Belle II Software development
PDFConstructor.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/TOPTrack.h>
12#include <top/reconstruction_cpp/InverseRaytracer.h>
13#include <top/reconstruction_cpp/FastRaytracer.h>
14#include <top/reconstruction_cpp/YScanner.h>
15#include <top/reconstruction_cpp/SignalPDF.h>
16#include <top/reconstruction_cpp/BackgroundPDF.h>
17#include <top/reconstruction_cpp/DeltaRayPDF.h>
18#include <top/geometry/TOPGeometryPar.h>
19#include <vector>
20#include <map>
21#include <set>
22#include <limits>
23
24namespace Belle2 {
29 namespace TOP {
30
35
36 public:
37
42 c_Rough = 0,
43 c_Fine = 1,
45 };
46
52 c_Full = 1
53 };
54
58 struct LogL {
59 double logL = 0;
60 double expPhotons = 0;
61 unsigned numPhotons = 0;
63
68 explicit LogL(double phot): logL(-phot), expPhotons(phot)
69 {}
70 };
71
75 struct Pull {
76 int pixelID = 0;
77 double time = 0;
78 double peakT0 = 0;
79 double ttsT0 = 0;
80 double sigma = 0;
81 double phiCer = 0;
82 double wt = 0;
83
94 Pull(int pix, double t, double t0, double tts0, double sig, double phi, double w):
95 pixelID(pix), time(t), peakT0(t0), ttsT0(tts0), sigma(sig), phiCer(phi), wt(w)
96 {}
97 };
98
107 PDFConstructor(const TOPTrack& track, const Const::ChargedStable& hypothesis,
108 EPDFOption PDFOption = c_Optimal, EStoreOption storeOption = c_Reduced, double overrideMass = 0);
109
114 bool isValid() const {return m_valid;}
115
119 void switchOffDeltaRayPDF() const {m_deltaPDFOn = false;}
120
124 void switchOnDeltaRayPDF() const {m_deltaPDFOn = true;}
125
130 void switchDeltaRayPDF(bool deltaPDFOn) const {m_deltaPDFOn = deltaPDFOn;}
131
136 int getModuleID() const {return m_moduleID;}
137
143
148 const std::vector<TOPTrack::SelectedHit>& getSelectedHits() const {return m_selectedHits;}
149
154 double getBkgRate() const {return m_bkgRate;}
155
160 double getCosTotal() const {return m_cosTotal;}
161
167 double getCosCerenkovAngle(double E) const;
168
173 const std::vector<SignalPDF>& getSignalPDF() const {return m_signalPDFs;}
174
180
185 const DeltaRayPDF& getDeltaRayPDF() const {return m_deltaRayPDF;}
186
192
198
205 {
206 double photons = m_bkgPhotons;
207 for (const auto* other : m_pdfOtherTracks) {
208 photons += other->getExpectedSignalPhotons() + other->getExpectedDeltaPhotons();
209 }
210 return photons;
211 }
212
221
228 double getExpectedSignalPhotons(double minTime, double maxTime) const
229 {
230 // the time window usually contains either all the PDF peaks or none of them,
231 // and then the sum over the pixels is known in advance
232 double ps = 0;
233 if (not m_hasPeaks) {
234 ; // no peaks at all: the sum stays zero
235 } else if (minTime <= m_minPeakT0 and maxTime >= m_maxPeakT0) {
236 ps = m_sumOfPeaks;
237 } else if (maxTime < m_minPeakT0 or minTime > m_maxPeakT0) {
238 ; // no peak is inside the window: the sum stays zero
239 } else {
240 for (const auto& signalPDF : m_signalPDFs) {
241 ps += signalPDF.getIntegral(minTime, maxTime);
242 }
243 }
244 return ps * m_signalPhotons;
245 }
246
253 double getExpectedDeltaPhotons(double minTime, double maxTime) const
254 {
255 return m_deltaPDFOn ? m_deltaRayPDF.getIntegral(minTime, maxTime) * m_deltaPhotons : 0;
256 }
257
265 double getExpectedBkgPhotons(double minTime, double maxTime) const
266 {
267 double photons = (maxTime - minTime) / (m_maxTime - m_minTime) * m_bkgPhotons;
268 for (const auto* other : m_pdfOtherTracks) {
269 photons += other->getExpectedSignalPhotons(minTime, maxTime) + other->getExpectedDeltaPhotons(minTime, maxTime);
270 }
271 return photons;
272 }
273
280 double getExpectedPhotons(double minTime, double maxTime) const
281 {
282 return getExpectedSignalPhotons(minTime, maxTime) + getExpectedDeltaPhotons(minTime, maxTime) +
283 getExpectedBkgPhotons(minTime, maxTime);
284 }
285
294 double getPDFValue(int pixelID, double time, double timeErr, double sigt = 0) const
295 {
296 return pdfValue(pixelID, time, timeErr, sigt) / getExpectedPhotons();
297 }
298
303 LogL getLogL() const;
304
311 LogL getLogL(double t0, double sigt = 0) const {return getLogL(t0, m_minTime, m_maxTime, sigt);}
312
321 LogL getLogL(double t0, double minTime, double maxTime, double sigt = 0) const;
322
328
335 LogL getBackgroundLogL(double minTime, double maxTime) const;
336
343 const std::vector<LogL>& getPixelLogLs(double t0, double sigt = 0) const
344 {return getPixelLogLs(t0, m_minTime, m_maxTime, sigt);}
345
354 const std::vector<LogL>& getPixelLogLs(double t0, double minTime, double maxTime, double sigt = 0) const;
355
360 const std::vector<Pull>& getPulls() const;
361
368
375
381 const std::map <double, YScanner::Derivatives>& getDerivatives() const {return m_derivatives;}
382
387 void appendPDFOther(const PDFConstructor* pdfOther)
388 {
389 if (not pdfOther) return;
390 m_pdfOtherTracks.push_back(pdfOther);
391 }
392
397
398
399 private:
400
405 double len = 0;
406 double L = 0;
407 double cosFic = 0;
408 double sinFic = 0;
409 };
410
417
427 int solve(double xD, double zD, int, double, double,
428 const TOPTrack::AssumedEmission& assumedEmission,
429 const InverseRaytracer::CerenkovAngle& cer, double step = 0) const
430 {
431 return inverseRaytracer->solveDirect(xD, zD, assumedEmission, cer, step);
432 }
433 };
434
441
454 int solve(double xD, double zD, int Nxm, double xmMin, double xmMax,
455 const TOPTrack::AssumedEmission& assumedEmission,
456 const InverseRaytracer::CerenkovAngle& cer, double step = 0) const
457 {
458 return inverseRaytracer->solveReflected(xD, zD, Nxm, xmMin, xmMax, assumedEmission, cer, step);
459 }
460 };
461
472 template<class T>
473 void setSignalPDF(T& t, unsigned col, double xD, double zD, int Nxm = 0, double xmMin = 0, double xmMax = 0);
474
481
485 void setSignalPDF();
486
490 void setSignalPDF_direct();
491
496
500 void setSignalPDF_prism();
501
508 void setSignalPDF_reflected(int Nxm, double xmMin, double xmMax);
509
518 bool detectionPositionX(double xM, int Nxm, std::vector<double>& xDs, double& minLen);
519
528 bool doRaytracingCorrections(const InverseRaytracer::Solution& sol, double dFic_dx, double xD);
529
537 double deltaXD(double dFic, const InverseRaytracer::Solution& sol, double xD);
538
547 bool setDerivatives(YScanner::Derivatives& D, double dL, double de, double dFic);
548
557 bool raytrace(const FastRaytracer& rayTracer, double dL = 0, double de = 0, double dFic = 0);
558
568 double propagationLosses(double E, double propLen, int nx, int ny, SignalPDF::EPeakType type) const;
569
576 void expandSignalPDF(unsigned col, const YScanner::Derivatives& D, SignalPDF::EPeakType type);
577
585 bool rangeOfX(double z, double& xmi, double& xma);
586
597 static double findReflectionExtreme(double xE, double zE, double zD, int Nxm, double A,
598 const RaytracerBase::Mirror& mirror);
599
610 static double derivativeOfReflectedX(double x, double xe, double ze, double zd);
611
620 bool prismRaytrace(const PrismSolution& sol, double dL = 0, double dFic = 0, double de = 0);
621
629 PrismSolution prismSolution(const PixelPositions::PixelData& pixel, unsigned k, int nx);
630
637 PrismSolution prismSolution(const ROOT::Math::XYZPoint& rD, double L);
638
647 double pdfValueSignal(int pixelID, double time, double timeErr, double sigt = 0) const;
648
657 double pdfValueSignalDelta(int pixelID, double time, double timeErr, double sigt = 0) const;
658
667 double pdfValue(int pixelID, double time, double timeErr, double sigt = 0) const;
668
674 void initializePixelLogLs(double minTime, double maxTime) const;
675
680 void appendPulls(const TOPTrack::SelectedHit& hit) const;
681
682 int m_moduleID = 0;
687 std::vector<FastRaytracer> m_rayTracers;
688 const YScanner* m_yScanner = 0;
693 bool m_valid = false;
694
695 double m_beta = 0;
696 double m_tof = 0;
697 double m_groupIndex = 0;
699 double m_cosTotal = 0;
700 double m_minTime = 0;
701 double m_maxTime = 0;
702 std::vector<TOPTrack::SelectedHit> m_selectedHits;
703 double m_bkgRate = 0;
704
705 std::vector<SignalPDF> m_signalPDFs;
706 double m_signalPhotons = 0;
707 bool m_hasPeaks = false;
708 double m_sumOfPeaks = 0;
709 double m_minPeakT0 = 0;
710 double m_maxPeakT0 = 0;
711 double m_bkgPhotons = 0;
712 double m_deltaPhotons = 0;
713
714 std::map<double, InverseRaytracer::CerenkovAngle> m_cerenkovAngles;
716 double m_dFic = 0;
717 double m_Fic = 0;
719 int m_ncallsSetPDF[3] = {0, 0, 0};
721 int m_ncallsExpandPDF[3] = {0, 0, 0};
722 mutable std::vector<LogL> m_pixelLLs;
723 mutable std::vector<Pull> m_pulls;
724 mutable bool m_deltaPDFOn = true;
725 std::map <double, YScanner::Derivatives> m_derivatives;
726 mutable std::set<int> m_zeroPixels;
727
728 std::vector<const PDFConstructor*> m_pdfOtherTracks;
729 mutable double m_f0 = 0;
730
731 };
732
733 //--- inline functions ------------------------------------------------------------
734
735 inline double PDFConstructor::pdfValueSignal(int pixelID, double time, double timeErr, double sigt) const
736 {
737 unsigned k = pixelID - 1;
738 if (k < m_signalPDFs.size() and m_valid) {
739 return m_signalPhotons * m_signalPDFs[k].getPDFValue(time, timeErr, sigt);
740 }
741 return 0;
742 }
743
744 inline double PDFConstructor::pdfValueSignalDelta(int pixelID, double time, double timeErr, double sigt) const
745 {
746 double f = pdfValueSignal(pixelID, time, timeErr, sigt);
747 if (m_deltaPDFOn) f += m_deltaPhotons * m_deltaRayPDF.getPDFValue(pixelID, time);
748 return f;
749 }
750
751 inline double PDFConstructor::pdfValue(int pixelID, double time, double timeErr, double sigt) const
752 {
753
754 if (not m_valid) return 0;
755
756 double f = pdfValueSignal(pixelID, time, timeErr, sigt); // signal
757 m_f0 = f;
758 if (m_deltaPDFOn) f += m_deltaPhotons * m_deltaRayPDF.getPDFValue(pixelID, time); // delta electrons
759 f += m_bkgPhotons * m_backgroundPDF->getPDFValue(pixelID); // uniform background
760 for (const auto* other : m_pdfOtherTracks) f += other->pdfValueSignalDelta(pixelID, time, timeErr, sigt); // other tracks
761
762 return f;
763 }
764
765 inline double PDFConstructor::deltaXD(double dFic, const InverseRaytracer::Solution& sol, double xD)
766 {
767 m_dFic = dFic;
768 m_fastRaytracer->propagate(m_inverseRaytracer->getReconstructedPhoton(sol, dFic), true);
769 if (not m_fastRaytracer->getPropagationStatus()) return std::numeric_limits<double>::quiet_NaN();
770 return m_fastRaytracer->getXD() - xD;
771 }
772
773 inline double PDFConstructor::getCosCerenkovAngle(double E) const
774 {
775 double refind = TOPGeometryPar::getPhaseIndex(E);
776 return std::min(1 / m_beta / refind, 1.0);
777 }
778
780 {
781 // dE = 0 is by far the most frequent argument, so it is kept out of the map
782 auto& cer = (dE == 0) ? m_cerenkovAngle0 : m_cerenkovAngles[dE];
783 if (cer.cosThc == 0 and cer.sinThc == 0) {
784 double meanE = m_yScanner->getMeanEnergy();
785 double cosThc = getCosCerenkovAngle(meanE + dE);
787 }
788 return cer;
789 }
790
791
792 template<class T>
793 void PDFConstructor::setSignalPDF(T& t, unsigned col, double xD, double zD, int Nxm, double xmMin, double xmMax)
794 {
795 m_ncallsSetPDF[t.type]++;
796
797 m_inverseRaytracer->clear();
798 t.inverseRaytracer = m_inverseRaytracer;
799
800 // central solutions
801
802 int i0 = t.solve(xD, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle());
803 if (i0 < 0 or not m_inverseRaytracer->getStatus()) return;
804 int n = 0;
805 for (unsigned i = 0; i < 2; i++) {
806 if (not m_inverseRaytracer->getStatus(i)) continue;
807 const auto& solutions = m_inverseRaytracer->getSolutions(i);
808 const auto& sol = solutions[i0];
809 double time = m_tof + sol.len * m_groupIndex / Const::speedOfLight;
810 if (time > m_maxTime + 1.0) continue;
811 n++;
812 }
813 if (n == 0) return;
814
815 // solutions with xD displaced by dx
816
817 double dx = 0.1; // cm
818 int i_dx = t.solve(xD + dx, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle(), dx);
819 if (i_dx < 0) return;
820 int k = 0;
821 while (m_inverseRaytracer->isNymDifferent()) { // get rid of discontinuities
822 if (k > 8) {
823 B2DEBUG(20, "TOP::PDFConstructor::setSignalPDF: failed to find the same Nym (dx)");
824 return;
825 }
826 dx = - dx / 2;
827 i_dx = t.solve(xD + dx, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle(), dx);
828 if (i_dx < 0) return;
829 k++;
830 }
831
832 // loop over the two solutions, do ray-tracing corrections, compute the derivatives and expand PDF in y
833
834 for (unsigned i = 0; i < 2; i++) {
835 if (not m_inverseRaytracer->getStatus(i)) continue;
836 const auto& solutions = m_inverseRaytracer->getSolutions(i);
837 const auto& sol = solutions[i0];
838 const auto& sol_dx = solutions[i_dx];
839
840 // compute dFic/dx needed in raytracing corrections
841
842 double dFic_dx = YScanner::Derivatives::dFic_d(sol, sol_dx);
843
844 // do raytracing corrections
845
846 m_dFic = 0;
847 bool ok = doRaytracingCorrections(sol, dFic_dx, xD);
848 if (not ok) continue;
849 m_Fic = sol.getFic() + m_dFic;
850
851 // check if time is still within the reconstruction range
852
853 double time = m_tof + m_fastRaytracer->getPropagationLen() * m_groupIndex / Const::speedOfLight;
854 if (time > m_maxTime) continue;
855
856 // compute the derivatives
857
859 ok = setDerivatives(D, 0.1, 0.1, 0.001);
860 if (not ok) {
861 B2DEBUG(20, "TOP::PDFConstructor::setSignalPDF: failed to determine derivatives: "
862 << LogVar("track momentum", m_track.getMomentumMag())
863 << LogVar("impact local z", m_track.getEmissionPoint().position.Z())
864 << LogVar("xD", xD)
865 << LogVar("Nxm", Nxm)
866 << LogVar("time", time)
867 << LogVar("peak type", t.type));
868 continue;
869 }
870 if (m_storeOption == c_Full) m_derivatives[xD] = D;
871
872 // expand PDF in y
873
874 expandSignalPDF(col, D, t.type);
875 }
876 }
877
878 } // namespace TOP
880} // namespace Belle2
R E
internal precision of FFTW codelets
Provides a type-safe way to pass members of the chargedStableSet set.
Definition Const.h:590
static const double speedOfLight
[cm/ns]
Definition Const.h:696
Parametrization of background PDF in pixels of single module.
Parametrization of delta-ray PDF in pixels of single module.
Definition DeltaRayPDF.h:27
Fast photon propagation in quartz optics.
Utility for solving inverse ray-tracing problem.
double m_cosTotal
cosine of total reflection angle
void setSignalPDF_prism()
Sets signal PDF for track crossing prism.
int m_ncallsExpandPDF[3]
number of calls to expandSignalPDF, indexed with SignalPDF::EPeakType
InverseRaytracer::CerenkovAngle m_cerenkovAngle0
sine and cosine of Cerenkov angle at dE = 0
void setSignalPDF()
Sets signal PDF.
double m_bkgRate
estimated background hit rate
LogL getLogL(double t0, double sigt=0) const
Returns extended log likelihood for PDF shifted in time.
double getPDFValue(int pixelID, double time, double timeErr, double sigt=0) const
Returns PDF value.
double m_beta
particle hypothesis beta
const BackgroundPDF * getBackgroundPDF() const
Returns background PDF.
const InverseRaytracer::CerenkovAngle & cerenkovAngle(double dE=0)
Returns cosine and sine of cerenkov angle.
int getNCalls_setPDF(SignalPDF::EPeakType type) const
Returns number of calls of template function setSignalPDF<T> for a given peak type.
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 poin...
double m_minPeakT0
position of the earliest PDF peak of all pixels [ns]
void switchOnDeltaRayPDF() const
Include delta-ray PDF in log likelihood calculation (this is default)
const YScanner * m_yScanner
PDF expander in y.
std::vector< SignalPDF > m_signalPDFs
parameterized signal PDF in pixels (index = pixelID - 1)
void setSignalPDF_reflected()
Sets signal PDF for reflected photons.
double getBkgRate() const
Returns estimated background hit rate.
LogL getBackgroundLogL() const
Returns extended log likelihood for background hypothesis using default time window.
double pdfValueSignal(int pixelID, double time, double timeErr, double sigt=0) const
Returns the value of signal PDF normalized to the number of expected photons.
void switchOffDeltaRayPDF() const
Exclude delta-ray PDF in log likelihood calculation.
PrismSolution prismSolution(const PixelPositions::PixelData &pixel, unsigned k, int nx)
General solution of inverse raytracing in prism: iterative procedure calling basic solution.
LogL getLogL() const
Returns extended log likelihood (using the default time window)
const std::vector< TOPTrack::SelectedHit > & getSelectedHits() const
Returns selected photon hits belonging to this slot.
double m_maxTime
time window upper edge
const InverseRaytracer * m_inverseRaytracer
inverse ray-tracer
double m_minTime
time window lower edge
double getExpectedDeltaPhotons() const
Returns the expected number of delta-ray photons within the default time window.
double getExpectedBkgPhotons(double minTime, double maxTime) const
Returns the expected number of background photons within a given time window.
bool isValid() const
Checks the object status.
const std::vector< SignalPDF > & getSignalPDF() const
Returns signal PDF.
EStoreOption m_storeOption
signal PDF storing option
double m_Fic
temporary storage for Cerenkov azimuthal angle
double m_sumOfPeaks
sum over the pixels of the normalized number of photons in all peaks
double getExpectedSignalPhotons() const
Returns the expected number of signal photons within the default time window.
bool m_hasPeaks
true if at least one pixel has a PDF peak
double getExpectedSignalPhotons(double minTime, double maxTime) const
Returns the expected number of signal photons within a given time window.
bool setDerivatives(YScanner::Derivatives &D, double dL, double de, double dFic)
Sets the derivatives (numerically) using forward ray-tracing.
double getExpectedDeltaPhotons(double minTime, double maxTime) const
Returns the expected number of delta-ray photons within a given time window.
double m_groupIndex
group refractive index at mean photon energy
int getNCalls_expandPDF(SignalPDF::EPeakType type) const
Returns number of calls of function expandSignalPDF for a given peak type.
std::vector< const PDFConstructor * > m_pdfOtherTracks
most probable PDF's of other tracks in the module
double m_bkgPhotons
expected number of uniform background photons
const std::vector< LogL > & getPixelLogLs(double t0, double sigt=0) const
Returns extended log likelihoods in pixels for PDF shifted in time.
double propagationLosses(double E, double propLen, int nx, int ny, SignalPDF::EPeakType type) const
Returns photon propagation losses (bulk absorption, surface reflectivity, mirror reflectivity)
int getModuleID() const
Returns slot ID.
double m_deltaPhotons
expected number of delta-ray photons
const std::vector< Pull > & getPulls() const
Returns photon pulls w.r.t PDF peaks.
double getCosCerenkovAngle(double E) const
Returns cosine of Cerenkov angle at given photon energy.
double m_maxPeakT0
position of the latest PDF peak of all pixels [ns]
double getCosTotal() const
Returns cosine of total reflection angle.
double m_signalPhotons
expected number of signal photons
static double derivativeOfReflectedX(double x, double xe, double ze, double zd)
Returns the derivative of reflected position at given x.
void appendPulls(const TOPTrack::SelectedHit &hit) const
Appends pulls of a photon hit.
double getExpectedPhotons() const
Returns the expected number of all photons within the default time window.
bool m_valid
cross-check flag, true if track is valid and all the pointers above are valid
DeltaRayPDF m_deltaRayPDF
delta-ray PDF
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.
bool doRaytracingCorrections(const InverseRaytracer::Solution &sol, double dFic_dx, double xD)
Corrects the solution of inverse ray-tracing with fast ray-tracing.
bool raytrace(const FastRaytracer &rayTracer, double dL=0, double de=0, double dFic=0)
Forward ray-tracing (called by setDerivatives)
std::vector< Pull > m_pulls
photon pulls w.r.t PDF peaks
const FastRaytracer * m_fastRaytracer
fast ray-tracer
const Const::ChargedStable & getHypothesis() const
Returns particle hypothesis.
EStoreOption
Options for storing signal PDF parameters.
@ c_Reduced
only PDF peak data
@ c_Full
also extra information and derivatives
const std::map< double, YScanner::Derivatives > & getDerivatives() const
Returns a collection of derivatives for debugging purposes.
static double findReflectionExtreme(double xE, double zE, double zD, int Nxm, double A, const RaytracerBase::Mirror &mirror)
Finds the position on the mirror of the extreme reflection.
const TOPTrack & m_track
temporary reference to track at TOP
std::vector< LogL > m_pixelLLs
pixel log likelihoods (index = pixelID - 1)
void appendPDFOther(const PDFConstructor *pdfOther)
Append most probable PDF of other track in this module.
EPDFOption m_PDFOption
signal PDF construction option
const BackgroundPDF * m_backgroundPDF
background PDF
bool m_deltaPDFOn
include/exclude delta-ray PDF in likelihood calculation
EPDFOption
Signal PDF construction options.
@ c_Optimal
y dependent only where necessary
@ c_Fine
y dependent everywhere
@ c_Rough
no dependence on y
std::map< double, InverseRaytracer::CerenkovAngle > m_cerenkovAngles
sine and cosine of Cerenkov angles for dE != 0
double pdfValue(int pixelID, double time, double timeErr, double sigt=0) const
Returns the value of PDF normalized to the number of expected photons.
void expandSignalPDF(unsigned col, const YScanner::Derivatives &D, SignalPDF::EPeakType type)
Expands signal PDF in y (y-scan)
std::vector< FastRaytracer > m_rayTracers
copies of fast ray-tracer used to compute derivatives
const Const::ChargedStable m_hypothesis
particle hypothesis
double getExpectedBkgPhotons() const
Returns the expected number of background photons within the default time window.
bool prismRaytrace(const PrismSolution &sol, double dL=0, double dFic=0, double de=0)
Do forward raytracing of inverse raytracing solution in prism.
void clearPDFOther()
Clear the container of PDF's of other tracks.
double m_groupIndexDerivative
derivative (dn_g/dE) of group refractive index at mean photon energy
double pdfValueSignalDelta(int pixelID, double time, double timeErr, double sigt=0) const
Returns the value of signal + deltaRay PDF normalized to the number of expected photons.
void switchDeltaRayPDF(bool deltaPDFOn) const
Include or exclude delta-ray PDF in log likelihood calculation.
const DeltaRayPDF & getDeltaRayPDF() const
Returns delta-ray PDF.
void initializePixelLogLs(double minTime, double maxTime) const
Initializes pixel log likelihoods.
bool rangeOfX(double z, double &xmi, double &xma)
Estimates range of unfolded x coordinate of the hits on given plane perpendicular to z-axis.
std::vector< TOPTrack::SelectedHit > m_selectedHits
selected photon hits
void setSignalPDF_direct()
Sets signal PDF for direct photons.
double getExpectedPhotons(double minTime, double maxTime) const
Returns the expected number of all photons within a given time window.
std::set< int > m_zeroPixels
collection of pixelID's with zero pdfValue
std::map< double, YScanner::Derivatives > m_derivatives
a map of xD and derivatives
double m_f0
temporary value of signal PDF
double m_dFic
temporary storage for dFic used in last call to deltaXD
int m_ncallsSetPDF[3]
number of calls to setSignalPDF<T>, indexed with SignalPDF::EPeakType
double m_tof
time-of-flight from IP to average photon emission position
PDFConstructor(const TOPTrack &track, const Const::ChargedStable &hypothesis, EPDFOption PDFOption=c_Optimal, EStoreOption storeOption=c_Reduced, double overrideMass=0)
Class constructor.
EPeakType
Enumerator for single PDF peak types.
Definition SignalPDF.h:34
@ c_Direct
direct photon
Definition SignalPDF.h:36
@ c_Reflected
reflected photon
Definition SignalPDF.h:37
static double getPhaseIndex(double energy)
Returns phase refractive index of quartz at given photon energy.
Reconstructed track at TOP.
Definition TOPTrack.h:41
Utility for expanding the PDF in y direction.
Definition YScanner.h:35
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.
Sine and cosine of Cerenkov angle.
Solution of inverse ray-tracing.
Structure that enables defining a template function: direct photons.
const SignalPDF::EPeakType type
PDF peak type.
int solve(double xD, double zD, int, double, double, const TOPTrack::AssumedEmission &assumedEmission, const InverseRaytracer::CerenkovAngle &cer, double step=0) const
Solve inverse ray-tracing for direct photon.
const InverseRaytracer * inverseRaytracer
inverse ray-tracer
Structure that enables defining a template function: reflected photons.
const SignalPDF::EPeakType type
PDF peak type.
int solve(double xD, double zD, int Nxm, double xmMin, double xmMax, const TOPTrack::AssumedEmission &assumedEmission, const InverseRaytracer::CerenkovAngle &cer, double step=0) const
Solve inverse ray-tracing for reflected photon.
const InverseRaytracer * inverseRaytracer
inverse ray-tracer
Useful data type for returning the results of log likelihood calculation.
double expPhotons
expected number of photons
double effectiveSignalYield
effective number of signal photons in data
LogL(double phot)
Constructor.
unsigned numPhotons
detected number of photons
double logL
extended log likelihood
Solution of inverse raytracing in prism.
double L
emission position distance along particle trajectory
double cosFic
cosine of azimuthal Cerenkov angle
double sinFic
sine of azimuthal Cerenkov angle
double sigma
peak overall sigma (signal) or 0 (background)
double peakT0
PDF peak time (signal) or minimal PDF peak time in pixel (background)
double ttsT0
TTS gaussian peak time (signal) or 0 (background)
Pull(int pix, double t, double t0, double tts0, double sig, double phi, double w)
Constructor.
double phiCer
azimuthal Cerenkov angle (signal) or 0 (background)
position and size of a pixel
spherical mirror data in module local frame.
assumed photon emission point in local frame
Definition TOPTrack.h:76
selected photon hit from TOPDigits
Definition TOPTrack.h:85
static double dFic_d(const InverseRaytracer::Solution &sol0, const InverseRaytracer::Solution &sol1)
Calculates the derivative of Cerenkov azimuthal angle.
Definition YScanner.h:571