Ignore:
Timestamp:
10/26/04 15:04:42 (20 years ago)
Author:
moralejo
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx

    r5248 r5319  
    7474  //
    7575
    76   fwhm_resp = RESPONSE_FWHM       ;
    77   ampl_resp = RESPONSE_AMPLITUDE  ;
     76  fwhm_resp = RESPONSE_FWHM;
     77  ampl_resp = RESPONSE_AMPLITUDE;
    7878
    7979  overlaping_time = TRIGGER_OVERLAPING;
    8080
    81   threshold = CHANNEL_THRESHOLD  ;
    82  
    83 
    84   gate_leng        = TRIGGER_GATE       ;
    85   trigger_multi    = TRIGGER_MULTI      ;
    86   trigger_geometry = TRIGGER_GEOM ;
     81  threshold = CHANNEL_THRESHOLD;
     82 
     83
     84  gate_leng        = TRIGGER_GATE;
     85  trigger_multi    = TRIGGER_MULTI;
     86  trigger_geometry = TRIGGER_GEOM;
    8787
    8888  //
     
    234234 
    235235
    236   //
    237   //   the amplitude of one single photo electron is not a constant.
    238   //   There exists a measured distribution from Razmik. This distribution
    239   //   is used to simulate the noise of the amplitude.
    240   //   For this a histogramm (histPmt) is created and filled with the
    241   //   values.
    242   //
    243 
    244   histPmt = new TH1F ("histPmt","Noise of PMT", 40, 0., 40.) ;
    245  
    246   Stat_t ValRazmik[41] = { 0., 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08,  2.15,
    247                            2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20,  2.10,
    248                            1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65,  0.50,
    249                            0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12,  0.10,
    250                            0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ;
    251 
    252   histMean =  histPmt->GetMean() ;   
    253  
    254   for (i=0;i<41;i++){
    255     histPmt->SetBinContent(i,ValRazmik[i]);
    256   }
    257 
    258   histMean =  histPmt->GetMean() ;
     236  // Initialize histogram histPmt which represents the distribution of amplitudes
     237  // of the PMT response to a single photpelectron.
     238
     239  InitGainFluctuations();
     240
    259241
    260242  //
     
    481463  peak_time = ( (Float_t) imax )  / ( (Float_t) TRIG_SLICES_PER_NSEC ) ;
    482464 
    483   //
    484   //   the amplitude of one single photo electron is not a constant.
    485   //   There exists a measured distribution from Razmik. This distribution
    486   //   is used to simulate the noise of the amplitude.
    487   //   For this a histogramm (histPmt) is created and filled with the
    488   //   values.
    489   //
    490 
     465
     466  // Initialize histogram histPmt which represents the distribution of amplitudes
     467  // of the PMT response to a single photpelectron.
     468
     469  InitGainFluctuations();
     470 
     471  //
     472  // Change name of histogram (tag with CT id) to avoid confusion in the case of
     473  // multi-telescope simulations.
     474  //
    491475  char histname[32];
    492476  sprintf(histname, "histPmt_%d", ct_id);
    493   histPmt = new TH1F (histname,"Noise of PMT", 40, 0., 40.) ;
    494  
    495   Stat_t ValRazmik[41] = { 0., 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08,  2.15,
    496                            2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20,  2.10,
    497                            1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65,  0.50,
    498                            0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12,  0.10,
    499                            0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ;
    500 
    501   histMean =  histPmt->GetMean() ;   
    502  
    503   for (i=0;i<41;i++){
    504     histPmt->SetBinContent(i,ValRazmik[i]);
    505   }
    506 
    507   histMean =  histPmt->GetMean() ;
     477  histPmt->SetName(histname);
     478
    508479
    509480  //
     
    644615  //
    645616
    646   fwhm_resp = fwhm       ;
    647   ampl_resp = ampl  ;
     617  fwhm_resp = fwhm;
     618  ampl_resp = ampl;
    648619
    649620  overlaping_time = overt;
    650621
    651622   
    652   threshold = CHANNEL_THRESHOLD  ;
    653  
    654 
    655   gate_leng        = gate       ;
    656   trigger_multi    = TRIGGER_MULTI      ;
    657   trigger_geometry = TRIGGER_GEOM ;
     623  threshold = CHANNEL_THRESHOLD;
     624 
     625
     626  gate_leng        = gate;
     627  trigger_multi    = TRIGGER_MULTI;
     628  trigger_geometry = TRIGGER_GEOM;
    658629
    659630  cout << endl
     
    710681  peak_time = ( (Float_t) imax )  / ( (Float_t) TRIG_SLICES_PER_NSEC ) ;
    711682 
    712   //
    713   //   the amplitude of one single photo electron is not a constant.
    714   //   There exists a measured distribution from Razmik. This distribution
    715   //   is used to simulate the noise of the amplitude.
    716   //   For this a histogramm (histPmt) is created and filled with the
    717   //   values.
    718   //
    719 
    720   histPmt = new TH1F ("histPmt","Noise of PMT", 40, 0., 40.) ;
    721  
    722   Stat_t ValRazmik[41] = { 0., 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08,  2.15,
    723                            2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20,  2.10,
    724                            1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65,  0.50,
    725                            0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12,  0.10,
    726                            0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ;
    727 
    728   histMean =  histPmt->GetMean() ;   
    729  
    730   for (i=0;i<41;i++){
    731     histPmt->SetBinContent(i,ValRazmik[i]);
    732   }
    733 
    734   histMean =  histPmt->GetMean() ;
     683
     684  // Initialize histogram histPmt which represents the distribution of amplitudes
     685  // of the PMT response to a single photpelectron.
     686
     687  InitGainFluctuations();
     688
    735689
    736690  //
     
    931885    //  the FADC simulation
    932886    //
    933     PmtAmp =  (histPmt->GetRandom()/histMean) ;
     887    if (fGainFluctuations)
     888      PmtAmp =  (histPmt->GetRandom()/histMean) ;
     889    else
     890      PmtAmp = 1.0;
    934891
    935892    // AM April 2004: removed updating of counters nphotshow, nphotnsb,
     
    960917   
    961918    //
    962     // get the randomized amplitude
    963     //
    964     PmtAmp =  (histPmt->GetRandom()/histMean) ;
     919    // get the randomized amplitude (unless fGainFluctuations == kFALSE)
     920    //
     921    if (fGainFluctuations)
     922      PmtAmp =  (histPmt->GetRandom()/histMean) ;
     923    else
     924      PmtAmp = 1.0;
    965925
    966926    //
     
    10611021  Float_t rausch ;
    10621022
    1063   rausch = RESPONSE_AMPLITUDE * factor ;
     1023  rausch = ampl_resp * factor ;
    10641024 
    10651025  cout<<"MTrigger::SetElecNoise ... generating database for electronic noise."
     
    10801040  //    to the signal
    10811041  //
    1082   Float_t rausch ;
    1083 
    1084   rausch = RESPONSE_AMPLITUDE * factor ;
    10851042
    10861043  UInt_t startslice;
     
    19001857
    19011858}
     1859
     1860//=================================================================
     1861
     1862void MTrigger::InitGainFluctuations()
     1863{
     1864  //
     1865  //   The amplitude of one single photo electron is not a constant.
     1866  //   There exists a measured distribution from Razmik. This distribution
     1867  //   is used to simulate the noise of the amplitude.
     1868  //   For this a histogramm (histPmt) is created and filled with the
     1869  //   values.
     1870  //
     1871
     1872  histPmt = new TH1F ("histPmt","Noise of PMT", 40, 0., 40.) ;
     1873 
     1874  Stat_t ValRazmik[40] = { 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08,  2.15,
     1875                           2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20,  2.10,
     1876                           1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65,  0.50,
     1877                           0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12,  0.10,
     1878                           0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ;
     1879
     1880  for (Int_t i = 0; i < 40; i++)
     1881    histPmt->SetBinContent(i+1 ,ValRazmik[i]);
     1882
     1883  histMean =  histPmt->GetMean() ;
     1884
     1885  fGainFluctuations = kTRUE; // Default value
     1886
     1887  return;
     1888}
Note: See TracChangeset for help on using the changeset viewer.