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.

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 }

References getCorrection(), and mps_fire::i.

◆ 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.

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 }

References mps_fire::i.

Referenced by calculate().

mps_fire.i
i
Definition: mps_fire.py:428
PedestalSub::getCorrection
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