Ignore:
Timestamp:
12/15/04 01:56:39 (20 years ago)
Author:
MAGIC
Message:
 Added input card option pmt_jitter_ns to simulate the time jitter of
 PMTs. The input parameter is the sigma of a gaussian, which by
 default is sigma=0.25 ns. This jitter is applied to each phe-
 independently. We have not applied this to the NSB noise, since the
 arrival time of NSB photons is random and nothing would change.
File:
1 edited

Legend:

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

    r5419 r5600  
    1111// @date        Thu May  7 16:24:22 1998
    1212//
    13 //----------------------------------------------------------------------
    14 //
    15 // Created: Thu May  7 16:24:22 1998
    16 // Author:  Jose Carlos Gonzalez
    17 // Purpose: Program for reflector simulation
    18 // Notes:   See files README for details
    19 //   
    20 //----------------------------------------------------------------------
    21 //
    22 // $RCSfile: camera.cxx,v $
    23 // $Revision: 1.83 $
    24 // $Author: moralejo $
    25 // $Date: 2004-11-17 11:43:13 $
    26 //
    27 ////////////////////////////////////////////////////////////////////////
    28 // @tableofcontents @coverpage
    2913
    3014//=-----------------------------------------------------------
    3115//!@section Source code of |camera.cxx|.
    32 
    33 /*!@"
    34 
    35   In this section we show the (commented) code of the program for the
    36   read-out of the output files generated by the simulator of the
    37   reflector, |reflector 0.3|.
    38 
    39   @"*/
    4016
    4117//=-----------------------------------------------------------
     
    229205static  float Azimutal = 90.0;
    230206
    231 //@: Miss Pointing Simulation
     207//@: Mispointing Simulation
    232208static   int missPointing = 0;
    233209static   float missP_x = 0.0;
     
    238214static  float Spot_y=0.0;
    239215static  float Spotsigma=0.0;
     216
     217//@: PMT time jitter
     218static  float pmt_jitter=0.25;
    240219
    241220 
     
    737716  missPointing = get_misspointing(&missP_x,&missP_y);
    738717  Spotsigma = get_sigma_xy_cm_spot(&Spot_x,&Spot_y);
     718  pmt_jitter = get_pmt_jitter_ns();
    739719
    740720
     
    29672947    McConfigRunHeader[ict]->InitSizePMTs(ct_NPixels);
    29682948    for(int i=0; i<(Int_t)((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels();i++){
    2969       McConfigRunHeader[ict]->AddPMT(i);
    2970       MGeomPMT &pmt  = McConfigRunHeader[ict]->GetPMT(i);
    2971       qe_pmt.Set(pointsQE[ict],QE[ict][i][1]);
    2972       wav_pmt.Set(pointsQE[ict],QElambda);
    2973       pmt.SetArraySize(pointsQE[ict]);
    2974       pmt.SetPMTContent(i,wav_pmt,qe_pmt);
     2949        McConfigRunHeader[ict]->SetPmtTimeJitter(pmt_jitter);
     2950        McConfigRunHeader[ict]->AddPMT(i);
     2951        MGeomPMT &pmt  = McConfigRunHeader[ict]->GetPMT(i);
     2952        qe_pmt.Set(pointsQE[ict],QE[ict][i][1]);
     2953        wav_pmt.Set(pointsQE[ict],QElambda);
     2954        pmt.SetArraySize(pointsQE[ict]);
     2955        pmt.SetPMTContent(i,wav_pmt,qe_pmt);
    29752956    }
    29762957   
     
    40764057  static UInt_t seed = (UInt_t)(get_seeds(0)*get_seeds(1));
    40774058
    4078   Float_t t;
     4059  float time;
     4060  float pmtjit;
    40794061
    40804062  // reset variables
     
    41194101    //  Check if photon is inside trigger time range
    41204102
    4121     t = photon.get_t() ;
    4122 
    4123     if (t-*tmin_ns>TOTAL_TRIGGER_TIME) {
     4103    time = photon.get_t() ;
     4104
     4105    if (time-*tmin_ns>TOTAL_TRIGGER_TIME) {
    41244106        continue;
    41254107    }
     
    42164198
    42174199    //
    4218     // Apply incient angular correction due to Light Guides, plexiglas,
     4200    // Apply incident angular correction due to Light Guides, plexiglas,
    42194201    // 1st dynode collection efficiency, double crossings... etc.
    42204202    // This information is contained in the file Data/LightCollection.dat
     
    42604242    nphe[ipixnum] += 1.0;
    42614243
     4244    //
     4245    // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
     4246    // not accept negative times!)
     4247    //
     4248    do
     4249      pmtjit = random.Gaus(3.*pmt_jitter, pmt_jitter);
     4250    while(pmtjit<0.);
    42624251
    42634252    // store the new photoelectron
    42644253
    4265     fadc->Fill(ipixnum,(t-*tmin_ns) + fadc_jitter ,
    4266                trigger->FillShow(ipixnum, t-*tmin_ns + fadc_jitter),
     4254    fadc->Fill(ipixnum,
     4255               (time-*tmin_ns) + pmtjit + fadc_jitter,
     4256               trigger->FillShow(ipixnum, time-*tmin_ns + pmtjit + fadc_jitter),
    42674257               !((*camgeom)[ipixnum].GetD()>(*camgeom)[0].GetD()));
    42684258   
     
    47704760  float **qept;
    47714761  float radius_mm, focal_dist_mm;
    4772   int total_photons;
     4762  int   total_photons;
     4763  float pmtjit;
     4764
    47734765  static UInt_t seed = (UInt_t)(get_seeds(0)*get_seeds(1));
    47744766
     
    49394931      nphe[ipixnum] += 1.;
    49404932
     4933      //
     4934      // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
     4935      // not accept negative times!)
     4936      //
     4937      do
     4938        pmtjit = random.Gaus(3.*pmt_jitter, pmt_jitter);
     4939      while(pmtjit<0.);
     4940
    49414941      // store the new photoelectron
    49424942
    4943       fadc->Fill(ipixnum, time + fadc_jitter,
    4944                  trigger->FillShow(ipixnum, time + fadc_jitter),
     4943      fadc->Fill(ipixnum, time + pmtjit + fadc_jitter,
     4944                 trigger->FillShow(ipixnum, time + pmtjit + fadc_jitter),
    49454945                 !((*camgeom)[ipixnum].GetD()>(*camgeom)[0].GetD()));
    49464946   
     
    49634963//
    49644964// $Log: not supported by cvs2svn $
     4965// Revision 1.83  2004/11/17 11:43:13  moralejo
     4966//
     4967//  Made the necessary changes in starresponse to account for the new option
     4968//  to switch off gain fluctuations for the NSB noise database generation.
     4969//  The option in the Star Response card is "gain_fluctuations_off". The
     4970//  version number of the NSB database has been updated to 1004 (see
     4971//  MStarLight.hxx), now including information on whether the gain
     4972//  fluctuations were on or off when the NSB database was generated.
     4973//
    49654974// Revision 1.82  2004/11/17 11:34:49  moralejo
    49664975//
Note: See TracChangeset for help on using the changeset viewer.