- Timestamp:
- 06/20/09 10:14:33 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/melectronics/MAvalanchePhotoDiode.cc
r9261 r9462 77 77 APD::APD(Int_t n, Float_t prob, Float_t dt, Float_t rt) 78 78 : fHist("APD", "", n, 0.5, n+0.5, n, 0.5, n+0.5), 79 fCrosstalkProb(prob), fDeadTime(dt), fRecoveryTime(rt) 79 fCrosstalkProb(prob), fDeadTime(dt), fRecoveryTime(rt), fTime(-1) 80 80 { 81 81 fHist.SetDirectory(0); 82 } 83 84 // -------------------------------------------------------------------------- 85 // 86 // This is the time the cell needs after a hit until less than threshold 87 // (0.001 == one permille) of the signal is lost. 88 // 89 // If all cells of a G-APD have fired simultaneously and they are fired 90 // once more after the relaxation time (with the defaultthreshold of 0.001) 91 // the chip will show a signal which is one permille too small. 92 // 93 Float_t APD::GetRelaxationTime(Float_t threshold) const 94 { 95 return fDeadTime-TMath::Log(threshold)*fRecoveryTime; 82 96 } 83 97 … … 197 211 // The default time is 0. 198 212 // 213 // If you want t w.r.t. fTime use HitRandomCellRelative istead. 214 // 199 215 Float_t APD::HitRandomCell(Float_t t) 200 216 { … … 219 235 // If deadtime and recovery time are 0 then t-1 is set. 220 236 // 237 // Sets fTime to t 238 // 221 239 // The default time is 0. 222 240 // … … 231 249 232 250 fHist.SetEntries(1); 251 252 fTime = t; 233 253 } 234 254 … … 238 258 // by calling HitCellImp with time t-gRandom->Exp(n/rate) with n being 239 259 // the total number of cells. 260 // 261 // Sets fTime to t 262 // 240 263 // The default time is 0. 241 264 // … … 253 276 for (int x=1; x<=nx; x++) 254 277 for (int y=1; y<=ny; y++) 255 {256 278 HitCellImp(x, y, t-MMath::RndmExp(f)); 257 } 279 280 fTime = t; 281 } 282 283 // -------------------------------------------------------------------------- 284 // 285 // Evolve the chip from fTime to fTime+dt if it with a given frequency 286 // freq. Returns the total signal "recorded". 287 // 288 // fTime is set to the fTime+dt 289 // 290 // If you want to evolve over a default relaxation time (relax the chip 291 // from a signal) use Relax instead. 292 // 293 Float_t APD::Evolve(Double_t freq, Double_t dt) 294 { 295 const Double_t avglen = 1./freq; 296 297 const Double_t end = fTime+dt; 298 299 Float_t hits = 0; 300 301 Double_t time = fTime; 302 while (1) 303 { 304 time += MMath::RndmExp(avglen); 305 if (time>end) 306 break; 307 308 hits += HitRandomCell(time); 309 } 310 311 fTime = end; 312 313 return hits; 258 314 } 259 315
Note:
See TracChangeset
for help on using the changeset viewer.