160 {
161
162 int nGoodCharged = 0;
163 int nGoodChargedp = 0;
164 int nGoodChargedm = 0;
165 int nCharged = 0;
166 int nNeutrk = 0;
167 int nTottrk = 0;
168 int totCharged = 0;
169 int npionp = 0;
170 int npionm = 0;
171 int nprotonp = 0;
172 int nprotonm = 0;
173 int nkaonp = 0;
174 int nkaonm = 0;
175 int nlambda = 0;
176 int nalambda= 0;
177 int nks = 0;
178 int ngamma = 0;
179 int neta = 0;
180 int npi0 = 0;
181 int nmuonp = 0;
182 int nmuonm = 0;
183 int nelectronp = 0;
184 int nelectronm = 0;
185
186 Hep3Vector xorigin(0,0,0);
189 xorigin.setX(dbv[0]);
190 xorigin.setY(dbv[1]);
191 xorigin.setZ(dbv[2]);
192 }
193
194 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(), EventModel::EventHeader);
195 if (!eventHeader) {
196 std::cout << "Could not find Event Header" << std::endl;
197 return StatusCode::FAILURE;
198 }
199 int EvtNo = eventHeader->eventNumber();
200 int RunNo = eventHeader->runNumber();
201 if ( iEvt == 0 ) std::cout << "RUN=" << RunNo << std::endl;
204
205 nCharged = evtRecEvent->totalCharged();
206 nNeutrk = evtRecEvent->totalNeutral();
207 nTottrk = evtRecEvent->totalTracks();
208
209
210 vector<int> iGood;
211 iGood.clear();
212 for ( Int_t iCharge = 0; iCharge < evtRecEvent->totalCharged(); ++iCharge ) {
214 if(!(*itTrk)->isMdcTrackValid()) continue;
216 double theta = mdcTrk->
theta();
217 HepVector a = mdcTrk->
helix();
218 HepSymMatrix Ea = mdcTrk->
err();
220 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
222 helixip.pivot(IP);
223 HepVector vecipa = helixip.a();
224 double Rvxy0=fabs(vecipa[0]);
225 double Rvz0=vecipa[3];
226 double Rvphi0=vecipa[1];
227 if(fabs(Rvxy0) >= 1.0) continue;
228 if(fabs(Rvz0) >= 10.0) continue;
229 if(fabs(
cos(theta))>=0.93)
continue;
230 if(mdcTrk->
charge() > 0) nGoodChargedp++;
231 if(mdcTrk->
charge() < 0) nGoodChargedm++;
232 ++nGoodCharged;
233 totCharged +=mdcTrk->
charge();
234 iGood.push_back(iCharge);
235 }
236
237
238
239 for(int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
241 if((*iTrk)->isEmcShowerValid()){
243 if ( (emcShower->
energy()>0.025) && (emcShower->
time()>0) && (emcShower->
time()<14) && ( ( (abs(
cos(emcShower->
theta()))<0.80) && (emcShower->
energy()>0.025) ) || ( (abs(
cos(emcShower->
theta()))<0.92) && (abs(
cos(emcShower->
theta()))>0.86) && (emcShower->
energy()>0.050) ) ) ){
244 ngamma++;
245 }
246 }
247 }
248
249
250 for (int i=0;i<iGood.size();i++){
253
254
263
265 if (mdcKalTrack->
charge() > 0) npionp++;
266 if (mdcKalTrack->
charge() < 0) npionm++;
267 }
268
270 if (mdcKalTrack->
charge() > 0) nkaonp++;
271 if (mdcKalTrack->
charge() < 0) nkaonm++;
272 }
273
275 if (mdcKalTrack->
charge() > 0) nprotonp++;
276 if (mdcKalTrack->
charge() < 0) nprotonm++;
277 }
278
280 if (mdcKalTrack->
charge() > 0) nelectronp++;
281 if (mdcKalTrack->
charge() < 0) nelectronm++;
282 }
283
285 if (mdcKalTrack->
charge() > 0) nmuonp++;
286 if (mdcKalTrack->
charge() < 0) nmuonm++;
287 }
288 }
289
290
292 for (EvtRecEtaToGGCol::iterator iEta = evtRecEtaToGGCol->begin(); iEta != evtRecEtaToGGCol->end(); iEta++){
293 if ((((*iEta)->chisq() < 2500) && ((*iEta)->unconMass() > 0.40) && ((*iEta)->unconMass() < 0.70))){
296 if ( (loShower->
energy() > 0.025) && (loShower->
time() > 0) && (loShower->
time() < 14) && ( ( (abs(
cos(loShower->
theta())) < 0.80) && (loShower->
energy() > 0.025) ) || ( (abs(
cos(loShower->
theta())) < 0.92) && (abs(
cos(loShower->
theta())) > 0.86) && (loShower->
energy() > 0.050) ) ) ){
299 if ( (hiShower->
energy() > 0.025) && (hiShower->
time() > 0) && (hiShower->
time() < 14) && ( ( (abs(
cos(hiShower->
theta())) < 0.80) && (hiShower->
energy() > 0.025) ) || ( (abs(
cos(hiShower->
theta())) < 0.92) && (abs(
cos(hiShower->
theta())) > 0.86) && (hiShower->
energy() > 0.050) ) ) ){
300 neta++;
301 }
302 }
303 }
304 }
305
306
308 for (EvtRecPi0Col::iterator iPi0 = evtRecPi0Col->begin(); iPi0 != evtRecPi0Col->end(); iPi0++){
309 if ((((*iPi0)->chisq() < 2500) && ((*iPi0)->unconMass() > 0.107) && ((*iPi0)->unconMass() < 0.163))){
312 if ( (loShower->
energy() > 0.025) && (loShower->
time() > 0) && (loShower->
time() < 14) && ( (( abs(
cos(loShower->
theta())) < 0.80) && (loShower->
energy() > 0.025) ) || ( (abs(
cos(loShower->
theta())) < 0.92) && (abs(
cos(loShower->
theta())) > 0.86) && (loShower->
energy() > 0.050) ) ) ){
315 if ( (hiShower->
energy() > 0.025) && (hiShower->
time() > 0) && (hiShower->
time() < 14) && ( ( (abs(
cos(hiShower->
theta())) < 0.80) && (hiShower->
energy() > 0.025) ) || ( (abs(
cos(hiShower->
theta())) < 0.92) && (abs(
cos(hiShower->
theta())) > 0.86) && (hiShower->
energy() > 0.050) ) ) ){
316 npi0++;
317 }
318 }
319 }
320 }
321
322
323
324
326 for (EvtRecVeeVertexCol::iterator iKs = evtRecVeeVertexCol->begin(); iKs != evtRecVeeVertexCol->end(); iKs++){
327 if ((*iKs)->vertexId() == 310){
328 if ( ((*iKs)->mass() > 0.471) && ((*iKs)->mass() < 0.524) && ((*iKs)->chi2() < 100) ){
329 nks++;
330 }
331 }
332 }
333
334 for (EvtRecVeeVertexCol::iterator iL = evtRecVeeVertexCol->begin(); iL != evtRecVeeVertexCol->end(); iL++){
335 if ((*iL)->vertexId() == 3122){
336 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
337 nlambda++;
338 }
339 }
340 if ((*iL)->vertexId() == -3122){
341 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
342 nalambda++;
343 }
344 }
345 }
346
347 unsigned int tagdata1 = nGoodCharged;
348 unsigned int tagdata2 =
IntToTag1(nNeutrk, nTottrk, ngamma, npi0);
349 unsigned int tagdata3 =
IntToTag2(npionp, npionm, nkaonp, nkaonm, nprotonp, nprotonm);
350 unsigned int tagdata4 =
IntToTag2(nlambda, nalambda, nelectronp, nelectronm, nmuonp, nmuonm);
351 unsigned int tagdata5 =
IntToTag2(nks, neta, nCharged, nGoodChargedp, nGoodChargedm, totCharged);
352
358
360
361 std::set<UInt_t> Dsmode0, Dsmode1, D0mode0, D0mode1, Dmode0, Dmode1;
362 Dsmode0.clear(); Dsmode1.clear(); D0mode0.clear(); D0mode1.clear(), Dmode0.clear(); Dmode1.clear();
363 if ( evtRecDTagCol ) {
364 EvtRecDTagCol::iterator iter_begin = evtRecDTagCol->begin();
365 EvtRecDTagCol::iterator iter_end = evtRecDTagCol->end();
366
367 for (EvtRecDTagCol::iterator
iter = iter_begin;
iter != iter_end;
iter++) {
368 Int_t type = (*iter)->type();
369 Int_t mode = (*iter)->decayMode();
370
371 if ( mode>=400 && mode<505 ) {
372 if (type==1) {
373 Dsmode1.insert(mode);
374 } else {
375 Dsmode0.insert(mode);
376 }
377 }
378 else if ( mode>=0 && mode<200 ) {
379 if (type==1) {
380 D0mode1.insert(mode);
381 } else {
382 D0mode0.insert(mode);
383 }
384 }
385 else if ( mode>=200 && mode<400 ) {
386 if (type==1) {
387 Dmode1.insert(mode);
388 } else {
389 Dmode0.insert(mode);
390 }
391 }
392 }
393
394 }
395
396 UInt_t Ds_modemap = 0, D0_modemap = 0, D_modemap = 0, QC_status = 0;
397 int data0=3;
398
399 if (m_QC) QC_status = eventHeader->eventTag();
400 else QC_status = 1;
401
402 std::set<UInt_t>::iterator it1, it0;
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423 if ( D0mode1.size()>0 || Dmode1.size()>0 || D0mode0.size()>0 || Dmode0.size()>0 ) {
424 std::cout << EvtNo;
425 if (m_QC) std::cout << " QC= " << QC_status;
426 } else {
427 if ( Dsmode1.size()>0 ) {
428 if (m_QC) std::cout << EvtNo << " QC= " << QC_status << " Ds_1";
429 else std::cout << EvtNo << " Ds_1";
430 Ds_modemap |= (1<<31);
431 for (it1=Dsmode1.begin(); it1!=Dsmode1.end(); ++it1) {
432 std::cout << ' ' << *it1;
433 Ds_modemap |= (1<<Ds_modeTag[*it1]);
434 }
435 std::cout << " ("<<nCharged<<">"<<nGoodCharged<<","<<nNeutrk<<">"<<ngamma<<"):2"<<std::endl;
436 } else {
437 if ( Dsmode0.size()>0 ) {
438 if (m_QC) std::cout << EvtNo << " QC= " << QC_status << " Ds_0";
439 else std::cout << EvtNo << " Ds_0";
440 for (it0=Dsmode0.begin(); it0!=Dsmode0.end(); ++it0) {
441 std::cout << ' ' << *it0;
442 Ds_modemap |= (1<<Ds_modeTag[*it0]);
443 }
444 std::cout << " ("<<nCharged<<">"<<nGoodCharged<<","<<nNeutrk<<">"<<ngamma<<"):2"<<std::endl;
445 }
446 }
447 }
448
449 if ( D0mode1.size()>0 ) {
450 std::cout << " D0_1";
451 D0_modemap |= (1<<31);
452 for (it1=D0mode1.begin(); it1!=D0mode1.end(); ++it1) {
453 std::cout << ' ' << *it1;
454 D0_modemap |= (1<<D0_modeTag[*it1]);
455 }
456 } else {
457 if ( D0mode0.size()>0 ) {
458 std::cout << " D0_0";
459 for (it0=D0mode0.begin(); it0!=D0mode0.end(); ++it0) {
460 std::cout << ' ' << *it0;
461 D0_modemap |= (1<<D0_modeTag[*it0]);
462 }
463 }
464 }
465
466 if ( Dmode1.size()>0 ) {
467 std::cout << " D+_1";
468 D_modemap |= (1<<31);
469 for (it1=Dmode1.begin(); it1!=Dmode1.end(); ++it1) {
470 std::cout << ' ' << *it1;
471 D_modemap |= (1<<D_modeTag[*it1]);
472 }
473 } else {
474 if ( Dmode0.size()>0 ) {
475 std::cout << " D+_0";
476 for (it0=Dmode0.begin(); it0!=Dmode0.end(); ++it0) {
477 std::cout << ' ' << *it0;
478 D_modemap |= (1<<D_modeTag[*it0]);
479 }
480 }
481 }
482
483 if ( D0mode1.size()>0 || Dmode1.size()>0 ) {
484 data0 = 0;
485 std::cout << " ("<<nCharged<<">"<<nGoodCharged<<","<<nNeutrk<<">"<<ngamma<<")"<<":0" << endl;
486 } else if ( D0mode0.size()>0 || Dmode0.size()>0 ) {
487 data0 = 1;
488 std::cout << " ("<<nCharged<<">"<<nGoodCharged<<","<<nNeutrk<<">"<<ngamma<<")"<<":1" << endl;
489 } else if ( Dsmode1.size()>0 || Dsmode0.size()>0 ) {
490 data0 = 2;
491 }
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
529
530
531
532
533
534
535 iEvt++;
536}
double cos(const BesAngle a)
EvtRecTrackCol::iterator EvtRecTrackIterator
const double theta() const
const HepSymMatrix err() const
const HepVector helix() const
......
RecEmcShower * emcShower()
virtual bool isVertexValid()=0
virtual double * PrimaryVertex()=0
int methodProbability() const
void setRecTrack(EvtRecTrack *trk)
void setMethod(const int method)
void identify(const int pidcase)
double probElectron() const
void usePidSys(const int pidsys)
static ParticleID * instance()
bool IsPidInfoValid() const
double probProton() const
void setTagData8(unsigned int t)
void setTagData0(unsigned int t)
void setTagData3(unsigned int t)
void setTagData9(unsigned int t)
void setTagData6(unsigned int t)
void setTagData5(unsigned int t)
void setTagData4(unsigned int t)
void setTagData1(unsigned int t)
void setTagData2(unsigned int t)
void setTagData7(unsigned int t)
_EXTERN_ std::string EvtRecPi0Col
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecVeeVertexCol
_EXTERN_ std::string EvtRecEtaToGGCol
_EXTERN_ std::string EvtRecDTagCol
_EXTERN_ std::string EvtRecTrackCol