#include <VMM_Shaper.h>
|
| VMM_Shaper (const float peakTime, const float lowerTimeWindow, const float upperTimeWindow) |
|
virtual | ~VMM_Shaper ()=default |
|
void | initialize () |
|
bool | vmmPeakResponse (const std::vector< float > &effectiveCharge, const std::vector< float > &electronsTime, const double electronicsThreshold, double &litudeFirstPeak, double &timeFirstPeak) const |
|
bool | vmmThresholdResponse (const std::vector< float > &effectiveCharge, const std::vector< float > &electronsTime, const double electronicsThreshold, double &litudeAtFirstPeak, double &timeAtThreshold) const |
|
bool | hasChargeAboveThreshold (const std::vector< float > &effectiveCharge, const std::vector< float > &electronsTime, const double electronicsThreshold) const |
|
Definition at line 10 of file VMM_Shaper.h.
◆ VMM_Shaper()
VMM_Shaper::VMM_Shaper |
( |
const float |
peakTime, |
|
|
const float |
lowerTimeWindow, |
|
|
const float |
upperTimeWindow |
|
) |
| |
◆ ~VMM_Shaper()
virtual VMM_Shaper::~VMM_Shaper |
( |
| ) |
|
|
virtualdefault |
◆ aboveThresholdSimple()
bool VMM_Shaper::aboveThresholdSimple |
( |
const std::vector< float > & |
effectiveCharge, |
|
|
const std::vector< float > & |
electronsTime, |
|
|
const double |
electronicsThreshold |
|
) |
| const |
|
private |
Definition at line 204 of file VMM_Shaper.cxx.
208 for (
unsigned int i_elec = 0; i_elec < effectiveCharge.size(); i_elec++) {
213 return chargeSum >= electronicsThreshold;
◆ findPeak()
double VMM_Shaper::findPeak |
( |
const std::vector< float > & |
effectiveCharge, |
|
|
const std::vector< float > & |
electronsTime, |
|
|
const double |
electronicsThreshold |
|
) |
| const |
|
private |
Definition at line 122 of file VMM_Shaper.cxx.
124 if (effectiveCharge.empty())
return -9999;
126 double minElectronTime = *std::min_element(electronsTime.begin(), electronsTime.end());
133 double oldResponse = 0;
136 double timeStepScaleFactor = 5.0;
146 int searchWindow = 5;
148 std::vector<double> tmpTime, tmpResponse;
150 tmpTime.reserve(2 * timeStepScaleFactor);
151 tmpResponse.reserve(2 * timeStepScaleFactor);
155 tmpTime.push_back(fineTime);
156 tmpResponse.push_back(
vmmResponse(effectiveCharge, electronsTime, fineTime));
159 int nBins = tmpTime.size();
161 for (
int i_time = 1; i_time <
nBins - 1; i_time++) {
162 if (tmpResponse.at(i_time) < tmpResponse.at(i_time + 1))
continue;
164 if (tmpResponse.at(i_time) < electronicsThreshold)
break;
166 bool checkTimeWindow =
false;
167 for (
int i_timeOfPeak = i_time - searchWindow + 1; i_timeOfPeak <= i_time + searchWindow; i_timeOfPeak++) {
168 if (i_timeOfPeak < 1 || i_timeOfPeak ==
nBins - 1)
continue;
170 double oldDerivative = (tmpResponse.at(i_time) - tmpResponse.at(i_time - 1));
171 double newDerivative = (tmpResponse.at(i_time + 1) - tmpResponse.at(i_time));
172 if (newDerivative > oldDerivative) {
173 checkTimeWindow =
false;
176 checkTimeWindow =
true;
179 if (checkTimeWindow)
return tmpTime.at(i_time);
◆ hasChargeAboveThreshold()
bool VMM_Shaper::hasChargeAboveThreshold |
( |
const std::vector< float > & |
effectiveCharge, |
|
|
const std::vector< float > & |
electronsTime, |
|
|
const double |
electronicsThreshold |
|
) |
| const |
Definition at line 185 of file VMM_Shaper.cxx.
189 if (effectiveCharge.empty())
return false;
191 double minElectronTime = *std::min_element(electronsTime.begin(), electronsTime.end());
199 if (
vmmResponse(effectiveCharge, electronsTime,
time) >= electronicsThreshold) {
return true; }
◆ initialize()
void VMM_Shaper::initialize |
( |
| ) |
|
◆ vmmPeakResponse()
bool VMM_Shaper::vmmPeakResponse |
( |
const std::vector< float > & |
effectiveCharge, |
|
|
const std::vector< float > & |
electronsTime, |
|
|
const double |
electronicsThreshold, |
|
|
double & |
amplitudeFirstPeak, |
|
|
double & |
timeFirstPeak |
|
) |
| const |
Definition at line 64 of file VMM_Shaper.cxx.
66 double t_peak =
findPeak(effectiveCharge, electronsTime, electronicsThreshold);
68 if (t_peak == -9999)
return false;
70 amplitudeFirstPeak =
vmmResponse(effectiveCharge, electronsTime, t_peak);
71 timeFirstPeak = t_peak;
◆ vmmResponse()
double VMM_Shaper::vmmResponse |
( |
const std::vector< float > & |
effectiveCharge, |
|
|
const std::vector< float > & |
electronsTime, |
|
|
double |
time |
|
) |
| const |
|
private |
Definition at line 49 of file VMM_Shaper.cxx.
51 for (
unsigned int i_electron = 0; i_electron < effectiveCharge.size(); i_electron++) {
52 if (
time < electronsTime.at(i_electron))
continue;
53 double t = (
time - electronsTime.at(i_electron));
◆ vmmThresholdResponse()
bool VMM_Shaper::vmmThresholdResponse |
( |
const std::vector< float > & |
effectiveCharge, |
|
|
const std::vector< float > & |
electronsTime, |
|
|
const double |
electronicsThreshold, |
|
|
double & |
amplitudeAtFirstPeak, |
|
|
double & |
timeAtThreshold |
|
) |
| const |
Definition at line 75 of file VMM_Shaper.cxx.
79 if (effectiveCharge.empty())
return false;
81 double minElectronTime = *std::min_element(electronsTime.begin(), electronsTime.end());
86 double tmpTimeAtThreshold = -9999;
90 if (
vmmResponse(effectiveCharge, electronsTime,
time) <= electronicsThreshold)
continue;
94 if (
vmmResponse(effectiveCharge, electronsTime, fineTime) >= electronicsThreshold)
continue;
95 tmpTimeAtThreshold = fineTime + 0.5 *
m_timeStep;
101 if (tmpTimeAtThreshold == -9999) {
105 if (
vmmResponse(effectiveCharge, electronsTime,
time) >= electronicsThreshold) {
106 tmpTimeAtThreshold =
time;
112 if (tmpTimeAtThreshold == -9999)
return false;
114 double t_peak =
findPeak(effectiveCharge, electronsTime, electronicsThreshold);
115 if (t_peak == -9999)
return false;
117 timeAtThreshold = tmpTimeAtThreshold;
118 amplitudeAtFirstPeak =
vmmResponse(effectiveCharge, electronsTime, t_peak);
◆ m_a
double VMM_Shaper::m_a {0.} |
|
private |
◆ m_argK1
double VMM_Shaper::m_argK1 {0.} |
|
private |
◆ m_im_pole1
double VMM_Shaper::m_im_pole1 {0.} |
|
private |
◆ m_im_pole1_ns
double VMM_Shaper::m_im_pole1_ns {0.} |
|
private |
◆ m_inverseTimeStep
double VMM_Shaper::m_inverseTimeStep {0.} |
|
private |
◆ m_k1_abs
double VMM_Shaper::m_k1_abs {0.} |
|
private |
◆ m_lowerTimeWindow
double VMM_Shaper::m_lowerTimeWindow {0.} |
|
private |
◆ m_peakTime
double VMM_Shaper::m_peakTime {0.} |
|
private |
◆ m_peakTimeChargeScaling
double VMM_Shaper::m_peakTimeChargeScaling {0.} |
|
private |
◆ m_pole0
double VMM_Shaper::m_pole0 {0.} |
|
private |
◆ m_pole0_ns
double VMM_Shaper::m_pole0_ns {0.} |
|
private |
◆ m_pole1_square
double VMM_Shaper::m_pole1_square {0.} |
|
private |
◆ m_preCalculationVMMShaper
double VMM_Shaper::m_preCalculationVMMShaper {0.} |
|
private |
◆ m_re_pole1
double VMM_Shaper::m_re_pole1 {0.} |
|
private |
◆ m_re_pole1_ns
double VMM_Shaper::m_re_pole1_ns {0.} |
|
private |
◆ m_timeStep
double VMM_Shaper::m_timeStep {0.} |
|
private |
◆ m_upperTimeWindow
double VMM_Shaper::m_upperTimeWindow {0.} |
|
private |
The documentation for this class was generated from the following files: