Belle II Software development
SignalPDF Class Reference

Parametrization of signal PDF in a single pixel. More...

#include <SignalPDF.h>

Classes

struct  PDFExtra
 Extra information about single PDF peak. More...
 
struct  PDFPeak
 Single PDF peak. More...
 

Public Types

enum  EPeakType {
  c_Unknown = 0 ,
  c_Direct = 1 ,
  c_Reflected = 2
}
 Enumerator for single PDF peak types. More...
 

Public Member Functions

 SignalPDF (int pixelID, const TOPNominalTTS &tts)
 Class constructor.
 
void append (const PDFPeak &peak)
 Appends single PDF peak.
 
void append (const PDFExtra &extra)
 Appends extra information of single PDF peak.
 
void normalize (double a)
 Normalize PDF peaks by dividing nph with given constant.
 
double getSum () const
 Returns a sum of nph of all peaks.
 
int getPixelID () const
 Returns pixel ID.
 
const TOPNominalTTSgetTTS () const
 Returns TTS.
 
const std::vector< PDFPeak > & getPDFPeaks () const
 Returns PDF peaks.
 
const std::vector< PDFExtra > & getPDFExtraInfo () const
 Returns PDF extra info Note: available only if stored on demand.
 
bool isExtraInfoAvailable () const
 Checks if extra info is available.
 
double getPDFValue (double time, double timeErr, double sigt=0) const
 Returns PDF value at given time.
 
double getIntegral (double minTime, double maxTime) const
 Returns integral of PDF from minTime to maxTime.
 

Private Attributes

int m_pixelID = 0
 pixel ID
 
const TOPNominalTTSm_tts = 0
 nominal TTS
 
std::vector< PDFPeakm_peaks
 PDF peaks.
 
std::vector< PDFExtram_extras
 extra information (stored only on request)
 

Detailed Description

Parametrization of signal PDF in a single pixel.

PDF is parametrized as a sum of Gaussian distributions.

Definition at line 25 of file SignalPDF.h.

Member Enumeration Documentation

◆ EPeakType

enum EPeakType

Enumerator for single PDF peak types.

Enumerator
c_Unknown 

unknown

c_Direct 

direct photon

c_Reflected 

reflected photon

Definition at line 32 of file SignalPDF.h.

32 {
33 c_Unknown = 0,
34 c_Direct = 1,
35 c_Reflected = 2
36 };
@ c_Direct
direct photon
Definition: SignalPDF.h:34
@ c_Reflected
reflected photon
Definition: SignalPDF.h:35

Constructor & Destructor Documentation

◆ SignalPDF()

SignalPDF ( int  pixelID,
const TOPNominalTTS tts 
)

Class constructor.

Parameters
pixelIDpixel ID
ttsTTS

Definition at line 21 of file SignalPDF.cc.

21 :
22 m_pixelID(pixelID), m_tts(&tts)
23 {}
const TOPNominalTTS * m_tts
nominal TTS
Definition: SignalPDF.h:155
int m_pixelID
pixel ID
Definition: SignalPDF.h:154

Member Function Documentation

◆ append() [1/2]

void append ( const PDFExtra extra)
inline

Appends extra information of single PDF peak.

Parameters
extraextra information

Definition at line 91 of file SignalPDF.h.

91{ m_extras.push_back(extra);}
std::vector< PDFExtra > m_extras
extra information (stored only on request)
Definition: SignalPDF.h:157

◆ append() [2/2]

void append ( const PDFPeak peak)
inline

Appends single PDF peak.

Parameters
peaksingle PDF peak

Definition at line 85 of file SignalPDF.h.

85{ m_peaks.push_back(peak);}
std::vector< PDFPeak > m_peaks
PDF peaks.
Definition: SignalPDF.h:156

◆ getIntegral()

double getIntegral ( double  minTime,
double  maxTime 
) const

Returns integral of PDF from minTime to maxTime.

Parameters
minTimeintegral lower limit
maxTimeintegral upper limit
Returns
integral of PDF

Definition at line 41 of file SignalPDF.cc.

42 {
43 double s = 0;
44 for (const auto& peak : m_peaks) {
45 if (peak.t0 < minTime or peak.t0 > maxTime) continue;
46 s += peak.nph;
47 }
48 return s;
49 }

◆ getPDFExtraInfo()

const std::vector< PDFExtra > & getPDFExtraInfo ( ) const
inline

Returns PDF extra info Note: available only if stored on demand.

Returns
PDF extra info

Definition at line 127 of file SignalPDF.h.

127{return m_extras;}

◆ getPDFPeaks()

const std::vector< PDFPeak > & getPDFPeaks ( ) const
inline

Returns PDF peaks.

Returns
PDF peaks

Definition at line 120 of file SignalPDF.h.

120{return m_peaks;}

◆ getPDFValue()

double getPDFValue ( double  time,
double  timeErr,
double  sigt = 0 
) const

Returns PDF value at given time.

Parameters
timephoton hit time
timeErruncertainty of hit time (sigma)
sigtadditional time smearing
Returns
PDF value

Definition at line 25 of file SignalPDF.cc.

26 {
27 double wid0 = timeErr * timeErr + sigt * sigt;
28 double f = 0;
29 for (const auto& peak : m_peaks) {
30 for (const auto& gaus : m_tts->getTTS()) {
31 double sigma = peak.wid + gaus.sigma * gaus.sigma + wid0; // sigma squared!
32 double x = pow(time - peak.t0 - gaus.position, 2) / sigma;
33 if (x > 100) continue;
34 sigma = sqrt(2 * M_PI * sigma);
35 f += peak.nph * gaus.fraction / sigma * exp(-x / 2);
36 }
37 }
38 return f;
39 }
const std::vector< Gauss > & getTTS() const
Returns TTS.
Definition: TOPNominalTTS.h:74
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ getPixelID()

int getPixelID ( ) const
inline

Returns pixel ID.

Returns
pixel ID

Definition at line 108 of file SignalPDF.h.

108{return m_pixelID;}

◆ getSum()

double getSum ( ) const
inline

Returns a sum of nph of all peaks.

Definition at line 168 of file SignalPDF.h.

169 {
170 double s = 0;
171 for (const auto& peak : m_peaks) s += peak.nph;
172 return s;
173 }

◆ getTTS()

const TOPNominalTTS * getTTS ( ) const
inline

Returns TTS.

Returns
TTS

Definition at line 114 of file SignalPDF.h.

114{return m_tts;}

◆ isExtraInfoAvailable()

bool isExtraInfoAvailable ( ) const
inline

Checks if extra info is available.

Returns
true if available

Definition at line 133 of file SignalPDF.h.

133{return m_extras.size() == m_peaks.size();}

◆ normalize()

void normalize ( double  a)
inline

Normalize PDF peaks by dividing nph with given constant.

Parameters
anormalization constant

Definition at line 163 of file SignalPDF.h.

164 {
165 for (auto& peak : m_peaks) peak.nph /= a;
166 }

Member Data Documentation

◆ m_extras

std::vector<PDFExtra> m_extras
private

extra information (stored only on request)

Definition at line 157 of file SignalPDF.h.

◆ m_peaks

std::vector<PDFPeak> m_peaks
private

PDF peaks.

Definition at line 156 of file SignalPDF.h.

◆ m_pixelID

int m_pixelID = 0
private

pixel ID

Definition at line 154 of file SignalPDF.h.

◆ m_tts

const TOPNominalTTS* m_tts = 0
private

nominal TTS

Definition at line 155 of file SignalPDF.h.


The documentation for this class was generated from the following files: