CMS 3D CMS Logo

List of all members | Public Member Functions
PedestalSub Class Reference

#include <PedestalSub.h>

Public Member Functions

void calculate (const std::vector< double > &inputCharge, const std::vector< double > &inputPedestal, const std::vector< double > &inputNoise, std::vector< double > &corrCharge, int soi, int nSample) const
 
double getCorrection (const std::vector< double > &inputCharge, const std::vector< double > &inputPedestal, const std::vector< double > &inputNoise, int soi, int nSample) const
 
 PedestalSub ()
 
 ~PedestalSub ()
 

Detailed Description

Definition at line 7 of file PedestalSub.h.

Constructor & Destructor Documentation

PedestalSub::PedestalSub ( )

Definition at line 8 of file PedestalSub.cc.

8  {
9 }
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,
const std::vector< double > &  inputNoise,
std::vector< double > &  corrCharge,
int  soi,
int  nSample 
) const

Definition at line 15 of file PedestalSub.cc.

References getCorrection(), and mps_fire::i.

15  {
16 
17  double bseCorr=PedestalSub::getCorrection(inputCharge, inputPedestal, inputNoise, soi, nTS);
18  for (auto i=0; i<nTS; i++) {
19  corrCharge.push_back(inputCharge[i]-inputPedestal[i]-bseCorr);
20  }
21 }
double getCorrection(const std::vector< double > &inputCharge, const std::vector< double > &inputPedestal, const std::vector< double > &inputNoise, int soi, int nSample) const
Definition: PedestalSub.cc:23
double PedestalSub::getCorrection ( const std::vector< double > &  inputCharge,
const std::vector< double > &  inputPedestal,
const std::vector< double > &  inputNoise,
int  soi,
int  nSample 
) const

Definition at line 23 of file PedestalSub.cc.

References mps_fire::i.

Referenced by calculate().

23  {
24 
25  double baseline=0;
26 
27  for (auto i=0; i<nTS; i++) {
28  if (i==soi || i==(soi+1)) continue;
29  if ( (inputCharge[i]-inputPedestal[i])<3*inputNoise[i]) {
30  baseline+=(inputCharge[i]-inputPedestal[i]);
31  }
32  else {
33  baseline+=3*inputNoise[i];
34  }
35  }
36  baseline/=(nTS-2);
37  return baseline;
38 
39 }