source: JEM-EUSO/esaf_cc_at_lal/packages/simulation/generators/showers/include/ShowerTrack.hh @ 114

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

actual version of ESAF at CCin2p3

File size: 7.5 KB
Line 
1// $Id: ShowerTrack.hh 2993 2011-10-04 12:18:58Z mabl $
2// Alessandro Thea, Sergio Bottai, Dmitry Naumov 23/11/2003
3
4/*****************************************************************************
5 * ESAF: Euso Simulation and Analysis Framework                              *
6 *                                                                           *
7 *  Id: ShowerTrack                                                          *
8 *  Package: Shower                                                          *
9 *  Coordinator: Sergio.Bottai, Dmitry.Naumov                                *
10 *                                                                           *
11 *****************************************************************************/
12
13#ifndef __SHOWERTRACK_HH__
14#define __SHOWERTRACK_HH__
15
16#include "euso.hh"
17#include "PhysicsData.hh"
18#include "ShowerStep.hh"
19#include "EVector.hh"
20#include "EsafMsgSource.hh"
21
22#include <TH1F.h>
23#include <TH2F.h>
24#include <TH3F.h>
25#include <TF2.h>
26#include <vector>
27
28class UnisimFileShowerGenerator;
29class SlastShowerGenerator;
30class SlastLightToEuso;
31class ShowerTrack;
32
33
34////////////////////////////////////////////////////////////////////////////////
35//                                                                            //
36// ShowerTrack                                                                //
37//                                                                            // 
38// <brief class description>                                                  // 
39//                                                                            // 
40////////////////////////////////////////////////////////////////////////////////
41
42
43class ShowerTrack : public PhysicsData, public EsafMsgSource {
44public:
45    // ctor
46    ShowerTrack();
47
48    // dtor
49    virtual ~ShowerTrack();
50
51    // Reset the shower track information
52    void Reset();
53
54    // add the new step
55    void   Add( ShowerStep step );
56
57    // Cleaning the memory from all histos associated to the track
58    Bool_t Clear();
59
60    // Checking that the track does not contain infinities and so funny things
61    Bool_t CheckTrack();
62   
63    // return the  Number of steps
64    inline UInt_t   GetNumStep() const { return fSteps.size(); }
65
66    // return the  Energy Threshold of electrons
67    inline Double_t GetEthrEl() const { return fEthrEl; }
68
69    // return the  Direction versor in MES of the track axis
70    inline EVector  GetDirVers() const { return fDirVers; }
71
72    // returns the  first interaction position in the MES frame
73    inline EVector  GetInitPos() const { return fInitPos; } 
74
75    // returns true if shower can hit ground in Euso FoV
76    inline Bool_t   GetHitGround() const { return fHitGround; }
77   
78    // returns the UHECR energy
79    inline Double_t GetEnergy() const {return fEnergy; }
80
81    // returns the UHECR Theta
82    inline Double_t GetTheta() const {return fTheta; }
83
84    // returns the UHECR Phi
85    inline Double_t GetPhi() const {return fPhi; }
86
87    // returns the UHECR first interaction depth
88    inline Double_t GetX1() const {return fX1; }
89   
90    // return the i-th step of the shower
91    const ShowerStep& GetStep( UInt_t ) const;
92   
93    // return last step of the shower
94    const ShowerStep& GetLastStep(  ) const;
95
96    // return the i-th step using an operator
97    const ShowerStep& operator[]( UInt_t ) const;
98
99    // returns all steps in the track
100    const vector<ShowerStep>& GetSteps( ) const;
101
102    // returns number of steps in the track
103    inline UInt_t Size() const { return fSteps.size(); }
104
105    // Draw 3D of the track. Can be usefull for debug, visualizations etc
106    void DrawXYZ(Option_t *opt="box");
107   
108    // Draw 2D of the track. Can be usefull for debug, visualizations etc
109    void DrawXY(Option_t *opt="colz");
110
111    // update the Track to the density profile of the atmosphere currently setted in ESAF
112
113    void AtmUpdateTrack() ;
114   
115    // return resp. entry of the first ShowerStep and exit of the last
116    EarthVector FirstPos() const;
117    EarthVector LastPos() const;
118
119    // Get Pointer to the energy distribution of electrons in the shower
120    static TF2* GetEnergyDistribution(TString);
121
122    // GetLateralDistribution returns a pointer to a TF2 function dNe/dx(x,age)
123    // where x is  x=D/Ro with D = distance to shower axis and Ro=moliere
124    // radius (depending on density).  The integration of dNe/dx(x,age) over dx
125    // from 0 to infinity is normalized to 1
126    // The integral from x=x1=D1/Ro to  x=x2=D2/Ro gives the fraction of
127    // total number of electrons which lie inside such corona identified by
128    // the interval D2-D1 in the distance from the shower axis.*/
129    static TF2* GetLateralDistribution(TString);
130
131    // GetAngularDistribution returns a pointer to a TF2 function
132    // dNe/dtheta(theta,Et) where theta is the
133    // angle between the electrons and the shower axis and Et (MeV) is the
134    // energy thr for electrons considered.
135    // The integration of dNe/dtheta(theta,Et) over dtheta from 0 to pi is
136    // normalized to 1.  The integral from theta1 to theta2 give the fraction
137    // of total number of electrons which lie inside
138    // such angular interval (distribution in phi is supposed  uniform).
139    static TF2* GetAngularDistribution(TString);
140
141    Int_t  GetNumEnergyHistos()         {return fNumEnergyHistos;}
142    Int_t  GetNumLateralHistos()        {return fNumLateralHistos;}
143    void   SetNumEnergyHistos(Int_t n)  {fNumEnergyHistos = n;}
144    void   SetNumLateralHistos(Int_t n) {fNumLateralHistos = n;}
145   
146private:
147    vector<ShowerStep>  fSteps;    // vector of ShowerStep's
148    Double_t            fEnergy;   // UHECR energy
149    Double_t            fTheta;    // UHECR Theta
150    Double_t            fPhi;      // UHECR Phi
151    Double_t            fX1;       // UHECR first interaction depth
152    Double_t            fEthrEl;   // Energy Threshold of electrons
153    EVector             fDirVers;  // Unit vector of the track direction
154    EVector             fInitPos;  // first interaction point (3D coord, meters) in MES
155    EVector             fEarthImpact;// Impact point on the Earth if any
156    Bool_t              fHitGround;// kTRUE is the track can hit the Ground in EUSO FoV, kFALSE otherwise
157   
158    Int_t               fNumEnergyHistos; // number of energy distribution histograms
159    Int_t               fNumLateralHistos; // number of lateral distribution histograms
160    static TF2* fEnergyAgeDistributionDefault; // default 2d function of energy and age distribution
161    static TF2* fEnergyAgeDistributionHillas;  // hillas 2d function of energy and age distribution
162    static TF2* fEnergyAgeDistributionNerling; // nerling 2d function of energy and age distribution
163    static TF2* fEnergyAgeDistributionMelot;   // melot 2d function of energy and age distribution
164    static TF2* fEnergyAgeDistributionGiller;  // giller 2d function of energy and age distribution
165   
166    static TF2* fLateralDistributionDefalt;    // default 2d function of lateral distribution
167    static TF2* fLateralDistribution1;         // NKG1 2d function of lateral distribution
168    static TF2* fLateralDistribution2;         // NKG 2d function of lateral distribution
169    static TF2* fLateralDistribution3;         // NKGhadron 2d function of lateral distribution
170
171    static TF2* fAngularDistribution1;         // 2d angular distribution
172
173    friend class UnisimFileShowerGenerator;
174    friend class CorsikaFileShowerGenerator;
175    friend class SlastShowerGenerator;
176    friend class SlastLightToEuso;
177    friend class ConexFileShowerGenerator;
178
179    ClassDef(ShowerTrack,0)
180};
181
182#endif  /* __SHOWERTRACK_HH_ */
183
Note: See TracBrowser for help on using the repository browser.