Changeset 5078 for trunk/MagicSoft


Ignore:
Timestamp:
09/16/04 16:54:27 (20 years ago)
Author:
moralejo
Message:
Updated in CVS after some time...
Location:
trunk/MagicSoft/Simulation/Detector/include-MC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/include-MC/MCCphoton.hxx

    r3046 r5078  
    5858
    5959class MCCphoton {
    60 
    61 public:
     60private:
    6261  Float_t     w;                // wavelength [nm/-] +
    6362                                //   1000*(id_generator)
     
    8382  }
    8483
     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
    8593  // writes photon to binary output stream
    8694  Int_t write ( ofstream &os ) {
     
    9199  // get information about the photon
    92100  inline Float_t get_wl( void ) { return ( w - 1000.*((int)floor(w/1000.))); }
     101
    93102  inline Int_t get_particle( void ) {
    94103    return ( (int)floor(w/1000.) );
    95104  }
     105
    96106
    97107  inline Float_t get_x( void ) { return ( x ); }
     
    102112  inline Float_t get_t( void ) { return ( t ); }
    103113  inline Float_t get_phi( void ) { return ( phi ); }
    104                  
     114
     115
    105116  inline Float_t get_r( void ) { return ( sqrt( x*x + y*y ) ); }
    106117  inline Float_t get_w( void ) { return ( sqrt( 1.0 - u*u - v*v ) ); }
     
    121132  }
    122133
     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
    123143  int isA( const char * flag ) {
    124144    return ( (strncmp((char *)this, flag, 8)==0) ? TRUE : FALSE );
    125145  }
    126146
    127   inline int mysize(void) { return ( SIZE_OF_MCCPHOTON*sizeof(float) ); }
     147  inline int mysize(void) { return ( SIZE_OF_MCCPHOTON*sizeof(Float_t) ); }
    128148
    129149};
  • trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx

    r3046 r5078  
    104104  }
    105105
     106  Int_t read (FILE* f) {
     107    return fread((char*)&EvtNumber, (SIZE_OF_MCEVENTHEADER)*sizeof(Float_t), 1, f );
     108  }
     109 
     110
    106111  // writes EventHeader to binary output stream
    107112  Int_t write ( ofstream &os ) {
  • trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader_2.hxx

    r3046 r5078  
    180180  }
    181181
     182  Int_t read (FILE* f) {
     183    return fread((char*)&EvtNumber, (SIZE_OF_MCEVENTHEADER_2)*sizeof(Float_t), 1, f );
     184  }
     185
    182186  // writes EventHeader to binary output stream
    183187  Int_t write ( ofstream &os ) {
  • trunk/MagicSoft/Simulation/Detector/include-MC/MCRunHeader.hxx

    r3046 r5078  
    132132  }
    133133
     134  Int_t read (FILE* f) {
     135    return fread((char*)&RunNumber, (SIZE_OF_MCRUNHEADER)*sizeof(float), 1, f );
     136  }
     137 
     138
    134139  // writes EventHeader to binary output stream
    135140  Int_t write ( ofstream &os ) {
Note: See TracChangeset for help on using the changeset viewer.