1 #include "StFstRawHit.h"
2 #include "StFstRawHitCollection.h"
3 #include "St_base/StMessMgr.h"
8 StFstRawHitCollection::StFstRawHitCollection(
int wedge ) :
StObject(), mWedge(wedge), mRawHitVec(), mRawHitElecIdVec(kFstNumElecIds)
16 while (!mRawHitVec.empty())
delete mRawHitVec.back(), mRawHitVec.pop_back();
18 mRawHitElecIdVec.clear();
22 void StFstRawHitCollection::sortByGeoId()
24 std::sort( mRawHitVec.begin(), mRawHitVec.end(), &StFstRawHitCollection::rawHitIdLessThan );
32 vector<StFstRawHit *> &StFstRawHitCollection::getRawHitVec()
37 const vector<StFstRawHit *> &StFstRawHitCollection::getRawHitVec()
const
42 size_t StFstRawHitCollection::getNumRawHits()
const
44 return mRawHitVec.size();
47 void StFstRawHitCollection::setWedge(
int wedge )
52 unsigned char StFstRawHitCollection::getWedge()
const
57 void StFstRawHitCollection::Clear( Option_t *opt )
59 while (!mRawHitVec.empty())
delete mRawHitVec.back(), mRawHitVec.pop_back();
62 for (
unsigned int i = 0; i < mRawHitElecIdVec.size(); i++)
63 mRawHitElecIdVec[i] = 0;
67 void StFstRawHitCollection::Print(
int nTimeBins)
const
73 for (std::vector<StFstRawHit*>::const_iterator it = mRawHitVec.begin(); it != mRawHitVec.end(); ++it, ++rawHitIdx)
75 LOG_DEBUG <<
"raw hit: Idx=" << rawHitIdx << endm;
76 (*it)->Print(nTimeBins);
90 if (!fstRawHit)
return;
94 if (elecId < 0 || elecId >= kFstNumElecIds)
return;
96 StFstRawHit *fstRawHitCurrent = mRawHitElecIdVec[elecId];
101 if (fstRawHitCurrent) {
102 auto hitPtr = std::find(mRawHitVec.begin(), mRawHitVec.end(), fstRawHitCurrent);
105 delete fstRawHitCurrent;
108 mRawHitVec.push_back(fstRawHit);
111 mRawHitElecIdVec[elecId] = fstRawHit;
115 StFstRawHit *StFstRawHitCollection::getRawHit(
int elecId )
117 StFstRawHit *&rawHitPtr = mRawHitElecIdVec[elecId];
121 mRawHitVec.push_back( rawHitPtr );
int getGeoId() const
0-36863
void addRawHit(StFstRawHit *fstRawHit)
int getChannelId() const
0-36863