// $Id$ // // File: DDANAEVIO_factory.cc // Created: Mon Mar 15 09:08:37 EDT 2010 // Creator: wolin (on Linux stan.jlab.org 2.6.18-164.el5 x86_64) // // // // JANA factory plugin creates EVIO DOM tree from DANA objects // // // Implements the following JANA command-line parameters: // // EVIO:DANAEVIO specify which objects to add to DOM tree, see below for defaults // EVIO:DANADICT use custom XML tag/num dictionary instead of built-in version // EVIO:WRITEOUT default file writeout is true, to turn off use -PEVIO::WRITEOUT=0 // // // To specify which objects to add to EVIO tree: // // Use comma-separated, case-insensitive list (best not to included embedded whitespace) // Accepts "all", "none", "truth" and "hits", as well as individual DANA object names // Use prefix "-" to invert selection, "+" also accepted // // // Built-in dictionary can be found in dana_evio_dict.xml // // // // Elliott Wolin, 19-Jul-2010 // // // // n.b. to get factory pointer in event processor // // DDANAEVIO_factory *f = dynamic_cast(eventLoop->GetFactory("DDANAEVIODOMTree")); // if(f!=NULL) { ... } // // // // still to do: // enable associated objects in DTOFRawHit when JANA fixed // Add new objects when Paul M. is done // optimize multi-threading // add evio to external packages // lock when changing map #include #include #include #include using namespace std; // DANA objects processed by DANAEVIO static string danaObjs[] = { "dmctrackhit", "dbeamphoton", "dmcthrown", "dfcaltruthshower", "dbcaltruthshower", "dtoftruth", "dsctruthhit", "dmctrajectorypoint", "dcdchit", "dfdchit", "dfcalhit", "dtofrawhit", "dschit", "dtagmhit", "dtaghhit", "dtrackwirebased", "dtracktimebased", "dchargedtrack", "dphoton", "dcdctrackhit", "dfdcpseudo", "dvertex", "dtrackcandidate", "dbcalphoton", "dfcalphoton", "dchargedtruthmatch", "dtofrawhitmc", "dtofhit", "dtofpoint", "dbcalhit", "dbcalshower", "dfcalcluster", "dfdccathodecluster", "dfdcsegment", }; #include #include #include #include #include using namespace jana; #include "DANA/DApplication.h" #include "TRACKING/DMCThrown.h" #include "TRACKING/DMCTrackHit.h" #include "TRACKING/DTrackWireBased.h" #include "TRACKING/DTrackTimeBased.h" #include "TRACKING/DMCTrajectoryPoint.h" #include "TRACKING/DTrackCandidate.h" #include "FCAL/DFCALTruthShower.h" #include "FCAL/DFCALHit.h" #include "FCAL/DFCALPhoton.h" #include "FCAL/DFCALCluster.h" #include "BCAL/DBCALTruthShower.h" #include "BCAL/DBCALPhoton.h" #include "BCAL/DBCALGeometry.h" #include "BCAL/DBCALHit.h" #include "BCAL/DBCALShower.h" #include "TOF/DTOFTruth.h" #include "TOF/DTOFRawHit.h" #include "TOF/DTOFRawHitMC.h" #include "TOF/DTOFHit.h" #include "TOF/DTOFPoint.h" #include "CDC/DCDCHit.h" #include "FDC/DFDCHit.h" #include "FDC/DFDCCathodeCluster.h" #include "FDC/DFDCSegment.h" #include "PID/DBeamPhoton.h" #include "PID/DPhoton.h" #include "PID/DChargedTrack.h" #include "PID/DChargedTruthMatch.h" #include "START_COUNTER/DSCHit.h" #include "START_COUNTER/DSCTruthHit.h" #include "PID/DVertex.h" #include "TAGGER/DTAGMHit.h" #include "TAGGER/DTAGHHit.h" #include "SplitString.h" #include "evioFileChannel.hxx" #include "evioUtil.hxx" using namespace evio; // for DANAEVIO #include "danaevio/dana_evio_dict.h" #include "danaevio/DDANAEVIO_factory.h" // holds tag/num pairs for all DANA objects static map< string, pair > tagMap; // for one-time initialization static pthread_mutex_t initMutex = PTHREAD_MUTEX_INITIALIZER; //-------------------------------------------------------------------------------------- DDANAEVIO_factory::DDANAEVIO_factory() { static bool done_once_only = false; static string danaevio = ""; // initialize evio hash map (insert empty set into map for each danaObj) for(unsigned int i=0; i(); } // get mutex and initialize, some stuff done once-only pthread_mutex_lock(&initMutex); if(!done_once_only) { done_once_only=true; // get danaevio command line parameter gPARMS->SetDefaultParameter("EVIO:DANAEVIO",danaevio); // parse tag/num file (using EVIO:DANADICT parameter) our use default string to get tag/num pairs get_tagNum_dictionary(); // fill evioMap based on EVIO:DANAEVIO parameter setEVIOMap(danaevio); // print factory/tag selection flags map >::iterator iter1; set::iterator iter2; jout << endl << endl << endl << " DANA object output flags:" << endl << endl; for(iter1=evioMap.begin(); iter1!=evioMap.end(); iter1++) { jout << " " << setiosflags(ios::left) << setw(20) << iter1->first+":"; if(iter1->second.size()>0) { for(iter2=iter1->second.begin(); iter2!=iter1->second.end(); iter2++) { jout << setw(20) << string(((*iter2).size()>0)?(*iter2):("untagged")) << string(" "); } } else { jout << setw(20) << "(not selected)"; } jout << endl; } jout << endl << endl<< endl; } else { // just fill evioMap based on EVIO:DANAEVIO parameter setEVIOMap(danaevio); } pthread_mutex_unlock(&initMutex); } //---------------------------------------------------------------------------- void DDANAEVIO_factory::setEVIOMap(string danaevio) { // decodes danaevio string and fills map // parameters are comma-separated and case-insensitive // "-" means invert // "+" is ignored // also supported: "all", "none", "truth" "hits", "tracks" // otherwise parameter must be the name/tag of a DANA object that is processed by this program // append factory tag to object with ":" to specify tagged factory, e.g. "DBCALShower:myTag" // NOTE: factory tag names are case sensitive if(danaevio==NULL)return; if(danaevio.size()<=0)return; map< string, set >::iterator iter; vector params; SplitString(danaevio,params,","); for(unsigned int i=0; i paramsCS(params); // factory tags are Case Sensitive std::transform(params[i].begin(), params[i].end(), params[i].begin(), (int(*)(int)) tolower); bool plus=(params[i][0]=='+'); bool minus=(params[i][0]=='-'); string value = params[i].substr((plus||minus)?1:0); string valueCS = paramsCS[i].substr((plus||minus)?1:0); if(value=="all") { for(iter=evioMap.begin(); iter!=evioMap.end(); iter++) if(!minus) iter->second.insert(""); else iter->second.erase(""); } else if(value=="none") { for(iter=evioMap.begin(); iter!=evioMap.end(); iter++) if(minus) iter->second.insert(""); else iter->second.erase(""); } else if(value=="truth") { if(!minus) evioMap["dbeamphoton"].insert(""); else evioMap["dbeamphoton"].erase(""); if(!minus) evioMap["dmcthrown"].insert(""); else evioMap["dmcthrown"].erase(""); if(!minus) evioMap["dmctrackhit"].insert(""); else evioMap["dmctrackhit"].erase(""); if(!minus) evioMap["dfcaltruthshower"].insert(""); else evioMap["dfcaltruthshower"].erase(""); if(!minus) evioMap["dbcaltruthshower"].insert(""); else evioMap["dbcaltruthshower"].erase(""); if(!minus) evioMap["dtoftruth"].insert(""); else evioMap["dtoftruth"].erase(""); if(!minus) evioMap["dsctruth"].insert(""); else evioMap["dsctruth"].erase(""); if(!minus) evioMap["dtofrawhitmc"].insert(""); else evioMap["dtofrawhitmc"].erase(""); } else if(value=="hits") { if(!minus) evioMap["dcdchit"].insert(""); else evioMap["dcdchit"].erase(""); if(!minus) evioMap["dfdchit"].insert(""); else evioMap["dfdchit"].erase(""); if(!minus) evioMap["dfcalhit"].insert(""); else evioMap["dfcalhit"].erase(""); if(!minus) evioMap["dbcalhit"].insert(""); else evioMap["dbcalhit"].erase(""); if(!minus) evioMap["dschit"].insert(""); else evioMap["dschit"].erase(""); if(!minus) evioMap["dtofrawhit"].insert(""); else evioMap["dtofrawhit"].erase(""); } else if(value=="tracks") { if(!minus) evioMap["dtrackwirebased"].insert(""); else evioMap["dtrackwirebased"].erase(""); if(!minus) evioMap["dtracktimebased"].insert(""); else evioMap["dtracktimebased"].erase(""); if(!minus) evioMap["dchargedtrack"].insert(""); else evioMap["dchargedtrack"].erase(""); if(!minus) evioMap["dphoton"].insert(""); else evioMap["dphoton"].erase(""); if(!minus) evioMap["dcdctrackhit"].insert(""); else evioMap["dcdctrackhit"].erase(""); if(!minus) evioMap["dfdcpseudo"].insert(""); else evioMap["dfdcpseudo"].erase(""); } else { string::size_type colon = value.find(":"); string name = value; string tag = ""; if(colon!=string::npos) { name = value.substr(0,colon); tag = valueCS.substr(colon+1); } map< string, set >::iterator found = evioMap.find(name); if(found!=evioMap.end()) { if(!minus)found->second.insert(tag); else found->second.erase(tag); } else { jerr << endl << " ?unknown DANAEVIO parameter: " << params[i] << endl; } } } } //---------------------------------------------------------------------------- void DDANAEVIO_factory::get_tagNum_dictionary(void) { // init string parser XML_Parser xmlParser = XML_ParserCreate(NULL); XML_SetElementHandler(xmlParser,startElement,NULL); // set defaults by parsing internal string if(XML_Parse(xmlParser,dana_evio_dict_String.c_str(),dana_evio_dict_String.size(),true)!=0) { jout << endl << endl << " Successfully loaded default tag/num dictionary" << endl << endl << endl; } else { jerr << endl << endl << endl << " ?get_tagNum_dictionary...parse error for default string" << endl << endl << " " << XML_ErrorString(XML_GetErrorCode(xmlParser)) << endl << endl << endl; } XML_ParserFree(xmlParser); // parse user-supplied dictionary file if specified string danadict = ""; gPARMS->SetDefaultParameter("EVIO:DANADICT",danadict); if(danadict!="") { const int bufSize = 10000; char buf[bufSize]; // init file parser XML_Parser xmlParser2 = XML_ParserCreate(NULL); XML_SetElementHandler(xmlParser2,startElement,NULL); // open dictionary file FILE *f = fopen(danadict.c_str(),"r"); if(f!=NULL) { int status,len; bool done; do { len = fread(buf,1,bufSize,f); done = len!=bufSize; status=XML_Parse(xmlParser2,buf,len,done); if((!done)&&(status==0)) { jerr << endl << endl << endl << " ?read_custom_dictionary...parseXMLFile parse error for " << danadict << endl << endl << XML_ErrorString(XML_GetErrorCode(xmlParser2)) << endl << endl << endl; fclose(f); XML_ParserFree(xmlParser2); return; } } while (!done); fclose(f); } else { jerr << endl << endl << endl << " ?Unable to read custom tag/num dictionary: " << danadict << endl << endl << endl; XML_ParserFree(xmlParser2); return; } // successfully parsed dictionary file jout << endl << endl << " Using custom tag/num dictionary: " << danadict << endl << endl << endl; XML_ParserFree(xmlParser2); } } //---------------------------------------------------------------------------- void DDANAEVIO_factory::startElement(void *userData, const char *xmlname, const char **atts) { // only process dictionary entries if( (strcasecmp(xmlname,"xmldumpDictEntry")!=0) && (strcasecmp(xmlname,"evioDictEntry")!=0) && (strcasecmp(xmlname,"danaevioDictEntry")!=0) ) return; string name = ""; int tag = 0; int num = 0; for (int i=0; atts[i]; i+=2) { if(strcasecmp(atts[i],"name")==0) { name = string(atts[i+1]); } else if(strcasecmp(atts[i],"tag")==0) { tag = atoi(atts[i+1]); } else if(strcasecmp(atts[i],"num")==0) { num = atoi(atts[i+1]); } } // add pair to dictionary tagMap[name]=pair(tag,num); } //-------------------------------------------------------------------------- const map< string, pair > *DDANAEVIO_factory::getTagMapPointer() { return(&tagMap); } //-------------------------------------------------------------------------- jerror_t DDANAEVIO_factory::evnt(JEventLoop *loop, int eventnumber) { // clear global object id map objIdMap.clear(); // create single evio tree object and add to factory vector (may create more than one tree in the future) pair p = tagMap["DanaEvent"]; DDANAEVIODOMTree *myDDANAEVIODOMTree = new DDANAEVIODOMTree(p.first,p.second); _data.push_back(myDDANAEVIODOMTree); // add selected DANA banks to event tree if(evioMap["dmctrackhit" ].size()>0) addDMCTrackHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dbeamphoton" ].size()>0) addDBeamPhoton( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dmcthrown" ].size()>0) addDMCThrown( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dfcaltruthshower" ].size()>0) addDFCALTruthShower( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dbcaltruthshower" ].size()>0) addDBCALTruthShower( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtoftruth" ].size()>0) addDTOFTruth( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dsctruthhit" ].size()>0) addDSCTruthHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dmctrajectorypoint" ].size()>0) addDMCTrajectoryPoint( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dcdchit" ].size()>0) addDCDCHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dfdchit" ].size()>0) addDFDCHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dbcalhit" ].size()>0) addDBCALHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dfcalhit" ].size()>0) addDFCALHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtofrawhitmc" ].size()>0) addDTOFRawHitMC( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dschit" ].size()>0) addDSCHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtagmhit" ].size()>0) addDTAGMHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtaghhit" ].size()>0) addDTAGHHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dcdctrackhit" ].size()>0) addDCDCTrackHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dfdcpseudo" ].size()>0) addDFDCPseudo( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtrackwirebased" ].size()>0) addDTrackWireBased( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtracktimebased" ].size()>0) addDTrackTimeBased( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dchargedtrack" ].size()>0) addDChargedTrack( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dphoton" ].size()>0) addDPhoton( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dvertex" ].size()>0) addDVertex( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtrackcandidate" ].size()>0) addDTrackCandidate( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dbcalphoton" ].size()>0) addDBCALPhoton( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dfcalphoton" ].size()>0) addDFCALPhoton( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dchargedtruthmatch" ].size()>0) addDChargedTruthMatch( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtofrawhit" ].size()>0) addDTOFRawHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtofhit" ].size()>0) addDTOFHit( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dtofpoint" ].size()>0) addDTOFPoint( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dbcalshower" ].size()>0) addDBCALShower( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dfcalcluster" ].size()>0) addDFCALCluster( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dfdccathodecluster" ].size()>0) addDFDCCathodeCluster( eventLoop, myDDANAEVIODOMTree->tree); if(evioMap["dfdcsegment" ].size()>0) addDFDCSegment( eventLoop, myDDANAEVIODOMTree->tree); // if(evioMap["dtwogammafit" ].size()>0) addDTwoGammaFit( eventLoop, myDDANAEVIODOMTree->tree); // add global object id bank addObjIdBank(myDDANAEVIODOMTree->tree); return NOERROR; } //-------------------------------------------------------------------------------------- template evioDOMNodeP DDANAEVIO_factory::createLeafNode(string nameId) { pair p = tagMap[nameId];; return(evioDOMNode::createEvioDOMNode(p.first,p.second)); } //-------------------------------------------------------------------------------------- // might as well put this here... evioDOMNodeP DDANAEVIO_factory::createContainerNode(string nameId) { pair p = tagMap[nameId];; return(evioDOMNode::createEvioDOMNode(p.first,p.second)); } //-------------------------------------------------------------------------------------- void DDANAEVIO_factory::addObjIdBank(evioDOMTree &tree) { // create objIdBank and add to event tree evioDOMNodeP objIdBank = createContainerNode("objIdBank"); tree << objIdBank; // create data banks and add to objIdBank evioDOMNodeP idBank = createLeafNode ("objIdBank.id"); evioDOMNodeP nameTagBank = createLeafNode ("objIdBank.nameTag"); *objIdBank << idBank << nameTagBank; // add collected id's and name/tags to data banks map::iterator iter; for(iter=objIdMap.begin(); iter!=objIdMap.end(); iter++) { *idBank << iter->first; *nameTagBank << iter->second; } } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDMCThrown(JEventLoop *eventLoop, evioDOMTree &tree) { // create mcthrown bank and add to event tree evioDOMNodeP mcthrown = createContainerNode("DMCThrown"); tree << mcthrown; // create data banks and add to mcthrown evioDOMNodeP objIdBank = createLeafNode ("DMCThrown.objId"); evioDOMNodeP typeBank = createLeafNode ("DMCThrown.type"); evioDOMNodeP pdgtypeBank = createLeafNode ("DMCThrown.pdgtype"); evioDOMNodeP myidBank = createLeafNode ("DMCThrown.myid"); evioDOMNodeP parentidBank = createLeafNode ("DMCThrown.parentid"); evioDOMNodeP mechBank = createLeafNode ("DMCThrown.mech"); evioDOMNodeP xBank = createLeafNode ("DMCThrown.x"); evioDOMNodeP yBank = createLeafNode ("DMCThrown.y"); evioDOMNodeP zBank = createLeafNode ("DMCThrown.z"); evioDOMNodeP pxBank = createLeafNode ("DMCThrown.px"); evioDOMNodeP pyBank = createLeafNode ("DMCThrown.py"); evioDOMNodeP pzBank = createLeafNode ("DMCThrown.pz"); evioDOMNodeP energyBank = createLeafNode ("DMCThrown.energy"); *mcthrown << objIdBank << typeBank << pdgtypeBank << myidBank << parentidBank << mechBank << xBank << yBank << zBank << pxBank << pyBank << pzBank << energyBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DMCThrown.assocObjectBanks"); *mcthrown << assocBank; // loop over each requested factory, add data to banks int assocCount = 0; set::iterator iter; for(iter=evioMap["dmcthrown"].begin(); iter!=evioMap["dmcthrown"].end(); iter++) { vector mcthrowns; eventLoop->Get(mcthrowns,(*iter).c_str()); if(mcthrowns.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *typeBank << mcthrowns[i]->type; *pdgtypeBank << mcthrowns[i]->pdgtype; *myidBank << mcthrowns[i]->myid; *parentidBank << mcthrowns[i]->parentid; *mechBank << mcthrowns[i]->mech; DVector3 pos = mcthrowns[i]->position(); *xBank << pos.X(); *yBank << pos.Y(); *zBank << pos.Z(); DVector3 mom = mcthrowns[i]->momentum(); *pxBank << mom.X(); *pyBank << mom.Y(); *pzBank << mom.Z(); *energyBank << mcthrowns[i]->energy(); objIdMap[mcthrowns[i]->id]=mcthrowns[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DMCThrown.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; mcthrowns[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDMCTrackHit(JEventLoop *eventLoop, evioDOMTree &tree) { // create mctrackhit bank and add to event tree evioDOMNodeP mctrackhit = createContainerNode("DMCTrackHit"); tree << mctrackhit; // create data banks and add to mctrackhit bank evioDOMNodeP objIdBank = createLeafNode ("DMCTrackHit.objId"); evioDOMNodeP rBank = createLeafNode ("DMCTrackHit.r"); evioDOMNodeP phiBank = createLeafNode ("DMCTrackHit.phi"); evioDOMNodeP zBank = createLeafNode ("DMCTrackHit.z"); evioDOMNodeP trackBank = createLeafNode ("DMCTrackHit.track"); evioDOMNodeP primaryBank = createLeafNode ("DMCTrackHit.primary"); evioDOMNodeP ptypeBank = createLeafNode ("DMCTrackHit.ptype"); evioDOMNodeP systemBank = createLeafNode ("DMCTrackHit.system"); *mctrackhit << objIdBank << rBank << phiBank << zBank << trackBank << primaryBank << ptypeBank << systemBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DMCTrackHit.assocObjectBanks"); *mctrackhit << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dmctrackhit"].begin(); iter!=evioMap["dmctrackhit"].end(); iter++) { // is there any data vector mctrackhits; eventLoop->Get(mctrackhits,(*iter).c_str()); if(mctrackhits.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *rBank << mctrackhits[i]->r; *phiBank << mctrackhits[i]->phi; *zBank << mctrackhits[i]->z; *trackBank << mctrackhits[i]->track; *primaryBank << mctrackhits[i]->primary; *ptypeBank << mctrackhits[i]->ptype; *systemBank << mctrackhits[i]->system; objIdMap[mctrackhits[i]->id]=mctrackhits[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DMCTrackHit.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; mctrackhits[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTOFTruth(JEventLoop *eventLoop, evioDOMTree &tree) { // create toftruth bank and add to event tree evioDOMNodeP toftruth = createContainerNode("DTOFTruth"); tree << toftruth; // create data banks and add to toftruth bank evioDOMNodeP objIdBank = createLeafNode ("DTOFTruth.objId"); evioDOMNodeP trackBank = createLeafNode ("DTOFTruth.track"); evioDOMNodeP primaryBank = createLeafNode ("DTOFTruth.primary"); evioDOMNodeP xBank = createLeafNode ("DTOFTruth.x"); evioDOMNodeP yBank = createLeafNode ("DTOFTruth.y"); evioDOMNodeP zBank = createLeafNode ("DTOFTruth.z"); evioDOMNodeP pxBank = createLeafNode ("DTOFTruth.px"); evioDOMNodeP pyBank = createLeafNode ("DTOFTruth.py"); evioDOMNodeP pzBank = createLeafNode ("DTOFTruth.pz"); evioDOMNodeP tBank = createLeafNode ("DTOFTruth.t"); evioDOMNodeP EBank = createLeafNode ("DTOFTruth.E"); evioDOMNodeP ptypeBank = createLeafNode ("DTOFTruth.ptype"); *toftruth << objIdBank << trackBank << primaryBank << xBank << yBank << zBank << pxBank << pyBank << pzBank << tBank << EBank << ptypeBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DTOFTruth.assocObjectBanks"); *toftruth << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dtoftruth"].begin(); iter!=evioMap["dtoftruth"].end(); iter++) { // is there any data vector toftruths; eventLoop->Get(toftruths,(*iter).c_str()); if(toftruths.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *trackBank << toftruths[i]->track; *primaryBank << toftruths[i]->primary; *xBank << toftruths[i]->x; *yBank << toftruths[i]->y; *zBank << toftruths[i]->z; *pxBank << toftruths[i]->px; *pyBank << toftruths[i]->py; *pzBank << toftruths[i]->pz; *tBank << toftruths[i]->t; *EBank << toftruths[i]->E; *ptypeBank << toftruths[i]->ptype; objIdMap[toftruths[i]->id]=toftruths[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DTOFTruth.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; toftruths[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDFCALTruthShower(JEventLoop *eventLoop, evioDOMTree &tree) { // create fcaltruthshower bank and add to event tree evioDOMNodeP fcaltruthshower = createContainerNode("DFCALTruthShower"); tree << fcaltruthshower; // create data banks and add to fcaltruthshower evioDOMNodeP objIdBank = createLeafNode ("DFCALTruthShower.objId"); evioDOMNodeP xBank = createLeafNode ("DFCALTruthShower.x"); evioDOMNodeP yBank = createLeafNode ("DFCALTruthShower.y"); evioDOMNodeP zBank = createLeafNode ("DFCALTruthShower.z"); evioDOMNodeP tBank = createLeafNode ("DFCALTruthShower.t"); evioDOMNodeP pxBank = createLeafNode ("DFCALTruthShower.px"); evioDOMNodeP pyBank = createLeafNode ("DFCALTruthShower.py"); evioDOMNodeP pzBank = createLeafNode ("DFCALTruthShower.pz"); evioDOMNodeP EBank = createLeafNode ("DFCALTruthShower.E"); evioDOMNodeP primaryBank = createLeafNode ("DFCALTruthShower.primary"); evioDOMNodeP trackBank = createLeafNode ("DFCALTruthShower.track"); evioDOMNodeP typeBank = createLeafNode ("DFCALTruthShower.type"); *fcaltruthshower << objIdBank << xBank << yBank << zBank << tBank << pxBank << pyBank<< pzBank << EBank << primaryBank<< trackBank<< typeBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DFCALTruthShower.assocObjectBanks"); *fcaltruthshower<< assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dfcaltruthshower"].begin(); iter!=evioMap["dfcaltruthshower"].end(); iter++) { // is there any data vector fcaltruthshowers; eventLoop->Get(fcaltruthshowers,(*iter).c_str()); if(fcaltruthshowers.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *xBank << fcaltruthshowers[i]->x(); *yBank << fcaltruthshowers[i]->y(); *zBank << fcaltruthshowers[i]->z(); *tBank << fcaltruthshowers[i]->t(); *pxBank << fcaltruthshowers[i]->px(); *pyBank << fcaltruthshowers[i]->py(); *pzBank << fcaltruthshowers[i]->pz(); *EBank << fcaltruthshowers[i]->E(); *primaryBank << fcaltruthshowers[i]->primary(); *trackBank << fcaltruthshowers[i]->track(); *typeBank << fcaltruthshowers[i]->type(); objIdMap[fcaltruthshowers[i]->id]=fcaltruthshowers[i]->GetNameTag(); // associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DFCALTruthShower.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; fcaltruthshowers[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDBCALTruthShower(JEventLoop *eventLoop, evioDOMTree &tree) { // create bcaltruthshower bank and add to event tree evioDOMNodeP bcaltruthshower = createContainerNode("DBCALTruthShower"); tree << bcaltruthshower; // create data banks and add to bcaltruthshower evioDOMNodeP objIdBank = createLeafNode ("DBCALTruthShower.objId"); evioDOMNodeP trackBank = createLeafNode ("DBCALTruthShower.track"); evioDOMNodeP primaryBank = createLeafNode ("DBCALTruthShower.primary"); evioDOMNodeP phiBank = createLeafNode ("DBCALTruthShower.phi"); evioDOMNodeP rBank = createLeafNode ("DBCALTruthShower.r"); evioDOMNodeP zBank = createLeafNode ("DBCALTruthShower.z"); evioDOMNodeP tBank = createLeafNode ("DBCALTruthShower.t"); evioDOMNodeP EBank = createLeafNode ("DBCALTruthShower.E"); *bcaltruthshower << objIdBank << trackBank << primaryBank << phiBank << rBank << zBank << tBank << EBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DBCALTruthShower.assocObjectBanks"); *bcaltruthshower<< assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dbcaltruthshower"].begin(); iter!=evioMap["dbcaltruthshower"].end(); iter++) { // is there any data vector bcaltruthshowers; eventLoop->Get(bcaltruthshowers,(*iter).c_str()); if(bcaltruthshowers.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *trackBank << bcaltruthshowers[i]->track; *primaryBank << bcaltruthshowers[i]->primary; *phiBank << bcaltruthshowers[i]->phi; *rBank << bcaltruthshowers[i]->r; *zBank << bcaltruthshowers[i]->z; *tBank << bcaltruthshowers[i]->t; *EBank << bcaltruthshowers[i]->E; objIdMap[bcaltruthshowers[i]->id]=bcaltruthshowers[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DBCALTruthShower.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; bcaltruthshowers[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDCDCHit(JEventLoop *eventLoop, evioDOMTree &tree) { // create cdchit bank and add to event tree evioDOMNodeP cdchit = createContainerNode("DCDCHit"); tree << cdchit; // create data banks and add to cdchit bank evioDOMNodeP objIdBank = createLeafNode ("DCDCHit.objId"); evioDOMNodeP ringBank = createLeafNode ("DCDCHit.ring"); evioDOMNodeP strawBank = createLeafNode ("DCDCHit.straw"); evioDOMNodeP dEBank = createLeafNode ("DCDCHit.dE"); evioDOMNodeP tBank = createLeafNode ("DCDCHit.t"); *cdchit << objIdBank << ringBank << strawBank << dEBank << tBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DCDCHit.assocObjectBanks"); *cdchit << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dcdchit"].begin(); iter!=evioMap["dcdchit"].end(); iter++) { // is there any data vector cdchits; eventLoop->Get(cdchits,(*iter).c_str()); if(cdchits.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *ringBank << cdchits[i]->ring; *strawBank << cdchits[i]->straw; *dEBank << cdchits[i]->dE; *tBank << cdchits[i]->t; objIdMap[cdchits[i]->id]=cdchits[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DCDCHit.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; cdchits[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDMCTrajectoryPoint(JEventLoop *eventLoop, evioDOMTree &tree) { // create bank and add to event tree evioDOMNodeP mctrajectorypoint = createContainerNode("DMCTrajectoryPoint"); tree << mctrajectorypoint; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode ("DMCTrajectoryPoint.objId"); evioDOMNodeP xBank = createLeafNode ("DMCTrajectoryPoint.x"); evioDOMNodeP yBank = createLeafNode ("DMCTrajectoryPoint.y"); evioDOMNodeP zBank = createLeafNode ("DMCTrajectoryPoint.z"); evioDOMNodeP pxBank = createLeafNode ("DMCTrajectoryPoint.px"); evioDOMNodeP pyBank = createLeafNode ("DMCTrajectoryPoint.py"); evioDOMNodeP pzBank = createLeafNode ("DMCTrajectoryPoint.pz"); evioDOMNodeP EBank = createLeafNode ("DMCTrajectoryPoint.E"); evioDOMNodeP dEBank = createLeafNode ("DMCTrajectoryPoint.dE"); evioDOMNodeP primary_trackBank = createLeafNode ("DMCTrajectoryPoint.primary_track"); evioDOMNodeP trackBank = createLeafNode ("DMCTrajectoryPoint.track"); evioDOMNodeP partBank = createLeafNode ("DMCTrajectoryPoint.part"); evioDOMNodeP radlenBank = createLeafNode ("DMCTrajectoryPoint.radlen"); evioDOMNodeP stepBank = createLeafNode ("DMCTrajectoryPoint.step"); evioDOMNodeP mechBank = createLeafNode ("DMCTrajectoryPoint.mech"); *mctrajectorypoint << objIdBank << xBank << yBank << zBank << pxBank << pyBank << pzBank << EBank << dEBank << primary_trackBank << trackBank << partBank << radlenBank << stepBank << mechBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DMCTrajectoryPoint.assocObjectBanks"); *mctrajectorypoint << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dmctrajectorypoint"].begin(); iter!=evioMap["dmctrajectorypoint"].end(); iter++) { // is there any data vector mctrajectorypoints; eventLoop->Get(mctrajectorypoints,(*iter).c_str()); if(mctrajectorypoints.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *xBank << mctrajectorypoints[i]->x; *yBank << mctrajectorypoints[i]->y; *zBank << mctrajectorypoints[i]->z; *pxBank << mctrajectorypoints[i]->px; *pyBank << mctrajectorypoints[i]->py; *pzBank << mctrajectorypoints[i]->pz; *EBank << mctrajectorypoints[i]->E; *dEBank << mctrajectorypoints[i]->dE; *primary_trackBank << mctrajectorypoints[i]->primary_track; *trackBank << mctrajectorypoints[i]->track; *partBank << mctrajectorypoints[i]->part; *radlenBank << mctrajectorypoints[i]->radlen; *stepBank << mctrajectorypoints[i]->step; *mechBank << mctrajectorypoints[i]->mech; objIdMap[mctrajectorypoints[i]->id]=mctrajectorypoints[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DMCTrajectoryPoint.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; mctrajectorypoints[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDFDCHit(JEventLoop *eventLoop, evioDOMTree &tree) { // create fdchit bank and add to event tree evioDOMNodeP fdchit = createContainerNode("DFDCHit"); tree << fdchit; // create data banks and add to fdchit bank evioDOMNodeP objIdBank = createLeafNode ("DFDCHit.objId"); evioDOMNodeP layerBank = createLeafNode ("DFDCHit.layer"); evioDOMNodeP moduleBank = createLeafNode ("DFDCHit.module"); evioDOMNodeP elementBank = createLeafNode ("DFDCHit.element"); evioDOMNodeP planeBank = createLeafNode ("DFDCHit.plane"); evioDOMNodeP gPlaneBank = createLeafNode ("DFDCHit.gPlane"); evioDOMNodeP gLayerBank = createLeafNode ("DFDCHit.gLayer"); evioDOMNodeP qBank = createLeafNode ("DFDCHit.q"); evioDOMNodeP tBank = createLeafNode ("DFDCHit.t"); evioDOMNodeP rBank = createLeafNode ("DFDCHit.r"); evioDOMNodeP typeBank = createLeafNode ("DFDCHit.type"); *fdchit << objIdBank << layerBank << moduleBank << elementBank << planeBank << gPlaneBank << gLayerBank << qBank << tBank << rBank << typeBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DFDCHits.assocObjectBanks"); *fdchit << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dfdchit"].begin(); iter!=evioMap["dfdchit"].end(); iter++) { // is there any data vector fdchits; eventLoop->Get(fdchits,(*iter).c_str()); if(fdchits.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *layerBank << fdchits[i]->layer; *moduleBank << fdchits[i]->module; *elementBank << fdchits[i]->element; *planeBank << fdchits[i]->plane; *gPlaneBank << fdchits[i]->gPlane; *gLayerBank << fdchits[i]->gLayer; *qBank << fdchits[i]->q; *tBank << fdchits[i]->t; *rBank << fdchits[i]->r; *typeBank << fdchits[i]->type; objIdMap[fdchits[i]->id]=fdchits[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DFDCHits.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; fdchits[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //---------------------------------------------------------------------------- void DDANAEVIO_factory::addDBeamPhoton(JEventLoop *eventLoop, evioDOMTree &tree) { // create bank and add to event tree evioDOMNodeP beamphoton = createContainerNode("DBeamPhoton"); tree << beamphoton; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode ("DBeamPhoton.objId"); evioDOMNodeP xBank = createLeafNode ("DBeamPhoton.x"); evioDOMNodeP yBank = createLeafNode ("DBeamPhoton.y"); evioDOMNodeP zBank = createLeafNode ("DBeamPhoton.z"); evioDOMNodeP pxBank = createLeafNode ("DBeamPhoton.px"); evioDOMNodeP pyBank = createLeafNode ("DBeamPhoton.py"); evioDOMNodeP pzBank = createLeafNode ("DBeamPhoton.pz"); evioDOMNodeP tBank = createLeafNode ("DBeamPhoton.t"); *beamphoton << objIdBank << xBank<< yBank<< zBank<< pxBank<< pyBank<< pzBank << tBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DBeamPhoton.assocObjectBanks"); *beamphoton << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dbeamphoton"].begin(); iter!=evioMap["dbeamphoton"].end(); iter++) { // is there any data vector beamphotons; eventLoop->Get(beamphotons,(*iter).c_str()); if(beamphotons.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; DVector3 pos = beamphotons[i]->position(); *xBank << pos.X(); *yBank << pos.Y(); *zBank << pos.Z(); DVector3 mom = beamphotons[i]->momentum(); *pxBank << mom.X(); *pyBank << mom.Y(); *pzBank << mom.Z(); *tBank << beamphotons[i]->t; objIdMap[beamphotons[i]->id]=beamphotons[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DBeamPhoton.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; beamphotons[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDSCTruthHit(JEventLoop *eventLoop, evioDOMTree &tree) { // create bank and add to event tree evioDOMNodeP sctruthhit = createContainerNode("DSCTruthHit"); tree << sctruthhit; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode ("DSCTruthHit.objId"); evioDOMNodeP dEdxBank = createLeafNode ("DSCTruthHit.dEdx"); evioDOMNodeP primaryBank = createLeafNode ("DSCTruthHit.primary"); evioDOMNodeP trackBank = createLeafNode ("DSCTruthHit.track"); evioDOMNodeP ptypeBank = createLeafNode ("DSCTruthHit.ptype"); evioDOMNodeP rBank = createLeafNode ("DSCTruthHit.r"); evioDOMNodeP phiBank = createLeafNode ("DSCTruthHit.phi"); evioDOMNodeP zBank = createLeafNode ("DSCTruthHit.z"); evioDOMNodeP tBank = createLeafNode ("DSCTruthHit.t"); evioDOMNodeP sectorBank = createLeafNode ("DSCTruthHit.sector"); *sctruthhit << objIdBank << dEdxBank << primaryBank << trackBank << ptypeBank << rBank << phiBank << zBank << tBank << sectorBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DSCTruthHit.assocObjectBanks"); *sctruthhit << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dsctruthhit"].begin(); iter!=evioMap["dsctruthhit"].end(); iter++) { // is there any data vector sctruthhits; eventLoop->Get(sctruthhits,(*iter).c_str()); if(sctruthhits.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *dEdxBank << sctruthhits[i]->dEdx; *primaryBank << (int8_t)sctruthhits[i]->primary; *trackBank << sctruthhits[i]->track; *ptypeBank << sctruthhits[i]->ptype; *rBank << sctruthhits[i]->r; *phiBank << sctruthhits[i]->phi; *zBank << sctruthhits[i]->z; *tBank << sctruthhits[i]->t; *sectorBank << sctruthhits[i]->sector; objIdMap[sctruthhits[i]->id]=sctruthhits[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DSCTruthHit.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; sctruthhits[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDFCALHit(JEventLoop *eventLoop, evioDOMTree &tree) { // create bank and add to event tree evioDOMNodeP fcalhit = createContainerNode("DFCALHit"); tree << fcalhit; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode ("DFCALHit.objId"); evioDOMNodeP rowBank = createLeafNode ("DFCALHit.row"); evioDOMNodeP columnBank = createLeafNode ("DFCALHit.column"); evioDOMNodeP xBank = createLeafNode ("DFCALHit.x"); evioDOMNodeP yBank = createLeafNode ("DFCALHit.y"); evioDOMNodeP EBank = createLeafNode ("DFCALHit.E"); evioDOMNodeP tBank = createLeafNode ("DFCALHit.t"); *fcalhit << objIdBank << rowBank << columnBank << xBank << yBank << EBank << tBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DFCALHit.assocObjectBanks"); *fcalhit << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dfcalhit"].begin(); iter!=evioMap["dfcalhit"].end(); iter++) { // is there any data vector fcalhits; eventLoop->Get(fcalhits,(*iter).c_str()); if(fcalhits.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *rowBank << fcalhits[i]->row; *columnBank << fcalhits[i]->column; *xBank << fcalhits[i]->x; *yBank << fcalhits[i]->y; *EBank << fcalhits[i]->E; *tBank << fcalhits[i]->t; objIdMap[fcalhits[i]->id]=fcalhits[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DFCALHit.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; fcalhits[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDSCHit(JEventLoop *eventLoop, evioDOMTree &tree) { // create bank and add to event tree evioDOMNodeP schit = createContainerNode("DSCHit"); tree << schit; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode ("DSCHit.objId"); evioDOMNodeP dEBank = createLeafNode ("DSCHit.dE"); evioDOMNodeP tBank = createLeafNode ("DSCHit.t"); evioDOMNodeP sectorBank = createLeafNode ("DSCHit.sector"); *schit << objIdBank << dEBank << tBank << sectorBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DSCHit.assocObjectBanks"); *schit << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dschit"].begin(); iter!=evioMap["dschit"].end(); iter++) { // is there any data vector schits; eventLoop->Get(schits,(*iter).c_str()); if(schits.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *dEBank << schits[i]->dE; *tBank << schits[i]->t; *sectorBank << schits[i]->sector; objIdMap[schits[i]->id]=schits[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DSCHit.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; schits[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTrackWireBased(JEventLoop *eventLoop, evioDOMTree &tree) { // create wirebasedtrack bank and add to event tree evioDOMNodeP wirebasedtrack = createContainerNode("DTrackWireBased"); tree << wirebasedtrack; // create data banks and add to bank (n.b. time based track has FOM, wire based doesn't) evioDOMNodeP objIdBank = createLeafNode ("DTrackWireBased.objId"); evioDOMNodeP chisqBank = createLeafNode ("DTrackWireBased.chisq"); evioDOMNodeP NdofBank = createLeafNode ("DTrackWireBased.Ndof"); evioDOMNodeP xBank = createLeafNode ("DTrackWireBased.x"); evioDOMNodeP yBank = createLeafNode ("DTrackWireBased.y"); evioDOMNodeP zBank = createLeafNode ("DTrackWireBased.z"); evioDOMNodeP pxBank = createLeafNode ("DTrackWireBased.px"); evioDOMNodeP pyBank = createLeafNode ("DTrackWireBased.py"); evioDOMNodeP pzBank = createLeafNode ("DTrackWireBased.pz"); evioDOMNodeP qBank = createLeafNode ("DTrackWireBased.q"); evioDOMNodeP EBank = createLeafNode ("DTrackWireBased.E"); evioDOMNodeP massBank = createLeafNode ("DTrackWireBased.mass"); *wirebasedtrack << objIdBank << chisqBank << NdofBank << xBank << yBank << zBank << pxBank << pyBank << pzBank << qBank << EBank << massBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DTrackWireBased.assocObjectBanks"); *wirebasedtrack<< assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dtrackwirebased"].begin(); iter!=evioMap["dtrackwirebased"].end(); iter++) { // is there any data vector wirebasedtracks; eventLoop->Get(wirebasedtracks,(*iter).c_str()); if(wirebasedtracks.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *chisqBank << wirebasedtracks[i]->chisq; *NdofBank << wirebasedtracks[i]->Ndof; *xBank << wirebasedtracks[i]->x(); *yBank << wirebasedtracks[i]->y(); *zBank << wirebasedtracks[i]->z(); *pxBank << wirebasedtracks[i]->px(); *pyBank << wirebasedtracks[i]->py(); *pzBank << wirebasedtracks[i]->pz(); *qBank << wirebasedtracks[i]->charge(); *EBank << wirebasedtracks[i]->energy(); *massBank << wirebasedtracks[i]->mass(); objIdMap[wirebasedtracks[i]->id]=wirebasedtracks[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DTrackWireBased.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; wirebasedtracks[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTrackTimeBased(JEventLoop *eventLoop, evioDOMTree &tree) { // create timebasedtrack bank and add to event tree evioDOMNodeP timebasedtrack = createContainerNode("DTrackTimeBased"); tree << timebasedtrack; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode ("DTrackTimeBased.objId"); evioDOMNodeP chisqBank = createLeafNode ("DTrackTimeBased.chisq"); evioDOMNodeP NdofBank = createLeafNode ("DTrackTimeBased.Ndof"); evioDOMNodeP FOMBank = createLeafNode ("DTrackTimeBased.FOM"); evioDOMNodeP xBank = createLeafNode ("DTrackTimeBased.x"); evioDOMNodeP yBank = createLeafNode ("DTrackTimeBased.y"); evioDOMNodeP zBank = createLeafNode ("DTrackTimeBased.z"); evioDOMNodeP pxBank = createLeafNode ("DTrackTimeBased.px"); evioDOMNodeP pyBank = createLeafNode ("DTrackTimeBased.py"); evioDOMNodeP pzBank = createLeafNode ("DTrackTimeBased.pz"); evioDOMNodeP qBank = createLeafNode ("DTrackTimeBased.q"); evioDOMNodeP EBank = createLeafNode ("DTrackTimeBased.E"); evioDOMNodeP massBank = createLeafNode ("DTrackTimeBased.mass"); evioDOMNodeP t0Bank = createLeafNode ("DTrackTimeBased.t0"); *timebasedtrack << objIdBank << chisqBank << NdofBank << FOMBank << xBank << yBank << zBank << pxBank << pyBank << pzBank << qBank << EBank << massBank << t0Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DTrackTimeBased.assocObjectBanks"); *timebasedtrack << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dtracktimebased"].begin(); iter!=evioMap["dtracktimebased"].end(); iter++) { // is there any data vector timebasedtracks; eventLoop->Get(timebasedtracks,(*iter).c_str()); if(timebasedtracks.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *chisqBank << timebasedtracks[i]->chisq; *NdofBank << timebasedtracks[i]->Ndof; *FOMBank << timebasedtracks[i]->FOM; *xBank << timebasedtracks[i]->x(); *yBank << timebasedtracks[i]->y(); *zBank << timebasedtracks[i]->z(); *pxBank << timebasedtracks[i]->px(); *pyBank << timebasedtracks[i]->py(); *pzBank << timebasedtracks[i]->pz(); *qBank << timebasedtracks[i]->charge(); *EBank << timebasedtracks[i]->energy(); *massBank << timebasedtracks[i]->mass(); *t0Bank << timebasedtracks[i]->t0(); objIdMap[timebasedtracks[i]->id]=timebasedtracks[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DTrackTimeBased.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; timebasedtracks[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDChargedTrack(JEventLoop *eventLoop, evioDOMTree &tree) { // create chargedtrack bank and add to event tree evioDOMNodeP chargedtrack = createContainerNode("DChargedTrack"); tree << chargedtrack; // create data banks and add to chargedtrack bank evioDOMNodeP objIdBank = createLeafNode ("DChargedTrack.objId"); evioDOMNodeP hypothesisBank = createContainerNode ("DChargedTrack.hypothesisBanks"); *chargedtrack << objIdBank << hypothesisBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DChargedTrack.assocObjectBanks"); *chargedtrack << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dchargedtrack"].begin(); iter!=evioMap["dchargedtrack"].end(); iter++) { // is there any data vector chargedtracks; eventLoop->Get(chargedtracks,(*iter).c_str()); if(chargedtracks.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; // create id bank for each charged track and add to hypotheses bank evioDOMNodeP hypotheses = createLeafNode ("DChargedTrack.hypotheses"); *hypothesisBank << hypotheses; for(unsigned int j=0; jhypotheses.size(); j++) { *hypotheses << chargedtracks[i]->hypotheses[j]->id; } objIdMap[chargedtracks[i]->id]=chargedtracks[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DChargedTrack.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; chargedtracks[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDPhoton(JEventLoop *eventLoop, evioDOMTree &tree) { // create photon bank and add to event tree evioDOMNodeP photon = createContainerNode("DPhoton"); tree << photon; // create data banks and add to photon bank evioDOMNodeP objIdBank = createLeafNode ("DPhoton.objId"); evioDOMNodeP EBank = createLeafNode ("DPhoton.E"); evioDOMNodeP pxBank = createLeafNode ("DPhoton.px"); evioDOMNodeP pyBank = createLeafNode ("DPhoton.py"); evioDOMNodeP pzBank = createLeafNode ("DPhoton.pz"); evioDOMNodeP xBank = createLeafNode ("DPhoton.x"); evioDOMNodeP yBank = createLeafNode ("DPhoton.y"); evioDOMNodeP zBank = createLeafNode ("DPhoton.z"); evioDOMNodeP tBank = createLeafNode ("DPhoton.t"); evioDOMNodeP TagBank = createLeafNode ("DPhoton.Tag"); *photon << objIdBank << EBank << pxBank << pyBank << pzBank << xBank << yBank << zBank << tBank << TagBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DPhoton.assocObjectBanks"); *photon << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dphoton"].begin(); iter!=evioMap["dphoton"].end(); iter++) { // is there any data vector photons; eventLoop->Get(photons),(*iter).c_str(); if(photons.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *EBank << photons[i]->energy(); *pxBank << photons[i]->px(); *pyBank << photons[i]->py(); *pzBank << photons[i]->pz(); *xBank << photons[i]->x(); *yBank << photons[i]->y(); *zBank << photons[i]->z(); *tBank << photons[i]->getTime(); *TagBank << photons[i]->getTag(); objIdMap[photons[i]->id]=photons[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DPhoton.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; photons[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDCDCTrackHit(JEventLoop *eventLoop, evioDOMTree &tree) { // create cdctrackhit bank and add to event tree evioDOMNodeP cdctrackhit = createContainerNode("DCDCTrackHit"); tree << cdctrackhit; // create data banks and add to cdctrackhit bank evioDOMNodeP objIdBank = createLeafNode ("DCDCTrackHit.objId"); evioDOMNodeP ringBank = createLeafNode ("DCDCTrackHit.ring"); evioDOMNodeP strawBank = createLeafNode ("DCDCTrackHit.straw"); evioDOMNodeP xBank = createLeafNode ("DCDCTrackHit.x"); evioDOMNodeP yBank = createLeafNode ("DCDCTrackHit.y"); evioDOMNodeP stereoBank = createLeafNode ("DCDCTrackHit.stereo"); evioDOMNodeP tdriftBank = createLeafNode ("DCDCTrackHit.tdrift"); evioDOMNodeP distBank = createLeafNode ("DCDCTrackHit.dist"); evioDOMNodeP dEBank = createLeafNode ("DCDCTrackHit.dE"); *cdctrackhit << objIdBank << ringBank << strawBank << xBank << yBank << stereoBank << tdriftBank << distBank << dEBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DCDCTrackHit.assocObjectBanks"); *cdctrackhit << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dcdctrackhit"].begin(); iter!=evioMap["dcdctrackhit"].end(); iter++) { // is there any data vector cdctrackhits; eventLoop->Get(cdctrackhits,(*iter).c_str()); if(cdctrackhits.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *ringBank << cdctrackhits[i]->wire->ring; *strawBank << cdctrackhits[i]->wire->straw; *xBank << cdctrackhits[i]->wire->origin.x(); *yBank << cdctrackhits[i]->wire->origin.y(); *stereoBank << cdctrackhits[i]->wire->stereo; *tdriftBank << cdctrackhits[i]->tdrift; *distBank << cdctrackhits[i]->dist; *dEBank << cdctrackhits[i]->dE; objIdMap[cdctrackhits[i]->id]=cdctrackhits[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DCDCTrackHit.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; cdctrackhits[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDFDCPseudo(JEventLoop *eventLoop, evioDOMTree &tree) { // create fdcpseudo bank and add to event tree evioDOMNodeP fdcpseudo = createContainerNode("DFDCPseudo"); tree << fdcpseudo; // create data banks and add to fdcpseudo bank evioDOMNodeP objIdBank = createLeafNode ("DFDCPseudo.objId"); evioDOMNodeP uBank = createLeafNode ("DFDCPseudo.u"); evioDOMNodeP vBank = createLeafNode ("DFDCPseudo.v"); evioDOMNodeP wBank = createLeafNode ("DFDCPseudo.w"); evioDOMNodeP sBank = createLeafNode ("DFDCPseudo.s"); evioDOMNodeP layerBank = createLeafNode ("DFDCPseudo.layer"); evioDOMNodeP wireBank = createLeafNode ("DFDCPseudo.wire"); evioDOMNodeP timeBank = createLeafNode ("DFDCPseudo.time"); evioDOMNodeP statusBank = createLeafNode ("DFDCPseudo.status"); evioDOMNodeP xBank = createLeafNode ("DFDCPseudo.x"); evioDOMNodeP yBank = createLeafNode ("DFDCPseudo.y"); evioDOMNodeP dEBank = createLeafNode ("DFDCPseudo.dE"); *fdcpseudo << objIdBank << uBank<< vBank << wBank << sBank << layerBank << wireBank << timeBank << statusBank << xBank << yBank << dEBank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode("DFDCPseudo.assocObjectBanks"); *fdcpseudo << assocBank; // loop over each requested factory int assocCount = 0; set::iterator iter; for(iter=evioMap["dfdcpseudo"].begin(); iter!=evioMap["dfdcpseudo"].end(); iter++) { // is there any data vector fdcpseudos; eventLoop->Get(fdcpseudos,(*iter).c_str()); if(fdcpseudos.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *uBank << fdcpseudos[i]->u; *vBank << fdcpseudos[i]->v; *wBank << fdcpseudos[i]->w; *sBank << fdcpseudos[i]->s; *layerBank << fdcpseudos[i]->wire->layer; *wireBank << fdcpseudos[i]->wire->wire; *timeBank << fdcpseudos[i]->time; *statusBank << fdcpseudos[i]->status; *xBank << fdcpseudos[i]->xy.X(); *yBank << fdcpseudos[i]->xy.Y(); *dEBank << fdcpseudos[i]->dE; objIdMap[fdcpseudos[i]->id]=fdcpseudos[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode ("DFDCPseudo.assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; fdcpseudos[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //---------------------------------------------------------------------------- void DDANAEVIO_factory::addDVertex(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DVertex"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".x"); evioDOMNodeP var2Bank = createLeafNode (objName+".y"); evioDOMNodeP var3Bank = createLeafNode (objName+".z"); evioDOMNodeP var4Bank = createLeafNode (objName+".t"); evioDOMNodeP var5Bank = createLeafNode (objName+".beamline_used"); evioDOMNodeP var6Bank = createLeafNode (objName+".Ntracks"); evioDOMNodeP var7Bank = createLeafNode (objName+".Nphotons"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank << var6Bank << var7Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->x.X(); *var2Bank << dataObjects[i]->x.Y(); *var3Bank << dataObjects[i]->x.Z(); *var4Bank << dataObjects[i]->x.T(); *var5Bank << dataObjects[i]->beamline_used; vector trks; dataObjects[i]->Get(trks); *var6Bank << trks.size(); vector showers; dataObjects[i]->Get(showers); *var7Bank << showers.size(); objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTrackCandidate(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DTrackCandidate"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".chisq"); evioDOMNodeP var2Bank = createLeafNode (objName+".Ndof"); *mainBank << objIdBank << var1Bank << var2Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data // vector dataObjects; vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->chisq; *var2Bank << dataObjects[i]->Ndof ; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDBCALPhoton(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DBCALPhoton"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".x"); evioDOMNodeP var2Bank = createLeafNode (objName+".y"); evioDOMNodeP var3Bank = createLeafNode (objName+".z"); evioDOMNodeP var4Bank = createLeafNode (objName+".px"); evioDOMNodeP var5Bank = createLeafNode (objName+".py"); evioDOMNodeP var6Bank = createLeafNode (objName+".pz"); evioDOMNodeP var7Bank = createLeafNode (objName+".E"); evioDOMNodeP var8Bank = createLeafNode (objName+".t"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank << var6Bank << var7Bank << var8Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->showerPosition().X(); *var2Bank << dataObjects[i]->showerPosition().Y(); *var3Bank << dataObjects[i]->showerPosition().Z(); *var4Bank << dataObjects[i]->lorentzMomentum().Px(); *var5Bank << dataObjects[i]->lorentzMomentum().Py(); *var6Bank << dataObjects[i]->lorentzMomentum().Pz(); *var7Bank << dataObjects[i]->lorentzMomentum().E(); *var8Bank << dataObjects[i]->showerTime(); objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDFCALPhoton(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DFCALPhoton"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".x"); evioDOMNodeP var2Bank = createLeafNode (objName+".y"); evioDOMNodeP var3Bank = createLeafNode (objName+".z"); evioDOMNodeP var4Bank = createLeafNode (objName+".px"); evioDOMNodeP var5Bank = createLeafNode (objName+".py"); evioDOMNodeP var6Bank = createLeafNode (objName+".pz"); evioDOMNodeP var7Bank = createLeafNode (objName+".E"); evioDOMNodeP var8Bank = createLeafNode (objName+".t"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank << var6Bank << var7Bank << var8Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->lorentzMomentum().X(); *var2Bank << dataObjects[i]->lorentzMomentum().Y(); *var3Bank << dataObjects[i]->lorentzMomentum().Z(); *var4Bank << dataObjects[i]->lorentzMomentum().Px(); *var5Bank << dataObjects[i]->lorentzMomentum().Py(); *var6Bank << dataObjects[i]->lorentzMomentum().Pz(); *var7Bank << dataObjects[i]->lorentzMomentum().E(); *var8Bank << dataObjects[i]->showerTime(); objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDChargedTruthMatch(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DChargedTruthMatch"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".Nhits_thrown"); evioDOMNodeP var2Bank = createLeafNode (objName+".Nhits_thrown_selector"); evioDOMNodeP var3Bank = createLeafNode (objName+".Nhits_recon"); evioDOMNodeP var4Bank = createLeafNode (objName+".Nhits_both"); evioDOMNodeP var5Bank = createLeafNode (objName+".fom"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->Nhits_thrown; *var2Bank << dataObjects[i]->Nhits_thrown_selector; *var3Bank << dataObjects[i]->Nhits_recon; *var4Bank << dataObjects[i]->Nhits_both; *var5Bank << dataObjects[i]->fom; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTOFRawHit(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DTOFRawHit"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".bar"); evioDOMNodeP var2Bank = createLeafNode (objName+".plane"); evioDOMNodeP var3Bank = createLeafNode (objName+".lr"); evioDOMNodeP var4Bank = createLeafNode (objName+".dE"); evioDOMNodeP var5Bank = createLeafNode (objName+".t"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->bar; *var2Bank << dataObjects[i]->plane; *var3Bank << dataObjects[i]->lr; *var4Bank << dataObjects[i]->dE; *var5Bank << dataObjects[i]->t; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; // objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTOFRawHitMC(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DTOFRawHitMC"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".bar"); evioDOMNodeP var2Bank = createLeafNode (objName+".plane"); evioDOMNodeP var3Bank = createLeafNode (objName+".lr"); evioDOMNodeP var4Bank = createLeafNode (objName+".dist"); evioDOMNodeP var5Bank = createLeafNode (objName+".x"); evioDOMNodeP var6Bank = createLeafNode (objName+".y"); evioDOMNodeP var7Bank = createLeafNode (objName+".z"); evioDOMNodeP var8Bank = createLeafNode (objName+".px"); evioDOMNodeP var9Bank = createLeafNode (objName+".py"); evioDOMNodeP var10Bank = createLeafNode (objName+".pz"); evioDOMNodeP var11Bank = createLeafNode (objName+".E"); evioDOMNodeP var12Bank = createLeafNode (objName+".ptype"); evioDOMNodeP var13Bank = createLeafNode (objName+".itrack"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank << var6Bank << var7Bank << var8Bank << var9Bank << var10Bank << var11Bank << var12Bank << var13Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->bar; *var2Bank << dataObjects[i]->plane; *var3Bank << dataObjects[i]->lr; *var4Bank << dataObjects[i]->dist; *var5Bank << dataObjects[i]->x; *var6Bank << dataObjects[i]->y; *var7Bank << dataObjects[i]->z; *var8Bank << dataObjects[i]->px; *var9Bank << dataObjects[i]->py; *var10Bank << dataObjects[i]->pz; *var11Bank << dataObjects[i]->E; *var12Bank << dataObjects[i]->ptype; *var13Bank << dataObjects[i]->itrack; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; // objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTOFHit(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DTOFHit"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".orientation"); evioDOMNodeP var2Bank = createLeafNode (objName+".bar"); evioDOMNodeP var3Bank = createLeafNode (objName+".t_north"); evioDOMNodeP var4Bank = createLeafNode (objName+".E_north"); evioDOMNodeP var5Bank = createLeafNode (objName+".t_south"); evioDOMNodeP var6Bank = createLeafNode (objName+".E_south"); evioDOMNodeP var7Bank = createLeafNode (objName+".meantime"); evioDOMNodeP var8Bank = createLeafNode (objName+".timediff"); evioDOMNodeP var9Bank = createLeafNode (objName+".pos"); evioDOMNodeP var10Bank = createLeafNode (objName+".dpos"); evioDOMNodeP var11Bank = createLeafNode (objName+".dE"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank << var6Bank << var7Bank << var8Bank << var9Bank << var10Bank << var11Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->orientation; *var2Bank << dataObjects[i]->bar; *var3Bank << dataObjects[i]->t_north; *var4Bank << dataObjects[i]->E_north; *var5Bank << dataObjects[i]->t_south; *var6Bank << dataObjects[i]->E_south; *var7Bank << dataObjects[i]->meantime; *var8Bank << dataObjects[i]->timediff; *var9Bank << dataObjects[i]->pos; *var10Bank << dataObjects[i]->dpos; *var11Bank << dataObjects[i]->dE; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTOFPoint(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DTOFPoint"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".x"); evioDOMNodeP var2Bank = createLeafNode (objName+".y"); evioDOMNodeP var3Bank = createLeafNode (objName+".z"); evioDOMNodeP var4Bank = createLeafNode (objName+".t"); evioDOMNodeP var5Bank = createLeafNode (objName+".dedx"); evioDOMNodeP var6Bank = createLeafNode (objName+".chisq"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank << var6Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->pos.x(); *var2Bank << dataObjects[i]->pos.y(); *var3Bank << dataObjects[i]->pos.z(); *var4Bank << dataObjects[i]->t; *var5Bank << dataObjects[i]->dedx; *var6Bank << dataObjects[i]->chisq; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDBCALHit(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DBCALHit"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".module"); evioDOMNodeP var2Bank = createLeafNode (objName+".layer"); evioDOMNodeP var3Bank = createLeafNode (objName+".sector"); evioDOMNodeP var4Bank = createLeafNode (objName+".end"); evioDOMNodeP var5Bank = createLeafNode (objName+".E"); evioDOMNodeP var6Bank = createLeafNode (objName+".t"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank << var6Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks string s; for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->module; *var2Bank << dataObjects[i]->layer; *var3Bank << dataObjects[i]->sector; *var4Bank << string((dataObjects[i]->end==DBCALGeometry::kUpstream) ? "upstream" : "downstream"); *var5Bank << dataObjects[i]->E; *var6Bank << dataObjects[i]->t; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDBCALShower(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DBCALShower"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".x"); evioDOMNodeP var2Bank = createLeafNode (objName+".y"); evioDOMNodeP var3Bank = createLeafNode (objName+".z"); evioDOMNodeP var4Bank = createLeafNode (objName+".t"); evioDOMNodeP var5Bank = createLeafNode (objName+".E"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->x; *var2Bank << dataObjects[i]->y; *var3Bank << dataObjects[i]->z; *var4Bank << dataObjects[i]->t; *var5Bank << dataObjects[i]->E; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDFCALCluster(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DFCALCluster"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".x"); evioDOMNodeP var2Bank = createLeafNode (objName+".y"); evioDOMNodeP var3Bank = createLeafNode (objName+".E"); evioDOMNodeP var4Bank = createLeafNode (objName+".t"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->getCentroid().x(); *var2Bank << dataObjects[i]->getCentroid().y(); *var3Bank << dataObjects[i]->getEnergy(); *var4Bank << dataObjects[i]->getTime(); objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDFDCCathodeCluster(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DFDCCathodeCluster"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".Nmembers"); evioDOMNodeP var2Bank = createLeafNode (objName+".plane"); evioDOMNodeP var3Bank = createLeafNode (objName+".gLayer"); evioDOMNodeP var4Bank = createLeafNode (objName+".gPlane"); evioDOMNodeP var5Bank = createLeafNode (objName+".q_tot"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->members.size(); *var2Bank << dataObjects[i]->plane; *var3Bank << dataObjects[i]->gLayer; *var4Bank << dataObjects[i]->gPlane; *var5Bank << dataObjects[i]->q_tot; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDFDCSegment(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DFDCSegment"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".xc"); evioDOMNodeP var2Bank = createLeafNode (objName+".yc"); evioDOMNodeP var3Bank = createLeafNode (objName+".rc"); evioDOMNodeP var4Bank = createLeafNode (objName+".Phi1"); evioDOMNodeP var5Bank = createLeafNode (objName+".Nhits"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank << var5Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->xc; *var2Bank << dataObjects[i]->yc; *var3Bank << dataObjects[i]->rc; *var4Bank << dataObjects[i]->Phi1; *var5Bank << dataObjects[i]->hits.size(); objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------ void DDANAEVIO_factory::addDTAGMHit(JEventLoop *eventLoop, evioDOMTree &tree) { string objName = "DTAGMHit"; string objNameLC(objName); std::transform(objNameLC.begin(), objNameLC.end(), objNameLC.begin(), (int(*)(int)) tolower); // create main bank and add to event tree evioDOMNodeP mainBank = createContainerNode(objName); tree << mainBank; // create data banks and add to bank evioDOMNodeP objIdBank = createLeafNode (objName+".objId"); evioDOMNodeP var1Bank = createLeafNode (objName+".row"); evioDOMNodeP var2Bank = createLeafNode (objName+".column"); evioDOMNodeP var3Bank = createLeafNode (objName+".E"); evioDOMNodeP var4Bank = createLeafNode (objName+".t"); *mainBank << objIdBank << var1Bank << var2Bank << var3Bank << var4Bank; // create associated object bank and add to main bank evioDOMNodeP assocBank = createContainerNode(objName+".assocObjectBanks"); *mainBank << assocBank; // loop over each requested factory, indexed by object name in lower case int assocCount = 0; set::iterator iter; for(iter=evioMap[objNameLC].begin(); iter!=evioMap[objNameLC].end(); iter++) { // is there any data vector dataObjects; eventLoop->Get(dataObjects,(*iter).c_str()); if(dataObjects.size()<=0)continue; // add track data to banks for(unsigned int i=0; iid; *var1Bank << dataObjects[i]->row; *var2Bank << dataObjects[i]->column; *var3Bank << dataObjects[i]->E; *var3Bank << dataObjects[i]->t; objIdMap[dataObjects[i]->id]=dataObjects[i]->GetNameTag(); // get associated object id bank and add to associated object bank evioDOMNodeP assocObjs = createLeafNode (objName+".assocObjects"); *assocBank << assocObjs; // get id's, add to id bank and to global object id map vector objs; dataObjects[i]->GetT(objs); for(unsigned int j=0; jid; objIdMap[objs[j]->id]=objs[j]->GetNameTag(); } } } if(assocCount==0)assocBank->cutAndDelete(); } //------------------------------------------------------------------------------