208 #include "TDataSetIter.h"
209 #include "TObjectSet.h"
210 #include "TBrowser.h"
211 #include "StCalibrationVertex.h"
212 #include "StDetectorState.h"
214 #include "StEventClusteringHints.h"
215 #include "StEventInfo.h"
216 #include "StEventSummary.h"
217 #include "StTpcHitCollection.h"
218 #include "StRnDHitCollection.h"
219 #include "StEtrHitCollection.h"
220 #include "StSvtHitCollection.h"
221 #include "StSsdHitCollection.h"
222 #include "StSstHitCollection.h"
223 #include "StFtpcHitCollection.h"
224 #include "StEmcCollection.h"
225 #include "StEpdCollection.h"
226 #include "StFcsCollection.h"
227 #include "StFttCollection.h"
228 #include "StFmsCollection.h"
229 #include "StRHICfCollection.h"
230 #include "StRichCollection.h"
231 #include "StRpsCollection.h"
232 #include "StRunInfo.h"
233 #include "StTofCollection.h"
234 #include "StBTofCollection.h"
235 #include "StETofCollection.h"
236 #include "StMtdCollection.h"
237 #include "StFpdCollection.h"
238 #include "StPhmdCollection.h"
239 #include "StTrackDetectorInfo.h"
240 #include "StTriggerData.h"
241 #include "StTriggerDetectorCollection.h"
242 #include "StTriggerIdCollection.h"
243 #include "StPrimaryVertex.h"
244 #include "StL0Trigger.h"
245 #include "StL1Trigger.h"
246 #include "StL3Trigger.h"
248 #include "event_header.h"
249 #include "StEventBranch.h"
250 #include "StHltEvent.h"
251 #include "StFgtCollection.h"
252 #include "StPxlHitCollection.h"
253 #include "StIstHitCollection.h"
254 #include "StFstEvtCollection.h"
255 #include "StFstHitCollection.h"
256 #include "StTrackNode.h"
258 #include "StFwdTrackCollection.h"
260 #ifndef ST_NO_NAMESPACES
264 TString StEvent::mCvsTag =
"$Id: StEvent.cxx,v 2.61 2021/02/27 17:07:50 ullrich Exp $";
265 static const char rcsid[] =
"$Id: StEvent.cxx,v 2.61 2021/02/27 17:07:50 ullrich Exp $";
270 template<class T>
void _lookup(T*& val, StSPtrVecObject &vec)
273 for (
unsigned int i=0; i<vec.size(); i++)
274 if (vec[i] &&
typeid(*vec[i]) ==
typeid(T)) {
275 val =
static_cast<T*
>(vec[i]);
281 template<
class T>
void _lookupOrCreate(T*& val, StSPtrVecObject &vec)
293 template<
class T>
void _lookupAndSet(T* val, StSPtrVecObject &vec)
295 for (
unsigned int i=0; i<vec.size(); i++)
296 if (vec[i] &&
typeid(*vec[i]) ==
typeid(T)) {
306 template<
class T>
void _lookupDynamic(T*& val, StSPtrVecObject &vec)
309 for (
unsigned int i=0; i<vec.size(); i++)
311 val =
dynamic_cast<T*
>(vec[i]);
317 template<
class T>
void _lookupDynamicAndSet(T* val, StSPtrVecObject &vec)
320 for (
unsigned int i=0; i<vec.size(); i++) {
322 test =
dynamic_cast<T*
>(vec[i]);
335 void StEvent::initToZero() { }
349 StEvent::type()
const
352 _lookup(info, mContent);
353 return info ? info->type() : TString();
360 _lookup(info, mContent);
361 return info ? info->id() : 0;
365 StEvent::runId()
const
368 _lookup(info, mContent);
369 return info ? info->runId() : 0;
373 StEvent::time()
const
376 _lookup(info, mContent);
377 return info ? info->time() : 0;
381 StEvent::triggerMask()
const
384 _lookup(info, mContent);
385 return info ? info->triggerMask() : 0;
389 StEvent::bunchCrossingNumber(
unsigned int i)
const
392 _lookup(info, mContent);
393 return info ? info->bunchCrossingNumber(i) : 0;
400 _lookup(info, mContent);
405 StEvent::info()
const
408 _lookup(info, mContent);
416 _lookup(info, mContent);
421 StEvent::runInfo()
const
424 _lookup(info, mContent);
432 _lookup(summary, mContent);
437 StEvent::summary()
const
440 _lookup(summary, mContent);
445 StEvent::cvsTag() {
return mCvsTag; }
451 _lookup(hits, mContent);
457 StEvent::tpcHitCollection()
const
460 _lookup(hits, mContent);
468 _lookup(hits, mContent);
476 _lookup(hits, mContent);
484 _lookup(hits, mContent);
492 _lookup(hits, mContent);
499 _lookup(hits, mContent);
504 StEvent::ftpcHitCollection()
const
507 _lookup(hits, mContent);
512 StEvent::svtHitCollection()
515 _lookup(hits, mContent);
520 StEvent::svtHitCollection()
const
523 _lookup(hits, mContent);
528 StEvent::ssdHitCollection()
531 _lookup(hits, mContent);
536 StEvent::ssdHitCollection()
const
539 _lookup(hits, mContent);
544 StEvent::sstHitCollection()
547 _lookup(hits, mContent);
552 StEvent::sstHitCollection()
const
555 _lookup(hits, mContent);
560 StEvent::emcCollection()
563 _lookup(emc, mContent);
568 StEvent::emcCollection()
const
571 _lookup(emc, mContent);
576 StEvent::fcsCollection()
579 _lookup(fcs, mContent);
584 StEvent::fcsCollection()
const
587 _lookup(fcs, mContent);
592 StEvent::fttCollection()
595 _lookup(ftt, mContent);
600 StEvent::fttCollection()
const
603 _lookup(ftt, mContent);
608 StEvent::fmsCollection()
611 _lookup(fms, mContent);
616 StEvent::fmsCollection()
const
619 _lookup(fms, mContent);
624 StEvent::rhicfCollection()
627 _lookup(rhicf, mContent);
632 StEvent::rhicfCollection()
const
635 _lookup(rhicf, mContent);
640 StEvent::richCollection()
643 _lookup(rich, mContent);
648 StEvent::richCollection()
const
651 _lookup(rich, mContent);
656 StEvent::rpsCollection()
659 _lookup(rps, mContent);
664 StEvent::rpsCollection()
const
667 _lookup(rps, mContent);
672 StEvent::tofCollection()
675 _lookup(tof, mContent);
680 StEvent::tofCollection()
const
683 _lookup(tof, mContent);
688 StEvent::btofCollection()
691 _lookup(btof, mContent);
696 StEvent::btofCollection()
const
699 _lookup(btof, mContent);
704 StEvent::etofCollection()
707 _lookup(etof, mContent);
712 StEvent::etofCollection()
const
715 _lookup(etof, mContent);
720 StEvent::epdCollection()
723 _lookup(epd, mContent);
728 StEvent::epdCollection()
const
731 _lookup(epd, mContent);
736 StEvent::mtdCollection()
739 _lookup(mtd, mContent);
744 StEvent::mtdCollection()
const
747 _lookup(mtd, mContent);
752 StEvent::fpdCollection()
755 _lookup(fpd, mContent);
760 StEvent::fpdCollection()
const
763 _lookup(fpd, mContent);
768 StEvent::phmdCollection()
771 _lookup(phmd, mContent);
776 StEvent::phmdCollection()
const
779 _lookup(phmd, mContent);
784 StEvent::triggerDetectorCollection()
787 _lookup(trg, mContent);
792 StEvent::triggerDetectorCollection()
const
795 _lookup(trg, mContent);
800 StEvent::triggerIdCollection()
803 _lookup(trg, mContent);
808 StEvent::triggerIdCollection()
const
811 _lookup(trg, mContent);
816 StEvent::triggerData()
819 _lookupDynamic(trg, mContent);
824 StEvent::triggerData()
const
827 _lookupDynamic(trg, mContent);
835 _lookup(trg, mContent);
840 StEvent::l0Trigger()
const
843 _lookup(trg, mContent);
851 _lookup(trg, mContent);
856 StEvent::l1Trigger()
const
859 _lookup(trg, mContent);
867 _lookup(trg, mContent);
872 StEvent::l3Trigger()
const
875 _lookup(trg, mContent);
883 _lookup(hlt, mContent);
888 StEvent::hltEvent()
const
891 _lookup(hlt, mContent);
896 StEvent::fgtCollection()
899 _lookup(fgtCollection, mContent);
900 return fgtCollection;
904 StEvent::fgtCollection()
const
907 _lookup(fgtCollection, mContent);
908 return fgtCollection;
912 StEvent::istHitCollection()
915 _lookup(istHitCollection, mContent);
916 return istHitCollection;
920 StEvent::istHitCollection()
const
923 _lookup(istHitCollection, mContent);
924 return istHitCollection;
928 StEvent::fstEvtCollection()
931 _lookup(fstEvtCollection, mContent);
932 return fstEvtCollection;
936 StEvent::fstEvtCollection()
const
939 _lookup(fstEvtCollection, mContent);
940 return fstEvtCollection;
944 StEvent::fstHitCollection()
947 _lookup(fstHitCollection, mContent);
948 return fstHitCollection;
952 StEvent::fstHitCollection()
const
955 _lookup(fstHitCollection, mContent);
956 return fstHitCollection;
960 StEvent::pxlHitCollection()
963 _lookup(pxlHitCollection, mContent);
964 return pxlHitCollection;
968 StEvent::pxlHitCollection()
const
971 _lookup(pxlHitCollection, mContent);
972 return pxlHitCollection;
975 StSPtrVecTrackDetectorInfo&
976 StEvent::trackDetectorInfo()
978 StSPtrVecTrackDetectorInfo *info = 0;
979 _lookupOrCreate(info, mContent);
983 const StSPtrVecTrackDetectorInfo&
984 StEvent::trackDetectorInfo()
const
986 StSPtrVecTrackDetectorInfo *info = 0;
987 _lookupOrCreate(info, mContent);
992 StEvent::fwdTrackCollection()
995 _lookup(fwdTracks, mContent);
1000 StEvent::fwdTrackCollection()
const
1003 _lookup(fwdTrack, mContent);
1008 StEvent::trackNodes()
1010 StSPtrVecTrackNode *nodes = 0;
1011 _lookupOrCreate(nodes, mContent);
1015 const StSPtrVecTrackNode&
1016 StEvent::trackNodes()
const
1018 StSPtrVecTrackNode *nodes = 0;
1019 _lookupOrCreate(nodes, mContent);
1024 StEvent::numberOfPrimaryVertices()
const
1026 StSPtrVecPrimaryVertex *vertices = 0;
1027 _lookupOrCreate(vertices, mContent);
1028 return vertices ? vertices->size() : 0;
1032 StEvent::primaryVertex(
unsigned int i)
1034 StSPtrVecPrimaryVertex *vertices = 0;
1035 _lookup(vertices, mContent);
1036 if (vertices && i < vertices->size())
1037 return (*vertices)[i];
1043 StEvent::primaryVertex(
unsigned int i)
const
1045 StSPtrVecPrimaryVertex *vertices = 0;
1046 _lookup(vertices, mContent);
1047 if (vertices && i < vertices->size())
1048 return (*vertices)[i];
1054 StEvent::numberOfCalibrationVertices()
const
1056 StSPtrVecCalibrationVertex *vertices = 0;
1057 _lookupOrCreate(vertices, mContent);
1058 return vertices ? vertices->size() : 0;
1062 StEvent::calibrationVertex(
unsigned int i)
1064 StSPtrVecCalibrationVertex *vertices = 0;
1065 _lookup(vertices, mContent);
1066 if (vertices && i < vertices->size())
1067 return (*vertices)[i];
1073 StEvent::calibrationVertex(
unsigned int i)
const
1075 StSPtrVecCalibrationVertex *vertices = 0;
1076 _lookup(vertices, mContent);
1077 if (vertices && i < vertices->size())
1078 return (*vertices)[i];
1084 StEvent::v0Vertices()
1086 StSPtrVecV0Vertex *vertices = 0;
1087 _lookupOrCreate(vertices, mContent);
1091 const StSPtrVecV0Vertex&
1092 StEvent::v0Vertices()
const
1094 StSPtrVecV0Vertex *vertices = 0;
1095 _lookupOrCreate(vertices, mContent);
1100 StEvent::xiVertices()
1102 StSPtrVecXiVertex *vertices = 0;
1103 _lookupOrCreate(vertices, mContent);
1107 const StSPtrVecXiVertex&
1108 StEvent::xiVertices()
const
1110 StSPtrVecXiVertex *vertices = 0;
1111 _lookupOrCreate(vertices, mContent);
1115 StSPtrVecKinkVertex&
1116 StEvent::kinkVertices()
1118 StSPtrVecKinkVertex *vertices = 0;
1119 _lookupOrCreate(vertices, mContent);
1123 const StSPtrVecKinkVertex&
1124 StEvent::kinkVertices()
const
1126 StSPtrVecKinkVertex *vertices = 0;
1127 _lookupOrCreate(vertices, mContent);
1132 StEvent::detectorState(StDetectorId det)
1134 StSPtrVecDetectorState *states = 0;
1135 _lookup(states, mContent);
1137 for (
unsigned int i=0; i<states->size(); i++)
1138 if ((*states)[i]->detector() == det)
return (*states)[i];
1143 StEvent::detectorState(StDetectorId det)
const
1145 StSPtrVecDetectorState *states = 0;
1146 _lookup(states, mContent);
1148 for (
unsigned int i=0; i<states->size(); i++)
1149 if ((*states)[i]->detector() == det)
return (*states)[i];
1154 StEvent::psd(
StPwg p,
int i)
1157 for (
unsigned int k=0; k<mContent.size(); k++) {
1158 thePsd =
dynamic_cast<StPsd*
>(mContent[k]);
1159 if (thePsd && thePsd->pwg() == p && thePsd->id() == i)
1166 StEvent::psd(
StPwg p,
int i)
const
1168 const StPsd *thePsd = 0;
1169 for (
unsigned int k=0; k<mContent.size(); k++) {
1170 thePsd =
dynamic_cast<StPsd*
>(mContent[k]);
1171 if (thePsd && thePsd->pwg() == p && thePsd->id() == i)
1178 StEvent::numberOfPsds()
const
1181 for (
unsigned int i=0; i<mContent.size(); i++)
1182 if (dynamic_cast<StPsd*>(mContent[i])) nPsds++;
1187 StEvent::numberOfPsds(
StPwg p)
const
1191 for (
unsigned int i=0; i<mContent.size(); i++) {
1192 thePsd =
dynamic_cast<StPsd*
>(mContent[i]);
1193 if (thePsd && thePsd->pwg() == p) nPsds++;
1199 StEvent::content() {
return mContent; }
1202 StEvent::clusteringHints()
const
1205 _lookupOrCreate(hints, mContent);
1210 StEvent::clusteringHints()
1213 _lookupOrCreate(hints, mContent);
1214 hints->SetParent(
this);
1219 StEvent::setType(
const char* val)
1222 _lookupOrCreate(info, mContent);
1227 StEvent::setRunId(
int val)
1230 _lookupOrCreate(info, mContent);
1231 info->setRunId(val);
1235 StEvent::setId(
int val)
1238 _lookupOrCreate(info, mContent);
1243 StEvent::setTime(
int val)
1246 _lookupOrCreate(info, mContent);
1251 StEvent::setTriggerMask(
unsigned int val)
1254 _lookupOrCreate(info, mContent);
1255 info->setTriggerMask(val);
1259 StEvent::setBunchCrossingNumber(
unsigned int val,
unsigned int i)
1262 _lookupOrCreate(info, mContent);
1263 info->setBunchCrossingNumber(val, i);
1269 _lookupAndSet(val, mContent);
1275 _lookupAndSet(val, mContent);
1281 _lookupAndSet(val, mContent);
1287 _lookupAndSet(val, mContent);
1293 _lookupAndSet(val, mContent);
1299 _lookupAndSet(val, mContent);
1305 _lookupAndSet(val, mContent);
1311 _lookupAndSet(val, mContent);
1317 _lookupAndSet(val, mContent);
1323 _lookupAndSet(val, mContent);
1329 _lookupAndSet(val, mContent);
1335 _lookupAndSet(val, mContent);
1341 _lookupAndSet(val, mContent);
1347 _lookupAndSet(val, mContent);
1353 _lookupAndSet(val, mContent);
1359 _lookupAndSet(val, mContent);
1365 _lookupAndSet(val, mContent);
1371 _lookupAndSet(val, mContent);
1377 _lookupAndSet(val, mContent);
1384 _lookupAndSet(val, mContent);
1390 _lookupAndSet(val, mContent);
1396 _lookupAndSet(val, mContent);
1402 _lookupAndSet(val, mContent);
1408 _lookupAndSet(val, mContent);
1414 _lookupAndSet(val, mContent);
1420 _lookupDynamicAndSet(val, mContent);
1426 _lookupAndSet(val, mContent);
1432 _lookupAndSet(val, mContent);
1438 _lookupAndSet(val, mContent);
1444 _lookupAndSet(val, mContent);
1450 _lookupAndSet(val, mContent);
1456 _lookupAndSet(val, mContent);
1462 _lookupAndSet(val, mContent);
1468 _lookupAndSet(val, mContent);
1474 _lookupAndSet(val, mContent);
1480 _lookupAndSet(val, mContent);
1486 _lookupAndSet(val, mContent);
1492 if (!vertex)
return;
1497 StSPtrVecPrimaryVertex* vertexVector = 0;
1498 _lookupOrCreate(vertexVector, mContent);
1499 vertexVector->push_back(vertex);
1511 for (i=vertexVector->size()-1; i>0; i--) {
1512 if ((*vertexVector)[i]->numberOfDaughters() > (*vertexVector)[i-1]->numberOfDaughters())
1513 swap((*vertexVector)[i], (*vertexVector)[i-1]);
1521 for (i=vertexVector->size()-1; i>0; i--) {
1522 if ((*vertexVector)[i]->ranking() > (*vertexVector)[i-1]->ranking())
1523 swap((*vertexVector)[i], (*vertexVector)[i-1]);
1535 StSPtrVecCalibrationVertex* vertexVector = 0;
1536 _lookupOrCreate(vertexVector, mContent);
1537 vertexVector->push_back(vertex);
1545 StSPtrVecDetectorState* stateVector = 0;
1546 _lookupOrCreate(stateVector, mContent);
1547 stateVector->push_back(state);
1552 StEvent::addPsd(
StPsd* p)
1555 if (psd(p->pwg(), p->id()))
1556 cerr <<
"StEvent::addPsd(): Error, PSD with same identifiers already exist. Nothing added." << endl;
1558 mContent.push_back(p);
1562 void StEvent::removePsd(
StPsd* p)
1564 StSPtrVecObjectIterator iter;
1566 for (iter = mContent.begin(); iter != mContent.end(); iter++)
1568 mContent.erase(iter);
1572 void StEvent::statistics()
1574 cout <<
"Statistics and information for event " << id() << endl;
1575 cout <<
"\tthis: " <<
static_cast<void*
>(
this) << endl;
1577 cout <<
"\ttype: " << type() << endl;
1578 cout <<
"\tid: " << id() << endl;
1579 cout <<
"\trunId: " << runId() << endl;
1580 cout <<
"\ttime: " << time() << endl;
1581 cout <<
"\ttriggerMask: " << triggerMask() << endl;
1582 cout <<
"\tbunchCrossingNumber(0): " << bunchCrossingNumber(0) << endl;
1583 cout <<
"\tbunchCrossingNumber(1): " << bunchCrossingNumber(1) << endl;
1584 cout <<
"\tStEventSummary: " <<
static_cast<void*
>(summary()) << endl;
1585 cout <<
"\tStTpcHitCollection: " <<
static_cast<void*
>(tpcHitCollection()) << endl;
1586 cout <<
"\tStRnDHitCollection: " <<
static_cast<void*
>(rndHitCollection()) << endl;
1587 cout <<
"\tStFtpcHitCollection: " <<
static_cast<void*
>(ftpcHitCollection()) << endl;
1588 cout <<
"\tStSvtHitCollection: " <<
static_cast<void*
>(svtHitCollection()) << endl;
1589 cout <<
"\tStSsdHitCollection: " <<
static_cast<void*
>(ssdHitCollection()) << endl;
1590 cout <<
"\tStSstHitCollection: " <<
static_cast<void*
>(sstHitCollection()) << endl;
1591 cout <<
"\tStIstHitCollection: " <<
static_cast<void*
>(istHitCollection()) << endl;
1592 cout <<
"\tStFstEvtCollection: " <<
static_cast<void*
>(fstEvtCollection()) << endl;
1593 cout <<
"\tStFstHitCollection: " <<
static_cast<void*
>(fstHitCollection()) << endl;
1594 cout <<
"\tStPxlHitCollection: " <<
static_cast<void*
>(pxlHitCollection()) << endl;
1595 cout <<
"\tStEmcCollection: " <<
static_cast<void*
>(emcCollection()) << endl;
1596 cout <<
"\tStFmsCollection: " <<
static_cast<void*
>(fmsCollection()) << endl;
1597 cout <<
"\tStRHICfCollection: " <<
static_cast<void*
>(rhicfCollection()) << endl;
1598 cout <<
"\tStRichCollection: " <<
static_cast<void*
>(richCollection()) << endl;
1599 cout <<
"\tStRpsCollection: " <<
static_cast<void*
>(rpsCollection()) << endl;
1600 cout <<
"\tStTofCollection: " <<
static_cast<void*
>(tofCollection()) << endl;
1601 cout <<
"\tStBTofCollection: " <<
static_cast<void*
>(btofCollection()) << endl;
1602 cout <<
"\tStETofCollection: " <<
static_cast<void*
>(etofCollection()) << endl;
1603 cout <<
"\tStEpdCollection: " <<
static_cast<void*
>(epdCollection()) << endl;
1604 cout <<
"\tStMtdCollection: " <<
static_cast<void*
>(mtdCollection()) << endl;
1605 cout <<
"\tStFpdCollection: " <<
static_cast<void*
>(fpdCollection()) << endl;
1606 cout <<
"\tStPhmdCollection: " <<
static_cast<void*
>(phmdCollection()) << endl;
1607 cout <<
"\tStL0Trigger: " <<
static_cast<void*
>(l0Trigger()) << endl;
1608 cout <<
"\tStL1Trigger: " <<
static_cast<void*
>(l0Trigger()) << endl;
1609 cout <<
"\tStL3Trigger: " <<
static_cast<void*
>(l3Trigger()) << endl;
1610 cout <<
"\tStHltEvent: " <<
static_cast<void*
>(hltEvent()) << endl;
1611 cout <<
"\tStTriggerDetectorCollection: " <<
static_cast<void*
>(triggerDetectorCollection()) << endl;
1612 cout <<
"\tStTriggerIdCollection: " <<
static_cast<void*
>(triggerIdCollection()) << endl;
1613 cout <<
"\tStTriggerData: " <<
static_cast<void*
>(triggerData()) << endl;
1614 cout <<
"\tStPrimaryVertex: " <<
static_cast<void*
>(primaryVertex(0)) << endl;
1615 cout <<
"\tnumberOfPrimaryVertices: " << numberOfPrimaryVertices() << endl;
1616 cout <<
"\tStCalibrationVertex: " <<
static_cast<void*
>(calibrationVertex(0));
1617 cout <<
"\tnumberOfCalibrationVertices: " << numberOfCalibrationVertices() << endl;
1618 cout <<
"\t# of TPC hits: " << (tpcHitCollection() ? tpcHitCollection()->numberOfHits() : 0) << endl;
1619 cout <<
"\t# of FTPC hits: " << (ftpcHitCollection() ? ftpcHitCollection()->numberOfHits() : 0) << endl;
1620 cout <<
"\t# of SVT hits: " << (svtHitCollection() ? svtHitCollection()->numberOfHits() : 0) << endl;
1621 cout <<
"\t# of SSD hits: " << (ssdHitCollection() ? ssdHitCollection()->numberOfHits() : 0) << endl;
1622 cout <<
"\t# of IST hits: " << (istHitCollection() ? istHitCollection()->numberOfHits() : 0) << endl;
1623 cout <<
"\t# of PXL hits: " << (pxlHitCollection() ? pxlHitCollection()->numberOfHits() : 0) << endl;
1624 cout <<
"\t# of track nodes: " << trackNodes().size() << endl;
1625 cout <<
"\t# of primary tracks: " << (primaryVertex(0) ? primaryVertex(0)->numberOfDaughters() : 0) << endl;
1626 cout <<
"\t# of V0s: " << v0Vertices().size() << endl;
1627 cout <<
"\t# of Xis: " << xiVertices().size() << endl;
1628 cout <<
"\t# of Kinks: " << kinkVertices().size() << endl;
1629 cout <<
"\t# of hits in EMC: " << (emcCollection() ? emcCollection()->barrelPoints().size() : 0) << endl;
1630 cout <<
"\t# of hits in EEMC: " << (emcCollection() ? emcCollection()->endcapPoints().size() : 0) << endl;
1631 cout <<
"\t# of hits in FGT: " << (fgtCollection() ? fgtCollection()->getNumHits() : 0) << endl;
1632 cout <<
"\t# of hits in RICH: " << (richCollection() ? richCollection()->getRichHits().size() : 0) << endl;
1633 cout <<
"\t# of PSDs: " << numberOfPsds() << endl;
1636 void StEvent::Split()
1643 while ((ds=next())) {
1644 if (ds->IsA()!=StEventBranch::Class())
continue;
1648 vector<string> brs = clu->listOfBranches();
1649 int nbrs = brs.size();
1650 for (
int ibr =0; ibr < nbrs; ibr++) {
1651 string sbr = brs[ibr];
1652 if(sbr.size()==0)
continue;
1653 const char *brName = sbr.c_str();
1654 assert(strncmp(brName,
"evt_",4)==0 || strcmp(brName,
"event")==0);
1656 UInt_t tally = ((clu->branchId(brName)) << 22) | 1 ;
1659 vector<string> cls = clu->listOfClasses(sbr.c_str());
1660 int ncls = cls.size();
1661 for (
int icl =0; icl < ncls; icl++) {
1662 string scl = cls[icl];
1663 if(scl.size()==0)
continue;
1664 obr->AddKlass(scl.c_str());
1669 Bool_t StEvent::Notify() {Split();
return 0;}
1671 void StEvent::Streamer(TBuffer &R__b)
1676 if (R__b.IsReading()) {
1678 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1680 TDataSet::Streamer(R__b);
1681 mContent.Streamer(R__b);
1682 R__b.CheckByteCount(R__s, R__c, Class());
1687 StXRefMain::Streamer(R__b);
1688 R__b.CheckByteCount(R__s, R__c, Class());
1696 while ((ds=next())) {
1697 if (ds->IsA()==StEventBranch::Class())
break;
1702 R__c = R__b.WriteVersion(Class(), kTRUE);
1703 StXRefMain::Streamer(R__b);
1704 R__b.SetByteCount(R__c, kTRUE);
1708 StSPtrVecHit* StEvent::hitCollection(
const Char_t *name) {
1709 StSPtrVecHit *theHitCollection = 0;
1711 if (set) theHitCollection = (StSPtrVecHit *) set->
GetObject();
1712 return theHitCollection;
1715 void StEvent::addHitCollection(StSPtrVecHit* p,
const Char_t *name) {
1719 cerr <<
"StEvent::addHitCollection(): Error, HitCollection with "
1720 << name <<
" already exist. Nothing added." << endl;
1728 void StEvent::removeHitCollection(
const Char_t *name) {
1733 void StEvent::setIdTruth() {
1734 StSPtrVecTrackNode& trackNode = trackNodes();
1735 UInt_t nTracks = trackNode.size();
1737 for (UInt_t i = 0; i < nTracks; i++) {
1738 node = trackNode[i];
1739 if (!node)
continue;
1740 UInt_t notr = node->entries();
1741 for (UInt_t t = 0; t < notr; t++) {
1743 track->setIdTruth();
1747 Int_t noOfPrimaryVertices = numberOfPrimaryVertices();
1748 for (Int_t i = 0; i < noOfPrimaryVertices; i++) primaryVertex(i)->setIdTruth();
1749 Int_t noOfCalibrationVertices = numberOfCalibrationVertices();
1750 for (Int_t i = 0; i < noOfCalibrationVertices; i++) calibrationVertex(i)->setIdTruth();
1751 Int_t noOfv0Vertices = v0Vertices().size();
1752 for (Int_t i = 0; i < noOfv0Vertices; i++) ((
StVertex *) v0Vertices()[i])->setIdTruth();
1753 Int_t noOfxiVertices = xiVertices().size();
1754 for (Int_t i = 0; i < noOfxiVertices; i++) ((
StVertex *) xiVertices()[i])->setIdTruth();
1755 Int_t noOfkinkVertices = kinkVertices().size();
1756 for (Int_t i = 0; i < noOfkinkVertices; i++) ((
StVertex *) kinkVertices()[i])->setIdTruth();
virtual void Remove(TDataSet *set)
Remiove the "set" from this TDataSet.
virtual void Delete(Option_t *opt="")
to be documented
Collection of trigger ids as stored in StEvent.
virtual TDataSet * FindByName(const char *name, const char *path="", Option_t *opt="") const
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)