Belle II Software  release-08-01-10
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 
24 namespace Belle2 {
29  namespace TOP {
30 
35 
36  public:
37 
41  enum EPDFOption {
42  c_Rough = 0,
43  c_Fine = 1,
44  c_Optimal = 2
45  };
46 
50  enum EStoreOption {
51  c_Reduced = 0,
52  c_Full = 1
53  };
54 
58  struct LogL {
59  double logL = 0;
60  double expPhotons = 0;
61  unsigned numPhotons = 0;
67  explicit LogL(double phot): logL(-phot), expPhotons(phot)
68  {}
69  };
70 
74  struct Pull {
75  int pixelID = 0;
76  double time = 0;
77  double peakT0 = 0;
78  double ttsT0 = 0;
79  double sigma = 0;
80  double phiCer = 0;
81  double wt = 0;
93  Pull(int pix, double t, double t0, double tts0, double sig, double phi, double w):
94  pixelID(pix), time(t), peakT0(t0), ttsT0(tts0), sigma(sig), phiCer(phi), wt(w)
95  {}
96  };
97 
106  PDFConstructor(const TOPTrack& track, const Const::ChargedStable& hypothesis,
107  EPDFOption PDFOption = c_Optimal, EStoreOption storeOption = c_Reduced, double overrideMass = 0);
108 
113  bool isValid() const {return m_valid;}
114 
118  void switchOffDeltaRayPDF() const {m_deltaPDFOn = false;}
119 
123  void switchOnDeltaRayPDF() const {m_deltaPDFOn = true;}
124 
129  void switchDeltaRayPDF(bool deltaPDFOn) const {m_deltaPDFOn = deltaPDFOn;}
130 
135  int getModuleID() const {return m_moduleID;}
136 
142 
147  const std::vector<TOPTrack::SelectedHit>& getSelectedHits() const {return m_selectedHits;}
148 
153  double getBkgRate() const {return m_bkgRate;}
154 
159  double getCosTotal() const {return m_cosTotal;}
160 
166  double getCosCerenkovAngle(double E) const;
167 
172  const std::vector<SignalPDF>& getSignalPDF() const {return m_signalPDFs;}
173 
179 
184  const DeltaRayPDF& getDeltaRayPDF() const {return m_deltaRayPDF;}
185 
190  double getExpectedSignalPhotons() const {return m_signalPhotons;}
191 
196  double getExpectedDeltaPhotons() const {return m_deltaPDFOn ? m_deltaPhotons : 0;}
197 
203  double getExpectedBkgPhotons() const
204  {
205  double photons = m_bkgPhotons;
206  for (const auto* other : m_pdfOtherTracks) {
207  photons += other->getExpectedSignalPhotons() + other->getExpectedDeltaPhotons();
208  }
209  return photons;
210  }
211 
216  double getExpectedPhotons() const
217  {
219  }
220 
227  double getExpectedSignalPhotons(double minTime, double maxTime) const
228  {
229  double ps = 0;
230  for (const auto& signalPDF : m_signalPDFs) {
231  ps += signalPDF.getIntegral(minTime, maxTime);
232  }
233  return ps * m_signalPhotons;
234  }
235 
242  double getExpectedDeltaPhotons(double minTime, double maxTime) const
243  {
244  return m_deltaPDFOn ? m_deltaRayPDF.getIntegral(minTime, maxTime) * m_deltaPhotons : 0;
245  }
246 
254  double getExpectedBkgPhotons(double minTime, double maxTime) const
255  {
256  double photons = (maxTime - minTime) / (m_maxTime - m_minTime) * m_bkgPhotons;
257  for (const auto* other : m_pdfOtherTracks) {
258  photons += other->getExpectedSignalPhotons(minTime, maxTime) + other->getExpectedDeltaPhotons(minTime, maxTime);
259  }
260  return photons;
261  }
262 
269  double getExpectedPhotons(double minTime, double maxTime) const
270  {
271  return getExpectedSignalPhotons(minTime, maxTime) + getExpectedDeltaPhotons(minTime, maxTime) +
272  getExpectedBkgPhotons(minTime, maxTime);
273  }
274 
283  double getPDFValue(int pixelID, double time, double timeErr, double sigt = 0) const
284  {
285  return pdfValue(pixelID, time, timeErr, sigt) / getExpectedPhotons();
286  }
287 
292  LogL getLogL() const;
293 
300  LogL getLogL(double t0, double sigt = 0) const {return getLogL(t0, m_minTime, m_maxTime, sigt);}
301 
310  LogL getLogL(double t0, double minTime, double maxTime, double sigt = 0) const;
311 
317 
324  LogL getBackgroundLogL(double minTime, double maxTime) const;
325 
332  const std::vector<LogL>& getPixelLogLs(double t0, double sigt = 0) const
333  {return getPixelLogLs(t0, m_minTime, m_maxTime, sigt);}
334 
343  const std::vector<LogL>& getPixelLogLs(double t0, double minTime, double maxTime, double sigt = 0) const;
344 
349  const std::vector<Pull>& getPulls() const;
350 
356  int getNCalls_setPDF(SignalPDF::EPeakType type) const {return m_ncallsSetPDF[type];}
357 
364 
370  const std::map <double, YScanner::Derivatives>& getDerivatives() const {return m_derivatives;}
371 
376  void appendPDFOther(const PDFConstructor* pdfOther)
377  {
378  if (not pdfOther) return;
379  m_pdfOtherTracks.push_back(pdfOther);
380  }
381 
385  void clearPDFOther() {m_pdfOtherTracks.clear();}
386 
387 
388  private:
389 
393  struct PrismSolution {
394  double len = 0;
395  double L = 0;
396  double cosFic = 0;
397  double sinFic = 0;
398  };
399 
416  int solve(double xD, double zD, int, double, double,
417  const TOPTrack::AssumedEmission& assumedEmission,
418  const InverseRaytracer::CerenkovAngle& cer, double step = 0) const
419  {
420  return inverseRaytracer->solveDirect(xD, zD, assumedEmission, cer, step);
421  }
422  };
423 
443  int solve(double xD, double zD, int Nxm, double xmMin, double xmMax,
444  const TOPTrack::AssumedEmission& assumedEmission,
445  const InverseRaytracer::CerenkovAngle& cer, double step = 0) const
446  {
447  return inverseRaytracer->solveReflected(xD, zD, Nxm, xmMin, xmMax, assumedEmission, cer, step);
448  }
449  };
450 
461  template<class T>
462  void setSignalPDF(T& t, unsigned col, double xD, double zD, int Nxm = 0, double xmMin = 0, double xmMax = 0);
463 
469  const InverseRaytracer::CerenkovAngle& cerenkovAngle(double dE = 0);
470 
474  void setSignalPDF();
475 
479  void setSignalPDF_direct();
480 
484  void setSignalPDF_reflected();
485 
489  void setSignalPDF_prism();
490 
497  void setSignalPDF_reflected(int Nxm, double xmMin, double xmMax);
498 
507  bool detectionPositionX(double xM, int Nxm, std::vector<double>& xDs, double& minLen);
508 
517  bool doRaytracingCorrections(const InverseRaytracer::Solution& sol, double dFic_dx, double xD);
518 
526  double deltaXD(double dFic, const InverseRaytracer::Solution& sol, double xD);
527 
536  bool setDerivatives(YScanner::Derivatives& D, double dL, double de, double dFic);
537 
546  bool raytrace(const FastRaytracer& rayTracer, double dL = 0, double de = 0, double dFic = 0);
547 
557  double propagationLosses(double E, double propLen, int nx, int ny, SignalPDF::EPeakType type) const;
558 
565  void expandSignalPDF(unsigned col, const YScanner::Derivatives& D, SignalPDF::EPeakType type);
566 
574  bool rangeOfX(double z, double& xmi, double& xma);
575 
586  double findReflectionExtreme(double xE, double zE, double zD, int Nxm, double A,
587  const RaytracerBase::Mirror& mirror) const;
588 
599  double derivativeOfReflectedX(double x, double xe, double ze, double zd) const;
600 
609  bool prismRaytrace(const PrismSolution& sol, double dL = 0, double dFic = 0, double de = 0);
610 
618  PrismSolution prismSolution(const PixelPositions::PixelData& pixel, unsigned k, int nx);
619 
626  PrismSolution prismSolution(const ROOT::Math::XYZPoint& rD, double L);
627 
636  double pdfValueSignalDelta(int pixelID, double time, double timeErr, double sigt = 0) const;
637 
646  double pdfValue(int pixelID, double time, double timeErr, double sigt = 0) const;
647 
653  void initializePixelLogLs(double minTime, double maxTime) const;
654 
659  void appendPulls(const TOPTrack::SelectedHit& hit) const;
660 
661  int m_moduleID = 0;
662  const TOPTrack& m_track;
666  std::vector<FastRaytracer> m_rayTracers;
667  const YScanner* m_yScanner = 0;
672  bool m_valid = false;
674  double m_beta = 0;
675  double m_tof = 0;
676  double m_groupIndex = 0;
678  double m_cosTotal = 0;
679  double m_minTime = 0;
680  double m_maxTime = 0;
681  std::vector<TOPTrack::SelectedHit> m_selectedHits;
682  double m_bkgRate = 0;
684  std::vector<SignalPDF> m_signalPDFs;
685  double m_signalPhotons = 0;
686  double m_bkgPhotons = 0;
687  double m_deltaPhotons = 0;
689  std::map<double, InverseRaytracer::CerenkovAngle> m_cerenkovAngles;
690  double m_dFic = 0;
691  double m_Fic = 0;
692  mutable std::map <SignalPDF::EPeakType, int> m_ncallsSetPDF;
693  mutable std::map <SignalPDF::EPeakType, int> m_ncallsExpandPDF;
694  mutable std::vector<LogL> m_pixelLLs;
695  mutable std::vector<Pull> m_pulls;
696  mutable bool m_deltaPDFOn = true;
697  std::map <double, YScanner::Derivatives> m_derivatives;
698  mutable std::set<int> m_zeroPixels;
700  std::vector<const PDFConstructor*> m_pdfOtherTracks;
702  };
703 
704  //--- inline functions ------------------------------------------------------------
705 
706  inline double PDFConstructor::pdfValueSignalDelta(int pixelID, double time, double timeErr, double sigt) const
707  {
708  unsigned k = pixelID - 1;
709  if (k < m_signalPDFs.size() and m_valid) {
710  double f = m_signalPhotons * m_signalPDFs[k].getPDFValue(time, timeErr, sigt);
711  if (m_deltaPDFOn) f += m_deltaPhotons * m_deltaRayPDF.getPDFValue(pixelID, time);
712  return f;
713  }
714  return 0;
715  }
716 
717  inline double PDFConstructor::pdfValue(int pixelID, double time, double timeErr, double sigt) const
718  {
719 
720  if (not m_valid) return 0;
721 
722  double f = pdfValueSignalDelta(pixelID, time, timeErr, sigt); // signal
723  f += m_bkgPhotons * m_backgroundPDF->getPDFValue(pixelID); // uniform background
724  for (const auto* other : m_pdfOtherTracks) f += other->pdfValueSignalDelta(pixelID, time, timeErr, sigt); // other tracks
725 
726  return f;
727  }
728 
729  inline double PDFConstructor::deltaXD(double dFic, const InverseRaytracer::Solution& sol, double xD)
730  {
731  m_dFic = dFic;
733  if (not m_fastRaytracer->getPropagationStatus()) return std::numeric_limits<double>::quiet_NaN();
734  return m_fastRaytracer->getXD() - xD;
735  }
736 
737  inline double PDFConstructor::getCosCerenkovAngle(double E) const
738  {
739  double refind = TOPGeometryPar::Instance()->getPhaseIndex(E);
740  return std::min(1 / m_beta / refind, 1.0);
741  }
742 
744  {
745  auto& cer = m_cerenkovAngles[dE];
746  if (cer.cosThc == 0 and cer.sinThc == 0) {
747  double meanE = m_yScanner->getMeanEnergy();
748  double cosThc = getCosCerenkovAngle(meanE + dE);
749  cer = InverseRaytracer::CerenkovAngle(cosThc);
750  }
751  return cer;
752  }
753 
754 
755  template<class T>
756  void PDFConstructor::setSignalPDF(T& t, unsigned col, double xD, double zD, int Nxm, double xmMin, double xmMax)
757  {
758  m_ncallsSetPDF[t.type]++;
759 
761  t.inverseRaytracer = m_inverseRaytracer;
762 
763  // central solutions
764 
765  int i0 = t.solve(xD, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle());
766  if (i0 < 0 or not m_inverseRaytracer->getStatus()) return;
767  int n = 0;
768  for (unsigned i = 0; i < 2; i++) {
769  if (not m_inverseRaytracer->getStatus(i)) continue;
770  const auto& solutions = m_inverseRaytracer->getSolutions(i);
771  const auto& sol = solutions[i0];
772  double time = m_tof + sol.len * m_groupIndex / Const::speedOfLight;
773  if (time > m_maxTime + 1.0) continue;
774  n++;
775  }
776  if (n == 0) return;
777 
778  // solutions with xD displaced by dx
779 
780  double dx = 0.1; // cm
781  int i_dx = t.solve(xD + dx, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle(), dx);
782  if (i_dx < 0) return;
783  int k = 0;
784  while (m_inverseRaytracer->isNymDifferent()) { // get rid of discontinuities
785  if (k > 8) {
786  B2DEBUG(20, "TOP::PDFConstructor::setSignalPDF: failed to find the same Nym (dx)");
787  return;
788  }
789  dx = - dx / 2;
790  i_dx = t.solve(xD + dx, zD, Nxm, xmMin, xmMax, m_track.getEmissionPoint(), cerenkovAngle(), dx);
791  if (i_dx < 0) return;
792  k++;
793  }
794 
795  // loop over the two solutions, do ray-tracing corrections, compute the derivatives and expand PDF in y
796 
797  for (unsigned i = 0; i < 2; i++) {
798  if (not m_inverseRaytracer->getStatus(i)) continue;
799  const auto& solutions = m_inverseRaytracer->getSolutions(i);
800  const auto& sol = solutions[i0];
801  const auto& sol_dx = solutions[i_dx];
802 
803  // compute dFic/dx needed in raytracing corrections
804 
805  double dFic_dx = YScanner::Derivatives::dFic_d(sol, sol_dx);
806 
807  // do raytracing corrections
808 
809  m_dFic = 0;
810  bool ok = doRaytracingCorrections(sol, dFic_dx, xD);
811  if (not ok) continue;
812  m_Fic = sol.getFic() + m_dFic;
813 
814  // check if time is still within the reconstruction range
815 
817  if (time > m_maxTime) continue;
818 
819  // compute the derivatives
820 
822  ok = setDerivatives(D, 0.1, 0.1, 0.001);
823  if (not ok) {
824  B2DEBUG(20, "TOP::PDFConstructor::setSignalPDF: failed to determine derivatives: "
825  << LogVar("track momentum", m_track.getMomentumMag())
826  << LogVar("impact local z", m_track.getEmissionPoint().position.Z())
827  << LogVar("xD", xD)
828  << LogVar("Nxm", Nxm)
829  << LogVar("time", time)
830  << LogVar("peak type", t.type));
831  continue;
832  }
833  if (m_storeOption == c_Full) m_derivatives[xD] = D;
834 
835  // expand PDF in y
836 
837  expandSignalPDF(col, D, t.type);
838  }
839  }
840 
841  } // namespace TOP
843 } // namespace Belle2
R E
internal precision of FFTW codelets
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:580
static const double speedOfLight
[cm/ns]
Definition: Const.h:686
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.
int solveDirect(double xD, double zD, const TOPTrack::AssumedEmission &assumedEmission, const CerenkovAngle &cer, double step=0) const
Solve inverse ray-tracing for direct photon.
std::vector< Solution > & getSolutions(unsigned i) const
Returns the solutions of inverse ray-tracing.
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
const std::map< double, YScanner::Derivatives > & getDerivatives() const
Returns a collection of derivatives for debugging purposes.
LogL getLogL(double t0, double sigt=0) const
Returns extended log likelihood for PDF shifted in time.
const Const::ChargedStable & getHypothesis() const
Returns particle hypothesis.
double getPDFValue(int pixelID, double time, double timeErr, double sigt=0) const
Returns PDF value.
double m_beta
particle hypothesis beta
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.
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)
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.
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 std::vector< SignalPDF > & getSignalPDF() const
Returns signal PDF.
const BackgroundPDF * getBackgroundPDF() const
Returns background PDF.
EStoreOption
Options for storing signal PDF parameters.
@ c_Reduced
only PDF peak data
@ c_Full
also extra information and derivatives
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
const std::vector< TOPTrack::SelectedHit > & getSelectedHits() const
Returns selected photon hits belonging to this slot.
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.
const DeltaRayPDF & getDeltaRayPDF() const
Returns delta-ray PDF.
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.
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_dFic
temporary storage for dFic used in last call to deltaXD
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: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
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:510