126 {
127 StatusCode sc = StatusCode::SUCCESS;
128
129 MsgStream log(
msgSvc(), name());
130 log << MSG::INFO << "in execute()" << endreq;
131
132
133
134
135 setFilterPassed(false);
136
137 m_pass[0] += 1;
138
139 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
142
143 Vint ilam, ip, ipi, iGood;
144 iGood.clear();
145 ilam.clear();
146 ip.clear();
147 ipi.clear();
148
150 ppi.clear();
151 pp.clear();
152
153 int TotCharge = 0;
154 for(int i = 0; i < evtRecEvent->totalCharged(); i++){
156 if(!(*itTrk)->isMdcTrackValid()) continue;
158 if(fabs(mdcTrk->
z()) >= m_vz0cut)
continue;
159 if(mdcTrk->
r() >= m_vr0cut)
continue;
160 iGood.push_back(i);
161 TotCharge += mdcTrk->
charge();
162 }
163
164
165
166 int nGood = iGood.size();
167
168
169
170
171
172 if((nGood < 2) || (TotCharge!=0)) return sc;
173
174 m_pass[1] += 1;
175
176
177
179 for(int i = 0; i < nGood; i++) {
181
190
191 if(!(*itTrk)->isMdcKalTrackValid()) continue ;
193
194 if(mdcKalTrk->
charge() == 0)
continue;
195
198 ipi.push_back(iGood[i]);
199 HepLorentzVector
ptrk;
200 ptrk.setPx(mdcKalTrk->
px());
201 ptrk.setPy(mdcKalTrk->
py());
202 ptrk.setPz(mdcKalTrk->
pz());
206 }
209 ip.push_back(iGood[i]);
210 HepLorentzVector
ptrk;
211 ptrk.setPx(mdcKalTrk->
px());
212 ptrk.setPy(mdcKalTrk->
py());
213 ptrk.setPz(mdcKalTrk->
pz());
217 }
218 }
219
220 m_pass[2] += 1;
221
222 int npi = ipi.size();
223 int np = ip.size();
224 m_npi = npi;
225 m_np = np;
226 if(npi < 1 || np <1) return sc;
227
228 m_pass[3] += 1;
229
230
231
232 double chi=999.;
233 double delm;
234
236 HepSymMatrix Evx(3, 0);
237 double bx = 1E+6;
238 double by = 1E+6;
239 double bz = 1E+6;
240 Evx[0][0] = bx*bx;
241 Evx[1][1] = by*by;
242 Evx[2][2] = bz*bz;
246
247 int ipion=-1, iproton=-1;
248
251
252 for(unsigned int i1 = 0; i1 < ipi.size(); i1++) {
253 RecMdcKalTrack *piTrk = (*(evtRecTrkCol->begin()+ipi[i1]))->mdcKalTrack();
256
257 for(unsigned int i2 = 0; i2 < ip.size(); i2++) {
258 RecMdcKalTrack *protonTrk = (*(evtRecTrkCol->begin()+ip[i2]))->mdcKalTrack();
261
262 int NCharge = 0;
264
265
266
267 if(NCharge != 0) continue;
268
273 if(!(vtxfit0->
Fit(0)))
continue;
275
277
280 if(!vtxfit->
Fit())
continue;
281
282
283
284
285 if(vtxfit->
chisq() > chi)
continue;
286
288 chi = vtxfit->
chisq();
289 ipion=ipi[i1];
290 iproton=ip[i2];
291 }
292 }
293
294
295
296 if(ipion==-1 || iproton==-1) return sc;
297 m_pass[4] += 1;
298
299 RecMdcKalTrack *pionTrk = (*(evtRecTrkCol->begin()+ipion))->mdcKalTrack();
302
303 RecMdcKalTrack *protonTrk = (*(evtRecTrkCol->begin()+iproton))->mdcKalTrack();
310 if(!(vtxfit0->
Fit(0)))
return sc;
312
314
317 if(!vtxfit->
Fit())
return sc;
318
319 m_lamRawMass = vtxfit->
p4par().m();
320 m_ctau = vtxfit->
ctau();
323 m_chis = vtxfit->
chisq();
324 m_plam = vtxfit->
p4par().rho();
325
326 if(m_lxyz>3.5){
327
328 TH1 *h(0);
329 if (m_thsvc->getHist("/DQAHist/InclLam/InclLam_mass", h).isSuccess()) {
330 h->Fill(m_lamRawMass);
331 } else {
332 log << MSG::ERROR << "Couldn't retrieve incllam_mass" << endreq;
333 }
334
335 }
336 m_tuple1->write();
337
338
339
340
341
342
343 (*(evtRecTrkCol->begin()+ipion))->tagPion();
344 (*(evtRecTrkCol->begin()+iproton))->tagProton();
345
346
347
348
349
350 (*(evtRecTrkCol->begin()+ipion))->setQuality(1);
351 (*(evtRecTrkCol->begin()+iproton))->setQuality(1);
352
353
354
355
356 setFilterPassed(true);
357
358 return StatusCode::SUCCESS;
359}
EvtRecTrackCol::iterator EvtRecTrackIterator
std::vector< HepLorentzVector > Vp4
const HepVector & helix() const
static void setPidType(PidType pidType)
const HepSymMatrix & err() const
int methodProbability() const
void setChiMinCut(const double chi=4)
void setRecTrack(EvtRecTrack *trk)
void setMethod(const int method)
void identify(const int pidcase)
void usePidSys(const int pidsys)
static ParticleID * instance()
bool IsPidInfoValid() const
double probProton() const
HepLorentzVector p4par() const
double decayLength() const
double decayLengthError() const
static SecondVertexFit * instance()
void setVpar(const VertexParameter vpar)
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
WTrackParameter wVirtualTrack(int n) const
void AddVertex(int number, VertexParameter vpar, std::vector< int > lis)
static VertexFit * instance()
VertexParameter vpar(int n) const
void BuildVirtualParticle(int number)
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecTrackCol