StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiHitLoader.h
1 #ifndef StiHitLoader_H
2 #define StiHitLoader_H
3 
4 #include "Riostream.h"
5 
6 #include "Sti/Base/Factory.h"
7 #include "Sti/Base/Named.h"
8 #include "Sti/Base/Filter.h"
9 #include "Sti/StiToolkit.h"
10 #include "Sti/StiHitContainer.h"
11 class StiHit;
12 class StiTrack;
13 class StiHitContainer;
14 class StiTrackContainer;
15 
35 template <class Source1, class Detector>
36 class StiHitLoader : public Named
37 {
38  public:
39 
40  StiHitLoader(const string & name);
41  StiHitLoader(const string & name,
42  StiHitContainer* hitContainer,
43  Factory<StiHit>*hitFactory,
44  Detector * detector);
45  virtual ~StiHitLoader();
46  virtual void loadEvent(Source1 *source1,
47  Filter<StiTrack> * trackFilter,
48  Filter<StiHit> * hitFilter);
49  virtual void loadHits(Source1 * source,
50  Filter<StiTrack> * trackFilter,
51  Filter<StiHit> * hitFilter);
52  virtual void setHitContainer(StiHitContainer* hitContainer);
53  virtual void setHitFactory(Factory<StiHit>*hitFactory);
54  virtual void setDetector(Detector*detector);
55  void setMaxTimes(int nMaxTimes){_hitContainer->setMaxTimes(nMaxTimes);}
56  virtual Detector* getDetector();
57  protected:
58  StiHitContainer * _hitContainer;
59  StiTrackContainer * _trackContainer;
60  Factory<StiHit> * _hitFactory;
61  Factory<StiKalmanTrack> * _trackFactory;
62  Detector * _detector;
63 };
64 
65 template<class Source1, class Detector>
67  : Named(name),
68  _hitContainer(StiToolkit::instance()->getHitContainer()),
69  _trackContainer(StiToolkit::instance()->getTrackContainer()),
70  _hitFactory(StiToolkit::instance()->getHitFactory()),
71  _trackFactory(StiToolkit::instance()->getTrackFactory()),
72  _detector(0)
73 {}
74 
75 template<class Source1, class Detector>
77  StiHitContainer* hitContainer,
78  Factory<StiHit>*hitFactory,
79  Detector * detector)
80  : Named(name),
81  _hitContainer(hitContainer),
82  _trackContainer(StiToolkit::instance()->getTrackContainer()),
83  _hitFactory(hitFactory),
84  _trackFactory(StiToolkit::instance()->getTrackFactory()),
85  _detector(detector)
86 {}
87 
88 template<class Source1, class Detector>StiHitLoader<Source1, Detector>::~StiHitLoader(){}
89 
90 template<class Source1, class Detector>
91 void StiHitLoader<Source1, Detector>::loadEvent(Source1 *source1,
92  Filter<StiTrack> * trackFilter,
93  Filter<StiHit> * hitFilter)
94 {
95 }
96 
97 template<class Source1, class Detector>
99 {
100  _hitContainer = hitContainer;
101 }
102 
103 
104 template<class Source1, class Detector>
106 {
107  _hitFactory = hitFactory;
108 }
109 
110 template<class Source1,class Detector>
111 void StiHitLoader<Source1,Detector>::setDetector(Detector *detector)
112 {
113  _detector = detector;
114 }
115 
116 template<class Source1,class Detector>
118 {
119  return _detector;
120 }
121 
122 
123 template<class Source1,class Detector>
124 void StiHitLoader<Source1,Detector>::loadHits(Source1 * source,
125  Filter<StiTrack> * trackFilter,
126  Filter<StiHit> * hitFilter)
127 {
128 }
129 
130 #endif
131 
Abstract definition of a Track.
Definition: StiTrack.h:59
Definition: StiHit.h:51
Definition: Named.h:16
Abstract interface for a STI toolkit.
Definition of toolkit.
Definition: StiToolkit.h:55
void setMaxTimes(int nTimes)
Set max time for all hits.