source: trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunHeader.hxx@ 9223

Last change on this file since 9223 was 3046, checked in by blanch, 21 years ago
*** empty log message ***
File size: 4.3 KB
Line 
1/////////////////////////////////////////////////////////////////
2//
3// CORRunHeader
4//
5// Created: Tue Apr 15 16:27:14 2001
6// Author: Carles Domingo
7// Purpose: Base class for RunHeader-classes
8// Notes:
9//
10/////////////////////////////////////////////////////////////////
11
12// @T \newpage
13
14// @section Source code of {\tt CORRunHeader.hxx}
15
16/* @text
17This section shows the include file {\tt CORRunHeader.hxx}
18@endtext */
19
20#ifndef CORRunHeader_Class
21#define CORRunHeader_Class
22
23// @subsection Include files
24
25// @code
26#include "TROOT.h"
27#include "TObject.h"
28
29#include <iostream.h>
30#include <iomanip.h>
31#include <fstream.h>
32#include <stdlib.h>
33#include <math.h>
34
35#include "COREventHeader.hxx"
36
37// @endcode
38
39// @subsection Class {\em CORRunHeader}: Definition
40
41// @code
42class CORRunHeader {
43
44public:
45
46 char RUNH[4];
47 Float_t RunNumber;
48 Float_t DateRun;
49 Float_t VersionPGM;
50
51 Float_t NumObsLev;
52 Float_t HeightLev[10];
53
54 Float_t SlopeSpec;
55 Float_t ELowLim;
56 Float_t EUppLim;
57
58 Float_t EGS4yn;
59 Float_t NKGyn;
60
61 Float_t Ecutoffh;
62 Float_t Ecutoffm;
63 Float_t Ecutoffe;
64 Float_t Ecutoffg;
65
66 Float_t C[50];
67 Float_t dmmy1[20];
68 Float_t CKA[40];
69 Float_t CETA[5];
70 Float_t CSTRBA[11];
71 Float_t dmmy2[104];
72 Float_t AATM[5];
73 Float_t BATM[5];
74 Float_t CATM[5];
75 Float_t NFLAIN;
76 Float_t NFLDIF;
77 Float_t NFLPI0_PIF;
78 Float_t NFLCHE_AGM;
79
80public:
81 CORRunHeader(void) {} // default constructor
82
83 virtual ~CORRunHeader(void) {} // default destructor
84
85 // reads RunHeader from binary input stream
86 Int_t read ( ifstream &is ) {
87 is.read ( (char *)this, sizeof( float ) * 273 );
88 return is.gcount();
89 }
90
91 // writes RunHeader to binary output stream
92 Int_t write ( ofstream &os ) {
93 os.write ( (char *)this, sizeof( float ) * 273 );
94 return 0;
95 }
96
97 // get information about the RunHeader
98
99 // print-out of the RUNH
100 void print(void);
101
102 // get the run number
103 inline Float_t get_number ( void ) { return (RunNumber); }
104
105 // get the spectrum slope
106 inline Float_t get_slope ( void ) { return ( SlopeSpec ); }
107
108 // get the energy range of this run
109 inline void get_energy_range ( Float_t *elow, Float_t *eup ) {
110 *elow = ELowLim;
111 *eup = EUppLim;
112 }
113
114 // fill Run Header
115 inline void fill ( Float_t theRunNumber,
116 Float_t theDateRun,
117 Float_t theVersionPGM,
118 Float_t theNumObsLev,
119 Float_t theHeightLev1,
120 Float_t theHeightLev2,
121 Float_t theHeightLev3,
122 Float_t theHeightLev4,
123 Float_t theHeightLev5,
124 Float_t theHeightLev6,
125 Float_t theHeightLev7,
126 Float_t theHeightLev8,
127 Float_t theHeightLev9,
128 Float_t theHeightLev10,
129 Float_t theSlopeSpec,
130 Float_t theELowLim,
131 Float_t theEUppLim,
132 Float_t theEGS4yn,
133 Float_t theNKGyn,
134 Float_t theEcutoffh,
135 Float_t theEcutoffm,
136 Float_t theEcutoffe,
137 Float_t theEcutoffg) {
138
139 strcpy(RUNH,"RUNH");
140 RunNumber = theRunNumber;
141 DateRun = theDateRun;
142 VersionPGM = theVersionPGM;
143 NumObsLev = theNumObsLev;
144 HeightLev[0] = theHeightLev1;
145 HeightLev[1] = theHeightLev2;
146 HeightLev[2] = theHeightLev3;
147 HeightLev[3] = theHeightLev4;
148 HeightLev[4] = theHeightLev5;
149 HeightLev[5] = theHeightLev6;
150 HeightLev[6] = theHeightLev7;
151 HeightLev[7] = theHeightLev8;
152 HeightLev[8] = theHeightLev9;
153 HeightLev[9] = theHeightLev10;
154 SlopeSpec = theSlopeSpec;
155 ELowLim = theELowLim;
156 EUppLim = theEUppLim;
157 EGS4yn = theEGS4yn;
158 NKGyn = theNKGyn;
159 Ecutoffh = theEcutoffh;
160 Ecutoffm = theEcutoffm;
161 Ecutoffe = theEcutoffe;
162 Ecutoffg = theEcutoffg;
163
164 return;
165 }
166
167 // transport from COREventHeader to CORRunHeader
168 void transport ( COREventHeader *e );
169
170 // Reset CORRunHeader
171 void reset ( void );
172
173};
174// @endcode
175
176#endif // not defined CORRunHeader_Class
Note: See TracBrowser for help on using the repository browser.