1 | /* ======================================================================== *\
|
---|
2 | !
|
---|
3 | ! *
|
---|
4 | ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
---|
5 | ! * Software. It is distributed to you in the hope that it can be a useful
|
---|
6 | ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
---|
7 | ! * It is distributed WITHOUT ANY WARRANTY.
|
---|
8 | ! *
|
---|
9 | ! * Permission to use, copy, modify and distribute this software and its
|
---|
10 | ! * documentation for any purpose is hereby granted without fee,
|
---|
11 | ! * provided that the above copyright notice appear in all copies and
|
---|
12 | ! * that both that copyright notice and this permission notice appear
|
---|
13 | ! * in supporting documentation. It is provided "as is" without express
|
---|
14 | ! * or implied warranty.
|
---|
15 | ! *
|
---|
16 | !
|
---|
17 | !
|
---|
18 | ! Author(s):
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2005
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MMcEvt
|
---|
28 | //
|
---|
29 | // This class handles and contains the MonteCarlo information
|
---|
30 | // with which the events have been generated
|
---|
31 | // This information exists for each event.
|
---|
32 | //
|
---|
33 | // Note: All the azimuth Phi angles in this and other MC classes follow
|
---|
34 | // the convention in the Corsika program (see Corsika manual). There, phi
|
---|
35 | // is the azimuth of the momentum vector of particles, and is measured
|
---|
36 | // from the north direction, anticlockwise (i.e, west is phi=90 degrees).
|
---|
37 | // When it refers to the telescope orientation, it is the azimuth of a
|
---|
38 | // vector along the telescope axis, going from the camera to the mirror.
|
---|
39 | // So, fTelescopeTheta=90, fTelescopePhi = 0 means the telescope is
|
---|
40 | // pointing horizontally towards South. For an explanation, see also
|
---|
41 | // TDAS 02-11.
|
---|
42 | //
|
---|
43 | // Version 4:
|
---|
44 | // - Added member fFadcTimeJitter
|
---|
45 | //
|
---|
46 | // Version 5:
|
---|
47 | // - removed fPartId, fEnergy, fImpact, fTelescopeTheta, fTelescopePhi
|
---|
48 | // - derives now from MMcEvtBasic which contains all these values
|
---|
49 | // - moved ParticleId_t to base class MMcEvtBasic
|
---|
50 | //
|
---|
51 | /////////////////////////////////////////////////////////////////////////////
|
---|
52 | #include "MMcEvt.hxx"
|
---|
53 |
|
---|
54 | #include "MLog.h"
|
---|
55 | #include "MLogManip.h"
|
---|
56 |
|
---|
57 | ClassImp(MMcEvt);
|
---|
58 |
|
---|
59 | using namespace std;
|
---|
60 |
|
---|
61 |
|
---|
62 | // --------------------------------------------------------------------------
|
---|
63 | //
|
---|
64 | // Default constructor. Calls Clear()
|
---|
65 | //
|
---|
66 | MMcEvt::MMcEvt()
|
---|
67 | {
|
---|
68 | fName = "MMcEvt";
|
---|
69 | fTitle = "Event info from Monte Carlo";
|
---|
70 |
|
---|
71 | Clear();
|
---|
72 | }
|
---|
73 |
|
---|
74 | // --------------------------------------------------------------------------
|
---|
75 | //
|
---|
76 | // Constructor. Use this to set all data members
|
---|
77 | //
|
---|
78 | // THIS FUNCTION IS FOR THE SIMULATION OLNY.
|
---|
79 | // DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS.
|
---|
80 | //
|
---|
81 | MMcEvt::MMcEvt(UInt_t fEvtNum, ParticleId_t usPId, Float_t fEner,
|
---|
82 | Float_t fThi0, Float_t fFirTar, Float_t fzFirInt,
|
---|
83 | Float_t fThet, Float_t fPhii, Float_t fCorD,
|
---|
84 | Float_t fCorX, Float_t fCorY, Float_t fImpa,
|
---|
85 | Float_t fTPhii, Float_t fTThet, Float_t fTFirst,
|
---|
86 | Float_t fTLast, Float_t fL_Nmax, Float_t fL_t0,
|
---|
87 | Float_t fL_tmax, Float_t fL_a, Float_t fL_b,
|
---|
88 | Float_t fL_c, Float_t fL_chi2, UInt_t uiPin,
|
---|
89 | UInt_t uiPat, UInt_t uiPre, UInt_t uiPco,
|
---|
90 | UInt_t uiPelS, UInt_t uiPelC, Float_t elec,
|
---|
91 | Float_t muon, Float_t other, Float_t fadc_jitter)
|
---|
92 | {
|
---|
93 | fName = "MMcEvt";
|
---|
94 | fTitle = "Event info from Monte Carlo";
|
---|
95 |
|
---|
96 | Fill(fEvtNum, usPId, fEner, fThi0, fFirTar, fzFirInt, fThet,
|
---|
97 | fPhii, fCorD, fCorX, fCorY, fImpa, fTPhii, fTThet, fTFirst,
|
---|
98 | fTLast, fL_Nmax, fL_t0, fL_tmax, fL_a, fL_b, fL_c, fL_chi2,
|
---|
99 | uiPin, uiPat, uiPre, uiPco, uiPelS, uiPelC, elec, muon, other,
|
---|
100 | fadc_jitter);
|
---|
101 | }
|
---|
102 |
|
---|
103 | // --------------------------------------------------------------------------
|
---|
104 | //
|
---|
105 | // reset all values to values as nonsense as possible
|
---|
106 | //
|
---|
107 | void MMcEvt::Clear(Option_t *opt)
|
---|
108 | {
|
---|
109 | fPartId = kUNDEFINED;
|
---|
110 | fEnergy = -1;
|
---|
111 |
|
---|
112 | fTheta = 0;
|
---|
113 | fPhi = 0;
|
---|
114 |
|
---|
115 | fCoreD = 0;
|
---|
116 | fCoreX = 0;
|
---|
117 | fCoreY = 0;
|
---|
118 | fImpact = -1;
|
---|
119 |
|
---|
120 | fPhotIni = 0;
|
---|
121 | fPassPhotAtm = 0;
|
---|
122 | fPassPhotRef = 0;
|
---|
123 | fPassPhotCone = 0;
|
---|
124 | fPhotElfromShower = 0;
|
---|
125 | fPhotElinCamera = 0;
|
---|
126 |
|
---|
127 | fElecCphFraction=0;
|
---|
128 | fMuonCphFraction=0;
|
---|
129 | fOtherCphFraction=0;
|
---|
130 | }
|
---|
131 |
|
---|
132 | // --------------------------------------------------------------------------
|
---|
133 | //
|
---|
134 | // Use this to set all data members
|
---|
135 | //
|
---|
136 | // THIS FUNCTION IS FOR THE SIMULATION OLNY.
|
---|
137 | // DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS.
|
---|
138 | //
|
---|
139 | void MMcEvt::Fill( UInt_t fEvtNum, ParticleId_t usPId, Float_t fEner,
|
---|
140 | Float_t fThi0, Float_t fFirTar, Float_t fzFirInt,
|
---|
141 | Float_t fThet, Float_t fPhii, Float_t fCorD,
|
---|
142 | Float_t fCorX, Float_t fCorY, Float_t fImpa,
|
---|
143 | Float_t fTPhii, Float_t fTThet, Float_t fTFirst,
|
---|
144 | Float_t fTLast, Float_t fL_Nmax, Float_t fL_t0,
|
---|
145 | Float_t fL_tmax, Float_t fL_a, Float_t fL_b,
|
---|
146 | Float_t fL_c, Float_t fL_chi2, UInt_t uiPin,
|
---|
147 | UInt_t uiPat, UInt_t uiPre, UInt_t uiPco,
|
---|
148 | UInt_t uiPelS, UInt_t uiPelC, Float_t elec,
|
---|
149 | Float_t muon, Float_t other, Float_t fadc_jitter)
|
---|
150 | {
|
---|
151 | //
|
---|
152 | // All datamembers are filled with the correspondin parameters.
|
---|
153 | //
|
---|
154 | // Don't use this memberfunction in analysis
|
---|
155 | //
|
---|
156 | fEvtNumber = fEvtNum;
|
---|
157 | fPartId = usPId ;
|
---|
158 | fEnergy = fEner ;
|
---|
159 | fThick0 = fThi0;
|
---|
160 | fFirstTarget = fFirTar;
|
---|
161 | fZFirstInteraction = fzFirInt;
|
---|
162 |
|
---|
163 | fTheta = fThet ;
|
---|
164 | fPhi = fPhii ;
|
---|
165 |
|
---|
166 | fCoreD = fCorD ;
|
---|
167 | fCoreX = fCorX ;
|
---|
168 | fCoreY = fCorY ;
|
---|
169 | fImpact = fImpa ;
|
---|
170 |
|
---|
171 | fTelescopePhi = fTPhii;
|
---|
172 | fTelescopeTheta = fTThet;
|
---|
173 | fTimeFirst = fTFirst;
|
---|
174 | fTimeLast = fTLast;
|
---|
175 | fLongiNmax = fL_Nmax;
|
---|
176 | fLongit0 = fL_t0;
|
---|
177 | fLongitmax = fL_tmax;
|
---|
178 | fLongia = fL_a;
|
---|
179 | fLongib = fL_b;
|
---|
180 | fLongic = fL_c;
|
---|
181 | fLongichi2 = fL_chi2;
|
---|
182 |
|
---|
183 | fPhotIni = uiPin ;
|
---|
184 | fPassPhotAtm = fPhotIni-uiPat ;
|
---|
185 | fPassPhotRef = fPassPhotAtm-uiPre ;
|
---|
186 | fPassPhotCone = uiPco ;
|
---|
187 | fPhotElfromShower = uiPelS ;
|
---|
188 | fPhotElinCamera = uiPelC ;
|
---|
189 |
|
---|
190 | fElecCphFraction=elec;
|
---|
191 | fMuonCphFraction=muon;
|
---|
192 | fOtherCphFraction=other;
|
---|
193 |
|
---|
194 | fFadcTimeJitter = fadc_jitter;
|
---|
195 | }
|
---|
196 |
|
---|
197 | // --------------------------------------------------------------------------
|
---|
198 | //
|
---|
199 | // Print the contents of the container.
|
---|
200 | //
|
---|
201 | // if you specify an option only the requested data members are printed:
|
---|
202 | // allowed options are:
|
---|
203 | // id, energy, impact
|
---|
204 | //
|
---|
205 | void MMcEvt::Print(Option_t *opt) const
|
---|
206 | {
|
---|
207 | MMcEvtBasic::Print(opt);
|
---|
208 |
|
---|
209 | TString str(opt);
|
---|
210 | if (str.IsNull())
|
---|
211 | {
|
---|
212 | *fLog << " Photoelectrons: " << fPhotElfromShower << endl;
|
---|
213 | return;
|
---|
214 | }
|
---|
215 | }
|
---|