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

#include <MucPID.h>

Inheritance diagram for MucPID:

Public Member Functions

void init ()
void calculate ()
bool IsPidInfoValid () const
double chi (int n) const
double prob (int n) const
int ndof () const
double hits () const
double depth () const
double chi2 () const
double distance () const
double delta_phi () const
double val_muc1 () const
int neuronPID () const
void init ()
void calculate ()
bool IsPidInfoValid () const
double chi (int n) const
double prob (int n) const
int ndof () const
double hits () const
double depth () const
double chi2 () const
double distance () const
double delta_phi () const
double val_muc1 () const
int neuronPID () const
void init ()
void calculate ()
bool IsPidInfoValid () const
double chi (int n) const
double prob (int n) const
int ndof () const
double hits () const
double depth () const
double chi2 () const
double distance () const
double delta_phi () const
double val_muc1 () const
int neuronPID () 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 MucPIDinstance ()
static MucPIDinstance ()
static MucPIDinstance ()

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

Member Function Documentation

◆ calculate() [1/3]

void MucPID::calculate ( )
virtual

Implements ParticleIDBase.

Definition at line 103 of file MucPID.cxx.

103 {
104 if ( particleIDCalculation() == 0 ) m_ndof = 1;
105}
int particleIDCalculation()
Definition MucPID.cxx:107

◆ calculate() [2/3]

void MucPID::calculate ( )
virtual

Implements ParticleIDBase.

◆ calculate() [3/3]

void MucPID::calculate ( )
virtual

Implements ParticleIDBase.

◆ chi() [1/3]

double MucPID::chi ( int n) const
inlinevirtual

Implements ParticleIDBase.

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

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

◆ chi() [2/3]

double MucPID::chi ( int n) const
inlinevirtual

Implements ParticleIDBase.

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

28{ return m_chi[n]; }

◆ chi() [3/3]

double MucPID::chi ( int n) const
inlinevirtual

Implements ParticleIDBase.

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

28{ return m_chi[n]; }

◆ chi2() [1/3]

double MucPID::chi2 ( ) const
inline

Definition at line 33 of file Analysis/ParticleID/include/ParticleID/MucPID.h.

33{ return m_chi2; }

Referenced by init().

◆ chi2() [2/3]

double MucPID::chi2 ( ) const
inline

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

33{ return m_chi2; }

◆ chi2() [3/3]

double MucPID::chi2 ( ) const
inline

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

33{ return m_chi2; }

◆ delta_phi() [1/3]

double MucPID::delta_phi ( ) const
inline

Definition at line 35 of file Analysis/ParticleID/include/ParticleID/MucPID.h.

35{ return m_muc_delta_phi; }

◆ delta_phi() [2/3]

double MucPID::delta_phi ( ) const
inline

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

35{ return m_muc_delta_phi; }

◆ delta_phi() [3/3]

double MucPID::delta_phi ( ) const
inline

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

35{ return m_muc_delta_phi; }

◆ depth() [1/3]

double MucPID::depth ( ) const
inline

Definition at line 32 of file Analysis/ParticleID/include/ParticleID/MucPID.h.

32{ return m_depth; }

Referenced by init().

◆ depth() [2/3]

double MucPID::depth ( ) const
inline

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

32{ return m_depth; }

◆ depth() [3/3]

double MucPID::depth ( ) const
inline

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

32{ return m_depth; }

◆ distance() [1/3]

double MucPID::distance ( ) const
inline

Definition at line 34 of file Analysis/ParticleID/include/ParticleID/MucPID.h.

34{ return m_distance; }

Referenced by init().

◆ distance() [2/3]

double MucPID::distance ( ) const
inline

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

34{ return m_distance; }

◆ distance() [3/3]

double MucPID::distance ( ) const
inline

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

34{ return m_distance; }

◆ hits() [1/3]

double MucPID::hits ( ) const
inline

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

31{ return m_hits; }

Referenced by init().

◆ hits() [2/3]

double MucPID::hits ( ) const
inline

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

31{ return m_hits; }

◆ hits() [3/3]

double MucPID::hits ( ) const
inline

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

31{ return m_hits; }

◆ init() [1/3]

void MucPID::init ( )
virtual

Implements ParticleIDBase.

Definition at line 65 of file MucPID.cxx.

65 {
66 for ( int i = 0; i < 5; i++ )
67 {
68 m_chi[i] = 99.0;
69 m_prob[i] = -1.0;
70 }
71 m_chimin = 99.;
72 m_ndof = 0;
73 m_hits = -99;
74 m_depth = -999;
75 m_val_muc = -99;
76
77 std::string neural = path + "/share/neural.root";
78 std::string muc = path + "/share/muc.txt";
79 double ptrk, phi, theta, depth, hits, chi2, distance, muc_delta_phi;
80 int type;
81 if ( !m_trainTree_muc )
82 {
83 m_trainTree_muc = new TTree( "m_trainTree_muc", "m_trainTree_muc" );
84 m_trainTree_muc->Branch( "ptrk", &ptrk, "ptrk/D" );
85 m_trainTree_muc->Branch( "phi", &phi, "phi/D" );
86 m_trainTree_muc->Branch( "theta", &theta, "theta/D" );
87 m_trainTree_muc->Branch( "depth", &depth, "depth/D" );
88 m_trainTree_muc->Branch( "hits", &hits, "hits/D" );
89 m_trainTree_muc->Branch( "chi2", &chi2, "chi2/D" );
90 m_trainTree_muc->Branch( "distance", &distance, "distance/D" );
91 m_trainTree_muc->Branch( "muc_delta_phi", &muc_delta_phi, "muc_delta_phi/D" );
92 m_trainTree_muc->Branch( "type", &type, "type/I" );
93 }
94 if ( !m_mlp_muc )
95 {
96 m_mlp_muc = new TMultiLayerPerceptron(
97 "@ptrk,@phi,@theta,@depth,@hits,@chi2,@distance,@muc_delta_phi:16:type",
98 m_trainTree_muc );
99 m_mlp_muc->LoadWeights( muc.c_str() );
100 }
101}

◆ init() [2/3]

void MucPID::init ( )
virtual

Implements ParticleIDBase.

◆ init() [3/3]

void MucPID::init ( )
virtual

Implements ParticleIDBase.

◆ instance() [1/3]

MucPID * MucPID::instance ( )
static

Definition at line 22 of file MucPID.cxx.

22 {
23
24 if ( !m_pointer ) m_pointer = new MucPID();
25 return m_pointer;
26}

Referenced by ParticleID::init().

◆ instance() [2/3]

MucPID * MucPID::instance ( )
static

◆ instance() [3/3]

MucPID * MucPID::instance ( )
static

◆ IsPidInfoValid() [1/3]

bool MucPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

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

27{ return ( m_ndof > 0 ); }

◆ IsPidInfoValid() [2/3]

bool MucPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

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

27{ return ( m_ndof > 0 ); }

◆ IsPidInfoValid() [3/3]

bool MucPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

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

27{ return ( m_ndof > 0 ); }

◆ LikelihoodCalculation() [1/3]

int MucPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

Definition at line 43 of file Analysis/ParticleID/include/ParticleID/MucPID.h.

43{ return -1; }

◆ LikelihoodCalculation() [2/3]

int MucPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

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

43{ return -1; }

◆ LikelihoodCalculation() [3/3]

int MucPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

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

43{ return -1; }

◆ ndof() [1/3]

int MucPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

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

30{ return m_ndof; }

◆ ndof() [2/3]

int MucPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

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

30{ return m_ndof; }

◆ ndof() [3/3]

int MucPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

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

30{ return m_ndof; }

◆ neuronPID() [1/3]

int MucPID::neuronPID ( ) const
inline

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

38{ return -1; }

◆ neuronPID() [2/3]

int MucPID::neuronPID ( ) const
inline

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

38{ return -1; }

◆ neuronPID() [3/3]

int MucPID::neuronPID ( ) const
inline

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

38{ return -1; }

◆ neuronPIDCalculation() [1/3]

int MucPID::neuronPIDCalculation ( )
inlineprotected

Definition at line 42 of file Analysis/ParticleID/include/ParticleID/MucPID.h.

42{ return -1; }

◆ neuronPIDCalculation() [2/3]

int MucPID::neuronPIDCalculation ( )
inlineprotected

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

42{ return -1; }

◆ neuronPIDCalculation() [3/3]

int MucPID::neuronPIDCalculation ( )
inlineprotected

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

42{ return -1; }

◆ particleIDCalculation() [1/3]

int MucPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

Definition at line 107 of file MucPID.cxx.

107 {
108 int irc = -1;
109 EvtRecTrack* recTrk = PidTrk();
110 if ( !( recTrk->isMdcTrackValid() ) ) return irc;
111 RecMdcTrack* mdcTrk = recTrk->mdcTrack();
112
113 m_depth = -99;
114 m_hits = -99;
115 m_chi2 = -99;
116 m_distance = -99;
117 m_muc_delta_phi = -99;
118
119 double ptrk = mdcTrk->p();
120 double m_ptrk = ptrk;
121 double m_pt = mdcTrk->pxy();
122 double phi = mdcTrk->phi();
123 double theta = mdcTrk->theta();
124 double cost = cos( mdcTrk->theta() );
125 if ( ptrk < 0.5 ) return irc;
126 if ( fabs( cost ) > 0.83 ) return irc;
127 if ( !( recTrk->isExtTrackValid() ) ) return irc;
128 RecExtTrack* extTrk = recTrk->extTrack();
129 if ( extTrk->mucVolumeNumber() == -1 ) return irc;
130 if ( !( recTrk->isMucTrackValid() ) ) return irc;
131 RecMucTrack* mucTrk = recTrk->mucTrack();
132
133 // if(mucTrk->maxHitsInLayer()< 0) return irc;
134 if ( mucTrk->depth() > 100000 ) return irc;
135
136 m_hits = mucTrk->maxHitsInLayer();
137 m_depth = mucTrk->depth();
138 m_distance = mucTrk->distance();
139 m_chi2 = mucTrk->chi2();
140 /* Hep3Vector phi_muc;
141 phi_muc.set(mucTrk->xPos(),mucTrk->yPos(),0);
142 Hep3Vector phi_mdc;
143 phi_mdc.set(mdcTrk->px(),mdcTrk->py(),0);
144 m_muc_delta_phi = phi_muc.angle(phi_mdc);
145 if(m_muc_delta_phi<0) m_muc_delta_phi = -m_muc_delta_phi; */
146 m_muc_delta_phi = mucTrk->deltaPhi();
147 m_muc_delta_phi = 3.14159 - m_muc_delta_phi;
148 theta = cos( theta );
149 params_muc1[0] = m_ptrk;
150 params_muc1[1] = phi;
151 params_muc1[2] = theta;
152 params_muc1[3] = m_depth;
153 params_muc1[4] = m_hits;
154 params_muc1[5] = m_chi2;
155 params_muc1[6] = m_distance;
156 params_muc1[7] = m_muc_delta_phi;
157
158 m_val_muc = m_mlp_muc->Evaluate( 0, params_muc1 );
159 if ( m_pt < 0 ) m_pt = -m_pt;
160 int pindex = int( ( m_ptrk - 0.5 ) / 0.1 );
161 int bindex = int( ( m_val_muc - 0.5 ) / 0.01 );
162 if ( bindex > 300 || bindex < 0 ) return irc;
163 if ( pindex > 11 ) pindex = 11;
164 if ( pindex < 0 ) pindex = 0;
165 m_prob[0] = m_p_h[pindex][bindex];
166 ;
167 m_prob[1] = m_m_h[pindex][bindex];
168 m_prob[2] = m_p_h[pindex][bindex];
169 m_prob[3] = m_p_h[pindex][bindex];
170 m_prob[4] = m_p_h[pindex][bindex];
171 for ( int i = 0; i < 5; i++ )
172 {
173 if ( m_prob[i] == 0 ) m_prob[i] = 0.001;
174 }
175 float ppp[5];
176 for ( int i = 0; i < 5; i++ ) { ppp[i] = 0.0; }
177
178 for ( int j = 0; j < bindex; j++ )
179 {
180 ppp[1] += m_m_h[pindex][j] * 0.01;
181 ppp[2] += m_p_h[pindex][j] * 0.01;
182 }
183 if ( ppp[1] > 0 && ppp[1] < 1 ) CALG( ppp[1], m_chi[1] );
184 if ( ppp[2] > 0 && ppp[2] < 1 ) CALG( ppp[2], m_chi[2] );
185 if ( ppp[1] <= 0 || ppp[1] >= 1 ) m_chi[1] = -99;
186 if ( ppp[2] <= 0 || ppp[2] >= 1 ) m_chi[2] = -99;
187
188 m_chi[3] = m_chi[2];
189 m_chi[4] = m_chi[2];
190 m_chi[0] = m_chi[2];
191 m_ndof = 1;
192 irc = 0;
193 return irc;
194}
NTuple::Item< double > m_pt
void CALG(double Px, double &e2)
Definition calg.cxx:31

Referenced by calculate().

◆ particleIDCalculation() [2/3]

int MucPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

◆ particleIDCalculation() [3/3]

int MucPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

◆ prob() [1/3]

double MucPID::prob ( int n) const
inlinevirtual

Implements ParticleIDBase.

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

29{ return m_prob[n]; }

◆ prob() [2/3]

double MucPID::prob ( int n) const
inlinevirtual

Implements ParticleIDBase.

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

29{ return m_prob[n]; }

◆ prob() [3/3]

double MucPID::prob ( int n) const
inlinevirtual

Implements ParticleIDBase.

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

29{ return m_prob[n]; }

◆ val_muc1() [1/3]

double MucPID::val_muc1 ( ) const
inline

Definition at line 36 of file Analysis/ParticleID/include/ParticleID/MucPID.h.

36{ return m_val_muc; }

◆ val_muc1() [2/3]

double MucPID::val_muc1 ( ) const
inline

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

36{ return m_val_muc; }

◆ val_muc1() [3/3]

double MucPID::val_muc1 ( ) const
inline

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

36{ return m_val_muc; }

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