106 MsgStream log(
msgSvc(), name());
107 log << MSG::INFO <<
"in execute()" << endreq;
114 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
115 int event= eventHeader->eventNumber();
121 log << MSG::DEBUG <<
"run and event = " << eventHeader->runNumber()
122 <<
" " << eventHeader->eventNumber() << endreq;
123 log << MSG::DEBUG <<
"ncharg, nneu, tottks = "
124 << recEvent->totalCharged() <<
" , "
125 << recEvent->totalNeutral() <<
" , "
126 << recEvent->totalTracks() <<endreq;
135 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(),
"/Event/EvtRec/EvtRecPi0Col");
137 log << MSG::FATAL <<
"Could not find EvtRecPi0Col" << endreq;
138 return StatusCode::FAILURE;
143 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol(eventSvc(),
"/Event/EvtRec/EvtRecEtaToGGCol");
144 if ( ! recEtaToGGCol ) {
145 log << MSG::FATAL <<
"Could not find EvtRecEtaToGGCol" << endreq;
146 return StatusCode::FAILURE;
150 SmartDataPtr<EvtRecVeeVertexCol> recVeeVertexCol(eventSvc(),
"/Event/EvtRec/EvtRecVeeVertexCol");
151 if ( ! recVeeVertexCol ) {
152 log << MSG::FATAL <<
"Could not find EvtRecVeeVertexCol" << endreq;
153 return StatusCode::FAILURE;
159 log << MSG::FATAL <<
"EvtRecDTagCol is not registered in TDS" << endreq;
160 return StatusCode::FAILURE;
164 Hep3Vector xorigin(0,0,0);
166 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
171 xorigin.setX(vertex[0]);
172 xorigin.setY(vertex[1]);
173 xorigin.setZ(vertex[2]);
201 dc_fill(ksList, recVeeVertexCol->begin(), recVeeVertexCol->end());
204 map<EvtRecVeeVertex*, vector< double > > fitinfo;
205 for(
CDKsList::iterator ksit = ksList.particle_begin(); ksit != ksList.particle_end(); ++ksit ){
217 dc_fill(pi0List, recPi0Col->begin(), recPi0Col->end());
220 dc_fill(etaList, recEtaToGGCol->begin(), recEtaToGGCol->end());
229 int run = eventHeader->runNumber();
230 m_ievt = eventHeader->eventNumber();
231 m_nChrg = recEvent->totalCharged();
232 m_nNeu = recEvent->totalNeutral();
233 m_nPion = pionList.
size();
234 m_nKaon = kaonList.
size();
235 m_nPi0 = pi0List.size();
236 m_nKs = ksList.size();
242 if(m_ReadBeamEFromDB && m_irun!=run){
246 m_beamE=m_readDb.
getbeamE(m_irun, m_beamE);
252 double ebeam=m_beamE;
260 for(
int list=0;list<chanlist.size();list++){
262 string channel=chanlist[list];
268 bool isFlavorMode=
false;
275 if(channel==
"D0toKPi") {
277 numchan.push_back(1);
278 numchan.push_back(2);
279 decaylist=kaonList.
minus() * pionList.
plus();
282 else if(channel==
"D0toKPiPi0"){
284 numchan.push_back(1);
285 numchan.push_back(2);
286 numchan.push_back(3);
287 decaylist=kaonList.
minus() * pionList.
plus() * pi0List;
290 else if(channel==
"D0toKPiPi0Pi0"){
292 numchan.push_back(1);
293 numchan.push_back(2);
294 numchan.push_back(3);
295 numchan.push_back(3);
296 decaylist=kaonList.
minus() * pionList.
plus() * pi0List * pi0List;
299 else if(channel==
"D0toKPiPiPi"){
301 numchan.push_back(1);
302 numchan.push_back(2);
303 numchan.push_back(2);
304 numchan.push_back(2);
308 else if(channel==
"D0toKPiPiPiPi0"){
310 numchan.push_back(1);
311 numchan.push_back(2);
312 numchan.push_back(2);
313 numchan.push_back(2);
314 numchan.push_back(3);
315 decaylist=kaonList.
minus()* pionList.
plus()* pionList.
plus()* pionList.
minus()* pi0List;
318 else if(channel==
"D0toKPiEta"){
320 numchan.push_back(1);
321 numchan.push_back(2);
322 numchan.push_back(4);
323 decaylist=kaonList.
minus() * pionList.
plus() * etaList;
326 else if(channel==
"D0toKsKPi"){
328 numchan.push_back(5);
329 numchan.push_back(1);
330 numchan.push_back(2);
331 decaylist=ksList* kaonList.
minus()* pionList.
plus();
333 else if(channel==
"D0toKsKPiPi0"){
335 numchan.push_back(5);
336 numchan.push_back(1);
337 numchan.push_back(2);
338 numchan.push_back(3);
339 decaylist=ksList* kaonList.
minus() * pionList.
plus()* pi0List;
341 else if(channel==
"D0toKsPiPi"){
343 numchan.push_back(5);
344 numchan.push_back(2);
345 numchan.push_back(2);
346 decaylist=ksList* pionList.
plus()* pionList.
minus();
348 else if(channel==
"D0toKsPiPiPi0"){
350 numchan.push_back(5);
351 numchan.push_back(2);
352 numchan.push_back(2);
353 numchan.push_back(3);
354 decaylist=ksList* pionList.
plus()* pionList.
minus()* pi0List;
356 else if(channel==
"D0toKsPi0"){
358 numchan.push_back(5);
359 numchan.push_back(3);
360 decaylist=ksList* pi0List;
362 else if(channel==
"D0toPiPiPi0"){
364 numchan.push_back(2);
365 numchan.push_back(2);
366 numchan.push_back(3);
367 decaylist=pionList.
plus()* pionList.
minus()* pi0List;
369 else if(channel==
"D0toPiPi"){
371 numchan.push_back(2);
372 numchan.push_back(2);
373 decaylist=pionList.
plus()* pionList.
minus();
375 else if(channel==
"D0toKK"){
377 numchan.push_back(1);
378 numchan.push_back(1);
379 decaylist=kaonList.
minus()* kaonList.
plus();
381 else if(channel==
"D0toKKPi0"){
383 numchan.push_back(1);
384 numchan.push_back(1);
385 numchan.push_back(3);
386 decaylist=kaonList.
minus()* kaonList.
plus()* pi0List;
388 else if(channel==
"D0toPi0Pi0"){
390 numchan.push_back(3);
391 numchan.push_back(3);
392 decaylist=pi0List* pi0List;
394 else if(channel==
"D0toKsKs"){
396 numchan.push_back(5);
397 numchan.push_back(5);
398 decaylist=ksList* ksList;
400 else if(channel==
"D0toKsKsPi0"){
402 numchan.push_back(5);
403 numchan.push_back(5);
404 numchan.push_back(3);
405 decaylist=ksList* ksList* pi0List;
407 else if(channel==
"D0toKsPi0Pi0"){
409 numchan.push_back(5);
410 numchan.push_back(3);
411 numchan.push_back(3);
412 decaylist=ksList* pi0List* pi0List;
414 else if(channel==
"D0toKsKK"){
416 numchan.push_back(5);
417 numchan.push_back(1);
418 numchan.push_back(1);
419 decaylist=ksList* kaonList.
minus()* kaonList.
plus();
421 else if(channel==
"D0toKsEta"){
423 numchan.push_back(5);
424 numchan.push_back(4);
425 decaylist=ksList* etaList;
427 else if(channel==
"D0toPi0Pi0Pi0"){
429 numchan.push_back(3);
430 numchan.push_back(3);
431 numchan.push_back(3);
432 decaylist=pi0List* pi0List* pi0List;
434 else if(channel==
"D0toKsKsKs"){
436 numchan.push_back(5);
437 numchan.push_back(5);
438 numchan.push_back(5);
439 decaylist=ksList* ksList* ksList;
441 else if(channel==
"D0toPiPiPiPi"){
443 numchan.push_back(2);
444 numchan.push_back(2);
445 numchan.push_back(2);
446 numchan.push_back(2);
449 else if(channel==
"D0toPiPiPi0Pi0"){
451 numchan.push_back(2);
452 numchan.push_back(2);
453 numchan.push_back(3);
454 numchan.push_back(3);
455 decaylist=pionList.
plus()* pionList.
minus()* pi0List* pi0List;
457 else if(channel==
"D0toKKPiPi"){
459 numchan.push_back(1);
460 numchan.push_back(1);
461 numchan.push_back(2);
462 numchan.push_back(2);
465 else if(channel==
"D0toKKPi0Pi0"){
467 numchan.push_back(1);
468 numchan.push_back(1);
469 numchan.push_back(3);
470 numchan.push_back(3);
471 decaylist=kaonList.
minus()* kaonList.
plus()* pi0List* pi0List;
473 else if(channel==
"D0toKsKsPiPi"){
475 numchan.push_back(5);
476 numchan.push_back(5);
477 numchan.push_back(2);
478 numchan.push_back(2);
479 decaylist=ksList* ksList* pionList.
plus()* pionList.
minus();
481 else if(channel==
"D0toPiPiPiPiPi0"){
483 numchan.push_back(2);
484 numchan.push_back(2);
485 numchan.push_back(2);
486 numchan.push_back(2);
487 numchan.push_back(3);
488 decaylist=pionList.
plus()* pionList.
plus()* pionList.
minus()* pionList.
minus()* pi0List;
490 else if(channel==
"D0toKsPiPiPiPi"){
492 numchan.push_back(5);
493 numchan.push_back(2);
494 numchan.push_back(2);
495 numchan.push_back(2);
496 numchan.push_back(2);
497 decaylist=ksList* pionList.
plus()* pionList.
plus()* pionList.
minus()* pionList.
minus();
499 else if(channel==
"D0toKKPiPiPi0"){
501 numchan.push_back(1);
502 numchan.push_back(1);
503 numchan.push_back(2);
504 numchan.push_back(2);
505 numchan.push_back(3);
506 decaylist=kaonList.
minus()* kaonList.
plus()* pionList.
plus()* pionList.
minus()* pi0List;
508 else if(channel==
"D0toKsPi0Eta"){
510 numchan.push_back(5);
511 numchan.push_back(3);
512 numchan.push_back(4);
513 decaylist=ksList* pi0List* etaList;
515 else if(channel==
"D0toKsEPPiPiEta"){
517 numchan.push_back(5);
518 numchan.push_back(6);
520 epList=pionList.
plus()* pionList.
minus()* etaList;
521 decaylist= ksList* epList;
523 else if(channel==
"D0toKsEPRhoGam"){
525 numchan.push_back(5);
526 numchan.push_back(7);
528 rhoList=pionList.
plus()* pionList.
minus();
530 epList=rhoList* photonList;
531 decaylist= ksList* epList;
533 else if(channel==
"D0toKsPi0Pi0Pi0"){
535 numchan.push_back(5);
536 numchan.push_back(3);
537 numchan.push_back(3);
538 numchan.push_back(3);
539 decaylist=ksList* pi0List* pi0List* pi0List;
552 vector<int> trackid, showerid;
553 vector<int> kaonid, pionid;
555 int numofchildren=numchan.size()-1;
557 for(
int i=0; i< numofchildren;i++){
559 const CDCandidate& daughter=(*it).particle().child(i);
560 if(isFlavorMode && i==0)
565 trackid.push_back(track->
trackId());
566 kaonid.push_back(track->
trackId());
568 else if(numchan[i+1]==2){
570 trackid.push_back(track->
trackId());
571 pionid.push_back(track->
trackId());
573 else if ( numchan[i+1]==3){
576 showerid.push_back(hiEnGamma->
trackId());
577 showerid.push_back(loEnGamma->
trackId());
579 else if ( numchan[i+1]==4){
582 showerid.push_back(hiEnGamma->
trackId());
583 showerid.push_back(loEnGamma->
trackId());
585 else if ( numchan[i+1]==5){
588 recDTag->
addToFitInfo(aKsCand->
mass(),fitinfo[aKsCand][0],fitinfo[aKsCand][1],fitinfo[aKsCand][2]);
592 trackid.push_back(pion1Trk->
trackId());
593 trackid.push_back(pion2Trk->
trackId());
595 else if (numchan[i+1]==6){
604 trackid.push_back(apiontrk->
trackId());
605 trackid.push_back(spiontrk->
trackId());
606 showerid.push_back(hiEnGamma->
trackId());
607 showerid.push_back(loEnGamma->
trackId());
610 else if (numchan[i+1]==7){
622 trackid.push_back(apiontrk->
trackId());
623 trackid.push_back(spiontrk->
trackId());
624 showerid.push_back(gammatrk->
trackId());
633 savetrack(trackid,showerid,charged_begin,charged_end,neutral_begin,neutral_end,recDTag);
634 pidtag(kaonid,pionid,kaonList_tight, pionList_tight,recDTag);
637 if(m_debug) cout<<
"beforevfit:"<<endl;
639 HepLorentzVector p4change_vfit;
642 p4change_vfit=util.
vfitref(channel, kaonid, pionid, xorigin, charged_begin);
644 p4change_vfit=util.
vfit(channel, kaonid, pionid, xorigin, charged_begin);
647 recDTag->
setp4(recDTag->
p4()+p4change_vfit);
658 recDTagCol->push_back(recDTag);
667 return StatusCode::SUCCESS;