Changeset 5418 for trunk/MagicSoft


Ignore:
Timestamp:
11/17/04 11:38:28 (20 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Simulation/Detector
Files:
5 edited

Legend:

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

    r5317 r5418  
    1919//=
    2020//= $RCSfile: creadparam.cxx,v $
    21 //= $Revision: 1.33 $
     21//= $Revision: 1.34 $
    2222//= $Author: moralejo $
    23 //= $Date: 2004-10-26 13:58:59 $
     23//= $Date: 2004-11-17 11:36:07 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    118118static int   selected_pixel = -1; // Selected pixel: if >= 0 ==> only this pixel is filled!
    119119
    120 static int   gain_fluctuations = 1; // Is 0 if PMT gain fluctuations are disabled
     120static int   gain_fluctuations = 1; // Is 0 if PMT gain fluctuations are disabled for signal
     121static int   noise_gain_fluctuations = 1; // Is 0 if PMT gain fluctuations are disabled for NSB noise
    121122
    122123// Coordinates of CT locations, in centimeters, in the Corsika system.
     
    629630      break;
    630631
     632    case noise_gain_fluctuations_off:
     633
     634      noise_gain_fluctuations = 0;
     635
     636      break;
     637
    631638    case end_file:            //@< end of the parameters file
    632639
     
    14111418}
    14121419 
     1420int apply_noise_gain_fluctuations()
     1421{
     1422  return noise_gain_fluctuations;
     1423}
     1424 
    14131425
    14141426//=------------------------------------------------------------
     
    14181430//
    14191431// $Log: not supported by cvs2svn $
     1432// Revision 1.33  2004/10/26 13:58:59  moralejo
     1433//
     1434// Added option gain_fluctuations_off
     1435//
    14201436// Revision 1.32  2004/10/14 16:53:49  moralejo
    14211437//
  • trunk/MagicSoft/Simulation/Detector/Camera/creadparam.h

    r5317 r5418  
    1919//=
    2020//= $RCSfile: creadparam.h,v $
    21 //= $Revision: 1.29 $
     21//= $Revision: 1.30 $
    2222//= $Author: moralejo $
    23 //= $Date: 2004-10-26 13:58:59 $
     23//= $Date: 2004-11-17 11:36:07 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    116116T(mirror_fraction), /* Fraction of dish mirror really operative */ \
    117117T(calibration_run), /* option to produce a calibration file */ \
    118 T(gain_fluctuations_off), /* Switches off PMT gain fluctuations */ \
     118T(gain_fluctuations_off), /* Switches off PMT gain fluctuations for signal */ \
     119T(noise_gain_fluctuations_off), /* Switches off PMT gain fluctuations for NSB noise */ \
    119120T(end_file)         /* end of the parameters file */
    120121
     
    197198                                 float *sigma_time, int *nevents, int *selected_pixel);
    198199int   apply_gain_fluctuations();
     200int   apply_noise_gain_fluctuations();
    199201//!@}
    200202
     
    212214/*
    213215 * $Log: not supported by cvs2svn $
     216 * Revision 1.29  2004/10/26 13:58:59  moralejo
     217 *
     218 * Added option gain_fluctuations_off
     219 *
    214220 * Revision 1.28  2004/10/13 17:05:05  moralejo
    215221 * *** empty log message ***
  • trunk/MagicSoft/Simulation/Detector/StarResponse/starresponse.cxx

    r5408 r5418  
    2525  MStarLight  data(fadc->GetFadcSlicesPerNanosec(), fadc->GetResponseSlicesFadc());
    2626  // create  instance of the MStarLight
     27
     28  data.SetGainFluctuations(apply_gain_fluctuations());
    2729
    2830  //  Shall I write the root file???
  • trunk/MagicSoft/Simulation/Detector/include-MLons/MLons.cxx

    r5306 r5418  
    1919  fFwhmFadc = 2.0;
    2020
     21  fGainFluctuations = 1;
     22
    2123  RandomNumber = new TRandom();
    2224  RandomNumber -> SetSeed(0);
     
    2628MLons::MLons(Int_t in_shapeT, Float_t in_amplT, Float_t in_FwhmT,
    2729             Int_t in_shapeF, Float_t in_integF, Float_t in_FwhmF,
    28              Float_t in_Fadc_Slices_per_ns)
     30             Float_t in_Fadc_Slices_per_ns, Int_t in_Gain_Fluctuations)
    2931{
    3032  //--------------------------------------------------------------------
     
    4345  fFadcSlicesPerNanosec = in_Fadc_Slices_per_ns;
    4446
     47  fGainFluctuations = in_Gain_Fluctuations;
     48
    4549  MSLStored = new MStarLight;
    4650
     
    6367  fIntegFadc   = 0.;
    6468  fFwhmFadc    = 0.;
     69
     70  fGainFluctuations = 1;
    6571
    6672  MSLStored->Reset();
     
    221227      strcat(filename_slt, ".slt");
    222228 
    223       // If brightness is different it check if the new file has the
     229      // If brightness is different it checks if the new file has the
    224230      // required parameters.
    225231      // Note: I could be faster to store the whole trigger and fadc
     
    236242          return 0;
    237243        }
     244
     245      if ( !MSLStored->GetGainFluctuations() && fGainFluctuations)
     246        {
     247          cout << endl << "ERROR! The read NSB database in " << filename_slt << endl;
     248          cout << "has been produced without PMT gain fluctuations. This is incompatible" << endl;
     249          cout << "with the camera input card you are using. Please change the camera" << endl;
     250          cout << "input card (adding the  noise_gain_fluctuations_off  command) or"  << endl;
     251          cout << "produce a new NSB database (using program StarResponse) without" << endl;
     252          cout << "gain fluctuations. Exiting..." << endl << endl;
     253          return 0;
     254        }
     255
     256      else if ( MSLStored->GetGainFluctuations() && !fGainFluctuations)
     257        {
     258          cout << endl << "ERROR! The read NSB database in " << filename_slt << endl;
     259          cout << "has been produced with PMT gain fluctuations. This is incompatible" << endl;
     260          cout << "with the camera input card command  noise_gain_fluctuations_off" << endl;
     261          cout << "that you are using. Please change the camera input card or produce a" << endl;
     262          cout << "new NSB database (using program StarResponse) without gain fluctuations." << endl;
     263          cout << "Exiting..." << endl << endl;
     264          return 0;
     265        }
     266
    238267      MSLStored->SetBrightness(in_br);
    239268
  • trunk/MagicSoft/Simulation/Detector/include-MLons/MLons.hxx

    r5306 r5418  
    5757  Float_t  fFadcSlicesPerNanosec; // The sampling frequency (GHz) of the FADC
    5858
     59  Int_t    fGainFluctuations; // Indicates whether or not  gain fluctuations have
     60                              // been simulated for producing the NSB database
     61
     62
    5963  TRandom  *RandomNumber; // RandomGenerator
    6064
     
    6569  MLons(Int_t in_shapeT, Float_t in_amplT, Float_t in_FwhmT,
    6670        Int_t in_shapeF, Float_t in_integF, Float_t in_FwhmF,
    67         Float_t in_Fadc_Slices_per_ns);
     71        Float_t in_Fadc_Slices_per_ns, Int_t in_Gain_Fluctuations);
    6872
    6973  void Reset() ;
     
    8387  Float_t GetFwhmFadc() ;
    8488  Float_t GetFadcSlicesPerNanosec() {return fFadcSlicesPerNanosec;}
     89  Int_t   GetGainFluctuations() const { return fGainFluctuations; }
     90
    8591
    8692  void GetPath(Char_t *out);
Note: See TracChangeset for help on using the changeset viewer.