Changeset 1550


Ignore:
Timestamp:
10/18/02 17:53:03 (22 years ago)
Author:
blanch
Message:
Modification to read several reflector files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx

    r1521 r1550  
    2121//
    2222// $RCSfile: camera.cxx,v $
    23 // $Revision: 1.43 $
     23// $Revision: 1.44 $
    2424// $Author: blanch $
    25 // $Date: 2002-09-13 10:53:39 $
     25// $Date: 2002-10-18 16:53:03 $
    2626//
    2727////////////////////////////////////////////////////////////////////////
     
    18501850                    heights,
    18511851                    corsika,
    1852                     (UInt_t)(REFL_VERSION*100),
     1852                    (UInt_t)(REFL_VERSION_A*100),
    18531853                    (UInt_t)(VERSION*100));
    18541854 
     
    30333033int check_reflector_file(FILE *infile){
    30343034
    3035   char Signature[20];           // auxiliary variable
    30363035  char sign[20];                // auxiliary variable
    30373036
    3038   strcpy(Signature, REFL_SIGNATURE);
    3039  
    3040   strcpy(sign, Signature);
    3041  
    3042   fread( (char *)sign, strlen(Signature), 1, infile);
    3043 
    3044   if (strcmp(sign, Signature) != 0) {
     3037  strcpy(sign, REFL_SIGNATURE_B);
     3038 
     3039  fread( (char *)sign, strlen(REFL_SIGNATURE_B), 1, infile);
     3040  if (strcmp(sign, REFL_SIGNATURE_A) == 0){
     3041    fread( (char *)sign, 1, 1, infile);
     3042    return 4;
     3043  }
     3044  else if (strcmp(sign, REFL_SIGNATURE_B) == 0){
     3045    fread( (char *)sign, 1, 1, infile);
     3046    return 5;
     3047  }
     3048  else if (strcmp(sign, REFL_SIGNATURE_C) == 0){
     3049    fread( (char *)sign, 1, 1, infile);
     3050    return 6;
     3051  }
     3052  else {
    30453053    cout << "ERROR: Signature of .rfl file is not correct\n";
    30463054    cout << '"' << sign << '"' << '\n';
    3047     cout << "should be: " << Signature << '\n';
     3055    cout << "should be: " << REFL_SIGNATURE_A <<" or "<< REFL_SIGNATURE_B <<" or " << REFL_SIGNATURE_C <<" or "<< '\n';
    30483056    return(FALSE);
    30493057  }
    30503058
    3051   fread( (char *)sign, 1, 1, infile);
    3052 
    3053   return(TRUE);
    30543059
    30553060}
     
    36013606//
    36023607// $Log: not supported by cvs2svn $
     3608// Revision 1.43  2002/09/13 10:53:39  blanch
     3609// Minor change to remove some undisired comments.
     3610//
    36033611// Revision 1.42  2002/09/09 16:00:49  blanch
    36043612// Statement has been included to avoid writting to disk MParContainer and MArray.
     
    37313739//
    37323740// $Log: not supported by cvs2svn $
     3741// Revision 1.43  2002/09/13 10:53:39  blanch
     3742// Minor change to remove some undisired comments.
     3743//
    37333744// Revision 1.42  2002/09/09 16:00:49  blanch
    37343745// Statement has been included to avoid writting to disk MParContainer and MArray.
Note: See TracChangeset for help on using the changeset viewer.