![]() |
Belle II Software
release-06-01-15
|
PDF construction and log likelihood determination for a given track and particle hypothesis. More...
#include <PDFConstructor.h>
Classes | |
struct | InverseRaytracerDirect |
Structure that enables defining a template function: direct photons. More... | |
struct | InverseRaytracerReflected |
Structure that enables defining a template function: reflected photons. More... | |
struct | LogL |
Useful data type for returning the results of log likelihood calculation. More... | |
struct | PrismSolution |
Solution of inverse raytracing in prism. More... | |
struct | Pull |
Data type for storing photon pull w.r.t PDF peak. More... | |
Public Types | |
enum | EPDFOption { c_Rough = 0 , c_Fine = 1 , c_Optimal = 2 } |
Signal PDF construction options. More... | |
enum | EStoreOption { c_Reduced = 0 , c_Full = 1 } |
Options for storing signal PDF parameters. More... | |
Public Member Functions | |
PDFConstructor (const TOPTrack &track, const Const::ChargedStable &hypothesis, EPDFOption PDFOption=c_Optimal, EStoreOption storeOption=c_Reduced, double overrideMass=0) | |
Class constructor. More... | |
bool | isValid () const |
Checks the object status. More... | |
void | switchOffDeltaRayPDF () const |
Exclude delta-ray PDF in log likelihood calculation. | |
void | switchOnDeltaRayPDF () const |
Include delta-ray PDF in log likelihood calculation (this is default) | |
void | switchDeltaRayPDF (bool deltaPDFOn) const |
Include or exclude delta-ray PDF in log likelihood calculation. More... | |
int | getModuleID () const |
Returns slot ID. More... | |
const Const::ChargedStable & | getHypothesis () const |
Returns particle hypothesis. More... | |
const std::vector< TOPTrack::SelectedHit > & | getSelectedHits () const |
Returns selected photon hits belonging to this slot. More... | |
double | getBkgRate () const |
Returns estimated background hit rate. More... | |
double | getCosTotal () const |
Returns cosine of total reflection angle. More... | |
double | getCosCerenkovAngle (double E) const |
Returns cosine of Cerenkov angle at given photon energy. More... | |
const std::vector< SignalPDF > & | getSignalPDF () const |
Returns signal PDF. More... | |
const BackgroundPDF * | getBackgroundPDF () const |
Returns background PDF. More... | |
const DeltaRayPDF & | getDeltaRayPDF () const |
Returns delta-ray PDF. More... | |
double | getExpectedSignalPhotons () const |
Returns the expected number of signal photons within the default time window. More... | |
double | getExpectedBkgPhotons () const |
Returns the expected number of background photons within the default time window. More... | |
double | getExpectedDeltaPhotons () const |
Returns the expected number of delta-ray photons within the default time window. More... | |
double | getExpectedPhotons () const |
Returns the expected number of photons within the default time window. More... | |
double | getPDFValue (int pixelID, double time, double timeErr, double sigt=0) const |
Returns PDF value. More... | |
LogL | getLogL () const |
Returns extended log likelihood (using the default time window) More... | |
LogL | getLogL (double t0, double sigt=0) const |
Returns extended log likelihood for PDF shifted in time. More... | |
LogL | getLogL (double t0, double minTime, double maxTime, double sigt=0) const |
Returns extended log likelihood for PDF shifted in time and using different time window. More... | |
const std::vector< LogL > & | getPixelLogLs (double t0, double sigt=0) const |
Returns extended log likelihoods in pixels for PDF shifted in time. More... | |
const std::vector< LogL > & | getPixelLogLs (double t0, double minTime, double maxTime, double sigt=0) const |
Returns extended log likelihoods in pixels for PDF shifted in time and using diferent time window. More... | |
const std::vector< Pull > & | getPulls () const |
Returns photon pulls w.r.t PDF peaks. More... | |
int | getNCalls_setPDF (SignalPDF::EPeakType type) const |
Returns number of calls of template function setSignalPDF<T> for a given peak type. More... | |
int | getNCalls_expandPDF (SignalPDF::EPeakType type) const |
Returns number of calls of function expandSignalPDF for a given peak type. More... | |
Private Member Functions | |
template<class T > | |
void | setSignalPDF (T &t, unsigned col, double xD, double zD, int Nxm=0, double xmMin=0, double xmMax=0) |
Template function: sets signal PDF in a pixel column and for specific reflection in x. More... | |
const InverseRaytracer::CerenkovAngle & | cerenkovAngle (double dE=0) |
Returns cosine and sine of cerenkov angle. More... | |
void | setSignalPDF () |
Sets signal PDF. | |
void | setSignalPDF_direct () |
Sets signal PDF for direct photons. | |
void | setSignalPDF_reflected () |
Sets signal PDF for reflected photons. | |
void | setSignalPDF_prism () |
Sets signal PDF for track crossing prism. | |
void | setSignalPDF_reflected (int Nxm, double xmMin, double xmMax) |
Sets signal PDF for reflected photons at given reflection number. More... | |
bool | detectionPositionX (double xM, int Nxm, std::vector< double > &xDs, double &minLen) |
Calculates unfolded detection position from known reflection position on the mirror and emission point. More... | |
bool | doRaytracingCorrections (const InverseRaytracer::Solution &sol, double dFic_dx, double xD) |
Corrects the solution of inverse ray-tracing with fast ray-tracing. More... | |
double | deltaXD (double dFic, const InverseRaytracer::Solution &sol, double xD) |
Returns the difference in xD between ray-traced solution rotated by dFic and input argument. More... | |
double | propagationLosses (double E, double propLen, int nx, int ny, SignalPDF::EPeakType type) const |
Returns photon propagation losses (bulk absorption, surface reflectivity, mirror reflectivity) More... | |
void | expandSignalPDF (unsigned col, const YScanner::Derivatives &D, SignalPDF::EPeakType type) |
Expands signal PDF in y (y-scan) More... | |
bool | rangeOfX (double z, double &xmi, double &xma) |
Estimates range of unfolded x coordinate of the hits on given plane perpendicular to z-axis. More... | |
double | findReflectionExtreme (double xE, double zE, double zD, int Nxm, double A, const RaytracerBase::Mirror &mirror) const |
Finds the position on the mirror of the extreme reflection. More... | |
double | derivativeOfReflectedX (double x, double xe, double ze, double zd) const |
Returns the derivative of reflected position at given x. More... | |
bool | prismRaytrace (const PrismSolution &sol, double dL=0, double dFic=0, double de=0) |
Do forward raytracing of inverse raytracing solution in prism. More... | |
PrismSolution | prismSolution (const PixelPositions::PixelData &pixel, unsigned k, int nx) |
General solution of inverse raytracing in prism: iterative procedure calling basic solution. More... | |
PrismSolution | prismSolution (const TVector3 &rD, double L) |
Basic solution of inverse raytracing in prism: assuming straight line particle trajectory. More... | |
double | pdfValue (int pixelID, double time, double timeErr, double sigt=0) const |
Returns the value of PDF normalized to the number of expected photons. More... | |
double | expectedPhotons (double minTime, double maxTime) const |
Returns the expected number of photons within given time window. More... | |
void | initializePixelLogLs (double minTime, double maxTime) const |
Initializes pixel log likelihoods. More... | |
void | appendPulls (const TOPTrack::SelectedHit &hit) const |
Appends pulls of a photon hit. More... | |
Private Attributes | |
int | m_moduleID = 0 |
slot ID | |
const TOPTrack & | m_track |
temporary reference to track at TOP | |
const Const::ChargedStable | m_hypothesis |
particle hypothesis | |
const InverseRaytracer * | m_inverseRaytracer = 0 |
inverse ray-tracer | |
const FastRaytracer * | m_fastRaytracer = 0 |
fast ray-tracer | |
const YScanner * | m_yScanner = 0 |
PDF expander in y. | |
const BackgroundPDF * | m_backgroundPDF = 0 |
background PDF | |
DeltaRayPDF | m_deltaRayPDF |
delta-ray PDF | |
EPDFOption | m_PDFOption = c_Optimal |
signal PDF construction option | |
EStoreOption | m_storeOption = c_Reduced |
signal PDF storing option | |
bool | m_valid = false |
cross-check flag, true if track is valid and all the pointers above are valid | |
double | m_beta = 0 |
particle hypothesis beta | |
double | m_tof = 0 |
time-of-flight from IP to average photon emission position | |
double | m_groupIndex = 0 |
group refractive index at mean photon energy | |
double | m_groupIndexDerivative = 0 |
derivative (dn_g/dE) of group refractive index at mean photon energy | |
double | m_cosTotal = 0 |
cosine of total reflection angle | |
double | m_minTime = 0 |
time window lower edge | |
double | m_maxTime = 0 |
time window upper edge | |
std::vector< TOPTrack::SelectedHit > | m_selectedHits |
selected photon hits | |
double | m_bkgRate = 0 |
estimated background hit rate | |
std::vector< SignalPDF > | m_signalPDFs |
parameterized signal PDF in pixels (index = pixelID - 1) | |
double | m_signalPhotons = 0 |
expected number of signal photons | |
double | m_bkgPhotons = 0 |
expected number of background photons | |
double | m_deltaPhotons = 0 |
expected number of delta-ray photons | |
std::map< double, InverseRaytracer::CerenkovAngle > | m_cerenkovAngles |
sine and cosine of Cerenkov angles | |
double | m_dFic = 0 |
temporary storage for dFic used in last call to deltaXD | |
double | m_Fic = 0 |
temporary storage for Cerenkov azimuthal angle | |
std::map< SignalPDF::EPeakType, int > | m_ncallsSetPDF |
number of calls to setSignalPDF<T> | |
std::map< SignalPDF::EPeakType, int > | m_ncallsExpandPDF |
number of calls to expandSignalPDF | |
std::vector< LogL > | m_pixelLLs |
pixel log likelihoods (index = pixelID - 1) | |
std::vector< Pull > | m_pulls |
photon pulls w.r.t PDF peaks | |
bool | m_deltaPDFOn = true |
include/exclude delta-ray PDF in likelihood calculation | |
PDF construction and log likelihood determination for a given track and particle hypothesis.
Definition at line 33 of file PDFConstructor.h.
enum EPDFOption |
Signal PDF construction options.
Enumerator | |
---|---|
c_Rough | no dependence on y |
c_Fine | y dependent everywhere |
c_Optimal | y dependent only where necessary |
Definition at line 40 of file PDFConstructor.h.
enum EStoreOption |
Options for storing signal PDF parameters.
Enumerator | |
---|---|
c_Reduced | only PDF peak data |
c_Full | also extra information |
Definition at line 49 of file PDFConstructor.h.
PDFConstructor | ( | const TOPTrack & | track, |
const Const::ChargedStable & | hypothesis, | ||
EPDFOption | PDFOption = c_Optimal , |
||
EStoreOption | storeOption = c_Reduced , |
||
double | overrideMass = 0 |
||
) |
Class constructor.
track | track at TOP |
hypothesis | particle hypothesis |
PDFOption | signal PDF construction option |
storeOption | signal PDF store option |
overrideMass | alternative mass value to be used intestead of the one from hypothesis. Ignored if <= 0. |
Definition at line 27 of file PDFConstructor.cc.
|
private |
Appends pulls of a photon hit.
hit | photon hit |
Definition at line 845 of file PDFConstructor.cc.
|
inlineprivate |
Returns cosine and sine of cerenkov angle.
dE | energy difference to mean photon energy |
Definition at line 605 of file PDFConstructor.h.
|
inlineprivate |
Returns the difference in xD between ray-traced solution rotated by dFic and input argument.
dFic | rotation angle around track direction (delta Cerenkov azimuthal angle) |
sol | solution of inverse raytracing |
xD | unfolded detection position in x |
Definition at line 591 of file PDFConstructor.h.
|
private |
Returns the derivative of reflected position at given x.
This function is used to find the position of reflection extreme. All arguments must be given in the mirror frame and in units of mirror radius.
x | position in x on the mirror |
xe | unfolded emission position in x |
ze | emission position in z |
zd | unfolded detection position in z |
Definition at line 469 of file PDFConstructor.cc.
|
private |
Calculates unfolded detection position from known reflection position on the mirror and emission point.
xM | reflection position x on the mirror |
Nxm | reflection number before the mirror |
xDs | unfolded detection positions (appended at each call) [in/out] |
minLen | minimum of propagation lengths (updated at each call) [in/out] |
Definition at line 212 of file PDFConstructor.cc.
|
private |
Corrects the solution of inverse ray-tracing with fast ray-tracing.
Corrected solution is available in m_fastRaytracer.
sol | solution of inverse raytracing |
dFic_dx | derivative of Cerenkov azimuthal angle over photon detection coordinate x |
xD | unfolded detection position in x |
Definition at line 232 of file PDFConstructor.cc.
|
private |
Expands signal PDF in y (y-scan)
col | pixel column (0-based) |
D | derivatives |
type | peak type, e.g. direct or reflected |
Definition at line 290 of file PDFConstructor.cc.
|
private |
Returns the expected number of photons within given time window.
minTime | time window lower edge |
maxTime | time window upper edge |
Definition at line 805 of file PDFConstructor.cc.
|
private |
Finds the position on the mirror of the extreme reflection.
xE | true emission position in x |
zE | emission position in z |
zD | detection position in z |
Nxm | signed number of reflections before mirror |
A | width of the mirror segment |
mirror | spherical mirror data |
Definition at line 487 of file PDFConstructor.cc.
|
inline |
|
inline |
Returns estimated background hit rate.
Definition at line 152 of file PDFConstructor.h.
|
inline |
Returns cosine of Cerenkov angle at given photon energy.
E | photon energy [eV] |
Definition at line 599 of file PDFConstructor.h.
|
inline |
Returns cosine of total reflection angle.
Definition at line 158 of file PDFConstructor.h.
|
inline |
|
inline |
Returns the expected number of background photons within the default time window.
Definition at line 195 of file PDFConstructor.h.
|
inline |
Returns the expected number of delta-ray photons within the default time window.
Definition at line 201 of file PDFConstructor.h.
|
inline |
Returns the expected number of photons within the default time window.
Definition at line 207 of file PDFConstructor.h.
|
inline |
Returns the expected number of signal photons within the default time window.
Definition at line 189 of file PDFConstructor.h.
|
inline |
Returns particle hypothesis.
Definition at line 140 of file PDFConstructor.h.
PDFConstructor::LogL getLogL | ( | ) | const |
Returns extended log likelihood (using the default time window)
Definition at line 730 of file PDFConstructor.cc.
PDFConstructor::LogL getLogL | ( | double | t0, |
double | minTime, | ||
double | maxTime, | ||
double | sigt = 0 |
||
) | const |
Returns extended log likelihood for PDF shifted in time and using different time window.
t0 | time shift |
minTime | time window lower edge |
maxTime | time window upper edge |
sigt | additional time smearing |
Definition at line 756 of file PDFConstructor.cc.
|
inline |
Returns extended log likelihood for PDF shifted in time.
t0 | time shift |
sigt | additional time smearing |
Definition at line 231 of file PDFConstructor.h.
|
inline |
|
inline |
Returns number of calls of function expandSignalPDF for a given peak type.
type | PDF peak type |
Definition at line 280 of file PDFConstructor.h.
|
inline |
Returns number of calls of template function setSignalPDF<T> for a given peak type.
type | PDF peak type |
Definition at line 273 of file PDFConstructor.h.
|
inline |
Returns PDF value.
pixelID | pixel ID |
time | photon hit time |
timeErr | uncertainty of hit time |
sigt | additional time smearing |
Definition at line 586 of file PDFConstructor.h.
const std::vector< PDFConstructor::LogL > & getPixelLogLs | ( | double | t0, |
double | minTime, | ||
double | maxTime, | ||
double | sigt = 0 |
||
) | const |
Returns extended log likelihoods in pixels for PDF shifted in time and using diferent time window.
t0 | time shift |
minTime | time window lower edge |
maxTime | time window upper edge |
sigt | additional time smearing |
Definition at line 779 of file PDFConstructor.cc.
|
inline |
Returns extended log likelihoods in pixels for PDF shifted in time.
t0 | time shift |
sigt | additional time smearing |
Definition at line 249 of file PDFConstructor.h.
const std::vector< PDFConstructor::Pull > & getPulls | ( | ) | const |
Returns photon pulls w.r.t PDF peaks.
Definition at line 833 of file PDFConstructor.cc.
|
inline |
Returns selected photon hits belonging to this slot.
Definition at line 146 of file PDFConstructor.h.
|
inline |
Returns signal PDF.
Definition at line 171 of file PDFConstructor.h.
|
private |
Initializes pixel log likelihoods.
minTime | time window lower edge |
maxTime | time window upper edge |
Definition at line 817 of file PDFConstructor.cc.
|
inline |
Checks the object status.
Definition at line 112 of file PDFConstructor.h.
|
inlineprivate |
Returns the value of PDF normalized to the number of expected photons.
pixelID | pixel ID |
time | photon hit time |
timeErr | uncertainty of hit time |
sigt | additional time smearing |
Definition at line 573 of file PDFConstructor.h.
|
private |
Do forward raytracing of inverse raytracing solution in prism.
sol | solution of inverse raytracing in prism |
dL | step in length along trajectory for derivative calculation |
dFic | step in Cherenkov azimuthal angle for derivative calculation |
de | step in photon energy for derivative calculation |
Definition at line 653 of file PDFConstructor.cc.
|
private |
General solution of inverse raytracing in prism: iterative procedure calling basic solution.
pixel | pixel data |
k | index of unfolded prism exit window |
nx | number of reflections in x |
Definition at line 679 of file PDFConstructor.cc.
|
private |
Basic solution of inverse raytracing in prism: assuming straight line particle trajectory.
rD | unfolded pixel position |
L | emission position distance along particle trajectory |
Definition at line 701 of file PDFConstructor.cc.
|
private |
Returns photon propagation losses (bulk absorption, surface reflectivity, mirror reflectivity)
E | photon energy |
propLen | propagation length |
nx | total number of reflections in x |
ny | total number of reflections in y |
type | peak type, e.g. direct or reflected |
Definition at line 378 of file PDFConstructor.cc.
|
private |
Estimates range of unfolded x coordinate of the hits on given plane perpendicular to z-axis.
z | position of the plane |
xmi | lower limit [out] |
xma | upper limit [out] |
Definition at line 388 of file PDFConstructor.cc.
|
private |
Template function: sets signal PDF in a pixel column and for specific reflection in x.
t | template parameter of type InverseRaytracerDirect or InverseRaytracerReflected |
col | pixel column (0-based) |
xD | unfolded detection position in x |
zD | detection position in z |
Nxm | signed number of reflections in x before mirror (dummy for direct PDF) |
xmMin | lower limit of the reflection positions on the mirror (dummy for direct PDF) |
xmMax | upper limit of the reflection positions on the mirror (dummy for direct PDF) |
Definition at line 617 of file PDFConstructor.h.
|
private |
Sets signal PDF for reflected photons at given reflection number.
Nxm | reflection number in x before mirror |
xmMin | lower limit of the reflection positions on the mirror |
xmMax | upper limit of the reflection positions on the mirror |
Definition at line 172 of file PDFConstructor.cc.
|
inline |
Include or exclude delta-ray PDF in log likelihood calculation.
deltaPDFOn | true = include, false = exclude |
Definition at line 128 of file PDFConstructor.h.