Belle II Software development
DeltaRayPDF.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <top/reconstruction_cpp/BackgroundPDF.h>
12#include <top/reconstruction_cpp/PixelPositions.h>
13#include <top/reconstruction_cpp/TOPTrack.h>
14#include <vector>
15#include <cmath>
16
17namespace Belle2 {
22 namespace TOP {
23
28
29 public:
30
35 explicit DeltaRayPDF(int moduleID);
36
42 void prepare(const TOPTrack& track, const Const::ChargedStable& hypothesis);
43
48 int getModuleID() const {return m_moduleID;}
49
54 double getNumPhotons() const {return m_numPhotons;}
55
60 double getFraction() const {return m_fraction;}
61
68 double getPDFValue(int pixelID, double time) const;
69
77 double getPDFValue(double time, double dt0 = 0, double acc = 1) const;
78
85 double getIntegral(double minTime, double maxTime) const;
86
87 private:
88
92 struct GausXY {
93 double x = 0;
94 double y = 0;
95
100 explicit GausXY(double X): x(X), y(exp(-0.5 * x * x))
101 {}
102 };
103
110 double angularDistr(double kz) const;
111
118 double timeDistr(double t, double t0) const;
119
126 double smearedTimeDistr(double t, double t0) const;
127
135 double peakFraction(double tmin, double tmax, double t0) const;
136
143 double totalFraction(double tmin, double tmax) const;
144
150 double directFraction(double z) const;
151
158 double photonYield(double beta, int PDGCode) const;
159
160 // variables set in constructor (slot dependent)
164 double m_zD = 0;
165 double m_zM = 0;
166 double m_phaseIndex = 0;
167 double m_groupIndex = 0;
168 double m_dispersion = 0;
169 double m_angularNorm = 0;
170 std::vector<double> m_norms;
171 std::vector<GausXY> m_tableGaus;
172
173 // variables set in prepare method (track/hypothesis dependent)
174 double m_xE = 0;
175 double m_yE = 0;
176 double m_zE = 0;
177 double m_dirFrac = 0;
178 double m_dirT0 = 0;
179 double m_reflT0 = 0;
180 double m_TOF = 0;
181 double m_fraction = 0;
182 double m_numPhotons = 0;
183 std::vector<double> m_pixelAcceptances;
184
185 };
186
187
188 //--- inline functions ------------------------------------------------------------
189
190 inline double DeltaRayPDF::angularDistr(double kz) const
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 }
198
199 inline double DeltaRayPDF::timeDistr(double t, double t0) const
200 {
201 if (t < t0) return 0;
202 return angularDistr(t0 / t) / m_angularNorm * t0 / pow(t, 2);
203 }
204
205 inline double DeltaRayPDF::getPDFValue(double time, double dt0, double acc) const
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 }
212
213 inline double DeltaRayPDF::getIntegral(double minTime, double maxTime) const
214 {
215 return totalFraction(minTime, maxTime) / m_fraction;
216 }
217
218 } // namespace TOP
220} // namespace Belle2
221
Provides a type-safe way to pass members of the chargedStableSet set.
Definition Const.h:589
Parametrization of background PDF in pixels of single module.
double m_dispersion
dispersion coefficient
double m_dirT0
minimal propagation time of direct photons
double m_reflT0
minimal propagation time of reflected photons
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 m_zD
detector (photo-cathode) position in z
double m_dirFrac
fraction of direct photons
void prepare(const TOPTrack &track, const Const::ChargedStable &hypothesis)
Prepare the object.
double m_yE
average photon emission position in y
double m_TOF
time-of-flight of particle
double m_groupIndex
group refractive index
const BackgroundPDF * m_background
background PDF
double photonYield(double beta, int PDGCode) const
Photon yield from delta-rays per track length in quartz for nominal photon detection efficiency.
int getModuleID() const
Returns slot ID.
Definition DeltaRayPDF.h:48
std::vector< double > m_norms
relative angular distribution normalization constants (cumulative)
std::vector< GausXY > m_tableGaus
table of normal (Gaussian) distribution
double m_zM
spherical mirror position in z
double m_angularNorm
angular distribution normalization constant
double getFraction() const
Returns fraction of delta-ray photons in the time window.
Definition DeltaRayPDF.h:60
double peakFraction(double tmin, double tmax, double t0) const
Fraction of delta-ray photons within given propagation time interval for single peak at t0.
DeltaRayPDF(int moduleID)
Class constructor.
double m_fraction
fraction of delta-ray photons within time window
std::vector< double > m_pixelAcceptances
pixel angular acceptances for direct peak (index = pixelID - 1)
double m_phaseIndex
phase refractive index
double getNumPhotons() const
Returns number of photons.
Definition DeltaRayPDF.h:54
double getIntegral(double minTime, double maxTime) const
Returns integral of PDF from minTime to maxTime.
double smearedTimeDistr(double t, double t0) const
Smeared time distribution of photons from delta rays (normalized).
const PixelPositions * m_pixelPositions
pixel positions
double angularDistr(double kz) const
Angular distribution of photons from delta rays w/ total reflection requirement.
double m_zE
average photon emission position in z
double m_numPhotons
number of photons
double getPDFValue(int pixelID, double time) const
Returns PDF value at given time and pixel.
double timeDistr(double t, double t0) const
Time distribution of photons from delta rays (normalized).
double m_xE
average photon emission position in x
Pixel positions and dimensions in module local frame.
Reconstructed track at TOP.
Definition TOPTrack.h:39
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28
Abstract base class for different kinds of events.
GausXY(double X)
Constructor.