Belle II Software development
SVDHitTimeSelectionFunction Class Reference

class to contain the cut on svd hit time at SP creation step More...

#include <SVDHitTimeSelectionFunction.h>

Inheritance diagram for SVDHitTimeSelectionFunction:

Public Types

typedef bool(SVDHitTimeSelectionFunction::* selFunction) (double, double, double, double) const
 typedef of the output calibration function
 

Public Member Functions

bool isInTime (double svdTime, double svdTimeError=0, double t0=0, double t0Error=0) const
 returns whether the hit came on time or not
 
bool areClustersInTime (double uTime, double vTime) const
 returns whether the uCluster time is compatible with the vClsuter time
 
 SVDHitTimeSelectionFunction ()
 constructor
 
void setFunctionID (int user_current)
 copy constructor
 
int getFunctionID () const
 get the function ID (function version)
 
void setMinTime (double tMin)
 set the minimum cluster time
 
float getMinTime () const
 returns the minimum cluster time
 
void setDeltaTime (double deltaT)
 set the minimum time distance wrt t0
 
float getDeltaTime () const
 returns the minimum time distance wrt t0
 
void setNsigma (double nSigma)
 set the nSigma
 
float getNsigma () const
 returns the minimum cluster time
 
void setMaxUVTimeDifference (double timeDiff)
 set m_maxUVTimeDifference
 
float getMaxUVTimeDifference () const
 get m_maxUVTimeDifference
 

Public Attributes

float m_maxUVTimeDifference = 100
 max time difference of U and V clusters
 

Private Member Functions

bool firstVersion (double svdTime, double, double, double) const
 function parameters & implementations
 
bool secondVersion (double svdTime, double, double t0, double) const
 SECOND VERSION, ID = 1: isOnTime if |t - t0|< deltaT.
 
bool thirdVersion (double svdTime, double svdTimeError, double t0, double t0Error) const
 THIRD VERSION, ID = 2: isOnTime if |t - t0|< nSigma*sigma.
 

Private Attributes

double m_tMin
 minimum cluster time
 
double m_deltaT
 minimum time distance wrt t0
 
double m_nSigma
 number of Sigma
 
int m_current
 current function ID
 

Static Private Attributes

static std::vector< selFunctionm_implementations
 vector of functions, we use the m_current
 

Detailed Description

class to contain the cut on svd hit time at SP creation step

Definition at line 23 of file SVDHitTimeSelectionFunction.h.

Member Typedef Documentation

◆ selFunction

typedef bool(SVDHitTimeSelectionFunction::* selFunction) (double, double, double, double) const

typedef of the output calibration function

Definition at line 28 of file SVDHitTimeSelectionFunction.h.

Constructor & Destructor Documentation

◆ SVDHitTimeSelectionFunction()

constructor

Definition at line 48 of file SVDHitTimeSelectionFunction.h.

49 {
50 // The m_implementations vector is static.
51 // We have to initialize it just once.
52 if (m_implementations.size() == 0) {
53 m_implementations.push_back(&SVDHitTimeSelectionFunction::firstVersion);
54 m_implementations.push_back(&SVDHitTimeSelectionFunction::secondVersion);
55 m_implementations.push_back(&SVDHitTimeSelectionFunction::thirdVersion);
56 }
57
58 m_current = 0; //firstVersion is the default //m_implementations.size() - 1;
59 m_deltaT = 100; //ns
60 m_nSigma = 100;
61 m_tMin = -999; //ns
62 };

Member Function Documentation

◆ areClustersInTime()

bool areClustersInTime ( double uTime,
double vTime ) const
inline

returns whether the uCluster time is compatible with the vClsuter time

Definition at line 39 of file SVDHitTimeSelectionFunction.h.

40 {
41 if (std::abs(uTime - vTime) > m_maxUVTimeDifference)
42 return false;
43 return true;
44 }

◆ firstVersion()

bool firstVersion ( double svdTime,
double ,
double ,
double  ) const
inlineprivate

function parameters & implementations

FIRST VERSION, ID = 0: isOnTime if t > m_tMin

Definition at line 102 of file SVDHitTimeSelectionFunction.h.

103 {
104 return svdTime > m_tMin;
105 };

◆ getDeltaTime()

float getDeltaTime ( ) const
inline

returns the minimum time distance wrt t0

Definition at line 83 of file SVDHitTimeSelectionFunction.h.

83{ return m_deltaT; };

◆ getFunctionID()

int getFunctionID ( ) const
inline

get the function ID (function version)

Definition at line 71 of file SVDHitTimeSelectionFunction.h.

71{return m_current;}

◆ getMaxUVTimeDifference()

float getMaxUVTimeDifference ( ) const
inline

get m_maxUVTimeDifference

Definition at line 95 of file SVDHitTimeSelectionFunction.h.

95{ return m_maxUVTimeDifference; }

◆ getMinTime()

float getMinTime ( ) const
inline

returns the minimum cluster time

Definition at line 77 of file SVDHitTimeSelectionFunction.h.

77{ return m_tMin; };

◆ getNsigma()

float getNsigma ( ) const
inline

returns the minimum cluster time

Definition at line 89 of file SVDHitTimeSelectionFunction.h.

89{ return m_nSigma; };

◆ isInTime()

bool isInTime ( double svdTime,
double svdTimeError = 0,
double t0 = 0,
double t0Error = 0 ) const
inline

returns whether the hit came on time or not

Definition at line 31 of file SVDHitTimeSelectionFunction.h.

32 {
33 // cppcheck-suppress assignBoolToPointer
34 selFunction f = m_implementations[m_current];
35 return (this->*f)(svdTime, svdTimeError, t0, t0Error) ;
36 }

◆ secondVersion()

bool secondVersion ( double svdTime,
double ,
double t0,
double  ) const
inlineprivate

SECOND VERSION, ID = 1: isOnTime if |t - t0|< deltaT.

Definition at line 109 of file SVDHitTimeSelectionFunction.h.

110 {
111 return fabs(svdTime - t0) < m_deltaT;
112 };

◆ setDeltaTime()

void setDeltaTime ( double deltaT)
inline

set the minimum time distance wrt t0

Definition at line 81 of file SVDHitTimeSelectionFunction.h.

81{ m_deltaT = deltaT; }

◆ setFunctionID()

void setFunctionID ( int user_current)
inline

copy constructor

set the function ID (version)

Definition at line 69 of file SVDHitTimeSelectionFunction.h.

69{m_current = user_current;}

◆ setMaxUVTimeDifference()

void setMaxUVTimeDifference ( double timeDiff)
inline

set m_maxUVTimeDifference

Definition at line 93 of file SVDHitTimeSelectionFunction.h.

93{ m_maxUVTimeDifference = timeDiff; }

◆ setMinTime()

void setMinTime ( double tMin)
inline

set the minimum cluster time

Definition at line 75 of file SVDHitTimeSelectionFunction.h.

75{ m_tMin = tMin; }

◆ setNsigma()

void setNsigma ( double nSigma)
inline

set the nSigma

Definition at line 87 of file SVDHitTimeSelectionFunction.h.

87{ m_nSigma = nSigma; }

◆ thirdVersion()

bool thirdVersion ( double svdTime,
double svdTimeError,
double t0,
double t0Error ) const
inlineprivate

THIRD VERSION, ID = 2: isOnTime if |t - t0|< nSigma*sigma.

Definition at line 117 of file SVDHitTimeSelectionFunction.h.

118 {
119 float err2 = svdTimeError * svdTimeError + t0Error * t0Error;
120 return (svdTime - t0) * (svdTime - t0) < m_nSigma * m_nSigma * err2;
121 };

Member Data Documentation

◆ m_current

int m_current
private

current function ID

Definition at line 126 of file SVDHitTimeSelectionFunction.h.

◆ m_deltaT

double m_deltaT
private

minimum time distance wrt t0

Definition at line 113 of file SVDHitTimeSelectionFunction.h.

◆ m_implementations

std::vector< SVDHitTimeSelectionFunction::selFunction > m_implementations
staticprivate

vector of functions, we use the m_current

Definition at line 128 of file SVDHitTimeSelectionFunction.h.

◆ m_maxUVTimeDifference

float m_maxUVTimeDifference = 100

max time difference of U and V clusters

Definition at line 45 of file SVDHitTimeSelectionFunction.h.

◆ m_nSigma

double m_nSigma
private

number of Sigma

Definition at line 122 of file SVDHitTimeSelectionFunction.h.

◆ m_tMin

double m_tMin
private

minimum cluster time

Definition at line 106 of file SVDHitTimeSelectionFunction.h.


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