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

Last change on this file since 8050 was 7880, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 6.8 KB
Line 
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// Version 6:
52// - added fEventReuse
53//
54/////////////////////////////////////////////////////////////////////////////
55#include "MMcEvt.hxx"
56
57#include "MLog.h"
58#include "MLogManip.h"
59
60ClassImp(MMcEvt);
61
62using namespace std;
63
64// --------------------------------------------------------------------------
65//
66// Default constructor. Calls Clear()
67//
68MMcEvt::MMcEvt()
69{
70 fName = "MMcEvt";
71 fTitle = "Event info from Monte Carlo";
72
73 Clear();
74}
75
76// --------------------------------------------------------------------------
77//
78// Constructor. Use this to set all data members
79//
80// THIS FUNCTION IS FOR THE SIMULATION OLNY.
81// DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS.
82//
83MMcEvt::MMcEvt(UInt_t fEvtNum, ParticleId_t usPId, Float_t fEner,
84 Float_t fThi0, Float_t fFirTar, Float_t fzFirInt,
85 Float_t fThet, Float_t fPhii, Float_t fCorD,
86 Float_t fCorX, Float_t fCorY, Float_t fImpa,
87 Float_t fTPhii, Float_t fTThet, Float_t fTFirst,
88 Float_t fTLast, Float_t fL_Nmax, Float_t fL_t0,
89 Float_t fL_tmax, Float_t fL_a, Float_t fL_b,
90 Float_t fL_c, Float_t fL_chi2, UInt_t uiPin,
91 UInt_t uiPat, UInt_t uiPre, UInt_t uiPco,
92 UInt_t uiPelS, UInt_t uiPelC, Float_t elec,
93 Float_t muon, Float_t other, Float_t fadc_jitter,
94 Int_t reuse)
95{
96 fName = "MMcEvt";
97 fTitle = "Event info from Monte Carlo";
98
99 Fill(fEvtNum, usPId, fEner, fThi0, fFirTar, fzFirInt, fThet,
100 fPhii, fCorD, fCorX, fCorY, fImpa, fTPhii, fTThet, fTFirst,
101 fTLast, fL_Nmax, fL_t0, fL_tmax, fL_a, fL_b, fL_c, fL_chi2,
102 uiPin, uiPat, uiPre, uiPco, uiPelS, uiPelC, elec, muon, other,
103 fadc_jitter, reuse);
104}
105
106// --------------------------------------------------------------------------
107//
108// reset all values to values as nonsense as possible
109//
110void MMcEvt::Clear(Option_t *opt)
111{
112 fPartId = kUNDEFINED;
113 fEnergy = -1;
114
115 fTheta = 0;
116 fPhi = 0;
117
118 fCoreD = 0;
119 fCoreX = 0;
120 fCoreY = 0;
121 fImpact = -1;
122
123 fPhotIni = 0;
124 fPassPhotAtm = 0;
125 fPassPhotRef = 0;
126 fPassPhotCone = 0;
127 fPhotElfromShower = 0;
128 fPhotElinCamera = 0;
129
130 fElecCphFraction=0;
131 fMuonCphFraction=0;
132 fOtherCphFraction=0;
133
134 fEventReuse = 0;
135}
136
137// --------------------------------------------------------------------------
138//
139// Use this to set all data members
140//
141// THIS FUNCTION IS FOR THE SIMULATION OLNY.
142// DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS.
143//
144void MMcEvt::Fill( UInt_t fEvtNum, ParticleId_t usPId, Float_t fEner,
145 Float_t fThi0, Float_t fFirTar, Float_t fzFirInt,
146 Float_t fThet, Float_t fPhii, Float_t fCorD,
147 Float_t fCorX, Float_t fCorY, Float_t fImpa,
148 Float_t fTPhii, Float_t fTThet, Float_t fTFirst,
149 Float_t fTLast, Float_t fL_Nmax, Float_t fL_t0,
150 Float_t fL_tmax, Float_t fL_a, Float_t fL_b,
151 Float_t fL_c, Float_t fL_chi2, UInt_t uiPin,
152 UInt_t uiPat, UInt_t uiPre, UInt_t uiPco,
153 UInt_t uiPelS, UInt_t uiPelC, Float_t elec,
154 Float_t muon, Float_t other, Float_t fadc_jitter,
155 Int_t reuse)
156{
157 //
158 // All datamembers are filled with the correspondin parameters.
159 //
160 // Don't use this memberfunction in analysis
161 //
162 fEvtNumber = fEvtNum;
163 fPartId = usPId ;
164 fEnergy = fEner ;
165 fThick0 = fThi0;
166 fFirstTarget = fFirTar;
167 fZFirstInteraction = fzFirInt;
168
169 fTheta = fThet ;
170 fPhi = fPhii ;
171
172 fCoreD = fCorD ;
173 fCoreX = fCorX ;
174 fCoreY = fCorY ;
175 fImpact = fImpa ;
176
177 fTelescopePhi = fTPhii;
178 fTelescopeTheta = fTThet;
179 fTimeFirst = fTFirst;
180 fTimeLast = fTLast;
181 fLongiNmax = fL_Nmax;
182 fLongit0 = fL_t0;
183 fLongitmax = fL_tmax;
184 fLongia = fL_a;
185 fLongib = fL_b;
186 fLongic = fL_c;
187 fLongichi2 = fL_chi2;
188
189 fPhotIni = uiPin ;
190 fPassPhotAtm = fPhotIni-uiPat ;
191 fPassPhotRef = fPassPhotAtm-uiPre ;
192 fPassPhotCone = uiPco ;
193 fPhotElfromShower = uiPelS ;
194 fPhotElinCamera = uiPelC ;
195
196 fElecCphFraction=elec;
197 fMuonCphFraction=muon;
198 fOtherCphFraction=other;
199
200 fFadcTimeJitter = fadc_jitter;
201
202 fEventReuse = reuse;
203}
204
205// --------------------------------------------------------------------------
206//
207// Print the contents of the container.
208//
209// if you specify an option only the requested data members are printed:
210// allowed options are:
211// id, energy, impact
212//
213void MMcEvt::Print(Option_t *opt) const
214{
215 MMcEvtBasic::Print(opt);
216
217 TString str(opt);
218 if (str.IsNull())
219 {
220 *fLog << " Photoelectrons: " << fPhotElfromShower << endl;
221 return;
222 }
223}
Note: See TracBrowser for help on using the repository browser.