Belle II Software development
DeltaRayPDF Class Reference

Parametrization of delta-ray PDF in pixels of single module. More...

#include <DeltaRayPDF.h>

Classes

struct  GausXY
 Normal (Gaussian) distribution: an entry for the table. More...
 

Public Member Functions

 DeltaRayPDF (int moduleID)
 Class constructor.
 
void prepare (const TOPTrack &track, const Const::ChargedStable &hypothesis)
 Prepare the object.
 
int getModuleID () const
 Returns slot ID.
 
double getNumPhotons () const
 Returns number of photons.
 
double getFraction () const
 Returns fraction of delta-ray photons in the time window.
 
double getPDFValue (int pixelID, double time) const
 Returns PDF value at given time and pixel.
 
double getPDFValue (double time, double dt0=0, double acc=1) const
 Returns PDF value at given time and integrated over all pixels.
 
double getIntegral (double minTime, double maxTime) const
 Returns integral of PDF from minTime to maxTime.
 

Private Member Functions

double angularDistr (double kz) const
 Angular distribution of photons from delta rays w/ total reflection requirement.
 
double timeDistr (double t, double t0) const
 Time distribution of photons from delta rays (normalized).
 
double smearedTimeDistr (double t, double t0) const
 Smeared time distribution of photons from delta rays (normalized).
 
double peakFraction (double tmin, double tmax, double t0) const
 Fraction of delta-ray photons within given propagation time interval for single peak at t0.
 
double totalFraction (double tmin, double tmax) const
 Total fraction of delta-ray photons within given propagation time interval.
 
double directFraction (double z) const
 Fraction of direct photons from delta-rays, e.g direct/(direct+reflected)
 
double photonYield (double beta, int PDGCode) const
 Photon yield from delta-rays per track length in quartz for nominal photon detection efficiency.
 

Private Attributes

int m_moduleID
 slot ID
 
const BackgroundPDFm_background = 0
 background PDF
 
const PixelPositionsm_pixelPositions = 0
 pixel positions
 
double m_zD = 0
 detector (photo-cathode) position in z
 
double m_zM = 0
 spherical mirror position in z
 
double m_phaseIndex = 0
 phase refractive index
 
double m_groupIndex = 0
 group refractive index
 
double m_dispersion = 0
 dispersion coefficient
 
double m_angularNorm = 0
 angular distribution normalization constant
 
std::vector< double > m_norms
 relative angular distribution normalization constants (cumulative)
 
std::vector< GausXYm_tableGaus
 table of normal (Gaussian) distribution
 
double m_xE = 0
 average photon emission position in x
 
double m_yE = 0
 average photon emission position in y
 
double m_zE = 0
 average photon emission position in z
 
double m_dirFrac = 0
 fraction of direct photons
 
double m_dirT0 = 0
 minimal propagation time of direct photons
 
double m_reflT0 = 0
 minimal propagation time of reflected photons
 
double m_TOF = 0
 time-of-flight of particle
 
double m_fraction = 0
 fraction of delta-ray photons within time window
 
double m_numPhotons = 0
 number of photons
 
std::vector< double > m_pixelAcceptances
 pixel angular acceptances for direct peak (index = pixelID - 1)
 

Detailed Description

Parametrization of delta-ray PDF in pixels of single module.

Definition at line 27 of file DeltaRayPDF.h.

Constructor & Destructor Documentation

◆ DeltaRayPDF()

DeltaRayPDF ( int  moduleID)
explicit

Class constructor.

Parameters
moduleIDslot ID

Definition at line 24 of file DeltaRayPDF.cc.

24 :
26 {
27 if (not m_background) {
28 B2ERROR("TOP::DeltaRayPDF: background PDF not found");
29 return;
30 }
31
32 const auto* yScanner = TOPRecoManager::getYScanner(moduleID);
33 if (not yScanner) {
34 B2ERROR("TOP::DeltaRayPDF: YScanner not found");
35 return;
36 }
37
38 m_pixelPositions = &(yScanner->getPixelPositions());
39
40 m_zD = yScanner->getPrism().zD;
41 m_zM = yScanner->getBars().back().zR;
42 double meanE = yScanner->getMeanEnergyBeta1();
43 double sigE = yScanner->getRMSEnergyBeta1();
46 double dng_de = TOPGeometryPar::Instance()->getGroupIndexDerivative(meanE);
47 m_dispersion = dng_de / m_groupIndex * sigE;
48
49 const int N = 1000;
50 double dkz = 1.0 / N;
51 m_norms.push_back(0);
52 for (int i = 0; i < N; i++) {
53 double kz = (i + 0.5) * dkz;
54 m_angularNorm += angularDistr(kz) * dkz;
55 m_norms.push_back(m_angularNorm);
56 }
57 for (auto& norm : m_norms) norm /= m_angularNorm;
58
59 const int Np = 101;
60 double dx = 6.0 / (Np - 1);
61 for (int i = 0; i < Np; i++) {
62 double x = i * dx - 3.0;
63 m_tableGaus.push_back(GausXY(x));
64 }
65 double sum = 0;
66 for (const auto& gaus : m_tableGaus) sum += gaus.y;
67 for (auto& gaus : m_tableGaus) gaus.y /= sum;
68 }
double m_dispersion
dispersion coefficient
Definition: DeltaRayPDF.h:168
double m_zD
detector (photo-cathode) position in z
Definition: DeltaRayPDF.h:164
double m_groupIndex
group refractive index
Definition: DeltaRayPDF.h:167
const BackgroundPDF * m_background
background PDF
Definition: DeltaRayPDF.h:162
std::vector< double > m_norms
relative angular distribution normalization constants (cumulative)
Definition: DeltaRayPDF.h:170
std::vector< GausXY > m_tableGaus
table of normal (Gaussian) distribution
Definition: DeltaRayPDF.h:171
double m_zM
spherical mirror position in z
Definition: DeltaRayPDF.h:165
double m_angularNorm
angular distribution normalization constant
Definition: DeltaRayPDF.h:169
double m_phaseIndex
phase refractive index
Definition: DeltaRayPDF.h:166
const PixelPositions * m_pixelPositions
pixel positions
Definition: DeltaRayPDF.h:163
double angularDistr(double kz) const
Angular distribution of photons from delta rays w/ total reflection requirement.
Definition: DeltaRayPDF.h:190
double getGroupIndexDerivative(double energy) const
Returns the derivative (dn_g/dE) of group refractive index of quartz at given photon energy.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
double getPhaseIndex(double energy) const
Returns phase refractive index of quartz at given photon energy.
double getGroupIndex(double energy) const
Returns group refractive index of quartz at given photon energy.
static const YScanner * getYScanner(int moduleID)
Returns y-scanner of a given module.
static const BackgroundPDF * getBackgroundPDF(int moduleID)
Returns background PDF of a given module.

Member Function Documentation

◆ angularDistr()

double angularDistr ( double  kz) const
inlineprivate

Angular distribution of photons from delta rays w/ total reflection requirement.

Distribution is not normalized.

Parameters
kzz-component of photon direction
Returns
distribution value

Definition at line 190 of file DeltaRayPDF.h.

191 {
192 if (std::abs(kz) < 1 / m_phaseIndex) {
193 double x = sqrt((1 - 1 / pow(m_phaseIndex, 2)) / (1 - pow(kz, 2)));
194 return 1 - acos(x) * 4 / M_PI;
195 }
196 return 1;
197 }
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ directFraction()

double directFraction ( double  z) const
private

Fraction of direct photons from delta-rays, e.g direct/(direct+reflected)

Parameters
zlocal z position of track at TOP
Returns
fraction of direct photons

Definition at line 155 of file DeltaRayPDF.cc.

156 {
157 // coefficients of 5th order polynom (from fit to MC, see B2GM/TOP Software status, June 2020)
158 const double par[] = {0.332741, -0.00331502, 2.0801e-05, -3.43689e-09, -6.35849e-10, 3.54556e-12};
159
160 double x = 1;
161 double f = 0;
162 for (auto p : par) {
163 f += p * x;
164 x *= z;
165 }
166 return f;
167 }

◆ getFraction()

double getFraction ( ) const
inline

Returns fraction of delta-ray photons in the time window.

Returns
fraction of delta-ray photons in the time window

Definition at line 60 of file DeltaRayPDF.h.

60{return m_fraction;}
double m_fraction
fraction of delta-ray photons within time window
Definition: DeltaRayPDF.h:181

◆ getIntegral()

double getIntegral ( double  minTime,
double  maxTime 
) const
inline

Returns integral of PDF from minTime to maxTime.

Parameters
minTimeintegral lower limit
maxTimeintegral upper limit
Returns
integral of PDF

Definition at line 213 of file DeltaRayPDF.h.

214 {
215 return totalFraction(minTime, maxTime) / m_fraction;
216 }
double totalFraction(double tmin, double tmax) const
Total fraction of delta-ray photons within given propagation time interval.
Definition: DeltaRayPDF.cc:148

◆ getModuleID()

int getModuleID ( ) const
inline

Returns slot ID.

Returns
slot ID

Definition at line 48 of file DeltaRayPDF.h.

48{return m_moduleID;}

◆ getNumPhotons()

double getNumPhotons ( ) const
inline

Returns number of photons.

Returns
number of photons

Definition at line 54 of file DeltaRayPDF.h.

54{return m_numPhotons;}
double m_numPhotons
number of photons
Definition: DeltaRayPDF.h:182

◆ getPDFValue() [1/2]

double getPDFValue ( double  time,
double  dt0 = 0,
double  acc = 1 
) const
inline

Returns PDF value at given time and integrated over all pixels.

Parameters
timephoton hit time
dt0direct peak position correction
accacceptance correction factor for direct peak
Returns
PDF value (projection to time axis)

Definition at line 205 of file DeltaRayPDF.h.

206 {
207 double t = time - m_TOF;
208 double pdfDirect = smearedTimeDistr(t, m_dirT0 + dt0) * acc;
209 double pdfReflec = smearedTimeDistr(t, m_reflT0);
210 return m_dirFrac * pdfDirect + (1 - m_dirFrac) * pdfReflec;
211 }
double m_dirT0
minimal propagation time of direct photons
Definition: DeltaRayPDF.h:178
double m_reflT0
minimal propagation time of reflected photons
Definition: DeltaRayPDF.h:179
double m_dirFrac
fraction of direct photons
Definition: DeltaRayPDF.h:177
double m_TOF
time-of-flight of particle
Definition: DeltaRayPDF.h:180
double smearedTimeDistr(double t, double t0) const
Smeared time distribution of photons from delta rays (normalized).
Definition: DeltaRayPDF.cc:126

◆ getPDFValue() [2/2]

double getPDFValue ( int  pixelID,
double  time 
) const

Returns PDF value at given time and pixel.

Parameters
pixelIDpixel ID
timephoton hit time
Returns
PDF value

Definition at line 113 of file DeltaRayPDF.cc.

114 {
115 const auto& pixelPDF = m_background->getPDF();
116 unsigned k = pixelID - 1;
117 if (k < pixelPDF.size()) {
118 const auto& pixel = m_pixelPositions->get(pixelID);
119 double t0 = sqrt(pow(pixel.xc - m_xE, 2) + pow(pixel.yc - m_yE, 2) + pow(m_zD - m_zE, 2))
121 return getPDFValue(time, t0 - m_dirT0, m_pixelAcceptances[k]) * pixelPDF[k];
122 }
123 return 0;
124 }
static const double speedOfLight
[cm/ns]
Definition: Const.h:695
const std::vector< double > & getPDF() const
Returns pixel part of PDF.
Definition: BackgroundPDF.h:50
double m_yE
average photon emission position in y
Definition: DeltaRayPDF.h:175
std::vector< double > m_pixelAcceptances
pixel angular acceptances for direct peak (index = pixelID - 1)
Definition: DeltaRayPDF.h:183
double m_zE
average photon emission position in z
Definition: DeltaRayPDF.h:176
double getPDFValue(int pixelID, double time) const
Returns PDF value at given time and pixel.
Definition: DeltaRayPDF.cc:113
double m_xE
average photon emission position in x
Definition: DeltaRayPDF.h:174
const PixelData & get(int pixelID) const
Returns pixel data for given pixelID.

◆ peakFraction()

double peakFraction ( double  tmin,
double  tmax,
double  t0 
) const
private

Fraction of delta-ray photons within given propagation time interval for single peak at t0.

Parameters
tmintime interval lower edge
tmaxtime interval upper edge
t0minimal possible propagation time
Returns
fraction of photons within time interval for single peak

Definition at line 138 of file DeltaRayPDF.cc.

139 {
140 int nt = m_norms.size() - 1;
141 int i1 = nt;
142 if (tmax > t0) i1 = t0 / tmax * nt;
143 int i2 = nt;
144 if (tmin > t0) i2 = t0 / tmin * nt;
145 return std::abs(m_norms[i2] - m_norms[i1]);
146 }

◆ photonYield()

double photonYield ( double  beta,
int  PDGCode 
) const
private

Photon yield from delta-rays per track length in quartz for nominal photon detection efficiency.

Parameters
betaparticle velocity
PDGCodePDG code
Returns
photon yield per cm

Definition at line 169 of file DeltaRayPDF.cc.

170 {
171 // for parametrizations see B2GM/TOP Software status, June 2020
172 const double averagePDE = 1.06404889; // relative to nominal PDE
173 const double scaleFactor = 0.79;
174
175 if (std::abs(PDGCode) == 11) { // electorns and positrons
176 return 5.30 * scaleFactor / averagePDE;
177 } else if (PDGCode == -2212) { // anti-protons
178 const double par[] = {13.5859, -28.0625, 17.2684};
179 double f = par[0] + par[1] * beta + par[2] * beta * beta;
180 return f * scaleFactor / averagePDE;
181 } else { // other charged particles
182 const double par[] = { -8.15871, 10.0082, -1.25140, -120.225, 120.210};
183 double f = exp(par[0] + par[1] * beta + par[2] * beta * beta) + exp(par[3] + par[4] * beta);
184 return f * scaleFactor / averagePDE;
185 }
186 }

◆ prepare()

void prepare ( const TOPTrack track,
const Const::ChargedStable hypothesis 
)

Prepare the object.

Parameters
tracktrack at TOP
hypothesisparticle hypothesis

Definition at line 70 of file DeltaRayPDF.cc.

71 {
72 const auto& emi = track.getEmissionPoint().position;
73 m_xE = emi.X();
74 m_yE = emi.Y();
75 m_zE = emi.Z();
79 m_TOF = track.getTOF(hypothesis);
80
81 if (m_dirT0 < 0) {
82 B2ERROR("TOP::DeltaRayPDF::prepare: T0 direct is negative -> set to 0");
83 m_dirT0 = 0;
84 }
85 if (m_reflT0 < 0) {
86 B2ERROR("TOP::DeltaRayPDF::prepare: T0 reflected is negative -> set to 0");
87 m_reflT0 = 0;
88 }
89
90 double beta = track.getBeta(hypothesis);
91 int PDGCode = std::abs(hypothesis.getPDGCode());
92 if (PDGCode < 20) PDGCode = -PDGCode;
93 if (track.getCharge() < 0) PDGCode = -PDGCode;
94 double tlen = track.getLengthInQuartz();
95 double tmin = TOPRecoManager::getMinTime();
96 double tmax = TOPRecoManager::getMaxTime();
97 double relEffi = m_background->getEfficiency();
98 m_fraction = totalFraction(tmin, tmax);
99 m_numPhotons = photonYield(beta, PDGCode) * tlen * m_fraction * relEffi;
100
101 for (const auto& pixel : m_pixelPositions->getPixels()) {
102 double dfi_dx = std::abs(m_zD - m_zE) / (pow(pixel.xc - m_xE, 2) + pow(pixel.yc - m_yE, 2) + pow(m_zD - m_zE, 2));
103 m_pixelAcceptances.push_back(dfi_dx * pixel.Dx);
104 }
105 double sum = 0;
106 const auto& pixelPDF = m_background->getPDF();
107 for (size_t k = 0; k < m_pixelAcceptances.size(); k++) {
108 sum += m_pixelAcceptances[k] * pixelPDF[k];
109 }
110 for (auto& x : m_pixelAcceptances) x /= sum;
111 }
double getEfficiency() const
Returns average of pixel relative efficiencies.
Definition: BackgroundPDF.h:56
double directFraction(double z) const
Fraction of direct photons from delta-rays, e.g direct/(direct+reflected)
Definition: DeltaRayPDF.cc:155
double photonYield(double beta, int PDGCode) const
Photon yield from delta-rays per track length in quartz for nominal photon detection efficiency.
Definition: DeltaRayPDF.cc:169
const std::vector< PixelData > & getPixels() const
Returns pixel data of entire module.
static double getMaxTime()
Returns time window upper edge.
static double getMinTime()
Returns time window lower edge.

◆ smearedTimeDistr()

double smearedTimeDistr ( double  t,
double  t0 
) const
private

Smeared time distribution of photons from delta rays (normalized).

Parameters
tphoton propagation time
t0minimal possible propagation time
Returns
normalized time distribution value at given propagaton time

Definition at line 126 of file DeltaRayPDF.cc.

127 {
128 const double sigma0 = 0.15;
129 double sigma = sqrt(pow(sigma0, 2) + pow(m_dispersion * t, 2));
130
131 if (sigma < 0.001) return timeDistr(t, t0);
132
133 double f = 0;
134 for (const auto& gaus : m_tableGaus) f += timeDistr(t - gaus.x * sigma, t0) * gaus.y;
135 return f;
136 }
double timeDistr(double t, double t0) const
Time distribution of photons from delta rays (normalized).
Definition: DeltaRayPDF.h:199

◆ timeDistr()

double timeDistr ( double  t,
double  t0 
) const
inlineprivate

Time distribution of photons from delta rays (normalized).

Parameters
tphoton propagation time
t0minimal possible propagation time
Returns
normalized time distribution value at given propagaton time

Definition at line 199 of file DeltaRayPDF.h.

200 {
201 if (t < t0) return 0;
202 return angularDistr(t0 / t) / m_angularNorm * t0 / pow(t, 2);
203 }

◆ totalFraction()

double totalFraction ( double  tmin,
double  tmax 
) const
private

Total fraction of delta-ray photons within given propagation time interval.

Parameters
tmintime interval lower edge
tmaxtime interval upper edge
Returns
fraction of photons within time interval including direct and reflected peaks

Definition at line 148 of file DeltaRayPDF.cc.

149 {
150 double dirPeak = peakFraction(tmin - m_TOF, tmax - m_TOF, m_dirT0);
151 double reflPeak = peakFraction(tmin - m_TOF, tmax - m_TOF, m_reflT0);
152 return m_dirFrac * dirPeak + (1 - m_dirFrac) * reflPeak;
153 }
double peakFraction(double tmin, double tmax, double t0) const
Fraction of delta-ray photons within given propagation time interval for single peak at t0.
Definition: DeltaRayPDF.cc:138

Member Data Documentation

◆ m_angularNorm

double m_angularNorm = 0
private

angular distribution normalization constant

Definition at line 169 of file DeltaRayPDF.h.

◆ m_background

const BackgroundPDF* m_background = 0
private

background PDF

Definition at line 162 of file DeltaRayPDF.h.

◆ m_dirFrac

double m_dirFrac = 0
private

fraction of direct photons

Definition at line 177 of file DeltaRayPDF.h.

◆ m_dirT0

double m_dirT0 = 0
private

minimal propagation time of direct photons

Definition at line 178 of file DeltaRayPDF.h.

◆ m_dispersion

double m_dispersion = 0
private

dispersion coefficient

Definition at line 168 of file DeltaRayPDF.h.

◆ m_fraction

double m_fraction = 0
private

fraction of delta-ray photons within time window

Definition at line 181 of file DeltaRayPDF.h.

◆ m_groupIndex

double m_groupIndex = 0
private

group refractive index

Definition at line 167 of file DeltaRayPDF.h.

◆ m_moduleID

int m_moduleID
private

slot ID

Definition at line 161 of file DeltaRayPDF.h.

◆ m_norms

std::vector<double> m_norms
private

relative angular distribution normalization constants (cumulative)

Definition at line 170 of file DeltaRayPDF.h.

◆ m_numPhotons

double m_numPhotons = 0
private

number of photons

Definition at line 182 of file DeltaRayPDF.h.

◆ m_phaseIndex

double m_phaseIndex = 0
private

phase refractive index

Definition at line 166 of file DeltaRayPDF.h.

◆ m_pixelAcceptances

std::vector<double> m_pixelAcceptances
private

pixel angular acceptances for direct peak (index = pixelID - 1)

Definition at line 183 of file DeltaRayPDF.h.

◆ m_pixelPositions

const PixelPositions* m_pixelPositions = 0
private

pixel positions

Definition at line 163 of file DeltaRayPDF.h.

◆ m_reflT0

double m_reflT0 = 0
private

minimal propagation time of reflected photons

Definition at line 179 of file DeltaRayPDF.h.

◆ m_tableGaus

std::vector<GausXY> m_tableGaus
private

table of normal (Gaussian) distribution

Definition at line 171 of file DeltaRayPDF.h.

◆ m_TOF

double m_TOF = 0
private

time-of-flight of particle

Definition at line 180 of file DeltaRayPDF.h.

◆ m_xE

double m_xE = 0
private

average photon emission position in x

Definition at line 174 of file DeltaRayPDF.h.

◆ m_yE

double m_yE = 0
private

average photon emission position in y

Definition at line 175 of file DeltaRayPDF.h.

◆ m_zD

double m_zD = 0
private

detector (photo-cathode) position in z

Definition at line 164 of file DeltaRayPDF.h.

◆ m_zE

double m_zE = 0
private

average photon emission position in z

Definition at line 176 of file DeltaRayPDF.h.

◆ m_zM

double m_zM = 0
private

spherical mirror position in z

Definition at line 165 of file DeltaRayPDF.h.


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