Changeset 6712 for trunk


Ignore:
Timestamp:
03/02/05 21:45:06 (20 years ago)
Author:
moralejo
Message:
 Changed meaning of pmt_jitter: now it is not the jitter per phe-, but
 the jitter of the total pulse in each pixel (and independent from pixel
 to pixel).

 The delay between the high and low gain peaks can be set now to a non
 integer number of FADC slices. Now by default it is 16.5.
File:
1 edited

Legend:

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

    r6696 r6712  
    11////!////////////////////////////////////////////////////////////////////
    22//
    3 // camera                
     3// camera               
    44//
    55// @file        camera.cxx
     
    221221
    222222//@: PMT time jitter
    223 static  float pmt_jitter=0.25;
     223static  float pmt_jitter;
    224224
    225225 
     
    41354135
    41364136  float time;
    4137   float pmtjit;
     4137  float *pmtjit;
     4138
     4139  pmtjit = new float[camgeom->GetNumPixels()];
    41384140
    41394141  // reset variables
    41404142
    4141   for ( i=0; i<camgeom->GetNumPixels(); ++i )
    4142     nphe[i] = 0.0;
    4143 
     4143  TRandom random;
     4144  random.SetSeed(seed);
     4145 
     4146  for ( i = 0; i < camgeom->GetNumPixels(); ++i )
     4147    {
     4148      nphe[i] = 0.0;
     4149      //
     4150      // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
     4151      // not accept negative times!)
     4152      //
     4153      do
     4154        pmtjit[i] = random.Gaus(3.*pmt_jitter, pmt_jitter);
     4155      while (pmtjit[i] < 0.);
     4156    }
    41444157
    41454158  *itotnphe = 0;
     
    41474160
    41484161  radius_mm = camgeom->GetMaxRadius();
    4149 
    4150   TRandom random;
    4151   random.SetSeed(seed);
    41524162
    41534163  float C1, C2, C3, rho;
     
    43194329    nphe[ipixnum] += 1.0;
    43204330
    4321     //
    4322     // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
    4323     // not accept negative times!)
    4324     //
    4325     do
    4326       pmtjit = random.Gaus(3.*pmt_jitter, pmt_jitter);
    4327     while(pmtjit<0.);
    4328 
    43294331    // store the new photoelectron
    43304332
    43314333    fadc->Fill(ipixnum,
    4332                (time-*tmin_ns) + pmtjit + fadc_jitter,
    4333                trigger->FillShow(ipixnum, time-*tmin_ns + pmtjit + fadc_jitter),
     4334               (time-*tmin_ns) + pmtjit[ipixnum] + fadc_jitter,
     4335               trigger->FillShow(ipixnum, time-*tmin_ns + pmtjit[ipixnum] + fadc_jitter),
    43344336               !((*camgeom)[ipixnum].GetD()>(*camgeom)[0].GetD()));
    43354337   
     
    48594861  float radius_mm, focal_dist_mm;
    48604862  int   total_photons;
    4861   float pmtjit;
     4863  float *pmtjit;
    48624864
    48634865  static UInt_t seed = (UInt_t)(get_seeds(0)*get_seeds(1));
    48644866
     4867  pmtjit = new float[camgeom->GetNumPixels()];
     4868
    48654869  // reset variables
    48664870
     4871  TRandom random;
     4872  random.SetSeed(seed);
     4873
    48674874  for ( uint i = 0; i < camgeom->GetNumPixels(); i++ )
    4868     nphe[i] = 0.0;
     4875    {
     4876      nphe[i] = 0.0;
     4877
     4878      //
     4879      // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
     4880      // not accept negative times!)
     4881      //
     4882      do
     4883        pmtjit[i] = random.Gaus(3.*pmt_jitter, pmt_jitter);
     4884      while(pmtjit[i]<0.);
     4885    }
    48694886
    48704887  *itotnphe = 0;
    48714888  *nphot = 0;
    4872 
    4873   TRandom random;
    4874   random.SetSeed(seed);
    48754889
    48764890  //
     
    48874901  // dish to the edge of the camera:
    48884902  float cos_epsilon_max = cos(atan2(radius_mm, focal_dist_mm));
     4903
    48894904
    48904905
     
    50295044      nphe[ipixnum] += 1.;
    50305045
    5031       //
    5032       // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
    5033       // not accept negative times!)
    5034       //
    5035       do
    5036         pmtjit = random.Gaus(3.*pmt_jitter, pmt_jitter);
    5037       while(pmtjit<0.);
    5038 
    50395046      // store the new photoelectron
    50405047
    5041       fadc->Fill(ipixnum, time + pmtjit + fadc_jitter,
    5042                  trigger->FillShow(ipixnum, time + pmtjit + fadc_jitter),
     5048      fadc->Fill(ipixnum, time + pmtjit[ipixnum] + fadc_jitter,
     5049                 trigger->FillShow(ipixnum, time + pmtjit[ipixnum] + fadc_jitter),
    50435050                 !((*camgeom)[ipixnum].GetD()>(*camgeom)[0].GetD()));
    50445051   
     
    50615068//
    50625069// $Log: not supported by cvs2svn $
     5070// Revision 1.96  2005/03/01 21:57:01  moralejo
     5071//
     5072//  Set parameters for the shape of the low gain pulse in the FADC to more
     5073//  precise values. Low gain pulse from real data was provided by H. Bartko.
     5074//
    50635075// Revision 1.95  2005/03/01 20:13:17  moralejo
    50645076//  Added comments
Note: See TracChangeset for help on using the changeset viewer.