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