#include <HcalSiPMRecovery.h>
Public Member Functions | |
void | addToHistory (double time, int pixels) |
void | clearHistory () |
int | getIntegral (double time) |
HcalSiPMRecovery (double recoveryTime=250.) | |
void | setRecoveryTime (double recoveryTime) |
~HcalSiPMRecovery () | |
Protected Attributes | |
std::multimap< double, int > | theHistory |
int | theIntegral |
double | theRecoveryTime |
Definition at line 8 of file HcalSiPMRecovery.h.
HcalSiPMRecovery::HcalSiPMRecovery | ( | double | recoveryTime = 250. | ) |
Definition at line 3 of file HcalSiPMRecovery.cc.
: theRecoveryTime(recoveryTime), theIntegral(0) { }
HcalSiPMRecovery::~HcalSiPMRecovery | ( | ) |
Definition at line 7 of file HcalSiPMRecovery.cc.
{ }
void HcalSiPMRecovery::addToHistory | ( | double | time, |
int | pixels | ||
) |
Definition at line 22 of file HcalSiPMRecovery.cc.
References theHistory, and theIntegral.
Referenced by HcalSiPMHitResponse::run().
{ theHistory.insert(std::pair<double, int>(time,pixels)); theIntegral += pixels; }
void HcalSiPMRecovery::clearHistory | ( | ) |
Definition at line 27 of file HcalSiPMRecovery.cc.
References theHistory, and theIntegral.
Referenced by HcalSiPMHitResponse::run().
{ theHistory.clear(); theIntegral = 0; }
int HcalSiPMRecovery::getIntegral | ( | double | time | ) |
Definition at line 10 of file HcalSiPMRecovery.cc.
References theHistory, theIntegral, and theRecoveryTime.
Referenced by HcalSiPMHitResponse::run().
{ int recoveredPixels = 0; std::multimap<double, int>::iterator past; for (past = theHistory.begin(); past != theHistory.lower_bound(time-theRecoveryTime); ++past) { recoveredPixels += past->second; } theHistory.erase(theHistory.begin(), past); theIntegral -= recoveredPixels; return theIntegral; }
void HcalSiPMRecovery::setRecoveryTime | ( | double | recoveryTime | ) | [inline] |
Definition at line 17 of file HcalSiPMRecovery.h.
References theRecoveryTime.
{ theRecoveryTime = recoveryTime; }
std::multimap<double, int> HcalSiPMRecovery::theHistory [protected] |
Definition at line 23 of file HcalSiPMRecovery.h.
Referenced by addToHistory(), clearHistory(), and getIntegral().
int HcalSiPMRecovery::theIntegral [protected] |
Definition at line 22 of file HcalSiPMRecovery.h.
Referenced by addToHistory(), clearHistory(), and getIntegral().
double HcalSiPMRecovery::theRecoveryTime [protected] |
Definition at line 21 of file HcalSiPMRecovery.h.
Referenced by getIntegral(), and setRecoveryTime().