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

Last change on this file since 11438 was 10060, checked in by rohlfs, 14 years ago
two new command line arguments of readcorsika: -A=arrayNo and -T=telescopeNo. New design of program flow in MCorsikaRead: It is now determined by the order of the data blocks in the input file.
File size: 5.4 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²] AATM (see Corsika Manual for details)
67 Float_t fAtmosphericCoeffB[5]; // [g/cm²] BATM (see Corsika Manual for details)
68 Float_t fAtmosphericCoeffC[5]; // [cm] CATM (see Corsika Manual for details)
69
70 UInt_t fCerenkovFlag;
71
72public:
73 MCorsikaRunHeader(const char *name=NULL, const char *title=NULL);
74
75 // Getter
76 UInt_t GetRunNumber() const { return fRunNumber; }
77 UInt_t GetParticleID() const { return fParticleID; }
78 UInt_t GetNumEvents() const { return fNumEvents; }
79 UInt_t GetNumReuse() const { return fNumReuse; }
80
81 const MTime &GetRunStart() const { return fRunStart; }
82
83 Float_t GetProgramVersion() const { return fProgramVersion; }
84
85 Float_t GetZdMin() const { return fZdMin; }
86 Float_t GetZdMax() const { return fZdMax; }
87
88 Float_t GetAzMin() const { return fAzMin; }
89 Float_t GetAzMax() const { return fAzMax; }
90
91 Float_t GetWavelengthMin() const { return fWavelengthMin; }
92 Float_t GetWavelengthMax() const { return fWavelengthMax; }
93
94 Float_t GetSlopeSpectrum() const { return fSlopeSpectrum; }
95 Float_t GetEnergyMin() const { return fEnergyMin; }
96 Float_t GetEnergyMax() const { return fEnergyMax; }
97
98 Float_t GetImpactMax() const { return fImpactMax; }
99
100 Float_t GetMagneticFieldX() const { return fMagneticFieldX; }
101 Float_t GetMagneticFieldZ() const { return fMagneticFieldZ; }
102 Float_t GetMagneticFieldAz() const { return fMagneticFieldAz; }
103
104 Float_t GetViewConeInnerAngle() const { return fViewConeInnerAngle; }
105 Float_t GetViewConeOuterAngle() const { return fViewConeOuterAngle; }
106 Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
107
108 Float_t GetObsLevel(UInt_t i=0) const { return i>9 ? -1 : fObsLevel[i]; }
109
110 Bool_t Has(CerenkovFlag_t opt) const { return fCerenkovFlag&opt ? 1 : 0; }
111
112 static Double_t EarthRadius() { return fgEarthRadius; }
113
114 // Preliminary!
115 Bool_t HasLayers() const { return fAtmosphericLayers[4]>0; }
116
117 const Float_t *GetAtmosphericLayers() const { return fAtmosphericLayers; }
118 const Float_t *GetAtmosphericCoeffA() const { return fAtmosphericCoeffA; }
119 const Float_t *GetAtmosphericCoeffB() const { return fAtmosphericCoeffB; }
120 const Float_t *GetAtmosphericCoeffC() const { return fAtmosphericCoeffC; }
121
122 UInt_t GetNumAtmosphericModel() const { return (fCerenkovFlag>>10)&0x3ff; }
123
124 // I/O
125 Bool_t ReadEvt(MCorsikaFormat * fInFormat);
126 Bool_t ReadEventHeader(Float_t * g);
127 Bool_t ReadEvtEnd(MCorsikaFormat * fInFormat, Bool_t runNumberVerify);
128 Bool_t SeekEvtEnd(istream &fin);
129
130 // TObject
131 void Print(Option_t *t=NULL) const;
132
133 ClassDef(MCorsikaRunHeader, 3) // storage container for general info
134};
135#endif
Note: See TracBrowser for help on using the repository browser.