BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TofPID Class Reference

#include <TofPID.h>

Inheritance diagram for TofPID:

Public Member Functions

 ~TofPID ()
void init ()
void calculate ()
bool IsPidInfoValid () const
double chi (int n) const
double prob (int n) const
double offset (int n) const
double sigma (int n) const
int ndof () const
double getweight1 () const
double getweight2 () const
double chilayer1 (int n) const
double chilayer2 (int n) const
 ~TofPID ()
void init ()
void calculate ()
bool IsPidInfoValid () const
double chi (int n) const
double prob (int n) const
double offset (int n) const
double sigma (int n) const
int ndof () const
double getweight1 () const
double getweight2 () const
double chilayer1 (int n) const
double chilayer2 (int n) const
 ~TofPID ()
void init ()
void calculate ()
bool IsPidInfoValid () const
double chi (int n) const
double prob (int n) const
double offset (int n) const
double sigma (int n) const
int ndof () const
double getweight1 () const
double getweight2 () const
double chilayer1 (int n) const
double chilayer2 (int n) const
Public Member Functions inherited from ParticleIDBase
 ParticleIDBase ()
virtual ~ParticleIDBase ()
EvtRecTrackPidTrk () const
void setRecTrack (EvtRecTrack *trk)
double chiMinCut () const
void setChiMinCut (const double chi=4)
double chiMaxCut () const
void setChiMaxCut (const double chi=6)
double pdfMinSigmaCut () const
void setPdfMinSigmaCut (const double pdf=4)
double getRunNo () const
void setRunNo (const double runh=8093)
double p ()
double pt ()
double charge ()
double xmass (int n)
double velc ()
double probCalculate (double chi2, int n)
double pdfCalculate (double offset, double sigma)
double interpolation (double *x, double *y, double x1)
double pol2 (double x, double *par)
double pol3 (double x, double *par)
double pol4 (double x, double *par)
int useDedx () const
int useTof () const
int useTof1 () const
int useTof2 () const
int useTofE () const
int useTofQ () const
int useTofC () const
int useTofCorr () const
int useEmc () const
int useMuc () const
int onlyPionKaon () const
int onlyPionKaonProton () const
int onlyPionKaonElectron () const
int all () const
int onlyElectron () const
int onlyMuon () const
int onlyPion () const
int onlyKaon () const
int onlyProton () const
int methodLikelihood () const
int methodProbability () const
int methodNeuronNetwork () const
int dedxValid () const
int tofValid () const
int tofeValid () const
int tofqValid () const
int tofcValid () const
int tofcorrValid () const
int emcValid () const
int mucValid () const
void set_path (const char *s_path=0)
void set_path (std::string s_path)
 ParticleIDBase ()
virtual ~ParticleIDBase ()
EvtRecTrackPidTrk () const
void setRecTrack (EvtRecTrack *trk)
double chiMinCut () const
void setChiMinCut (const double chi=4)
double chiMaxCut () const
void setChiMaxCut (const double chi=6)
double pdfMinSigmaCut () const
void setPdfMinSigmaCut (const double pdf=4)
double getRunNo () const
void setRunNo (const double runh=8093)
double p ()
double pt ()
double charge ()
double xmass (int n)
double velc ()
double probCalculate (double chi2, int n)
double pdfCalculate (double offset, double sigma)
double interpolation (double *x, double *y, double x1)
double pol2 (double x, double *par)
double pol3 (double x, double *par)
double pol4 (double x, double *par)
int useDedx () const
int useTof () const
int useTof1 () const
int useTof2 () const
int useTofE () const
int useTofQ () const
int useTofC () const
int useTofCorr () const
int useEmc () const
int useMuc () const
int onlyPionKaon () const
int onlyPionKaonProton () const
int onlyPionKaonElectron () const
int all () const
int onlyElectron () const
int onlyMuon () const
int onlyPion () const
int onlyKaon () const
int onlyProton () const
int methodLikelihood () const
int methodProbability () const
int methodNeuronNetwork () const
int dedxValid () const
int tofValid () const
int tofeValid () const
int tofqValid () const
int tofcValid () const
int tofcorrValid () const
int emcValid () const
int mucValid () const
void set_path (const char *s_path=0)
void set_path (std::string s_path)
 ParticleIDBase ()
virtual ~ParticleIDBase ()
EvtRecTrackPidTrk () const
void setRecTrack (EvtRecTrack *trk)
double chiMinCut () const
void setChiMinCut (const double chi=4)
double chiMaxCut () const
void setChiMaxCut (const double chi=6)
double pdfMinSigmaCut () const
void setPdfMinSigmaCut (const double pdf=4)
double getRunNo () const
void setRunNo (const double runh=8093)
double p ()
double pt ()
double charge ()
double xmass (int n)
double velc ()
double probCalculate (double chi2, int n)
double pdfCalculate (double offset, double sigma)
double interpolation (double *x, double *y, double x1)
double pol2 (double x, double *par)
double pol3 (double x, double *par)
double pol4 (double x, double *par)
int useDedx () const
int useTof () const
int useTof1 () const
int useTof2 () const
int useTofE () const
int useTofQ () const
int useTofC () const
int useTofCorr () const
int useEmc () const
int useMuc () const
int onlyPionKaon () const
int onlyPionKaonProton () const
int onlyPionKaonElectron () const
int all () const
int onlyElectron () const
int onlyMuon () const
int onlyPion () const
int onlyKaon () const
int onlyProton () const
int methodLikelihood () const
int methodProbability () const
int methodNeuronNetwork () const
int dedxValid () const
int tofValid () const
int tofeValid () const
int tofqValid () const
int tofcValid () const
int tofcorrValid () const
int emcValid () const
int mucValid () const
void set_path (const char *s_path=0)
void set_path (std::string s_path)

Static Public Member Functions

static TofPIDinstance ()
static TofPIDinstance ()
static TofPIDinstance ()

Protected Member Functions

int particleIDCalculation ()
int neuronPIDCalculation ()
int LikelihoodCalculation ()
int particleIDCalculation ()
int neuronPIDCalculation ()
int LikelihoodCalculation ()
int particleIDCalculation ()
int neuronPIDCalculation ()
int LikelihoodCalculation ()

Additional Inherited Members

Static Protected Attributes inherited from ParticleIDBase
static std::string path = ""

Detailed Description

Constructor & Destructor Documentation

◆ ~TofPID() [1/3]

TofPID::~TofPID ( )
inline

Definition at line 20 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

20{ ; }

◆ ~TofPID() [2/3]

TofPID::~TofPID ( )
inline

◆ ~TofPID() [3/3]

TofPID::~TofPID ( )
inline

Member Function Documentation

◆ calculate() [1/3]

void TofPID::calculate ( )
virtual

Implements ParticleIDBase.

Definition at line 46 of file TofPID.cxx.

46 {
47 if ( particleIDCalculation() == 0 ) m_ndof = 1;
48}
int particleIDCalculation()
Definition TofPID.cxx:50

◆ calculate() [2/3]

void TofPID::calculate ( )
virtual

Implements ParticleIDBase.

◆ calculate() [3/3]

void TofPID::calculate ( )
virtual

Implements ParticleIDBase.

◆ chi() [1/3]

double TofPID::chi ( int n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 25 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

25{ return m_chi[n]; }
const Int_t n

Referenced by chilayer1(), and chilayer2().

◆ chi() [2/3]

double TofPID::chi ( int n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 25 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

25{ return m_chi[n]; }

◆ chi() [3/3]

double TofPID::chi ( int n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 25 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

25{ return m_chi[n]; }

◆ chilayer1() [1/3]

double TofPID::chilayer1 ( int n) const

Definition at line 34 of file TofPID.cxx.

34 {
35 double chi = 99;
36 if ( val_tof1 ) chi = m_tof1pid->chi( n );
37 return chi;
38}

◆ chilayer1() [2/3]

double TofPID::chilayer1 ( int n) const

◆ chilayer1() [3/3]

double TofPID::chilayer1 ( int n) const

◆ chilayer2() [1/3]

double TofPID::chilayer2 ( int n) const

Definition at line 40 of file TofPID.cxx.

40 {
41 double chi = 99;
42 if ( val_tof2 ) chi = m_tof2pid->chi( n );
43 return chi;
44}

◆ chilayer2() [2/3]

double TofPID::chilayer2 ( int n) const

◆ chilayer2() [3/3]

double TofPID::chilayer2 ( int n) const

◆ getweight1() [1/3]

double TofPID::getweight1 ( ) const
inline

Definition at line 30 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

30{ return weight1; }

◆ getweight1() [2/3]

double TofPID::getweight1 ( ) const
inline

Definition at line 30 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

30{ return weight1; }

◆ getweight1() [3/3]

double TofPID::getweight1 ( ) const
inline

Definition at line 30 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

30{ return weight1; }

◆ getweight2() [1/3]

double TofPID::getweight2 ( ) const
inline

Definition at line 31 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

31{ return weight2; }

◆ getweight2() [2/3]

double TofPID::getweight2 ( ) const
inline

Definition at line 31 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

31{ return weight2; }

◆ getweight2() [3/3]

double TofPID::getweight2 ( ) const
inline

Definition at line 31 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

31{ return weight2; }

◆ init() [1/3]

void TofPID::init ( )
virtual

Implements ParticleIDBase.

Definition at line 21 of file TofPID.cxx.

21 {
22 for ( int i = 0; i < 5; i++ )
23 {
24 m_chi[i] = 99.0;
25 m_prob[i] = -1.0;
26 m_sigma[i] = 1;
27 m_offset[i] = 99.0;
28 }
29 m_chimin = 99.;
30 m_pdfmin = 99.;
31 m_ndof = 0;
32}

◆ init() [2/3]

void TofPID::init ( )
virtual

Implements ParticleIDBase.

◆ init() [3/3]

void TofPID::init ( )
virtual

Implements ParticleIDBase.

◆ instance() [1/3]

TofPID * TofPID::instance ( )
static

Definition at line 14 of file TofPID.cxx.

14 {
15 if ( !m_pointer ) m_pointer = new TofPID();
16 return m_pointer;
17}

Referenced by ParticleID::init().

◆ instance() [2/3]

TofPID * TofPID::instance ( )
static

◆ instance() [3/3]

TofPID * TofPID::instance ( )
static

◆ IsPidInfoValid() [1/3]

bool TofPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 24 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

24{ return ( m_ndof > 0 ); }

◆ IsPidInfoValid() [2/3]

bool TofPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 24 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

24{ return ( m_ndof > 0 ); }

◆ IsPidInfoValid() [3/3]

bool TofPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 24 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

24{ return ( m_ndof > 0 ); }

◆ LikelihoodCalculation() [1/3]

int TofPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

Definition at line 38 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

38{ return -1; }

◆ LikelihoodCalculation() [2/3]

int TofPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

Definition at line 38 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

38{ return -1; }

◆ LikelihoodCalculation() [3/3]

int TofPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

Definition at line 38 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

38{ return -1; }

◆ ndof() [1/3]

int TofPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 29 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

29{ return m_ndof; }

◆ ndof() [2/3]

int TofPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

29{ return m_ndof; }

◆ ndof() [3/3]

int TofPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

29{ return m_ndof; }

◆ neuronPIDCalculation() [1/3]

int TofPID::neuronPIDCalculation ( )
inlineprotected

Definition at line 37 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

37{ return -1; }

◆ neuronPIDCalculation() [2/3]

int TofPID::neuronPIDCalculation ( )
inlineprotected

Definition at line 37 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

37{ return -1; }

◆ neuronPIDCalculation() [3/3]

int TofPID::neuronPIDCalculation ( )
inlineprotected

Definition at line 37 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

37{ return -1; }

◆ offset() [1/3]

double TofPID::offset ( int n) const
inline

Definition at line 27 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

27{ return m_offset[n]; }

◆ offset() [2/3]

double TofPID::offset ( int n) const
inline

Definition at line 27 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

27{ return m_offset[n]; }

◆ offset() [3/3]

double TofPID::offset ( int n) const
inline

Definition at line 27 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

27{ return m_offset[n]; }

◆ particleIDCalculation() [1/3]

int TofPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

Definition at line 50 of file TofPID.cxx.

50 {
51 int irc = -1;
52 EvtRecTrack* recTrk = PidTrk();
53 m_tof1pid = Tof1PID::instance();
54 m_tof1pid->init();
55 m_tof1pid->setRecTrack( recTrk );
56 m_tof1pid->setChiMinCut( chiMinCut() );
57 m_tof1pid->setPdfMinSigmaCut( pdfMinSigmaCut() );
58 m_tof1pid->calculate();
59 val_tof1 = m_tof1pid->IsPidInfoValid();
60 m_tof2pid = Tof2PID::instance();
61 m_tof2pid->init();
62 m_tof2pid->setRecTrack( recTrk );
63 m_tof2pid->setChiMinCut( chiMinCut() );
64 m_tof2pid->setPdfMinSigmaCut( pdfMinSigmaCut() );
65 m_tof2pid->calculate();
66 val_tof2 = m_tof2pid->IsPidInfoValid();
67 double chitemp = 99.;
68 double pdftemp = 0;
69 for ( int i = 0; i < 5; i++ )
70 {
71 double t_tof1 = m_tof1pid->offset( i );
72 double t_tof2 = m_tof2pid->offset( i );
73 double m_sigma1 = m_tof1pid->sigma( i );
74 double m_sigma2 = m_tof2pid->sigma( i );
75 // double weight1,weight2;
76 if ( val_tof1 == 1 && val_tof2 == 1 )
77 {
78 weight1 = ( m_sigma2 * m_sigma2 - 0.041 * 0.041 ) /
79 ( m_sigma1 * m_sigma1 + m_sigma2 * m_sigma2 - 2 * 0.041 * 0.041 );
80 weight2 = ( m_sigma1 * m_sigma1 - 0.041 * 0.041 ) /
81 ( m_sigma1 * m_sigma1 + m_sigma2 * m_sigma2 - 2 * 0.041 * 0.041 );
82 m_sigma[i] =
83 sqrt( ( m_sigma1 * m_sigma1 * m_sigma2 * m_sigma2 - 0.041 * 0.041 * 0.041 * 0.041 ) /
84 ( m_sigma1 * m_sigma1 + m_sigma2 * m_sigma2 - 2 * 0.041 * 0.041 ) );
85 m_offset[i] = weight1 * t_tof1 + weight2 * t_tof2;
86 m_chi[i] = m_offset[i] / m_sigma[i];
87 }
88 if ( val_tof1 == 1 && val_tof2 == 0 )
89 {
90 weight1 = 1;
91 weight2 = 0;
92 m_sigma[i] = m_tof1pid->sigma( i );
93 m_offset[i] = t_tof1;
94 m_chi[i] = m_tof1pid->chi( i );
95 }
96
97 if ( val_tof1 == 0 && val_tof2 == 1 )
98 {
99 weight1 = 0;
100 weight2 = 1;
101 m_sigma[i] = m_tof2pid->sigma( i );
102 m_offset[i] = t_tof2;
103 m_chi[i] = m_tof2pid->chi( i );
104 }
105
106 if ( val_tof1 == 0 && val_tof2 == 0 ) return irc;
107 if ( fabs( m_chi[i] ) < chitemp ) chitemp = fabs( m_chi[i] );
108 double ppp = pdfCalculate( m_chi[i], 1 );
109 if ( fabs( ppp ) > pdftemp ) pdftemp = fabs( ppp );
110 }
111
112 m_chimin = chitemp;
113 m_pdfmin = pdftemp;
114 if ( pdftemp < pdfCalculate( pdfMinSigmaCut(), 1 ) ) return irc;
115 if ( m_chimin > chiMinCut() ) return irc;
116 for ( int i = 0; i < 5; i++ ) m_prob[i] = probCalculate( m_chi[i] * m_chi[i], 1 );
117 irc = 0;
118 return irc;
119}
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
static Tof1PID * instance()
Definition Tof1PID.cxx:16
static Tof2PID * instance()
Definition Tof2PID.cxx:17

Referenced by calculate().

◆ particleIDCalculation() [2/3]

int TofPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

◆ particleIDCalculation() [3/3]

int TofPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

◆ prob() [1/3]

double TofPID::prob ( int n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 26 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

26{ return m_prob[n]; }

◆ prob() [2/3]

double TofPID::prob ( int n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 26 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

26{ return m_prob[n]; }

◆ prob() [3/3]

double TofPID::prob ( int n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 26 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

26{ return m_prob[n]; }

◆ sigma() [1/3]

double TofPID::sigma ( int n) const
inline

Definition at line 28 of file Analysis/ParticleID/include/ParticleID/TofPID.h.

28{ return m_sigma[n]; }

◆ sigma() [2/3]

double TofPID::sigma ( int n) const
inline

Definition at line 28 of file InstallArea/x86_64-el9-gcc13-dbg/include/ParticleID/TofPID.h.

28{ return m_sigma[n]; }

◆ sigma() [3/3]

double TofPID::sigma ( int n) const
inline

Definition at line 28 of file InstallArea/x86_64-el9-gcc13-opt/include/ParticleID/TofPID.h.

28{ return m_sigma[n]; }

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