Changeset 17323


Ignore:
Timestamp:
11/17/13 20:30:25 (11 years ago)
Author:
tbretz
Message:
According to a simply toy MC this reproduces the behaviour of the sensor best and reproduces very well the measured dark count spectra.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/melectronics/MAvalanchePhotoDiode.cc

    r17202 r17323  
    240240    Float_t n = weight;
    241241
    242     /*
    243      // Check if a photon in a neighboring cell is produced (crosstalk)
    244      while (gRandom->Rndm()<fCrosstalkProb)
    245      {
     242    // Get random number of emitted and possible converted crosstalk photons
     243    const UInt_t rndm = gRandom->Poisson(prob);
     244
     245    for (int i=0; i<rndm; i++)
     246    {
    246247        // Get a random neighbor which is hit.
    247248        switch (gRandom->Integer(4))
    248         {
    249         case 0: x++; if (x>fHist.GetNbinsX()) continue; break;
    250         case 1: x--; if (x<1) continue;                 break;
    251         case 2: y++; if (y>fHist.GetNbinsY()) continue; break;
    252         case 3: y--; if (y<1) continue;                 break;
    253         }
    254 
    255         n += HitCellImp(x, y, t);
    256      }
    257      */
    258 
    259 
    260     //for (int i=0; i<1; i++)
    261     while (1)
    262     {
    263         const Double_t rndm = gRandom->Rndm();
    264         if (rndm>=prob/*fCrosstalkProb*/)
    265             break;
    266 
    267         // We can re-use the random number because it is uniformely
    268         // distributed. This saves cpu power
    269         const Int_t dir = TMath::FloorNint(4*rndm/prob/*fCrosstalkProb*/);
    270 
    271         // Get a random neighbor which is hit.
    272         switch (dir)
    273249        {
    274250        case 0: if (x<fHist.GetNbinsX()) n += HitCellImp(x+1, y, t); break;
     
    277253        case 3: if (y>1)                 n += HitCellImp(x, y-1, t); break;
    278254        }
    279 
    280         // In the unlikely case the calculated direction is out-of-range,
    281         // i.e. <0 or >3, we would just try to fill the same cell again which
    282255    }
    283256
Note: See TracChangeset for help on using the changeset viewer.