1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // CorsikaFileShowerGenerator.hh |
---|
3 | |
---|
4 | #ifndef __CORSIKAFILESHOWERGENERATOR_HH_ |
---|
5 | #define __CORSIKAFILESHOWERGENERATOR_HH_ |
---|
6 | |
---|
7 | #include "euso.hh" |
---|
8 | #include "EventGenerator.hh" |
---|
9 | #include "Config.hh" |
---|
10 | #include "ShowerTrack.hh" |
---|
11 | #include "EsafMsgSource.hh" |
---|
12 | #include "EConst.hh" |
---|
13 | |
---|
14 | |
---|
15 | class PhysicsData; |
---|
16 | class ShowerTrack; |
---|
17 | class MCTruth; |
---|
18 | |
---|
19 | |
---|
20 | class CorsikaFileShowerGenerator : public EventGenerator , public EsafMsgSource |
---|
21 | { |
---|
22 | public: |
---|
23 | // ctor |
---|
24 | CorsikaFileShowerGenerator(); |
---|
25 | |
---|
26 | // dtor |
---|
27 | virtual ~CorsikaFileShowerGenerator(); |
---|
28 | |
---|
29 | // get a new event |
---|
30 | PhysicsData *Get(); |
---|
31 | |
---|
32 | // get pointer to MonteCarlo Truth |
---|
33 | MCTruth *GetTruth(); |
---|
34 | |
---|
35 | // get ready for next event |
---|
36 | virtual void Reset() {} //FIXME : to be implemented |
---|
37 | |
---|
38 | virtual void ReplaceInputFile(const char*, const char* ); |
---|
39 | |
---|
40 | void Open(); |
---|
41 | void Close(); |
---|
42 | // read Corsika Output Files |
---|
43 | void ReadParticleHeader(); |
---|
44 | void ReadLong(); |
---|
45 | |
---|
46 | float GetAltitude(float); |
---|
47 | float GetThickness(float); |
---|
48 | float GetCoeff(float); |
---|
49 | float GetXstep(float); |
---|
50 | float GetYstep(float); |
---|
51 | float GetStepTime(float); |
---|
52 | float GetAge(float); |
---|
53 | |
---|
54 | |
---|
55 | EsafConfigClass(Generators, CorsikaFileShowerGenerator) |
---|
56 | |
---|
57 | private: |
---|
58 | |
---|
59 | |
---|
60 | ShowerTrack *fTrack; |
---|
61 | ShowerStep fStep; |
---|
62 | FILE* fParticleFile; |
---|
63 | FILE* fLongFile; |
---|
64 | |
---|
65 | MCTruth *fTruth; |
---|
66 | string fParticleFileName, fLongFileName; |
---|
67 | bool LoadTrack(Int_t) ; |
---|
68 | bool LoadHeader() ; |
---|
69 | |
---|
70 | map<string,double> fHeader; |
---|
71 | |
---|
72 | string thinning; |
---|
73 | double howmany; |
---|
74 | double r; |
---|
75 | |
---|
76 | multimap<int,float> particle; |
---|
77 | multimap<int,float>::iterator pnum; |
---|
78 | |
---|
79 | float vertical_distance; |
---|
80 | float coeff_i, coeff_f; |
---|
81 | float xi, xf, yi, yf, zi, zf; |
---|
82 | float z_firstint, thick_firstint; |
---|
83 | float epolangd, eaziangd; |
---|
84 | float timei, timef; |
---|
85 | float distance; |
---|
86 | float energy; |
---|
87 | float thickness; |
---|
88 | float Nemax, to, tmax; |
---|
89 | |
---|
90 | float eldircos, emdircos, endircos; |
---|
91 | |
---|
92 | float x0comes, y0comes, z0comes; |
---|
93 | |
---|
94 | size_t nin, nkey; |
---|
95 | char header[4]; |
---|
96 | int i,j, k; |
---|
97 | int n1, n2, nmax; |
---|
98 | |
---|
99 | Int_t nev_an; |
---|
100 | Int_t ev_num, event; |
---|
101 | |
---|
102 | long int pos; |
---|
103 | |
---|
104 | char longitudinal[150]; |
---|
105 | |
---|
106 | float xmax, ymax, zmax; |
---|
107 | float nstep; |
---|
108 | float step_long; |
---|
109 | int nshow; |
---|
110 | float part[10], en[10]; |
---|
111 | float step[6]; |
---|
112 | float aatm[5], batm[5], catm[5]; |
---|
113 | |
---|
114 | ClassDef(CorsikaFileShowerGenerator,0) |
---|
115 | }; |
---|
116 | |
---|
117 | #endif /* __CORSIKAFILESHOWERGENERATOR_HH_ */ |
---|
118 | |
---|