FairRoot/PandaRoot
PndFtsRecoHitProducer.h
Go to the documentation of this file.
1 #ifndef PNDFTSRECOHITPRODUCER_H
2 #define PNDFTSRECOHITPRODUCER_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 
25  PndFtsRecoHitProducer(TClonesArray*, TClonesArray*);
26  virtual ~PndFtsRecoHitProducer();
27 
28  virtual GFAbsRecoHit* produce(int index);
29 };
30 
31 template <class hit_T,class recoHit_T>
32  PndFtsRecoHitProducer<hit_T,recoHit_T>::PndFtsRecoHitProducer(TClonesArray* theArr, TClonesArray* theTubeArr) {
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  assert(hitArrayTClones!=NULL);
45  assert(tubeArrayTClones!=NULL);
46  if(hitArrayTClones->At(index) == 0) {
47  GFException e("In PndFtsRecoHitProducer: index for hit in TClonesArray out of bounds",__LINE__,__FILE__);
48  e.setFatal();
49  throw e;
50  }
51 
52  return ( new recoHit_T( (hit_T*) hitArrayTClones->At(index), tubeArrayTClones ) );
53 }
54 
55 
56 #endif
57 
58 
virtual GFAbsRecoHit * produce(int index)
Virtual abstract method to produce a RecoHit. Implemented in GFRecoHitProducer.
Base Class for representing a Hit in GENFIT.
Definition: GFAbsRecoHit.h:73
Abstract interface class for GFRecoHitProducer.
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:45
PndFtsRecoHitProducer(TClonesArray *, TClonesArray *)
void setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:77