Ignore:
Timestamp:
10/26/03 20:01:45 (21 years ago)
Author:
blanch
Message:
A check of the StarResponse version has been introduced.
If the one used for the generation of the database and the one of the
current software used is not the same, the camera program will stop.
Current verion 1000.0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/StarResponse/MStarLight.cxx

    r1079 r2430  
    316316  }
    317317
     318  Float_t version = VERSIONSR;
     319
    318320  //   write them out
    319321
     322  fwrite ( &version, sizeof(Float_t), 1, datei ) ;
    320323  fwrite ( &fBrightness, sizeof(Float_t), 1, datei ) ;
    321324  fwrite ( &fTimeRange , sizeof(Float_t), 1, datei ) ;
     
    377380    exit (230) ;
    378381  }
    379  
     382
     383  Float_t read_version;
     384  Float_t current_version=VERSIONSR;
     385
     386  // Check taht we read the right version of the Database
     387  fread ( &read_version, sizeof(Float_t), 1, datei ) ;
     388
     389  if(Int_t(read_version)!=Int_t(current_version)){
     390    cout<<" Error: You are trying to read database VERSION "<<
     391      read_version<<endl;
     392    cout<<" You must generate a databse for the current VERSION "<<
     393      current_version<<endl;
     394    exit (230);
     395  }
     396
    380397  fread ( &fBrightness, sizeof(Float_t), 1, datei ) ;
    381398  fread ( &fTimeRange , sizeof(Float_t), 1, datei ) ;
Note: See TracChangeset for help on using the changeset viewer.