- Timestamp:
- 09/16/04 16:54:27 (20 years ago)
- File:
-
- 1 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 };
Note:
See TracChangeset
for help on using the changeset viewer.