PandaRoot
PndSttRecoHitProducer.h
Go to the documentation of this file.
1 #ifndef PNDSTTRECOHITPRODUCER_H
2 #define PNDSTTRECOHITPRODUCER_H
3 
4 #include <vector>
5 #include <map>
6 #include <assert.h>
7 #include <iostream>
8 
9 #include "TClonesArray.h"
10 #include "GFException.h"
11 #include "GFRecoHitProducer.h"
12 
13 class GFAbsRecoHit;
14 class TClonesArray;
15 
16 template <class hit_T, class recoHit_T>
18 
19  private:
20  TClonesArray *hitArrayTClones;
21  TClonesArray *tubeArrayTClones;
22 
23  public:
24  PndSttRecoHitProducer(TClonesArray *, TClonesArray *);
25  virtual ~PndSttRecoHitProducer();
26 
27  virtual GFAbsRecoHit *produce(int index);
28 };
29 
30 template <class hit_T, class recoHit_T>
31 PndSttRecoHitProducer<hit_T, recoHit_T>::PndSttRecoHitProducer(TClonesArray *theArr, TClonesArray *theTubeArr)
32 {
33  hitArrayTClones = theArr;
34  tubeArrayTClones = theTubeArr;
35 }
36 
37 template <class hit_T, class recoHit_T>
39 {
40 }
41 
42 template <class hit_T, class recoHit_T>
44 {
45  assert(hitArrayTClones != nullptr);
46  assert(tubeArrayTClones != nullptr);
47  if (hitArrayTClones->At(index) == 0) {
48  GFException e("In PndSttRecoHitProducer: index for hit in TClonesArray out of bounds", __LINE__, __FILE__);
49  e.setFatal();
50  throw e;
51  }
52 
53  return (new recoHit_T((hit_T *)hitArrayTClones->At(index), tubeArrayTClones));
54 }
55 
56 #endif
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:71
Abstract interface class for GFRecoHitProducer.
virtual GFAbsRecoHit * produce(int index)
Virtual abstract method to produce a RecoHit. Implemented in GFRecoHitProducer.
PndSttRecoHitProducer(TClonesArray *, TClonesArray *)
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:44
void setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:74