95 {
96 MsgStream log(
msgSvc(), name());
97 log << MSG::INFO << "in execute()" << endreq;
98
99 StatusCode sc;
100
101
102
103
104 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
105 int event= eventHeader->eventNumber();
106
107
108
111 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
112 << " " << eventHeader->eventNumber() << endreq;
113 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
114 << recEvent->totalCharged() << " , "
115 << recEvent->totalNeutral() << " , "
116 << recEvent->totalTracks() <<endreq;
117
120
123
124
125 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(), "/Event/EvtRec/EvtRecPi0Col");
126 if ( ! recPi0Col ) {
127 log << MSG::FATAL << "Could not find EvtRecPi0Col" << endreq;
128 return StatusCode::FAILURE;
129 }
130
131
132 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol(eventSvc(), "/Event/EvtRec/EvtRecEtaToGGCol");
133 if ( ! recEtaToGGCol ) {
134 log << MSG::FATAL << "Could not find EvtRecEtaToGGCol" << endreq;
135 return StatusCode::FAILURE;
136 }
137
138
139 SmartDataPtr<EvtRecVeeVertexCol> recVeeVertexCol(eventSvc(), "/Event/EvtRec/EvtRecVeeVertexCol");
140 if ( ! recVeeVertexCol ) {
141 log << MSG::FATAL << "Could not find EvtRecVeeVertexCol" << endreq;
142 return StatusCode::FAILURE;
143 }
144
145
147 if (!recDTagCol) {
148 log << MSG::FATAL << "EvtRecDTagCol is not registered yet" << endreq;
149 return StatusCode::FAILURE;
150 }
151
152
153
154
155
156
157
158
159
160
161
162
163
164
169
170
172 dc_fill(ksList, recVeeVertexCol->begin(), recVeeVertexCol->end());
173
175 dc_fill(pi0List, recPi0Col->begin(), recPi0Col->end());
176
178 dc_fill(etaList, recEtaToGGCol->begin(), recEtaToGGCol->end());
179
180
185
186
187
188 int run = eventHeader->runNumber();
189 m_ievt = eventHeader->eventNumber();
190 m_nChrg = recEvent->totalCharged();
191 m_nNeu = recEvent->totalNeutral();
192 m_nPion = pionList.size();
193 m_nKaon = kaonList.size();
194 m_nPi0 = pi0List.size();
195 m_nKs = ksList.size();
196
197
198
199
200
201
202
203 if(m_ReadBeamEFromDB && m_irun!=run){
204 m_irun=run;
205 if(m_usecalibBeamE)
207 m_beamE=m_readDb.
getbeamE(m_irun,m_beamE);
208 if(run>0)
210
211 }
212 double ebeam=m_beamE;
213
214
215
216
217
218
219
220 for(int list=0;list<chanlist.size();list++){
221
222 string channel=chanlist[list];
223 vector<int> numchan;
227
228
229
230
231
232 if(channel=="DptoKPiPi") {
234 numchan.push_back(1);
235 numchan.push_back(2);
236 numchan.push_back(2);
237 decaylist=kaonList.minus()* pionList.plus()* pionList.plus();
238 }
239 else if(channel=="DptoKPiPiPi0") {
241 numchan.push_back(1);
242 numchan.push_back(2);
243 numchan.push_back(2);
244 numchan.push_back(3);
245 decaylist=kaonList.minus()* pionList.plus()* pionList.plus()* pi0List;
246 }
247 else if(channel=="DptoKsPi") {
249 numchan.push_back(5);
250 numchan.push_back(2);
251 decaylist=ksList* pionList.plus();
252 }
253 else if(channel=="DptoKsPiPi0") {
255 numchan.push_back(5);
256 numchan.push_back(2);
257 numchan.push_back(3);
258 decaylist=ksList* pionList.plus()* pi0List;
259 }
260 else if(channel=="DptoKsPiPiPi") {
262 numchan.push_back(5);
263 numchan.push_back(2);
264 numchan.push_back(2);
265 numchan.push_back(2);
266 decaylist=ksList* pionList.plus()* pionList.plus()* pionList.minus();
267 }
268 else if(channel=="DptoKKPi") {
270 numchan.push_back(1);
271 numchan.push_back(1);
272 numchan.push_back(2);
273 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus();
274 }
275 else if(channel=="DptoPiPi0") {
277 numchan.push_back(2);
278 numchan.push_back(3);
279 decaylist=pionList.plus()* pi0List;
280 }
281 else if(channel=="DptoKPi0") {
283 numchan.push_back(1);
284 numchan.push_back(3);
285 decaylist=kaonList.plus()* pi0List;
286 }
287 else if(channel=="DptoKsK") {
289 numchan.push_back(5);
290 numchan.push_back(1);
291 decaylist=ksList* kaonList.plus();
292 }
293 else if(channel=="DptoPiPiPi") {
295 numchan.push_back(2);
296 numchan.push_back(2);
297 numchan.push_back(2);
298 decaylist=pionList.plus()* pionList.plus()* pionList.minus() ;
299 }
300 else if(channel=="DptoPiPi0Pi0") {
302 numchan.push_back(2);
303 numchan.push_back(3);
304 numchan.push_back(3);
305 decaylist=pionList.plus()* pi0List* pi0List;
306 }
307 else if(channel=="DptoKsKsPi") {
309 numchan.push_back(5);
310 numchan.push_back(5);
311 numchan.push_back(2);
312 decaylist=ksList* ksList* pionList.plus();
313 }
314 else if(channel=="DptoKsKPi0") {
316 numchan.push_back(5);
317 numchan.push_back(1);
318 numchan.push_back(3);
319 decaylist=ksList* kaonList.plus()* pi0List;
320 }
321 else if(channel=="DptoKsKsK") {
323 numchan.push_back(5);
324 numchan.push_back(5);
325 numchan.push_back(1);
326 decaylist=ksList* ksList* kaonList.plus();
327 }
328 else if(channel=="DptoPiPiPiPi0") {
330 numchan.push_back(2);
331 numchan.push_back(2);
332 numchan.push_back(2);
333 numchan.push_back(3);
334 decaylist=pionList.plus()* pionList.plus()* pionList.minus()* pi0List;
335 }
336 else if(channel=="DptoKsPiPi0Pi0") {
338 numchan.push_back(5);
339 numchan.push_back(2);
340 numchan.push_back(3);
341 numchan.push_back(3);
342 decaylist=ksList* pionList.plus()* pi0List* pi0List;
343 }
344 else if(channel=="DptoKsKplusPiPi") {
346 numchan.push_back(5);
347 numchan.push_back(1);
348 numchan.push_back(2);
349 numchan.push_back(2);
350 decaylist=ksList* kaonList.plus()* pionList.plus()* pionList.minus();
351 }
352 else if(channel=="DptoKsKminusPiPi") {
354 numchan.push_back(5);
355 numchan.push_back(1);
356 numchan.push_back(2);
357 numchan.push_back(2);
358 decaylist=ksList* kaonList.minus()* pionList.plus()* pionList.plus();
359 }
360 else if(channel=="DptoKKPiPi0") {
362 numchan.push_back(1);
363 numchan.push_back(1);
364 numchan.push_back(2);
365 numchan.push_back(3);
366 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus()* pi0List;
367 }
368 else if(channel=="DptoPiPiPiPiPi") {
370 numchan.push_back(2);
371 numchan.push_back(2);
372 numchan.push_back(2);
373 numchan.push_back(2);
374 numchan.push_back(2);
375 decaylist=pionList.plus()* pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus();
376 }
377 else if(channel=="DptoKPiPiPiPi") {
379 numchan.push_back(1);
380 numchan.push_back(2);
381 numchan.push_back(2);
382 numchan.push_back(2);
383 numchan.push_back(2);
384 decaylist=kaonList.plus()* pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus();
385 }
386 else if(channel=="DptoPiEta") {
388 numchan.push_back(2);
389 numchan.push_back(4);
390 decaylist=pionList.plus()* etaList;
391 }
392 else if(channel=="DptoKsPiEta") {
394 numchan.push_back(5);
395 numchan.push_back(2);
396 numchan.push_back(4);
397 decaylist=ksList* pionList.plus()* etaList;
398 }
399
402
404
407
408 vector<int> trackid, showerid;
409 vector<int> kaonid, pionid;
410 int numofchildren=numchan.size()-1;
411
412 for(int i=0; i< numofchildren;i++){
413
414 const CDCandidate& daughter=(*it).particle().child(i);
415
416 if(numchan[i+1]==1){
418 trackid.push_back(track->
trackId());
419 kaonid.push_back(track->
trackId());
420 }
421 else if(numchan[i+1]==2){
423 trackid.push_back(track->
trackId());
424 pionid.push_back(track->
trackId());
425 }
426 else if ( numchan[i+1]==3){
429 showerid.push_back(hiEnGamma->
trackId());
430 showerid.push_back(loEnGamma->
trackId());
431 }
432 else if ( numchan[i+1]==4){
435 showerid.push_back(hiEnGamma->
trackId());
436 showerid.push_back(loEnGamma->
trackId());
437 }
438 else if ( numchan[i+1]==5){
442 trackid.push_back(pion1Trk->
trackId());
443 trackid.push_back(pion2Trk->
trackId());
444 }
445
446 }
447
448
449 saveDpInfo(it, ebeam, numofchildren, recDTag);
450 savetrack(trackid,showerid,charged_begin,charged_end,neutral_begin,neutral_end,recDTag);
451 pidtag(kaonid,pionid,kaonList_tight, pionList_tight,recDTag);
452
453 trackid.clear();
454 showerid.clear();
455 kaonid.clear();
456 pionid.clear();
457
458
459
460 recDTagCol->push_back(recDTag);
461
462 }
463
464 numchan.clear();
465
466 }
467
468
469
470 return StatusCode::SUCCESS;
471}
ChargedDSelector chargedDSelector
void dc_fill(DCFillableChargedList< Charged > &aFillableList, WitnessIterator first, WitnessIterator last)
EvtRecTrackCol::iterator EvtRecTrackIterator
LocalEtatoGGSelector etatoGGSelector
LocalKaonSelector kaonSelector
LocalKsSelector ksSelector
LocalPi0Selector pi0Selector
LocalPionSelector pionSelector
virtual const EvtRecTrack * track() const
virtual const EvtRecVeeVertex * navKshort() const
virtual const EvtRecPi0 * navPi0() const
virtual const EvtRecEtaToGG * navEta() const
void saveDpInfo(CDDecayList::iterator, double, int, EvtRecDTag *)
void pidtag(vector< int >, vector< int >, CDChargedKaonList &, CDChargedPionList &, EvtRecDTag *)
void savetrack(vector< int >, vector< int >, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, 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