101 {
102 MsgStream log(
msgSvc(), name());
103 log << MSG::INFO << "in execute()" << endreq;
104
105 StatusCode sc;
106
107
108
109
110 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
111 int event= eventHeader->eventNumber();
112
113
114
117 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
118 << " " << eventHeader->eventNumber() << endreq;
119 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
120 << recEvent->totalCharged() << " , "
121 << recEvent->totalNeutral() << " , "
122 << recEvent->totalTracks() <<endreq;
123
126
129
130
131 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(), "/Event/EvtRec/EvtRecPi0Col");
132 if ( ! recPi0Col ) {
133 log << MSG::FATAL << "Could not find EvtRecPi0Col" << endreq;
134 return StatusCode::FAILURE;
135 }
136
137
138
139 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol(eventSvc(), "/Event/EvtRec/EvtRecEtaToGGCol");
140 if ( ! recEtaToGGCol ) {
141 log << MSG::FATAL << "Could not find EvtRecEtaToGGCol" << endreq;
142 return StatusCode::FAILURE;
143 }
144
145
146 SmartDataPtr<EvtRecVeeVertexCol> recVeeVertexCol(eventSvc(), "/Event/EvtRec/EvtRecVeeVertexCol");
147 if ( ! recVeeVertexCol ) {
148 log << MSG::FATAL << "Could not find EvtRecVeeVertexCol" << endreq;
149 return StatusCode::FAILURE;
150 }
151
152
154 if (!recDTagCol) {
155 log << MSG::FATAL << "EvtRecDTagCol is not registered in TDS" << endreq;
156 return StatusCode::FAILURE;
157 }
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
180 dc_fill(ksList, recVeeVertexCol->begin(), recVeeVertexCol->end());
181
183 dc_fill(pi0List, recPi0Col->begin(), recPi0Col->end());
184
186 dc_fill(etaList, recEtaToGGCol->begin(), recEtaToGGCol->end());
187
188
189
194
195 int run = eventHeader->runNumber();
196 m_ievt = eventHeader->eventNumber();
197 m_nChrg = recEvent->totalCharged();
198 m_nNeu = recEvent->totalNeutral();
199 m_nPion = pionList.size();
200 m_nKaon = kaonList.size();
201 m_nPi0 = pi0List.size();
202 m_nKs = ksList.size();
203
204
205
206
207
208 if(m_ReadBeamEFromDB && m_irun!=run){
209 m_irun=run;
210 if(m_usecalibBeamE)
212 m_beamE=m_readDb.
getbeamE(m_irun, m_beamE);
213 if(run>0)
215
216
217 }
218 double ebeam=m_beamE;
219
220
221
222
223
224
225
226 for(int list=0;list<chanlist.size();list++){
227
228 string channel=chanlist[list];
229 vector<int> numchan;
233
234 bool isFlavorMode=false;
235
236
237
238
239
240
241 if(channel=="D0toKPi") {
243 numchan.push_back(1);
244 numchan.push_back(2);
245 decaylist=kaonList.minus() * pionList.plus();
246 isFlavorMode=true;
247 }
248 else if(channel=="D0toKPiPi0"){
250 numchan.push_back(1);
251 numchan.push_back(2);
252 numchan.push_back(3);
253 decaylist=kaonList.minus() * pionList.plus() * pi0List;
254 isFlavorMode=true;
255 }
256 else if(channel=="D0toKPiPi0Pi0"){
258 numchan.push_back(1);
259 numchan.push_back(2);
260 numchan.push_back(3);
261 numchan.push_back(3);
262 decaylist=kaonList.minus() * pionList.plus() * pi0List * pi0List;
263 isFlavorMode=true;
264 }
265 else if(channel=="D0toKPiPiPi"){
267 numchan.push_back(1);
268 numchan.push_back(2);
269 numchan.push_back(2);
270 numchan.push_back(2);
271 decaylist=kaonList.minus()* pionList.plus()* pionList.plus() * pionList.minus();
272 isFlavorMode=true;
273 }
274 else if(channel=="D0toKPiPiPiPi0"){
276 numchan.push_back(1);
277 numchan.push_back(2);
278 numchan.push_back(2);
279 numchan.push_back(2);
280 numchan.push_back(3);
281 decaylist=kaonList.minus()* pionList.plus()* pionList.plus()* pionList.minus()* pi0List;
282 isFlavorMode=true;
283 }
284 else if(channel=="D0toKPiEta"){
286 numchan.push_back(1);
287 numchan.push_back(2);
288 numchan.push_back(4);
289 decaylist=kaonList.minus() * pionList.plus() * etaList;
290 isFlavorMode=true;
291 }
292 else if(channel=="D0toKsKPi"){
294 numchan.push_back(5);
295 numchan.push_back(1);
296 numchan.push_back(2);
297 decaylist=ksList* kaonList.minus()* pionList.plus();
298 }
299 else if(channel=="D0toKsKPiPi0"){
301 numchan.push_back(5);
302 numchan.push_back(1);
303 numchan.push_back(2);
304 numchan.push_back(3);
305 decaylist=ksList* kaonList.minus() * pionList.plus()* pi0List;
306 }
307 else if(channel=="D0toKsPiPi"){
309 numchan.push_back(5);
310 numchan.push_back(2);
311 numchan.push_back(2);
312 decaylist=ksList* pionList.plus()* pionList.minus();
313 }
314 else if(channel=="D0toKsPiPiPi0"){
316 numchan.push_back(5);
317 numchan.push_back(2);
318 numchan.push_back(2);
319 numchan.push_back(3);
320 decaylist=ksList* pionList.plus()* pionList.minus()* pi0List;
321 }
322 else if(channel=="D0toKsPi0"){
324 numchan.push_back(5);
325 numchan.push_back(3);
326 decaylist=ksList* pi0List;
327 }
328 else if(channel=="D0toPiPiPi0"){
330 numchan.push_back(2);
331 numchan.push_back(2);
332 numchan.push_back(3);
333 decaylist=pionList.plus()* pionList.minus()* pi0List;
334 }
335 else if(channel=="D0toPiPi"){
337 numchan.push_back(2);
338 numchan.push_back(2);
339 decaylist=pionList.plus()* pionList.minus();
340 }
341 else if(channel=="D0toKK"){
343 numchan.push_back(1);
344 numchan.push_back(1);
345 decaylist=kaonList.minus()* kaonList.plus();
346 }
347 else if(channel=="D0toKKPi0"){
349 numchan.push_back(1);
350 numchan.push_back(1);
351 numchan.push_back(3);
352 decaylist=kaonList.minus()* kaonList.plus()* pi0List;
353 }
354 else if(channel=="D0toPi0Pi0"){
356 numchan.push_back(3);
357 numchan.push_back(3);
358 decaylist=pi0List* pi0List;
359 }
360 else if(channel=="D0toKsKs"){
362 numchan.push_back(5);
363 numchan.push_back(5);
364 decaylist=ksList* ksList;
365 }
366 else if(channel=="D0toKsKsPi0"){
368 numchan.push_back(5);
369 numchan.push_back(5);
370 numchan.push_back(3);
371 decaylist=ksList* ksList* pi0List;
372 }
373 else if(channel=="D0toKsPi0Pi0"){
375 numchan.push_back(5);
376 numchan.push_back(3);
377 numchan.push_back(3);
378 decaylist=ksList* pi0List* pi0List;
379 }
380 else if(channel=="D0toKsKK"){
382 numchan.push_back(5);
383 numchan.push_back(1);
384 numchan.push_back(1);
385 decaylist=ksList* kaonList.minus()* kaonList.plus();
386 }
387 else if(channel=="D0toKsEta"){
389 numchan.push_back(5);
390 numchan.push_back(4);
391 decaylist=ksList* etaList;
392 }
393 else if(channel=="D0toPi0Pi0Pi0"){
395 numchan.push_back(3);
396 numchan.push_back(3);
397 numchan.push_back(3);
398 decaylist=pi0List* pi0List* pi0List;
399 }
400 else if(channel=="D0toKsKsKs"){
402 numchan.push_back(5);
403 numchan.push_back(5);
404 numchan.push_back(5);
405 decaylist=ksList* ksList* ksList;
406 }
407 else if(channel=="D0toPiPiPiPi"){
409 numchan.push_back(2);
410 numchan.push_back(2);
411 numchan.push_back(2);
412 numchan.push_back(2);
413 decaylist=pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus();
414 }
415 else if(channel=="D0toPiPiPi0Pi0"){
417 numchan.push_back(2);
418 numchan.push_back(2);
419 numchan.push_back(3);
420 numchan.push_back(3);
421 decaylist=pionList.plus()* pionList.minus()* pi0List* pi0List;
422 }
423 else if(channel=="D0toKKPiPi"){
425 numchan.push_back(1);
426 numchan.push_back(1);
427 numchan.push_back(2);
428 numchan.push_back(2);
429 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus()* pionList.minus();
430 }
431 else if(channel=="D0toKKPi0Pi0"){
433 numchan.push_back(1);
434 numchan.push_back(1);
435 numchan.push_back(3);
436 numchan.push_back(3);
437 decaylist=kaonList.minus()* kaonList.plus()* pi0List* pi0List;
438 }
439 else if(channel=="D0toKsKsPiPi"){
441 numchan.push_back(5);
442 numchan.push_back(5);
443 numchan.push_back(2);
444 numchan.push_back(2);
445 decaylist=ksList* ksList* pionList.plus()* pionList.minus();
446 }
447 else if(channel=="D0toPiPiPiPiPi0"){
449 numchan.push_back(2);
450 numchan.push_back(2);
451 numchan.push_back(2);
452 numchan.push_back(2);
453 numchan.push_back(3);
454 decaylist=pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus()* pi0List;
455 }
456 else if(channel=="D0toKsPiPiPiPi"){
458 numchan.push_back(5);
459 numchan.push_back(2);
460 numchan.push_back(2);
461 numchan.push_back(2);
462 numchan.push_back(2);
463 decaylist=ksList* pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus();
464 }
465 else if(channel=="D0toKKPiPiPi0"){
467 numchan.push_back(1);
468 numchan.push_back(1);
469 numchan.push_back(2);
470 numchan.push_back(2);
471 numchan.push_back(3);
472 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus()* pionList.minus()* pi0List;
473 }
474 else if(channel=="D0toKsPi0Eta"){
476 numchan.push_back(5);
477 numchan.push_back(3);
478 numchan.push_back(4);
479 decaylist=ksList* pi0List* etaList;
480 }
481 else if(channel=="D0toKsEPPiPiEta"){
483 numchan.push_back(5);
484 numchan.push_back(6);
486 epList=pionList.plus()* pionList.minus()* etaList;
487 decaylist= ksList* epList;
488 }
489 else if(channel=="D0toKsEPRhoGam"){
491 numchan.push_back(5);
492 numchan.push_back(7);
494 rhoList=pionList.plus()* pionList.minus();
496 epList=rhoList* photonList;
497 decaylist= ksList* epList;
498 }
499
500
503
505
508
509
510 vector<int> trackid, showerid;
511 vector<int> kaonid, pionid;
512 int charm=0;
513 int numofchildren=numchan.size()-1;
514
515 for(int i=0; i< numofchildren;i++){
516
517 const CDCandidate& daughter=(*it).particle().child(i);
518 if(isFlavorMode && i==0)
520
521 if(numchan[i+1]==1){
523 trackid.push_back(track->
trackId());
524 kaonid.push_back(track->
trackId());
525 }
526 else if(numchan[i+1]==2){
528 trackid.push_back(track->
trackId());
529 pionid.push_back(track->
trackId());
530 }
531 else if ( numchan[i+1]==3){
534 showerid.push_back(hiEnGamma->
trackId());
535 showerid.push_back(loEnGamma->
trackId());
536 }
537 else if ( numchan[i+1]==4){
540 showerid.push_back(hiEnGamma->
trackId());
541 showerid.push_back(loEnGamma->
trackId());
542 }
543 else if ( numchan[i+1]==5){
547 trackid.push_back(pion1Trk->
trackId());
548 trackid.push_back(pion2Trk->
trackId());
549 }
550 else if (numchan[i+1]==6){
558
559 trackid.push_back(apiontrk->
trackId());
560 trackid.push_back(spiontrk->
trackId());
561 showerid.push_back(hiEnGamma->
trackId());
562 showerid.push_back(loEnGamma->
trackId());
563
564 }
565 else if (numchan[i+1]==7){
570
571
575
576
577 trackid.push_back(apiontrk->
trackId());
578 trackid.push_back(spiontrk->
trackId());
579 showerid.push_back(gammatrk->
trackId());
580
581 }
582
583
584 }
585
586
587 saveD0Info(it, ebeam, charm, numofchildren, recDTag);
588 savetrack(trackid,showerid,charged_begin,charged_end,neutral_begin,neutral_end,recDTag);
589 pidtag(kaonid,pionid,kaonList_tight, pionList_tight,recDTag);
590
591
592 trackid.clear();
593 showerid.clear();
594 kaonid.clear();
595 pionid.clear();
596
597
598
599 recDTagCol->push_back(recDTag);
600
601 }
602
603 numchan.clear();
604
605 }
606
607
608 return StatusCode::SUCCESS;
609}
void dc_fill(DCFillableChargedList< Charged > &aFillableList, WitnessIterator first, WitnessIterator last)
EvtRecTrackCol::iterator EvtRecTrackIterator
LocalEptoPiPiEtaSelector eptoPiPiEtaSelector
LocalEptoRhoGamSelector eptoRhoGamSelector
LocalEtatoGGSelector etatoGGSelector
LocalKaonSelector kaonSelector
LocalKsSelector ksSelector
LocalPhotonSelector photonSelector
LocalPi0Selector pi0Selector
LocalPionSelector pionSelector
LocalRhotoPiPiSelector rhotoPiPiSelector
NeutralDSelector neutralDSelector
virtual const DecayEvidence & decay() const
virtual const EvtRecTrack * photon() const
virtual const EvtRecTrack * track() const
virtual const EvtRecVeeVertex * navKshort() const
virtual const EvtRecPi0 * navPi0() const
virtual const EvtRecEtaToGG * navEta() const
const CDCandidate & child(unsigned int aPosition) const
void setdecayMode(DecayMode decayMode)
const EvtRecTrack * hiEnGamma() const
const EvtRecTrack * loEnGamma() const
const EvtRecTrack * loEnGamma() const
const EvtRecTrack * hiEnGamma() const
SmartRef< EvtRecTrack > & daughter(int i)
void setpidtype(int type)
void setpidtype(int type)
void savetrack(vector< int >, vector< int >, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecDTag *)
void pidtag(vector< int >, vector< int >, CDChargedKaonList &, CDChargedPionList &, EvtRecDTag *)
void saveD0Info(CDDecayList::iterator, double, int, int, EvtRecDTag *)
void setbeta(Hep3Vector beta)
void setebeam(double ebeam)
bool setcalib(bool calib)
CLHEP::Hep3Vector getbeta()
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecDTagCol
_EXTERN_ std::string EvtRecTrackCol