source: trunk/MagicSoft/Simulation/Detector/include-MC/MCRunHeader.hxx@ 4308

Last change on this file since 4308 was 3046, checked in by blanch, 21 years ago
*** empty log message ***
File size: 3.8 KB
Line 
1/////////////////////////////////////////////////////////////////
2//
3// MCRunHeader
4//
5// Created: Wed Oct 30 17:43:14 2002
6// Author: Oscar Blanch Bigas
7// Purpose: Base class for RunHeader-classes
8// Notes:
9//
10/////////////////////////////////////////////////////////////////
11
12// @T \newpage
13
14// @section Source code of {\tt MCRunHeader.hxx}
15
16/* @text
17This section shows the include file {\tt MCRunHeader.hxx}
18@endtext */
19
20#ifndef MCRunHeader_Class
21#define MCRunHeader_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#define SIZE_OF_MCRUNHEADER 272 /* floats */
36
37// @endcode
38
39// @subsection Class {\em MCRunHeader}: Definition
40
41// @code
42class MCRunHeader {
43
44protected:
45 Float_t RunNumber;
46 Float_t date;
47 Float_t Corsika_version;
48 Float_t NumObsLev;
49 Float_t HeightLev[10];
50 Float_t SlopeSpec; /* Slope of primaries' energy spectrum */
51 Float_t ELowLim;
52 Float_t EUppLim; /* Limits of energy range for generation */
53 Float_t EGS4_flag;
54 Float_t NKG_flag;
55 Float_t Ecutoffh;
56 Float_t Ecutoffm;
57 Float_t Ecutoffe;
58 Float_t Ecutoffg;
59 /* Physical constants and interaction flags (see CORSIKA manual): */
60 Float_t C[50];
61 float wobble_mode; /* Indicates wobble mode with which
62 reflector has been run */
63 float atmospheric_model; /* Indicates atmospheric model used in
64 absorption simulation. 0 = no atmosphere,
65 1 = atm_90percent, 2 = atm_isothermal,
66 3 = atm_corsika.
67 */
68 Float_t dummy1[18]; /* not used */
69 Float_t CKA[40];
70 Float_t CETA[5];
71 Float_t CSTRBA[11];
72 Float_t dummy2[104]; /* not used */
73 Float_t AATM[5];
74 Float_t BATM[5];
75 Float_t CATM[5];
76 Float_t NFL[4];
77
78public:
79 MCRunHeader(void) {} // default constructor
80
81 virtual ~MCRunHeader(void) {} // default destructor
82
83 // Get variables
84 void get_constantC(float *c){
85 for (int i=0;i<50;i++)
86 c[i]=C[i];
87 }
88 void get_constantCKA(float *cka){
89 for (int i=0;i<40;i++)
90 cka[i]=CKA[i];
91 }
92 void get_constantCETA(float *ceta){
93 for (int i=0;i<5;i++)
94 ceta[i]=CETA[i];
95 }
96 void get_constantCSTRBA(float *cstrba){
97 for (int i=0;i<11;i++)
98 cstrba[i]=CSTRBA[i];
99 }
100 void get_constantAATM(float *aatm){
101 for (int i=0;i<5;i++)
102 aatm[i]=AATM[i];
103 }
104 void get_constantBATM(float *batm){
105 for (int i=0;i<5;i++)
106 batm[i]=BATM[i];
107 }
108 void get_constantCATM(float *catm){
109 for (int i=0;i<5;i++)
110 catm[i]=CATM[i];
111 }
112 void get_constantNFL(float *nfl){
113 for (int i=0;i<4;i++)
114 nfl[i]=NFL[i];
115 }
116
117 float get_date() { return date;}
118 float get_ELow() { return ELowLim;}
119 float get_EUpp() { return EUppLim;}
120 float get_EGS4() { return EGS4_flag;}
121 float get_NKG() { return NKG_flag;}
122 float get_Ecutoffh() {return Ecutoffh;}
123 float get_Ecutoffm() {return Ecutoffm;}
124 float get_Ecutoffe() {return Ecutoffe;}
125 float get_Ecutoffg() {return Ecutoffg;}
126 float get_wobble() {return wobble_mode;}
127 float get_atmophere() {return atmospheric_model;}
128 // reads EventHeader from binary input stream
129 Int_t read ( ifstream &is ) {
130 is.read ( (char *)this, mysize() );
131 return is.gcount();
132 }
133
134 // writes EventHeader to binary output stream
135 Int_t write ( ofstream &os ) {
136 os.write ( (char *)this, mysize() );
137 return 0;
138 }
139
140 inline int mysize(void)
141 { return ( sizeof( float ) * SIZE_OF_MCRUNHEADER ); }
142
143 inline void print ( void ) {
144 float *ptr = (float *)this;
145 for(int i=0; i<SIZE_OF_MCRUNHEADER; ++i,++ptr)
146 cerr << i << ':' << *ptr << '\n';
147 }
148
149};
150// @endcode
151
152#endif // not defined MCRunHeader_Class
Note: See TracBrowser for help on using the repository browser.