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

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