Belle II Software development
SVDELS3Charge Class Reference

Derived Class representing the SVD cluster charge computed with the ELS3 algorithm. More...

#include <SVDELS3Charge.h>

Inheritance diagram for SVDELS3Charge:
SVDClusterCharge

Public Member Functions

virtual ~SVDELS3Charge ()
 virtual destructor
 
void computeClusterCharge (Belle2::SVD::RawCluster &rawCluster, double &charge, double &SNR, double &seedCharge) override
 compute the cluster charge, charge error and SNR with ELS3
 
void applyMaxSampleCharge (const Belle2::SVD::RawCluster &rawCluster, double &charge, double &SNR, double &seedCharge)
 MaxSample Charge Algorithm.
 
void applySumSamplesCharge (const Belle2::SVD::RawCluster &rawCluster, double &charge, double &SNR, double &seedCharge)
 SumSamples Charge Algorithm.
 
void applyELS3Charge (const Belle2::SVD::RawCluster &rawCluster, double &charge, double &SNR, double &seedCharge)
 ELS3 Charge Algorithm.
 

Protected Attributes

DBObjPtr< HardwareClockSettingsm_hwClock
 Hardware Clocks.
 
double m_apvClockPeriod = 1. / m_hwClock->getClockFrequency(Const::EDetector::SVD, "sampling")
 APV clock period.
 
SVDPulseShapeCalibrations m_PulseShapeCal
 SVDPulseShaper calibration wrapper.
 
SVDNoiseCalibrations m_NoiseCal
 SVDNoise calibration wrapper.
 

Detailed Description

Derived Class representing the SVD cluster charge computed with the ELS3 algorithm.

ELS3: Least-Squares method with the Exponentially decaying waveform.

Definition at line 26 of file SVDELS3Charge.h.

Constructor & Destructor Documentation

◆ ~SVDELS3Charge()

virtual ~SVDELS3Charge ( )
inlinevirtual

virtual destructor

Definition at line 33 of file SVDELS3Charge.h.

33{};

Member Function Documentation

◆ applyELS3Charge()

void applyELS3Charge ( const Belle2::SVD::RawCluster rawCluster,
double &  charge,
double &  SNR,
double &  seedCharge 
)
inherited

ELS3 Charge Algorithm.

Definition at line 95 of file SVDClusterCharge.cc.

96 {
97
98 // ISSUES:
99 // 1. samples always in electrons for charge
100 // 2. hardcoded ELS3 tau
101 // 3. seed charge is maxSample
102
103 float m_ELS3tau = 55;
104
105 //get seed charge
106 int seedCellID = rawCluster.getStripsInRawCluster().at(rawCluster.getSeedInternalIndex()).cellID;
107
108 seedCharge = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), seedCellID,
109 rawCluster.getSeedMaxSample());
110
111 //initialize noise and charge
112 double noise = 0;
113 charge = 0;
114
115 //take the MaxSum 3 samples
116 SVDMaxSumAlgorithm maxSum = SVDMaxSumAlgorithm(rawCluster.getClsSamples(false));
117 std::vector<float> selectedSamples = maxSum.getSelectedSamples();
118
119 auto begin = selectedSamples.begin();
120
121 const double E = std::exp(- m_apvClockPeriod / m_ELS3tau);
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));
128
129 //compute raw time
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);
133 float rawtime = - m_apvClockPeriod * rawtime_num / rawtime_den;
134
135 a0 = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), rawCluster.getStripsInRawCluster()[0].cellID,
136 a0);
137 a1 = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), rawCluster.getStripsInRawCluster()[0].cellID,
138 a1);
139 a2 = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), rawCluster.getStripsInRawCluster()[0].cellID,
140 a2);
141
142
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);
145
146 charge = num / den;
147
148 //compute Noise
149 std::vector<Belle2::SVD::StripInRawCluster> strips = rawCluster.getStripsInRawCluster();
150
151 for (int i = 0; i < (int)strips.size(); i++) {
152
153 Belle2::SVD::StripInRawCluster strip = strips.at(i);
154
155 double tmp_noise = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), strip.cellID, strip.noise);
156 noise += tmp_noise * tmp_noise;
157 }
158
159 SNR = charge / sqrt(noise);
160
161 }
R E
internal precision of FFTW codelets
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 ...
int getSeedInternalIndex() const
Definition: RawCluster.h:120
const std::vector< StripInRawCluster > getStripsInRawCluster() const
Definition: RawCluster.h:110
int getSeedMaxSample() const
Definition: RawCluster.h:115
Belle2::SVDShaperDigit::APVFloatSamples getClsSamples(bool inElectrons) const
Definition: RawCluster.cc:104
bool isUSide() const
Definition: RawCluster.h:85
VxdID getSensorID() const
Definition: RawCluster.h:80
SVDPulseShapeCalibrations m_PulseShapeCal
SVDPulseShaper calibration wrapper.
double m_apvClockPeriod
APV clock period.
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44
structure containing the relevant informations of each strip of the raw cluster
Definition: RawCluster.h:20

◆ applyMaxSampleCharge()

void applyMaxSampleCharge ( const Belle2::SVD::RawCluster rawCluster,
double &  charge,
double &  SNR,
double &  seedCharge 
)
inherited

MaxSample Charge Algorithm.

Definition at line 24 of file SVDClusterCharge.cc.

26 {
27
28 //get seed charge
29 int seedCellID = rawCluster.getStripsInRawCluster().at(rawCluster.getSeedInternalIndex()).cellID;
30
31 seedCharge = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), seedCellID,
32 rawCluster.getSeedMaxSample());
33
34 std::vector<Belle2::SVD::StripInRawCluster> strips = rawCluster.getStripsInRawCluster();
35
36 //initialize noise and charge
37 double noise = 0;
38 charge = 0;
39
40
41 for (int i = 0; i < (int)strips.size(); i++) {
42
43 Belle2::SVD::StripInRawCluster strip = strips.at(i);
44
45 double rawCharge = *std::max_element(begin(strip.samples), end(strip.samples));
46
47 // calibrate (ADC -> electrons)
48 double stripCharge = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), strip.cellID, rawCharge);
49
50 double tmp_noise = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), strip.cellID, strip.noise);
51 noise += tmp_noise * tmp_noise;
52
53 charge += stripCharge;
54 }
55
56 SNR = charge / sqrt(noise);
57 }
Belle2::SVDShaperDigit::APVFloatSamples samples
ADC of the acquired samples.
Definition: RawCluster.h:25

◆ applySumSamplesCharge()

void applySumSamplesCharge ( const Belle2::SVD::RawCluster rawCluster,
double &  charge,
double &  SNR,
double &  seedCharge 
)
inherited

SumSamples Charge Algorithm.

Definition at line 59 of file SVDClusterCharge.cc.

61 {
62
63 std::vector<Belle2::SVD::StripInRawCluster> strips = rawCluster.getStripsInRawCluster();
64
65 //initialize noise and charge
66 double noise = 0;
67 charge = 0;
68 seedCharge = 0;
69
70 for (int i = 0; i < (int)strips.size(); i++) {
71
72 Belle2::SVD::StripInRawCluster strip = strips.at(i);
73
74 double rawCharge = 0;
75 for (auto sample : strip.samples)
76 rawCharge += sample;
77
78 // calibrate (ADC -> electrons)
79 double stripCharge = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), strip.cellID, rawCharge);
80
81 if (stripCharge > seedCharge)
82 seedCharge = stripCharge;
83
84 double tmp_noise = m_PulseShapeCal.getChargeFromADC(rawCluster.getSensorID(), rawCluster.isUSide(), strip.cellID, strip.noise);
85 noise += tmp_noise * tmp_noise;
86
87 charge += stripCharge;
88 }
89
90 SNR = charge / sqrt(noise);
91
92 }

◆ computeClusterCharge()

void computeClusterCharge ( Belle2::SVD::RawCluster rawCluster,
double &  charge,
double &  SNR,
double &  seedCharge 
)
overridevirtual

compute the cluster charge, charge error and SNR with ELS3

Implements SVDClusterCharge.

Definition at line 25 of file SVDELS3Charge.cc.

26 {
27 applyELS3Charge(rawCluster, charge, SNR, seedCharge);
28 }
void applyELS3Charge(const Belle2::SVD::RawCluster &rawCluster, double &charge, double &SNR, double &seedCharge)
ELS3 Charge Algorithm.

Member Data Documentation

◆ m_apvClockPeriod

double m_apvClockPeriod = 1. / m_hwClock->getClockFrequency(Const::EDetector::SVD, "sampling")
protectedinherited

APV clock period.

Definition at line 59 of file SVDClusterCharge.h.

◆ m_hwClock

DBObjPtr<HardwareClockSettings> m_hwClock
protectedinherited

Hardware Clocks.

Definition at line 56 of file SVDClusterCharge.h.

◆ m_NoiseCal

SVDNoiseCalibrations m_NoiseCal
protectedinherited

SVDNoise calibration wrapper.

Definition at line 65 of file SVDClusterCharge.h.

◆ m_PulseShapeCal

SVDPulseShapeCalibrations m_PulseShapeCal
protectedinherited

SVDPulseShaper calibration wrapper.

Definition at line 62 of file SVDClusterCharge.h.


The documentation for this class was generated from the following files: