Tof2PID Class Reference

#include <Tof2PID.h>

Inheritance diagram for Tof2PID:

ParticleIDBase List of all members.

Public Member Functions

 ~Tof2PID ()
void init ()
void calculate ()
bool IsPidInfoValid () const
double chi (int n) const
double sigma (int n) const
double offset (int n) const
double prob (int n) const
int ndof () const
double mass2 () const
double ph2 () const
double zhit2 () const
double path2 () const
double tof2 () 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 Tof2PIDinstance ()

Protected Member Functions

int particleIDCalculation ()
int neuronPIDCalculation ()
int LikelihoodCalculation ()
double offsetTof2 (int n, int cntr, double ptrk, double ztof, double m_ph2, double charge)
double sigmaTof2 (int n, int cntr, double ptrk, double ztof, double m_ph2, double charge)
double sampleQ0 (double betagamma, double beta)

Static Protected Attributes

static std::string path = ""

Private Member Functions

 Tof2PID ()

Private Attributes

double m_chi [5]
double m_prob [5]
double m_sigma [5]
double m_offset [5]
double m_chimin
double m_pdfmin
int m_ndof
double m_mass2
double m_ph2
double m_zhit2
double m_path2
double m_tof2
double m_pars [15]

Static Private Attributes

static Tof2PIDm_pointer = 0

Detailed Description

Definition at line 14 of file Tof2PID.h.


Constructor & Destructor Documentation

Tof2PID::~Tof2PID (  )  [inline]

Definition at line 18 of file Tof2PID.h.

00018 {;} 

Tof2PID::Tof2PID (  )  [private]

Definition at line 23 of file Tof2PID.cxx.

References m_pars.

Referenced by instance().

00023                 :ParticleIDBase() {
00024    m_pars[0]=-0.237207;
00025    m_pars[1]= 1.90436;
00026    m_pars[2]= -0.210625;
00027    m_pars[3]= 0.664667;
00028    m_pars[4]= 0.00165226;
00029    m_pars[5]= -1.86503e-06;
00030    m_pars[6]= 6.07045e-10;
00031    m_pars[7]=-0.0882228;
00032    m_pars[8]= 0.0125708;
00033    m_pars[9]= -0.117157;
00034    m_pars[10]=   0.00252878;
00035    m_pars[11]= 0.254343;
00036    m_pars[12]= -5.74886;
00037    m_pars[13]=   5.20507;
00038    m_pars[14]= 1.86515;
00039 
00040 }


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 Tof2PID::calculate (  )  [virtual]

Implements ParticleIDBase.

Definition at line 58 of file Tof2PID.cxx.

References m_ndof, and particleIDCalculation().

Referenced by TofPID::particleIDCalculation().

00058                         {
00059    if(particleIDCalculation() == 0) m_ndof=1;
00060 }

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

Implements ParticleIDBase.

Definition at line 23 of file Tof2PID.h.

References m_chi.

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

00023 {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(), particleIDCalculation(), Tof1PID::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 Tof2PID::init (  )  [virtual]

Implements ParticleIDBase.

Definition at line 42 of file Tof2PID.cxx.

References genRecEmupikp::i, m_chi, m_chimin, m_mass2, m_ndof, m_offset, m_pdfmin, m_ph2, m_prob, m_sigma, and m_zhit2.

Referenced by TofPID::particleIDCalculation().

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

Tof2PID * Tof2PID::instance (  )  [static]

Definition at line 17 of file Tof2PID.cxx.

References m_pointer, and Tof2PID().

Referenced by TofPID::particleIDCalculation().

00017                             {
00018    if(!m_pointer) m_pointer = new Tof2PID();
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 Tof2PID::IsPidInfoValid (  )  const [inline, virtual]

Implements ParticleIDBase.

Definition at line 22 of file Tof2PID.h.

References m_ndof.

Referenced by TofPID::particleIDCalculation().

00022 {return (m_ndof > 0); }

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

Implements ParticleIDBase.

Definition at line 38 of file Tof2PID.h.

00038 {return -1;}

double Tof2PID::mass2 (  )  const [inline]

Definition at line 28 of file Tof2PID.h.

References m_mass2.

00028 {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 Tof2PID::ndof (  )  const [inline, virtual]

Implements ParticleIDBase.

Definition at line 27 of file Tof2PID.h.

References m_ndof.

00027 {return m_ndof;}

int Tof2PID::neuronPID (  )  const [inline]

Definition at line 33 of file Tof2PID.h.

00033 {return -1;}

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

Definition at line 37 of file Tof2PID.h.

00037 {return -1;}

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

Definition at line 25 of file Tof2PID.h.

References m_offset.

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

00025 {return m_offset[n];}

double Tof2PID::offsetTof2 ( int  n,
int  cntr,
double  ptrk,
double  ztof,
double  m_ph2,
double  charge 
) [protected]

Definition at line 153 of file Tof2PID.cxx.

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

00153                                                                                           {
00154    double offset;
00155    //   double gb = ptrk/xmass(n);
00156    double betagamma;
00157    switch(n) {
00158 
00159    case 0: {  // Electron
00160       offset = 0.0;
00161       return offset;
00162    }
00163 
00164    case 1: { // Muon
00165       offset = 0.0;
00166       return offset;
00167    }
00168 
00169    case 2: { // Pion
00170       betagamma=ptrk/139.57;
00171       break;
00172    }
00173    case 3: { // Kaon
00174       betagamma=ptrk/493.68;
00175       break;
00176    }
00177 
00178    case 4: { // Proton
00179       betagamma=ptrk/938.27;
00180       break;
00181    }
00182 
00183    default: {
00184       offset = 0.0;
00185       return offset;
00186    }
00187    break;
00188    }
00189    z=z/1000.0;
00190    double Q = ph;
00191    double beta = betagamma / TMath::Sqrt(1 + betagamma*betagamma);
00192    double Q0 = sampleQ0(betagamma,beta);
00193    double func[15]= {0.};
00194    func[0]=1.;
00195    func[1]=1./sqrt(Q);
00196    func[2]=z/sqrt(Q);
00197    func[3]=z*z/sqrt(Q);
00198    func[4]=Q;
00199    func[5]=Q*Q;
00200    func[6]=Q*Q*Q;
00201    func[7]=1./(0.89*0.89+z*z);
00202    func[8]=z;
00203    func[9]=z*z;
00204    func[10]=z*z*z;
00205    func[11]=1./sqrt(Q0);
00206    func[12]=z/sqrt(Q0);
00207    func[13]=z*z/sqrt(Q0);
00208    func[14]=z*z*z/sqrt(Q0);
00209    offset=0.;
00210    for(int i=0; i<15; i++) {
00211       offset+= m_pars[i]*func[i];
00212    }
00213 
00214    return offset;
00215 }

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

Implements ParticleIDBase.

Definition at line 62 of file Tof2PID.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_path2, m_pdfmin, m_ph2, m_prob, m_sigma, m_tof2, m_zhit2, EvtRecTrack::mdcTrack(), DstMdcTrack::p(), ParticleIDBase::path, ParticleIDBase::pdfCalculate(), ParticleIDBase::pdfMinSigmaCut(), ParticleIDBase::PidTrk(), ParticleIDBase::probCalculate(), TofHitStatus::setStatus(), sigmaTof2(), EvtRecTrack::tofTrack(), and ParticleIDBase::velc().

Referenced by calculate().

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

double Tof2PID::path2 (  )  const [inline]

Definition at line 31 of file Tof2PID.h.

References m_path2.

00031 {return m_path2;}

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

00042 {return m_pdfsigmamin_cut;}

double Tof2PID::ph2 (  )  const [inline]

Definition at line 29 of file Tof2PID.h.

References m_ph2.

00029 {return m_ph2;}

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

Implements ParticleIDBase.

Definition at line 26 of file Tof2PID.h.

References m_prob.

00026 {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(), particleIDCalculation(), Tof1PID::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 Tof2PID::sampleQ0 ( double  betagamma,
double  beta 
) [protected]

Definition at line 258 of file Tof2PID.cxx.

Referenced by offsetTof2().

00258                                                      {
00259    double p1 = 0.261;
00260    double p2 = 5.43;
00261    double p3 = 1.12;
00262    double p4 = 1.96;
00263    double p5 = 0.386;
00264    double val = p1 / TMath::Power(beta, p4) *
00265                 ( p2- TMath::Power(beta, p4) -
00266                   TMath::Log(p3 + TMath::Power(1/betagamma, p5)));
00267 
00268    return val*100.;
00269 }

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

Definition at line 24 of file Tof2PID.h.

References m_sigma.

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

00024 {return m_sigma[n];}

double Tof2PID::sigmaTof2 ( int  n,
int  cntr,
double  ptrk,
double  ztof,
double  m_ph2,
double  charge 
) [protected]

Definition at line 217 of file Tof2PID.cxx.

References cos(), and sigma().

Referenced by particleIDCalculation().

00217                                                                                              {
00218    double sigma;
00219    //   double gb = ptrk/xmass(n);
00220    double cosz = cos(ztof/1000.0);
00221    //  double phtemp=ph;
00222    switch(n) {
00223 
00224    case 0: { // Electron
00225       sigma = 0.115816 -0.0933215*cosz+ 0.0788252*cosz*cosz;
00226       break;
00227    }
00228 
00229    case 1: { // Muon
00230       sigma = 0.121536 -0.0935898*cosz+0.0748771*cosz*cosz;
00231       break;
00232    }
00233 
00234    case 2: { // Pion
00235       sigma =  0.106882-0.0147375*cosz+0.027491*cosz*cosz;
00236       break;
00237    }
00238    case 3: { // Kaon
00239       sigma =0.106882 -0.0147375*cosz +0.027491 *cosz*cosz;
00240       break;
00241    }
00242 
00243    case 4: { // Proton
00244       sigma = 0.168489 -0.131762*cosz+ 0.105708*cosz*cosz;
00245       break;
00246    }
00247 
00248    default:
00249       sigma = 0.100;
00250       break;
00251    }
00252    sigma = 0.110;
00253    //sigma = 1.0;
00254    return sigma;
00255 }

double Tof2PID::tof2 (  )  const [inline]

Definition at line 32 of file Tof2PID.h.

References m_tof2.

00032 {return m_tof2;}

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(), 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 }

double Tof2PID::zhit2 (  )  const [inline]

Definition at line 30 of file Tof2PID.h.

References m_zhit2.

00030 {return m_zhit2;}


Member Data Documentation

double Tof2PID::m_chi[5] [private]

Definition at line 44 of file Tof2PID.h.

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

double Tof2PID::m_chimin [private]

Definition at line 48 of file Tof2PID.h.

Referenced by init(), and particleIDCalculation().

double Tof2PID::m_mass2 [private]

Definition at line 51 of file Tof2PID.h.

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

int Tof2PID::m_ndof [private]

Definition at line 50 of file Tof2PID.h.

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

double Tof2PID::m_offset[5] [private]

Definition at line 47 of file Tof2PID.h.

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

double Tof2PID::m_pars[15] [private]

Definition at line 56 of file Tof2PID.h.

Referenced by offsetTof2(), and Tof2PID().

double Tof2PID::m_path2 [private]

Definition at line 54 of file Tof2PID.h.

Referenced by particleIDCalculation(), and path2().

double Tof2PID::m_pdfmin [private]

Definition at line 49 of file Tof2PID.h.

Referenced by init(), and particleIDCalculation().

double Tof2PID::m_ph2 [private]

Definition at line 52 of file Tof2PID.h.

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

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

Definition at line 59 of file Tof2PID.h.

Referenced by instance().

double Tof2PID::m_prob[5] [private]

Definition at line 45 of file Tof2PID.h.

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

double Tof2PID::m_sigma[5] [private]

Definition at line 46 of file Tof2PID.h.

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

double Tof2PID::m_tof2 [private]

Definition at line 55 of file Tof2PID.h.

Referenced by particleIDCalculation(), and tof2().

double Tof2PID::m_zhit2 [private]

Definition at line 53 of file Tof2PID.h.

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

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(), particleIDCalculation(), Tof1PID::particleIDCalculation(), and ParticleIDBase::set_path().


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