/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Analysis/ParticleID/ParticleID-00-04-61/src/TofQPID.cxx

Go to the documentation of this file.
00001 #include <cmath>
00002 
00003 #include "ParticleID/TofQPID.h"
00004 
00005 #ifndef BEAN
00006 #include "MdcRecEvent/RecMdcTrack.h"
00007 #include "TofRecEvent/RecTofTrack.h"
00008 #include "EvtRecEvent/EvtRecTrack.h"
00009 #endif
00010 
00011 TofQPID * TofQPID::m_pointer = 0;
00012 
00013 TofQPID * TofQPID::instance() {
00014    if(!m_pointer) m_pointer = new TofQPID();
00015    return m_pointer;
00016 }
00017 
00018 TofQPID::TofQPID():ParticleIDBase() {
00019    ;
00020 }
00021 
00022 void TofQPID::init() {
00023    for(int i = 0; i < 5; i++) {
00024       m_chi[i] = 99.0;
00025       m_prob[i] = -1.0;
00026    }
00027    m_chimin = 99.;
00028    m_ndof = 0;
00029    m_hitstatus = -2;
00030    //  m_q1 = -1;
00031    //  m_q2 = -1;
00032 }
00033 
00034 void TofQPID::calculate() {
00035    if(particleIDCalculation() == 0) m_ndof=1;
00036 }
00037 int TofQPID::particleIDCalculation() {
00038    int irc = -1;
00039    EvtRecTrack* recTrk = PidTrk();
00040    if(!(recTrk->isMdcTrackValid())) return irc;
00041    //   RecMdcTrack* mdcTrk = recTrk->mdcTrack();
00042 
00043    //   double ptrk = mdcTrk->p();
00044    //   double cost = cos(mdcTrk->theta());
00045 
00046    if(!(recTrk->isTofTrackValid())) return irc;
00047    // RecTofTrack* tofTrk = recTrk->tofTrack();
00048 
00049    //
00050    // two layer hit in barrel TOF are required
00051    //
00052    //  if(tofTrk->getPart() != 1) return irc;
00053    // double ph1 = tofTrk->getPh1();
00054    // double ph2 = tofTrk->getPh2();
00055    // if(ph1 <= 0 || ph2 <= 0) return irc;
00056    //
00057    //  Tof Q calibration is needed
00058    //
00059    //  m_hitstatus = tofTrk->getHitStatus();
00060    //m_hitstatus = 1;
00061    //if(m_hitstatus == 0 || m_hitstatus == 1) m_q1 = tofTrk->getQ1();
00062    //if(m_hitstatus == 0 || m_hitstatus == 2) m_q2 = tofTrk->getQ2();
00063 
00064    //m_q1 = 1.0;
00065    //m_q2 = 1.0;
00066    m_ndof = 1;
00067    irc = 0;
00068    return irc;
00069 }

Generated on Tue Nov 29 22:57:34 2016 for BOSS_7.0.2 by  doxygen 1.4.7