source: JEM-EUSO/esaf_lal/tags/v1_r0/esaf/packages/reconstruction/modules/shower/fitting/include/TrackDirectionModule.hh @ 117

Last change on this file since 117 was 117, checked in by moretto, 11 years ago

ESAF version compilable on mac OS

File size: 4.8 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: TrackDirectionModule.hh 2846 2010-04-18 06:09:05Z fenu $
3// R. Pesce created May, 11 2004
4// Reconstruction of direction of showers; based also on S. Bottai and E. Taddei algorithms.
5
6#ifndef __TRACKDIRECTIONMODULE_HH_
7#define __TRACKDIRECTIONMODULE_HH_
8
9#include "euso.hh"
10#include "RecoModule.hh"
11
12class TDirectory;
13class TF1;
14class RecoRootEvent;
15class TTree;
16class TMultiGraph;
17
18// container for beta fitting data
19struct TrackData: public TObject {
20    void Clear();
21
22    vector<Double_t> fAlpha;            // Angles
23    vector<Double_t> fTime;             // Arrival Times
24    vector<Double_t> fErrors;           // Uncertantlies
25    vector<Int_t> fHits;                // hits per pixel
26    Int_t fIdMin;                       // id of the first hit
27    Int_t fIdMax;                       // id of the last hit
28    Int_t fIdMostPop;                   // id of the most populated pixel
29    Int_t fNumPoints;                   // number of points
30    Int_t fNumHits;                     // number of hits
31    TVector3 fNorm;                     // TDP normal vector
32    TVector3 fWAxis;                    // TDP W axis
33    TVector3 fUAxis;                    // TDP U axis
34    Double_t fCsi;                      // angle between Z axis and Max direction
35    TF1* fTimeAtEuso;                   
36
37    ClassDef(TrackData,0)
38
39};
40
41class TrackDirectionModule : public RecoModule {
42public:
43    // ctor
44    TrackDirectionModule();
45
46    // dtor
47    virtual ~TrackDirectionModule();
48
49    Bool_t Init();
50    Bool_t PreProcess();
51    Bool_t Process(RecoEvent*);
52    Bool_t PostProcess();
53    Bool_t Done();
54    // save root output
55    virtual Bool_t SaveRootData( RecoRootEvent* );
56
57    void UserMemoryClean();
58
59    EsafConfigClass(Reco, TrackDirectionModule)
60
61private:
62    RecoEvent *fEv;             // Euso Event
63
64    Int_t fMinuitOutputLevel;   // minuit output display level
65   
66    Int_t fNum;                 // event number
67    vector<Int_t> fPointsId;    //
68    vector<TVector3> fSpPos;    // Incident dirs on the unitary sphere
69    TVector3 fNormTDP;          // TDP normal vector
70    TVector3 fWAxisTDP;         // TDP W axis
71    TVector3 fUAxisTDP;         // TDP U Axis
72    TVector3 fXAxisTDP;         // TDP X Axis
73    TVector3 fYAxisTDP;         // TDP Y Axis
74    TrackData fBetaData;        // container of data necessary to the fit function
75
76    Double_t fHISS;             // ISS height
77    Double_t fEarthRadius;
78    Double_t fGTU;
79
80    TF1 *fTimeAtEuso;
81
82    // Truth values
83    Double_t fTrueEnergy;
84    TVector3 fTrueDir;
85    Double_t fTrueHMax;         
86    Double_t fTrueBeta;
87    Double_t fBeta;
88    Double_t fBetaInit;
89    Double_t fHMax;
90    Double_t fErrorBeta;
91    Double_t fErrorBetaInit;
92    Double_t fErrorHMax;
93
94    Double_t fRMax;
95    Double_t fTrueRMax;
96
97    Double_t fR0;
98    Double_t fTrueR0;
99
100    Double_t fAlpha0;
101    Double_t fTrueAlpha0;
102
103    Double_t fAlphaMax;
104    Double_t fTrueAlphaMax;
105
106    Double_t fTau0;
107    Double_t fTrueTau0;
108    Double_t fTMax;
109
110    TVector3 fCenterPos;        // position in the field of view
111    Double_t fCenterX;
112    Double_t fCenterY;
113    Double_t fVisualAngle;      // angle beteween max position and shower direction
114    Double_t fDist;             // distance from center of FOV
115
116    //angular velocities
117    Double_t fOmega;               // angular velocity of shower (approx costant) with median fit
118    Double_t fOmegaLeast;          // angular velocity with least squares fit
119    Double_t fOmegaMean;           // mean angular velocity of shower
120    Double_t fOmegaFirst;          // angular velocity between maximum and first point
121    Double_t fOmegaLast;           // angular velocity between maximum and last point
122
123    // results of fit   
124    TVector3 fDir;
125    Double_t fTrueTheta;
126    Double_t fTrueThetaInc;
127    Double_t fTruePhi;
128    Double_t fTheta;
129    Double_t fThetaInc;
130    Double_t fThetaInit;
131    Double_t fPhi;
132    Double_t fPhiInit;
133    Double_t fErrorDirection;
134    Double_t fErrorDirectionInit;
135    Double_t fErrorTheta;
136    Double_t fErrorThetaInit;
137    Double_t fErrorPhi;
138    Double_t fErrorPhiInit;
139    Double_t fErrorPlane;
140
141    Int_t fNumPoints;
142    Int_t fNumHits;
143   
144    // Helpers
145    void FillBetaData();
146    void UseApprox();
147    void UseExact();
148    void PrintBeta();
149    Double_t CalculateRMax(Double_t hmax);
150   
151
152    // vectors for graph and graph2d
153    vector<Float_t> fEASCenterX;
154    vector<Float_t> fEASCenterY;
155    vector<Float_t> fDirectionErrors;
156    vector<Float_t> fHMaxErrors;
157    vector<Float_t> fThetaErrors;
158    vector<Float_t> fPhiErrors;
159    vector<Float_t> fBetaErrors;
160    vector<Int_t>   fNumFastOr;
161    vector<Int_t>   fNumPhEl;
162    vector<Float_t> fPlaneErrors;
163    // Check info
164    TMultiGraph *fAll;
165    ClassDef(TrackDirectionModule,0)
166};
167
168#endif  /* __TRACKDIRECTIONMODULE_HH_ */
169
Note: See TracBrowser for help on using the repository browser.