source: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx@ 1580

Last change on this file since 1580 was 1580, checked in by blanch, 22 years ago
*** empty log message ***
File size: 5.4 KB
Line 
1#include "MMcEvt.hxx"
2
3#include "MLog.h"
4#include "MLogManip.h"
5
6//==========
7// MMcEvt
8//
9// This class handles and contains the MonteCarlo information
10// with which the events have been generated
11// This information exists for each event.
12
13
14
15ClassImp(MMcEvt);
16
17
18
19MMcEvt::MMcEvt()
20{
21 //
22 // default constructor
23 // set all values to zero
24 fName = "MMcEvt";
25 fTitle = "Event info from Monte Carlo";
26
27 Clear();
28}
29
30MMcEvt::MMcEvt( Float_t fEvtNum,
31 UShort_t usPId,
32 Float_t fEner,
33 Float_t fThi0,
34 Float_t fFirTar,
35 Float_t fzFirInt,
36 Float_t fThet,
37 Float_t fPhii,
38 Float_t fCorD,
39 Float_t fCorX,
40 Float_t fCorY,
41 Float_t fImpa,
42 Float_t fTPhii,
43 Float_t fTThet,
44 Float_t fTFirst,
45 Float_t fTLast,
46 Float_t fL_Nmax,
47 Float_t fL_t0,
48 Float_t fL_tmax,
49 Float_t fL_a,
50 Float_t fL_b,
51 Float_t fL_c,
52 Float_t fL_chi2,
53 UInt_t uiPin,
54 UInt_t uiPat,
55 UInt_t uiPre,
56 UInt_t uiPco,
57 UInt_t uiPelS,
58 UInt_t uiPelC ) {
59
60 fName = "MMcEvt";
61 fTitle = "Event info from Monte Carlo";
62 //
63 // constuctor II
64 //
65 // All datamembers are parameters.
66 //
67 // Don't use this memberfunction in analysis
68 //
69
70 fEvtNumber = fEvtNum;
71 fPartId = usPId ;
72 fEnergy = fEner ;
73 fThick0 = fThi0;
74 fFirstTarget = fFirTar;
75 fzFirstInt = fzFirInt;
76
77 fTheta = fThet ;
78 fPhi = fPhii ;
79
80 fCoreD = fCorD ;
81 fCoreX = fCorX ;
82 fCoreY = fCorY ;
83 fImpact = fImpa ;
84
85 ftelescopePhi = fTPhii;
86 ftelescopeTheta = fTThet;
87 fTimeFirst = fTFirst;
88 fTimeLast = fTLast;
89 flongi_Nmax = fL_Nmax;
90 flongi_t0 = fL_t0;
91 flongi_a = fL_a;
92 flongi_b = fL_b;
93 flongi_c = fL_c;
94 flongi_chi2 = fL_chi2;
95
96
97 fPhotIni = uiPin ;
98 fPassPhotAtm = uiPat ;
99 fPassPhotRef = uiPre ;
100 fPassPhotCone = uiPco ;
101 fPhotElfromShower = uiPelS ;
102 fPhotElinCamera = uiPelC ;
103}
104
105
106
107MMcEvt::~MMcEvt() {
108 //
109 // default destructor
110 //
111}
112
113
114
115
116void MMcEvt::Clear(Option_t *opt)
117{
118 //
119 // reset all values to values as nonsense as possible
120 //
121 fPartId = 0;
122 fEnergy = -1;
123
124 fTheta = 0;
125 fPhi = 0;
126
127 fCoreD = 0;
128 fCoreX = 0;
129 fCoreY = 0;
130 fImpact = -1;
131
132 fPhotIni = 0;
133 fPassPhotAtm = 0;
134 fPassPhotRef = 0;
135 fPassPhotCone = 0;
136 fPhotElfromShower = 0;
137 fPhotElinCamera = 0;
138}
139
140void MMcEvt::Fill( Float_t fEvtNum,
141 UShort_t usPId,
142 Float_t fEner,
143 Float_t fThi0,
144 Float_t fFirTar,
145 Float_t fzFirInt,
146 Float_t fThet,
147 Float_t fPhii,
148 Float_t fCorD,
149 Float_t fCorX,
150 Float_t fCorY,
151 Float_t fImpa,
152 Float_t fTPhii,
153 Float_t fTThet,
154 Float_t fTFirst,
155 Float_t fTLast,
156 Float_t fL_Nmax,
157 Float_t fL_t0,
158 Float_t fL_tmax,
159 Float_t fL_a,
160 Float_t fL_b,
161 Float_t fL_c,
162 Float_t fL_chi2,
163 UInt_t uiPin,
164 UInt_t uiPat,
165 UInt_t uiPre,
166 UInt_t uiPco,
167 UInt_t uiPelS,
168 UInt_t uiPelC ) {
169 //
170 // All datamembers are filled with the correspondin parameters.
171 //
172 // Don't use this memberfunction in analysis
173 //
174
175 fEvtNumber = fEvtNum;
176 fPartId = usPId ;
177 fEnergy = fEner ;
178 fThick0 = fThi0;
179 fFirstTarget = fFirTar;
180 fzFirstInt = fzFirInt;
181
182 fTheta = fThet ;
183 fPhi = fPhii ;
184
185 fCoreD = fCorD ;
186 fCoreX = fCorX ;
187 fCoreY = fCorY ;
188 fImpact = fImpa ;
189
190 ftelescopePhi = fTPhii;
191 ftelescopeTheta = fTThet;
192 fTimeFirst = fTFirst;
193 fTimeLast = fTLast;
194 flongi_Nmax = fL_Nmax;
195 flongi_t0 = fL_t0;
196 flongi_a = fL_a;
197 flongi_b = fL_b;
198 flongi_c = fL_c;
199 flongi_chi2 = fL_chi2;
200
201 fPhotIni = uiPin ;
202 fPassPhotAtm = fPhotIni-uiPat ;
203 fPassPhotRef = fPassPhotAtm-uiPre ;
204 fPassPhotCone = uiPco ;
205 fPhotElfromShower = uiPelS ;
206 fPhotElinCamera = uiPelC ;
207}
208
209/*
210void MMcEvt::AsciiWrite(ofstream &fout) const
211{
212 fout << fEnergy << " ";
213 fout << fTheta ;
214}
215*/
216
217// --------------------------------------------------------------------------
218//
219// Print the contents of the container.
220//
221// if you specify an option only the requested data members are printed:
222// allowed options are:
223// id, energy, impact
224//
225void MMcEvt::Print(Option_t *opt) const
226{
227 //
228 // print out the data member on screen
229 //
230 TString str(opt);
231 if (str.IsNull())
232 {
233 *fLog << all << endl;
234 *fLog << "Monte Carlo output:" << endl;
235 *fLog << " Particle Id: ";
236 switch(fPartId)
237 {
238 case kGAMMA:
239 *fLog << "Gamma" << endl;
240 break;
241 case kPROTON:
242 *fLog << "Proton" << endl;
243 break;
244 case kHELIUM:
245 *fLog << "Helium" << endl;
246 break;
247 }
248 *fLog << " Energy: " << fEnergy << "GeV" << endl;
249 *fLog << " Impactpar.: " << fImpact/100 << "m" << endl;
250 *fLog << " Photoelectrons: " << fPhotElfromShower << endl;
251 *fLog << endl;
252 return;
253 }
254 if (str.Contains("id", TString::kIgnoreCase))
255 switch(fPartId)
256 {
257 case kGAMMA:
258 *fLog << "Particle: Gamma" << endl;
259 break;
260 case kPROTON:
261 *fLog << "Particle: Proton" << endl;
262 break;
263 case kHELIUM:
264 *fLog << "Particle: Helium" << endl;
265 break;
266 }
267 if (str.Contains("energy", TString::kIgnoreCase))
268 *fLog << "Energy: " << fEnergy << "GeV" << endl;
269 if (str.Contains("impact", TString::kIgnoreCase))
270 *fLog << "Impact: " << fImpact << "cm" << endl;
271}
Note: See TracBrowser for help on using the repository browser.