9#include <framework/logging/Logger.h>
10#include <svd/reconstruction/SVDClusterCharge.h>
11#include <svd/reconstruction/SVDMaxSumAlgorithm.h>
41 for (
int i = 0; i < (int)strips.size(); i++) {
45 double rawCharge = *std::max_element(begin(strip.
samples), end(strip.
samples));
51 noise += tmp_noise * tmp_noise;
53 charge += stripCharge;
56 SNR = charge /
sqrt(noise);
70 for (
int i = 0; i < (int)strips.size(); i++) {
75 for (
auto sample : strip.
samples)
81 if (stripCharge > seedCharge)
82 seedCharge = stripCharge;
85 noise += tmp_noise * tmp_noise;
87 charge += stripCharge;
90 SNR = charge /
sqrt(noise);
103 float m_ELS3tau = 55;
119 auto begin = selectedSamples.begin();
122 const double E2 =
E *
E;
123 const double E3 =
E *
E *
E;
124 const double E4 =
E *
E *
E *
E;
125 double a0 = (*begin);
126 double a1 = (*(begin + 1));
127 double a2 = (*(begin + 2));
130 const double w = (a0 - E2 * a2) / (2 * a0 +
E * a1);
131 auto rawtime_num = 2 * E4 + w * E2;
132 auto rawtime_den = 1 - E4 - w * (2 + E2);
143 double num = (1. /
E - E3) * a1 + (2 + E2) * a2 - (1 + 2 * E2) * a0;
144 double den =
m_apvClockPeriod / m_ELS3tau * std::exp(1 + rawtime / m_ELS3tau) * (1 + 4 * E2 + E4);
151 for (
int i = 0; i < (int)strips.size(); i++) {
156 noise += tmp_noise * tmp_noise;
159 SNR = charge /
sqrt(noise);
double getChargeFromADC(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &pulseADC) const
Return the charge (number of electrons/holes) collected on a specific strip, given the number of ADC ...
Class representing a raw cluster candidate during clustering of the SVD.
int getSeedInternalIndex() const
const std::vector< StripInRawCluster > getStripsInRawCluster() const
int getSeedMaxSample() const
Belle2::SVDShaperDigit::APVFloatSamples getClsSamples(bool inElectrons) const
VxdID getSensorID() const
void applySumSamplesCharge(const Belle2::SVD::RawCluster &rawCluster, double &charge, double &SNR, double &seedCharge)
SumSamples Charge Algorithm.
void applyMaxSampleCharge(const Belle2::SVD::RawCluster &rawCluster, double &charge, double &SNR, double &seedCharge)
MaxSample Charge Algorithm.
SVDPulseShapeCalibrations m_PulseShapeCal
SVDPulseShaper calibration wrapper.
void applyELS3Charge(const Belle2::SVD::RawCluster &rawCluster, double &charge, double &SNR, double &seedCharge)
ELS3 Charge Algorithm.
double m_apvClockPeriod
APV clock period.
Class implementing the MaxSum algorithm.
std::vector< float > getSelectedSamples()
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.
structure containing the relevant informations of each strip of the raw cluster
Belle2::SVDShaperDigit::APVFloatSamples samples
ADC of the acquired samples.