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,
44 c_Optimal = 2
45 };
46
52 c_Full = 1
53 };
54
58 struct LogL {
59 double logL = 0;
60 double expPhotons = 0;
61 unsigned numPhotons = 0;
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;
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
217 double getExpectedPhotons() const
218 {
220 }
221
228 double getExpectedSignalPhotons(double minTime, double maxTime) const
229 {
230 double ps = 0;
231 for (const auto& signalPDF : m_signalPDFs) {
232 ps += signalPDF.getIntegral(minTime, maxTime);
233 }
234 return ps * m_signalPhotons;
235 }
236
243 double getExpectedDeltaPhotons(double minTime, double maxTime) const
244 {
245 return m_deltaPDFOn ? m_deltaRayPDF.getIntegral(minTime, maxTime) * m_deltaPhotons : 0;
246 }
247
255 double getExpectedBkgPhotons(double minTime, double maxTime) const
256 {
257 double photons = (maxTime - minTime) / (m_maxTime - m_minTime) * m_bkgPhotons;
258 for (const auto* other : m_pdfOtherTracks) {
259 photons += other->getExpectedSignalPhotons(minTime, maxTime) + other->getExpectedDeltaPhotons(minTime, maxTime);
260 }
261 return photons;
262 }
263
270 double getExpectedPhotons(double minTime, double maxTime) const
271 {
272 return getExpectedSignalPhotons(minTime, maxTime) + getExpectedDeltaPhotons(minTime, maxTime) +
273 getExpectedBkgPhotons(minTime, maxTime);
274 }
275
284 double getPDFValue(int pixelID, double time, double timeErr, double sigt = 0) const
285 {
286 return pdfValue(pixelID, time, timeErr, sigt) / getExpectedPhotons();
287 }
288
293 LogL getLogL() const;
294
301 LogL getLogL(double t0, double sigt = 0) const {return getLogL(t0, m_minTime, m_maxTime, sigt);}
302
311 LogL getLogL(double t0, double minTime, double maxTime, double sigt = 0) const;
312
318
325 LogL getBackgroundLogL(double minTime, double maxTime) const;
326
333 const std::vector<LogL>& getPixelLogLs(double t0, double sigt = 0) const
334 {return getPixelLogLs(t0, m_minTime, m_maxTime, sigt);}
335
344 const std::vector<LogL>& getPixelLogLs(double t0, double minTime, double maxTime, double sigt = 0) const;
345
350 const std::vector<Pull>& getPulls() const;
351
358
365
371 const std::map <double, YScanner::Derivatives>& getDerivatives() const {return m_derivatives;}
372
377 void appendPDFOther(const PDFConstructor* pdfOther)
378 {
379 if (not pdfOther) return;
380 m_pdfOtherTracks.push_back(pdfOther);
381 }
382
387
388
389 private:
390
395 double len = 0;
396 double L = 0;
397 double cosFic = 0;
398 double sinFic = 0;
399 };
400
417 int solve(double xD, double zD, int, double, double,
418 const TOPTrack::AssumedEmission& assumedEmission,
419 const InverseRaytracer::CerenkovAngle& cer, double step = 0) const
420 {
421 return inverseRaytracer->solveDirect(xD, zD, assumedEmission, cer, step);
422 }
423 };
424
444 int solve(double xD, double zD, int Nxm, double xmMin, double xmMax,
445 const TOPTrack::AssumedEmission& assumedEmission,
446 const InverseRaytracer::CerenkovAngle& cer, double step = 0) const
447 {
448 return inverseRaytracer->solveReflected(xD, zD, Nxm, xmMin, xmMax, assumedEmission, cer, step);
449 }
450 };
451
462 template<class T>
463 void setSignalPDF(T& t, unsigned col, double xD, double zD, int Nxm = 0, double xmMin = 0, double xmMax = 0);
464
471
475 void setSignalPDF();
476
480 void setSignalPDF_direct();
481
486
490 void setSignalPDF_prism();
491
498 void setSignalPDF_reflected(int Nxm, double xmMin, double xmMax);
499
508 bool detectionPositionX(double xM, int Nxm, std::vector<double>& xDs, double& minLen);
509
518 bool doRaytracingCorrections(const InverseRaytracer::Solution& sol, double dFic_dx, double xD);
519
527 double deltaXD(double dFic, const InverseRaytracer::Solution& sol, double xD);
528
537 bool setDerivatives(YScanner::Derivatives& D, double dL, double de, double dFic);
538
547 bool raytrace(const FastRaytracer& rayTracer, double dL = 0, double de = 0, double dFic = 0);
548
558 double propagationLosses(double E, double propLen, int nx, int ny, SignalPDF::EPeakType type) const;
559
566 void expandSignalPDF(unsigned col, const YScanner::Derivatives& D, SignalPDF::EPeakType type);
567
575 bool rangeOfX(double z, double& xmi, double& xma);
576
587 double findReflectionExtreme(double xE, double zE, double zD, int Nxm, double A,
588 const RaytracerBase::Mirror& mirror) const;
589
600 double derivativeOfReflectedX(double x, double xe, double ze, double zd) const;
601
610 bool prismRaytrace(const PrismSolution& sol, double dL = 0, double dFic = 0, double de = 0);
611
619 PrismSolution prismSolution(const PixelPositions::PixelData& pixel, unsigned k, int nx);
620
627 PrismSolution prismSolution(const ROOT::Math::XYZPoint& rD, double L);
628
637 double pdfValueSignal(int pixelID, double time, double timeErr, double sigt = 0) const;
638
647 double pdfValueSignalDelta(int pixelID, double time, double timeErr, double sigt = 0) const;
648
657 double pdfValue(int pixelID, double time, double timeErr, double sigt = 0) const;
658
664 void initializePixelLogLs(double minTime, double maxTime) const;
665
670 void appendPulls(const TOPTrack::SelectedHit& hit) const;
671
672 int m_moduleID = 0;
677 std::vector<FastRaytracer> m_rayTracers;
678 const YScanner* m_yScanner = 0;
683 bool m_valid = false;
685 double m_beta = 0;
686 double m_tof = 0;
687 double m_groupIndex = 0;
689 double m_cosTotal = 0;
690 double m_minTime = 0;
691 double m_maxTime = 0;
692 std::vector<TOPTrack::SelectedHit> m_selectedHits;
693 double m_bkgRate = 0;
695 std::vector<SignalPDF> m_signalPDFs;
696 double m_signalPhotons = 0;
697 double m_bkgPhotons = 0;
698 double m_deltaPhotons = 0;
700 std::map<double, InverseRaytracer::CerenkovAngle> m_cerenkovAngles;
701 double m_dFic = 0;
702 double m_Fic = 0;
703 mutable std::map <SignalPDF::EPeakType, int> m_ncallsSetPDF;
704 mutable std::map <SignalPDF::EPeakType, int> m_ncallsExpandPDF;
705 mutable std::vector<LogL> m_pixelLLs;
706 mutable std::vector<Pull> m_pulls;
707 mutable bool m_deltaPDFOn = true;
708 std::map <double, YScanner::Derivatives> m_derivatives;
709 mutable std::set<int> m_zeroPixels;
711 std::vector<const PDFConstructor*> m_pdfOtherTracks;
712 mutable double m_f0 = 0;
714 };
715
716 //--- inline functions ------------------------------------------------------------
717
718 inline double PDFConstructor::pdfValueSignal(int pixelID, double time, double timeErr, double sigt) const
719 {
720 unsigned k = pixelID - 1;
721 if (k < m_signalPDFs.size() and m_valid) {
722 return m_signalPhotons * m_signalPDFs[k].getPDFValue(time, timeErr, sigt);
723 }
724 return 0;
725 }
726
727 inline double PDFConstructor::pdfValueSignalDelta(int pixelID, double time, double timeErr, double sigt) const
728 {
729 double f = pdfValueSignal(pixelID, time, timeErr, sigt);
730 if (m_deltaPDFOn) f += m_deltaPhotons * m_deltaRayPDF.getPDFValue(pixelID, time);
731 return f;
732 }
733
734 inline double PDFConstructor::pdfValue(int pixelID, double time, double timeErr, double sigt) const
735 {
736
737 if (not m_valid) return 0;
738
739 double f = pdfValueSignal(pixelID, time, timeErr, sigt); // signal
740 m_f0 = f;
741 if (m_deltaPDFOn) f += m_deltaPhotons * m_deltaRayPDF.getPDFValue(pixelID, time); // delta electrons
742 f += m_bkgPhotons * m_backgroundPDF->getPDFValue(pixelID); // uniform background
743 for (const auto* other : m_pdfOtherTracks) f += other->pdfValueSignalDelta(pixelID, time, timeErr, sigt); // other tracks
744
745 return f;
746 }
747
748 inline double PDFConstructor::deltaXD(double dFic, const InverseRaytracer::Solution& sol, double xD)
749 {
750 m_dFic = dFic;
752 if (not m_fastRaytracer->getPropagationStatus()) return std::numeric_limits<double>::quiet_NaN();
753 return m_fastRaytracer->getXD() - xD;
754 }
755
756 inline double PDFConstructor::getCosCerenkovAngle(double E) const
757 {
758 double refind = TOPGeometryPar::Instance()->getPhaseIndex(E);
759 return std::min(1 / m_beta / refind, 1.0);
760 }
761
763 {
764 auto& cer = m_cerenkovAngles[dE];
765 if (cer.cosThc == 0 and cer.sinThc == 0) {
766 double meanE = m_yScanner->getMeanEnergy();
767 double cosThc = getCosCerenkovAngle(meanE + dE);
769 }
770 return cer;
771 }
772
773
774 template<class T>
775 void PDFConstructor::setSignalPDF(T& t, unsigned col, double xD, double zD, int Nxm, double xmMin, double xmMax)
776 {
777 m_ncallsSetPDF[t.type]++;
778
780 t.inverseRaytracer = m_inverseRaytracer;
781
782 // central solutions
783
784 int i0 = t.solve(xD, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle());
785 if (i0 < 0 or not m_inverseRaytracer->getStatus()) return;
786 int n = 0;
787 for (unsigned i = 0; i < 2; i++) {
788 if (not m_inverseRaytracer->getStatus(i)) continue;
789 const auto& solutions = m_inverseRaytracer->getSolutions(i);
790 const auto& sol = solutions[i0];
791 double time = m_tof + sol.len * m_groupIndex / Const::speedOfLight;
792 if (time > m_maxTime + 1.0) continue;
793 n++;
794 }
795 if (n == 0) return;
796
797 // solutions with xD displaced by dx
798
799 double dx = 0.1; // cm
800 int i_dx = t.solve(xD + dx, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle(), dx);
801 if (i_dx < 0) return;
802 int k = 0;
803 while (m_inverseRaytracer->isNymDifferent()) { // get rid of discontinuities
804 if (k > 8) {
805 B2DEBUG(20, "TOP::PDFConstructor::setSignalPDF: failed to find the same Nym (dx)");
806 return;
807 }
808 dx = - dx / 2;
809 i_dx = t.solve(xD + dx, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle(), dx);
810 if (i_dx < 0) return;
811 k++;
812 }
813
814 // loop over the two solutions, do ray-tracing corrections, compute the derivatives and expand PDF in y
815
816 for (unsigned i = 0; i < 2; i++) {
817 if (not m_inverseRaytracer->getStatus(i)) continue;
818 const auto& solutions = m_inverseRaytracer->getSolutions(i);
819 const auto& sol = solutions[i0];
820 const auto& sol_dx = solutions[i_dx];
821
822 // compute dFic/dx needed in raytracing corrections
823
824 double dFic_dx = YScanner::Derivatives::dFic_d(sol, sol_dx);
825
826 // do raytracing corrections
827
828 m_dFic = 0;
829 bool ok = doRaytracingCorrections(sol, dFic_dx, xD);
830 if (not ok) continue;
831 m_Fic = sol.getFic() + m_dFic;
832
833 // check if time is still within the reconstruction range
834
836 if (time > m_maxTime) continue;
837
838 // compute the derivatives
839
841 ok = setDerivatives(D, 0.1, 0.1, 0.001);
842 if (not ok) {
843 B2DEBUG(20, "TOP::PDFConstructor::setSignalPDF: failed to determine derivatives: "
844 << LogVar("track momentum", m_track.getMomentumMag())
845 << LogVar("impact local z", m_track.getEmissionPoint().position.Z())
846 << LogVar("xD", xD)
847 << LogVar("Nxm", Nxm)
848 << LogVar("time", time)
849 << LogVar("peak type", t.type));
850 continue;
851 }
852 if (m_storeOption == c_Full) m_derivatives[xD] = D;
853
854 // expand PDF in y
855
856 expandSignalPDF(col, D, t.type);
857 }
858 }
859
860 } // namespace TOP
862} // namespace Belle2
R E
internal precision of FFTW codelets
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:589
static const double speedOfLight
[cm/ns]
Definition: Const.h:695
Parametrization of background PDF in pixels of single module.
Definition: BackgroundPDF.h:23
double getPDFValue(int pixelID) const
Returns PDF value for given pixel.
Parametrization of delta-ray PDF in pixels of single module.
Definition: DeltaRayPDF.h:27
double getIntegral(double minTime, double maxTime) const
Returns integral of PDF from minTime to maxTime.
Definition: DeltaRayPDF.h:213
double getPDFValue(int pixelID, double time) const
Returns PDF value at given time and pixel.
Definition: DeltaRayPDF.cc:113
Fast photon propagation in quartz optics.
Definition: FastRaytracer.h:26
double getPropagationLen() const
Returns total propagation length since initial position.
void propagate(const PhotonState &photon, bool averaging=false) const
Propagate photon to photo-detector plane.
bool getPropagationStatus() const
Returns propagation status.
Definition: FastRaytracer.h:68
double getXD() const
Returns unfolded position in x at virtual Detector plane.
Utility for solving inverse ray-tracing problem.
int solveReflected(double xD, double zD, int Nxm, double xmMin, double xmMax, const TOPTrack::AssumedEmission &assumedEmission, const CerenkovAngle &cer, double step=0) const
Solve inverse ray-tracing for reflected photon.
PhotonState getReconstructedPhoton(const Solution &sol, double DFic=0) const
Returns reconstructed photon at emission for a given solution of inverse raytracing.
bool getStatus() const
Returns status.
bool isNymDifferent() const
Checks if Nym differs between solutions front and back in at least one of the vectors.
std::vector< Solution > & getSolutions(unsigned i) const
Returns the solutions of inverse ray-tracing.
int solveDirect(double xD, double zD, const TOPTrack::AssumedEmission &assumedEmission, const CerenkovAngle &cer, double step=0) const
Solve inverse ray-tracing for direct photon.
void clear() const
Clear the solutions to prepare for the new round.
PDF construction and log likelihood determination for a given track and particle hypothesis.
double m_cosTotal
cosine of total reflection angle
void setSignalPDF_prism()
Sets signal PDF for track crossing prism.
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...
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.
std::map< SignalPDF::EPeakType, int > m_ncallsSetPDF
number of calls to setSignalPDF<T>
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 getExpectedSignalPhotons() const
Returns the expected number of signal photons within the default time window.
double getExpectedSignalPhotons(double minTime, double maxTime) const
Returns the expected number of signal photons within a given time window.
double derivativeOfReflectedX(double x, double xe, double ze, double zd) const
Returns the derivative of reflected position at given x.
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 getCosTotal() const
Returns cosine of total reflection angle.
double m_signalPhotons
expected number of signal photons
std::map< SignalPDF::EPeakType, int > m_ncallsExpandPDF
number of calls to expandSignalPDF
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
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.
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.
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
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
double m_tof
time-of-flight from IP to average photon emission position
EPeakType
Enumerator for single PDF peak types.
Definition: SignalPDF.h:32
@ c_Direct
direct photon
Definition: SignalPDF.h:34
@ c_Reflected
reflected photon
Definition: SignalPDF.h:35
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.
Reconstructed track at TOP.
Definition: TOPTrack.h:39
const TOPTrack::AssumedEmission & getEmissionPoint(double dL=0) const
Returns assumed photon emission position and track direction.
Definition: TOPTrack.cc:357
double getMomentumMag() const
Returns momentum magnitude (extrapolated to TOP)
Definition: TOPTrack.h:149
Utility for expanding the PDF in y direction.
Definition: YScanner.h:33
double getMeanEnergy() const
Returns mean photon energy.
Definition: YScanner.h:329
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
Data type for storing photon pull w.r.t PDF peak.
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.
Definition: RaytracerBase.h:80
assumed photon emission point in local frame
Definition: TOPTrack.h:74
ROOT::Math::XYZPoint position
position
Definition: TOPTrack.h:75
selected photon hit from TOPDigits
Definition: TOPTrack.h:83
static double dFic_d(const InverseRaytracer::Solution &sol0, const InverseRaytracer::Solution &sol1)
Calculates the derivative of Cerenkov azimuthal angle.
Definition: YScanner.h:501