79 {
80 MsgStream log(
msgSvc(), name() );
81 log << MSG::INFO << "in execute()" << endmsg;
82
83 StatusCode sc;
84
85
86
87
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();
96
97
98
99
100 SmartDataPtr<EvtRecVeeVertexCol> veeVertexCol( eventSvc(),
102 if ( !veeVertexCol )
103 {
105 sc = registerEvtRecVeeVertexCol( veeVertexCol, log );
106 if ( sc != StatusCode::SUCCESS ) { return sc; }
107 }
108
109
110
111
112 Vint icp, icm, iGood;
113 for ( unsigned int i = 0; i < recEvent->totalCharged(); i++ )
114 {
116 if ( !( *itTrk )->isMdcTrackValid() ) continue;
117 if ( !( *itTrk )->isMdcKalTrackValid() ) continue;
118 RecMdcTrack* mdcTrk = ( *itTrk )->mdcTrack();
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 );
124 }
125
126
127 if ( icp.size() < 1 || icm.size() < 1 ) return StatusCode::SUCCESS;
128
129
130
131
133 HepSymMatrix Evx( 3, 0 );
134 double bx = 1E+6;
135 double by = 1E+6;
136 double bz = 1E+6;
137 Evx[0][0] = bx * bx;
138 Evx[1][1] = by * by;
139 Evx[2][2] = bz * bz;
140
141
142
143
144 for ( unsigned int i1 = 0; i1 < icp.size(); i1++ )
145 {
146 int ip1 = icp[i1];
147 RecMdcKalTrack* ppKalTrk = ( *( recTrackCol->begin() + ip1 ) )->mdcKalTrack();
149 WTrackParameter wpptrk(
mp, ppKalTrk->
helix(), ppKalTrk->
err() );
150
151 for ( unsigned int i2 = 0; i2 < icm.size(); i2++ )
152 {
153 int ip2 = icm[i2];
154 RecMdcKalTrack* pimKalTrk = ( *( recTrackCol->begin() + ip2 ) )->mdcKalTrack();
156 WTrackParameter wpimtrk(
mpi, pimKalTrk->
helix(), pimKalTrk->
err() );
157
158 if ( m_useVFrefine )
159 {
160 VertexParameter vxpar;
163
166
167
171
172 bool fitok = vtxfit0->
Fit();
173 if ( !fitok ) continue;
174
175
176
177 if ( vtxfit0->
chisq( 0 ) > m_chisqCut )
continue;
179 std::pair<int, int> pair;
180 pair.first = 5;
181 pair.second = 3;
182
183 EvtRecTrack* track0 = *( recTrackCol->begin() + ip1 );
184 EvtRecTrack* track1 = *( recTrackCol->begin() + ip2 );
185
186 EvtRecVeeVertex* LambdaVertex = new EvtRecVeeVertex;
191 LambdaVertex->
setMass( wLamb.
p().m() );
192 LambdaVertex->
setW( wLamb.
w() );
193 LambdaVertex->
setEw( wLamb.
Ew() );
199 veeVertexCol->push_back( LambdaVertex );
200
201
202
203
204
205
206
207
208
209
210 }
211 else
212 {
213 VertexParameter vxpar;
216
222 if ( !( vtxfit0->
Fit( 0 ) ) )
continue;
224 if ( vtxfit0->
chisq( 0 ) > m_chisqCut )
continue;
226 std::pair<int, int> pair;
227 pair.first = 5;
228 pair.second = 3;
229
230 EvtRecTrack* track0 = *( recTrackCol->begin() + ip1 );
231 EvtRecTrack* track1 = *( recTrackCol->begin() + ip2 );
232
233 EvtRecVeeVertex* LambdaVertex = new EvtRecVeeVertex;
238 LambdaVertex->
setMass( wLamb.
p().m() );
239 LambdaVertex->
setW( wLamb.
w() );
240 LambdaVertex->
setEw( wLamb.
Ew() );
246 veeVertexCol->push_back( LambdaVertex );
247
248
249
250
251
252
253
254
255
256
257 }
258 }
259 }
260
261
262 for ( unsigned int i1 = 0; i1 < icp.size(); i1++ )
263 {
264 int ip1 = icp[i1];
265 RecMdcKalTrack* pipKalTrk = ( *( recTrackCol->begin() + ip1 ) )->mdcKalTrack();
267 WTrackParameter wpiptrk(
mpi, pipKalTrk->
helix(), pipKalTrk->
err() );
268
269 for ( unsigned int i2 = 0; i2 < icm.size(); i2++ )
270 {
271 int ip2 = icm[i2];
272 RecMdcKalTrack* pmKalTrk = ( *( recTrackCol->begin() + ip2 ) )->mdcKalTrack();
274 WTrackParameter wpmtrk(
mp, pmKalTrk->
helix(), pmKalTrk->
err() );
275
276 if ( m_useVFrefine )
277 {
278 VertexParameter vxpar;
281
284
285
289
290 bool fitok = vtxfit0->
Fit();
291 if ( !fitok ) continue;
292
293
294
295 if ( vtxfit0->
chisq( 0 ) > m_chisqCut )
continue;
297 std::pair<int, int> pair;
298 pair.first = 3;
299 pair.second = 5;
300
301 EvtRecTrack* track0 = *( recTrackCol->begin() + ip1 );
302 EvtRecTrack* track1 = *( recTrackCol->begin() + ip2 );
303
304 EvtRecVeeVertex* ALambdaVertex = new EvtRecVeeVertex;
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 );
318
319
320
321
322
323
324
325
326
327
328 }
329 else
330 {
331 VertexParameter vxpar;
334
340 if ( !( vtxfit0->
Fit( 0 ) ) )
continue;
342 if ( vtxfit0->
chisq( 0 ) > m_chisqCut )
continue;
344 std::pair<int, int> pair;
345 pair.first = 3;
346 pair.second = 5;
347
348 EvtRecTrack* track0 = *( recTrackCol->begin() + ip1 );
349 EvtRecTrack* track1 = *( recTrackCol->begin() + ip2 );
350
351 EvtRecVeeVertex* ALambdaVertex = new EvtRecVeeVertex;
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 );
365
366
367
368
369
370
371
372
373
374
375 }
376 }
377 }
378
379 return StatusCode::SUCCESS;
380}
HepGeom::Point3D< double > HepPoint3D
EvtRecTrackCol::iterator EvtRecTrackIterator
ObjectVector< EvtRecVeeVertex > EvtRecVeeVertexCol
double cos(const BesAngle a)
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