7 #include "StEventHitIter.h"
8 #include "StTpcHitCollection.h"
9 #include "StTpcSectorHitCollection.h"
10 #include "StTpcPadrowHitCollection.h"
11 #include "StFtpcHitCollection.h"
12 #include "StFtpcPlaneHitCollection.h"
13 #include "StSsdHitCollection.h"
14 #include "StSvtHitCollection.h"
15 #include "StRnDHitCollection.h"
16 #include "StEtrHitCollection.h"
17 #include "StTofCollection.h"
18 #include "StFgtCollection.h"
19 #include "StFgtHitCollection.h"
20 #include "StFgtPointCollection.h"
21 #include "StIstHitCollection.h"
22 #include "StFstHitCollection.h"
37 StHitIter::~StHitIter()
39 delete fDowIter;fDowIter=0;
42 const TObject *StHitIter::Reset(
const TObject *cont)
47 for (fJIter =0;fJIter<fNIter;fJIter++) {
48 const TObject *dowCont =
GetObject(fJIter);
49 if (!dowCont)
continue;
50 if (!fDowIter)
return dowCont;
51 const TObject *to = fDowIter->Reset(dowCont);
59 if (fJIter>=fNIter)
return 0;
62 if (!fDowIter)
return obj;
63 return fDowIter->
Get();
69 if (fJIter>=fNIter)
return 0;
71 while (++fJIter<fNIter) {
77 if ((to= ++(*fDowIter)))
return to;
78 while(++fJIter<fNIter) {
80 if ( (to=fDowIter->Reset(to)))
return to;
85 void StHitIter::UPath(ULong64_t &upath)
const
87 if (fDowIter) fDowIter->UPath(upath);
88 upath*=fNIter; upath+=fJIter;
93 StHitIterGroup::StHitIterGroup()
95 fDetectorId = kUnknownId;
98 StHitIterGroup::~StHitIterGroup()
100 for (
int i=0;i<(int)fGroup.size();i++) {
delete fGroup[i];}
103 const TObject *StHitIterGroup::Reset(
const TObject *cont)
105 if (cont) fCont=cont;
106 if (!fCont)
return 0;
107 fDetectorId = kUnknownId;
108 fNIter = fGroup.size();
109 for (fJIter=0;fJIter<fNIter;fJIter++) {
110 const TObject *to=fGroup[fJIter]->Reset(fCont);
116 void StHitIterGroup::Add(
StHitIter* iter)
118 fGroup.push_back(iter);
119 fNIter = fGroup.size();
123 { assert(0 &&
"In StHitIterGroup::GetObject");}
127 fDetectorId = kUnknownId;
128 if (fJIter>=fNIter)
return 0;
129 fDetectorId = fGroup[fJIter]->DetectorId();
130 return fGroup[fJIter]->Get();
135 if (fJIter>=fNIter)
return 0;
137 if ((to=++(*fGroup[fJIter])))
return to;
139 while(++fJIter<fNIter) {
140 to = fGroup[fJIter]->Reset(fCont);
146 UInt_t StHitIterGroup::UPath()
const
154 void StHitIterGroup::UPath(ULong64_t &ul)
const
156 fGroup[fJIter]->UPath(ul);
168 virtual const TObject *Reset(
const TObject *cont);
169 virtual const TObject *
GetObject (
int idx)
const;
180 virtual const TObject *
GetObject (
int idx)
const;
189 virtual const TObject *
GetObject (
int idx)
const;
195 StTpcHitIter::StTpcHitIter()
210 const TObject *StTpcHitIter::Reset(
const TObject *cont)
213 if (cont) to = ((
StEvent*)cont)->tpcHitCollection();
214 return StHitIter::Reset(to);
257 virtual const TObject *Reset(
const TObject *cont);
258 virtual const TObject *
GetObject (
int idx)
const;
267 virtual const TObject *
GetObject (
int idx)
const;
275 virtual const TObject *
GetObject (
int idx)
const;
283 virtual const TObject *
GetObject (
int idx)
const;
288 StSvtHitIter::StSvtHitIter()
296 const TObject *StSvtHitIter::Reset(
const TObject *cont)
299 if (cont) to = ((
StEvent*)cont)->svtHitCollection();
300 return StHitIter::Reset(to);
352 virtual const TObject *Reset(
const TObject *cont);
353 virtual const TObject *
GetObject (
int idx)
const;
360 const TObject *StEtrHitIter::Reset(
const TObject *cont)
363 if (cont) to = ((
StEvent*)cont)->etrHitCollection();
364 return StHitIter::Reset(to);
384 virtual const TObject *Reset(
const TObject *cont);
385 virtual const TObject *
GetObject (
int idx)
const;
394 virtual const TObject *
GetObject (
int idx)
const;
402 virtual const TObject *
GetObject (
int idx)
const;
407 StSsdHitIter::StSsdHitIter()
414 const TObject *StSsdHitIter::Reset(
const TObject *cont)
417 if (cont) to = ((
StEvent*)cont)->ssdHitCollection();
418 return StHitIter::Reset(to);
459 virtual const TObject *Reset(
const TObject *cont);
460 virtual const TObject *
GetObject (
int idx)
const;
470 virtual const TObject *
GetObject (
int idx)
const;
479 virtual const TObject *
GetObject (
int idx)
const;
484 StIstHitIter::StIstHitIter()
491 const TObject *StIstHitIter::Reset(
const TObject *cont)
494 if (cont) to = ((
StEvent*)cont)->istHitCollection();
495 return StHitIter::Reset(to);
535 virtual const TObject *Reset(
const TObject *cont);
536 virtual const TObject *
GetObject (
int idx)
const;
546 virtual const TObject *
GetObject (
int idx)
const;
555 virtual const TObject *
GetObject (
int idx)
const;
560 StFstHitIter::StFstHitIter()
567 const TObject *StFstHitIter::Reset(
const TObject *cont)
570 if (cont) to = ((
StEvent*)cont)->fstHitCollection();
571 return StHitIter::Reset(to);
581 return kFstNumWedges;
591 return kFstNumSensorsPerWedge;
613 virtual const TObject *Reset(
const TObject *cont);
614 virtual const TObject *
GetObject (
int idx)
const;
625 virtual const TObject *
GetObject (
int idx)
const;
634 virtual const TObject *
GetObject (
int idx)
const;
640 StFtpcHitIter::StFtpcHitIter()
647 const TObject *StFtpcHitIter::Reset(
const TObject *cont)
650 if (cont) to = ((
StEvent*)cont)->ftpcHitCollection();
651 return StHitIter::Reset(to);
693 virtual const TObject *Reset(
const TObject *cont);
694 virtual const TObject *
GetObject (
int idx)
const;
698 StDetectorId fDetectorId;
701 const TObject *StRnDHitIter::Reset(
const TObject *cont)
704 if (cont) to = ((
StEvent*)cont)->rndHitCollection();
705 return StHitIter::Reset(to);
721 #define StTofHitCollection StTofCollection
722 #define tofHitCollection tofCollection
728 virtual const TObject *Reset(
const TObject *cont);
729 virtual const TObject *
GetObject (
int idx)
const;
736 const TObject *StTofHitIter::Reset(
const TObject *cont)
739 if (cont) to = ((
StEvent*)cont)->tofHitCollection();
740 return StHitIter::Reset(to);
765 virtual const TObject *Reset(
const TObject *container );
766 virtual const TObject *
GetObject( Int_t idx )
const;
777 virtual const TObject *
GetObject( Int_t idx )
const;
781 StFgtHitIter::StFgtHitIter()
786 const TObject *StFgtHitIter::Reset(
const TObject *cont )
789 if ( cont ) to = ((
StEvent *)cont)->fgtCollection();
790 return StHitIter::Reset( to );
800 return (
const TObject *)((
StFgtCollection *)fCont)->getPointCollection();
816 #include "StEvent/StPxlHitCollection.h"
817 #include "StEvent/StPxlHit.h"
818 #include "StEvent/StPxlLadderHitCollection.h"
819 #include "StEvent/StPxlSectorHitCollection.h"
820 #include "StEvent/StPxlSensorHitCollection.h"
829 virtual const TObject *Reset(
const TObject *cont);
830 virtual const TObject *
GetObject (
int idx)
const;
840 virtual const TObject *
GetObject (
int idx)
const;
849 virtual const TObject *
GetObject (
int idx)
const;
858 virtual const TObject *
GetObject (
int idx)
const;
863 StPxlHitIter::StPxlHitIter()
871 const TObject *StPxlHitIter::Reset(
const TObject *cont)
874 if (cont) to = ((
StEvent*)cont)->pxlHitCollection();
875 return StHitIter::Reset(to);
922 int StEventHitIter::AddDetector(StDetectorId detId)
924 switch ((
int)detId) {
943 default: printf(
"StEventHitIter::AddDetector: No iterator for detectorId=%d",(
int)detId);
944 assert(0 &&
"No iterator for detectorId");
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
StEventHitIter is the top level hook, providing hits to the Stv tracking code.
void SetDowIter(StHitIter *it)
For the case of nested collections, sets the iterator over another collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(Int_t idx) const
Gets an object at a specified position in the collection.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
const int kIstNumLadders
24 IST Ladders
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(Int_t idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
StHitIter is an abstract base class, establishing the interface between hit collections in StEvent an...
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * operator++()
Increments the iterator, returning the next object in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual Int_t GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const =0
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual Int_t GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * Get() const
Gets the current object in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const =0
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * Get() const
Gets the current object in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
StDetectorId DetectorId() const
Returns the STAR ID of the detector.
const int kIstNumSensorsPerLadder
6 sensor per one IST Ladder
virtual int GetSize() const
Returns the number of entries in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * operator++()
Increments the iterator, returning the next object in the collection.
virtual int GetSize() const
Returns the number of entries in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.
virtual const TObject * GetObject(int idx) const
Gets an object at a specified position in the collection.