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

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