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

Last change on this file since 9893 was 9616, checked in by rohlfs, 14 years ago
can read also EventIO files
File size: 5.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
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 fParticleID; // Particle ID (see MMcEvtBasic or CORSIKA manual)
36 UInt_t fNumEvents; // Number of events
37 MTime fRunStart; // Date of begin (yymmdd)
38 Float_t fProgramVersion; // Version of program
39
40 Byte_t fNumObsLevel; // Number of observation levels
41 Float_t fObsLevel[10]; // Observation levels [cm]
42
43 Float_t fImpactMax; // [cm] Maximum simulated impact
44
45 Float_t fSlopeSpectrum; // Slope of energy spectrum
46 Float_t fEnergyMin; // Lower limit of energy range
47 Float_t fEnergyMax; // Upper limit of energy range
48
49 Float_t fZdMin; // [rad] Zenith distance
50 Float_t fZdMax; // [rad] Zenith distance
51 Float_t fAzMin; // [rad] Azimuth (north=0; east=90)
52 Float_t fAzMax; // [rad] Azimuth (north=0; east=90) (north denotes the magnet north which is defined to be in the geografic north!)
53
54 Float_t fMagneticFieldX; // [muT] x-component of earth magnetic field (ceres coordinate system)
55 Float_t fMagneticFieldZ; // [muT] z-component of earth magnetic field (ceres coordinate system)
56 Float_t fMagneticFieldAz; // [rad] Azimuth angle of magnetic north expressed in telescope coordinates
57
58 Float_t fWavelengthMin; // [nm] Wavelength bandwidth lo edge
59 Float_t fWavelengthMax; // [nm] Wavelength bandwidth up edge
60
61 Float_t fViewConeInnerAngle; // [deg]
62 Float_t fViewConeOuterAngle; // [deg]
63
64 Float_t fAtmosphericLayers[5]; // [cm] ATMLAY (see Corsika Manual for details)
65 Float_t fAtmosphericCoeffA[5]; // [g/cm²] AATM (see Corsika Manual for details)
66 Float_t fAtmosphericCoeffB[5]; // [g/cm²] BATM (see Corsika Manual for details)
67 Float_t fAtmosphericCoeffC[5]; // [cm] CATM (see Corsika Manual for details)
68
69 UInt_t fCerenkovFlag;
70
71public:
72 MCorsikaRunHeader(const char *name=NULL, const char *title=NULL);
73
74 // Getter
75 UInt_t GetRunNumber() const { return fRunNumber; }
76 UInt_t GetParticleID() const { return fParticleID; }
77 UInt_t GetNumEvents() const { return fNumEvents; }
78
79 const MTime &GetRunStart() const { return fRunStart; }
80
81 Float_t GetProgramVersion() const { return fProgramVersion; }
82
83 Float_t GetZdMin() const { return fZdMin; }
84 Float_t GetZdMax() const { return fZdMax; }
85
86 Float_t GetAzMin() const { return fAzMin; }
87 Float_t GetAzMax() const { return fAzMax; }
88
89 Float_t GetWavelengthMin() const { return fWavelengthMin; }
90 Float_t GetWavelengthMax() const { return fWavelengthMax; }
91
92 Float_t GetSlopeSpectrum() const { return fSlopeSpectrum; }
93 Float_t GetEnergyMin() const { return fEnergyMin; }
94 Float_t GetEnergyMax() const { return fEnergyMax; }
95
96 Float_t GetImpactMax() const { return fImpactMax; }
97
98 Float_t GetMagneticFieldX() const { return fMagneticFieldX; }
99 Float_t GetMagneticFieldZ() const { return fMagneticFieldZ; }
100 Float_t GetMagneticFieldAz() const { return fMagneticFieldAz; }
101
102 Float_t GetViewConeInnerAngle() const { return fViewConeInnerAngle; }
103 Float_t GetViewConeOuterAngle() const { return fViewConeOuterAngle; }
104 Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
105
106 Float_t GetObsLevel(UInt_t i=0) const { return i>9 ? -1 : fObsLevel[i]; }
107
108 Bool_t Has(CerenkovFlag_t opt) const { return fCerenkovFlag&opt ? 1 : 0; }
109
110 static Double_t EarthRadius() { return fgEarthRadius; }
111
112 // Preliminary!
113 Bool_t HasLayers() const { return fAtmosphericLayers[4]>0; }
114
115 const Float_t *GetAtmosphericLayers() const { return fAtmosphericLayers; }
116 const Float_t *GetAtmosphericCoeffA() const { return fAtmosphericCoeffA; }
117 const Float_t *GetAtmosphericCoeffB() const { return fAtmosphericCoeffB; }
118 const Float_t *GetAtmosphericCoeffC() const { return fAtmosphericCoeffC; }
119
120 UInt_t GetNumAtmosphericModel() const { return (fCerenkovFlag>>10)&0x3ff; }
121
122 // I/O
123 Bool_t ReadEvt(MCorsikaFormat * fInFormat);
124 Bool_t ReadEvtEnd(MCorsikaFormat * fInFormat);
125 Bool_t SeekEvtEnd(istream &fin);
126
127 // TObject
128 void Print(Option_t *t=NULL) const;
129
130 ClassDef(MCorsikaRunHeader, 2) // storage container for general info
131};
132#endif
Note: See TracBrowser for help on using the repository browser.