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::PedestalSub ( )

Definition at line 8 of file PedestalSub.cc.

8 {}

◆ ~PedestalSub()

PedestalSub::~PedestalSub ( )

Definition at line 10 of file PedestalSub.cc.

10 {}

Member Function Documentation

◆ calculate()

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 12 of file PedestalSub.cc.

References getCorrection(), and mps_fire::i.

17  {
18  double bseCorr = PedestalSub::getCorrection(inputCharge, inputPedestal, inputNoise, soi, nTS);
19  for (auto i = 0; i < nTS; i++) {
20  corrCharge.push_back(inputCharge[i] - inputPedestal[i] - bseCorr);
21  }
22 }
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:24

◆ getCorrection()

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 24 of file PedestalSub.cc.

References mps_fire::i.

Referenced by calculate().

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