3 #include "StIstRawHit.h"
4 #include "StIstRawHitCollection.h"
5 #include "St_base/StMessMgr.h"
10 StIstRawHitCollection::StIstRawHitCollection(
int ladder ) :
StObject(), mLadder(ladder), mRawHitVec(), mRawHitElecIdVec(kIstNumElecIds)
18 while (!mRawHitVec.empty())
delete mRawHitVec.back(), mRawHitVec.pop_back();
20 mRawHitElecIdVec.clear();
24 void StIstRawHitCollection::sortByGeoId()
26 std::sort( mRawHitVec.begin(), mRawHitVec.end(), &StIstRawHitCollection::rawHitIdLessThan );
34 vector<StIstRawHit *> &StIstRawHitCollection::getRawHitVec()
39 const vector<StIstRawHit *> &StIstRawHitCollection::getRawHitVec()
const
44 size_t StIstRawHitCollection::getNumRawHits()
const
46 return mRawHitVec.size();
49 void StIstRawHitCollection::setLadder(
int ladder )
54 unsigned char StIstRawHitCollection::getLadder()
const
59 void StIstRawHitCollection::Clear( Option_t *opt )
61 while (!mRawHitVec.empty())
delete mRawHitVec.back(), mRawHitVec.pop_back();
64 for (
unsigned int i = 0; i < mRawHitElecIdVec.size(); i++)
65 mRawHitElecIdVec[i] = 0;
69 void StIstRawHitCollection::Print(
int nTimeBins)
const
75 for (std::vector<StIstRawHit*>::const_iterator it = mRawHitVec.begin(); it != mRawHitVec.end(); ++it, ++rawHitIdx)
77 LOG_DEBUG <<
"raw hit: Idx=" << rawHitIdx << endm;
78 (*it)->Print(nTimeBins);
92 if (!istRawHit)
return;
96 if (elecId < 0 || elecId >= kIstNumElecIds)
return;
98 StIstRawHit *istRawHitCurrent = mRawHitElecIdVec[elecId];
103 if (istRawHitCurrent) {
104 auto hitPtr = std::find(mRawHitVec.begin(), mRawHitVec.end(), istRawHitCurrent);
107 delete istRawHitCurrent;
110 mRawHitVec.push_back(istRawHit);
113 mRawHitElecIdVec[elecId] = istRawHit;
117 StIstRawHit *StIstRawHitCollection::getRawHit(
int elecId )
119 StIstRawHit *&rawHitPtr = mRawHitElecIdVec[elecId];
123 mRawHitVec.push_back( rawHitPtr );
int getGeoId() const
1-110592
int getChannelId() const
0-110591
void addRawHit(StIstRawHit *istRawHit)