72 eventSvc()->registerObject(
"/Event/EvtRec/EvtRecVeeVertexCol", aNewEvtRecVeeVertexCol );
80 MsgStream log(
msgSvc(), name() );
81 log << MSG::INFO <<
"in execute()" << endmsg;
88 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(),
"/Event/EventHeader" );
91 log << MSG::DEBUG <<
"run and event = " << eventHeader->runNumber() <<
" "
92 << eventHeader->eventNumber() << endmsg;
93 log << MSG::DEBUG <<
"ncharg, nneu, tottks = " << recEvent->totalCharged() <<
" , "
94 << recEvent->totalNeutral() <<
" , " << recEvent->totalTracks() << endmsg;
95 int evtNo = eventHeader->eventNumber();
100 SmartDataPtr<EvtRecVeeVertexCol> veeVertexCol( eventSvc(),
105 sc = registerEvtRecVeeVertexCol( veeVertexCol, log );
106 if ( sc != StatusCode::SUCCESS ) {
return sc; }
112 Vint icp, icm, iGood;
113 for (
unsigned int i = 0; i < recEvent->totalCharged(); i++ )
116 if ( !( *itTrk )->isMdcTrackValid() )
continue;
117 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
119 if ( fabs(
cos( mdcTrk->
theta() ) ) >= m_cosThetaCut )
continue;
120 if ( fabs( mdcTrk->
z() ) >= m_vzCut )
continue;
121 iGood.push_back( i );
122 if ( mdcTrk->
charge() > 0 ) icp.push_back( i );
123 if ( mdcTrk->
charge() < 0 ) icm.push_back( i );
127 if ( icp.size() < 1 || icm.size() < 1 )
return StatusCode::SUCCESS;
133 HepSymMatrix Evx( 3, 0 );
144 for (
unsigned int i1 = 0; i1 < icp.size(); i1++ )
147 RecMdcKalTrack* ppKalTrk = ( *( recTrackCol->begin() + ip1 ) )->mdcKalTrack();
151 for (
unsigned int i2 = 0; i2 < icm.size(); i2++ )
154 RecMdcKalTrack* pimKalTrk = ( *( recTrackCol->begin() + ip2 ) )->mdcKalTrack();
172 bool fitok = vtxfit0->
Fit();
173 if ( !fitok )
continue;
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 );
191 LambdaVertex->
setMass( wLamb.
p().m() );
192 LambdaVertex->
setW( wLamb.
w() );
193 LambdaVertex->
setEw( wLamb.
Ew() );
199 veeVertexCol->push_back( LambdaVertex );
222 if ( !( vtxfit0->
Fit( 0 ) ) )
continue;
224 if ( vtxfit0->
chisq( 0 ) > m_chisqCut )
continue;
226 std::pair<int, int> pair;
230 EvtRecTrack* track0 = *( recTrackCol->begin() + ip1 );
231 EvtRecTrack* track1 = *( recTrackCol->begin() + ip2 );
238 LambdaVertex->
setMass( wLamb.
p().m() );
239 LambdaVertex->
setW( wLamb.
w() );
240 LambdaVertex->
setEw( wLamb.
Ew() );
246 veeVertexCol->push_back( LambdaVertex );
262 for (
unsigned int i1 = 0; i1 < icp.size(); i1++ )
265 RecMdcKalTrack* pipKalTrk = ( *( recTrackCol->begin() + ip1 ) )->mdcKalTrack();
269 for (
unsigned int i2 = 0; i2 < icm.size(); i2++ )
272 RecMdcKalTrack* pmKalTrk = ( *( recTrackCol->begin() + ip2 ) )->mdcKalTrack();
290 bool fitok = vtxfit0->
Fit();
291 if ( !fitok )
continue;
295 if ( vtxfit0->
chisq( 0 ) > m_chisqCut )
continue;
297 std::pair<int, int> pair;
301 EvtRecTrack* track0 = *( recTrackCol->begin() + ip1 );
302 EvtRecTrack* track1 = *( recTrackCol->begin() + ip2 );
309 ALambdaVertex->
setMass( wALamb.
p().m() );
310 ALambdaVertex->
setW( wALamb.
w() );
311 ALambdaVertex->
setEw( wALamb.
Ew() );
312 ALambdaVertex->
setPair( pair );
317 veeVertexCol->push_back( ALambdaVertex );
340 if ( !( vtxfit0->
Fit( 0 ) ) )
continue;
342 if ( vtxfit0->
chisq( 0 ) > m_chisqCut )
continue;
344 std::pair<int, int> pair;
348 EvtRecTrack* track0 = *( recTrackCol->begin() + ip1 );
349 EvtRecTrack* track1 = *( recTrackCol->begin() + ip2 );
356 ALambdaVertex->
setMass( wALamb.
p().m() );
357 ALambdaVertex->
setW( wALamb.
w() );
358 ALambdaVertex->
setEw( wALamb.
Ew() );
359 ALambdaVertex->
setPair( pair );
364 veeVertexCol->push_back( ALambdaVertex );
379 return StatusCode::SUCCESS;