1 #ifndef StiMasterHitLoader_H
2 #define StiMasterHitLoader_H
7 #include "StiHitLoader.h"
8 #include "Sti/StiTrackContainer.h"
10 #include "StEventTypes.h"
30 template<
class Source1,
class Detector>
32 public vector< StiHitLoader<Source1, Detector> *>
43 void loadEvent(Source1 *source1,
45 Filter<StiHit> * hitFilter);
48 virtual void setDetector(Detector*detector);
51 typedef vector< HitLoaderKey > HitLoaderVector;
52 typedef typename HitLoaderVector::iterator HitLoaderIter;
53 typedef typename HitLoaderVector::const_iterator HitLoaderConstIter;
57 template<
class Source1,
class Detector>
59 :
StiHitLoader<Source1, Detector>(
"MasterHitLoader",0,0,0)
62 template<
class Source1,
class Detector>
67 :
StiHitLoader<Source1, Detector>(name,hitContainer,hitFactory,transform)
70 template<
class Source1,
class Detector>
74 template<
class Source1,
class Detector>
77 this->push_back(loader);
80 template<
class Source1,
class Detector>
83 Filter<StiHit> * hitFilter)
85 assert(this->_hitContainer);
86 this->_hitContainer->clear();
87 HitLoaderConstIter iter;
88 for (iter=this->begin();iter!=this->end();iter++) {
89 unsigned nHitsBeforeLoad = this->_hitContainer->size();
90 (*iter)->loadHits(source1,trackFilter, hitFilter);
91 LOG_INFO <<
"StiMasterHitLoader::loadEvent() - "
92 << (*iter)->getName() <<
" loaded "
93 << this->_hitContainer->size() - nHitsBeforeLoad
96 this->_hitContainer->sortHits();
97 this->_hitContainer->reset();
100 template<
class Source1,
class Detector>
103 this->_hitContainer = hitContainer;
105 for (iter=this->begin();iter!=this->end();iter++)
106 (*iter)->setHitContainer(hitContainer);
110 template<
class Source1,
class Detector>
114 for (iter=this->begin();iter!=this->end();iter++)
115 (*iter)->setHitFactory(hitFactory);
118 template<
class Source1,
class Detector>
121 cout <<
"StiMasterHitLoader<Source1,Detector>::setDetector(Detector*) - This call is Forbiden in StiMasterHitLoader" << endl;