Belle II Software  release-08-01-10
SignalPDF.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/dbobjects/TOPNominalTTS.h>
12 #include <vector>
13 
14 namespace Belle2 {
19  namespace TOP {
20 
25  class SignalPDF {
26 
27  public:
28 
32  enum EPeakType {
33  c_Unknown = 0,
34  c_Direct = 1,
35  c_Reflected = 2
36  };
37 
41  struct PDFPeak {
42  double t0 = 0;
43  double wid = 0;
44  double nph = 0;
45  double fic = 0;
46  };
47 
51  struct PDFExtra {
52  double thc = 0;
53  double e = 0;
54  double sige = 0;
55  int Nxm = 0;
56  int Nxb = 0;
57  int Nxe = 0;
58  int Nym = 0;
59  int Nyb = 0;
60  int Nye = 0;
61  double xD = 0;
62  double yD = 0;
63  double zD = 0;
64  double yB = 0;
65  double kxE = 0;
66  double kyE = 0;
67  double kzE = 0;
68  double kxD = 0;
69  double kyD = 0;
70  double kzD = 0;
72  };
73 
79  SignalPDF(int pixelID, const TOPNominalTTS& tts);
80 
85  void append(const PDFPeak& peak) { m_peaks.push_back(peak);}
86 
91  void append(const PDFExtra& extra) { m_extras.push_back(extra);}
92 
97  void normalize(double a);
98 
102  double getSum() const;
103 
108  int getPixelID() const {return m_pixelID;}
109 
114  const TOPNominalTTS* getTTS() const {return m_tts;}
115 
120  const std::vector<PDFPeak>& getPDFPeaks() const {return m_peaks;}
121 
127  const std::vector<PDFExtra>& getPDFExtraInfo() const {return m_extras;}
128 
133  bool isExtraInfoAvailable() const {return m_extras.size() == m_peaks.size();}
134 
142  double getPDFValue(double time, double timeErr, double sigt = 0) const;
143 
150  double getIntegral(double minTime, double maxTime) const;
151 
152  private:
153 
154  int m_pixelID = 0;
155  const TOPNominalTTS* m_tts = 0;
156  std::vector<PDFPeak> m_peaks;
157  std::vector<PDFExtra> m_extras;
159  };
160 
161  //--- inline functions ------------------------------------------------------------
162 
163  inline void SignalPDF::normalize(double a)
164  {
165  for (auto& peak : m_peaks) peak.nph /= a;
166  }
167 
168  inline double SignalPDF::getSum() const
169  {
170  double s = 0;
171  for (const auto& peak : m_peaks) s += peak.nph;
172  return s;
173  }
174 
175  } // namespace TOP
177 } // namespace Belle2
178 
Nominal time transition spread of PMT.
Definition: TOPNominalTTS.h:23
Parametrization of signal PDF in a single pixel.
Definition: SignalPDF.h:25
std::vector< PDFExtra > m_extras
extra information (stored only on request)
Definition: SignalPDF.h:157
void normalize(double a)
Normalize PDF peaks by dividing nph with given constant.
Definition: SignalPDF.h:163
const std::vector< PDFPeak > & getPDFPeaks() const
Returns PDF peaks.
Definition: SignalPDF.h:120
std::vector< PDFPeak > m_peaks
PDF peaks.
Definition: SignalPDF.h:156
const TOPNominalTTS * m_tts
nominal TTS
Definition: SignalPDF.h:155
double getPDFValue(double time, double timeErr, double sigt=0) const
Returns PDF value at given time.
Definition: SignalPDF.cc:25
int getPixelID() const
Returns pixel ID.
Definition: SignalPDF.h:108
bool isExtraInfoAvailable() const
Checks if extra info is available.
Definition: SignalPDF.h:133
const TOPNominalTTS * getTTS() const
Returns TTS.
Definition: SignalPDF.h:114
void append(const PDFPeak &peak)
Appends single PDF peak.
Definition: SignalPDF.h:85
double getSum() const
Returns a sum of nph of all peaks.
Definition: SignalPDF.h:168
double getIntegral(double minTime, double maxTime) const
Returns integral of PDF from minTime to maxTime.
Definition: SignalPDF.cc:41
SignalPDF(int pixelID, const TOPNominalTTS &tts)
Class constructor.
Definition: SignalPDF.cc:21
const std::vector< PDFExtra > & getPDFExtraInfo() const
Returns PDF extra info Note: available only if stored on demand.
Definition: SignalPDF.h:127
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
int m_pixelID
pixel ID
Definition: SignalPDF.h:154
void append(const PDFExtra &extra)
Appends extra information of single PDF peak.
Definition: SignalPDF.h:91
Abstract base class for different kinds of events.
Extra information about single PDF peak.
Definition: SignalPDF.h:51
int Nxm
number of reflections in x before mirror
Definition: SignalPDF.h:55
double yB
unfolded coordinate x at prism entrance
Definition: SignalPDF.h:64
int Nye
number of reflections in y inside prism
Definition: SignalPDF.h:60
double xD
unfolded detection x coordinate
Definition: SignalPDF.h:61
double kxD
photon direction x at detection
Definition: SignalPDF.h:68
EPeakType type
peak type
Definition: SignalPDF.h:71
double kyD
photon direction y at detection
Definition: SignalPDF.h:69
double kzD
photon direction z at detection
Definition: SignalPDF.h:70
int Nym
number of reflections in y before mirror
Definition: SignalPDF.h:58
double thc
Cerenkov (polar) angle.
Definition: SignalPDF.h:52
double sige
photon energy sigma squared
Definition: SignalPDF.h:54
int Nxe
number of reflections in x inside prism
Definition: SignalPDF.h:57
int Nyb
number of reflections in y after mirror and before prism
Definition: SignalPDF.h:59
double kzE
photon direction z at emission
Definition: SignalPDF.h:67
double kyE
photon direction y at emission
Definition: SignalPDF.h:66
double e
photon energy
Definition: SignalPDF.h:53
double kxE
photon direction x at emission
Definition: SignalPDF.h:65
int Nxb
number of reflections in x after mirror and before prism
Definition: SignalPDF.h:56
double yD
unfolded detection y coordinate
Definition: SignalPDF.h:62
double zD
unfolded detection z coordinate
Definition: SignalPDF.h:63
double t0
peak position [ns]
Definition: SignalPDF.h:42
double fic
Cerenkov azimuthal angle.
Definition: SignalPDF.h:45
double wid
peak width squared [ns^2]
Definition: SignalPDF.h:43
double nph
normalized number of photons in a peak
Definition: SignalPDF.h:44