| 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
|
|---|
| 17 | This 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 | #ifdef __ROOT__
|
|---|
| 27 | #include "TROOT.h"
|
|---|
| 28 | #include "TObject.h"
|
|---|
| 29 | #else // not __ROOT__
|
|---|
| 30 | #include "Rtypes.h"
|
|---|
| 31 | #endif
|
|---|
| 32 |
|
|---|
| 33 | #include <iostream.h>
|
|---|
| 34 | #include <iomanip.h>
|
|---|
| 35 | #include <fstream.h>
|
|---|
| 36 | #include <stdlib.h>
|
|---|
| 37 | #include <math.h>
|
|---|
| 38 |
|
|---|
| 39 | #define SIZE_OF_MCRUNHEADER 272 /* floats */
|
|---|
| 40 |
|
|---|
| 41 | // @endcode
|
|---|
| 42 |
|
|---|
| 43 | // @subsection Class {\em MCRunHeader}: Definition
|
|---|
| 44 |
|
|---|
| 45 | // @code
|
|---|
| 46 | class MCRunHeader {
|
|---|
| 47 |
|
|---|
| 48 | protected:
|
|---|
| 49 | Float_t RunNumber;
|
|---|
| 50 | Float_t date;
|
|---|
| 51 | Float_t Corsika_version;
|
|---|
| 52 | Float_t NumObsLev;
|
|---|
| 53 | Float_t HeightLev[10];
|
|---|
| 54 | Float_t SlopeSpec; /* Slope of primaries' energy spectrum */
|
|---|
| 55 | Float_t ELowLim;
|
|---|
| 56 | Float_t EUppLim; /* Limits of energy range for generation */
|
|---|
| 57 | Float_t EGS4_flag;
|
|---|
| 58 | Float_t NKG_flag;
|
|---|
| 59 | Float_t Ecutoffh;
|
|---|
| 60 | Float_t Ecutoffm;
|
|---|
| 61 | Float_t Ecutoffe;
|
|---|
| 62 | Float_t Ecutoffg;
|
|---|
| 63 | /* Physical constants and interaction flags (see CORSIKA manual): */
|
|---|
| 64 | Float_t C[50];
|
|---|
| 65 | float wobble_mode; /* Indicates wobble mode with which
|
|---|
| 66 | reflector has been run */
|
|---|
| 67 | float atmospheric_model; /* Indicates atmospheric model used in
|
|---|
| 68 | absorption simulation. 0 = no atmosphere,
|
|---|
| 69 | 1 = atm_90percent, 2 = atm_isothermal,
|
|---|
| 70 | 3 = atm_corsika.
|
|---|
| 71 | */
|
|---|
| 72 | Float_t dummy1[18]; /* not used */
|
|---|
| 73 | Float_t CKA[40];
|
|---|
| 74 | Float_t CETA[5];
|
|---|
| 75 | Float_t CSTRBA[11];
|
|---|
| 76 | Float_t dummy2[104]; /* not used */
|
|---|
| 77 | Float_t AATM[5];
|
|---|
| 78 | Float_t BATM[5];
|
|---|
| 79 | Float_t CATM[5];
|
|---|
| 80 | Float_t NFL[4];
|
|---|
| 81 |
|
|---|
| 82 | public:
|
|---|
| 83 | MCRunHeader(void) {} // default constructor
|
|---|
| 84 |
|
|---|
| 85 | virtual ~MCRunHeader(void) {} // default destructor
|
|---|
| 86 |
|
|---|
| 87 | // Get variables
|
|---|
| 88 | void get_constantC(float *c){
|
|---|
| 89 | for (int i=0;i<50;i++)
|
|---|
| 90 | c[i]=C[i];
|
|---|
| 91 | }
|
|---|
| 92 | void get_constantCKA(float *cka){
|
|---|
| 93 | for (int i=0;i<40;i++)
|
|---|
| 94 | cka[i]=CKA[i];
|
|---|
| 95 | }
|
|---|
| 96 | void get_constantCETA(float *ceta){
|
|---|
| 97 | for (int i=0;i<5;i++)
|
|---|
| 98 | ceta[i]=CETA[i];
|
|---|
| 99 | }
|
|---|
| 100 | void get_constantCSTRBA(float *cstrba){
|
|---|
| 101 | for (int i=0;i<11;i++)
|
|---|
| 102 | cstrba[i]=CSTRBA[i];
|
|---|
| 103 | }
|
|---|
| 104 | void get_constantAATM(float *aatm){
|
|---|
| 105 | for (int i=0;i<5;i++)
|
|---|
| 106 | aatm[i]=AATM[i];
|
|---|
| 107 | }
|
|---|
| 108 | void get_constantBATM(float *batm){
|
|---|
| 109 | for (int i=0;i<5;i++)
|
|---|
| 110 | batm[i]=BATM[i];
|
|---|
| 111 | }
|
|---|
| 112 | void get_constantCATM(float *catm){
|
|---|
| 113 | for (int i=0;i<5;i++)
|
|---|
| 114 | catm[i]=CATM[i];
|
|---|
| 115 | }
|
|---|
| 116 | void get_constantNFL(float *nfl){
|
|---|
| 117 | for (int i=0;i<4;i++)
|
|---|
| 118 | nfl[i]=NFL[i];
|
|---|
| 119 | }
|
|---|
| 120 |
|
|---|
| 121 | float get_date() { return date;}
|
|---|
| 122 | float get_ELow() { return ELowLim;}
|
|---|
| 123 | float get_EUpp() { return EUppLim;}
|
|---|
| 124 | float get_EGS4() { return EGS4_flag;}
|
|---|
| 125 | float get_NKG() { return NKG_flag;}
|
|---|
| 126 | float get_Ecutoffh() {return Ecutoffh;}
|
|---|
| 127 | float get_Ecutoffm() {return Ecutoffm;}
|
|---|
| 128 | float get_Ecutoffe() {return Ecutoffe;}
|
|---|
| 129 | float get_Ecutoffg() {return Ecutoffg;}
|
|---|
| 130 | float get_wobble() {return wobble_mode;}
|
|---|
| 131 | float get_atmophere() {return atmospheric_model;}
|
|---|
| 132 | // reads EventHeader from binary input stream
|
|---|
| 133 | Int_t read ( ifstream &is ) {
|
|---|
| 134 | is.read ( (char *)this, mysize() );
|
|---|
| 135 | return is.gcount();
|
|---|
| 136 | }
|
|---|
| 137 |
|
|---|
| 138 | // writes EventHeader to binary output stream
|
|---|
| 139 | Int_t write ( ofstream &os ) {
|
|---|
| 140 | os.write ( (char *)this, mysize() );
|
|---|
| 141 | return 0;
|
|---|
| 142 | }
|
|---|
| 143 |
|
|---|
| 144 | inline int mysize(void)
|
|---|
| 145 | { return ( sizeof( float ) * SIZE_OF_MCRUNHEADER ); }
|
|---|
| 146 |
|
|---|
| 147 | inline void print ( void ) {
|
|---|
| 148 | float *ptr = (float *)this;
|
|---|
| 149 | for(int i=0; i<SIZE_OF_MCRUNHEADER; ++i,++ptr)
|
|---|
| 150 | cerr << i << ':' << *ptr << '\n';
|
|---|
| 151 | }
|
|---|
| 152 |
|
|---|
| 153 | };
|
|---|
| 154 | // @endcode
|
|---|
| 155 |
|
|---|
| 156 | #endif // not defined MCRunHeader_Class
|
|---|