10 #define NAMESPACE "heprep"
13 using namespace HEPREP;
21 XMLHepRepWriter::XMLHepRepWriter(ostream* os,
bool randomAccess,
bool useCompression)
23 compress(useCompression),
35 #ifndef CHEPREP_NO_ZLIB
39 cerr <<
"WARNING: the .gz output stream you are creating will be a plain file," << endl;
40 cerr <<
"since compression support (ZLIB) was not compiled into the library." << endl;
41 cerr <<
"To add ZLIB support, you need to undefine CHEPREP_NO_ZLIB." << endl;
64 map<string, string>::iterator i =
properties.begin();
66 *
zip << (*i).first <<
"=" << (*i).second << endl;
84 if (name.rfind(
".bheprep") == name.length()-8) {
92 xml->
setAttribute(
"xmlns", (
string)
"http://java.freehep.org/schemas/heprep/2.0");
93 xml->
setAttribute(
"xmlns",
"xsi",
"http://www.w3.org/2001/XMLSchema-instance");
94 xml->
setAttribute(
"xsi",
"schemaLocation",
"http://java.freehep.org/schemas/heprep/2.0 http://java.freehep.org/schemas/heprep/2.0/HepRep.xsd");
98 for (vector<HepRepTypeTree*>::iterator i1=typeTreeSet.begin(); i1 != typeTreeSet.end(); i1++) {
102 for (vector<HepRepInstanceTree*>::iterator i2=instanceTreeSet.begin(); i2 != instanceTreeSet.end(); i2++) {
118 string layerOrder =
"";
120 for (vector<string>::iterator i=layers.begin(); i != layers.end(); i++) {
122 layerOrder.append(
", ");
124 layerOrder.append(*i);
137 vector<HepRepType*> types = typeTree->
getTypeList();
138 for (vector<HepRepType*>::iterator i=types.begin(); i != types.end(); i++) {
153 for (vector<HepRepType*>::iterator i=types.begin(); i != types.end(); i++) {
183 for (vector<HepRepTreeID*>::iterator i1=instanceTreeSet.begin(); i1 != instanceTreeSet.end(); i1++) {
188 vector<HepRepInstance*> instanceList = instanceTree->
getInstances();
189 for (vector<HepRepInstance*>::iterator i2=instanceList.begin(); i2 != instanceList.end(); i2++) {
202 vector<HepRepPoint*> pointList = instance->
getPoints();
203 for (vector<HepRepPoint*>::iterator i1=pointList.begin(); i1 != pointList.end(); i1++) {
207 vector<HepRepInstance*> instanceList = instance->
getInstances();
208 for (vector<HepRepInstance*>::iterator i2=instanceList.begin(); i2 != instanceList.end(); i2++) {
233 if (layerAtt != NULL)
write(layerAtt);
236 for (set<HepRepAttValue*>::iterator i=attSet.begin(); i != attSet.end(); i++) {
244 for (set<HepRepAttDef*>::iterator i=list.begin(); i != list.end(); i++) {
271 if (attValue->
showLabel() != HepRepConstants::SHOW_NONE) {
cheprep::GZIPOutputStream * gz
virtual std::vector< HepRepInstanceTree * > getInstanceTreeList()=0
virtual std::vector< HepRepInstance * > getInstances()=0
virtual std::string getQualifier()=0
virtual std::string getAsString()=0
virtual std::string getFullName()=0
virtual std::string getName()=0
virtual int getInteger()=0
virtual HepRepTreeID * getTypeTree()=0
virtual std::string getDescription()=0
virtual HepRepAttValue * getAttValueFromNode(std::string lowerCaseName)=0
bool write(HEPREP::HepRep *heprep, std::string name)
virtual std::string getVersion()=0
virtual std::string getCategory()=0
virtual std::string getName()=0
virtual std::set< HepRepAttValue * > getAttValuesFromNode()=0
virtual std::vector< std::string > getLayerOrder()=0
virtual std::vector< HepRepTreeID * > getInstanceTreeList()=0
virtual void closeDoc(bool force=false)=0
virtual void openDoc(std::string version="1.0", std::string encoding="", bool standalone=false)=0
virtual std::string getExpression()=0
virtual void openTag(std::string ns, std::string name)=0
std::map< std::string, std::string > properties
virtual std::vector< HepRepPoint * > getPoints()=0
virtual std::vector< HepRepTypeTree * > getTypeTreeList()=0
const XML_Char int const XML_Char * value
virtual void closeTag()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual std::string getString()=0
virtual void printTag(std::string ns, std::string name)=0
virtual std::vector< HepRepInstance * > getInstances()=0
cheprep::ZipOutputStream * zip
virtual std::string getName()=0
virtual int64 getLong()=0
static MCTruthManager * instance
virtual std::set< HepRepAttDef * > getAttDefsFromNode()=0
virtual int showLabel()=0
virtual std::string getName()=0
virtual std::vector< double > getColor()=0
virtual HepRepType * getType()=0
virtual std::vector< HepRepType * > getTypeList()=0
void putNextEntry(const std::string &name, bool compress)
virtual std::string getName()=0
virtual double getDouble()=0
virtual std::string getExtra()=0
bool addProperty(std::string key, std::string value)
virtual std::vector< HepRepType * > getTypeList()=0
virtual bool getBoolean()=0