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;