199 {
200
201 int nGoodCharged = 0;
202 int nGoodChargedp = 0;
203 int nGoodChargedm = 0;
204 int nCharged = 0;
205 int nNeutrk = 0;
206 int nTottrk = 0;
207 int totCharged = 0;
208 int npionp = 0;
209 int npionm = 0;
210 int nprotonp = 0;
211 int nprotonm = 0;
212 int nkaonp = 0;
213 int nkaonm = 0;
214 int nlambda = 0;
215 int nalambda= 0;
216 int nks = 0;
217 int ngamma = 0;
218 int neta = 0;
219 int npi0 = 0;
220 int nmuonp = 0;
221 int nmuonm = 0;
222 int nelectronp = 0;
223 int nelectronm = 0;
224
225 Hep3Vector xorigin(0,0,0);
228 xorigin.setX(dbv[0]);
229 xorigin.setY(dbv[1]);
230 xorigin.setZ(dbv[2]);
231 }
232
233 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(), EventModel::EventHeader);
234 if (!eventHeader) {
235 std::cout << "Could not find Event Header" << std::endl;
236 return StatusCode::FAILURE;
237 }
238 int EvtNo = eventHeader->eventNumber();
239 int RunNo = eventHeader->runNumber();
240 if ( iEvt == 0 ) std::cout << "RUN=" << RunNo << std::endl;
243
244 nCharged = evtRecEvent->totalCharged();
245 nNeutrk = evtRecEvent->totalNeutral();
246 nTottrk = evtRecEvent->totalTracks();
247
248
249 vector<int> iGood;
250 iGood.clear();
251 for ( Int_t iCharge = 0; iCharge < evtRecEvent->totalCharged(); ++iCharge ) {
253 if(!(*itTrk)->isMdcTrackValid()) continue;
255 double theta = mdcTrk->
theta();
256 HepVector a = mdcTrk->
helix();
257 HepSymMatrix Ea = mdcTrk->
err();
259 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
261 helixip.pivot(IP);
262 HepVector vecipa = helixip.a();
263 double Rvxy0=fabs(vecipa[0]);
264 double Rvz0=vecipa[3];
265 double Rvphi0=vecipa[1];
266 if(fabs(Rvxy0) >= 1.0) continue;
267 if(fabs(Rvz0) >= 10.0) continue;
268 if(fabs(
cos(theta))>=0.93)
continue;
269 if(mdcTrk->
charge() > 0) nGoodChargedp++;
270 if(mdcTrk->
charge() < 0) nGoodChargedm++;
271 ++nGoodCharged;
272 totCharged +=mdcTrk->
charge();
273 iGood.push_back(iCharge);
274 }
275
276
277
278 for(int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
280 if((*iTrk)->isEmcShowerValid()){
282 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) ) ) ){
283 ngamma++;
284 }
285 }
286 }
287
288
289 for (int i=0;i<iGood.size();i++){
292
293
302
304 if (mdcKalTrack->
charge() > 0) npionp++;
305 if (mdcKalTrack->
charge() < 0) npionm++;
306 }
307
309 if (mdcKalTrack->
charge() > 0) nkaonp++;
310 if (mdcKalTrack->
charge() < 0) nkaonm++;
311 }
312
314 if (mdcKalTrack->
charge() > 0) nprotonp++;
315 if (mdcKalTrack->
charge() < 0) nprotonm++;
316 }
317
319 if (mdcKalTrack->
charge() > 0) nelectronp++;
320 if (mdcKalTrack->
charge() < 0) nelectronm++;
321 }
322
324 if (mdcKalTrack->
charge() > 0) nmuonp++;
325 if (mdcKalTrack->
charge() < 0) nmuonm++;
326 }
327 }
328
329
331 for (EvtRecEtaToGGCol::iterator iEta = evtRecEtaToGGCol->begin(); iEta != evtRecEtaToGGCol->end(); iEta++){
332 if ((((*iEta)->chisq() < 2500) && ((*iEta)->unconMass() > 0.40) && ((*iEta)->unconMass() < 0.70))){
335 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) ) ) ){
338 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) ) ) ){
339 neta++;
340 }
341 }
342 }
343 }
344
345
347 for (EvtRecPi0Col::iterator iPi0 = evtRecPi0Col->begin(); iPi0 != evtRecPi0Col->end(); iPi0++){
348 if ((((*iPi0)->chisq() < 2500) && ((*iPi0)->unconMass() > 0.107) && ((*iPi0)->unconMass() < 0.163))){
351 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) ) ) ){
354 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) ) ) ){
355 npi0++;
356 }
357 }
358 }
359 }
360
361
362
363
365 for (EvtRecVeeVertexCol::iterator iKs = evtRecVeeVertexCol->begin(); iKs != evtRecVeeVertexCol->end(); iKs++){
366 if ((*iKs)->vertexId() == 310){
367 if ( ((*iKs)->mass() > 0.471) && ((*iKs)->mass() < 0.524) && ((*iKs)->chi2() < 100) ){
368 nks++;
369 }
370 }
371 }
372
373 for (EvtRecVeeVertexCol::iterator iL = evtRecVeeVertexCol->begin(); iL != evtRecVeeVertexCol->end(); iL++){
374 if ((*iL)->vertexId() == 3122){
375 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
376 nlambda++;
377 }
378 }
379 if ((*iL)->vertexId() == -3122){
380 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
381 nalambda++;
382 }
383 }
384 }
385
386 unsigned int tagdata1 = nGoodCharged;
387 unsigned int tagdata2 =
IntToTag1(nNeutrk, nTottrk, ngamma, npi0);
388 unsigned int tagdata3 =
IntToTag2(npionp, npionm, nkaonp, nkaonm, nprotonp, nprotonm);
389 unsigned int tagdata4 =
IntToTag2(nlambda, nalambda, nelectronp, nelectronm, nmuonp, nmuonm);
390 unsigned int tagdata5 =
IntToTag2(nks, neta, nCharged, nGoodChargedp, nGoodChargedm, totCharged);
391
397
399
400 std::set<UInt_t> Dsmode0, Dsmode1, D0mode0, D0mode1, Dmode0, Dmode1;
401 Dsmode0.clear(); Dsmode1.clear(); D0mode0.clear(); D0mode1.clear(), Dmode0.clear(); Dmode1.clear();
402 if ( evtRecDTagCol ) {
403 EvtRecDTagCol::iterator iter_begin = evtRecDTagCol->begin();
404 EvtRecDTagCol::iterator iter_end = evtRecDTagCol->end();
405
406 for (EvtRecDTagCol::iterator
iter = iter_begin;
iter != iter_end;
iter++) {
407 Int_t type = (*iter)->type();
408 Int_t mode = (*iter)->decayMode();
409
410 if ( mode>=400 && mode<505 ) {
411 if (type==1) {
412 Dsmode1.insert(mode);
413 } else {
414 Dsmode0.insert(mode);
415 }
416 }
417 else if ( mode>=0 && mode<200 ) {
418 if (type==1) {
419 D0mode1.insert(mode);
420 } else {
421 D0mode0.insert(mode);
422 }
423 }
424 else if ( mode>=200 && mode<400 ) {
425 if (type==1) {
426 Dmode1.insert(mode);
427 } else {
428 Dmode0.insert(mode);
429 }
430 }
431 }
432
433 }
434
435 UInt_t Ds_modemap = 0, D0_modemap = 0, D_modemap = 0, QC_status = 0;
436 int data0=3;
437
438 if (m_QC) QC_status = eventHeader->eventTag();
439 else QC_status = 1;
440
441 std::set<UInt_t>::iterator it1, it0;
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462 if ( D0mode1.size()>0 || Dmode1.size()>0 || D0mode0.size()>0 || Dmode0.size()>0 ) {
463 std::cout << EvtNo;
464 if (m_QC) std::cout << " QC= " << QC_status;
465 } else {
466 if ( Dsmode1.size()>0 ) {
467 if (m_QC) std::cout << EvtNo << " QC= " << QC_status << " Ds_1";
468 else std::cout << EvtNo << " Ds_1";
469 Ds_modemap |= (1<<31);
470 for (it1=Dsmode1.begin(); it1!=Dsmode1.end(); ++it1) {
471 std::cout << ' ' << *it1;
472 Ds_modemap |= (1<<Ds_modeTag[*it1]);
473 }
474 std::cout << " ("<<nCharged<<">"<<nGoodCharged<<","<<nNeutrk<<">"<<ngamma<<"):2"<<std::endl;
475 } else {
476 if ( Dsmode0.size()>0 ) {
477 if (m_QC) std::cout << EvtNo << " QC= " << QC_status << " Ds_0";
478 else std::cout << EvtNo << " Ds_0";
479 for (it0=Dsmode0.begin(); it0!=Dsmode0.end(); ++it0) {
480 std::cout << ' ' << *it0;
481 Ds_modemap |= (1<<Ds_modeTag[*it0]);
482 }
483 std::cout << " ("<<nCharged<<">"<<nGoodCharged<<","<<nNeutrk<<">"<<ngamma<<"):2"<<std::endl;
484 }
485 }
486 }
487
488 if ( D0mode1.size()>0 ) {
489 std::cout << " D0_1";
490 D0_modemap |= (1<<31);
491 for (it1=D0mode1.begin(); it1!=D0mode1.end(); ++it1) {
492 std::cout << ' ' << *it1;
493 D0_modemap |= (1<<D0_modeTag[*it1]);
494 }
495 } else {
496 if ( D0mode0.size()>0 ) {
497 std::cout << " D0_0";
498 for (it0=D0mode0.begin(); it0!=D0mode0.end(); ++it0) {
499 std::cout << ' ' << *it0;
500 D0_modemap |= (1<<D0_modeTag[*it0]);
501 }
502 }
503 }
504
505 if ( Dmode1.size()>0 ) {
506 std::cout << " D+_1";
507 D_modemap |= (1<<31);
508 for (it1=Dmode1.begin(); it1!=Dmode1.end(); ++it1) {
509 std::cout << ' ' << *it1;
510 D_modemap |= (1<<D_modeTag[*it1]);
511 }
512 } else {
513 if ( Dmode0.size()>0 ) {
514 std::cout << " D+_0";
515 for (it0=Dmode0.begin(); it0!=Dmode0.end(); ++it0) {
516 std::cout << ' ' << *it0;
517 D_modemap |= (1<<D_modeTag[*it0]);
518 }
519 }
520 }
521
522 if ( D0mode1.size()>0 || Dmode1.size()>0 ) {
523 data0 = 0;
524 std::cout << " ("<<nCharged<<">"<<nGoodCharged<<","<<nNeutrk<<">"<<ngamma<<")"<<":0" << endl;
525 } else if ( D0mode0.size()>0 || Dmode0.size()>0 ) {
526 data0 = 1;
527 std::cout << " ("<<nCharged<<">"<<nGoodCharged<<","<<nNeutrk<<">"<<ngamma<<")"<<":1" << endl;
528 } else if ( Dsmode1.size()>0 || Dsmode0.size()>0 ) {
529 data0 = 2;
530 }
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
568
569
570
571
572
573
574 iEvt++;
575}
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