99 {
100 MsgStream log(
msgSvc(), name());
101 log << MSG::INFO << "in execute()" << endreq;
102
103 StatusCode sc;
104
105
106
107
108 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
109 int event= eventHeader->eventNumber();
110
111
112
115 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
116 << " " << eventHeader->eventNumber() << endreq;
117 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
118 << recEvent->totalCharged() << " , "
119 << recEvent->totalNeutral() << " , "
120 << recEvent->totalTracks() <<endreq;
121
124
127
128
129 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(), "/Event/EvtRec/EvtRecPi0Col");
130 if ( ! recPi0Col ) {
131 log << MSG::FATAL << "Could not find EvtRecPi0Col" << endreq;
132 return StatusCode::FAILURE;
133 }
134
135 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol(eventSvc(), "/Event/EvtRec/EvtRecEtaToGGCol");
136 if ( ! recEtaToGGCol ) {
137 log << MSG::FATAL << "Could not find EvtRecEtaToGGCol" << endreq;
138 return StatusCode::FAILURE;
139 }
140
141
142 SmartDataPtr<EvtRecVeeVertexCol> recVeeVertexCol(eventSvc(), "/Event/EvtRec/EvtRecVeeVertexCol");
143 if ( ! recVeeVertexCol ) {
144 log << MSG::FATAL << "Could not find EvtRecVeeVertexCol" << endreq;
145 return StatusCode::FAILURE;
146 }
147
148
150 if (!recDTagCol) {
151 log << MSG::FATAL << "EvtRecDTagCol is not registered yet" << endreq;
152 return StatusCode::FAILURE;
153 }
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
176 dc_fill(ksList, recVeeVertexCol->begin(), recVeeVertexCol->end());
177
179 dc_fill(pi0List, recPi0Col->begin(), recPi0Col->end());
180
182 dc_fill(etaList, recEtaToGGCol->begin(), recEtaToGGCol->end());
183
184
189
190
191 int run = eventHeader->runNumber();
192 m_ievt = eventHeader->eventNumber();
193 m_nChrg = recEvent->totalCharged();
194 m_nNeu = recEvent->totalNeutral();
195 m_nPion = pionList.size();
196 m_nKaon = kaonList.size();
197 m_nPi0 = pi0List.size();
198 m_nKs = ksList.size();
199
200
201
202
203
204
205 if(m_ReadBeamEFromDB && m_irun!=run){
206 m_irun=run;
207 if(m_usecalibBeamE)
209 m_beamE=m_readDb.
getbeamE(m_irun,m_beamE);
210 if(run>0)
212
213 }
214 double ebeam=m_beamE;
215
216
217
218
219
220
221 for(int list=0;list<chanlist.size();list++){
222
223 string channel=chanlist[list];
224 vector<int> numchan;
228
229
230
231
232
233 if(channel=="DstoKsK") {
235 numchan.push_back(5);
236 numchan.push_back(1);
237 decaylist=ksList* kaonList.plus();
238 }
239 else if(channel=="DstoKKPi") {
241 numchan.push_back(1);
242 numchan.push_back(1);
243 numchan.push_back(2);
244 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus();
245 }
246 else if(channel=="DstoKsKPi0") {
248 numchan.push_back(5);
249 numchan.push_back(1);
250 numchan.push_back(3);
251 decaylist=ksList* kaonList.plus()* pi0List;
252 }
253 else if(channel=="DstoKsKsPi") {
255 numchan.push_back(5);
256 numchan.push_back(5);
257 numchan.push_back(2);
258 decaylist=ksList* ksList* pionList.plus();
259 }
260 else if(channel=="DstoKKPiPi0") {
262 numchan.push_back(1);
263 numchan.push_back(1);
264 numchan.push_back(2);
265 numchan.push_back(3);
266 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus()* pi0List;
267 }
268 else if(channel=="DstoKsKplusPiPi") {
270 numchan.push_back(5);
271 numchan.push_back(1);
272 numchan.push_back(2);
273 numchan.push_back(2);
274 decaylist=ksList* kaonList.plus()* pionList.plus()* pionList.minus();
275 }
276 else if(channel=="DstoKsKminusPiPi") {
278 numchan.push_back(5);
279 numchan.push_back(1);
280 numchan.push_back(2);
281 numchan.push_back(2);
282 decaylist=ksList* kaonList.minus()* pionList.plus()* pionList.plus();
283 }
284 else if(channel=="DstoKKPiPiPi") {
286 numchan.push_back(1);
287 numchan.push_back(1);
288 numchan.push_back(2);
289 numchan.push_back(2);
290 numchan.push_back(2);
291 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus()* pionList.plus()* pionList.minus();
292 }
293 else if(channel=="DstoPiPi0") {
295 numchan.push_back(2);
296 numchan.push_back(3);
297 decaylist=pionList.plus()* pi0List;
298 }
299 else if(channel=="DstoPiPiPi") {
301 numchan.push_back(2);
302 numchan.push_back(2);
303 numchan.push_back(2);
304 decaylist=pionList.plus()* pionList.plus()* pionList.minus();
305 }
306 else if(channel=="DstoPiPiPiPi0") {
308 numchan.push_back(2);
309 numchan.push_back(2);
310 numchan.push_back(2);
311 numchan.push_back(3);
312 decaylist=pionList.plus()* pionList.plus()* pionList.minus()* pi0List;
313 }
314 else if(channel=="DstoPiPiPiPiPi") {
316 numchan.push_back(2);
317 numchan.push_back(2);
318 numchan.push_back(2);
319 numchan.push_back(2);
320 numchan.push_back(2);
321 decaylist=pionList.plus()* pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus();
322 }
323 else if(channel=="DstoPiPiPiPiPiPi0") {
325 numchan.push_back(2);
326 numchan.push_back(2);
327 numchan.push_back(2);
328 numchan.push_back(2);
329 numchan.push_back(2);
330 numchan.push_back(3);
331 decaylist=pionList.plus()* pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus()* pi0List;
332 }
333 else if(channel=="DstoPiEta") {
335 numchan.push_back(2);
336 numchan.push_back(4);
337 decaylist=pionList.plus()* etaList;
338 }
339 else if(channel=="DstoPiPi0Eta") {
341 numchan.push_back(2);
342 numchan.push_back(3);
343 numchan.push_back(4);
344 decaylist=pionList.plus()* pi0List* etaList;
345 }
346 else if(channel=="DstoPiPiPiEta") {
348 numchan.push_back(2);
349 numchan.push_back(2);
350 numchan.push_back(2);
351 numchan.push_back(4);
352 decaylist=pionList.plus()* pionList.plus()* pionList.minus()* etaList;
353 }
354 else if(channel=="DstoPiEPPiPiEta") {
356 numchan.push_back(2);
357 numchan.push_back(6);
359 epList=pionList.plus()* pionList.minus()* etaList;
360 decaylist=pionList.plus()* epList;
361 }
362 else if(channel=="DstoPiPi0EPPiPiEta") {
364 numchan.push_back(2);
365 numchan.push_back(3);
366 numchan.push_back(6);
368 epList=pionList.plus()* pionList.minus()* etaList;
369 decaylist=pionList.plus()* pi0List* epList;
370 }
371 else if(channel=="DstoPiEPRhoGam") {
373 numchan.push_back(2);
374 numchan.push_back(7);
376 rhoList=pionList.plus()* pionList.minus();
378 epList=rhoList* photonList;
379 decaylist=pionList.plus()* epList;
380 }
381 else if(channel=="DstoPiPi0EPRhoGam") {
383 numchan.push_back(2);
384 numchan.push_back(3);
385 numchan.push_back(7);
387 rhoList=pionList.plus()* pionList.minus();
389 epList=rhoList* photonList;
390 decaylist=pionList.plus()* pi0List* epList;
391 }
392 else if(channel=="DstoKsPi") {
394 numchan.push_back(5);
395 numchan.push_back(2);
396 decaylist=ksList* pionList.plus();
397 }
398 else if(channel=="DstoKsPiPi0") {
400 numchan.push_back(5);
401 numchan.push_back(2);
402 numchan.push_back(3);
403 decaylist=ksList* pionList.plus()* pi0List;
404 }
405 else if(channel=="DstoKPiPi") {
407 numchan.push_back(1);
408 numchan.push_back(2);
409 numchan.push_back(2);
410 decaylist=kaonList.plus()* pionList.plus()* pionList.minus();
411 }
412 else if(channel=="DstoKPiPiPi0") {
414 numchan.push_back(1);
415 numchan.push_back(2);
416 numchan.push_back(2);
417 numchan.push_back(3);
418 decaylist=kaonList.plus()* pionList.plus()* pionList.minus()* pi0List;
419 }
420 else if(channel=="DstoKKK") {
422 numchan.push_back(1);
423 numchan.push_back(1);
424 numchan.push_back(1);
425 decaylist=kaonList.minus()* kaonList.plus()* kaonList.plus();
426 }
427
430
432
435
436 vector<int> trackid, showerid;
437 vector<int> kaonid, pionid;
438 int numofchildren=numchan.size()-1;
439
440 for(int i=0; i< numofchildren;i++){
441
442 const CDCandidate& daughter=(*it).particle().child(i);
443
444 if(numchan[i+1]==1){
446 trackid.push_back(track->
trackId());
447 kaonid.push_back(track->
trackId());
448 }
449 else if(numchan[i+1]==2){
451 trackid.push_back(track->
trackId());
452 pionid.push_back(track->
trackId());
453 }
454 else if ( numchan[i+1]==3){
457 showerid.push_back(hiEnGamma->
trackId());
458 showerid.push_back(loEnGamma->
trackId());
459 }
460 else if ( numchan[i+1]==4){
463 showerid.push_back(hiEnGamma->
trackId());
464 showerid.push_back(loEnGamma->
trackId());
465 }
466 else if ( numchan[i+1]==5){
470 trackid.push_back(pion1Trk->
trackId());
471 trackid.push_back(pion2Trk->
trackId());
472 }
473 else if (numchan[i+1]==6){
481
482 trackid.push_back(apiontrk->
trackId());
483 trackid.push_back(spiontrk->
trackId());
484 showerid.push_back(hiEnGamma->
trackId());
485 showerid.push_back(loEnGamma->
trackId());
486
487 }
488 else if (numchan[i+1]==7){
493
497
498
499 trackid.push_back(apiontrk->
trackId());
500 trackid.push_back(spiontrk->
trackId());
501 showerid.push_back(gammatrk->
trackId());
502
503 }
504
505
506 }
507
508
509 saveDsInfo(it, ebeam, numofchildren, recDTag);
510 savetrack(trackid,showerid,charged_begin,charged_end,neutral_begin,neutral_end,recDTag);
511 pidtag(kaonid,pionid,kaonList_tight, pionList_tight,recDTag);
512
513 trackid.clear();
514 showerid.clear();
515 kaonid.clear();
516 pionid.clear();
517
518
519
520
521 recDTagCol->push_back(recDTag);
522
523 }
524
525 numchan.clear();
526
527 }
528
529
530
531 return StatusCode::SUCCESS;
532}
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
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 savetrack(vector< int >, vector< int >, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecDTag *)
void pidtag(vector< int >, vector< int >, CDChargedKaonList &, CDChargedPionList &, EvtRecDTag *)
void saveDsInfo(CDDecayList::iterator, double, int, EvtRecDTag *)
void setbeta(Hep3Vector beta)
void setebeam(double ebeam)
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)
bool setcalib(bool calib)
CLHEP::Hep3Vector getbeta()
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecDTagCol
_EXTERN_ std::string EvtRecTrackCol