#include <KShortReconstruction.h>
Public Member Functions | |
KShortReconstruction (const std::string &name, ISvcLocator *pSvcLocator) | |
StatusCode | initialize () |
StatusCode | execute () |
StatusCode | finalize () |
Private Member Functions | |
StatusCode | registerEvtRecVeeVertexCol (EvtRecVeeVertexCol *veeVertexCol, MsgStream &log) |
Private Attributes | |
double | m_vzCut |
double | m_cosThetaCut |
double | m_ChisqCut |
bool | m_useDedx |
bool | m_useTof1 |
bool | m_useTof2 |
bool | m_useTofE |
bool | m_useTofQ |
bool | m_useEmc |
double | m_PidProbCut |
double | m_massRangeLower |
double | m_massRangeHigher |
double | m_chisqCut |
Definition at line 10 of file KShortReconstruction.h.
KShortReconstruction::KShortReconstruction | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 29 of file KShortReconstruction.cxx.
References m_chisqCut, m_cosThetaCut, and m_vzCut.
00029 : 00030 Algorithm(name, pSvcLocator) { 00031 //Declare the properties 00032 00033 declareProperty("Vz0Cut", m_vzCut = 20.0); 00034 declareProperty("CosThetaCut", m_cosThetaCut=0.93); 00035 declareProperty("ChisqCut", m_chisqCut = 100.0); 00036 /* 00037 declareProperty("PidUseDedx", m_useDedx = true); 00038 declareProperty("PidUseTof1", m_useTof1 = true); 00039 declareProperty("PidUseTof2", m_useTof2 = true); 00040 declareProperty("PidUseTofE", m_useTofE = false); 00041 declareProperty("PidUseTofQ", m_useTofQ = false); 00042 declareProperty("PidUseEmc", m_useEmc = false); 00043 declareProperty("PidProbCut", m_PidProbCut= 0.001); 00044 declareProperty("MassRangeLower", m_massRangeLower = 0.45); 00045 declareProperty("MassRangeHigher", m_massRangeHigher = 0.55); 00046 */ 00047 }
StatusCode KShortReconstruction::execute | ( | ) |
Definition at line 76 of file KShortReconstruction.cxx.
References EvtRecVeeVertex::addDaughter(), TrackPool::AddTrack(), VertexFit::AddVertex(), VertexFit::BuildVirtualParticle(), DstMdcTrack::charge(), VertexFit::chisq(), cos(), Bes_Common::DEBUG, DstMdcKalTrack::err(), EventModel::EvtRec::EvtRecEvent, EventModel::EvtRec::EvtRecTrackCol, EventModel::EvtRec::EvtRecVeeVertexCol, WTrackParameter::Ew(), VertexFit::Fit(), DstMdcKalTrack::helix(), genRecEmupikp::i, Bes_Common::INFO, VertexFit::init(), VertexFit::instance(), m_chisqCut, m_cosThetaCut, m_vzCut, mpi, msgSvc(), WTrackParameter::p(), DstMdcKalTrack::pion, registerEvtRecVeeVertexCol(), EvtRecVeeVertex::setChi2(), VertexParameter::setEvx(), EvtRecVeeVertex::setEw(), EvtRecVeeVertex::setMass(), EvtRecVeeVertex::setNCharge(), EvtRecVeeVertex::setNdof(), EvtRecVeeVertex::setNTracks(), EvtRecVeeVertex::setPair(), DstMdcKalTrack::setPidType(), EvtRecVeeVertex::setVertexId(), EvtRecVeeVertex::setVertexType(), VertexParameter::setVx(), EvtRecVeeVertex::setW(), DstMdcTrack::theta(), WTrackParameter::w(), VertexFit::wVirtualTrack(), and DstMdcTrack::z().
00076 { 00077 MsgStream log(msgSvc(), name()); 00078 log << MSG::INFO << "in execute()" << endreq; 00079 00080 StatusCode sc; 00081 00083 // Read REC data 00085 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader"); 00086 SmartDataPtr<EvtRecEvent> recEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent); 00087 SmartDataPtr<EvtRecTrackCol> recTrackCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol); 00088 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber() 00089 << " " << eventHeader->eventNumber() << endreq; 00090 log << MSG::DEBUG <<"ncharg, nneu, tottks = " 00091 << recEvent->totalCharged() << " , " 00092 << recEvent->totalNeutral() << " , " 00093 << recEvent->totalTracks() <<endreq; 00094 int evtNo = eventHeader->eventNumber(); 00095 //if (eventHeader->eventNumber() % 1000 == 0) { 00096 // cout << "Event number = " << evtNo << endl; 00097 //} 00098 00099 SmartDataPtr<EvtRecVeeVertexCol> veeVertexCol(eventSvc(), 00100 EventModel::EvtRec::EvtRecVeeVertexCol); 00101 if (!veeVertexCol) { 00102 veeVertexCol = new EvtRecVeeVertexCol; 00103 sc = registerEvtRecVeeVertexCol(veeVertexCol, log); 00104 if (sc != StatusCode::SUCCESS) { 00105 return sc; 00106 } 00107 } 00108 00110 // No PID : identify positive and negative 00112 Vint ipip, ipim, iGood; 00113 for (unsigned int i = 0; i < recEvent->totalCharged(); i++) { 00114 EvtRecTrackIterator itTrk = recTrackCol->begin() + i; 00115 // EvtRecTrack* track = *itTrk; 00116 if(!(*itTrk)->isMdcTrackValid()) continue; 00117 if(!(*itTrk)->isMdcKalTrackValid()) continue; 00118 RecMdcTrack* mdcTrk = (*itTrk)->mdcTrack(); 00119 if (fabs(cos(mdcTrk->theta())) >= m_cosThetaCut) continue; 00120 if (fabs(mdcTrk->z()) >= m_vzCut) continue; 00121 iGood.push_back(i); 00122 if (mdcTrk->charge() > 0) ipip.push_back(i); 00123 if (mdcTrk->charge() < 0) ipim.push_back(i); 00124 } 00125 // Cut on good charged tracks 00126 //if (iGood.size() < 2) return StatusCode::SUCCESS; 00127 if (ipip.size() < 1 || ipim.size() < 1) return StatusCode::SUCCESS; 00128 00130 // Vertex Fit 00132 HepPoint3D vx(0., 0., 0.); 00133 HepSymMatrix Evx(3, 0); 00134 double bx = 1E+6; 00135 double by = 1E+6; 00136 double bz = 1E+6; 00137 Evx[0][0] = bx*bx; 00138 Evx[1][1] = by*by; 00139 Evx[2][2] = bz*bz; 00140 VertexParameter vxpar; 00141 vxpar.setVx(vx); 00142 vxpar.setEvx(Evx); 00143 00144 VertexFit *vtxfit0 = VertexFit::instance(); 00145 00146 for(unsigned int i1 = 0; i1 < ipip.size(); i1++) { 00147 int ip1 = ipip[i1]; 00148 RecMdcKalTrack *pipKalTrk = (*(recTrackCol->begin()+ip1))->mdcKalTrack(); 00149 RecMdcKalTrack::setPidType(RecMdcKalTrack::pion); 00150 WTrackParameter wpiptrk(mpi, pipKalTrk->helix(), pipKalTrk->err()); 00151 00152 for(unsigned int i2 = 0; i2 < ipim.size(); i2++) { 00153 int ip2 = ipim[i2]; 00154 RecMdcKalTrack *pimKalTrk = (*(recTrackCol->begin()+ip2))->mdcKalTrack(); 00155 RecMdcKalTrack::setPidType(RecMdcKalTrack::pion); 00156 WTrackParameter wpimtrk(mpi, pimKalTrk->helix(), pimKalTrk->err()); 00157 00158 vtxfit0->init(); 00159 vtxfit0->AddTrack(0, wpiptrk); 00160 vtxfit0->AddTrack(1, wpimtrk); 00161 vtxfit0->AddVertex(0, vxpar, 0, 1); 00162 if(!(vtxfit0->Fit(0))) continue; 00163 vtxfit0->BuildVirtualParticle(0); 00164 if(vtxfit0->chisq(0) > m_chisqCut) continue; 00165 WTrackParameter wKshort = vtxfit0->wVirtualTrack(0); //FIXME 00166 std::pair<int, int> pair; 00167 pair.first = 3; 00168 pair.second = 3; 00169 00170 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1); 00171 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2); 00172 00173 EvtRecVeeVertex* KsVertex = new EvtRecVeeVertex; 00174 KsVertex->setVertexId(310); 00175 KsVertex->setVertexType(0); 00176 KsVertex->setChi2(vtxfit0->chisq(0)); 00177 KsVertex->setNdof(1); 00178 KsVertex->setMass(wKshort.p().m()); 00179 KsVertex->setW(wKshort.w()); 00180 KsVertex->setEw(wKshort.Ew()); 00181 KsVertex->setPair(pair); 00182 KsVertex->setNCharge(0); 00183 KsVertex->setNTracks(2); 00184 KsVertex->addDaughter(track0, 0); 00185 KsVertex->addDaughter(track1, 1); 00186 veeVertexCol->push_back(KsVertex); 00187 /* 00188 cout << "============= After Vertex fitting ===========" << endl; 00189 cout << "Event number = " << evtNo << endl; 00190 cout << "chi2 = " << vtxfit0->chisq(0) << endl; 00191 cout << "mass = " << wKshort.p().m() << endl; 00192 cout << "w = " << wKshort.w() << endl; 00193 cout << "Ew = " << wKshort.Ew() << endl; 00194 cout << "track 0 : Z : " << track0->mdcTrack()->z() << endl; 00195 cout << "track 1 : Z : " << track1->mdcTrack()->z() << endl; */ 00196 } 00197 } 00198 00199 return StatusCode::SUCCESS; 00200 }
StatusCode KShortReconstruction::finalize | ( | ) |
Definition at line 58 of file KShortReconstruction.cxx.
References Bes_Common::INFO, and msgSvc().
00058 { 00059 MsgStream log(msgSvc(), name()); 00060 log << MSG::INFO << "in finalize()" << endreq; 00061 00062 return StatusCode::SUCCESS; 00063 }
StatusCode KShortReconstruction::initialize | ( | ) |
Definition at line 50 of file KShortReconstruction.cxx.
References Bes_Common::INFO, and msgSvc().
00050 { 00051 MsgStream log(msgSvc(), name()); 00052 log << MSG::INFO << "in initialize()" <<endreq; 00053 00054 return StatusCode::SUCCESS; 00055 }
StatusCode KShortReconstruction::registerEvtRecVeeVertexCol | ( | EvtRecVeeVertexCol * | veeVertexCol, | |
MsgStream & | log | |||
) | [private] |
Definition at line 65 of file KShortReconstruction.cxx.
References Bes_Common::FATAL.
Referenced by execute().
00066 { 00067 StatusCode sc = eventSvc()->registerObject("/Event/EvtRec/EvtRecVeeVertexCol", 00068 aNewEvtRecVeeVertexCol); 00069 if (sc != StatusCode::SUCCESS) { 00070 log << MSG::FATAL << "Could not register EvtRecVeeVertexCol in TDS!" << endreq; 00071 } 00072 return sc; 00073 }
double KShortReconstruction::m_chisqCut [private] |
Definition at line 39 of file KShortReconstruction.h.
Referenced by execute(), and KShortReconstruction().
double KShortReconstruction::m_ChisqCut [private] |
Definition at line 26 of file KShortReconstruction.h.
double KShortReconstruction::m_cosThetaCut [private] |
Definition at line 25 of file KShortReconstruction.h.
Referenced by execute(), and KShortReconstruction().
double KShortReconstruction::m_massRangeHigher [private] |
Definition at line 37 of file KShortReconstruction.h.
double KShortReconstruction::m_massRangeLower [private] |
Definition at line 36 of file KShortReconstruction.h.
double KShortReconstruction::m_PidProbCut [private] |
Definition at line 34 of file KShortReconstruction.h.
bool KShortReconstruction::m_useDedx [private] |
Definition at line 28 of file KShortReconstruction.h.
bool KShortReconstruction::m_useEmc [private] |
Definition at line 33 of file KShortReconstruction.h.
bool KShortReconstruction::m_useTof1 [private] |
Definition at line 29 of file KShortReconstruction.h.
bool KShortReconstruction::m_useTof2 [private] |
Definition at line 30 of file KShortReconstruction.h.
bool KShortReconstruction::m_useTofE [private] |
Definition at line 31 of file KShortReconstruction.h.
bool KShortReconstruction::m_useTofQ [private] |
Definition at line 32 of file KShortReconstruction.h.
double KShortReconstruction::m_vzCut [private] |
Definition at line 24 of file KShortReconstruction.h.
Referenced by execute(), and KShortReconstruction().