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

Last change on this file since 20001 was 19761, checked in by tbretz, 5 years ago
fgEarthRadius can be public.
File size: 6.2 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
31 static const Double_t fgEarthRadius; // Take same Earth radius as in CORSIKA (cm)
32
33private:
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 UInt_t fHadronModelLowEnergy;
74 UInt_t fHadronModelHighEnergy;
75
76 Float_t fTransitionEnergy; // [GeV]
77
78 Bool_t fCurvedAtmosphere;
79
80 Float_t fEnergyCutoffHadrons; // [GeV]
81 Float_t fEnergyCutoffMuons; // [GeV]
82 Float_t fEnergyCutoffElectrons; // [GeV]
83 Float_t fEnergyCutoffPhotons; // [GeV]
84
85 Float_t fThinningEnergyFractionH; // Hadronic energy limit: EFRCTHN
86 Float_t fThinningEnergyFractionEM; // EM energy limit: EFRCTHN*THINRAT
87 Float_t fThinningWeightLimitH; // Hadronic weight limit: WMAX
88 Float_t fThinningWeightLimitEM; // EM weight limit: WMAX*WEITRAT
89 Float_t fThinningMaxRadius; // [cm] Max radial raius for thinning
90
91
92public:
93 MCorsikaRunHeader(const char *name=NULL, const char *title=NULL);
94
95 // Getter
96 UInt_t GetRunNumber() const { return fRunNumber; }
97 UInt_t GetParticleID() const { return fParticleID; }
98 UInt_t GetNumEvents() const { return fNumEvents; }
99 UInt_t GetNumReuse() const { return fNumReuse; }
100
101 const MTime &GetRunStart() const { return fRunStart; }
102
103 Float_t GetProgramVersion() const { return fProgramVersion; }
104
105 Float_t GetZdMin() const { return fZdMin; }
106 Float_t GetZdMax() const { return fZdMax; }
107
108 Float_t GetAzMin() const { return fAzMin; }
109 Float_t GetAzMax() const { return fAzMax; }
110
111 Float_t GetWavelengthMin() const { return fWavelengthMin; }
112 Float_t GetWavelengthMax() const { return fWavelengthMax; }
113
114 Float_t GetSlopeSpectrum() const { return fSlopeSpectrum; }
115 Float_t GetEnergyMin() const { return fEnergyMin; }
116 Float_t GetEnergyMax() const { return fEnergyMax; }
117
118 Float_t GetImpactMax() const { return fImpactMax; }
119
120 Float_t GetMagneticFieldX() const { return fMagneticFieldX; }
121 Float_t GetMagneticFieldZ() const { return fMagneticFieldZ; }
122 Float_t GetMagneticFieldAz() const { return fMagneticFieldAz; }
123
124 Float_t GetViewConeInnerAngle() const { return fViewConeInnerAngle; }
125 Float_t GetViewConeOuterAngle() const { return fViewConeOuterAngle; }
126 Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
127
128 Float_t GetObsLevel(UInt_t i=0) const { return i>9 ? -1 : fObsLevel[i]; }
129
130 Bool_t Has(CerenkovFlag_t opt) const { return fCerenkovFlag&opt ? 1 : 0; }
131
132 UInt_t GetCerenkovFileOption() const { return fCerenkovFileOption; }
133
134 static Double_t EarthRadius() { return fgEarthRadius; }
135
136 // Preliminary!
137 Bool_t HasLayers() const { return fAtmosphericLayers[4]>0; }
138
139 const Float_t *GetAtmosphericLayers() const { return fAtmosphericLayers; }
140 const Float_t *GetAtmosphericCoeffA() const { return fAtmosphericCoeffA; }
141 const Float_t *GetAtmosphericCoeffB() const { return fAtmosphericCoeffB; }
142 const Float_t *GetAtmosphericCoeffC() const { return fAtmosphericCoeffC; }
143
144 UInt_t GetNumAtmosphericModel() const { return (fCerenkovFlag>>10)&0x3ff; }
145
146 // I/O
147 Bool_t ReadEvt(MCorsikaFormat * fInFormat, const uint32_t &blockLength);
148 Bool_t ReadEventHeader(Float_t * g);
149 Bool_t ReadEvtEnd(MCorsikaFormat * fInFormat, Bool_t runNumberVerify);
150
151 // TObject
152 void Print(Option_t *t=NULL) const;
153
154 ClassDef(MCorsikaRunHeader, 4) // storage container for general info
155};
156#endif
Note: See TracBrowser for help on using the repository browser.