PandaRoot
PndBarrelTrackFinder.h
Go to the documentation of this file.
1 //* $Id: */
2 
3 // -------------------------------------------------------------------------
4 // ----- PndBarrelTrackFinder header file -----
5 // ----- Created 05/12/2010 by R. Karabowicz -----
6 // -------------------------------------------------------------------------
7 
18 #ifndef PNDBARRELTRACKFINDER_H
19 #define PNDBARRELTRACKFINDER_H 1
20 
21 #include "PndPersistencyTask.h"
22 #include "FairHit.h"
23 #include "FairTSBufferFunctional.h"
24 
25 #include "TStopwatch.h"
26 #include "PndGeoSttPar.h"
27 
28 #include <list>
29 #include <map>
30 #include <vector>
31 
32 class TEllipse;
33 class TCanvas;
34 class TClonesArray;
35 class TLatex;
36 class PndGemDigiPar;
37 class TH1F;
38 
40  Double_t x;
41  Double_t y;
42  Double_t r;
43  Double_t z_phi;
44  Int_t n;
45  // x,y,r parameters of the circle,
46  // // p=atan(x/y),
47  // z_phi - z increase divided by phi angle increase,
48  // // p_1=atan(x_1/y_1) of the first hit,
49  // n='goodness' of parameter
50 };
51 
52 struct TrackBasis {
53  std::vector<TrackParameter> trackPars;
54  std::vector<FairHit *> trackHits;
55  std::vector<Int_t> trackHitD;
56  std::vector<Int_t> trackHitN;
57  Double_t meanX;
58  Double_t meanY;
59  Double_t meanR;
60  Double_t meanZ_Phi;
61 };
62 
64 
65  public:
68 
70  PndBarrelTrackFinder(Int_t iVerbose);
71 
73  PndBarrelTrackFinder(const char *name, Int_t iVerbose);
74 
76  virtual ~PndBarrelTrackFinder();
77 
79  virtual void Exec(Option_t *opt);
80 
81  void UseMvdSttGem(const Bool_t useMvd, const Bool_t useStt, const Bool_t useGem);
82 
83  void DrawDetails(Bool_t tb = kTRUE) { fDrawDetails = tb; }
84  void DrawHistos(Bool_t tb = kTRUE) { fDrawHistos = tb; }
85 
86  void SetRunTimeBased(Bool_t val = kTRUE) { fRunTimeBased = val; }
87 
88  private:
89  Bool_t fRunTimeBased;
90  StopTime *fFunctor;
91  double fStopTimeValue;
92 
93  Bool_t fDrawDetails;
94  Bool_t fDrawHistos;
95  TEllipse *fEllipse[1000];
96  TCanvas *fCanvas;
97  TLatex *fStageDesc;
98  TH1F *fClonesXDiff;
99  TH1F *fClonesYDiff;
100  TH1F *fClonesRDiff;
101  TH1F *fClonesZ_PhiDiff;
102  TH1F *fClonesXDiffRel;
103  TH1F *fClonesYDiffRel;
104  TH1F *fClonesRDiffRel;
105  TH1F *fClonesZ_PhiDiffRel;
106 
107  TH1F *fhHitDist[5][3];
108 
109  std::vector<TrackBasis> fTracksVector;
110 
111  std::vector<Int_t> fHitDetId;
112  std::vector<Int_t> fHitDetNo;
113  // previous hits
114  std::vector<FairHit *> fHitVector;
115  std::vector<Int_t> fHitVectDI;
116  std::vector<Int_t> fHitVectHN;
117 
118  Bool_t fIncludeDet[4];
119  TClonesArray *fHitArray[4];
120  TString fDetName[4];
121  Int_t fDetType[4];
122  TString fHitArrayName[4];
123 
125  TClonesArray *fBarrelTrackArray;
126  TClonesArray *fBarrelTrackCandArray;
127 
129  Int_t fTNofEvents;
130  Int_t fTNofTracks;
131 
132  double fRadToMomConversion;
133 
134  Double_t fMaximalDist;
135  Double_t fReasonableDist;
136  Double_t fMaximalZ_PhiD;
137  Double_t fReasonableZ_PhiD;
138  Double_t fMaximalRadDiff;
139  Double_t fMaximalPhiDiff;
140 
141  Bool_t MatchHitToTrack(FairHit *thisHit, Int_t detId, Int_t hitNo, Int_t trackNo);
142  Bool_t MatchSkewedSttHitTT(FairHit *thisHit, Int_t detId, Int_t hitNo, Int_t trackNo);
143  Bool_t MatchParallelSttHitTT(FairHit *thisHit, Int_t detId, Int_t hitNo, Int_t trackNo);
144  Bool_t MatchHitWithZInfoTT(FairHit *thisHit, Int_t detId, Int_t hitNo, Int_t trackNo);
145 
146  Bool_t ExtractMeanRPhiFromTrack(Int_t trackNo);
147  Bool_t ExtractMeanZ_PhiFromTrack(Int_t trackNo);
148 
149  Bool_t MatchHitToHit(FairHit *thisHit, Int_t detId, Int_t hitNo, Int_t prevHNo);
150  void RemoveHitFromPreviousHits(Int_t hitNo);
151 
152  Bool_t HitBelongsToTrack(Int_t detId, Int_t hitNo, Int_t trackNo);
153 
154  void AddHitToPreviousHits(FairHit *thisHit, Int_t detId, Int_t hitNo);
155 
156  void DrawTracks();
157  void PrintTracks();
158  Int_t CleanTracks();
159  Int_t WriteTracks();
160 
161  void RemoveShortTracks();
162  void RemoveCloneTracks();
163 
164  Bool_t FindCircPar(Double_t *c1, Double_t *c2, Double_t *c3, Int_t cno, Double_t *cl);
165  Double_t FindCircDist(Double_t *c1, Double_t *c2);
166  Int_t FindInterestingRegions(Double_t *circ, Double_t *tube, Double_t *reg);
167 
168  Double_t CalcPhi(Double_t x, Double_t y);
169  Double_t CalcZ_Phi(Double_t *circ, Double_t hx, Double_t hy, Double_t hz);
170 
172  virtual void SetParContainers();
173  // CHECK added
175  TClonesArray *fTubeArray;
176  PndGeoSttPar *fSttParameters; // CHECK added
177  Int_t fGeoType;
178 
180  virtual InitStatus Init();
181 
183  virtual InitStatus ReInit();
184 
186  void Reset();
187 
189  virtual void Finish();
190 
191  ClassDef(PndBarrelTrackFinder, 1);
192 };
193 
194 #endif
void DrawHistos(Bool_t tb=kTRUE)
Digitization Parameter Class for GEM part.
Definition: PndGemDigiPar.h:30
std::vector< Int_t > trackHitD
std::vector< FairHit * > trackHits
std::vector< Int_t > trackHitN
void DrawDetails(Bool_t tb=kTRUE)
void SetRunTimeBased(Bool_t val=kTRUE)
std::vector< TrackParameter > trackPars