1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: TrackDirection2Module.hh 2846 2010-04-18 06:09:05Z fenu $ |
---|
3 | // Author: elena Nov, 19 2004 |
---|
4 | |
---|
5 | /***************************************************************************** |
---|
6 | * ESAF: Euso Simulation and Analysis Framework * |
---|
7 | * * |
---|
8 | * Id: TrackDirection2Module * |
---|
9 | * Package: Fitting * |
---|
10 | * Coordinator: <coordinator> * |
---|
11 | * * |
---|
12 | *****************************************************************************/ |
---|
13 | |
---|
14 | #ifndef __TRACKDIRECTION2MODULE_HH_ |
---|
15 | #define __TRACKDIRECTION2MODULE_HH_ |
---|
16 | |
---|
17 | #include "euso.hh" |
---|
18 | #include "RecoModule.hh" |
---|
19 | #include <TVector3.h> |
---|
20 | |
---|
21 | class TDirectory; |
---|
22 | class RecoEvent; |
---|
23 | class RecoRootEvent; |
---|
24 | |
---|
25 | //////////////////////////////////////////////////////////////////////////////// |
---|
26 | // // |
---|
27 | // TrackDirection2Module // |
---|
28 | // // |
---|
29 | // Reconstruction module devoted to the search of the direction of the EAS // |
---|
30 | // track. // |
---|
31 | // In this version are implemented four different algorithms numerical and // |
---|
32 | // analytical, exact and approximate. // |
---|
33 | // For further details see the comments to the code and the documentation. // |
---|
34 | // // |
---|
35 | //////////////////////////////////////////////////////////////////////////////// |
---|
36 | |
---|
37 | struct ContainerData: public TObject { |
---|
38 | void Clear(Option_t* =0); |
---|
39 | void ClearMemory(); |
---|
40 | vector<TVector3> fPixXYZ; |
---|
41 | vector<TVector3> fPos; |
---|
42 | vector<TVector3> fErr; |
---|
43 | vector<TVector3> fSpPos; |
---|
44 | vector<TVector3> fSpErr; |
---|
45 | vector<TVector3> fSpPosSel; |
---|
46 | vector<Double_t> fTime; |
---|
47 | vector<Double_t> fTimeSel; |
---|
48 | vector<Double_t> fAlpha; |
---|
49 | vector<Double_t> fSigmaPhi; |
---|
50 | vector<Double_t> fSigmaTheta; |
---|
51 | vector<Double_t> fSigmaPhiSel; |
---|
52 | vector<Double_t> fSigmaThetaSel; |
---|
53 | vector<Int_t> fHits; |
---|
54 | vector<Int_t> fHitsSel; |
---|
55 | |
---|
56 | Int_t fNumPoints; |
---|
57 | Int_t fNumHits; |
---|
58 | |
---|
59 | TVector3 fCentroid; |
---|
60 | TVector3 fMedDir; |
---|
61 | TVector3 fVectorRmax; |
---|
62 | Double_t fMedTime,fMedAlpha; |
---|
63 | Int_t fApparentTimeLenght; |
---|
64 | Double_t fGtuLength; |
---|
65 | ClassDef(ContainerData,0) |
---|
66 | }; |
---|
67 | |
---|
68 | enum DirectionFitMethod { kAA1=1, kNE1, kAA2, kNE2, kAE1, kALL }; |
---|
69 | |
---|
70 | class TrackDirection2Module : public RecoModule { |
---|
71 | public: |
---|
72 | |
---|
73 | TrackDirection2Module();// ctor |
---|
74 | |
---|
75 | virtual ~TrackDirection2Module();// dtor |
---|
76 | |
---|
77 | virtual Bool_t Init();// Init method: called at the beginning of a run |
---|
78 | |
---|
79 | virtual Bool_t PreProcess();// called before each event process |
---|
80 | |
---|
81 | virtual Bool_t Process( RecoEvent* );// event processing |
---|
82 | |
---|
83 | virtual Bool_t PostProcess();// called after processing an event |
---|
84 | |
---|
85 | virtual Bool_t SaveRootData( RecoRootEvent* );// save root output |
---|
86 | |
---|
87 | virtual Bool_t Done();// called at the end of each run |
---|
88 | |
---|
89 | virtual void UserMemoryClean();// memory clean |
---|
90 | |
---|
91 | virtual void TmpMemoryClean();// memory clean |
---|
92 | |
---|
93 | EsafConfigClass(Reco, TrackDirection2Module) |
---|
94 | |
---|
95 | private: |
---|
96 | RecoEvent *fEv; |
---|
97 | |
---|
98 | vector<Int_t> fPointsId; |
---|
99 | |
---|
100 | vector<Double_t> vecDeltaEASDir; |
---|
101 | vector<Double_t> vecDeltaEASDirAA1; |
---|
102 | vector<Double_t> vecDeltaEASDirAA2; |
---|
103 | vector<Double_t> vecDeltaEASDirNE1; |
---|
104 | vector<Double_t> vecDeltaEASDirNE2; |
---|
105 | vector<Double_t> vecDeltaEASDirAE1; |
---|
106 | vector<Double_t> vecDeltaTDP; |
---|
107 | |
---|
108 | Int_t fNumPoints; |
---|
109 | Int_t fNumHits; |
---|
110 | Int_t fNumPointsSel; |
---|
111 | Int_t fNumHitsSel; |
---|
112 | Int_t fQuality; |
---|
113 | Int_t fRecoEventsCounter; |
---|
114 | |
---|
115 | ContainerData fData; |
---|
116 | |
---|
117 | TVector3 fCentroid; |
---|
118 | TVector3 fNorm; |
---|
119 | TVector3 fW; |
---|
120 | TVector3 fU; |
---|
121 | TVector3 fTrueDir; |
---|
122 | TVector3 fTrueNorm; |
---|
123 | TVector3 fTrueMax; |
---|
124 | TVector3 fEASDir; |
---|
125 | Double_t fAngularSpeed; |
---|
126 | Double_t fQAngularSpeed; |
---|
127 | Double_t fBeta,fBetaInit; |
---|
128 | Double_t fHmax, fRmax; |
---|
129 | Double_t fTrueTheta,fTruePhi; |
---|
130 | Double_t fTHETAloc,fTHETAreco,fPHIreco; |
---|
131 | Double_t fTmaxFit; |
---|
132 | Double_t fDeltaTheta,fDeltaPhi,fDeltaEASDir,fDeltaTDP; |
---|
133 | Double_t fDeltaEASDirAA1,fTHETArecoAA1,fPHIrecoAA1; |
---|
134 | Double_t fDeltaEASDirAA2,fTHETArecoAA2,fPHIrecoAA2; |
---|
135 | Double_t fDeltaEASDirNE1,fTHETArecoNE1,fPHIrecoNE1; |
---|
136 | Double_t fDeltaEASDirNE2,fTHETArecoNE2,fPHIrecoNE2; |
---|
137 | Double_t fDeltaEASDirAE1,fTHETArecoAE1,fPHIrecoAE1; |
---|
138 | Double_t fGTU; |
---|
139 | |
---|
140 | Double_t FindHmax( Double_t theta ); |
---|
141 | Double_t CalculateRmax( Double_t hmax ); |
---|
142 | void CalculatefromBetaEASdir(); |
---|
143 | void FindPlane(); |
---|
144 | void UseShapeandFindPlane(); |
---|
145 | void UseHoughandFindPlane(); |
---|
146 | |
---|
147 | //different algorithms to reconstruct EAS direction |
---|
148 | void AA1(); |
---|
149 | void NE1(); |
---|
150 | void AA2(); |
---|
151 | void NE2(); |
---|
152 | void AE1(); |
---|
153 | void All(); |
---|
154 | |
---|
155 | //search points over threshold (if no pattern recognition module has previously run) |
---|
156 | void FillPoints(Bool_t); |
---|
157 | |
---|
158 | // statistics of the reconstructed events |
---|
159 | void DoStat(vector<Double_t> err,string namemethod); |
---|
160 | |
---|
161 | //variables read by Init() and from config files |
---|
162 | Int_t fNumPointsMin; |
---|
163 | Int_t fNumHitsMinimum; |
---|
164 | Double_t fSignalToNoise; // take pixels with signal/sqrt(noise) >= fSignalToNoise number [valid for ProcessOnlySignal option] |
---|
165 | Int_t fNumPointsMax; // maximum number of points to process |
---|
166 | Bool_t fDoGraphUseShape; |
---|
167 | Bool_t fDoHough; |
---|
168 | Bool_t fOptionSelectionHough; |
---|
169 | Double_t fErrAngle; |
---|
170 | Double_t fHISS; // space station altitude |
---|
171 | Bool_t fDoShapeSelection; |
---|
172 | Bool_t fUseShapeSelectioninModules; |
---|
173 | DirectionFitMethod fMethodIdentifier; |
---|
174 | Bool_t fFixTmaxNumeric; |
---|
175 | Bool_t fAA1done; // true if the AA1module is already done |
---|
176 | Bool_t fAA1nan; // true if the AA1 method returns a nan |
---|
177 | Float_t fStat1,fStat2; |
---|
178 | Float_t fMulti1,fMulti2; |
---|
179 | Bool_t useLFplane, useMFplane, useHFplane, useRFplane; // fit method for TDP |
---|
180 | Bool_t useLFaa1, useMFaa1, useHFaa1, useRFaa1; // fit method in AA1 |
---|
181 | Bool_t fDebugInfo; // if true compute and display some debug infos |
---|
182 | |
---|
183 | // useful methods for math-geometrical calculus |
---|
184 | Double_t DeltaX(Double_t, Double_t, Double_t, Double_t); |
---|
185 | Double_t DeltaY(Double_t, Double_t, Double_t, Double_t); |
---|
186 | |
---|
187 | // gtu time-length in microseconds |
---|
188 | Double_t fGtuLength; |
---|
189 | |
---|
190 | Int_t fMinuitOutputLevel; // output level for TMinuit |
---|
191 | |
---|
192 | ClassDef(TrackDirection2Module,0) |
---|
193 | }; |
---|
194 | |
---|
195 | #endif /* __TrackDirection2MODULE_HH_ */ |
---|
196 | |
---|