102 MsgStream log(
msgSvc(), name());
103 log << MSG::INFO <<
"in execute()" << endreq;
110 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
111 int event= eventHeader->eventNumber();
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;
131 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(),
"/Event/EvtRec/EvtRecPi0Col");
133 log << MSG::FATAL <<
"Could not find EvtRecPi0Col" << endreq;
134 return StatusCode::FAILURE;
138 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol(eventSvc(),
"/Event/EvtRec/EvtRecEtaToGGCol");
139 if ( ! recEtaToGGCol ) {
140 log << MSG::FATAL <<
"Could not find EvtRecEtaToGGCol" << endreq;
141 return StatusCode::FAILURE;
145 SmartDataPtr<EvtRecVeeVertexCol> recVeeVertexCol(eventSvc(),
"/Event/EvtRec/EvtRecVeeVertexCol");
146 if ( ! recVeeVertexCol ) {
147 log << MSG::FATAL <<
"Could not find EvtRecVeeVertexCol" << endreq;
148 return StatusCode::FAILURE;
154 log << MSG::FATAL <<
"EvtRecDTagCol is not registered yet" << endreq;
155 return StatusCode::FAILURE;
161 Hep3Vector xorigin(0,0,0);
164 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
169 xorigin.setX(vertex[0]);
170 xorigin.setY(vertex[1]);
171 xorigin.setZ(vertex[2]);
198 dc_fill(ksList, recVeeVertexCol->begin(), recVeeVertexCol->end());
201 dc_fill(pi0List, recPi0Col->begin(), recPi0Col->end());
204 dc_fill(etaList, recEtaToGGCol->begin(), recEtaToGGCol->end());
214 int run = eventHeader->runNumber();
215 m_ievt = eventHeader->eventNumber();
216 m_nChrg = recEvent->totalCharged();
217 m_nNeu = recEvent->totalNeutral();
218 m_nPion = pionList.
size();
219 m_nKaon = kaonList.
size();
220 m_nPi0 = pi0List.size();
221 m_nKs = ksList.size();
229 if(m_ReadBeamEFromDB && m_irun!=run){
233 m_beamE=m_readDb.
getbeamE(m_irun,m_beamE);
238 double ebeam=m_beamE;
246 for(
int list=0;list<chanlist.size();list++){
248 string channel=chanlist[list];
258 if(channel==
"DptoKPiPi") {
260 numchan.push_back(1);
261 numchan.push_back(2);
262 numchan.push_back(2);
263 decaylist=kaonList.
minus()* pionList.
plus()* pionList.
plus();
265 else if(channel==
"DptoKPiPiPi0") {
267 numchan.push_back(1);
268 numchan.push_back(2);
269 numchan.push_back(2);
270 numchan.push_back(3);
271 decaylist=kaonList.
minus()* pionList.
plus()* pionList.
plus()* pi0List;
273 else if(channel==
"DptoKsPi") {
275 numchan.push_back(5);
276 numchan.push_back(2);
277 decaylist=ksList* pionList.
plus();
279 else if(channel==
"DptoKsPiPi0") {
281 numchan.push_back(5);
282 numchan.push_back(2);
283 numchan.push_back(3);
284 decaylist=ksList* pionList.
plus()* pi0List;
286 else if(channel==
"DptoKsPiPiPi") {
288 numchan.push_back(5);
289 numchan.push_back(2);
290 numchan.push_back(2);
291 numchan.push_back(2);
292 decaylist=ksList* pionList.
plus()* pionList.
plus()* pionList.
minus();
294 else if(channel==
"DptoKKPi") {
296 numchan.push_back(1);
297 numchan.push_back(1);
298 numchan.push_back(2);
299 decaylist=kaonList.
minus()* kaonList.
plus()* pionList.
plus();
301 else if(channel==
"DptoPiPi0") {
303 numchan.push_back(2);
304 numchan.push_back(3);
305 decaylist=pionList.
plus()* pi0List;
307 else if(channel==
"DptoKPi0") {
309 numchan.push_back(1);
310 numchan.push_back(3);
311 decaylist=kaonList.
plus()* pi0List;
313 else if(channel==
"DptoKsK") {
315 numchan.push_back(5);
316 numchan.push_back(1);
317 decaylist=ksList* kaonList.
plus();
319 else if(channel==
"DptoPiPiPi") {
321 numchan.push_back(2);
322 numchan.push_back(2);
323 numchan.push_back(2);
324 decaylist=pionList.
plus()* pionList.
plus()* pionList.
minus() ;
326 else if(channel==
"DptoPiPi0Pi0") {
328 numchan.push_back(2);
329 numchan.push_back(3);
330 numchan.push_back(3);
331 decaylist=pionList.
plus()* pi0List* pi0List;
333 else if(channel==
"DptoKsKsPi") {
335 numchan.push_back(5);
336 numchan.push_back(5);
337 numchan.push_back(2);
338 decaylist=ksList* ksList* pionList.
plus();
340 else if(channel==
"DptoKsKPi0") {
342 numchan.push_back(5);
343 numchan.push_back(1);
344 numchan.push_back(3);
345 decaylist=ksList* kaonList.
plus()* pi0List;
347 else if(channel==
"DptoKsKsK") {
349 numchan.push_back(5);
350 numchan.push_back(5);
351 numchan.push_back(1);
352 decaylist=ksList* ksList* kaonList.
plus();
354 else if(channel==
"DptoPiPiPiPi0") {
356 numchan.push_back(2);
357 numchan.push_back(2);
358 numchan.push_back(2);
359 numchan.push_back(3);
360 decaylist=pionList.
plus()* pionList.
plus()* pionList.
minus()* pi0List;
362 else if(channel==
"DptoKsPiPi0Pi0") {
364 numchan.push_back(5);
365 numchan.push_back(2);
366 numchan.push_back(3);
367 numchan.push_back(3);
368 decaylist=ksList* pionList.
plus()* pi0List* pi0List;
370 else if(channel==
"DptoKsKplusPiPi") {
372 numchan.push_back(5);
373 numchan.push_back(1);
374 numchan.push_back(2);
375 numchan.push_back(2);
376 decaylist=ksList* kaonList.
plus()* pionList.
plus()* pionList.
minus();
378 else if(channel==
"DptoKsKminusPiPi") {
380 numchan.push_back(5);
381 numchan.push_back(1);
382 numchan.push_back(2);
383 numchan.push_back(2);
384 decaylist=ksList* kaonList.
minus()* pionList.
plus()* pionList.
plus();
386 else if(channel==
"DptoKKPiPi0") {
388 numchan.push_back(1);
389 numchan.push_back(1);
390 numchan.push_back(2);
391 numchan.push_back(3);
392 decaylist=kaonList.
minus()* kaonList.
plus()* pionList.
plus()* pi0List;
394 else if(channel==
"DptoPiPiPiPiPi") {
396 numchan.push_back(2);
397 numchan.push_back(2);
398 numchan.push_back(2);
399 numchan.push_back(2);
400 numchan.push_back(2);
403 else if(channel==
"DptoKPiPiPiPi") {
405 numchan.push_back(1);
406 numchan.push_back(2);
407 numchan.push_back(2);
408 numchan.push_back(2);
409 numchan.push_back(2);
412 else if(channel==
"DptoPiEta") {
414 numchan.push_back(2);
415 numchan.push_back(4);
416 decaylist=pionList.
plus()* etaList;
418 else if(channel==
"DptoKsPiEta") {
420 numchan.push_back(5);
421 numchan.push_back(2);
422 numchan.push_back(4);
423 decaylist=ksList* pionList.
plus()* etaList;
434 vector<int> trackid, showerid;
435 vector<int> kaonid, pionid;
436 int numofchildren=numchan.size()-1;
438 for(
int i=0; i< numofchildren;i++){
440 const CDCandidate& daughter=(*it).particle().child(i);
444 trackid.push_back(track->
trackId());
445 kaonid.push_back(track->
trackId());
447 else if(numchan[i+1]==2){
449 trackid.push_back(track->
trackId());
450 pionid.push_back(track->
trackId());
452 else if ( numchan[i+1]==3){
455 showerid.push_back(hiEnGamma->
trackId());
456 showerid.push_back(loEnGamma->
trackId());
458 else if ( numchan[i+1]==4){
461 showerid.push_back(hiEnGamma->
trackId());
462 showerid.push_back(loEnGamma->
trackId());
464 else if ( numchan[i+1]==5){
468 trackid.push_back(pion1Trk->
trackId());
469 trackid.push_back(pion2Trk->
trackId());
475 saveDpInfo(it, ebeam, numofchildren, recDTag);
476 savetrack(trackid,showerid,charged_begin,charged_end,neutral_begin,neutral_end,recDTag);
477 pidtag(kaonid,pionid,kaonList_tight, pionList_tight,recDTag);
480 HepLorentzVector p4change_vfit=util.
vfit(channel, kaonid, pionid, xorigin, charged_begin);
481 recDTag->
setp4(recDTag->
p4()+p4change_vfit);
492 recDTagCol->push_back(recDTag);
502 return StatusCode::SUCCESS;
535 vector<EvtRecTrackIterator> trktemp;
536 vector<EvtRecTrackIterator> shrtemp;
541 bool isothertrack=
true;
542 for(
int i=0; i<trackid.size(); i++){
543 if( (*trk)->trackId()==trackid[i] ){
544 trktemp.push_back(trk);
552 for(
int i=0; i<trackid.size();i++){
553 for(
int j=0; j<trktemp.size(); j++){
555 if( (*trk)->trackId()==trackid[i])
563 bool isothershower=
true;
564 for(
int i=0; i<showerid.size(); i++){
565 if( (*shr)->trackId()==showerid[i] ){
566 shrtemp.push_back(shr);
575 for(
int i=0; i<showerid.size();i++){
576 for(
int j=0; j<shrtemp.size(); j++){
578 if( (*shr)->trackId()==showerid[i])