CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PedestalSub Class Reference

#include <PedestalSub.h>

Public Member Functions

void calculate (const std::vector< double > &inputCharge, const std::vector< double > &inputPedestal, std::vector< double > &corrCharge) const
 
double getCorrection (const std::vector< double > &inputCharge, const std::vector< double > &inputPedestal) const
 
void init (int runCond, float threshold, float quantile)
 
 PedestalSub ()
 
 ~PedestalSub ()
 

Private Attributes

float fCondition
 
float fQuantile
 
float fThreshold
 

Detailed Description

Definition at line 7 of file PedestalSub.h.

Constructor & Destructor Documentation

PedestalSub::PedestalSub ( )

Definition at line 8 of file PedestalSub.cc.

8  : fThreshold(2.7),fQuantile(0.0),fCondition(0){
9 }
float fCondition
Definition: PedestalSub.h:24
float fQuantile
Definition: PedestalSub.h:23
float fThreshold
Definition: PedestalSub.h:22
PedestalSub::~PedestalSub ( )

Definition at line 11 of file PedestalSub.cc.

11  {
12 }

Member Function Documentation

void PedestalSub::calculate ( const std::vector< double > &  inputCharge,
const std::vector< double > &  inputPedestal,
std::vector< double > &  corrCharge 
) const

Definition at line 20 of file PedestalSub.cc.

References getCorrection(), and mps_fire::i.

Referenced by HcalDeterministicFit::apply().

20  {
21 
22  double bseCorr=PedestalSub::getCorrection(inputCharge, inputPedestal);
23  for (auto i=0; i<10; i++) {
24  corrCharge.push_back(inputCharge[i]-inputPedestal[i]-bseCorr);
25  }
26 }
double getCorrection(const std::vector< double > &inputCharge, const std::vector< double > &inputPedestal) const
Definition: PedestalSub.cc:28
double PedestalSub::getCorrection ( const std::vector< double > &  inputCharge,
const std::vector< double > &  inputPedestal 
) const

Definition at line 28 of file PedestalSub.cc.

References fThreshold, and mps_fire::i.

Referenced by calculate().

28  {
29 
30  double baseline=0;
31 
32  for (auto i=0; i<10; i++) {
33  if (i==4||i==5) continue;
34  if ( (inputCharge[i]-inputPedestal[i])<fThreshold) {
35  baseline+=(inputCharge[i]-inputPedestal[i]);
36  }
37  else {
38  baseline+=fThreshold;
39  }
40  }
41  baseline/=8;
42  return baseline;
43 
44 }
float fThreshold
Definition: PedestalSub.h:22
void PedestalSub::init ( int  runCond = 0,
float  threshold = 0.0,
float  quantile = 0.0 
)

Definition at line 14 of file PedestalSub.cc.

References fCondition, fQuantile, fThreshold, and electronIdCutBased_cfi::threshold.

Referenced by parseHBHEMethod3Description().

14  {
16  fQuantile=quantile;
17  fCondition=runCond;
18 }
float fCondition
Definition: PedestalSub.h:24
float fQuantile
Definition: PedestalSub.h:23
float fThreshold
Definition: PedestalSub.h:22

Member Data Documentation

float PedestalSub::fCondition
private

Definition at line 24 of file PedestalSub.h.

Referenced by init().

float PedestalSub::fQuantile
private

Definition at line 23 of file PedestalSub.h.

Referenced by init().

float PedestalSub::fThreshold
private

Definition at line 22 of file PedestalSub.h.

Referenced by getCorrection(), and init().