Ignore:
Timestamp:
10/26/04 15:04:42 (20 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Simulation/Detector
Files:
4 edited

Legend:

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

    r5290 r5319  
    1919//=
    2020//= $RCSfile: camera.h,v $
    21 //= $Revision: 1.24 $
     21//= $Revision: 1.25 $
    2222//= $Author: moralejo $
    23 //= $Date: 2004-10-19 10:35:05 $
     23//= $Date: 2004-10-26 14:03:00 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    356356                        class MFadc *fadc, int *itotnphe, float *nphe,
    357357                        int *nphot, int ict, float lambda, float sigma_lambda,
    358                         float phot_per_pix, float sigma_time, int selected_pixel);
     358                        float phot_per_pix, float sigma_time, int selected_pixel,
     359                        float fadc_jitter);
    359360
    360361
     
    368369/*
    369370 *$Log: not supported by cvs2svn $
     371 *Revision 1.24  2004/10/19 10:35:05  moralejo
     372 **** empty log message ***
     373 *
    370374 *Revision 1.23  2004/10/13 17:05:05  moralejo
    371375 **** empty log message ***
  • trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx

    r5248 r5319  
    920920 
    921921  //
     922  // Here the slices to write out are calculated. Warning: the digitalization
     923  // is NOT done here (it is already done in MFadc::Fill). This procedure only
     924  // selects which FADC slices to write out, out of those contained in the sig[][]
     925  // array.
     926  //
     927
     928  //
    922929  //  calculate the first slice to write out, according to trigger time:
    923930  //
  • 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}
  • trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx

    r5248 r5319  
    3232
    3333//==========
    34 //  MTrigger
     34//  MTrigger   FIXME: some explanations are rather outdated!!
    3535//
    3636//  The simulation of the Trigger for MonteCarlo Events is using this
     
    5555//  the standard response function to the analog signal of the pixel.
    5656//
    57 //  Each pixel of the camera has such an summed-up analog signal. It may
    58 //  look like this picture:
    59 //
     57//  Each pixel of the camera has such an summed-up analog signal.
    6058//
    6159//  This is the input of the discriminator for the pixels. The output of
     
    6765//  with a given length is created.
    6866//
    69 //  No one can start with the simulation of different trigger levels.
     67//  Now one can start with the simulation of different trigger levels.
    7068// 
    7169//  The TriggerLevelZero is a very easy one. It is just looking if there
    72 //  are more then N digital signals at level ON (=1). If this is the case,
     70//  are more than N digital signals at level ON (=1). If this is the case,
    7371//  a TriggerLevelZero signal is created.
    7472//
    75 //  The TriggerLevelOne is not implemented now. This will be a kind of next
    76 //  neighbour condition (i.e. four neigbouring analog signals at the same
    77 //  time, but this requests at least four digital signals at level ON, what
    78 //  is equivalent with a TriggerLevelZero.
    7973// 
    8074// 
     
    161155  Int_t  PixelsSecond[5] ; //  Pixel which fires the trigger
    162156
    163 private:
    164 
    165157  Float_t  Fill( Int_t, Float_t, Int_t ) ; 
    166158
    167159  Bool_t PassNextNeighbour( Bool_t m[], Bool_t *n) ;
    168160
    169   void OverlapingTime( Bool_t m[], Bool_t *n, Int_t ifSli);  //  n[] will have pixels of
    170                                        //  m[] that are on for the required verlaping time
    171  
     161  void OverlapingTime( Bool_t m[], Bool_t *n, Int_t ifSli); 
     162  //  n[] will have pixels of m[] that are on for the required overlaping time
     163 
     164  Bool_t fGainFluctuations;
     165  void InitGainFluctuations();
     166
    172167public:
    173168
     
    216211  }
    217212
     213  void SetGainFluctuations(Bool_t x) { fGainFluctuations = x; }
     214
    218215  void CheckThreshold (float *thres, int cells);
    219216
Note: See TracChangeset for help on using the changeset viewer.