81 {
82 MsgStream log(
msgSvc(), name());
83 log << MSG::INFO << "in execute()" << endreq;
84
85 StatusCode sc;
86
87
88
89
90 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
93 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
94 << " " << eventHeader->eventNumber() << endreq;
95 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
96 << recEvent->totalCharged() << " , "
97 << recEvent->totalNeutral() << " , "
98 << recEvent->totalTracks() <<endreq;
99 int evtNo = eventHeader->eventNumber();
100
101
102
103
104 SmartDataPtr<EvtRecVeeVertexCol> veeVertexCol(eventSvc(),
106 if (!veeVertexCol) {
108 sc = registerEvtRecVeeVertexCol(veeVertexCol, log);
109 if (sc != StatusCode::SUCCESS) {
110 return sc;
111 }
112 }
113
114
115
116
117 Vint icp, icm, iGood;
118 for (unsigned int i = 0; i < recEvent->totalCharged(); i++) {
120 if(!(*itTrk)->isMdcTrackValid()) continue;
121 if(!(*itTrk)->isMdcKalTrackValid()) continue;
123 if (fabs(
cos(mdcTrk->
theta())) >= m_cosThetaCut)
continue;
124 if (fabs(mdcTrk->
z()) >= m_vzCut)
continue;
125 iGood.push_back(i);
126 if (mdcTrk->
charge() > 0) icp.push_back(i);
127 if (mdcTrk->
charge() < 0) icm.push_back(i);
128 }
129
130
131 if (icp.size() < 1 || icm.size() < 1) return StatusCode::SUCCESS;
132
133
134
135
137 HepSymMatrix Evx(3, 0);
138 double bx = 1E+6;
139 double by = 1E+6;
140 double bz = 1E+6;
141 Evx[0][0] = bx*bx;
142 Evx[1][1] = by*by;
143 Evx[2][2] = bz*bz;
144
145
146
147
148 for(unsigned int i1 = 0; i1 < icp.size(); i1++) {
149 int ip1 = icp[i1];
150 RecMdcKalTrack *ppKalTrk = (*(recTrackCol->begin()+ip1))->mdcKalTrack();
153
154 for(unsigned int i2 = 0; i2 < icm.size(); i2++) {
155 int ip2 = icm[i2];
156 RecMdcKalTrack *pimKalTrk = (*(recTrackCol->begin()+ip2))->mdcKalTrack();
159
160 if(m_useVFrefine){
164
167
168
172
173 bool fitok = vtxfit0->
Fit();
174 if(!fitok) continue;
175
176
177
178 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
180 std::pair<int, int> pair;
181 pair.first = 5;
182 pair.second = 3;
183
184 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
185 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
186
192 LambdaVertex->
setMass(wLamb.
p().m());
193 LambdaVertex->
setW(wLamb.
w());
194 LambdaVertex->
setEw(wLamb.
Ew());
200 veeVertexCol->push_back(LambdaVertex);
201
202
203
204
205
206
207
208
209
210
211
212 }else{
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
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
263
264 for(unsigned int i1 = 0; i1 < icp.size(); i1++) {
265 int ip1 = icp[i1];
266 RecMdcKalTrack *pipKalTrk = (*(recTrackCol->begin()+ip1))->mdcKalTrack();
269
270 for(unsigned int i2 = 0; i2 < icm.size(); i2++) {
271 int ip2 = icm[i2];
272 RecMdcKalTrack *pmKalTrk = (*(recTrackCol->begin()+ip2))->mdcKalTrack();
275
276 if(m_useVFrefine){
280
283
284
288
289 bool fitok = vtxfit0->
Fit();
290 if(!fitok) continue;
291
292
293
294 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
296 std::pair<int, int> pair;
297 pair.first = 3;
298 pair.second = 5;
299
300 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
301 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
302
308 ALambdaVertex->
setMass(wALamb.
p().m());
309 ALambdaVertex->
setW(wALamb.
w());
310 ALambdaVertex->
setEw(wALamb.
Ew());
316 veeVertexCol->push_back(ALambdaVertex);
317
318
319
320
321
322
323
324
325
326
327
328 }else{
332
338 if(!(vtxfit0->
Fit(0)))
continue;
340 if(vtxfit0->
chisq(0) > m_chisqCut)
continue;
342 std::pair<int, int> pair;
343 pair.first = 3;
344 pair.second = 5;
345
346 EvtRecTrack* track0 = *(recTrackCol->begin() + ip1);
347 EvtRecTrack* track1 = *(recTrackCol->begin() + ip2);
348
354 ALambdaVertex->
setMass(wALamb.
p().m());
355 ALambdaVertex->
setW(wALamb.
w());
356 ALambdaVertex->
setEw(wALamb.
Ew());
362 veeVertexCol->push_back(ALambdaVertex);
363
364
365
366
367
368
369
370
371
372
373
374 }
375
376 }
377 }
378
379
380
381 return StatusCode::SUCCESS;
382}
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