source: trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.cxx@ 3570

Last change on this file since 3570 was 2394, checked in by blanch, 21 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 7.5 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): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
19!
20! Copyright: MAGIC Software Development, 2000-2001
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MMcRunHeader
28//
29// Root storage container for the RUN MONTE CARLO HEADER information
30//
31// This the second version of this output class. Old root files, which have
32// a previous version of this class, are still compatibles and can be used.
33// But of course, you can no try to get infromatino in these old files about
34// the new data members.
35//
36// The following data member have been introduced in this second version
37// and they do not exist in the previous one:
38//
39// Float_t fMcRunNumber; Run Number
40// UInt_t fProductionSite; code to know where the run was generated
41// Float_t fDateRunMMCs; Date of the MMCs production
42// Float_t fDateRunCamera; Date, when the Camera program is run.
43// Byte_t fRawEvt; RawEvt[Data,Hedaer] stored or not
44// Byte_t fElecNoise; Electronic Noise simulated or not
45// Byte_t fStarFieldRotate; Is the starfield rotation switched on (1) or
46// off (0)
47// Float_t fCWaveLower; Wavelength limits for the Cerenkov photons
48// Float_t fCWaveUpper;
49// UInt_t fNumObsLev; Observation levels
50// Float_t fHeightLev[10];
51// Float_t fSlopeSpec; Spectral index
52//
53// Third version:
54//
55// Byte_t fOpticLinksNoise; Flag to state if the optic noise is simualted or not
56//
57//
58// Note: All the azimuth Phi angles in this and other MC classes follow
59// the convention in the Corsika program (see Corsika manual). There, phi
60// is the azimuth of the momentum vector of particles, and is measured
61// from the north direction, anticlockwise (i.e, west is phi=90 degrees).
62// When it refers to the telescope orientation, it is the azimuth of a
63// vector along the telescope axis, going from the camera to the mirror.
64// So, fTelesTheta=90, fTelesPhi = 0 means the telescope is pointing
65// horizontally towards South. For an explanation, see also TDAS 02-11.
66//
67////////////////////////////////////////////////////////////////////////////
68
69#include "MMcRunHeader.hxx"
70
71#include <fstream>
72#include <iomanip>
73
74#include "MLog.h"
75
76ClassImp(MMcRunHeader);
77
78using namespace std;
79
80// --------------------------------------------------------------------------
81//
82// Default constructor.
83//
84//
85MMcRunHeader::MMcRunHeader(const char *name, const char *title)
86{
87 fName = name ? name : "MMcRunHeader";
88 fTitle = title ? title : "Raw Run Header Information";
89
90 fMcRunNumber =0;
91 fProductionSite = 0;
92 fDateRunMMCs = 0;
93 fDateRunCamera = 0;
94 fNumTrigCond = 0;
95 fAllEvtsTriggered = 0 ;
96 fMcEvt = 0;
97 fMcTrig = 0;
98 fMcFadc = 0;
99 fRawEvt = 0;
100 fElecNoise = 0;
101 fStarFieldRotate = 0;
102 fNumAnalisedPixels = 0;
103 fNumSimulatedShowers = 0;
104 fNumStoredShowers = 0;
105 fNumEvents = 0;
106
107 fStarFieldRaH = 0;
108 fStarFieldRaM = 0;
109 fStarFieldRaS = 0;
110 fStarFieldDeD = 0;
111 fStarFieldDeM = 0;
112 fStarFieldDeS = 0;
113
114 fNumPheFromDNSB = 0.0;
115 fTelesTheta = 0.0;
116 fTelesPhi = 0.0;
117 fSourceOffsetTheta = 0.0;
118 fSourceOffsetPhi = 0.0;
119 fShowerThetaMax = 0.0;
120 fShowerThetaMin = 0.0;
121 fShowerPhiMax = 0.0;
122 fShowerPhiMin = 0.0;
123
124 fCWaveLower = 0.0;
125 fCWaveUpper = 0.0;
126
127 fNumObsLev = 0;
128 for (int i=0; i<10; i++){
129 fHeightLev[i]=0.0;
130 }
131 fSlopeSpec = 0.0;
132
133 fCorsikaVersion = 0;
134 fReflVersion = 0;
135 fCamVersion = 0;
136 fOpticLinksNoise= 0;
137
138}
139
140// --------------------------------------------------------------------------
141//
142// Destructor.
143//
144MMcRunHeader::~MMcRunHeader()
145{
146
147}
148
149// -------------------------------------------------------------------------
150//
151// Fill. Put data in the container
152//
153void MMcRunHeader::Fill(const Float_t runnumber,
154 const UInt_t productionsite,
155 const Float_t daterunMMCs,
156 const Float_t daterunCamera,
157 const UInt_t numtrigcond,
158 const Byte_t allevts,
159 const Byte_t mcevt,
160 const Byte_t mctrig,
161 const Byte_t mcfadc,
162 const Byte_t rawevt,
163 const Byte_t elecnoise,
164 const Int_t numanalpixels,
165 const UInt_t numsim,
166 const UInt_t numsto,
167 const Byte_t starfieldrotate,
168 const Int_t sfRaH,
169 const Int_t sfRaM,
170 const Int_t sfRaS,
171 const Int_t sfDeD,
172 const Int_t sfDeM,
173 const Int_t sfDeS,
174 const Float_t numdnsb,
175 const Float_t telestheta,
176 const Float_t telesphi,
177 const Float_t sofftheta,
178 const Float_t soffphi,
179 const Float_t shthetamax,
180 const Float_t shthetamin,
181 const Float_t shphimax,
182 const Float_t shphimin,
183 const Float_t impactmax,
184 const Float_t cwavelower,
185 const Float_t cwaveupper,
186 const Float_t slopespec,
187 const UInt_t numObslev,
188 const Float_t heightlev[10],
189 const UInt_t corsika,
190 const UInt_t refl,
191 const UInt_t cam,
192 const Byte_t opticnoise)
193{
194 fMcRunNumber =runnumber;
195 fProductionSite = productionsite;
196 fDateRunMMCs = daterunMMCs;
197 fDateRunCamera = daterunCamera;
198 fNumTrigCond = numtrigcond;
199 fAllEvtsTriggered = allevts;
200 fMcEvt = mcevt;
201 fMcTrig = mctrig;
202 fMcFadc = mcfadc;
203 fRawEvt = rawevt;
204 fElecNoise = elecnoise;
205 fStarFieldRotate = starfieldrotate;
206 fNumAnalisedPixels = numanalpixels;
207 fNumSimulatedShowers = numsim;
208 fNumStoredShowers = numsto;
209 fNumEvents = numsto;
210
211 fStarFieldRaH = sfRaH;
212 fStarFieldRaM = sfRaM;
213 fStarFieldRaS = sfRaS;
214 fStarFieldDeD = sfDeD;
215 fStarFieldDeM = sfDeM;
216 fStarFieldDeS = sfDeS;
217
218 fNumPheFromDNSB = numdnsb;
219 fTelesTheta = telestheta;
220 fTelesPhi = telesphi;
221 fSourceOffsetTheta = sofftheta;
222 fSourceOffsetPhi = soffphi;
223 fShowerThetaMax = shthetamax;
224 fShowerThetaMin = shthetamin;
225 fShowerPhiMax = shphimax;
226 fShowerPhiMin = shphimin;
227
228 fImpactMax=impactmax;
229
230 fCWaveLower = cwavelower;
231 fCWaveUpper = cwaveupper;
232
233 fNumObsLev = numObslev;
234 for (UInt_t i=0; i<numObslev; i++){
235 fHeightLev[i]=heightlev[i];
236 }
237 fSlopeSpec = slopespec;
238
239 fCorsikaVersion = corsika;
240 fReflVersion = refl;
241 fCamVersion = cam;
242 fOpticLinksNoise= opticnoise;
243}
244
245// -------------------------------------------------------------------------
246//
247// GetStarFieldRa. Get RA coordinates of the starfield
248//
249void MMcRunHeader::GetStarFieldRa(Int_t *hour, Int_t *minute, Int_t *second) const
250{
251 *hour = fStarFieldRaH;
252 *minute = fStarFieldRaM;
253 *second = fStarFieldRaS;
254}
255// -------------------------------------------------------------------------
256//
257// GetStarFieldDec. Get DE coordinates of the starfield
258//
259void MMcRunHeader::GetStarFieldDec(Int_t *degree, Int_t *minute, Int_t *second) const
260{
261 *degree = fStarFieldDeD;
262 *minute = fStarFieldDeM;
263 *second = fStarFieldDeS;
264}
Note: See TracBrowser for help on using the repository browser.