105 MsgStream log(
msgSvc(), name());
106 log << MSG::INFO <<
"in execute()" << endreq;
113 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
114 int event= eventHeader->eventNumber();
120 log << MSG::DEBUG <<
"run and event = " << eventHeader->runNumber()
121 <<
" " << eventHeader->eventNumber() << endreq;
122 log << MSG::DEBUG <<
"ncharg, nneu, tottks = "
123 << recEvent->totalCharged() <<
" , "
124 << recEvent->totalNeutral() <<
" , "
125 << recEvent->totalTracks() <<endreq;
134 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(),
"/Event/EvtRec/EvtRecPi0Col");
136 log << MSG::FATAL <<
"Could not find EvtRecPi0Col" << endreq;
137 return StatusCode::FAILURE;
141 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol(eventSvc(),
"/Event/EvtRec/EvtRecEtaToGGCol");
142 if ( ! recEtaToGGCol ) {
143 log << MSG::FATAL <<
"Could not find EvtRecEtaToGGCol" << endreq;
144 return StatusCode::FAILURE;
148 SmartDataPtr<EvtRecVeeVertexCol> recVeeVertexCol(eventSvc(),
"/Event/EvtRec/EvtRecVeeVertexCol");
149 if ( ! recVeeVertexCol ) {
150 log << MSG::FATAL <<
"Could not find EvtRecVeeVertexCol" << endreq;
151 return StatusCode::FAILURE;
157 log << MSG::FATAL <<
"EvtRecDTagCol is not registered yet" << endreq;
158 return StatusCode::FAILURE;
164 Hep3Vector xorigin(0,0,0);
167 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
172 xorigin.setX(vertex[0]);
173 xorigin.setY(vertex[1]);
174 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());
230 int run = eventHeader->runNumber();
231 m_ievt = eventHeader->eventNumber();
232 m_nChrg = recEvent->totalCharged();
233 m_nNeu = recEvent->totalNeutral();
234 m_nPion = pionList.
size();
235 m_nKaon = kaonList.
size();
236 m_nPi0 = pi0List.size();
237 m_nKs = ksList.size();
245 if(m_ReadBeamEFromDB && m_irun!=run){
249 m_beamE=m_readDb.
getbeamE(m_irun,m_beamE);
254 double ebeam=m_beamE;
262 for(
int list=0;list<chanlist.size();list++){
264 string channel=chanlist[list];
274 if(channel==
"DptoKPiPi") {
276 numchan.push_back(1);
277 numchan.push_back(2);
278 numchan.push_back(2);
279 decaylist=kaonList.
minus()* pionList.
plus()* pionList.
plus();
281 else if(channel==
"DptoKPiPiPi0") {
283 numchan.push_back(1);
284 numchan.push_back(2);
285 numchan.push_back(2);
286 numchan.push_back(3);
287 decaylist=kaonList.
minus()* pionList.
plus()* pionList.
plus()* pi0List;
289 else if(channel==
"DptoKsPi") {
291 numchan.push_back(5);
292 numchan.push_back(2);
293 decaylist=ksList* pionList.
plus();
295 else if(channel==
"DptoKsPiPi0") {
297 numchan.push_back(5);
298 numchan.push_back(2);
299 numchan.push_back(3);
300 decaylist=ksList* pionList.
plus()* pi0List;
302 else if(channel==
"DptoKsPiPiPi") {
304 numchan.push_back(5);
305 numchan.push_back(2);
306 numchan.push_back(2);
307 numchan.push_back(2);
308 decaylist=ksList* pionList.
plus()* pionList.
plus()* pionList.
minus();
310 else if(channel==
"DptoKKPi") {
312 numchan.push_back(1);
313 numchan.push_back(1);
314 numchan.push_back(2);
315 decaylist=kaonList.
minus()* kaonList.
plus()* pionList.
plus();
317 else if(channel==
"DptoPiPi0") {
319 numchan.push_back(2);
320 numchan.push_back(3);
321 decaylist=pionList.
plus()* pi0List;
323 else if(channel==
"DptoKPi0") {
325 numchan.push_back(1);
326 numchan.push_back(3);
327 decaylist=kaonList.
plus()* pi0List;
329 else if(channel==
"DptoKsK") {
331 numchan.push_back(5);
332 numchan.push_back(1);
333 decaylist=ksList* kaonList.
plus();
335 else if(channel==
"DptoPiPiPi") {
337 numchan.push_back(2);
338 numchan.push_back(2);
339 numchan.push_back(2);
340 decaylist=pionList.
plus()* pionList.
plus()* pionList.
minus() ;
342 else if(channel==
"DptoPiPi0Pi0") {
344 numchan.push_back(2);
345 numchan.push_back(3);
346 numchan.push_back(3);
347 decaylist=pionList.
plus()* pi0List* pi0List;
349 else if(channel==
"DptoKsKsPi") {
351 numchan.push_back(5);
352 numchan.push_back(5);
353 numchan.push_back(2);
354 decaylist=ksList* ksList* pionList.
plus();
356 else if(channel==
"DptoKsKPi0") {
358 numchan.push_back(5);
359 numchan.push_back(1);
360 numchan.push_back(3);
361 decaylist=ksList* kaonList.
plus()* pi0List;
363 else if(channel==
"DptoKsKsK") {
365 numchan.push_back(5);
366 numchan.push_back(5);
367 numchan.push_back(1);
368 decaylist=ksList* ksList* kaonList.
plus();
370 else if(channel==
"DptoPiPiPiPi0") {
372 numchan.push_back(2);
373 numchan.push_back(2);
374 numchan.push_back(2);
375 numchan.push_back(3);
376 decaylist=pionList.
plus()* pionList.
plus()* pionList.
minus()* pi0List;
378 else if(channel==
"DptoKsPiPi0Pi0") {
380 numchan.push_back(5);
381 numchan.push_back(2);
382 numchan.push_back(3);
383 numchan.push_back(3);
384 decaylist=ksList* pionList.
plus()* pi0List* pi0List;
386 else if(channel==
"DptoKsKplusPiPi") {
388 numchan.push_back(5);
389 numchan.push_back(1);
390 numchan.push_back(2);
391 numchan.push_back(2);
392 decaylist=ksList* kaonList.
plus()* pionList.
plus()* pionList.
minus();
394 else if(channel==
"DptoKsKminusPiPi") {
396 numchan.push_back(5);
397 numchan.push_back(1);
398 numchan.push_back(2);
399 numchan.push_back(2);
400 decaylist=ksList* kaonList.
minus()* pionList.
plus()* pionList.
plus();
402 else if(channel==
"DptoKKPiPi0") {
404 numchan.push_back(1);
405 numchan.push_back(1);
406 numchan.push_back(2);
407 numchan.push_back(3);
408 decaylist=kaonList.
minus()* kaonList.
plus()* pionList.
plus()* pi0List;
410 else if(channel==
"DptoPiPiPiPiPi") {
412 numchan.push_back(2);
413 numchan.push_back(2);
414 numchan.push_back(2);
415 numchan.push_back(2);
416 numchan.push_back(2);
419 else if(channel==
"DptoKPiPiPiPi") {
421 numchan.push_back(1);
422 numchan.push_back(2);
423 numchan.push_back(2);
424 numchan.push_back(2);
425 numchan.push_back(2);
428 else if(channel==
"DptoPiEta") {
430 numchan.push_back(2);
431 numchan.push_back(4);
432 decaylist=pionList.
plus()* etaList;
434 else if(channel==
"DptoKsPiEta") {
436 numchan.push_back(5);
437 numchan.push_back(2);
438 numchan.push_back(4);
439 decaylist=ksList* pionList.
plus()* etaList;
441 else if(channel==
"DptoKPiPiPi0Pi0") {
443 numchan.push_back(1);
444 numchan.push_back(2);
445 numchan.push_back(2);
446 numchan.push_back(3);
447 numchan.push_back(3);
448 decaylist=kaonList.
minus()* pionList.
plus()* pionList.
plus()* pi0List* pi0List;
450 else if(channel==
"DptoKsPiPiPiPi0") {
452 numchan.push_back(5);
453 numchan.push_back(2);
454 numchan.push_back(2);
455 numchan.push_back(2);
456 numchan.push_back(3);
457 decaylist=ksList* pionList.
plus()* pionList.
plus()* pionList.
minus()* pi0List;
459 else if(channel==
"DptoKsPiPi0Pi0Pi0") {
461 numchan.push_back(5);
462 numchan.push_back(2);
463 numchan.push_back(3);
464 numchan.push_back(3);
465 numchan.push_back(3);
466 decaylist=ksList* pionList.
plus()* pi0List* pi0List* pi0List;
468 else if(channel==
"DptoKsPiEPPiPiEta"){
470 numchan.push_back(5);
471 numchan.push_back(2);
472 numchan.push_back(6);
474 epList=pionList.
plus()* pionList.
minus()* etaList;
475 decaylist= ksList* pionList.
plus()* epList;
477 else if(channel==
"DptoKsPiEPRhoGam"){
479 numchan.push_back(5);
480 numchan.push_back(2);
481 numchan.push_back(7);
483 rhoList=pionList.
plus()* pionList.
minus();
485 epList=rhoList* photonList;
486 decaylist= ksList* pionList.
plus()* epList;
488 else if(channel==
"DptoKPiPiEta") {
490 numchan.push_back(1);
491 numchan.push_back(2);
492 numchan.push_back(2);
493 numchan.push_back(4);
494 decaylist=kaonList.
minus()* pionList.
plus()* pionList.
plus()* etaList;
496 else if(channel==
"DptoKsPiPi0Eta") {
498 numchan.push_back(5);
499 numchan.push_back(2);
500 numchan.push_back(3);
501 numchan.push_back(4);
502 decaylist=ksList* pionList.
plus()* pi0List* etaList;
504 else if(channel==
"DptoKsKKPi") {
506 numchan.push_back(5);
507 numchan.push_back(1);
508 numchan.push_back(1);
509 numchan.push_back(2);
510 decaylist=ksList* kaonList.
minus()* kaonList.
plus()* pionList.
plus();
512 else if(channel==
"DptoPiPiPiPi0Pi0") {
514 numchan.push_back(2);
515 numchan.push_back(2);
516 numchan.push_back(2);
517 numchan.push_back(3);
518 numchan.push_back(3);
519 decaylist=pionList.
plus()* pionList.
plus()* pionList.
minus()* pi0List* pi0List;
521 else if(channel==
"DptoPiPi0Eta") {
523 numchan.push_back(2);
524 numchan.push_back(3);
525 numchan.push_back(4);
526 decaylist=pionList.
plus()* pi0List* etaList;
528 else if(channel==
"DptoPiPiPiEta") {
530 numchan.push_back(2);
531 numchan.push_back(2);
532 numchan.push_back(2);
533 numchan.push_back(4);
534 decaylist=pionList.
plus()* pionList.
plus()* pionList.
minus()* etaList ;
536 else if(channel==
"DptoPiEtaEta") {
538 numchan.push_back(2);
539 numchan.push_back(4);
540 numchan.push_back(4);
541 decaylist=pionList.
plus()* etaList* etaList;
543 else if(channel==
"DptoPiEPPiPiEta"){
545 numchan.push_back(2);
546 numchan.push_back(6);
548 epList=pionList.
plus()* pionList.
minus()* etaList;
549 decaylist= pionList.
plus()* epList;
551 else if(channel==
"DptoPiEPRhoGam"){
553 numchan.push_back(2);
554 numchan.push_back(7);
556 rhoList=pionList.
plus()* pionList.
minus();
558 epList=rhoList* photonList;
559 decaylist= pionList.
plus()* epList;
561 else if(channel==
"DptoPiPi0EPPiPiEta"){
563 numchan.push_back(2);
564 numchan.push_back(3);
565 numchan.push_back(6);
567 epList=pionList.
plus()* pionList.
minus()* etaList;
568 decaylist= pionList.
plus()* pi0List* epList;
570 else if(channel==
"DptoPiPi0EPRhoGam"){
572 numchan.push_back(2);
573 numchan.push_back(3);
574 numchan.push_back(7);
576 rhoList=pionList.
plus()* pionList.
minus();
578 epList=rhoList* photonList;
579 decaylist= pionList.
plus()* pi0List* epList;
581 else if(channel==
"DptoKsKsPiPi0") {
583 numchan.push_back(5);
584 numchan.push_back(5);
585 numchan.push_back(2);
586 numchan.push_back(3);
587 decaylist=ksList* ksList* pionList.
plus()* pi0List;
589 else if(channel==
"DptoKsKPi0Pi0") {
591 numchan.push_back(5);
592 numchan.push_back(1);
593 numchan.push_back(3);
594 numchan.push_back(3);
595 decaylist=ksList* kaonList.
plus()* pi0List* pi0List;
597 else if(channel==
"DptoKsKEta") {
599 numchan.push_back(5);
600 numchan.push_back(1);
601 numchan.push_back(4);
602 decaylist=ksList* kaonList.
plus()* etaList;
604 else if(channel==
"DptoKKPiPiPi") {
606 numchan.push_back(1);
607 numchan.push_back(1);
608 numchan.push_back(2);
609 numchan.push_back(2);
610 numchan.push_back(2);
613 else if(channel==
"DptoKpPiPi") {
615 numchan.push_back(1);
616 numchan.push_back(2);
617 numchan.push_back(2);
618 decaylist=kaonList.
plus()* pionList.
plus()* pionList.
minus();
620 else if(channel==
"DptoKpPi0Pi0") {
622 numchan.push_back(1);
623 numchan.push_back(3);
624 numchan.push_back(3);
625 decaylist=kaonList.
plus()* pi0List* pi0List;
627 else if(channel==
"DptoKpPi0Eta") {
629 numchan.push_back(1);
630 numchan.push_back(3);
631 numchan.push_back(4);
632 decaylist=kaonList.
plus()* pi0List* etaList;
634 else if(channel==
"DptoKpPiPiPi0") {
636 numchan.push_back(1);
637 numchan.push_back(2);
638 numchan.push_back(2);
639 numchan.push_back(3);
640 decaylist=kaonList.
plus()* pionList.
plus()* pionList.
minus()* pi0List;
642 else if(channel==
"DptoKpPiPiEta") {
644 numchan.push_back(1);
645 numchan.push_back(2);
646 numchan.push_back(2);
647 numchan.push_back(4);
648 decaylist=kaonList.
plus()* pionList.
plus()* pionList.
minus()* etaList;
660 vector<int> trackid, showerid;
661 vector<int> kaonid, pionid;
662 int numofchildren=numchan.size()-1;
664 for(
int i=0; i< numofchildren;i++){
666 const CDCandidate& daughter=(*it).particle().child(i);
670 trackid.push_back(track->
trackId());
671 kaonid.push_back(track->
trackId());
673 else if(numchan[i+1]==2){
675 trackid.push_back(track->
trackId());
676 pionid.push_back(track->
trackId());
678 else if ( numchan[i+1]==3){
681 showerid.push_back(hiEnGamma->
trackId());
682 showerid.push_back(loEnGamma->
trackId());
684 else if ( numchan[i+1]==4){
687 showerid.push_back(hiEnGamma->
trackId());
688 showerid.push_back(loEnGamma->
trackId());
690 else if ( numchan[i+1]==5){
693 recDTag->
addToFitInfo(aKsCand->
mass(),fitinfo[aKsCand][0],fitinfo[aKsCand][1],fitinfo[aKsCand][2]);
697 trackid.push_back(pion1Trk->
trackId());
698 trackid.push_back(pion2Trk->
trackId());
700 else if (numchan[i+1]==6){
709 trackid.push_back(apiontrk->
trackId());
710 trackid.push_back(spiontrk->
trackId());
711 showerid.push_back(hiEnGamma->
trackId());
712 showerid.push_back(loEnGamma->
trackId());
715 else if (numchan[i+1]==7){
727 trackid.push_back(apiontrk->
trackId());
728 trackid.push_back(spiontrk->
trackId());
729 showerid.push_back(gammatrk->
trackId());
741 savetrack(trackid,showerid,charged_begin,charged_end,neutral_begin,neutral_end,recDTag);
742 pidtag(kaonid,pionid,kaonList_tight, pionList_tight,recDTag);
745 if(m_debug) cout<<
"beforevfit:"<<endl;
747 HepLorentzVector p4change_vfit;
750 p4change_vfit=util.
vfitref(channel, kaonid, pionid, xorigin, charged_begin);
752 p4change_vfit=util.
vfit(channel, kaonid, pionid, xorigin, charged_begin);
755 recDTag->
setp4(recDTag->
p4()+p4change_vfit);
766 recDTagCol->push_back(recDTag);
774 return StatusCode::SUCCESS;
944 HepLorentzVector p4Dp((*it).particle().momentum(), (*it).particle().energy());
945 HepLorentzVector p4Dp_New;
947 for(
int i = 0; i < numofchildren; i++){
948 const CDCandidate& daughter=(*it).particle().child(i);
952 HepVector veewks = aKsCand->
w();
953 HepLorentzVector p4KsCand;
954 p4KsCand.setX(veewks[0]);
955 p4KsCand.setY(veewks[1]);
956 p4KsCand.setZ(veewks[2]);
957 p4KsCand.setE(veewks[3]);
958 HepLorentzVector p4wks = p4KsCand;
963 vector<double> vp4ks_new = util.
UpdatedKsIfo(aKsCand,vtxsvc,m_useVFrefine);
964 HepLorentzVector p4wks_new;
965 p4wks_new.setX(vp4ks_new[0]);
966 p4wks_new.setY(vp4ks_new[1]);
967 p4wks_new.setZ(vp4ks_new[2]);
968 p4wks_new.setE(vp4ks_new[3]);
970 p4Dp = p4Dp - p4wks + p4wks_new;
978 double mass = p4Dp_New.m();
979 int charge = (*it).particle().charge();
980 recDTag->
setp4(p4Dp_New);
981 p4Dp_New.boost(-m_beta);
982 double mbc2_CMS =
ebeam*
ebeam - p4Dp_New.v().mag2();
983 double mbc_CMS = mbc2_CMS > 0 ? sqrt( mbc2_CMS ) : -10;
984 double deltaE_CMS = p4Dp_New.t() -
ebeam;
986 int tag=(*it).particle().userTag();