Changeset 19130
- Timestamp:
- 08/03/18 13:52:08 (6 years ago)
- Location:
- trunk/Mars/melectronics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/melectronics/MAvalanchePhotoDiode.cc
r18448 r19130 457 457 // -------------------------------------------------------------------------- 458 458 // 459 // Retu nrs the number of cells which have a time t<=fDeadTime, i.e. which are459 // Returns the number of cells which have a time t<=fDeadTime, i.e. which are 460 460 // dead. 461 461 // The default time is 0. 462 462 // 463 // Note that if you want to get a correct measure of t ehnumber of dead cells463 // Note that if you want to get a correct measure of the number of dead cells 464 464 // at the time t, this function will only produce a valid count if the 465 465 // afterpulses have been processed up to this time. … … 481 481 // -------------------------------------------------------------------------- 482 482 // 483 // Retur s the number of cells which have a time t<=fDeadTime+fRecoveryTime.483 // Returns the number of cells which have a time t<=fDeadTime+fRecoveryTime. 484 484 // The default time is 0. 485 485 // … … 506 506 // -------------------------------------------------------------------------- 507 507 // 508 // Returns the fraction of charge, the sensor can still release. 509 // The default time is 0. 510 // 511 // Note that if you want to get a correct measure at the time t, 512 // this function will only produce a valid count if the 513 // afterpulses have been processed up to this time. 514 // 515 Float_t APD::GetChargeState(Float_t t) const 516 { 517 const Int_t nx = fHist.GetNbinsX(); 518 const Int_t ny = fHist.GetNbinsY(); 519 520 Double_t tot = 0; 521 522 for (int x=1; x<=nx; x++) 523 for (int y=1; y<=ny; y++) 524 { 525 // Number of the x/y cell in the one dimensional array 526 // const Int_t cell = fHist.GetBin(x, y); 527 const Int_t cell = x + (fHist.GetNbinsX()+2)*y; 528 529 // Getting a reference to the float is the fastes way to 530 // access the bin-contents in fArray 531 const Float_t &cont = fHist.GetArray()[cell]; 532 533 // Calculate the time since the last breakdown 534 const Float_t dt = t-cont-fDeadTime; 535 536 // The signal height (in units of one photon) produced after dead time 537 // depends on the recovery of the cell - described by an exponential. 538 if (dt>0) 539 tot += fRecoveryTime<=0 ? 1. : 1-TMath::Exp(-dt/fRecoveryTime); 540 } 541 542 return tot / (nx*ny); 543 } 544 545 // -------------------------------------------------------------------------- 546 // 508 547 // Generate an afterpulse originating from the given cell and a pulse with 509 548 // charge. The afterpulse distribution to use is specified by -
trunk/Mars/melectronics/MAvalanchePhotoDiode.h
r17202 r19130 65 65 Int_t CountDeadCells(Float_t t=0) const; 66 66 Int_t CountRecoveringCells(Float_t t=0) const; 67 Float_t GetChargeState(Float_t t=0) const; 67 68 68 69 // --- Lower level user interface ---
Note:
See TracChangeset
for help on using the changeset viewer.