31 #include "StEventTypes.h"
33 #include "Sti/Base/Factory.h"
34 #include "StiSsd/StiSsdHitLoader.h"
35 #include "Sti/StiHit.h"
36 #include "Sti/StiTrack.h"
37 #include "Sti/StiHitContainer.h"
38 #include "Sti/StiDetector.h"
39 #include "Sti/StiDetectorBuilder.h"
40 #include "Sti/StiDetector.h"
42 StiSsdHitLoader::StiSsdHitLoader()
52 StiSsdHitLoader::~StiSsdHitLoader()
55 void StiSsdHitLoader::loadHits(
StEvent* source,
57 Filter<StiHit> * hitFilter)
60 throw runtime_error(
"StiSsdHitLoader::loadHits() - FATAL - source==0 ");
72 throw runtime_error(
"StiSsdHitLoader::loadHits() - FATAL - _hitContainer==0 ");
75 for (
unsigned int ladder = 0; ladder< ssdhits->numberOfLadders(); ++ladder)
78 if (!ladderhits)
break;
80 for (
unsigned int wafer = 0; wafer< ladderhits->numberOfWafers(); ++wafer)
84 if (!waferhits)
break;
85 const StSPtrVecSsdHit& hits = waferhits->hits();
87 for (const_StSsdHitIterator it=hits.begin(); it!=hits.end(); ++it)
89 if (!*it)
throw runtime_error(
"StiSsdHitLoader::loadHits() - WARNING - *it==0");
92 if (!hit)
throw runtime_error(
"StiSsdHitLoader::loadHits() - WARNING - hit==0");
94 detector = _detector->getDetector(layer, hit->ladder() - 1);
105 _hitContainer->
add( stiHit );
virtual void add(StiHit *)
void setGlobal(const StiDetector *detector, const StMeasuredPoint *stHit, Float_t x, Float_t y, Float_t z, Float_t energy)
virtual Abstract * getInstance()=0
Get a pointer to instance of objects served by this factory.