Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EmcPID Class Reference

#include <EmcPID.h>

Inheritance diagram for EmcPID:

ParticleIDBase ParticleIDBase List of all members.

Public Member Functions

int all () const
int all () const
void calculate ()
void calculate ()
double charge ()
double charge ()
double chi (int n) const
double chi (int n) const
double chiMinCut () const
double chiMinCut () const
int dedxValid () const
int dedxValid () const
double delta_phi () const
double delta_phi () const
double delta_theta () const
double delta_theta () const
double e3x3 () const
double e3x3 () const
double e5x5 () const
double e5x5 () const
int emcValid () const
int emcValid () const
double energy () const
double energy () const
double eseed () const
double eseed () const
double getRunNo () const
double getRunNo () const
void init ()
void init ()
double interpolation (double *x, double *y, double x1)
double interpolation (double *x, double *y, double x1)
bool IsPidInfoValid () const
bool IsPidInfoValid () const
int methodLikelihood () const
int methodLikelihood () const
int methodNeuronNetwork () const
int methodNeuronNetwork () const
int methodProbability () const
int methodProbability () const
int mucValid () const
int mucValid () const
int ndof () const
int ndof () const
int neuronPID () const
int neuronPID () const
int onlyElectron () const
int onlyElectron () const
int onlyKaon () const
int onlyKaon () const
int onlyMuon () const
int onlyMuon () const
int onlyPion () const
int onlyPion () const
int onlyPionKaon () const
int onlyPionKaon () const
int onlyPionKaonElectron () const
int onlyPionKaonElectron () const
int onlyPionKaonProton () const
int onlyPionKaonProton () const
int onlyProton () const
int onlyProton () const
double p ()
double p ()
double pars (int n) const
double pars (int n) const
double pdfCalculate (double offset, double sigma)
double pdfCalculate (double offset, double sigma)
double pdfMinSigmaCut () const
double pdfMinSigmaCut () const
EvtRecTrackPidTrk () const
EvtRecTrackPidTrk () const
double pol2 (double x, double *par)
double pol2 (double x, double *par)
double pol3 (double x, double *par)
double pol3 (double x, double *par)
double pol4 (double x, double *par)
double pol4 (double x, double *par)
double prob (int n) const
double prob (int n) const
double probCalculate (double chi2, int n)
double probCalculate (double chi2, int n)
double pt ()
double pt ()
double secondmoment () const
double secondmoment () const
void setChiMinCut (const double chi=4)
void setChiMinCut (const double chi=4)
void setPdfMinSigmaCut (const double pdf=4)
void setPdfMinSigmaCut (const double pdf=4)
void setRecTrack (EvtRecTrack *trk)
void setRecTrack (EvtRecTrack *trk)
void setRunNo (const double runh=8093)
void setRunNo (const double runh=8093)
int tofcValid () const
int tofcValid () const
int tofeValid () const
int tofeValid () const
int tofqValid () const
int tofqValid () const
int tofValid () const
int tofValid () const
int useDedx () const
int useDedx () const
int useEmc () const
int useEmc () const
int useMuc () const
int useMuc () const
int useTof () const
int useTof () const
int useTof1 () const
int useTof1 () const
int useTof2 () const
int useTof2 () const
int useTofC () const
int useTofC () const
int useTofE () const
int useTofE () const
int useTofQ () const
int useTofQ () const
double val_emc1 () const
double val_emc1 () const
double velc ()
double velc ()
double xmass (int n)
double xmass (int n)
 ~EmcPID ()
 ~EmcPID ()

Static Public Member Functions

EmcPIDinstance ()
EmcPIDinstance ()

Protected Member Functions

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

Private Member Functions

 EmcPID ()
 EmcPID ()

Private Attributes

double m_a20moment
double m_a42moment
double m_chi [5]
double m_chimin
double m_delta_phi
double m_delta_theta
double m_e3x3
double m_e5x5
double m_e_h [18][300]
double m_energy
double m_eseed
double m_latmoment
double m_m_h [18][300]
int m_ndof
double m_p_h [18][300]
double m_prob [5]
double m_pt
double m_ptrk
double m_secondmoment
int m_type
double m_val_emc
double params_emc1 [9]

Static Private Attributes

TMultiLayerPerceptron * m_mlp_emc
TMultiLayerPerceptron * m_mlp_emc
EmcPIDm_pointer
EmcPIDm_pointer
TTree * m_trainTree_emconly
TTree * m_trainTree_emconly = 0

Constructor & Destructor Documentation

EmcPID::~EmcPID  )  [inline]
 

00019 {;} 

EmcPID::EmcPID  )  [private]
 

00028               :ParticleIDBase(){
00029     m_mlp_emc = 0;
00030     std::string e_emc_file =string(getenv("PARTICLEIDROOT"))+ "/share/elec_emc_hist.txt";
00031     //std::string e_emc_file = "$PARTICLEIDROOT/share/elechist.txt";
00032   ifstream input(e_emc_file.c_str(),std::ios_base::in);
00033   for(int i=0;i<18;i++){
00034    for(int j=0;j<300;j++){
00035     input>>m_e_h[i][j];
00036    }
00037  }
00038 //   std::string pi_emc_file = "/ihepbatch/bes/huangb/boss610/Analysis/ParticleID/ParticleID-00-02-03/share/pionhist.txt";
00039     std::string pi_emc_file = string(getenv("PARTICLEIDROOT"))+"/share/pion_emc_hist.txt";
00040    //std::string pi_emc_file = "$PARTICLEIDROOT/share/pionhist.txt";
00041   ifstream input1(pi_emc_file.c_str(),std::ios_base::in);
00042   for(int i=0;i<18;i++){
00043    for(int j=0;j<300;j++){
00044     input1>>m_p_h[i][j];
00045    }
00046  }
00047    std::string mu_emc_file = string(getenv("PARTICLEIDROOT"))+"/share/muon_emc_hist.txt";
00048  //  std::string mu_emc_file = "/ihepbatch/bes/huangb/boss610/Analysis/ParticleID/ParticleID-00-02-03/share/muonhist.txt";
00049    //std::string mu_emc_file = "$PARTICLEIDROOT/share/muonhist.txt";
00050   ifstream input2(mu_emc_file.c_str(),std::ios_base::in);
00051   for(int i=0;i<18;i++){
00052    for(int j=0;j<300;j++){
00053     input2>>m_m_h[i][j];
00054 
00055    }
00056  }
00057 
00058   if(!m_trainTree_emconly){
00059      m_trainTree_emconly = new TTree("m_trainTree_emconly","m_trainTree_emconly");
00060      m_trainTree_emconly->Branch("ptrk",&m_ptrk,"ptrk/D");
00061      m_trainTree_emconly->Branch("pt",&m_pt,"pt/D");
00062      m_trainTree_emconly->Branch("type",&m_type,"type/D");
00063      m_trainTree_emconly->Branch("energy",&m_energy,"energy/D");
00064      m_trainTree_emconly->Branch("eseed",&m_eseed,"eseed/D");
00065      m_trainTree_emconly->Branch("e3x3",&m_e3x3,"e3x3/D");
00066      m_trainTree_emconly->Branch("e5x5",&m_e5x5,"e5x5/D");
00067      m_trainTree_emconly->Branch("latmoment",&m_latmoment,"latmoment/D");
00068      m_trainTree_emconly->Branch("a20moment",&m_a20moment,"a20moment/D");
00069      m_trainTree_emconly->Branch("a42moment",&m_a42moment,"a42moment/D");
00070      m_trainTree_emconly->Branch("secondmoment",&m_secondmoment,"secondmoment/D");
00071      m_trainTree_emconly->Branch("delta_phi",&m_delta_phi,"delta_phi/D");
00072      m_trainTree_emconly->Branch("delta_theta",&m_delta_theta,"delta_theta/D");
00073   }
00074   std::string emc = string(getenv("PARTICLEIDROOT"))+"/share/emc.txt";
00075   if(!m_mlp_emc){
00076    //  m_mlp_emc = new TMultiLayerPerceptron("ptrk,pt,energy,eseed,e3x3,e5x5,secondmoment,delta_theta,delta_phi:18:type",m_trainTree_emconly);
00077      m_mlp_emc = new TMultiLayerPerceptron("ptrk,pt,energy,eseed,e3x3,e5x5,secondmoment,latmoment,a20moment,a42moment,delta_theta,delta_phi:24:type",m_trainTree_emconly);
00078 
00079      m_mlp_emc->LoadWeights(emc.c_str());
00080      
00081 }
00082 }

EmcPID::~EmcPID  )  [inline]
 

00019 {;} 

EmcPID::EmcPID  )  [private]
 


Member Function Documentation

int ParticleIDBase::all  )  const [inline, inherited]
 

00091 {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}

int ParticleIDBase::all  )  const [inline, inherited]
 

00091 {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}

void EmcPID::calculate  )  [virtual]
 

Implements ParticleIDBase.

void EmcPID::calculate  )  [virtual]
 

Implements ParticleIDBase.

00141                        {
00142   if(particleIDCalculation() == 0) m_ndof = 1;
00143 }

double ParticleIDBase::charge  )  [inherited]
 

double ParticleIDBase::charge  )  [inherited]
 

00077                               {
00078   double val = 999;
00079   if(!m_trk) return val;
00080   if(!m_trk->isMdcTrackValid()) return val;
00081   RecMdcTrack *mdcTrk = m_trk->mdcTrack();
00082   val = mdcTrk->charge() + 0.0;
00083 }

double EmcPID::chi int  n  )  const [inline, virtual]
 

Implements ParticleIDBase.

00024 {return m_chi[n];}

double EmcPID::chi int  n  )  const [inline, virtual]
 

Implements ParticleIDBase.

00024 {return m_chi[n];}

double ParticleIDBase::chiMinCut  )  const [inline, inherited]
 

00052 {return m_chimin_cut;}

double ParticleIDBase::chiMinCut  )  const [inline, inherited]
 

00052 {return m_chimin_cut;}

int ParticleIDBase::dedxValid  )  const [inline, inherited]
 

00103 {return DEDX_VALID;}

int ParticleIDBase::dedxValid  )  const [inline, inherited]
 

00103 {return DEDX_VALID;}

double EmcPID::delta_phi  )  const [inline]
 

00032 {return m_delta_phi;}

double EmcPID::delta_phi  )  const [inline]
 

00032 {return m_delta_phi;}

double EmcPID::delta_theta  )  const [inline]
 

00031 {return m_delta_theta;}

double EmcPID::delta_theta  )  const [inline]
 

00031 {return m_delta_theta;}

double EmcPID::e3x3  )  const [inline]
 

00029 {return m_e3x3;}

double EmcPID::e3x3  )  const [inline]
 

00029 {return m_e3x3;}

double EmcPID::e5x5  )  const [inline]
 

00030 {return m_e5x5;}

double EmcPID::e5x5  )  const [inline]
 

00030 {return m_e5x5;}

int ParticleIDBase::emcValid  )  const [inline, inherited]
 

00108 {return EMC_VALID;}

int ParticleIDBase::emcValid  )  const [inline, inherited]
 

00108 {return EMC_VALID;}

double EmcPID::energy  )  const [inline]
 

00027 {return m_energy;}

double EmcPID::energy  )  const [inline]
 

00027 {return m_energy;}

double EmcPID::eseed  )  const [inline]
 

00028 {return m_eseed;}

double EmcPID::eseed  )  const [inline]
 

00028 {return m_eseed;}

double ParticleIDBase::getRunNo  )  const [inline, inherited]
 

00056 {return m_runno;}

double ParticleIDBase::getRunNo  )  const [inline, inherited]
 

00056 {return m_runno;}

void EmcPID::init  )  [virtual]
 

Implements ParticleIDBase.

void EmcPID::init  )  [virtual]
 

Implements ParticleIDBase.

00083                   {
00084   for(int i = 0; i < 5; i++) {
00085     m_chi[i] = 99.0;
00086     m_prob[i] = -1.0;
00087   }
00088   m_chimin = 99.;
00089   m_ndof = 0;
00090   m_energy = -99;
00091   m_eseed = -99;
00092   m_e3x3 = -99;
00093   m_e5x5 = -99;
00094   m_delta_theta = -99;
00095   m_delta_phi = -99;
00096   m_secondmoment = -99;
00097   m_val_emc = -99;
00098 //   std::string emc = string(getenv("PARTICLEIDROOT"))+"/share/emc_epimu.txt";
00099  /*   if(!m_trainTree_emconly){
00100    m_trainTree_emconly = new TTree("m_trainTree_emconly","m_trainTree_emconly");
00101    m_trainTree_emconly->Branch("ptrk",&m_ptrk,"ptrk/D");
00102    m_trainTree_emconly->Branch("pt",&m_pt,"pt/D");
00103    m_trainTree_emconly->Branch("type",&m_type,"type/D");
00104    m_trainTree_emconly->Branch("energy",&m_energy,"energy/D");
00105    m_trainTree_emconly->Branch("eseed",&m_eseed,"eseed/D");
00106    m_trainTree_emconly->Branch("e3x3",&m_e3x3,"e3x3/D");
00107    m_trainTree_emconly->Branch("e5x5",&m_e5x5,"e5x5/D");
00108    m_trainTree_emconly->Branch("secondmoment",&m_secondmoment,"secondmoment/D");
00109    m_trainTree_emconly->Branch("delta_phi",&m_delta_phi,"delta_phi/D");
00110    m_trainTree_emconly->Branch("delta_theta",&m_delta_theta,"delta_theta/D");
00111     }
00112    if(!m_mlp_emc){
00113   m_mlp_emc = new TMultiLayerPerceptron("ptrk,pt,energy,eseed,e3x3,e5x5,secondmoment,delta_theta,delta_phi:18:type",m_trainTree_emconly); 
00114    m_mlp_emc->LoadWeights(emc.c_str());
00115 }
00116 */
00117 
00118 /*if(!m_trainTree_emconly){
00119 m_trainTree_emconly = new TTree("m_trainTree_emconly","m_trainTree_emconly");
00120 m_trainTree_emconly->Branch("ptrk",&m_ptrk,"ptrk/D");
00121 m_trainTree_emconly->Branch("pt",&m_pt,"pt/D");
00122 m_trainTree_emconly->Branch("type",&m_type,"type/D");
00123 m_trainTree_emconly->Branch("energy",&m_energy,"energy/D");
00124 m_trainTree_emconly->Branch("eseed",&m_eseed,"eseed/D");
00125 m_trainTree_emconly->Branch("e3x3",&m_e3x3,"e3x3/D");
00126 m_trainTree_emconly->Branch("e5x5",&m_e5x5,"e5x5/D");
00127 m_trainTree_emconly->Branch("secondmoment",&m_secondmoment,"secondmoment/D");
00128 m_trainTree_emconly->Branch("delta_phi",&m_delta_phi,"delta_phi/D");
00129 m_trainTree_emconly->Branch("delta_theta",&m_delta_theta,"delta_theta/D");
00130 }
00131 if(!m_mlp_emc){
00132 m_mlp_emc = new TMultiLayerPerceptron("ptrk,pt,energy,eseed,e3x3,e5x5,secondmoment,delta_theta,delta_phi:18:type",m_trainTree_emconly);
00133 m_mlp_emc->LoadWeights(emc.c_str());
00134 }
00135 */                                            
00136 
00137 
00138 
00139 }

EmcPID* EmcPID::instance  )  [static]
 

EmcPID * EmcPID::instance  )  [static]
 

00023                           {
00024   if(!m_pointer) m_pointer = new EmcPID();
00025   return m_pointer;
00026 }

double ParticleIDBase::interpolation double *  x,
double *  y,
double  x1
[inherited]
 

double ParticleIDBase::interpolation double *  x,
double *  y,
double  x1
[inherited]
 

00085                                                                   {
00086   double c1 = (y[0]-y[1])*(x[1]-x[2])-(x[0]-x[1])*(y[1]-y[2]);
00087   double c2 = (x[0]*x[0]-x[1]*x[1])*(x[1]-x[2])-(x[1]*x[1]-x[2]*x[2])*(x[0]-x[1]);
00088   double c = c1/c2;
00089   double b1 = (y[0]-y[1])*(x[1]*x[1]-x[2]*x[2])-(x[0]*x[0]-x[1]*x[1])*(y[1]-y[2]);
00090   double b2 = (x[0]-x[1])*(x[1]*x[1]-x[2]*x[2])-(x[1]-x[2])*(x[0]*x[0]-x[1]*x[1]);
00091   double b = b1/b2;
00092   double a = y[0] - b*x[0]-c*x[0]*x[0];
00093   double y1 = a + b*x1 +c*x1*x1;
00094   return y1;
00095 }

bool EmcPID::IsPidInfoValid  )  const [inline, virtual]
 

Implements ParticleIDBase.

00023 {return (m_ndof> 0);}

bool EmcPID::IsPidInfoValid  )  const [inline, virtual]
 

Implements ParticleIDBase.

00023 {return (m_ndof> 0);}

int EmcPID::LikelihoodCalculation  )  [inline, protected, virtual]
 

Implements ParticleIDBase.

00042 {return -1;}

int EmcPID::LikelihoodCalculation  )  [inline, protected, virtual]
 

Implements ParticleIDBase.

00042 {return -1;}

int ParticleIDBase::methodLikelihood  )  const [inline, inherited]
 

00099 {return LIKELIHOOD_PID;}

int ParticleIDBase::methodLikelihood  )  const [inline, inherited]
 

00099 {return LIKELIHOOD_PID;}

int ParticleIDBase::methodNeuronNetwork  )  const [inline, inherited]
 

00101 {return NEURONNETWORK_PID;}

int ParticleIDBase::methodNeuronNetwork  )  const [inline, inherited]
 

00101 {return NEURONNETWORK_PID;}

int ParticleIDBase::methodProbability  )  const [inline, inherited]
 

00100 {return PROBABILITY_PID;}

int ParticleIDBase::methodProbability  )  const [inline, inherited]
 

00100 {return PROBABILITY_PID;}

int ParticleIDBase::mucValid  )  const [inline, inherited]
 

00109 {return MUC_VALID;}

int ParticleIDBase::mucValid  )  const [inline, inherited]
 

00109 {return MUC_VALID;}

int EmcPID::ndof  )  const [inline, virtual]
 

Implements ParticleIDBase.

00026 {return m_ndof;}

int EmcPID::ndof  )  const [inline, virtual]
 

Implements ParticleIDBase.

00026 {return m_ndof;}

int EmcPID::neuronPID  )  const [inline]
 

00035 {return -1;}

int EmcPID::neuronPID  )  const [inline]
 

00035 {return -1;}

int EmcPID::neuronPIDCalculation  )  [inline, protected]
 

00041 {return -1;}

int EmcPID::neuronPIDCalculation  )  [inline, protected]
 

00041 {return -1;}

int ParticleIDBase::onlyElectron  )  const [inline, inherited]
 

00092 {return IDENTIFY_ELECTRON;}

int ParticleIDBase::onlyElectron  )  const [inline, inherited]
 

00092 {return IDENTIFY_ELECTRON;}

int ParticleIDBase::onlyKaon  )  const [inline, inherited]
 

00095 {return IDENTIFY_KAON;}

int ParticleIDBase::onlyKaon  )  const [inline, inherited]
 

00095 {return IDENTIFY_KAON;}

int ParticleIDBase::onlyMuon  )  const [inline, inherited]
 

00093 {return IDENTIFY_MUON;}

int ParticleIDBase::onlyMuon  )  const [inline, inherited]
 

00093 {return IDENTIFY_MUON;}

int ParticleIDBase::onlyPion  )  const [inline, inherited]
 

00094 {return IDENTIFY_PION;}

int ParticleIDBase::onlyPion  )  const [inline, inherited]
 

00094 {return IDENTIFY_PION;}

int ParticleIDBase::onlyPionKaon  )  const [inline, inherited]
 

00088 {return (IDENTIFY_PION | IDENTIFY_KAON);}

int ParticleIDBase::onlyPionKaon  )  const [inline, inherited]
 

00088 {return (IDENTIFY_PION | IDENTIFY_KAON);}

int ParticleIDBase::onlyPionKaonElectron  )  const [inline, inherited]
 

00090 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}

int ParticleIDBase::onlyPionKaonElectron  )  const [inline, inherited]
 

00090 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}

int ParticleIDBase::onlyPionKaonProton  )  const [inline, inherited]
 

00089 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}

int ParticleIDBase::onlyPionKaonProton  )  const [inline, inherited]
 

00089 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}

int ParticleIDBase::onlyProton  )  const [inline, inherited]
 

00096 {return IDENTIFY_PROTON;}

int ParticleIDBase::onlyProton  )  const [inline, inherited]
 

00096 {return IDENTIFY_PROTON;}

double ParticleIDBase::p  )  [inherited]
 

double ParticleIDBase::p  )  [inherited]
 

00063                          {
00064   double val = 999;
00065   if(!m_trk) return val;
00066   if(!m_trk->isMdcTrackValid()) return val;
00067   RecMdcTrack *mdcTrk = m_trk->mdcTrack();
00068   val = mdcTrk->p();
00069 }

double EmcPID::pars int  n  )  const [inline]
 

00036 {return params_emc1[n];}

double EmcPID::pars int  n  )  const [inline]
 

00036 {return params_emc1[n];}

int EmcPID::particleIDCalculation  )  [protected, virtual]
 

Implements ParticleIDBase.

int EmcPID::particleIDCalculation  )  [protected, virtual]
 

Implements ParticleIDBase.

00145                                   {
00146   int irc = -1;
00147   EvtRecTrack* recTrk = PidTrk();
00148   if(!(recTrk->isMdcTrackValid())) return irc;
00149   RecMdcTrack* mdcTrk = recTrk->mdcTrack();
00150   if (!(recTrk)->isMdcKalTrackValid()) return irc;
00151   RecMdcKalTrack* mdcKalTrk = (recTrk)->mdcKalTrack();
00152   mdcKalTrk->setPidType(RecMdcKalTrack::electron);   
00153   double ptrk=mdcKalTrk->p();
00154  // double ptrk = mdcTrk->p();
00155    m_ptrk = ptrk;
00156    
00157    m_pt=mdcKalTrk->pxy();
00158    m_pt = m_pt*mdcTrk->charge();
00159   double cost = cos(mdcTrk->theta());
00160   
00161   if(!(recTrk->isExtTrackValid())) return irc;
00162   RecExtTrack* extTrk = recTrk->extTrack();
00163   if(extTrk->emcVolumeNumber() == -1) return irc;
00164   if (!(recTrk->isEmcShowerValid())) return irc;
00165   RecEmcShower* emcTrk = recTrk->emcShower();
00166 
00167   m_energy = emcTrk->energy();
00168   m_eseed = emcTrk->eSeed();
00169   m_e3x3 = emcTrk->e3x3();
00170   m_e5x5 = emcTrk->e5x5(); 
00171 
00172   double m_emc_theta = emcTrk->theta();
00173   double m_emc_phi = emcTrk->phi();
00174 
00175   Hep3Vector mc = extTrk->emcPosition();
00176   double m_ext_theta = mc.theta();
00177   double m_ext_phi = mc.phi();   
00178 
00179 
00180   m_delta_theta = m_emc_theta - m_ext_theta;
00181   m_delta_phi = m_emc_phi - m_ext_phi;
00182   if(m_delta_phi>1)   m_delta_phi=m_delta_phi-6.283;
00183   if(m_delta_phi<-1)  m_delta_phi=m_delta_phi+6.283;
00184 
00185   
00186   m_secondmoment = emcTrk->secondMoment()/1000.;
00187   m_a20moment=emcTrk->a20Moment();
00188   m_latmoment=emcTrk->latMoment();
00189   m_a42moment=emcTrk->a42Moment();
00190 
00191   if(emcTrk->energy() <= 0) return irc;
00192   //if(emcTrk->energy() > ptrk) return irc;
00193   
00194 /*  params_emc1[0] = m_ptrk;
00195   params_emc1[1] = m_pt;
00196   params_emc1[2] = m_energy;
00197   params_emc1[3] = m_eseed;
00198   params_emc1[4] = m_e3x3;
00199   params_emc1[5] = m_e5x5;
00200   params_emc1[6] = m_secondmoment;
00201   params_emc1[7] = m_delta_theta;
00202   params_emc1[8] = m_delta_phi;*/
00203   params_emc1[0] =m_ptrk;
00204   params_emc1[1] =m_pt;
00205   params_emc1[2] =m_energy;
00206   params_emc1[3] =m_eseed;
00207   params_emc1[4] =m_e3x3;
00208   params_emc1[5] =m_e5x5;
00209   params_emc1[6] =m_secondmoment;
00210   params_emc1[7] =m_latmoment;
00211   params_emc1[8] =m_a20moment;
00212   params_emc1[9] =m_a42moment;
00213   params_emc1[10] =m_delta_theta;
00214   params_emc1[11] =m_delta_phi;
00215 
00216   m_val_emc = m_mlp_emc->Evaluate(0,params_emc1);
00217   int pindex = int((m_ptrk-0.2)/0.1);
00218   int bindex = int((m_val_emc-0.5)/0.01);
00219   if(bindex>300||bindex<0) return irc;
00220   if(pindex>17) pindex=17;
00221   if(pindex<0) pindex=0;
00222   double bin_pos[3];
00223     m_prob[0] = m_e_h[pindex][bindex];
00224   m_prob[1] = m_m_h[pindex][bindex];
00225   m_prob[2] = m_p_h[pindex][bindex];
00226   m_prob[3] = m_p_h[pindex][bindex];
00227   m_prob[4] = m_p_h[pindex][bindex];
00228    for(int i =0;i<5;i++){
00229   if(m_prob[i]==0) m_prob[i] = 0.001; 
00230 }
00231 //calculate the chisq value using GAUSIN
00232   float ppp[5];
00233   for(int i=0;i<5;i++){
00234     ppp[i]=0;
00235   }
00236   for(int j=0;j<=bindex;j++){
00237       ppp[0]+= m_e_h[pindex][j];
00238       ppp[1]+= m_m_h[pindex][j];
00239       ppp[2]+= m_p_h[pindex][j];
00240     }
00241   for(int i=0;i<3;i++){
00242     ppp[i]=ppp[i]*0.01;
00243     if(ppp[i]>0&&ppp[i]<1){
00244     CALG(ppp[i],m_chi[i]);
00245     }
00246     if(ppp[i]<=0||ppp[i]>=1) m_chi[i]=-99;
00247   }
00248   // if(fabs(m_chi[2])==-99)
00249    m_chi[3]=m_chi[2];
00250    m_chi[4]=m_chi[2];
00251 
00252   m_ndof = 1;
00253   irc = 0;
00254   return irc;
00255 }

double ParticleIDBase::pdfCalculate double  offset,
double  sigma
[inherited]
 

double ParticleIDBase::pdfCalculate double  offset,
double  sigma
[inherited]
 

00055                                                               {
00056  const double pi =  3.141592653589793238;
00057  const double twoPi = 2*pi;
00058  double chi2 = -0.5*offset*offset/(sigma*sigma);
00059  double pdf = exp(chi2)/(sigma*sqrt(twoPi));
00060   return pdf;
00061 }

double ParticleIDBase::pdfMinSigmaCut  )  const [inline, inherited]
 

00054 {return m_pdfsigmamin_cut;} 

double ParticleIDBase::pdfMinSigmaCut  )  const [inline, inherited]
 

00054 {return m_pdfsigmamin_cut;} 

EvtRecTrack* ParticleIDBase::PidTrk  )  const [inline, inherited]
 

00050 {return m_trk;}

EvtRecTrack* ParticleIDBase::PidTrk  )  const [inline, inherited]
 

00050 {return m_trk;}

double ParticleIDBase::pol2 double  x,
double *  par
[inherited]
 

double ParticleIDBase::pol2 double  x,
double *  par
[inherited]
 

00097                                                 {
00098    double y=x;
00099    return par[0] + (par[1] * y) +(par[2] * y * y);
00100 }

double ParticleIDBase::pol3 double  x,
double *  par
[inherited]
 

double ParticleIDBase::pol3 double  x,
double *  par
[inherited]
 

00102                                                 {
00103    double y=x;
00104    return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y);
00105 }

double ParticleIDBase::pol4 double  x,
double *  par
[inherited]
 

double ParticleIDBase::pol4 double  x,
double *  par
[inherited]
 

00107                                                 {
00108    double y=x;
00109    return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y) + (par[4] * y * y*y*y);
00110 }

double EmcPID::prob int  n  )  const [inline, virtual]
 

Implements ParticleIDBase.

00025 {return m_prob[n];}

double EmcPID::prob int  n  )  const [inline, virtual]
 

Implements ParticleIDBase.

00025 {return m_prob[n];}

double ParticleIDBase::probCalculate double  chi2,
int  n
[inherited]
 

double ParticleIDBase::probCalculate double  chi2,
int  n
[inherited]
 

00047                                                           {
00048   double p = -1.0;
00049   if(chi2 < 0) return p;
00050   p = TMath::Prob(chi2, ndof);
00051   return p;
00052 }

double ParticleIDBase::pt  )  [inherited]
 

double ParticleIDBase::pt  )  [inherited]
 

00070                           {
00071   double val = 999;
00072   if(!m_trk) return val;
00073   if(!m_trk->isMdcTrackValid()) return val;
00074   RecMdcTrack *mdcTrk = m_trk->mdcTrack();
00075   val = mdcTrk->pxy();
00076 }

double EmcPID::secondmoment  )  const [inline]
 

00033 {return m_secondmoment;}

double EmcPID::secondmoment  )  const [inline]
 

00033 {return m_secondmoment;}

void ParticleIDBase::setChiMinCut const double  chi = 4  )  [inline, inherited]
 

00053 {m_chimin_cut = chi;}

void ParticleIDBase::setChiMinCut const double  chi = 4  )  [inline, inherited]
 

00053 {m_chimin_cut = chi;}

void ParticleIDBase::setPdfMinSigmaCut const double  pdf = 4  )  [inline, inherited]
 

00055 {m_pdfsigmamin_cut= pdf;}  

void ParticleIDBase::setPdfMinSigmaCut const double  pdf = 4  )  [inline, inherited]
 

00055 {m_pdfsigmamin_cut= pdf;}  

void ParticleIDBase::setRecTrack EvtRecTrack trk  )  [inline, inherited]
 

00051 {m_trk = trk;} 

void ParticleIDBase::setRecTrack EvtRecTrack trk  )  [inline, inherited]
 

00051 {m_trk = trk;} 

void ParticleIDBase::setRunNo const double  runh = 8093  )  [inline, inherited]
 

00057 {m_runno = runh;}

void ParticleIDBase::setRunNo const double  runh = 8093  )  [inline, inherited]
 

00057 {m_runno = runh;}

int ParticleIDBase::tofcValid  )  const [inline, inherited]
 

00107 {return TOFC_VALID;}

int ParticleIDBase::tofcValid  )  const [inline, inherited]
 

00107 {return TOFC_VALID;}

int ParticleIDBase::tofeValid  )  const [inline, inherited]
 

00105 {return TOFE_VALID;}

int ParticleIDBase::tofeValid  )  const [inline, inherited]
 

00105 {return TOFE_VALID;}

int ParticleIDBase::tofqValid  )  const [inline, inherited]
 

00106 {return TOFQ_VALID;}

int ParticleIDBase::tofqValid  )  const [inline, inherited]
 

00106 {return TOFQ_VALID;}

int ParticleIDBase::tofValid  )  const [inline, inherited]
 

00104 {return TOF_VALID;}

int ParticleIDBase::tofValid  )  const [inline, inherited]
 

00104 {return TOF_VALID;}

int ParticleIDBase::useDedx  )  const [inline, inherited]
 

00077 {return USE_DEDX;}

int ParticleIDBase::useDedx  )  const [inline, inherited]
 

00077 {return USE_DEDX;}

int ParticleIDBase::useEmc  )  const [inline, inherited]
 

00084 {return USE_EMC;}

int ParticleIDBase::useEmc  )  const [inline, inherited]
 

00084 {return USE_EMC;}

int ParticleIDBase::useMuc  )  const [inline, inherited]
 

00085 {return USE_MUC;}

int ParticleIDBase::useMuc  )  const [inline, inherited]
 

00085 {return USE_MUC;}

int ParticleIDBase::useTof  )  const [inline, inherited]
 

00078 {return USE_TOF;}

int ParticleIDBase::useTof  )  const [inline, inherited]
 

00078 {return USE_TOF;}

int ParticleIDBase::useTof1  )  const [inline, inherited]
 

00079 {return USE_TOF1;}

int ParticleIDBase::useTof1  )  const [inline, inherited]
 

00079 {return USE_TOF1;}

int ParticleIDBase::useTof2  )  const [inline, inherited]
 

00080 {return USE_TOF2;}

int ParticleIDBase::useTof2  )  const [inline, inherited]
 

00080 {return USE_TOF2;}

int ParticleIDBase::useTofC  )  const [inline, inherited]
 

00083 {return USE_TOFC;}

int ParticleIDBase::useTofC  )  const [inline, inherited]
 

00083 {return USE_TOFC;}

int ParticleIDBase::useTofE  )  const [inline, inherited]
 

00081 {return USE_TOFE;}

int ParticleIDBase::useTofE  )  const [inline, inherited]
 

00081 {return USE_TOFE;}

int ParticleIDBase::useTofQ  )  const [inline, inherited]
 

00082 {return USE_TOFQ;}

int ParticleIDBase::useTofQ  )  const [inline, inherited]
 

00082 {return USE_TOFQ;}

double EmcPID::val_emc1  )  const [inline]
 

00034 {return m_val_emc;}

double EmcPID::val_emc1  )  const [inline]
 

00034 {return m_val_emc;}

double ParticleIDBase::velc  )  [inherited]
 

double ParticleIDBase::velc  )  [inherited]
 

00041                             {
00042   //  double vel = 29.9792458;  // tof_path unit in cm.
00043   double vel = 299.792458;   // tof path unit in mm
00044   return vel;
00045 }

double ParticleIDBase::xmass int  n  )  [inherited]
 

double ParticleIDBase::xmass int  n  )  [inherited]
 

00035                                   {
00036   double mass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
00037   if(n < 0 || n >=5) return 0.0;
00038   return mass[n];
00039 }


Member Data Documentation

double EmcPID::m_a20moment [private]
 

double EmcPID::m_a42moment [private]
 

double EmcPID::m_chi [private]
 

double EmcPID::m_chimin [private]
 

double EmcPID::m_delta_phi [private]
 

double EmcPID::m_delta_theta [private]
 

double EmcPID::m_e3x3 [private]
 

double EmcPID::m_e5x5 [private]
 

double EmcPID::m_e_h [private]
 

double EmcPID::m_energy [private]
 

double EmcPID::m_eseed [private]
 

double EmcPID::m_latmoment [private]
 

double EmcPID::m_m_h [private]
 

TMultiLayerPerceptron* EmcPID::m_mlp_emc [static, private]
 

TMultiLayerPerceptron* EmcPID::m_mlp_emc [static, private]
 

int EmcPID::m_ndof [private]
 

double EmcPID::m_p_h [private]
 

EmcPID* EmcPID::m_pointer [static, private]
 

EmcPID* EmcPID::m_pointer [static, private]
 

double EmcPID::m_prob [private]
 

double EmcPID::m_pt [private]
 

double EmcPID::m_ptrk [private]
 

double EmcPID::m_secondmoment [private]
 

TTree* EmcPID::m_trainTree_emconly [static, private]
 

TTree * EmcPID::m_trainTree_emconly = 0 [static, private]
 

int EmcPID::m_type [private]
 

double EmcPID::m_val_emc [private]
 

double EmcPID::params_emc1 [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:01:37 2011 for BOSS6.5.5 by  doxygen 1.3.9.1