35 #include "StTpcHitCollection.h"
36 #include "StTpcPadrowHitCollection.h"
39 static const char rcsid[] =
"$Id: StTpcHitCollection.cxx,v 2.7 2019/04/02 15:32:49 smirnovd Exp $";
45 StTpcHitCollection::~StTpcHitCollection() { }
52 (s = hit->sector()-1) < mNumberOfSectors &&
53 (r = hit->padrow()-1) < mSectors[s].numberOfPadrows()) {
54 mSectors[s].padrow(r)->hits().push_back(hit);
61 StTpcHitCollection::numberOfHits()
const
64 for (
int i=0; i<mNumberOfSectors; i++) {
65 for (
unsigned int j=0; j<mSectors[i].numberOfPadrows(); j++) {
66 sum += mSectors[i].padrow(j)->hits().size();
73 StTpcHitCollection::sector(
unsigned int i)
75 if (i < mNumberOfSectors)
76 return &(mSectors[i]);
82 StTpcHitCollection::sector(
unsigned int i)
const
84 if (i < mNumberOfSectors)
85 return &(mSectors[i]);
90 const StSPtrVecTpcHit*
91 StTpcHitCollection::hits(
int sectorId,
int padrowId)
const
95 return pc ? &pc->hits() :
nullptr;
102 for (
int l1 = 0; l1 < c.numberOfSectors(); ++l1)
103 for (
int l2 = 0; l2 < c.numberOfPadrows(l1); ++l2)
115 StTpcHitCollection::StTpcHitIter::operator++()
120 const StSPtrVecTpcHit& currVector = *coll.hits(iSector, iPadrow);
121 if (iHit >= currVector.size()) {
127 if (iPadrow >= coll.numberOfPadrows(iSector)) {
133 if (*
this != end(coll)) {
135 const StSPtrVecTpcHit& nextVector = *coll.hits(iSector, iPadrow);
136 if (nextVector.empty()) {
138 (*this).operator++();
148 return &other.coll == &coll && other.iSector == iSector && other.iPadrow == iPadrow && other.iHit == iHit;
154 return !(*
this == other);
158 StTpcHitCollection::StTpcHitIter::operator*()
const
160 return (*coll.hits(iSector, iPadrow))[iHit];
An iterator over StTpcHits in a StTpcHitCollection.