5#include "GaudiKernel/MsgStream.h"
6#include "GaudiKernel/AlgFactory.h"
7#include "GaudiKernel/ISvcLocator.h"
8#include "GaudiKernel/SmartDataPtr.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/PropertyMgr.h"
27typedef std::vector<int>
Vint;
28const double mpi = 0.13957;
32Algorithm(name, pSvcLocator) {
35 declareProperty(
"Vz0Cut", m_vzCut = 20.0);
36 declareProperty(
"CosThetaCut", m_cosThetaCut=0.93);
37 declareProperty(
"ChisqCut", m_chisqCut = 100.0);
38 declareProperty(
"UseVFRefine", m_useVFrefine =
false);
54 MsgStream log(
msgSvc(), name());
55 log << MSG::INFO <<
"in initialize()" <<endreq;
57 return StatusCode::SUCCESS;
62 MsgStream log(
msgSvc(), name());
63 log << MSG::INFO <<
"in finalize()" << endreq;
65 return StatusCode::SUCCESS;
68StatusCode KShortReconstruction::registerEvtRecVeeVertexCol(
70 StatusCode sc = eventSvc()->registerObject(
"/Event/EvtRec/EvtRecVeeVertexCol",
71 aNewEvtRecVeeVertexCol);
72 if (sc != StatusCode::SUCCESS) {
73 log << MSG::FATAL <<
"Could not register EvtRecVeeVertexCol in TDS!" << endreq;
80 MsgStream log(
msgSvc(), name());
81 log << MSG::INFO <<
"in execute()" << endreq;
88 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
91 log << MSG::DEBUG <<
"run and event = " << eventHeader->runNumber()
92 <<
" " << eventHeader->eventNumber() << endreq;
93 log << MSG::DEBUG <<
"ncharg, nneu, tottks = "
94 << recEvent->totalCharged() <<
" , "
95 << recEvent->totalNeutral() <<
" , "
96 << recEvent->totalTracks() <<endreq;
97 int evtNo = eventHeader->eventNumber();
102 SmartDataPtr<EvtRecVeeVertexCol> veeVertexCol(eventSvc(),
106 sc = registerEvtRecVeeVertexCol(veeVertexCol, log);
107 if (sc != StatusCode::SUCCESS) {
115 Vint ipip, ipim, iGood;
116 for (
unsigned int i = 0; i < recEvent->totalCharged(); i++) {
119 if(!(*itTrk)->isMdcTrackValid())
continue;
120 if(!(*itTrk)->isMdcKalTrackValid())
continue;
122 if (fabs(
cos(mdcTrk->
theta())) >= m_cosThetaCut)
continue;
123 if (fabs(mdcTrk->
z()) >= m_vzCut)
continue;
125 if (mdcTrk->
charge() > 0) ipip.push_back(i);
126 if (mdcTrk->
charge() < 0) ipim.push_back(i);
130 if (ipip.size() < 1 || ipim.size() < 1)
return StatusCode::SUCCESS;
136 HepSymMatrix Evx(3, 0);
146 for(
unsigned int i1 = 0; i1 < ipip.size(); i1++) {
148 RecMdcKalTrack *pipKalTrk = (*(recTrackCol->begin()+ip1))->mdcKalTrack();
152 for(
unsigned int i2 = 0; i2 < ipim.size(); i2++) {
154 RecMdcKalTrack *pimKalTrk = (*(recTrackCol->begin()+ip2))->mdcKalTrack();
171 bool fitok = vtxfit0->
Fit();
177 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
179 std::pair<int, int> pair;
183 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
184 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
192 KsVertex->
setW(wKshort.
w());
199 veeVertexCol->push_back(KsVertex);
220 if(!(vtxfit0->
Fit(0)))
continue;
222 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
224 std::pair<int, int> pair;
228 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
229 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
237 KsVertex->
setW(wKshort.
w());
244 veeVertexCol->push_back(KsVertex);
262 return StatusCode::SUCCESS;
double cos(const BesAngle a)
EvtRecTrackCol::iterator EvtRecTrackIterator
ObjectVector< EvtRecVeeVertex > EvtRecVeeVertexCol
const HepVector & helix() const
static void setPidType(PidType pidType)
const HepSymMatrix & err() const
const double theta() const
void setVertexType(int vtxType)
void setChi2(double chi2)
void addDaughter(const SmartRef< EvtRecTrack > &track, int i)
void setEw(const HepSymMatrix &Ew)
void setMass(double mass)
void setNTracks(int nTracks)
void setVertexId(int vtxId)
void setPair(const std::pair< int, int > &pair)
void setW(const HepVector &w)
void setNCharge(int nCharge)
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
WTrackParameter wVirtualTrack(int n) const
void AddTrack(const int index, RecMdcKalTrack *p, const RecMdcKalTrack::PidType pid)
static VertexFitRefine * instance()
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
WTrackParameter wVirtualTrack(int n) const
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
static VertexFit * instance()
void BuildVirtualParticle(int number)
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
HepLorentzVector p() const
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecVeeVertexCol
_EXTERN_ std::string EvtRecTrackCol