source: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx@ 3570

Last change on this file since 3570 was 3506, checked in by moralejo, 21 years ago
*** empty log message ***
File size: 7.0 KB
Line 
1#ifndef __MMcEvt__
2#define __MMcEvt__
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8class MMcEvt : public MParContainer
9{
10public:
11 //
12 // ParticleId for Monte Carlo simulation
13 //
14 enum ParticleId_t
15 {
16 kGAMMA = 1,
17 kPOSITRON = 2,
18 kELECTRON = 3,
19 kPROTON = 14,
20 kHELIUM = 402,
21 kOXYGEN = 1608,
22 kIRON = 5626
23 };
24
25private:
26 UInt_t fEvtNumber;
27 UShort_t fPartId; // Type of particle
28 Float_t fEnergy; // [GeV] Energy
29 Float_t fThick0; // [g/cm2]
30 Float_t fFirstTarget; // []
31 Float_t fZFirstInteraction; // [cm]
32
33 Float_t fTheta; // [rad] Theta angle of event
34 Float_t fPhi; // [rad] Phi angle of event (see class description)
35
36 Float_t fCoreD; // [cm] Core d pos
37 Float_t fCoreX; // [cm] Core x pos
38 Float_t fCoreY; // [cm] Core y pos
39 Float_t fImpact; // [cm] impact parameter
40
41 // Up to here, the info from the CORSIKA event header.
42
43 // Telescope orientation:
44 Float_t fTelescopePhi; // [rad] (see class description)
45 Float_t fTelescopeTheta; // [rad]
46
47 // Time of first and last photon:
48 Float_t fTimeFirst; // [ns]
49 Float_t fTimeLast; // [ns]
50
51 // 6 parameters and chi2 of the NKG fit to the longitudinal
52 // particle distribution. See CORSIKA manual for explanation,
53 // section 4.42 "Longitudinal shower development":
54 //
55 Float_t fLongiNmax; // [particles]
56 Float_t fLongit0; // [g/cm2]
57 Float_t fLongitmax; // [g/cm2]
58 Float_t fLongia; // [g/cm2]
59 Float_t fLongib; // []
60 Float_t fLongic; // [cm2/g]
61 Float_t fLongichi2;
62
63 UInt_t fPhotIni; // [ph] Initial number of photons
64 UInt_t fPassPhotAtm; // [ph] Passed atmosphere
65 UInt_t fPassPhotRef; // [ph] Passed reflector(reflectivity + effective area)
66 UInt_t fPassPhotCone; // [ph] Passed glas
67 UInt_t fPhotElfromShower; // [phe] Passed qe coming from the shower
68 UInt_t fPhotElinCamera; // [phe] usPhotElfromShower + mean of phe
69 // from NSB
70
71 // Now follow the fraction of photons reaching the camera produced by
72 // electrons, muons and other particles respectively:
73
74 Float_t fElecCphFraction;
75 Float_t fMuonCphFraction;
76 Float_t fOtherCphFraction;
77
78
79
80 public:
81 MMcEvt() ;
82
83 MMcEvt( UInt_t, UShort_t, Float_t, Float_t, Float_t,
84 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
85 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
86 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
87 UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t,
88 Float_t, Float_t, Float_t) ;
89
90 ~MMcEvt();
91
92 void Clear(Option_t *opt=NULL);
93
94 void Fill( UInt_t, UShort_t, Float_t, Float_t, Float_t,
95 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
96 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
97 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
98 UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t,
99 Float_t, Float_t, Float_t) ;
100
101 //virtual void AsciiWrite(ofstream &fout) const;
102
103 void Print(Option_t *opt=NULL) const;
104
105 UInt_t GetEvtNumber() const { return fEvtNumber; } //Get Event Number
106 Short_t GetPartId() const { return fPartId; } //Get Type of particle
107 Float_t GetEnergy() const { return fEnergy; } //Get Energy
108
109 Float_t GetTheta() const { return fTheta; } //Get Theta angle
110 Float_t GetPhi() const { return fPhi ; } //Get Phi angle
111
112/* Float_t GetCoreD() { return fCoreD; } //Get Core d pos */
113 Float_t GetCoreX() { return fCoreX; } //Get Core x pos
114 Float_t GetCoreY() { return fCoreY; } //Get Core y pos
115 Float_t GetImpact() const { return fImpact;} //Get impact parameter
116
117 UInt_t GetPhotIni() { return fPhotIni; } //Get Initial photons
118 UInt_t GetPassPhotAtm() { return fPassPhotAtm;} //Get Passed atmosphere
119 UInt_t GetPassPhotRef() { return fPassPhotRef; } //Get Passed reflector
120 UInt_t GetPassPhotCone() { return fPassPhotCone; } //Get Passed glas
121 UInt_t GetPhotElfromShower() { return fPhotElfromShower; } //Get Passed qe from shower
122 UInt_t GetPhotElinCamera() { return fPhotElinCamera; } //Get Passed qe total
123 Float_t GetZFirstInteraction() const { return fZFirstInteraction; }
124
125 Float_t GetTelescopePhi() const { return fTelescopePhi; }
126 Float_t GetTelescopeTheta() const { return fTelescopeTheta; }
127 Float_t GetOtherCphFraction() const { return fOtherCphFraction; }
128
129 Float_t GetLongiNmax() const { return fLongiNmax; }
130 Float_t GetLongia() const { return fLongia; }
131 Float_t GetLongib() const { return fLongib; }
132 Float_t GetLongic() const { return fLongic; }
133 Float_t GetLongichi2() const { return fLongichi2; }
134 Float_t GetLongit0() const { return fLongit0; }
135 Float_t GetLongitmax() const { return fLongitmax; }
136
137 void SetPartId(Short_t PartId)
138 {fPartId=PartId;} //Set Type of particle
139
140 TString GetParticleName() const
141 {
142 switch (fPartId)
143 {
144 case kGAMMA: return "Gamma";
145 case kPOSITRON: return "Positron";
146 case kELECTRON: return "Electron";
147 case kPROTON: return "Proton";
148 case kHELIUM: return "Helium";
149 case kOXYGEN: return "Oxygen";
150 case kIRON: return "Iron";
151 }
152
153 return Form("%d", fPartId);
154 }
155 TString GetEnergyStr() const
156 {
157 if (fEnergy>1000)
158 return Form("%.1fTeV", fEnergy/1000);
159
160 if (fEnergy>10)
161 return Form("%dGeV", (Int_t)(fEnergy+.5));
162
163 if (fEnergy>1)
164 return Form("%.1fGeV", fEnergy);
165
166 return Form("%dMeV", (Int_t)(fEnergy*1000+.5));
167 }
168
169 void SetEnergy(Float_t Energy)
170 { fEnergy=Energy; } //Set Energy
171
172 void SetTheta(Float_t Theta)
173 { fTheta=Theta; } //Set Theta angle
174
175 void SetPhi(Float_t Phi)
176 { fPhi=Phi; } //Set Phi angle
177
178 void SetCoreD(Float_t CoreD)
179 { fCoreD=CoreD; } //Set Core d pos
180
181 void SetCoreX(Float_t CoreX)
182 { fCoreX=CoreX; } //Set Core x pos
183
184 void SetCoreY(Float_t CoreY )
185 { fCoreY=CoreY; } //Set Core y pos
186
187 void SetImpact(Float_t Impact)
188 { fImpact=Impact;} //Set impact parameter
189
190 // DO NOT USE THIS IS A WORKAROUND!
191 void SetTelescopeTheta(Float_t Theta) { fTelescopeTheta=Theta; }
192 void SetTelescopePhi(Float_t Phi) { fTelescopePhi=Phi; }
193
194
195/* void SetPhotIni(Short_t PhotIni) */
196/* { fPhotIni=PhotIni; } //Set Initial photons */
197/* void SetPassPhotAtm(Short_t PassPhotAtm) */
198/* { fPassPhotAtm=PassPhotAtm;} //Set Passed atmosphere */
199/* void SetPassPhotRef(Short_t PassPhotRef) */
200/* { fPassPhotRef=PassPhotRef ; } //Set Passed reflector */
201/* void SetPassPhotCone(Short_t PhotCon) */
202/* { fPassPhotCone=PhotCon; } //Set Passed glas */
203
204
205 ClassDef(MMcEvt, 3) //Stores Montecarlo Information of one event (eg. the energy)
206
207};
208
209#endif
210
211
212
213
214
Note: See TracBrowser for help on using the repository browser.