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

Last change on this file since 1983 was 1983, checked in by moralejo, 21 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 7.4 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.h>
72#include <iomanip.h>
73
74#include "MLog.h"
75
76ClassImp(MMcRunHeader);
77
78// --------------------------------------------------------------------------
79//
80// Default constructor.
81//
82//
83MMcRunHeader::MMcRunHeader(const char *name, const char *title)
84{
85 fName = name ? name : "MMcRunHeader";
86 fTitle = title ? title : "Raw Run Header Information";
87
88 fMcRunNumber =0;
89 fProductionSite = 0;
90 fDateRunMMCs = 0;
91 fDateRunCamera = 0;
92 fNumTrigCond = 0;
93 fAllEvtsTriggered = 0 ;
94 fMcEvt = 0;
95 fMcTrig = 0;
96 fMcFadc = 0;
97 fRawEvt = 0;
98 fElecNoise = 0;
99 fStarFieldRotate = 0;
100 fNumAnalisedPixels = 0;
101 fNumSimulatedShowers = 0;
102 fNumStoredShowers = 0;
103
104 fStarFieldRaH = 0;
105 fStarFieldRaM = 0;
106 fStarFieldRaS = 0;
107 fStarFieldDeD = 0;
108 fStarFieldDeM = 0;
109 fStarFieldDeS = 0;
110
111 fNumPheFromDNSB = 0.0;
112 fTelesTheta = 0.0;
113 fTelesPhi = 0.0;
114 fSourceOffsetTheta = 0.0;
115 fSourceOffsetPhi = 0.0;
116 fShowerThetaMax = 0.0;
117 fShowerThetaMin = 0.0;
118 fShowerPhiMax = 0.0;
119 fShowerPhiMin = 0.0;
120
121 fCWaveLower = 0.0;
122 fCWaveUpper = 0.0;
123
124 fNumObsLev = 0;
125 for (int i=0; i<10; i++){
126 fHeightLev[i]=0.0;
127 }
128 fSlopeSpec = 0.0;
129
130 fCorsikaVersion = 0;
131 fReflVersion = 0;
132 fCamVersion = 0;
133 fOpticLinksNoise= 0;
134
135}
136
137// --------------------------------------------------------------------------
138//
139// Destructor.
140//
141MMcRunHeader::~MMcRunHeader()
142{
143
144}
145
146// -------------------------------------------------------------------------
147//
148// Fill. Put data in the container
149//
150void MMcRunHeader::Fill(const Float_t runnumber,
151 const UInt_t productionsite,
152 const Float_t daterunMMCs,
153 const Float_t daterunCamera,
154 const UInt_t numtrigcond,
155 const Byte_t allevts,
156 const Byte_t mcevt,
157 const Byte_t mctrig,
158 const Byte_t mcfadc,
159 const Byte_t rawevt,
160 const Byte_t elecnoise,
161 const Int_t numanalpixels,
162 const UInt_t numsim,
163 const UInt_t numsto,
164 const Byte_t starfieldrotate,
165 const Int_t sfRaH,
166 const Int_t sfRaM,
167 const Int_t sfRaS,
168 const Int_t sfDeD,
169 const Int_t sfDeM,
170 const Int_t sfDeS,
171 const Float_t numdnsb,
172 const Float_t telestheta,
173 const Float_t telesphi,
174 const Float_t sofftheta,
175 const Float_t soffphi,
176 const Float_t shthetamax,
177 const Float_t shthetamin,
178 const Float_t shphimax,
179 const Float_t shphimin,
180 const Float_t cwavelower,
181 const Float_t cwaveupper,
182 const Float_t slopespec,
183 const UInt_t numObslev,
184 const Float_t heightlev[10],
185 const UInt_t corsika,
186 const UInt_t refl,
187 const UInt_t cam,
188 const Byte_t opticnoise)
189{
190 fMcRunNumber =runnumber;
191 fProductionSite = productionsite;
192 fDateRunMMCs = daterunMMCs;
193 fDateRunCamera = daterunCamera;
194 fNumTrigCond = numtrigcond;
195 fAllEvtsTriggered = allevts;
196 fMcEvt = mcevt;
197 fMcTrig = mctrig;
198 fMcFadc = mcfadc;
199 fRawEvt = rawevt;
200 fElecNoise = elecnoise;
201 fStarFieldRotate = starfieldrotate;
202 fNumAnalisedPixels = numanalpixels;
203 fNumSimulatedShowers = numsim;
204 fNumStoredShowers = numsto;
205
206 fStarFieldRaH = sfRaH;
207 fStarFieldRaM = sfRaM;
208 fStarFieldRaS = sfRaS;
209 fStarFieldDeD = sfDeD;
210 fStarFieldDeM = sfDeM;
211 fStarFieldDeS = sfDeS;
212
213 fNumPheFromDNSB = numdnsb;
214 fTelesTheta = telestheta;
215 fTelesPhi = telesphi;
216 fSourceOffsetTheta = sofftheta;
217 fSourceOffsetPhi = soffphi;
218 fShowerThetaMax = shthetamax;
219 fShowerThetaMin = shthetamin;
220 fShowerPhiMax = shphimax;
221 fShowerPhiMin = shphimin;
222
223 fCWaveLower = cwavelower;
224 fCWaveUpper = cwaveupper;
225
226 fNumObsLev = numObslev;
227 for (UInt_t i=0; i<numObslev; i++){
228 fHeightLev[i]=heightlev[i];
229 }
230 fSlopeSpec = slopespec;
231
232 fCorsikaVersion = corsika;
233 fReflVersion = refl;
234 fCamVersion = cam;
235 fOpticLinksNoise= opticnoise;
236}
237
238// -------------------------------------------------------------------------
239//
240// GetStarFieldRa. Get RA coordinates of the starfield
241//
242void MMcRunHeader::GetStarFieldRa(Int_t *hour, Int_t *minute, Int_t *second) const
243{
244 *hour = fStarFieldRaH;
245 *minute = fStarFieldRaM;
246 *second = fStarFieldRaS;
247}
248// -------------------------------------------------------------------------
249//
250// GetStarFieldDec. Get DE coordinates of the starfield
251//
252void MMcRunHeader::GetStarFieldDec(Int_t *degree, Int_t *minute, Int_t *second) const
253{
254 *degree = fStarFieldDeD;
255 *minute = fStarFieldDeM;
256 *second = fStarFieldDeS;
257}
Note: See TracBrowser for help on using the repository browser.