BOSS 7.0.4
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
 
- Public Member Functions inherited from ParticleIDBase
 ParticleIDBase ()
 
virtual ~ParticleIDBase ()
 
virtual void init ()=0
 
virtual void calculate ()=0
 
virtual bool IsPidInfoValid () const =0
 
virtual double chi (int n) const =0
 
virtual double prob (int n) const =0
 
virtual int ndof () const =0
 
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 ()
 
virtual void init ()=0
 
virtual void calculate ()=0
 
virtual bool IsPidInfoValid () const =0
 
virtual double chi (int n) const =0
 
virtual double prob (int n) const =0
 
virtual int ndof () const =0
 
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 ()
 

Protected Member Functions

int particleIDCalculation ()
 
int neuronPIDCalculation ()
 
int LikelihoodCalculation ()
 
int particleIDCalculation ()
 
int neuronPIDCalculation ()
 
int LikelihoodCalculation ()
 
virtual int particleIDCalculation ()=0
 
virtual int LikelihoodCalculation ()=0
 
virtual int particleIDCalculation ()=0
 
virtual int LikelihoodCalculation ()=0
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ calculate() [1/2]

void MucPID::calculate ( )
virtual

Implements ParticleIDBase.

Definition at line 101 of file MucPID.cxx.

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

◆ calculate() [2/2]

void MucPID::calculate ( )
virtual

Implements ParticleIDBase.

◆ chi() [1/2]

double MucPID::chi ( int  n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 29 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

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

◆ chi() [2/2]

double MucPID::chi ( int  n) const
inlinevirtual

Implements ParticleIDBase.

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

29{return m_chi[n];}

◆ chi2() [1/2]

double MucPID::chi2 ( ) const
inline

Definition at line 34 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

34{return m_chi2;}

Referenced by init().

◆ chi2() [2/2]

double MucPID::chi2 ( ) const
inline

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

34{return m_chi2;}

◆ delta_phi() [1/2]

double MucPID::delta_phi ( ) const
inline

Definition at line 36 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

36{return m_muc_delta_phi;}

◆ delta_phi() [2/2]

double MucPID::delta_phi ( ) const
inline

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

36{return m_muc_delta_phi;}

◆ depth() [1/2]

double MucPID::depth ( ) const
inline

Definition at line 33 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

33{return m_depth;}

Referenced by init().

◆ depth() [2/2]

double MucPID::depth ( ) const
inline

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

33{return m_depth;}

◆ distance() [1/2]

double MucPID::distance ( ) const
inline

Definition at line 35 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

35{return m_distance;}

Referenced by init().

◆ distance() [2/2]

double MucPID::distance ( ) const
inline

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

35{return m_distance;}

◆ hits() [1/2]

double MucPID::hits ( ) const
inline

Definition at line 32 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

32{return m_hits;}

Referenced by init().

◆ hits() [2/2]

double MucPID::hits ( ) const
inline

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

32{return m_hits;}

◆ init() [1/2]

void MucPID::init ( )
virtual

Implements ParticleIDBase.

Definition at line 67 of file MucPID.cxx.

67 {
68 for(int i = 0; i < 5; i++) {
69 m_chi[i] = 99.0;
70 m_prob[i] = -1.0;
71 }
72 m_chimin = 99.;
73 m_ndof = 0;
74 m_hits = -99;
75 m_depth = -999;
76 m_val_muc=-99;
77
78 std::string neural = path + "/share/neural.root";
79 std::string muc = path + "/share/muc.txt";
80 double ptrk,phi,theta,depth,hits,chi2,distance,muc_delta_phi;
81 int type;
82 if(!m_trainTree_muc) {
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 m_mlp_muc = new TMultiLayerPerceptron("@ptrk,@phi,@theta,@depth,@hits,@chi2,@distance,@muc_delta_phi:16:type",m_trainTree_muc);
96 m_mlp_muc->LoadWeights(muc.c_str());
97 }
98}

Referenced by ParticleID::init().

◆ init() [2/2]

void MucPID::init ( )
virtual

Implements ParticleIDBase.

◆ instance() [1/2]

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/2]

static MucPID * MucPID::instance ( )
static

◆ IsPidInfoValid() [1/2]

bool MucPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 28 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

28{return (m_ndof> 0);}

◆ IsPidInfoValid() [2/2]

bool MucPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

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

28{return (m_ndof> 0);}

◆ LikelihoodCalculation() [1/2]

int MucPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

Definition at line 46 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

46{return -1;}

◆ LikelihoodCalculation() [2/2]

int MucPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

Definition at line 46 of file InstallArea/include/ParticleID/ParticleID/MucPID.h.

46{return -1;}

◆ ndof() [1/2]

int MucPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 31 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

31{return m_ndof;}

◆ ndof() [2/2]

int MucPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

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

31{return m_ndof;}

◆ neuronPID() [1/2]

int MucPID::neuronPID ( ) const
inline

Definition at line 39 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

39{return -1;}

◆ neuronPID() [2/2]

int MucPID::neuronPID ( ) const
inline

Definition at line 39 of file InstallArea/include/ParticleID/ParticleID/MucPID.h.

39{return -1;}

◆ neuronPIDCalculation() [1/2]

int MucPID::neuronPIDCalculation ( )
inlineprotected

Definition at line 45 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

45{return -1;}

◆ neuronPIDCalculation() [2/2]

int MucPID::neuronPIDCalculation ( )
inlineprotected

Definition at line 45 of file InstallArea/include/ParticleID/ParticleID/MucPID.h.

45{return -1;}

◆ particleIDCalculation() [1/2]

int MucPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

Definition at line 105 of file MucPID.cxx.

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

Referenced by calculate().

◆ particleIDCalculation() [2/2]

int MucPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

◆ prob() [1/2]

double MucPID::prob ( int  n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 30 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

30{return m_prob[n];}

◆ prob() [2/2]

double MucPID::prob ( int  n) const
inlinevirtual

Implements ParticleIDBase.

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

30{return m_prob[n];}

◆ val_muc1() [1/2]

double MucPID::val_muc1 ( ) const
inline

Definition at line 37 of file Analysis/ParticleID/ParticleID-00-04-65/ParticleID/MucPID.h.

37{return m_val_muc;}

◆ val_muc1() [2/2]

double MucPID::val_muc1 ( ) const
inline

Definition at line 37 of file InstallArea/include/ParticleID/ParticleID/MucPID.h.

37{return m_val_muc;}

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