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