source: trunk/Mars/mcorsika/MCorsikaRunHeader.h@ 19340

Last change on this file since 19340 was 19332, checked in by tbretz, 6 years ago
Implemented variable block length to support thinning option, read more data values from the headers and store and print them.
File size: 6.1 KB
Line 
1#ifndef MARS_MCorsikaRunHeader
2#define MARS_MCorsikaRunHeader
3///////////////////////////////////////////////////////////////////////
4// //
5// MRunHeader //
6// //
7///////////////////////////////////////////////////////////////////////
8
9#ifndef MARS_MTime
10#include "MTime.h"
11#endif
12
13class MCorsikaFormat;
14
15class MCorsikaRunHeader : public MParContainer
16{
17 friend class MCorsikaEvtHeader;
18public:
19 enum CerenkovFlag_t
20 {
21 kCerenkov = BIT(0),
22 kIact = BIT(1),
23 kCeffic = BIT(2),
24 kAtmext = BIT(3),
25 kRefraction = BIT(4),
26 kVolumedet = BIT(5),
27 kCurved = BIT(6),
28 kSlant = BIT(8)
29 };
30
31private:
32 static const Double_t fgEarthRadius; // Take same Earth radius as in CORSIKA (cm)
33
34 UInt_t fRunNumber; // Run number
35 UInt_t fNumReuse; // Number of how many times the same shower is used
36 UInt_t fParticleID; // Particle ID (see MMcEvtBasic or CORSIKA manual)
37 UInt_t fNumEvents; // Number of events
38 MTime fRunStart; // Date of begin (yymmdd)
39 Float_t fProgramVersion; // Version of program
40
41 Byte_t fNumObsLevel; // Number of observation levels
42 Float_t fObsLevel[10]; // Observation levels [cm]
43
44 Float_t fImpactMax; // [cm] Maximum simulated impact
45
46 Float_t fSlopeSpectrum; // Slope of energy spectrum
47 Float_t fEnergyMin; // Lower limit of energy range
48 Float_t fEnergyMax; // Upper limit of energy range
49
50 Float_t fZdMin; // [rad] Zenith distance
51 Float_t fZdMax; // [rad] Zenith distance
52 Float_t fAzMin; // [rad] Azimuth (north=0; east=90)
53 Float_t fAzMax; // [rad] Azimuth (north=0; east=90) (north denotes the magnet north which is defined to be in the geografic north!)
54
55 Float_t fMagneticFieldX; // [muT] x-component of earth magnetic field (ceres coordinate system)
56 Float_t fMagneticFieldZ; // [muT] z-component of earth magnetic field (ceres coordinate system)
57 Float_t fMagneticFieldAz; // [rad] Azimuth angle of magnetic north expressed in telescope coordinates
58
59 Float_t fWavelengthMin; // [nm] Wavelength bandwidth lo edge
60 Float_t fWavelengthMax; // [nm] Wavelength bandwidth up edge
61
62 Float_t fViewConeInnerAngle; // [deg]
63 Float_t fViewConeOuterAngle; // [deg]
64
65 Float_t fAtmosphericLayers[5]; // [cm] ATMLAY (see Corsika Manual for details)
66 Float_t fAtmosphericCoeffA[5]; // [g/cm^2] AATM (see Corsika Manual for details)
67 Float_t fAtmosphericCoeffB[5]; // [g/cm^2] BATM (see Corsika Manual for details)
68 Float_t fAtmosphericCoeffC[5]; // [cm] CATM (see Corsika Manual for details)
69
70 UInt_t fCerenkovFlag;
71 UInt_t fCerenkovFileOption; // MCERFI
72
73 Float_t fEnergyCutoffHadrons; // [GeV]
74 Float_t fEnergyCutoffMuons; // [GeV]
75 Float_t fEnergyCutoffElectrons; // [GeV]
76 Float_t fEnergyCutoffPhotons; // [GeV]
77
78 Float_t fThinningEnergyFractionH; // Hadronic energy limit: EFRCTHN
79 Float_t fThinningEnergyFractionEM; // EM energy limit: EFRCTHN*THINRAT
80 Float_t fThinningWeightLimitH; // Hadronic weight limit: WMAX
81 Float_t fThinningWeightLimitEM; // EM weight limit: WMAX*WEITRAT
82 Float_t fThinningMaxRadius; // [cm] Max radial raius for thinning
83
84public:
85 MCorsikaRunHeader(const char *name=NULL, const char *title=NULL);
86
87 // Getter
88 UInt_t GetRunNumber() const { return fRunNumber; }
89 UInt_t GetParticleID() const { return fParticleID; }
90 UInt_t GetNumEvents() const { return fNumEvents; }
91 UInt_t GetNumReuse() const { return fNumReuse; }
92
93 const MTime &GetRunStart() const { return fRunStart; }
94
95 Float_t GetProgramVersion() const { return fProgramVersion; }
96
97 Float_t GetZdMin() const { return fZdMin; }
98 Float_t GetZdMax() const { return fZdMax; }
99
100 Float_t GetAzMin() const { return fAzMin; }
101 Float_t GetAzMax() const { return fAzMax; }
102
103 Float_t GetWavelengthMin() const { return fWavelengthMin; }
104 Float_t GetWavelengthMax() const { return fWavelengthMax; }
105
106 Float_t GetSlopeSpectrum() const { return fSlopeSpectrum; }
107 Float_t GetEnergyMin() const { return fEnergyMin; }
108 Float_t GetEnergyMax() const { return fEnergyMax; }
109
110 Float_t GetImpactMax() const { return fImpactMax; }
111
112 Float_t GetMagneticFieldX() const { return fMagneticFieldX; }
113 Float_t GetMagneticFieldZ() const { return fMagneticFieldZ; }
114 Float_t GetMagneticFieldAz() const { return fMagneticFieldAz; }
115
116 Float_t GetViewConeInnerAngle() const { return fViewConeInnerAngle; }
117 Float_t GetViewConeOuterAngle() const { return fViewConeOuterAngle; }
118 Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
119
120 Float_t GetObsLevel(UInt_t i=0) const { return i>9 ? -1 : fObsLevel[i]; }
121
122 Bool_t Has(CerenkovFlag_t opt) const { return fCerenkovFlag&opt ? 1 : 0; }
123
124 UInt_t GetCerenkovFileOption() const { return fCerenkovFileOption; }
125
126 static Double_t EarthRadius() { return fgEarthRadius; }
127
128 // Preliminary!
129 Bool_t HasLayers() const { return fAtmosphericLayers[4]>0; }
130
131 const Float_t *GetAtmosphericLayers() const { return fAtmosphericLayers; }
132 const Float_t *GetAtmosphericCoeffA() const { return fAtmosphericCoeffA; }
133 const Float_t *GetAtmosphericCoeffB() const { return fAtmosphericCoeffB; }
134 const Float_t *GetAtmosphericCoeffC() const { return fAtmosphericCoeffC; }
135
136 UInt_t GetNumAtmosphericModel() const { return (fCerenkovFlag>>10)&0x3ff; }
137
138 // I/O
139 Bool_t ReadEvt(MCorsikaFormat * fInFormat, const uint32_t &blockLength);
140 Bool_t ReadEventHeader(Float_t * g);
141 Bool_t ReadEvtEnd(MCorsikaFormat * fInFormat, Bool_t runNumberVerify);
142
143 // TObject
144 void Print(Option_t *t=NULL) const;
145
146 ClassDef(MCorsikaRunHeader, 4) // storage container for general info
147};
148#endif
Note: See TracBrowser for help on using the repository browser.