Tof1PID Class Reference

#include <Tof1PID.h>

Inheritance diagram for Tof1PID:

ParticleIDBase List of all members.

Public Member Functions

 ~Tof1PID ()
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 mass2 () const
double ph1 () const
double zhit1 () const
double path1 () const
double tof1 () const
int neuronPID () const
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 Tof1PIDinstance ()

Protected Member Functions

int particleIDCalculation ()
int neuronPIDCalculation ()
int LikelihoodCalculation ()
double offsetTof1 (int n, int cntr, double ptrk, double ztof, double m_ph1, double charge)
double sigmaTof1 (int n, int cntr, double ptrk, double ztof, double m_ph1, double charge)
double sampleQ0 (double betagamma, double beta)

Static Protected Attributes

static std::string path = ""

Private Member Functions

 Tof1PID ()

Private Attributes

double m_chi [5]
double m_sigma [5]
double m_offset [5]
double m_prob [5]
double m_chimin
double m_pdfmin
int m_ndof
double m_mass2
double m_ph1
double m_zhit1
double m_path1
double m_tof1
double m_pars [15]

Static Private Attributes

static Tof1PIDm_pointer = 0

Detailed Description

Definition at line 14 of file Tof1PID.h.


Constructor & Destructor Documentation

Tof1PID::~Tof1PID (  )  [inline]

Definition at line 19 of file Tof1PID.h.

00019 {;} 

Tof1PID::Tof1PID (  )  [private]

Definition at line 21 of file Tof1PID.cxx.

References m_pars.

Referenced by instance().

00021                 :ParticleIDBase() {
00022    m_pars[0]= -0.208289;
00023    m_pars[1]=  1.63092;
00024    m_pars[2]= -0.0733139;
00025    m_pars[3]= 1.02385;
00026    m_pars[4]= 0.00145052;
00027    m_pars[5]= -1.72471e-06;
00028    m_pars[6]= 5.92726e-10;
00029    m_pars[7]= -0.0645428;
00030    m_pars[8]= -0.00143637;
00031    m_pars[9]= -0.133817;
00032    m_pars[10]= 0.0101188;
00033    m_pars[11]= -5.07622;
00034    m_pars[12]= 5.31472;
00035    m_pars[13]= -0.443142;
00036    m_pars[14]= -12.1083;
00037 
00038 }


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.

void Tof1PID::calculate (  )  [virtual]

Implements ParticleIDBase.

Definition at line 55 of file Tof1PID.cxx.

References m_ndof, and particleIDCalculation().

Referenced by TofPID::particleIDCalculation().

00055                         {
00056    if(particleIDCalculation() == 0) m_ndof=1;
00057 }

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(), particleIDCalculation(), and DedxPID::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 Tof1PID::chi ( int  n  )  const [inline, virtual]

Implements ParticleIDBase.

Definition at line 24 of file Tof1PID.h.

References m_chi.

Referenced by TofPID::chilayer1(), and TofPID::particleIDCalculation().

00024 {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(), particleIDCalculation(), ParticleID::particleIDCalculation(), and DedxPID::particleIDCalculation().

00038 {return m_chimin_cut;}

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;}

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

Definition at line 44 of file ParticleIDBase.h.

References ParticleIDBase::m_runno.

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

00044 {return m_runno;}

void Tof1PID::init (  )  [virtual]

Implements ParticleIDBase.

Definition at line 40 of file Tof1PID.cxx.

References genRecEmupikp::i, m_chi, m_chimin, m_mass2, m_ndof, m_offset, m_pdfmin, m_ph1, m_prob, m_sigma, and m_zhit1.

Referenced by TofPID::particleIDCalculation().

00040                    {
00041    for(int i = 0; i < 5; i++) {
00042       m_chi[i] = 99.0;
00043       m_prob[i] = -1.0;
00044       m_sigma[i] = 1;
00045       m_offset[i] = 99.0;
00046    }
00047    m_chimin = 99.;
00048    m_pdfmin = 99.;
00049    m_ndof = 0;
00050    m_mass2 = -999;
00051    m_ph1 = -99;
00052    m_zhit1 = -99;
00053 }

Tof1PID * Tof1PID::instance (  )  [static]

Definition at line 16 of file Tof1PID.cxx.

References m_pointer, and Tof1PID().

Referenced by TofPID::particleIDCalculation().

00016                             {
00017    if(!m_pointer) m_pointer = new Tof1PID();
00018    return m_pointer;
00019 }

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 Tof1PID::IsPidInfoValid (  )  const [inline, virtual]

Implements ParticleIDBase.

Definition at line 23 of file Tof1PID.h.

References m_ndof.

Referenced by TofPID::particleIDCalculation().

00023 {return (m_ndof > 0); }

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

Implements ParticleIDBase.

Definition at line 40 of file Tof1PID.h.

00040 {return -1;}

double Tof1PID::mass2 (  )  const [inline]

Definition at line 29 of file Tof1PID.h.

References m_mass2.

00029 {return m_mass2;}

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;}

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

Implements ParticleIDBase.

Definition at line 28 of file Tof1PID.h.

References m_ndof.

00028 {return m_ndof;}

int Tof1PID::neuronPID (  )  const [inline]

Definition at line 34 of file Tof1PID.h.

00034 {return -1;}

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

Definition at line 39 of file Tof1PID.h.

00039 { return -1;}

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

Definition at line 26 of file Tof1PID.h.

References m_offset.

Referenced by offsetTof1(), and TofPID::particleIDCalculation().

00026 {return m_offset[n];}

double Tof1PID::offsetTof1 ( int  n,
int  cntr,
double  ptrk,
double  ztof,
double  m_ph1,
double  charge 
) [protected]

Definition at line 137 of file Tof1PID.cxx.

References genRecEmupikp::i, m_pars, offset(), and sampleQ0().

00137                                                                                            {
00138    double offset;
00139    //   double gb = ptrk/xmass(n);
00140    double betagamma;
00141    switch(n) {
00142 
00143    case 0: {  // Electron
00144       offset = 0.0;
00145       return offset;
00146    }
00147 
00148    case 1: { // Muon
00149       offset = 0.0;
00150       return offset;
00151    }
00152 
00153    case 2: { // Pion
00154       betagamma=ptrk/139.57;
00155       break;
00156    }
00157    case 3: { // Kaon
00158       betagamma=ptrk/493.68;
00159       break;
00160    }
00161 
00162    case 4: { // Proton
00163       betagamma=ptrk/938.27;
00164       break;
00165    }
00166 
00167    default: {
00168       offset = 0.0;
00169       return offset;
00170    }
00171    break;
00172    }
00173    double Q = ph1;
00174    z=z/1000.0;
00175    double beta = betagamma / TMath::Sqrt(1 + betagamma*betagamma);
00176    double Q0 = sampleQ0(betagamma,beta);
00177    double func[15]= {0.};
00178    func[0]=1.;
00179    func[1]=1./sqrt(Q);
00180    func[2]=z/sqrt(Q);
00181    func[3]=z*z/sqrt(Q);
00182    func[4]=Q;
00183    func[5]=Q*Q;
00184    func[6]=Q*Q*Q;
00185    func[7]=1./(0.84*0.84+z*z);
00186    func[8]=z;
00187    func[9]=z*z;
00188    func[10]=z*z*z;
00189    func[11]=1./sqrt(Q0);
00190    func[12]=z/sqrt(Q0);
00191    func[13]=z*z/sqrt(Q0);
00192    func[14]=z*z*z/sqrt(Q0);
00193    offset=0.;
00194    for(int i=0; i<15; i++) {
00195       offset+= m_pars[i]*func[i];
00196    }
00197 
00198    return offset;
00199 }

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 DedxPID::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 Tof1PID::particleIDCalculation (  )  [protected, virtual]

Implements ParticleIDBase.

Definition at line 59 of file Tof1PID.cxx.

References DstMdcTrack::charge(), ParticleIDBase::charge(), ParticleIDBase::chiMinCut(), genRecEmupikp::i, TofHitStatus::is_barrel(), TofHitStatus::is_counter(), EvtRecTrack::isMdcTrackValid(), EvtRecTrack::isTofTrackValid(), TofHitStatus::layer(), m_chi, m_chimin, m_mass2, m_offset, m_path1, m_pdfmin, m_ph1, m_prob, m_sigma, m_tof1, m_zhit1, EvtRecTrack::mdcTrack(), DstMdcTrack::p(), ParticleIDBase::path, ParticleIDBase::pdfCalculate(), ParticleIDBase::pdfMinSigmaCut(), ParticleIDBase::PidTrk(), ParticleIDBase::probCalculate(), TofHitStatus::setStatus(), sigmaTof1(), EvtRecTrack::tofTrack(), and ParticleIDBase::velc().

Referenced by calculate().

00059                                    {
00060    int irc = -1;
00061 
00062    EvtRecTrack* recTrk = PidTrk();
00063    if(!(recTrk->isMdcTrackValid())) return irc;
00064    RecMdcTrack* mdcTrk = recTrk->mdcTrack();
00065    double ptrk = mdcTrk->p();
00066    double charge = mdcTrk->charge();
00067    //   double cost = cos(mdcTrk->theta());
00068    if(!(recTrk->isTofTrackValid())) return irc;
00069 
00070 #ifndef BEAN
00071    SmartRefVector<RecTofTrack> tofTrk = recTrk->tofTrack();
00072    SmartRefVector<RecTofTrack>::iterator it;//=tofTrk.begin();
00073 #else
00074    const std::vector<TTofTrack* >& tofTrk = recTrk->tofTrack();
00075    std::vector<TTofTrack* >::const_iterator it;//=tofTrk.begin();
00076 #endif
00077 
00078    TofHitStatus *hitst = new TofHitStatus;
00079    std::vector<int> tof1count;
00080    int goodtof1trk=0;
00081    for(it = tofTrk.begin(); it!=tofTrk.end(); it++,goodtof1trk++) {
00082       unsigned int st = (*it)->status();
00083       hitst->setStatus(st);
00084       if( !(hitst->is_barrel()) ) continue;
00085       if( !(hitst->is_counter()) ) continue;
00086       if( hitst->layer()==1 )  tof1count.push_back(goodtof1trk);
00087    }
00088    delete hitst;
00089    if(tof1count.size()!=1) return irc;//not tof2 track or more than 1 tracks
00090    it = tofTrk.begin()+tof1count[0];
00091    double tof  = (*it)->tof();
00092    m_tof1 = tof;
00093    //   int qual = (*it)->quality();
00094    // if(qual != 1) return irc;
00095    int cntr = (*it)->tofID();
00096    double path  = ((*it)->path())*10.0;//the unit from mm to cm
00097    m_path1 = path;
00098    m_ph1  = (*it)->ph(); //no change
00099    m_zhit1 = ((*it)->zrhit())*10;//the unit from mm to cm
00100    double beta2 = path*path/velc()/velc()/tof/tof;
00101    m_mass2 = ptrk * ptrk * (1/beta2 -1);
00102    if ((m_mass2>20)||(m_mass2<-1)) return irc;
00103    if(tof <=0 ) return irc;
00104    double chitemp = 99.;
00105    double pdftemp = 0;
00106    double sigma_tmp= (*it)->sigma(0);
00107    for(int i = 0; i < 5; i++) {
00108 
00109       m_offset[i] = tof - (*it)->texp(i)-(*it)->toffset(i);//- offsetTof1(i, cntr, ptrk, m_zhit1, m_ph1,charge);
00110       if(sigma_tmp!=0) {
00111          m_sigma[i] = 1.2*sigma_tmp;
00112          if(i<2) m_sigma[i]=sigma_tmp;
00113       }
00114       else m_sigma[i]=sigmaTof1(i, cntr,ptrk,m_zhit1, m_ph1,charge);
00115       m_chi[i] = m_offset[i]/m_sigma[i];
00116 
00117       if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
00118       double ppp = pdfCalculate(m_chi[i],1);
00119       if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
00120    }
00121    m_chimin = chitemp;
00122    m_pdfmin = pdftemp;
00123    if(pdftemp < pdfCalculate(pdfMinSigmaCut(),1)) return irc;
00124    if(fabs(m_chimin) > chiMinCut()) return irc;
00125    for(int i = 0; i < 5; i++) {
00126       m_prob[i] = probCalculate(m_chi[i]*m_chi[i], 1);
00127    }
00128    irc = 0;
00129    return irc;
00130 }

double Tof1PID::path1 (  )  const [inline]

Definition at line 32 of file Tof1PID.h.

References m_path1.

00032 {return m_path1;}

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(), particleIDCalculation(), and DedxPID::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(), particleIDCalculation(), and DedxPID::particleIDCalculation().

00042 {return m_pdfsigmamin_cut;}

double Tof1PID::ph1 (  )  const [inline]

Definition at line 30 of file Tof1PID.h.

References m_ph1.

00030 {return m_ph1;}

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(), particleIDCalculation(), MucPID::particleIDCalculation(), EmcPID::particleIDCalculation(), and DedxPID::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 Tof1PID::prob ( int  n  )  const [inline, virtual]

Implements ParticleIDBase.

Definition at line 25 of file Tof1PID.h.

References m_prob.

00025 {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(), particleIDCalculation(), ParticleID::particleIDCalculation(), and DedxPID::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 }

double Tof1PID::sampleQ0 ( double  betagamma,
double  beta 
) [protected]

Definition at line 242 of file Tof1PID.cxx.

Referenced by offsetTof1().

00242                                                      {
00243    double val = 0.261/ TMath::Power(beta, 1.96) *( 5.43- TMath::Power(beta, 1.96) -TMath::Log(1.12 + TMath::Power(1/betagamma, 0.386)));
00244    return val*100.;
00245 }

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 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 Tof1PID::sigma ( int  n  )  const [inline]

Definition at line 27 of file Tof1PID.h.

References m_sigma.

Referenced by TofPID::particleIDCalculation(), and sigmaTof1().

00027 {return m_sigma[n];}

double Tof1PID::sigmaTof1 ( int  n,
int  cntr,
double  ptrk,
double  ztof,
double  m_ph1,
double  charge 
) [protected]

Definition at line 201 of file Tof1PID.cxx.

References cos(), and sigma().

Referenced by particleIDCalculation().

00201                                                                                              {
00202    double sigma;
00203    //   double gb = ptrk/xmass(n);
00204    double cosz = cos(ztof/1000.0);
00205 
00206    switch(n) {
00207 
00208    case 0: { // Electron
00209       sigma = 0.132405-0.135638*cosz+0.105528*cosz*cosz;
00210       break;
00211    }
00212 
00213    case 1: { // Muon
00214       sigma = 0.164057 -0.199648*cosz+ 0.139481*cosz*cosz;
00215       break;
00216    }
00217 
00218    case 2: { // Pion
00219       sigma = 0.132943-0.0996678*cosz+0.0785578*cosz*cosz;
00220       break;
00221    }
00222    case 3: { // Kaon
00223       sigma = 0.146572 -0.124672*cosz+0.0920656*cosz*cosz;
00224       break;
00225    }
00226 
00227    case 4: { // Proton
00228       sigma = 0.1513 -0.0806081*cosz+0.0607409*cosz*cosz;
00229       break;
00230    }
00231 
00232    default:
00233       sigma = 0.100;
00234       break;
00235    }
00236    sigma = 0.110;
00237    //sigma = 1.0;
00238    return sigma;
00239 }

double Tof1PID::tof1 (  )  const [inline]

Definition at line 33 of file Tof1PID.h.

References m_tof1.

00033 {return m_tof1;}

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 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 }

double Tof1PID::zhit1 (  )  const [inline]

Definition at line 31 of file Tof1PID.h.

References m_zhit1.

00031 {return m_zhit1;}


Member Data Documentation

double Tof1PID::m_chi[5] [private]

Definition at line 46 of file Tof1PID.h.

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

double Tof1PID::m_chimin [private]

Definition at line 50 of file Tof1PID.h.

Referenced by init(), and particleIDCalculation().

double Tof1PID::m_mass2 [private]

Definition at line 53 of file Tof1PID.h.

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

int Tof1PID::m_ndof [private]

Definition at line 52 of file Tof1PID.h.

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

double Tof1PID::m_offset[5] [private]

Definition at line 48 of file Tof1PID.h.

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

double Tof1PID::m_pars[15] [private]

Definition at line 58 of file Tof1PID.h.

Referenced by offsetTof1(), and Tof1PID().

double Tof1PID::m_path1 [private]

Definition at line 56 of file Tof1PID.h.

Referenced by particleIDCalculation(), and path1().

double Tof1PID::m_pdfmin [private]

Definition at line 51 of file Tof1PID.h.

Referenced by init(), and particleIDCalculation().

double Tof1PID::m_ph1 [private]

Definition at line 54 of file Tof1PID.h.

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

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

Definition at line 61 of file Tof1PID.h.

Referenced by instance().

double Tof1PID::m_prob[5] [private]

Definition at line 49 of file Tof1PID.h.

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

double Tof1PID::m_sigma[5] [private]

Definition at line 47 of file Tof1PID.h.

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

double Tof1PID::m_tof1 [private]

Definition at line 57 of file Tof1PID.h.

Referenced by particleIDCalculation(), and tof1().

double Tof1PID::m_zhit1 [private]

Definition at line 55 of file Tof1PID.h.

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

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

Definition at line 102 of file ParticleIDBase.h.

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


Generated on Tue Nov 29 23:36:03 2016 for BOSS_7.0.2 by  doxygen 1.4.7