test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
HcalSiPMRecovery Class Reference

#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
 

Detailed Description

Definition at line 8 of file HcalSiPMRecovery.h.

Constructor & Destructor Documentation

HcalSiPMRecovery::HcalSiPMRecovery ( double  recoveryTime = 250.)

Definition at line 3 of file HcalSiPMRecovery.cc.

3  :
4  theRecoveryTime(recoveryTime), theIntegral(0) {
5 }
HcalSiPMRecovery::~HcalSiPMRecovery ( )

Definition at line 7 of file HcalSiPMRecovery.cc.

7  {
8 }

Member Function Documentation

void HcalSiPMRecovery::addToHistory ( double  time,
int  pixels 
)

Definition at line 22 of file HcalSiPMRecovery.cc.

References theHistory, and theIntegral.

Referenced by HcalSiPMHitResponse::run().

22  {
23  theHistory.insert(std::pair<double, int>(time,pixels));
24  theIntegral += pixels;
25 }
std::multimap< double, int > theHistory
void HcalSiPMRecovery::clearHistory ( )

Definition at line 27 of file HcalSiPMRecovery.cc.

References theHistory, and theIntegral.

Referenced by HcalSiPMHitResponse::run().

27  {
28  theHistory.clear();
29  theIntegral = 0;
30 }
std::multimap< double, int > theHistory
int HcalSiPMRecovery::getIntegral ( double  time)

Definition at line 10 of file HcalSiPMRecovery.cc.

References theHistory, theIntegral, and theRecoveryTime.

Referenced by HcalSiPMHitResponse::run().

10  {
11  int recoveredPixels = 0;
12  std::multimap<double, int>::iterator past;
13  for (past = theHistory.begin();
14  past != theHistory.lower_bound(time-theRecoveryTime); ++past) {
15  recoveredPixels += past->second;
16  }
17  theHistory.erase(theHistory.begin(), past);
18  theIntegral -= recoveredPixels;
19  return theIntegral;
20 }
std::multimap< double, int > theHistory
void HcalSiPMRecovery::setRecoveryTime ( double  recoveryTime)
inline

Definition at line 17 of file HcalSiPMRecovery.h.

References theRecoveryTime.

17 { theRecoveryTime = recoveryTime; }

Member Data Documentation

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().