Changeset 5078
- Timestamp:
- 09/16/04 16:54:27 (20 years ago)
- Location:
- trunk/MagicSoft/Simulation/Detector/include-MC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/include-MC/MCCphoton.hxx
r3046 r5078 58 58 59 59 class MCCphoton { 60 61 public: 60 private: 62 61 Float_t w; // wavelength [nm/-] + 63 62 // 1000*(id_generator) … … 83 82 } 84 83 84 Int_t read ( FILE *f ) { 85 return fread( &w, mysize(), 1, f ); 86 } 87 88 void get_flag(Char_t* c) 89 { 90 memcpy(c, (Char_t*)&w, SIZE_OF_FLAGS); 91 } 92 85 93 // writes photon to binary output stream 86 94 Int_t write ( ofstream &os ) { … … 91 99 // get information about the photon 92 100 inline Float_t get_wl( void ) { return ( w - 1000.*((int)floor(w/1000.))); } 101 93 102 inline Int_t get_particle( void ) { 94 103 return ( (int)floor(w/1000.) ); 95 104 } 105 96 106 97 107 inline Float_t get_x( void ) { return ( x ); } … … 102 112 inline Float_t get_t( void ) { return ( t ); } 103 113 inline Float_t get_phi( void ) { return ( phi ); } 104 114 115 105 116 inline Float_t get_r( void ) { return ( sqrt( x*x + y*y ) ); } 106 117 inline Float_t get_w( void ) { return ( sqrt( 1.0 - u*u - v*v ) ); } … … 121 132 } 122 133 134 135 inline void fill(Char_t* data) 136 { 137 cout << "hola1" << endl; 138 memcpy((Char_t*)(&w), data, mysize()); 139 cout << "hola2" << endl; 140 } 141 142 123 143 int isA( const char * flag ) { 124 144 return ( (strncmp((char *)this, flag, 8)==0) ? TRUE : FALSE ); 125 145 } 126 146 127 inline int mysize(void) { return ( SIZE_OF_MCCPHOTON*sizeof( float) ); }147 inline int mysize(void) { return ( SIZE_OF_MCCPHOTON*sizeof(Float_t) ); } 128 148 129 149 }; -
trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx
r3046 r5078 104 104 } 105 105 106 Int_t read (FILE* f) { 107 return fread((char*)&EvtNumber, (SIZE_OF_MCEVENTHEADER)*sizeof(Float_t), 1, f ); 108 } 109 110 106 111 // writes EventHeader to binary output stream 107 112 Int_t write ( ofstream &os ) { -
trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader_2.hxx
r3046 r5078 180 180 } 181 181 182 Int_t read (FILE* f) { 183 return fread((char*)&EvtNumber, (SIZE_OF_MCEVENTHEADER_2)*sizeof(Float_t), 1, f ); 184 } 185 182 186 // writes EventHeader to binary output stream 183 187 Int_t write ( ofstream &os ) { -
trunk/MagicSoft/Simulation/Detector/include-MC/MCRunHeader.hxx
r3046 r5078 132 132 } 133 133 134 Int_t read (FILE* f) { 135 return fread((char*)&RunNumber, (SIZE_OF_MCRUNHEADER)*sizeof(float), 1, f ); 136 } 137 138 134 139 // writes EventHeader to binary output stream 135 140 Int_t write ( ofstream &os ) {
Note:
See TracChangeset
for help on using the changeset viewer.