Changeset 5600 for trunk/MagicSoft


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.
Location:
trunk/MagicSoft/Simulation/Detector/Camera
Files:
3 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//
  • trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx

    r5418 r5600  
    1919//=
    2020//= $RCSfile: creadparam.cxx,v $
    21 //= $Revision: 1.34 $
    22 //= $Author: moralejo $
    23 //= $Date: 2004-11-17 11:36:07 $
     21//= $Revision: 1.35 $
     22//= $Author: MAGIC $
     23//= $Date: 2004-12-15 01:56:39 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    106106                                // time window and the trigger instant.
    107107
     108static float pmt_jitter = 0.25; // Time jitter in ns (sigma of gaussian)
     109                                // of the PMT (per phe)
     110
    108111static float CTcoor[MAX_NUMBER_OF_CTS][3];
    109112
     
    563566      break;
    564567
     568    case pmt_jitter_ns:
     569
     570      sscanf(line, "%s %f", token, &pmt_jitter);
     571      break;
     572
    565573
    566574    case sigma_xy_cm_spot:
     
    13891397}
    13901398
     1399float get_pmt_jitter_ns(){
     1400
     1401  return pmt_jitter;
     1402
     1403}
     1404
    13911405float get_telescope_location_cm(int j, int icoor){
    13921406
     
    14301444//
    14311445// $Log: not supported by cvs2svn $
     1446// Revision 1.34  2004/11/17 11:36:07  moralejo
     1447// *** empty log message ***
     1448//
    14321449// Revision 1.33  2004/10/26 13:58:59  moralejo
    14331450//
  • trunk/MagicSoft/Simulation/Detector/Camera/creadparam.h

    r5418 r5600  
    1919//=
    2020//= $RCSfile: creadparam.h,v $
    21 //= $Revision: 1.30 $
    22 //= $Author: moralejo $
    23 //= $Date: 2004-11-17 11:36:07 $
     21//= $Revision: 1.31 $
     22//= $Author: MAGIC $
     23//= $Date: 2004-12-15 01:56:39 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    118118T(gain_fluctuations_off), /* Switches off PMT gain fluctuations for signal */ \
    119119T(noise_gain_fluctuations_off), /* Switches off PMT gain fluctuations for NSB noise */ \
     120T(pmt_jitter_ns), /* Sets the time jitter of each phe in the PMT */ \
    120121T(end_file)         /* end of the parameters file */
    121122
     
    193194float get_telescope_location_cm(int j, int icoor);
    194195float get_mirror_fraction(int j);
     196float get_pmt_jitter_ns();
    195197
    196198int   is_calibration_run();
     
    214216/*
    215217 * $Log: not supported by cvs2svn $
     218 * Revision 1.30  2004/11/17 11:36:07  moralejo
     219 * *** empty log message ***
     220 *
    216221 * Revision 1.29  2004/10/26 13:58:59  moralejo
    217222 *
Note: See TracChangeset for help on using the changeset viewer.