DedxPID Class Reference

#include <DedxPID.h>

Inheritance diagram for DedxPID:

ParticleIDBase List of all members.

Public Member Functions

 ~DedxPID ()
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 normPH () const
double goodHits () const
int neuronPID () const
int getNhitCutDx () const
void setNhitCutDx (const int nhitcuthdx=5)
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 DedxPIDinstance ()

Protected Member Functions

int particleIDCalculation ()
int neuronPIDCalculation ()
double offsetDedx (int n, double ptrk, double cost)
double sigmaDedx (int n, double ptrk, double cost)
int LikelihoodCalculation ()
double mypol3 (double x, double par0, double par1, double par2, double par3)
double mypol5 (double x, double par0, double par1, double par2, double par3, double par4, double par5)
void inputpar ()
double CorrDedx (int n, double ptrk, double cost, double chi, int charge)
double iterate (double ptrk, double *mean, double *p)
double cal_par (int index1, double *m_jpsi_pip_ptrk_offset, double ptrk, double begin, double bin)

Static Protected Attributes

static std::string path = ""

Private Member Functions

 DedxPID ()

Private Attributes

double m_chi [5]
double m_prob [5]
double m_offset [5]
double m_sigma [5]
double m_chimin
double m_pdfmin
int m_ndof
int m_nhitcutdx
int m_readstate
double m_normPH
double m_probPH
double m_goodHits
int m_runxx
double m_jpsi_kap_ptrk_offset [12]
double m_jpsi_kap_ptrk_sigma [12]
double m_jpsi_kam_ptrk_offset [12]
double m_jpsi_kam_ptrk_sigma [12]
double m_jpsi_kap_theta_offset [18]
double m_jpsi_kap_theta_sigma [18]
double m_jpsi_kam_theta_offset [18]
double m_jpsi_kam_theta_sigma [18]
double m_jpsi_mc_kap_ptrk_offset [12]
double m_jpsi_mc_kap_ptrk_sigma [12]
double m_jpsi_mc_kam_ptrk_offset [12]
double m_jpsi_mc_kam_ptrk_sigma [12]
double m_jpsi_mc_kap_theta_offset [18]
double m_jpsi_mc_kap_theta_sigma [18]
double m_jpsi_mc_kam_theta_offset [18]
double m_jpsi_mc_kam_theta_sigma [18]
double m_jpsi_protonp_ptrk_offset [8]
double m_jpsi_protonp_ptrk_sigma [8]
double m_jpsi_protonm_ptrk_offset [8]
double m_jpsi_protonm_ptrk_sigma [8]
double m_jpsi_protonp_theta_offset [18]
double m_jpsi_protonp_theta_sigma [18]
double m_jpsi_protonm_theta_offset [18]
double m_jpsi_protonm_theta_sigma [18]
double m_jpsi_mc_protonp_ptrk_offset [8]
double m_jpsi_mc_protonp_ptrk_sigma [8]
double m_jpsi_mc_protonm_ptrk_offset [8]
double m_jpsi_mc_protonm_ptrk_sigma [8]
double m_jpsi_mc_protonp_theta_offset [18]
double m_jpsi_mc_protonp_theta_sigma [18]
double m_jpsi_mc_protonm_theta_offset [18]
double m_jpsi_mc_protonm_theta_sigma [18]
double m_psip_kap_ptrk_offset [9]
double m_psip_kap_ptrk_sigma [9]
double m_psip_kam_ptrk_offset [9]
double m_psip_kam_ptrk_sigma [9]
double m_psip_mc_kap_ptrk_offset [9]
double m_psip_mc_kap_ptrk_sigma [9]
double m_psip_mc_kam_ptrk_offset [9]
double m_psip_mc_kam_ptrk_sigma [9]
double m_psip_protonp_ptrk_offset [9]
double m_psip_protonp_ptrk_sigma [9]
double m_psip_protonm_ptrk_offset [9]
double m_psip_protonm_ptrk_sigma [9]
double m_psip_mc_protonp_ptrk_offset [9]
double m_psip_mc_protonp_ptrk_sigma [9]
double m_psip_mc_protonm_ptrk_offset [9]
double m_psip_mc_protonm_ptrk_sigma [9]
double m_psipp_pi_ptrk_offset [18]
double m_psipp_pi_ptrk_sigma [18]
double m_psipp_pi_theta_offset [16]
double m_psipp_pi_theta_sigma [16]
double m_psipp_mc_pi_ptrk_offset [18]
double m_psipp_mc_pi_ptrk_sigma [18]
double m_psipp_mc_pi_theta_offset [16]
double m_psipp_mc_pi_theta_sigma [16]
double m_psipp_ka_ptrk_offset [17]
double m_psipp_ka_ptrk_sigma [17]
double m_psipp_ka_theta_offset [16]
double m_psipp_ka_theta_sigma [16]
double m_psipp_mc_ka_ptrk_offset [17]
double m_psipp_mc_ka_ptrk_sigma [17]
double m_psipp_mc_ka_theta_offset [16]
double m_psipp_mc_ka_theta_sigma [16]
double m_psipp_proton_ptrk_offset [18]
double m_psipp_proton_ptrk_sigma [18]
double m_psipp_proton_theta_offset [18]
double m_psipp_proton_theta_sigma [18]
double m_psipp_mc_proton_ptrk_offset [9]
double m_psipp_mc_proton_ptrk_sigma [9]
double m_psipp_mc_proton_theta_offset [18]
double m_psipp_mc_proton_theta_sigma [18]

Static Private Attributes

static DedxPIDm_pointer = 0

Detailed Description

Definition at line 15 of file DedxPID.h.


Constructor & Destructor Documentation

DedxPID::~DedxPID (  )  [inline]

Definition at line 21 of file DedxPID.h.

00021 {;} 

DedxPID::DedxPID (  )  [private]

Definition at line 22 of file DedxPID.cxx.

References m_readstate.

Referenced by instance().

00022                 :ParticleIDBase() {
00023    m_readstate=0;
00024 }


Member Function Documentation

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

Definition at line 79 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_ELECTRON, ParticleIDBase::IDENTIFY_KAON, ParticleIDBase::IDENTIFY_PION, and ParticleIDBase::IDENTIFY_PROTON.

double DedxPID::cal_par ( int  index1,
double *  m_jpsi_pip_ptrk_offset,
double  ptrk,
double  begin,
double  bin 
) [protected]

Definition at line 878 of file DedxPID.cxx.

References iterate(), and ParticleIDBase::p().

Referenced by CorrDedx().

00878                                                                                                      {
00879    double mean1[3],p[3];
00880    p[0]=begin+(index1-1)*bin;
00881    p[1]=begin+index1*bin;
00882    p[2]=begin+(index1+1)*bin;
00883    mean1[0]=m_jpsi_pip_ptrk_offset[index1-1];
00884    mean1[1]=m_jpsi_pip_ptrk_offset[index1];
00885    mean1[2]=m_jpsi_pip_ptrk_offset[index1+1];
00886    double res=iterate(ptrk,mean1,p);
00887    return res;
00888 }

void DedxPID::calculate (  )  [virtual]

Implements ParticleIDBase.

Definition at line 42 of file DedxPID.cxx.

References inputpar(), m_ndof, m_readstate, and particleIDCalculation().

00042                         {
00043    //    int rundedx = getRunNo();
00044    if(!m_readstate) {
00045       inputpar();
00046       m_readstate=1;
00047    }
00048    if(particleIDCalculation() == 0) m_ndof=1;
00049 }

double ParticleIDBase::charge (  )  [inherited]

Definition at line 116 of file ParticleIDBase.cxx.

References DstMdcTrack::charge(), EvtRecTrack::isMdcTrackValid(), ParticleIDBase::m_trk, and EvtRecTrack::mdcTrack().

Referenced by TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), and particleIDCalculation().

00116                               {
00117    double val = 999;
00118    if(!m_trk) return val;
00119    if(!m_trk->isMdcTrackValid()) return val;
00120    RecMdcTrack *mdcTrk = m_trk->mdcTrack();
00121    val = mdcTrk->charge() + 0.0;
00122    return val;
00123 }

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

Implements ParticleIDBase.

Definition at line 26 of file DedxPID.h.

References m_chi.

00026 {return m_chi[n];}

double ParticleIDBase::chiMaxCut (  )  const [inline, inherited]

Definition at line 40 of file ParticleIDBase.h.

References ParticleIDBase::m_chimax_cut.

Referenced by TofCorrPID::correlationCheck(), TofCorrPID::particleIDCalculation(), and ParticleID::particleIDCalculation().

00040 {return m_chimax_cut;}

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

Definition at line 38 of file ParticleIDBase.h.

References ParticleIDBase::m_chimin_cut.

Referenced by TofCorrPID::correlationCheck(), TofPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), ParticleID::particleIDCalculation(), and particleIDCalculation().

00038 {return m_chimin_cut;}

double DedxPID::CorrDedx ( int  n,
double  ptrk,
double  cost,
double  chi,
int  charge 
) [protected]

Definition at line 134 of file DedxPID.cxx.

References cal_par(), ParticleIDBase::getRunNo(), m_jpsi_kam_ptrk_offset, m_jpsi_kam_ptrk_sigma, m_jpsi_kam_theta_offset, m_jpsi_kam_theta_sigma, m_jpsi_kap_ptrk_offset, m_jpsi_kap_ptrk_sigma, m_jpsi_kap_theta_offset, m_jpsi_kap_theta_sigma, m_jpsi_mc_kam_ptrk_offset, m_jpsi_mc_kam_ptrk_sigma, m_jpsi_mc_kam_theta_offset, m_jpsi_mc_kam_theta_sigma, m_jpsi_mc_kap_ptrk_offset, m_jpsi_mc_kap_ptrk_sigma, m_jpsi_mc_kap_theta_offset, m_jpsi_mc_kap_theta_sigma, m_jpsi_mc_protonm_ptrk_offset, m_jpsi_mc_protonm_ptrk_sigma, m_jpsi_mc_protonm_theta_offset, m_jpsi_mc_protonm_theta_sigma, m_jpsi_mc_protonp_ptrk_offset, m_jpsi_mc_protonp_ptrk_sigma, m_jpsi_mc_protonp_theta_offset, m_jpsi_mc_protonp_theta_sigma, m_jpsi_protonm_ptrk_offset, m_jpsi_protonm_ptrk_sigma, m_jpsi_protonm_theta_offset, m_jpsi_protonm_theta_sigma, m_jpsi_protonp_ptrk_offset, m_jpsi_protonp_ptrk_sigma, m_jpsi_protonp_theta_offset, m_jpsi_protonp_theta_sigma, m_psip_kam_ptrk_offset, m_psip_kam_ptrk_sigma, m_psip_kap_ptrk_offset, m_psip_kap_ptrk_sigma, m_psip_mc_kam_ptrk_offset, m_psip_mc_kam_ptrk_sigma, m_psip_mc_kap_ptrk_offset, m_psip_mc_kap_ptrk_sigma, m_psip_mc_protonm_ptrk_offset, m_psip_mc_protonm_ptrk_sigma, m_psip_mc_protonp_ptrk_offset, m_psip_mc_protonp_ptrk_sigma, m_psip_protonm_ptrk_offset, m_psip_protonm_ptrk_sigma, m_psip_protonp_ptrk_offset, m_psip_protonp_ptrk_sigma, m_psipp_ka_ptrk_offset, m_psipp_ka_ptrk_sigma, m_psipp_ka_theta_offset, m_psipp_ka_theta_sigma, m_psipp_mc_ka_ptrk_offset, m_psipp_mc_ka_ptrk_sigma, m_psipp_mc_ka_theta_offset, m_psipp_mc_ka_theta_sigma, m_psipp_mc_pi_ptrk_offset, m_psipp_mc_pi_ptrk_sigma, m_psipp_mc_pi_theta_offset, m_psipp_mc_pi_theta_sigma, m_psipp_mc_proton_ptrk_offset, m_psipp_mc_proton_ptrk_sigma, m_psipp_mc_proton_theta_offset, m_psipp_mc_proton_theta_sigma, m_psipp_pi_ptrk_offset, m_psipp_pi_ptrk_sigma, m_psipp_pi_theta_offset, m_psipp_pi_theta_sigma, m_psipp_proton_ptrk_offset, m_psipp_proton_ptrk_sigma, m_psipp_proton_theta_offset, m_psipp_proton_theta_sigma, and offset().

Referenced by particleIDCalculation().

00134                                                                               {
00135    int rundedx2 = getRunNo();
00136    double offset = 0.0;
00137    double offsetp = 0.0;
00138    double offsetc = 0.0;
00139    double sigcos = 1;
00140    double sigp = 1;
00141    double chicor=chi;
00142    //   double gb = ptrk/xmass(n);
00143 
00144    switch(n) {
00145    case 0: { // Electron
00146       break;
00147    }
00148 
00149    case 1: {// Muon
00150       break;
00151    }
00152 
00153    case 2: {// Pion
00154       //     double  ptemp = ptrk;
00155       double  costm = cost;
00156       if(ptrk<0.1||ptrk>1) break;
00157       int index = int((ptrk-0.1)/0.05);
00158       if(index<=0) index=1;
00159       if(index>=17) index=16;
00160 
00161       if(fabs(costm)>=0.8) break;
00162       int index1 = int((costm+0.8)/0.1);
00163       if(index1<=0) index1=1;
00164       if(index1>=15) index1=14;
00165 
00166       //psipp data
00167       if(rundedx2>=11414&&rundedx2<=14604) {
00168          offsetp = cal_par(index,m_psipp_pi_ptrk_offset,ptrk,0.125,0.05);
00169          sigp = cal_par(index,m_psipp_pi_ptrk_sigma,ptrk,0.125,0.05);
00170          offsetc = cal_par(index1,m_psipp_pi_theta_offset,costm,-0.75,0.1);
00171          sigcos = cal_par(index1,m_psipp_pi_theta_sigma,costm,-0.75,0.1);
00172       }
00173       //psipp mc
00174       if(rundedx2<=-11414&&rundedx2>=-14604) {
00175          offsetp = cal_par(index,m_psipp_mc_pi_ptrk_offset,ptrk,0.125,0.05);
00176          sigp = cal_par(index,m_psipp_mc_pi_ptrk_sigma,ptrk,0.125,0.05);
00177          offsetc = cal_par(index1,m_psipp_mc_pi_theta_offset,costm,-0.75,0.1);
00178          sigcos = cal_par(index1,m_psipp_mc_pi_theta_sigma,costm,-0.75,0.1);
00179       }
00180 
00181       offset=offsetp+sigp*offsetc;
00182       chicor=(chicor-offset)/(sigcos*sigp);
00183       break;
00184    }
00185 
00186    case 3: {// Kaon
00187       //     double  ptemp = ptrk;
00188       double  costm = cost;
00189       if(ptrk<0.3||ptrk>0.8) break;
00190       offset=0;
00191       int index = int((ptrk-0.3)/0.1);
00192       if(index<=0) index=1;
00193       if(index>=4) index=3;
00194 
00195       int index1 = int((costm+0.9)/0.1);
00196       if(index1<=0) index1=1;
00197       if(index1>=17) index1=16;
00198       //data Jpsi
00199       if(rundedx2>=9947&&rundedx2<=10878) {
00200          if(charge>0) {
00201             offsetp = cal_par(index,m_jpsi_kap_ptrk_offset,ptrk,0.35,0.1);
00202             sigp = cal_par(index,m_jpsi_kap_ptrk_sigma,ptrk,0.35,0.1);
00203             if(fabs(costm)<=0.83) {
00204                offsetc = cal_par(index1,m_jpsi_kap_theta_offset,costm,-0.85,0.1);
00205                sigcos = cal_par(index1,m_jpsi_kap_theta_sigma,costm,-0.85,0.1);
00206             }
00207          }
00208          if(charge<0) {
00209             offsetp = cal_par(index,m_jpsi_kam_ptrk_offset,ptrk,0.35,0.1);
00210             sigp = cal_par(index,m_jpsi_kam_ptrk_sigma,ptrk,0.35,0.1);
00211             if(fabs(costm)<=0.83) {
00212                offsetc = cal_par(index1,m_jpsi_kam_theta_offset,costm,-0.85,0.1);
00213                sigcos = cal_par(index1,m_jpsi_kam_theta_sigma,costm,-0.85,0.1);
00214             }
00215          }
00216       }
00217 
00218       //mc Jpsi
00219       if(rundedx2<=-9947&&rundedx2>=-10878) {
00220          if(charge>0) {
00221             offsetp = cal_par(index,m_jpsi_mc_kap_ptrk_offset,ptrk,0.35,0.1);
00222             sigp = cal_par(index,m_jpsi_mc_kap_ptrk_sigma,ptrk,0.35,0.1);
00223             if(fabs(costm)<=0.83) {
00224                offsetc = cal_par(index1,m_jpsi_mc_kap_theta_offset,costm,-0.85,0.1);
00225                sigcos = cal_par(index1,m_jpsi_mc_kap_theta_sigma,costm,-0.85,0.1);
00226             }
00227          }
00228          if(charge<0) {
00229             offsetp = cal_par(index,m_jpsi_mc_kam_ptrk_offset,ptrk,0.35,0.1);
00230             sigp = cal_par(index,m_jpsi_mc_kam_ptrk_sigma,ptrk,0.35,0.1);
00231             if(fabs(costm)<=0.83) {
00232                offsetc = cal_par(index1,m_jpsi_mc_kam_theta_offset,costm,-0.85,0.1);
00233                sigcos = cal_par(index1,m_jpsi_mc_kam_theta_sigma,costm,-0.85,0.1);
00234             }
00235          }
00236       }
00237 
00238       //data Psip
00239       if(rundedx2>=8093&&rundedx2<=9025) {
00240          if(ptrk<0.3||ptrk>1.2) break;
00241          index = int((ptrk-0.3)/0.1);
00242          if(index<=0) index=1;
00243          if(index>=8) index=7;
00244          if(charge>0) {
00245             offsetp = cal_par(index,m_psip_kap_ptrk_offset,ptrk,0.35,0.1);
00246             sigp = cal_par(index,m_psip_kap_ptrk_sigma,ptrk,0.35,0.1);
00247          }
00248          if(charge<0) {
00249             offsetp = cal_par(index,m_psip_kam_ptrk_offset,ptrk,0.35,0.1);
00250             sigp = cal_par(index,m_psip_kam_ptrk_sigma,ptrk,0.35,0.1);
00251          }
00252       }
00253 
00254       //mc Psip
00255       if(rundedx2<=-8093&&rundedx2>=-9025) {
00256          //    if(ptrk < 0.4) ptrk = 0.4;
00257          if(ptrk<0.3||ptrk>1.2) break;
00258          index = int((ptrk-0.3)/0.1);
00259          if(index<=0) index=1;
00260          if(index>=8) index=7;
00261          if(charge>0) {
00262             offsetp = cal_par(index,m_psip_mc_kap_ptrk_offset,ptrk,0.35,0.1);
00263             sigp = cal_par(index,m_psip_mc_kap_ptrk_sigma,ptrk,0.35,0.1);
00264          }
00265          if(charge<0) {
00266             offsetp = cal_par(index,m_psip_mc_kam_ptrk_offset,ptrk,0.35,0.1);
00267             sigp = cal_par(index,m_psip_mc_kam_ptrk_sigma,ptrk,0.35,0.1);
00268          }
00269       }
00270 
00271 
00272       //psipp kaon data
00273       if(rundedx2>=11414&&rundedx2<=14604) {
00274          if(ptrk<0.15||ptrk>1) break;
00275          index = int((ptrk-0.15)/0.05);
00276          if(index<=0) index=1;
00277          if(index>=16) index=15;
00278          if(fabs(costm)>=0.8) break;
00279          index1 = int((costm+0.8)/0.1);
00280          if(index1<=0) index1=1;
00281          if(index1>=15) index1=14;
00282 
00283          offsetp = cal_par(index,m_psipp_ka_ptrk_offset,ptrk,0.175,0.05);
00284          sigp = cal_par(index,m_psipp_ka_ptrk_sigma,ptrk,0.175,0.05);
00285          offsetc = cal_par(index1,m_psipp_ka_theta_offset,costm,-0.75,0.1);
00286          sigcos = cal_par(index1,m_psipp_ka_theta_sigma,costm,-0.75,0.1);
00287       }
00288       //psipp kaon mc
00289       if(rundedx2<=-11414&&rundedx2>=-14604) {
00290          if(ptrk<0.15||ptrk>1) break;
00291          index = int((ptrk-0.15)/0.05);
00292          if(index<=0) index=1;
00293          if(index>=16) index=15;
00294          if(fabs(costm)>=0.8) break;
00295          index1 = int((costm+0.8)/0.1);
00296          if(index1<=0) index1=1;
00297          if(index1>=15) index1=14;
00298          offsetp = cal_par(index,m_psipp_mc_ka_ptrk_offset,ptrk,0.175,0.05);
00299          sigp = cal_par(index,m_psipp_mc_ka_ptrk_sigma,ptrk,0.175,0.05);
00300          offsetc = cal_par(index1,m_psipp_mc_ka_theta_offset,costm,-0.75,0.1);
00301          sigcos = cal_par(index1,m_psipp_mc_ka_theta_sigma,costm,-0.75,0.1);
00302       }
00303 
00304       offset=offsetp+sigp*offsetc;
00305       chicor=(chicor-offset)/(sigcos*sigp);
00306       break;
00307    }
00308 
00309    case 4 : { // Proton
00310       //     double  ptemp = ptrk;
00311       double  costm = cost;
00312       if(ptrk<0.3||ptrk>1.1) break;
00313       int index = int((ptrk-0.3)/0.1);
00314       if(index<=0) index=1;
00315       if(index>=7) index=6;
00316 
00317       int index1 = int((costm+0.9)/0.1);
00318       if(index1<=0) index1=1;
00319       if(index1>=17) index1=16;
00320 
00321       //    double plog = log(ptemp);
00322       offset=0;
00323       if(rundedx2>=9947&&rundedx2<=10878) {
00324          if(charge>0) {
00325             offsetp = cal_par(index,m_jpsi_protonp_ptrk_offset,ptrk,0.35,0.1);
00326             sigp = cal_par(index,m_jpsi_protonp_ptrk_sigma,ptrk,0.35,0.1);
00327             if(fabs(costm)<=0.83) {
00328                offsetc = cal_par(index1,m_jpsi_protonp_theta_offset,costm,-0.85,0.1);
00329                sigcos = cal_par(index1,m_jpsi_protonp_theta_sigma,costm,-0.85,0.1);
00330             }
00331          }
00332          if(charge<0) {
00333             offsetp = cal_par(index,m_jpsi_protonm_ptrk_offset,ptrk,0.35,0.1);
00334             sigp = cal_par(index,m_jpsi_protonm_ptrk_sigma,ptrk,0.35,0.1);
00335             if(fabs(costm)<=0.83) {
00336                offsetc = cal_par(index1,m_jpsi_protonm_theta_offset,costm,-0.85,0.1);
00337                sigcos = cal_par(index1,m_jpsi_protonm_theta_sigma,costm,-0.85,0.1);
00338             }
00339          }
00340       }
00341 
00342       //mc JPsi
00343       if(rundedx2<=-9947&&rundedx2>=-10878) {
00344          if(charge>0) {
00345             offsetp = cal_par(index,m_jpsi_mc_protonp_ptrk_offset,ptrk,0.35,0.1);
00346             sigp = cal_par(index,m_jpsi_mc_protonp_ptrk_sigma,ptrk,0.35,0.1);
00347             if(fabs(costm)<=0.83) {
00348                offsetc = cal_par(index1,m_jpsi_mc_protonp_theta_offset,costm,-0.85,0.1);
00349                sigcos = cal_par(index1,m_jpsi_mc_protonp_theta_sigma,costm,-0.85,0.1);
00350             }
00351          }
00352          if(charge<0) {
00353             offsetp = cal_par(index,m_jpsi_mc_protonm_ptrk_offset,ptrk,0.35,0.1);
00354             sigp = cal_par(index,m_jpsi_mc_protonm_ptrk_sigma,ptrk,0.35,0.1);
00355             if(fabs(costm)<=0.83) {
00356                offsetc = cal_par(index1,m_jpsi_mc_protonm_theta_offset,costm,-0.85,0.1);
00357                sigcos = cal_par(index1,m_jpsi_mc_protonm_theta_sigma,costm,-0.85,0.1);
00358             }
00359          }
00360       }
00361 
00362       //data Psip
00363       if(rundedx2>=8093&&rundedx2<=9025) {
00364          if(charge>0) {
00365             offsetp = cal_par(index,m_psip_protonp_ptrk_offset,ptrk,0.35,0.1);
00366             sigp = cal_par(index,m_psip_protonp_ptrk_sigma,ptrk,0.35,0.1);
00367          }
00368          if(charge<0) {
00369             offsetp = cal_par(index,m_psip_protonm_ptrk_offset,ptrk,0.35,0.1);
00370             sigp = cal_par(index,m_psip_protonm_ptrk_sigma,ptrk,0.35,0.1);
00371          }
00372       }
00373 
00374       //mc Psip
00375       if(rundedx2<=-8093&&rundedx2>=-9025) {
00376          if(charge>0) {
00377             offsetp = cal_par(index,m_psip_mc_protonp_ptrk_offset,ptrk,0.35,0.1);
00378             sigp = cal_par(index,m_psip_mc_protonp_ptrk_sigma,ptrk,0.35,0.1);
00379          }
00380          if(charge<0) {
00381             offsetp = cal_par(index,m_psip_mc_protonm_ptrk_offset,ptrk,0.35,0.1);
00382             sigp = cal_par(index,m_psip_mc_protonm_ptrk_sigma,ptrk,0.35,0.1);
00383          }
00384       }
00385 
00386       //psipp proton data
00387       if(rundedx2>=11414&&rundedx2<=14604) {
00388          if(ptrk<0.2||ptrk>1.1) break;
00389          index = int((ptrk-0.2)/0.05);
00390          if(index<=0) index=1;
00391          if(index>=17) index=16;
00392          if(fabs(costm)>=0.83) break;
00393          index1 = int((costm+0.9)/0.1);
00394          if(index1<=0) index1=1;
00395          if(index1>=17) index1=16;
00396 
00397          offsetp = cal_par(index,m_psipp_proton_ptrk_offset,ptrk,0.225,0.05);
00398          sigp = cal_par(index,m_psipp_proton_ptrk_sigma,ptrk,0.225,0.05);
00399          offsetc = cal_par(index1,m_psipp_proton_theta_offset,costm,-0.85,0.1);
00400          sigcos = cal_par(index1,m_psipp_proton_theta_sigma,costm,-0.85,0.1);
00401       }
00402       //psipp proton mc
00403       if(rundedx2<=-11414&&rundedx2>=-14604) {
00404          if(ptrk<0.2||ptrk>1.1) break;
00405          index = int((ptrk-0.2)/0.1);
00406          if(index<=0) index=1;
00407          if(index>=8) index=7;
00408          if(fabs(costm)>=0.83) break;
00409          index1 = int((costm+0.9)/0.1);
00410          if(index1<=0) index1=1;
00411          if(index1>=17) index1=16;
00412          offsetp = cal_par(index,m_psipp_mc_proton_ptrk_offset,ptrk,0.25,0.1);
00413          sigp = cal_par(index,m_psipp_mc_proton_ptrk_sigma,ptrk,0.25,0.1);
00414          offsetc = cal_par(index1,m_psipp_mc_proton_theta_offset,costm,-0.85,0.1);
00415          sigcos = cal_par(index1,m_psipp_mc_proton_theta_sigma,costm,-0.85,0.1);
00416       }
00417       offset=offsetp+sigp*offsetc;
00418       chicor=(chicor-offset)/(sigcos*sigp);
00419       break;
00420    }
00421 
00422    default:
00423       offset = 0.0;
00424       break;
00425    }
00426    //  offset = 0.0;
00427    return chicor;
00428 }

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

Definition at line 91 of file ParticleIDBase.h.

References ParticleIDBase::DEDX_VALID.

00091 {return DEDX_VALID;}

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

Definition at line 97 of file ParticleIDBase.h.

References ParticleIDBase::EMC_VALID.

00097 {return EMC_VALID;}

int DedxPID::getNhitCutDx (  )  const [inline]

Definition at line 34 of file DedxPID.h.

References m_nhitcutdx.

Referenced by particleIDCalculation().

00034 {return m_nhitcutdx;}

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

Definition at line 44 of file ParticleIDBase.h.

References ParticleIDBase::m_runno.

Referenced by TofCPID::calculate(), CorrDedx(), TofCorrPID::init(), TofCPID::offsetTofC(), TofCorrPID::sigmaTof(), and TofCPID::sigmaTofC().

00044 {return m_runno;}

double DedxPID::goodHits (  )  const [inline]

Definition at line 32 of file DedxPID.h.

References m_goodHits.

00032 {return m_goodHits;}

void DedxPID::init (  )  [virtual]

Implements ParticleIDBase.

Definition at line 26 of file DedxPID.cxx.

References genRecEmupikp::i, m_chi, m_chimin, m_goodHits, m_ndof, m_nhitcutdx, m_normPH, m_offset, m_pdfmin, m_prob, m_probPH, and m_sigma.

Referenced by ParticleID::init().

00026                    {
00027    for(int i = 0; i < 5; i++) {
00028       m_chi[i] = 99.0;
00029       m_prob[i] = -1.0;
00030       m_offset[i] = 99.0;
00031       m_sigma[i] = 1.0;
00032    }
00033    m_chimin = 99.;
00034    m_pdfmin =99;
00035    m_ndof = 0;
00036    m_goodHits = -99;
00037    m_normPH = -99;
00038    m_probPH = -99;
00039    m_nhitcutdx=5;
00040 }

void DedxPID::inputpar (  )  [protected]

Definition at line 495 of file DedxPID.cxx.

References genRecEmupikp::i, m_jpsi_kam_ptrk_offset, m_jpsi_kam_ptrk_sigma, m_jpsi_kam_theta_offset, m_jpsi_kam_theta_sigma, m_jpsi_kap_ptrk_offset, m_jpsi_kap_ptrk_sigma, m_jpsi_kap_theta_offset, m_jpsi_kap_theta_sigma, m_jpsi_mc_kam_ptrk_offset, m_jpsi_mc_kam_ptrk_sigma, m_jpsi_mc_kam_theta_offset, m_jpsi_mc_kam_theta_sigma, m_jpsi_mc_kap_ptrk_offset, m_jpsi_mc_kap_ptrk_sigma, m_jpsi_mc_kap_theta_offset, m_jpsi_mc_kap_theta_sigma, m_jpsi_mc_protonm_ptrk_offset, m_jpsi_mc_protonm_ptrk_sigma, m_jpsi_mc_protonm_theta_offset, m_jpsi_mc_protonm_theta_sigma, m_jpsi_mc_protonp_ptrk_offset, m_jpsi_mc_protonp_ptrk_sigma, m_jpsi_mc_protonp_theta_offset, m_jpsi_mc_protonp_theta_sigma, m_jpsi_protonm_ptrk_offset, m_jpsi_protonm_ptrk_sigma, m_jpsi_protonm_theta_offset, m_jpsi_protonm_theta_sigma, m_jpsi_protonp_ptrk_offset, m_jpsi_protonp_ptrk_sigma, m_jpsi_protonp_theta_offset, m_jpsi_protonp_theta_sigma, m_psip_kam_ptrk_offset, m_psip_kam_ptrk_sigma, m_psip_kap_ptrk_offset, m_psip_kap_ptrk_sigma, m_psip_mc_kam_ptrk_offset, m_psip_mc_kam_ptrk_sigma, m_psip_mc_kap_ptrk_offset, m_psip_mc_kap_ptrk_sigma, m_psip_mc_protonm_ptrk_offset, m_psip_mc_protonm_ptrk_sigma, m_psip_mc_protonp_ptrk_offset, m_psip_mc_protonp_ptrk_sigma, m_psip_protonm_ptrk_offset, m_psip_protonm_ptrk_sigma, m_psip_protonp_ptrk_offset, m_psip_protonp_ptrk_sigma, m_psipp_ka_ptrk_offset, m_psipp_ka_ptrk_sigma, m_psipp_ka_theta_offset, m_psipp_ka_theta_sigma, m_psipp_mc_ka_ptrk_offset, m_psipp_mc_ka_ptrk_sigma, m_psipp_mc_ka_theta_offset, m_psipp_mc_ka_theta_sigma, m_psipp_mc_pi_ptrk_offset, m_psipp_mc_pi_ptrk_sigma, m_psipp_mc_pi_theta_offset, m_psipp_mc_pi_theta_sigma, m_psipp_mc_proton_ptrk_offset, m_psipp_mc_proton_ptrk_sigma, m_psipp_mc_proton_theta_offset, m_psipp_mc_proton_theta_sigma, m_psipp_pi_ptrk_offset, m_psipp_pi_ptrk_sigma, m_psipp_pi_theta_offset, m_psipp_pi_theta_sigma, m_psipp_proton_ptrk_offset, m_psipp_proton_ptrk_sigma, m_psipp_proton_theta_offset, m_psipp_proton_theta_sigma, ParticleIDBase::path, and deljobs::string.

Referenced by calculate().

00495                        {
00496 
00497    //Jpsi ka+ momentum correction
00498    std::string jpsi_kap_mom = path + "/share/JPsi/kaon/dedx_kap.txt";
00499    std::string jpsi_kap_mom_mc = path + "/share/JPsi/kaon/dedx_kap_mc.txt";
00500    ifstream inputmomdata6(jpsi_kap_mom.c_str(),std::ios_base::in);
00501    if ( !inputmomdata6 ) {
00502       cout << " can not open: " << jpsi_kap_mom << endl;
00503       exit(1);
00504    }
00505    ifstream inputmomdata6mc(jpsi_kap_mom_mc.c_str(),std::ios_base::in);
00506    if ( !inputmomdata6mc ) {
00507       cout << " can not open: " << jpsi_kap_mom_mc << endl;
00508       exit(1);
00509    }
00510    for(int i=0; i<12; i++) {
00511       inputmomdata6>>m_jpsi_kap_ptrk_offset[i];
00512       inputmomdata6>>m_jpsi_kap_ptrk_sigma[i];
00513       inputmomdata6mc>>m_jpsi_mc_kap_ptrk_offset[i];
00514       inputmomdata6mc>>m_jpsi_mc_kap_ptrk_sigma[i];
00515    }
00516 
00517    //Jpsi ka- momentum correction
00518    std::string jpsi_kam_mom = path + "/share/JPsi/kaon/dedx_kam.txt";
00519    std::string jpsi_kam_mom_mc =  path + "/share/JPsi/kaon/dedx_kam_mc.txt";
00520    ifstream inputmomdata7(jpsi_kam_mom.c_str(),std::ios_base::in);
00521    if ( !inputmomdata7 ) {
00522       cout << " can not open: " << jpsi_kam_mom << endl;
00523       exit(1);
00524    }
00525    ifstream inputmomdata7mc(jpsi_kam_mom_mc.c_str(),std::ios_base::in);
00526    if ( !inputmomdata7mc ) {
00527       cout << " can not open: " << jpsi_kam_mom_mc << endl;
00528       exit(1);
00529    }
00530    for(int i=0; i<12; i++) {
00531       inputmomdata7>>m_jpsi_kam_ptrk_offset[i];
00532       inputmomdata7>>m_jpsi_kam_ptrk_sigma[i];
00533       inputmomdata7mc>>m_jpsi_mc_kam_ptrk_offset[i];
00534       inputmomdata7mc>>m_jpsi_mc_kam_ptrk_sigma[i];
00535 
00536    }
00537 
00538 
00539    //Jpsi ka+ theta correction
00540    std::string jpsi_kap_the =  path + "/share/JPsi/kaon/dedx_kap_theta.txt";
00541    std::string jpsi_kap_the_mc =  path + "/share/JPsi/kaon/dedx_kap_theta_mc.txt";
00542    ifstream inputmomdata8(jpsi_kap_the.c_str(),std::ios_base::in);
00543    if ( !inputmomdata8 ) {
00544       cout << " can not open: " << jpsi_kap_the << endl;
00545       exit(1);
00546    }
00547    ifstream inputmomdata8mc(jpsi_kap_the_mc.c_str(),std::ios_base::in);
00548    if ( !inputmomdata8mc ) {
00549       cout << " can not open: " << jpsi_kap_the_mc << endl;
00550       exit(1);
00551    }
00552    for(int i=0; i<18; i++) {
00553       inputmomdata8>>m_jpsi_kap_theta_offset[i];
00554       inputmomdata8>>m_jpsi_kap_theta_sigma[i];
00555       inputmomdata8mc>>m_jpsi_mc_kap_theta_offset[i];
00556       inputmomdata8mc>>m_jpsi_mc_kap_theta_sigma[i];
00557    }
00558 
00559    //Jpsi ka- theta correction
00560    std::string jpsi_kam_the =  path + "/share/JPsi/kaon/dedx_kam_theta.txt";
00561    std::string jpsi_kam_the_mc =  path + "/share/JPsi/kaon/dedx_kam_theta_mc.txt";
00562    ifstream inputmomdata9(jpsi_kam_the.c_str(),std::ios_base::in);
00563    if ( !inputmomdata9 ) {
00564       cout << " can not open: " << jpsi_kam_the << endl;
00565       exit(1);
00566    }
00567    ifstream inputmomdata9mc(jpsi_kam_the_mc.c_str(),std::ios_base::in);
00568    if ( !inputmomdata9mc ) {
00569       cout << " can not open: " << jpsi_kam_the_mc << endl;
00570       exit(1);
00571    }
00572    for(int i=0; i<18; i++) {
00573       inputmomdata9>>m_jpsi_kam_theta_offset[i];
00574       inputmomdata9>>m_jpsi_kam_theta_sigma[i];
00575       inputmomdata9mc>>m_jpsi_mc_kam_theta_offset[i];
00576       inputmomdata9mc>>m_jpsi_mc_kam_theta_sigma[i];
00577    }
00578 
00579    //Jpsi proton+ momentum correction
00580    std::string jpsi_protonp_mom =  path + "/share/JPsi/proton/dedx_protonp.txt";
00581    std::string jpsi_protonp_mom_mc =  path + "/share/JPsi/proton/dedx_protonp_mc.txt";
00582    ifstream inputmomdata12(jpsi_protonp_mom.c_str(),std::ios_base::in);
00583    if ( !inputmomdata12 ) {
00584       cout << " can not open: " << jpsi_protonp_mom << endl;
00585       exit(1);
00586    }
00587    ifstream inputmomdata12mc(jpsi_protonp_mom_mc.c_str(),std::ios_base::in);
00588    if ( !inputmomdata12mc ) {
00589       cout << " can not open: " << jpsi_protonp_mom_mc << endl;
00590       exit(1);
00591    }
00592    for(int i=0; i<8; i++) {
00593       inputmomdata12>>m_jpsi_protonp_ptrk_offset[i];
00594       inputmomdata12>>m_jpsi_protonp_ptrk_sigma[i];
00595       inputmomdata12mc>>m_jpsi_mc_protonp_ptrk_offset[i];
00596       inputmomdata12mc>>m_jpsi_mc_protonp_ptrk_sigma[i];
00597    }
00598 
00599    //Jpsi proton- momentum correction
00600    std::string jpsi_protonm_mom =  path + "/share/JPsi/proton/dedx_protonm.txt";
00601    std::string jpsi_protonm_mom_mc =  path + "/share/JPsi/proton/dedx_protonm_mc.txt";
00602    ifstream inputmomdata13(jpsi_protonm_mom.c_str(),std::ios_base::in);
00603    if ( !inputmomdata13 ) {
00604       cout << " can not open: " << jpsi_protonm_mom << endl;
00605       exit(1);
00606    }
00607    ifstream inputmomdata13mc(jpsi_protonm_mom_mc.c_str(),std::ios_base::in);
00608    if ( !inputmomdata13mc ) {
00609       cout << " can not open: " << jpsi_protonm_mom_mc << endl;
00610       exit(1);
00611    }
00612    for(int i=0; i<8; i++) {
00613       inputmomdata13>>m_jpsi_protonm_ptrk_offset[i];
00614       inputmomdata13>>m_jpsi_protonm_ptrk_sigma[i];
00615       inputmomdata13mc>>m_jpsi_mc_protonm_ptrk_offset[i];
00616       inputmomdata13mc>>m_jpsi_mc_protonm_ptrk_sigma[i];
00617    }
00618 
00619    //Jpsi proton+ theta correction
00620    std::string jpsi_protonp_the = path + "/share/JPsi/proton/dedx_protonp_theta.txt";
00621    std::string jpsi_protonp_the_mc = path + "/share/JPsi/proton/dedx_protonp_theta_mc.txt";
00622 
00623    ifstream inputmomdata14(jpsi_protonp_the.c_str(),std::ios_base::in);
00624    if ( !inputmomdata14 ) {
00625       cout << " can not open: " << jpsi_protonp_the << endl;
00626       exit(1);
00627    }
00628    ifstream inputmomdata14mc(jpsi_protonp_the_mc.c_str(),std::ios_base::in);
00629    if ( !inputmomdata14mc ) {
00630       cout << " can not open: " << jpsi_protonp_the_mc << endl;
00631       exit(1);
00632    }
00633    for(int i=0; i<18; i++) {
00634       inputmomdata14>>m_jpsi_protonp_theta_offset[i];
00635       inputmomdata14>>m_jpsi_protonp_theta_sigma[i];
00636       inputmomdata14mc>>m_jpsi_mc_protonp_theta_offset[i];
00637       inputmomdata14mc>>m_jpsi_mc_protonp_theta_sigma[i];
00638    }
00639 
00640    //Jpsi proton- theta correction
00641    std::string jpsi_protonm_the = path + "/share/JPsi/proton/dedx_protonm_theta.txt";
00642    std::string jpsi_protonm_the_mc = path + "/share/JPsi/proton/dedx_protonm_theta_mc.txt";
00643    ifstream inputmomdata15(jpsi_protonm_the.c_str(),std::ios_base::in);
00644    if ( !inputmomdata15 ) {
00645       cout << " can not open: " << jpsi_protonm_the << endl;
00646       exit(1);
00647    }
00648    ifstream inputmomdata15mc(jpsi_protonm_the_mc.c_str(),std::ios_base::in);
00649    if ( !inputmomdata15mc ) {
00650       cout << " can not open: " << jpsi_protonm_the_mc << endl;
00651       exit(1);
00652    }
00653    for(int i=0; i<18; i++) {
00654       inputmomdata15>>m_jpsi_protonm_theta_offset[i];
00655       inputmomdata15>>m_jpsi_protonm_theta_sigma[i];
00656       inputmomdata15mc>>m_jpsi_mc_protonm_theta_offset[i];
00657       inputmomdata15mc>>m_jpsi_mc_protonm_theta_sigma[i];
00658    }
00659 
00660 
00661 
00662 
00663    // Psip ka+ momentum correction
00664    std::string psip_kap_mom = path + "/share/Psip/kaon/dedx_kap.txt";
00665    std::string psip_kap_mom_mc = path + "/share/Psip/kaon/dedx_kap_mc.txt";
00666    ifstream inputmomdata24(psip_kap_mom.c_str(),std::ios_base::in);
00667    if ( !inputmomdata24 ) {
00668       cout << " can not open: " << psip_kap_mom << endl;
00669       exit(1);
00670    }
00671    ifstream inputmomdata24mc(psip_kap_mom_mc.c_str(),std::ios_base::in);
00672    if ( !inputmomdata24mc ) {
00673       cout << " can not open: " << psip_kap_mom_mc << endl;
00674       exit(1);
00675    }
00676    for(int i=0; i<9; i++) {
00677       inputmomdata24>>m_psip_kap_ptrk_offset[i];
00678       inputmomdata24>>m_psip_kap_ptrk_sigma[i];
00679       inputmomdata24mc>>m_psip_mc_kap_ptrk_offset[i];
00680       inputmomdata24mc>>m_psip_mc_kap_ptrk_sigma[i];
00681    }
00682 
00683    //Psip ka- momentum correction
00684    std::string psip_kam_mom = path + "/share/Psip/kaon/dedx_kam.txt";
00685    std::string psip_kam_mom_mc = path + "/share/Psip/kaon/dedx_kam_mc.txt";
00686    ifstream inputmomdata25(psip_kam_mom.c_str(),std::ios_base::in);
00687    if ( !inputmomdata25 ) {
00688       cout << " can not open: " << psip_kam_mom << endl;
00689       exit(1);
00690    }
00691    ifstream inputmomdata25mc(psip_kam_mom_mc.c_str(),std::ios_base::in);
00692    if ( !inputmomdata25mc ) {
00693       cout << " can not open: " << psip_kam_mom_mc << endl;
00694       exit(1);
00695    }
00696    for(int i=0; i<9; i++) {
00697       inputmomdata25>>m_psip_kam_ptrk_offset[i];
00698       inputmomdata25>>m_psip_kam_ptrk_sigma[i];
00699       inputmomdata25mc>>m_psip_mc_kam_ptrk_offset[i];
00700       inputmomdata25mc>>m_psip_mc_kam_ptrk_sigma[i];
00701    }
00702 
00703 
00704    // Psip proton+ momentum correction
00705    std::string psip_protonp_mom = path + "/share/Psip/proton/dedx_protonp.txt";
00706    std::string psip_protonp_mom_mc = path + "/share/Psip/proton/dedx_protonp_mc.txt";
00707    ifstream inputmomdata26(psip_protonp_mom.c_str(),std::ios_base::in);
00708    if ( !inputmomdata26 ) {
00709       cout << " can not open: " << psip_protonp_mom << endl;
00710       exit(1);
00711    }
00712    ifstream inputmomdata26mc(psip_protonp_mom_mc.c_str(),std::ios_base::in);
00713    if ( !inputmomdata26mc ) {
00714       cout << " can not open: " << psip_protonp_mom_mc << endl;
00715       exit(1);
00716    }
00717    for(int i=0; i<9; i++) {
00718       inputmomdata26>>m_psip_protonp_ptrk_offset[i];
00719       inputmomdata26>>m_psip_protonp_ptrk_sigma[i];
00720       inputmomdata26mc>>m_psip_mc_protonp_ptrk_offset[i];
00721       inputmomdata26mc>>m_psip_mc_protonp_ptrk_sigma[i];
00722    }
00723 
00724    //Psip proton- momentum correction
00725    std::string psip_protonm_mom = path + "/share/Psip/proton/dedx_protonm.txt";
00726    std::string psip_protonm_mom_mc = path + "/share/Psip/proton/dedx_protonm_mc.txt";
00727    ifstream inputmomdata27(psip_protonm_mom.c_str(),std::ios_base::in);
00728    if ( !inputmomdata27 ) {
00729       cout << " can not open: " << psip_protonm_mom << endl;
00730       exit(1);
00731    }
00732    ifstream inputmomdata27mc(psip_protonm_mom_mc.c_str(),std::ios_base::in);
00733    if ( !inputmomdata27mc ) {
00734       cout << " can not open: " << psip_protonm_mom_mc << endl;
00735       exit(1);
00736    }
00737    for(int i=0; i<9; i++) {
00738       inputmomdata27>>m_psip_protonm_ptrk_offset[i];
00739       inputmomdata27>>m_psip_protonm_ptrk_sigma[i];
00740       inputmomdata27mc>>m_psip_mc_protonm_ptrk_offset[i];
00741       inputmomdata27mc>>m_psip_mc_protonm_ptrk_sigma[i];
00742    }
00743 
00744    //Psipp pi momentum correction
00745    std::string psipp_pi_mom = path + "/share/Psipp/pion/dedx_pi.txt";
00746    std::string psipp_pi_mom_mc = path + "/share/Psipp/pion/dedx_pi_mc.txt";
00747    ifstream inputmomdata28(psipp_pi_mom.c_str(),std::ios_base::in);
00748    if ( !inputmomdata28 ) {
00749       cout << " can not open: " << psipp_pi_mom << endl;
00750       exit(1);
00751    }
00752    ifstream inputmomdata28mc(psipp_pi_mom_mc.c_str(),std::ios_base::in);
00753    if ( !inputmomdata28mc ) {
00754       cout << " can not open: " << psipp_pi_mom_mc << endl;
00755       exit(1);
00756    }
00757    for(int i=0; i<18; i++) {
00758       inputmomdata28>>m_psipp_pi_ptrk_offset[i];
00759       inputmomdata28>>m_psipp_pi_ptrk_sigma[i];
00760       inputmomdata28mc>>m_psipp_mc_pi_ptrk_offset[i];
00761       inputmomdata28mc>>m_psipp_mc_pi_ptrk_sigma[i];
00762    }
00763 
00764    //Psipp pi theta correction
00765    std::string psipp_pi_the = path + "/share/Psipp/pion/dedx_pi_theta.txt";
00766    std::string psipp_pi_the_mc = path + "/share/Psipp/pion/dedx_pi_theta_mc.txt";
00767    ifstream inputmomdata29(psipp_pi_the.c_str(),std::ios_base::in);
00768    if ( !inputmomdata29 ) {
00769       cout << " can not open: " << psipp_pi_the << endl;
00770       exit(1);
00771    }
00772    ifstream inputmomdata29mc(psipp_pi_the_mc.c_str(),std::ios_base::in);
00773    if ( !inputmomdata29mc ) {
00774       cout << " can not open: " << psipp_pi_the_mc << endl;
00775       exit(1);
00776    }
00777    for(int i=0; i<16; i++) {
00778       inputmomdata29>>m_psipp_pi_theta_offset[i];
00779       inputmomdata29>>m_psipp_pi_theta_sigma[i];
00780       inputmomdata29mc>>m_psipp_mc_pi_theta_offset[i];
00781       inputmomdata29mc>>m_psipp_mc_pi_theta_sigma[i];
00782    }
00783 
00784    //Psipp ka momentum correction
00785    std::string psipp_ka_mom = path + "/share/Psipp/kaon/dedx_ka.txt";
00786    std::string psipp_ka_mom_mc = path + "/share/Psipp/kaon/dedx_ka_mc.txt";
00787    ifstream inputmomdata30(psipp_ka_mom.c_str(),std::ios_base::in);
00788    if ( !inputmomdata30 ) {
00789       cout << " can not open: " << psipp_ka_mom << endl;
00790       exit(1);
00791    }
00792    ifstream inputmomdata30mc(psipp_ka_mom_mc.c_str(),std::ios_base::in);
00793    if ( !inputmomdata30mc ) {
00794       cout << " can not open: " << psipp_ka_mom_mc << endl;
00795       exit(1);
00796    }
00797    for(int i=0; i<17; i++) {
00798       inputmomdata30>>m_psipp_ka_ptrk_offset[i];
00799       inputmomdata30>>m_psipp_ka_ptrk_sigma[i];
00800       inputmomdata30mc>>m_psipp_mc_ka_ptrk_offset[i];
00801       inputmomdata30mc>>m_psipp_mc_ka_ptrk_sigma[i];
00802    }
00803 
00804    //Psipp ka theta correction
00805    std::string psipp_ka_the = path + "/share/Psipp/kaon/dedx_ka_theta.txt";
00806    std::string psipp_ka_the_mc = path + "/share/Psipp/kaon/dedx_ka_theta_mc.txt";
00807    ifstream inputmomdata31(psipp_ka_the.c_str(),std::ios_base::in);
00808    if ( !inputmomdata31 ) {
00809       cout << " can not open: " << psipp_ka_the << endl;
00810       exit(1);
00811    }
00812    ifstream inputmomdata31mc(psipp_ka_the_mc.c_str(),std::ios_base::in);
00813    if ( !inputmomdata31mc ) {
00814       cout << " can not open: " << psipp_ka_the_mc << endl;
00815       exit(1);
00816    }
00817    for(int i=0; i<16; i++) {
00818       inputmomdata31>>m_psipp_ka_theta_offset[i];
00819       inputmomdata31>>m_psipp_ka_theta_sigma[i];
00820       inputmomdata31mc>>m_psipp_mc_ka_theta_offset[i];
00821       inputmomdata31mc>>m_psipp_mc_ka_theta_sigma[i];
00822    }
00823 
00824 
00825    //Psipp proton momentum correction
00826    std::string psipp_proton_mom = path + "/share/Psipp/proton/dedx_proton.txt";
00827    std::string psipp_proton_mom_mc = path + "/share/Psipp/proton/dedx_proton_mc.txt";
00828    ifstream inputmomdata32(psipp_proton_mom.c_str(),std::ios_base::in);
00829    if ( !inputmomdata32 ) {
00830       cout << " can not open: " << psipp_proton_mom << endl;
00831       exit(1);
00832    }
00833    ifstream inputmomdata32mc(psipp_proton_mom_mc.c_str(),std::ios_base::in);
00834    if ( !inputmomdata32mc ) {
00835       cout << " can not open: " << psipp_proton_mom_mc << endl;
00836       exit(1);
00837    }
00838    for(int i=0; i<18; i++) {
00839       inputmomdata32>>m_psipp_proton_ptrk_offset[i];
00840       inputmomdata32>>m_psipp_proton_ptrk_sigma[i];
00841    }
00842    for(int i=0; i<9; i++) {
00843       inputmomdata32mc>>m_psipp_mc_proton_ptrk_offset[i];
00844       inputmomdata32mc>>m_psipp_mc_proton_ptrk_sigma[i];
00845    }
00846 
00847    //Psipp proton theta correction
00848    std::string psipp_proton_the = path + "/share/Psipp/proton/dedx_proton_theta.txt";
00849    std::string psipp_proton_the_mc = path + "/share/Psipp/proton/dedx_proton_theta_mc.txt";
00850    ifstream inputmomdata33(psipp_proton_the.c_str(),std::ios_base::in);
00851    if ( !inputmomdata33 ) {
00852       cout << " can not open: " << psipp_proton_the << endl;
00853       exit(1);
00854    }
00855    ifstream inputmomdata33mc(psipp_proton_the_mc.c_str(),std::ios_base::in);
00856    if ( !inputmomdata33mc ) {
00857       cout << " can not open: " << psipp_proton_the_mc << endl;
00858       exit(1);
00859    }
00860    for(int i=0; i<18; i++) {
00861       inputmomdata33>>m_psipp_proton_theta_offset[i];
00862       inputmomdata33>>m_psipp_proton_theta_sigma[i];
00863       inputmomdata33mc>>m_psipp_mc_proton_theta_offset[i];
00864       inputmomdata33mc>>m_psipp_mc_proton_theta_sigma[i];
00865    }
00866 
00867 }

DedxPID * DedxPID::instance (  )  [static]

Definition at line 17 of file DedxPID.cxx.

References DedxPID(), and m_pointer.

Referenced by ParticleID::init().

00017                             {
00018    if(!m_pointer) m_pointer = new DedxPID();
00019    return m_pointer;
00020 }

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

Definition at line 125 of file ParticleIDBase.cxx.

00125                                                                    {
00126    double c1 = (y[0]-y[1])*(x[1]-x[2])-(x[0]-x[1])*(y[1]-y[2]);
00127    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]);
00128    double c = c1/c2;
00129    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]);
00130    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]);
00131    double b = b1/b2;
00132    double a = y[0] - b*x[0]-c*x[0]*x[0];
00133    double y1 = a + b*x1 +c*x1*x1;
00134    return y1;
00135 }

bool DedxPID::IsPidInfoValid (  )  const [inline, virtual]

Implements ParticleIDBase.

Definition at line 25 of file DedxPID.h.

References m_ndof.

00025 {return (m_ndof>0);}

double DedxPID::iterate ( double  ptrk,
double *  mean,
double *  p 
) [protected]

Definition at line 869 of file DedxPID.cxx.

Referenced by cal_par().

00869                                                           {
00870    double p1,p2,p3;
00871    p2=((mean[0]-mean[1])*(p[1]*p[1]-p[2]*p[2])-(mean[1]-mean[2])*(p[0]*p[0]-p[1]*p[1]))/((p[0]-p[1])*(p[1]*p[1]-p[2]*p[2])-(p[1]-p[2])*(p[0]*p[0]-p[1]*p[1]));
00872    p3=((p[0]-p[1])*(mean[1]-mean[2])-(p[1]-p[2])*(mean[0]-mean[1]))/((p[0]-p[1])*(p[1]*p[1]-p[2]*p[2])-(p[1]-p[2])*(p[0]*p[0]-p[1]*p[1]));
00873    p1=mean[0]-p2*p[0]-p3*p[0]*p[0];
00874    double mean1 = p1+p2*ptrk+p3*ptrk*ptrk;
00875    return mean1;
00876 }

int DedxPID::LikelihoodCalculation (  )  [inline, protected, virtual]

Implements ParticleIDBase.

Definition at line 43 of file DedxPID.h.

00043 {return -1;}

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

Definition at line 87 of file ParticleIDBase.h.

References ParticleIDBase::LIKELIHOOD_PID.

00087 {return LIKELIHOOD_PID;}

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

Definition at line 89 of file ParticleIDBase.h.

References ParticleIDBase::NEURONNETWORK_PID.

00089 {return NEURONNETWORK_PID;}

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

Definition at line 88 of file ParticleIDBase.h.

References ParticleIDBase::PROBABILITY_PID.

00088 {return PROBABILITY_PID;}

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

Definition at line 98 of file ParticleIDBase.h.

References ParticleIDBase::MUC_VALID.

00098 {return MUC_VALID;}

double DedxPID::mypol3 ( double  x,
double  par0,
double  par1,
double  par2,
double  par3 
) [protected]

Definition at line 481 of file DedxPID.cxx.

00482 {
00483    double y = x;
00484    return par0 + (par1 * y) +(par2 * y * y) + (par3 * y * y * y);
00485 
00486 }

double DedxPID::mypol5 ( double  x,
double  par0,
double  par1,
double  par2,
double  par3,
double  par4,
double  par5 
) [protected]

Definition at line 488 of file DedxPID.cxx.

00489 {
00490    double y = x;
00491    return par0 + (par1 * y) +(par2 * y * y) + (par3 * y * y * y) + (par4 * y * y * y *y)+ (par5 * y * y * y * y * y);
00492 
00493 }

int DedxPID::ndof (  )  const [inline, virtual]

Implements ParticleIDBase.

Definition at line 30 of file DedxPID.h.

References m_ndof.

00030 {return m_ndof;}

int DedxPID::neuronPID (  )  const [inline]

Definition at line 33 of file DedxPID.h.

00033 {return -1;}

int DedxPID::neuronPIDCalculation (  )  [inline, protected]

Definition at line 40 of file DedxPID.h.

00040 {return -1;}

double DedxPID::normPH (  )  const [inline]

Definition at line 31 of file DedxPID.h.

References m_normPH.

00031 { return m_normPH;}

double DedxPID::offset ( int  n  )  const [inline]

Definition at line 28 of file DedxPID.h.

References m_offset.

Referenced by CorrDedx().

00028 {return m_offset[n];}

double DedxPID::offsetDedx ( int  n,
double  ptrk,
double  cost 
) [protected]

Definition at line 130 of file DedxPID.cxx.

Referenced by particleIDCalculation().

00130                                                           {
00131    return 0;
00132 }

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

Definition at line 80 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_ELECTRON.

Referenced by ParticleID::LikelihoodCalculation(), and ParticleID::particleIDCalculation().

00080 {return IDENTIFY_ELECTRON;}

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

Definition at line 83 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_KAON.

Referenced by ParticleID::LikelihoodCalculation(), and ParticleID::particleIDCalculation().

00083 {return IDENTIFY_KAON;}

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

Definition at line 81 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_MUON.

Referenced by ParticleID::LikelihoodCalculation(), and ParticleID::particleIDCalculation().

00081 {return IDENTIFY_MUON;}

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

Definition at line 82 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_PION.

Referenced by ParticleID::LikelihoodCalculation(), and ParticleID::particleIDCalculation().

00082 {return IDENTIFY_PION;}

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

Definition at line 76 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_KAON, and ParticleIDBase::IDENTIFY_PION.

00076 {return (IDENTIFY_PION | IDENTIFY_KAON);}

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

Definition at line 78 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_ELECTRON, ParticleIDBase::IDENTIFY_KAON, and ParticleIDBase::IDENTIFY_PION.

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

Definition at line 77 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_KAON, ParticleIDBase::IDENTIFY_PION, and ParticleIDBase::IDENTIFY_PROTON.

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

Definition at line 84 of file ParticleIDBase.h.

References ParticleIDBase::IDENTIFY_PROTON.

Referenced by ParticleID::LikelihoodCalculation(), and ParticleID::particleIDCalculation().

00084 {return IDENTIFY_PROTON;}

double ParticleIDBase::p (  )  [inherited]

Definition at line 100 of file ParticleIDBase.cxx.

References EvtRecTrack::isMdcTrackValid(), ParticleIDBase::m_trk, EvtRecTrack::mdcTrack(), and DstMdcTrack::p().

Referenced by cal_par(), TofCorrPID::particleIDCalculation(), and ParticleIDBase::probCalculate().

00100                          {
00101    double val = 999;
00102    if(!m_trk) return val;
00103    if(!m_trk->isMdcTrackValid()) return val;
00104    RecMdcTrack *mdcTrk = m_trk->mdcTrack();
00105    val = mdcTrk->p();
00106    return val;
00107 }

int DedxPID::particleIDCalculation (  )  [protected, virtual]

Implements ParticleIDBase.

Definition at line 51 of file DedxPID.cxx.

References DstMdcTrack::charge(), ParticleIDBase::charge(), DstMdcDedx::chi(), ParticleIDBase::chiMinCut(), CorrDedx(), cos(), getNhitCutDx(), genRecEmupikp::i, EvtRecTrack::isMdcDedxValid(), EvtRecTrack::isMdcTrackValid(), m_chi, m_chimin, m_goodHits, m_ndof, m_normPH, m_offset, m_pdfmin, m_prob, m_probPH, m_sigma, EvtRecTrack::mdcDedx(), EvtRecTrack::mdcTrack(), DstMdcDedx::normPH(), DstMdcDedx::numGoodHits(), offsetDedx(), DstMdcTrack::p(), ParticleIDBase::pdfCalculate(), ParticleIDBase::pdfMinSigmaCut(), ParticleIDBase::PidTrk(), ParticleIDBase::probCalculate(), DstMdcDedx::probPH(), sigmaDedx(), deljobs::string, and DstMdcTrack::theta().

Referenced by calculate().

00051                                    {
00052    //    int rundedx2 = getRunNo();
00053    int nhitcutdedx=getNhitCutDx();
00054    int irc = -1;
00055    EvtRecTrack* recTrk = PidTrk();
00056    if(!(recTrk->isMdcTrackValid())) return irc;
00057    RecMdcTrack* mdcTrk = recTrk->mdcTrack();
00058 
00059    double ptrk = mdcTrk->p();
00060    int charge = mdcTrk->charge();
00061    if(ptrk>5) return irc;
00062    double cost = cos(mdcTrk->theta());
00063    //   double sig_the= sin(mdcTrk->theta());
00064 
00065    if(!(recTrk->isMdcDedxValid())) return irc;
00066    RecMdcDedx* dedxTrk = recTrk->mdcDedx();
00067 
00068    if((dedxTrk->normPH()>30)||(dedxTrk->normPH()<0)) return irc;
00069    m_goodHits = dedxTrk->numGoodHits();
00070    if(dedxTrk->numGoodHits()<nhitcutdedx) return irc;
00071    m_normPH = dedxTrk->normPH();
00072    m_probPH = dedxTrk->probPH();
00073    // calculate chi and min chi
00074    double chitemp = 99.;
00075    double pdftemp = 0;
00076    //  double testchi[5];
00077    //  double testptrk[5];
00078    //  double testcost[5];
00079    for(int i = 0; i < 5; i++) {
00080       double sep = dedxTrk->chi(i);
00081 
00082 #ifndef BEAN
00083       string sftver = getenv("BES_RELEASE");
00084       string sft;
00085       sft.assign(sftver,0,5);
00086       if(sft=="6.6.0"||sft=="6.5.5") {
00087          m_chi[i] = CorrDedx(i,ptrk,cost,sep,charge);
00088       }
00089       else
00090          m_chi[i]=sep;
00091 #else
00092 // This is BEAN part:
00093 #if (ROOTEVENTDATA_VERSION_NUMERIC == ROOTEVENTDATA_VER(6,5,5) ||\
00094      ROOTEVENTDATA_VERSION_NUMERIC == ROOTEVENTDATA_VER(6,6,0)   )
00095       m_chi[i] = CorrDedx(i,ptrk,cost,sep,charge);
00096 #else
00097       m_chi[i]=sep;
00098 #endif
00099 #endif
00100 
00101       m_offset[i] = offsetDedx(i, ptrk, cost);
00102       m_sigma[i] = sigmaDedx(i, ptrk, cost);
00103       if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
00104       double ppp = pdfCalculate(m_chi[i],1);
00105       if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
00106 
00107    }
00108    m_chimin = chitemp;
00109    m_pdfmin = pdftemp;
00110    if(m_chimin > chiMinCut()) return irc;
00111    if(pdftemp < pdfCalculate(pdfMinSigmaCut(),1)) return irc;
00112 
00113 
00114    // calculate prob
00115 
00116    for(int i = 0; i < 5; i++)
00117       m_prob[i] = probCalculate(m_chi[i]*m_chi[i], 1);
00118 
00119    m_ndof = 1;
00120    irc = 0;
00121    return irc;
00122 }

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

Definition at line 91 of file ParticleIDBase.cxx.

References exp(), M_PI, pi, and twoPi.

Referenced by TofCorrPID::correlationCheck(), ParticleID::LikelihoodCalculation(), TofPID::particleIDCalculation(), TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), and particleIDCalculation().

00091                                                               {
00092    //  const double pi =  3.141592653589793238;
00093    const double pi =  M_PI;
00094    const double twoPi = 2*pi;
00095    double chi2 = -0.5*offset*offset/(sigma*sigma);
00096    double pdf = exp(chi2)/(sigma*sqrt(twoPi));
00097    return pdf;
00098 }

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

Definition at line 42 of file ParticleIDBase.h.

References ParticleIDBase::m_pdfsigmamin_cut.

Referenced by TofCorrPID::correlationCheck(), ParticleID::LikelihoodCalculation(), TofPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), and particleIDCalculation().

00042 {return m_pdfsigmamin_cut;}

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

Definition at line 36 of file ParticleIDBase.h.

References ParticleIDBase::m_trk.

Referenced by TofQPID::particleIDCalculation(), TofPID::particleIDCalculation(), TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), MucPID::particleIDCalculation(), EmcPID::particleIDCalculation(), and particleIDCalculation().

00036 {return m_trk;}

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

Definition at line 137 of file ParticleIDBase.cxx.

00137                                                  {
00138    double y=x;
00139    //    return par[0] + (par[1] * y) +(par[2] * y * y);
00140    return par[0] + y*(par[1] + y*(par[2]));
00141 }

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

Definition at line 143 of file ParticleIDBase.cxx.

00143                                                  {
00144    double y=x;
00145    //    return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y);
00146    return par[0] + y*(par[1] + y*(par[2] + y*(par[3])));
00147 }

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

Definition at line 149 of file ParticleIDBase.cxx.

00149                                                  {
00150    double y=x;
00151    //    return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y) + (par[4] * y * y*y*y);
00152    return par[0] + y*(par[1] + y*(par[2] + y*(par[3] + y*(par[4]))));
00153 }

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

Implements ParticleIDBase.

Definition at line 27 of file DedxPID.h.

References m_prob.

00027 {return m_prob[n];}

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

Definition at line 83 of file ParticleIDBase.cxx.

References ParticleIDBase::p().

Referenced by TofPID::particleIDCalculation(), TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), ParticleID::particleIDCalculation(), and particleIDCalculation().

00083                                                           {
00084    double p = -1.0;
00085    if(chi2 < 0) return p;
00086    p = TMath::Prob(chi2, ndof);
00087    return p;
00088 }

double ParticleIDBase::pt (  )  [inherited]

Definition at line 108 of file ParticleIDBase.cxx.

References EvtRecTrack::isMdcTrackValid(), ParticleIDBase::m_trk, EvtRecTrack::mdcTrack(), and DstMdcTrack::pxy().

00108                           {
00109    double val = 999;
00110    if(!m_trk) return val;
00111    if(!m_trk->isMdcTrackValid()) return val;
00112    RecMdcTrack *mdcTrk = m_trk->mdcTrack();
00113    val = mdcTrk->pxy();
00114    return val;
00115 }

void ParticleIDBase::set_path ( std::string  s_path  )  [inline, inherited]

Definition at line 105 of file ParticleIDBase.h.

References ParticleIDBase::path.

00105 {path = s_path;}

void ParticleIDBase::set_path ( const char *  s_path = 0  )  [inherited]

Definition at line 55 of file ParticleIDBase.cxx.

References ParticleIDBase::path, and deljobs::string.

Referenced by ParticleIDBase::ParticleIDBase().

00056 {
00057    if ( s_path ) {
00058       path = string(s_path);
00059    } else {
00060       char* env_path = getenv("PARTICLEIDROOT");
00061       if ( !env_path ) {
00062          cout << "  ParticleIDBase::set_path ERROR:"
00063               " the environment PARTICLEIDROOT not defined " << endl;
00064          exit(1);
00065       }
00066       path = string(env_path);
00067    }
00068 }

void ParticleIDBase::setChiMaxCut ( const double  chi = 6  )  [inline, inherited]

Definition at line 41 of file ParticleIDBase.h.

References ParticleIDBase::chi(), and ParticleIDBase::m_chimax_cut.

Referenced by ParticleID::init().

00041 {m_chimax_cut = chi;}

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

Definition at line 39 of file ParticleIDBase.h.

References ParticleIDBase::chi(), and ParticleIDBase::m_chimin_cut.

Referenced by ParticleID::init(), and TofPID::particleIDCalculation().

00039 {m_chimin_cut = chi;}

void DedxPID::setNhitCutDx ( const int  nhitcuthdx = 5  )  [inline]

Definition at line 35 of file DedxPID.h.

References m_nhitcutdx.

00035 {m_nhitcutdx = nhitcuthdx;}

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

Definition at line 43 of file ParticleIDBase.h.

References ParticleIDBase::m_pdfsigmamin_cut.

Referenced by TofPID::particleIDCalculation().

00043 {m_pdfsigmamin_cut= pdf;}

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

Definition at line 37 of file ParticleIDBase.h.

References ParticleIDBase::m_trk.

Referenced by TofPID::particleIDCalculation().

00037 {m_trk = trk;}

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

Definition at line 45 of file ParticleIDBase.h.

References ParticleIDBase::m_runno.

00045 {m_runno = runh;}

double DedxPID::sigma ( int  n  )  const [inline]

Definition at line 29 of file DedxPID.h.

References m_sigma.

00029 {return m_sigma[n];}

double DedxPID::sigmaDedx ( int  n,
double  ptrk,
double  cost 
) [protected]

Definition at line 430 of file DedxPID.cxx.

Referenced by particleIDCalculation().

00430                                                          {
00431 
00432    /*  int rundedx3 = getRunNo();
00433      double sigma = 1.0;
00434     double sigp = 1.0;
00435     double sigmac = 1.0;
00436     double gb = ptrk/xmass(n);
00437     switch(n) {
00438 
00439     case 0: {// Electron
00440       double  ptemp = ptrk;
00441       double  costm = cost;
00442    break;
00443     }
00444 
00445     case 1: {// Muon
00446       double  ptemp = ptrk;
00447       double  costm = cost;
00448    break;
00449     }
00450 
00451     case 2: {// Pion
00452       double  ptemp = ptrk;
00453       double  costm = cost;
00454    break;
00455     }
00456 
00457     case 3: { // Kaon
00458       double  ptemp = ptrk;
00459       double  costm = cost;
00460    break;
00461     }
00462 
00463 
00464     case 4: {// Proton
00465       double  ptemp = ptrk;
00466       double  costm = cost;
00467    break;
00468     }
00469 
00470     default:
00471       sigma = 1.0;
00472       break;
00473     }
00474    */
00475    //  sigma = 1.2;
00476    //  sigma =1.0;
00477    return 1;
00478    //  return sigma;
00479 }

int ParticleIDBase::tofcorrValid (  )  const [inline, inherited]

Definition at line 96 of file ParticleIDBase.h.

References ParticleIDBase::TOFCorr_VALID.

00096 {return TOFCorr_VALID;}

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

Definition at line 95 of file ParticleIDBase.h.

References ParticleIDBase::TOFC_VALID.

00095 {return TOFC_VALID;}

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

Definition at line 93 of file ParticleIDBase.h.

References ParticleIDBase::TOFE_VALID.

00093 {return TOFE_VALID;}

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

Definition at line 94 of file ParticleIDBase.h.

References ParticleIDBase::TOFQ_VALID.

00094 {return TOFQ_VALID;}

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

Definition at line 92 of file ParticleIDBase.h.

References ParticleIDBase::TOF_VALID.

00092 {return TOF_VALID;}

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

Definition at line 64 of file ParticleIDBase.h.

References ParticleIDBase::USE_DEDX.

Referenced by ParticleID::IsDedxInfoUsed().

00064 {return USE_DEDX;}

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

Definition at line 72 of file ParticleIDBase.h.

References ParticleIDBase::USE_EMC.

Referenced by ParticleID::IsEmcInfoUsed().

00072 {return USE_EMC;}

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

Definition at line 73 of file ParticleIDBase.h.

References ParticleIDBase::USE_MUC.

Referenced by ParticleID::IsMucInfoUsed().

00073 {return USE_MUC;}

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

Definition at line 65 of file ParticleIDBase.h.

References ParticleIDBase::USE_TOF.

Referenced by ParticleID::IsTofInfoUsed().

00065 {return USE_TOF;}

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

Definition at line 66 of file ParticleIDBase.h.

References ParticleIDBase::USE_TOF1.

Referenced by ParticleID::IsTof1InfoUsed().

00066 {return USE_TOF1;}

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

Definition at line 67 of file ParticleIDBase.h.

References ParticleIDBase::USE_TOF2.

Referenced by ParticleID::IsTof2InfoUsed().

00067 {return USE_TOF2;}

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

Definition at line 70 of file ParticleIDBase.h.

References ParticleIDBase::USE_TOFC.

Referenced by ParticleID::IsTofCInfoUsed().

00070 {return USE_TOFC;}

int ParticleIDBase::useTofCorr (  )  const [inline, inherited]

Definition at line 71 of file ParticleIDBase.h.

References ParticleIDBase::USE_TOFCorr.

Referenced by ParticleID::IsTofCorrInfoUsed().

00071 {return USE_TOFCorr;}

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

Definition at line 68 of file ParticleIDBase.h.

References ParticleIDBase::USE_TOFE.

Referenced by ParticleID::IsTofEInfoUsed().

00068 {return USE_TOFE;}

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

Definition at line 69 of file ParticleIDBase.h.

References ParticleIDBase::USE_TOFQ.

Referenced by ParticleID::IsTofQInfoUsed().

00069 {return USE_TOFQ;}

double ParticleIDBase::velc (  )  [inherited]

Definition at line 77 of file ParticleIDBase.cxx.

Referenced by TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), and Tof1PID::particleIDCalculation().

00077                             {
00078    //  double vel = 29.9792458;  // tof_path unit in cm.
00079    double vel = 299.792458;   // tof path unit in mm
00080    return vel;
00081 }

double ParticleIDBase::xmass ( int  n  )  [inherited]

Definition at line 71 of file ParticleIDBase.cxx.

References mass.

Referenced by TofCorrPID::offsetTof(), TofCorrPID::particleIDCalculation(), and TofCorrPID::sigmaTof().

00071                                   {
00072    double mass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
00073    if(n < 0 || n >=5) return 0.0;
00074    return mass[n];
00075 }


Member Data Documentation

double DedxPID::m_chi[5] [private]

Definition at line 52 of file DedxPID.h.

Referenced by chi(), init(), and particleIDCalculation().

double DedxPID::m_chimin [private]

Definition at line 56 of file DedxPID.h.

Referenced by init(), and particleIDCalculation().

double DedxPID::m_goodHits [private]

Definition at line 63 of file DedxPID.h.

Referenced by goodHits(), init(), and particleIDCalculation().

double DedxPID::m_jpsi_kam_ptrk_offset[12] [private]

Definition at line 69 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_kam_ptrk_sigma[12] [private]

Definition at line 70 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_kam_theta_offset[18] [private]

Definition at line 73 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_kam_theta_sigma[18] [private]

Definition at line 74 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_kap_ptrk_offset[12] [private]

Definition at line 67 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_kap_ptrk_sigma[12] [private]

Definition at line 68 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_kap_theta_offset[18] [private]

Definition at line 71 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_kap_theta_sigma[18] [private]

Definition at line 72 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_kam_ptrk_offset[12] [private]

Definition at line 78 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_kam_ptrk_sigma[12] [private]

Definition at line 79 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_kam_theta_offset[18] [private]

Definition at line 82 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_kam_theta_sigma[18] [private]

Definition at line 83 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_kap_ptrk_offset[12] [private]

Definition at line 76 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_kap_ptrk_sigma[12] [private]

Definition at line 77 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_kap_theta_offset[18] [private]

Definition at line 80 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_kap_theta_sigma[18] [private]

Definition at line 81 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_protonm_ptrk_offset[8] [private]

Definition at line 99 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_protonm_ptrk_sigma[8] [private]

Definition at line 100 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_protonm_theta_offset[18] [private]

Definition at line 103 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_protonm_theta_sigma[18] [private]

Definition at line 104 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_protonp_ptrk_offset[8] [private]

Definition at line 97 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_protonp_ptrk_sigma[8] [private]

Definition at line 98 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_protonp_theta_offset[18] [private]

Definition at line 101 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_mc_protonp_theta_sigma[18] [private]

Definition at line 102 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_protonm_ptrk_offset[8] [private]

Definition at line 89 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_protonm_ptrk_sigma[8] [private]

Definition at line 90 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_protonm_theta_offset[18] [private]

Definition at line 93 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_protonm_theta_sigma[18] [private]

Definition at line 94 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_protonp_ptrk_offset[8] [private]

Definition at line 87 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_protonp_ptrk_sigma[8] [private]

Definition at line 88 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_protonp_theta_offset[18] [private]

Definition at line 91 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_jpsi_protonp_theta_sigma[18] [private]

Definition at line 92 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

int DedxPID::m_ndof [private]

Definition at line 58 of file DedxPID.h.

Referenced by calculate(), init(), IsPidInfoValid(), ndof(), and particleIDCalculation().

int DedxPID::m_nhitcutdx [private]

Definition at line 59 of file DedxPID.h.

Referenced by getNhitCutDx(), init(), and setNhitCutDx().

double DedxPID::m_normPH [private]

Definition at line 61 of file DedxPID.h.

Referenced by init(), normPH(), and particleIDCalculation().

double DedxPID::m_offset[5] [private]

Definition at line 54 of file DedxPID.h.

Referenced by init(), offset(), and particleIDCalculation().

double DedxPID::m_pdfmin [private]

Definition at line 57 of file DedxPID.h.

Referenced by init(), and particleIDCalculation().

DedxPID * DedxPID::m_pointer = 0 [static, private]

Definition at line 169 of file DedxPID.h.

Referenced by instance().

double DedxPID::m_prob[5] [private]

Definition at line 53 of file DedxPID.h.

Referenced by init(), particleIDCalculation(), and prob().

double DedxPID::m_probPH [private]

Definition at line 62 of file DedxPID.h.

Referenced by init(), and particleIDCalculation().

double DedxPID::m_psip_kam_ptrk_offset[9] [private]

Definition at line 111 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_kam_ptrk_sigma[9] [private]

Definition at line 112 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_kap_ptrk_offset[9] [private]

Definition at line 109 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_kap_ptrk_sigma[9] [private]

Definition at line 110 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_mc_kam_ptrk_offset[9] [private]

Definition at line 116 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_mc_kam_ptrk_sigma[9] [private]

Definition at line 117 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_mc_kap_ptrk_offset[9] [private]

Definition at line 114 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_mc_kap_ptrk_sigma[9] [private]

Definition at line 115 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_mc_protonm_ptrk_offset[9] [private]

Definition at line 127 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_mc_protonm_ptrk_sigma[9] [private]

Definition at line 128 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_mc_protonp_ptrk_offset[9] [private]

Definition at line 125 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_mc_protonp_ptrk_sigma[9] [private]

Definition at line 126 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_protonm_ptrk_offset[9] [private]

Definition at line 122 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_protonm_ptrk_sigma[9] [private]

Definition at line 123 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_protonp_ptrk_offset[9] [private]

Definition at line 120 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psip_protonp_ptrk_sigma[9] [private]

Definition at line 121 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_ka_ptrk_offset[17] [private]

Definition at line 142 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_ka_ptrk_sigma[17] [private]

Definition at line 143 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_ka_theta_offset[16] [private]

Definition at line 144 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_ka_theta_sigma[16] [private]

Definition at line 145 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_ka_ptrk_offset[17] [private]

Definition at line 147 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_ka_ptrk_sigma[17] [private]

Definition at line 148 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_ka_theta_offset[16] [private]

Definition at line 149 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_ka_theta_sigma[16] [private]

Definition at line 150 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_pi_ptrk_offset[18] [private]

Definition at line 137 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_pi_ptrk_sigma[18] [private]

Definition at line 138 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_pi_theta_offset[16] [private]

Definition at line 139 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_pi_theta_sigma[16] [private]

Definition at line 140 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_proton_ptrk_offset[9] [private]

Definition at line 157 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_proton_ptrk_sigma[9] [private]

Definition at line 158 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_proton_theta_offset[18] [private]

Definition at line 159 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_mc_proton_theta_sigma[18] [private]

Definition at line 160 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_pi_ptrk_offset[18] [private]

Definition at line 132 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_pi_ptrk_sigma[18] [private]

Definition at line 133 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_pi_theta_offset[16] [private]

Definition at line 134 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_pi_theta_sigma[16] [private]

Definition at line 135 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_proton_ptrk_offset[18] [private]

Definition at line 152 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_proton_ptrk_sigma[18] [private]

Definition at line 153 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_proton_theta_offset[18] [private]

Definition at line 154 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

double DedxPID::m_psipp_proton_theta_sigma[18] [private]

Definition at line 155 of file DedxPID.h.

Referenced by CorrDedx(), and inputpar().

int DedxPID::m_readstate [private]

Definition at line 60 of file DedxPID.h.

Referenced by calculate(), and DedxPID().

int DedxPID::m_runxx [private]

Definition at line 65 of file DedxPID.h.

double DedxPID::m_sigma[5] [private]

Definition at line 55 of file DedxPID.h.

Referenced by init(), particleIDCalculation(), and sigma().

std::string ParticleIDBase::path = "" [static, protected, inherited]

Definition at line 102 of file ParticleIDBase.h.

Referenced by TofCPID::calculate(), EmcPID::EmcPID(), MucPID::init(), inputpar(), TofCorrPID::inputParameter(), MucPID::MucPID(), ParticleIDBase::ParticleIDBase(), TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), and ParticleIDBase::set_path().


Generated on Tue Nov 29 23:18:15 2016 for BOSS_7.0.2 by  doxygen 1.4.7