171 {
172
173 int nGoodCharged = 0;
174 int nGoodChargedp = 0;
175 int nGoodChargedm = 0;
176 int nCharged = 0;
177 int nNeutrk = 0;
178 int nTottrk = 0;
179 int totCharged = 0;
180 int npionp = 0;
181 int npionm = 0;
182 int nprotonp = 0;
183 int nprotonm = 0;
184 int nkaonp = 0;
185 int nkaonm = 0;
186 int nlambda = 0;
187 int nalambda= 0;
188 int nks = 0;
189 int ngamma = 0;
190 int neta = 0;
191 int npi0 = 0;
192 int nmuonp = 0;
193 int nmuonm = 0;
194 int nelectronp = 0;
195 int nelectronm = 0;
196
197 Hep3Vector xorigin(0,0,0);
200 xorigin.setX(dbv[0]);
201 xorigin.setY(dbv[1]);
202 xorigin.setZ(dbv[2]);
203 }
204
207
208 nCharged = evtRecEvent->totalCharged();
209 nNeutrk = evtRecEvent->totalNeutral();
210 nTottrk = evtRecEvent->totalTracks();
211
212
213 vector<int> iGood;
214 iGood.clear();
215 for ( Int_t iCharge = 0; iCharge < evtRecEvent->totalCharged(); ++iCharge ) {
217 if(!(*itTrk)->isMdcTrackValid()) continue;
219 HepVector a = mdcTrk->
helix();
220 HepSymMatrix Ea = mdcTrk->
err();
222 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
224 helixip.pivot(IP);
225 HepVector vecipa = helixip.a();
226 double Rvxy0=fabs(vecipa[0]);
227 double Rvz0=vecipa[3];
228 double Rvphi0=vecipa[1];
229 if(fabs(Rvxy0) >= 1.0) continue;
230 if(fabs(Rvz0) >= 10.0) continue;
231 if(mdcTrk->
charge() > 0) nGoodChargedp++;
232 if(mdcTrk->
charge() < 0) nGoodChargedm++;
233 ++nGoodCharged;
234 totCharged +=mdcTrk->
charge();
235 iGood.push_back(iCharge);
236 }
237
238
239
240 for(int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
242 if((*iTrk)->isEmcShowerValid()){
245 ngamma++;
246 }
247 }
248 }
249
250
251 for (int i=0;i<iGood.size();i++){
254
255
264
266 if (mdcKalTrack->
charge() > 0) npionp++;
267 if (mdcKalTrack->
charge() < 0) npionm++;
268 }
269
271 if (mdcKalTrack->
charge() > 0) nkaonp++;
272 if (mdcKalTrack->
charge() < 0) nkaonm++;
273 }
274
276 if (mdcKalTrack->
charge() > 0) nprotonp++;
277 if (mdcKalTrack->
charge() < 0) nprotonm++;
278 }
279
281 if (mdcKalTrack->
charge() > 0) nelectronp++;
282 if (mdcKalTrack->
charge() < 0) nelectronm++;
283 }
284
286 if (mdcKalTrack->
charge() > 0) nmuonp++;
287 if (mdcKalTrack->
charge() < 0) nmuonm++;
288 }
289 }
290
291
293 for (EvtRecEtaToGGCol::iterator iEta = evtRecEtaToGGCol->begin(); iEta != evtRecEtaToGGCol->end(); iEta++){
294 if ((((*iEta)->chisq() < 2500) && ((*iEta)->unconMass() > 0.40) && ((*iEta)->unconMass() < 0.70))){
301 neta++;
302 }
303 }
304 }
305 }
306
307
309 for (EvtRecPi0Col::iterator iPi0 = evtRecPi0Col->begin(); iPi0 != evtRecPi0Col->end(); iPi0++){
310 if ((((*iPi0)->chisq() < 2500) && ((*iPi0)->unconMass() > 0.107) && ((*iPi0)->unconMass() < 0.163))){
317 npi0++;
318 }
319 }
320 }
321 }
322
323
324
325
327 for (EvtRecVeeVertexCol::iterator iKs = evtRecVeeVertexCol->begin(); iKs != evtRecVeeVertexCol->end(); iKs++){
328 if ((*iKs)->vertexId() == 310){
329 if ( ((*iKs)->mass() > 0.471) && ((*iKs)->mass() < 0.524) && ((*iKs)->chi2() < 100) ){
330 nks++;
331 }
332 }
333 }
334
335 for (EvtRecVeeVertexCol::iterator iL = evtRecVeeVertexCol->begin(); iL != evtRecVeeVertexCol->end(); iL++){
336 if ((*iL)->vertexId() == 3122){
337 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
338 nlambda++;
339 }
340 }
341 if ((*iL)->vertexId() == -3122){
342 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
343 nalambda++;
344 }
345 }
346 }
347
348 unsigned int tagdata1 = nGoodCharged;
349 unsigned int tagdata2 =
IntToTag1(nNeutrk, nTottrk, ngamma, npi0);
350 unsigned int tagdata3 =
IntToTag2(npionp, npionm, nkaonp, nkaonm, nprotonp, nprotonm);
351 unsigned int tagdata4 =
IntToTag2(nlambda, nalambda, nelectronp, nelectronm, nmuonp, nmuonm);
352 unsigned int tagdata5 =
IntToTag2(nks, neta, nCharged, nGoodChargedp, nGoodChargedm, totCharged);
353
359
361
362 std::set<UInt_t> Lcmode0, Lcmode1, Dsmode0, Dsmode1, D0mode0, D0mode1, Dmode0, Dmode1;
363 Lcmode0.clear(); Lcmode1.clear(); Dsmode0.clear(); Dsmode1.clear(); D0mode0.clear(); D0mode1.clear(), Dmode0.clear(); Dmode1.clear();
364 if ( evtRecDTagCol ) {
365 EvtRecDTagCol::iterator iter_begin = evtRecDTagCol->begin();
366 EvtRecDTagCol::iterator iter_end = evtRecDTagCol->end();
367
368 for (EvtRecDTagCol::iterator
iter = iter_begin;
iter != iter_end;
iter++) {
369 Int_t type = (*iter)->type();
370 Int_t mode = (*iter)->decayMode();
371
372 if ( mode>=1000 && mode<1066 ) {
373 if (type==1) {
374 Lcmode1.insert(mode);
375 } else {
376 Lcmode0.insert(mode);
377 }
378 }
379 else if ( mode>=400 && mode<505 ) {
380 if (type==1) {
381 Dsmode1.insert(mode);
382 } else {
383 Dsmode0.insert(mode);
384 }
385 }
386 else if ( mode>=0 && mode<200 ) {
387 if (type==1) {
388 D0mode1.insert(mode);
389 } else {
390 D0mode0.insert(mode);
391 }
392 }
393 else if ( mode>=200 && mode<400 ) {
394 if (type==1) {
395 Dmode1.insert(mode);
396 } else {
397 Dmode0.insert(mode);
398 }
399 }
400 }
401
402 }
403
404 UInt_t Lc_modemap = 0, Ds_modemap = 0, D0_modemap = 0, D_modemap = 0;
405 int data0=3;
406 std::set<UInt_t>::iterator it1, it0;
407
408 if ( Lcmode1.size()>0 ) {
409 std::cout << "Evt: " << iEvt << " Lc_1 : ";
410 Lc_modemap |= (1<<31);
411 for (it1=Lcmode1.begin(); it1!=Lcmode1.end(); ++it1) {
412 std::cout << ' ' << *it1;
413 Lc_modemap |= (1<<Lc_modeTag[*it1]);
414 }
415 std::cout << endl;
416 } else {
417 if ( Lcmode0.size()>0 ) {
418 std::cout << "Evt: " << iEvt << " Lc_0 : ";
419 for (it0=Lcmode0.begin(); it0!=Lcmode0.end(); ++it0) {
420 std::cout << ' ' << *it0;
421 Lc_modemap |= (1<<Lc_modeTag[*it0]);
422 }
423 std::cout << endl;
424 }
425 }
426
427 if ( Dsmode1.size()>0 ) {
428 std::cout << "Evt: " << iEvt << " Ds_1 : ";
429 Ds_modemap |= (1<<31);
430 for (it1=Dsmode1.begin(); it1!=Dsmode1.end(); ++it1) {
431 std::cout << ' ' << *it1;
432 Ds_modemap |= (1<<Ds_modeTag[*it1]);
433 }
434 std::cout << endl;
435 } else {
436 if ( Dsmode0.size()>0 ) {
437 std::cout << "Evt: " << iEvt << " Ds_0 : ";
438 for (it0=Dsmode0.begin(); it0!=Dsmode0.end(); ++it0) {
439 std::cout << ' ' << *it0;
440 Ds_modemap |= (1<<Ds_modeTag[*it0]);
441 }
442 std::cout << endl;
443 }
444 }
445
446 if ( D0mode1.size()>0 ) {
447 std::cout << "Evt: " << iEvt << " D0_1 : ";
448 D0_modemap |= (1<<31);
449 for (it1=D0mode1.begin(); it1!=D0mode1.end(); ++it1) {
450 std::cout << ' ' << *it1;
451 D0_modemap |= (1<<D0_modeTag[*it1]);
452 }
453 std::cout << endl;
454 } else {
455 if ( D0mode0.size()>0 ) {
456 std::cout << "Evt: " << iEvt << " D0_0 : ";
457 for (it0=D0mode0.begin(); it0!=D0mode0.end(); ++it0) {
458 std::cout << ' ' << *it0;
459 D0_modemap |= (1<<D0_modeTag[*it0]);
460 }
461 std::cout << endl;
462 }
463 }
464
465 if ( Dmode1.size()>0 ) {
466 std::cout << "Evt: " << iEvt << " D+_1 : ";
467 D_modemap |= (1<<31);
468 for (it1=Dmode1.begin(); it1!=Dmode1.end(); ++it1) {
469 std::cout << ' ' << *it1;
470 D_modemap |= (1<<D_modeTag[*it1]);
471 }
472 std::cout << endl;
473 } else {
474 if ( Dmode0.size()>0 ) {
475 std::cout << "Evt: " << iEvt << " D+_0 : ";
476 for (it0=Dmode0.begin(); it0!=Dmode0.end(); ++it0) {
477 std::cout << ' ' << *it0;
478 D_modemap |= (1<<D_modeTag[*it0]);
479 }
480 std::cout << endl;
481 }
482 }
483
484 if ( Lcmode1.size()>0 ) {
485 data0 = 0;
486 } else if ( Dsmode1.size()>0 || D0mode1.size()>0 || Dmode1.size()>0 ) {
487 data0 = 1;
488 } else if ( Lcmode0.size()>0 || Dsmode0.size()>0 || D0mode0.size()>0 || Dmode0.size()>0 ) {
489 data0 = 2;
490 }
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
524
525
526
527
528
529
530
531
532
538
539
540
541
542
543
544 iEvt++;
545}
EvtRecTrackCol::iterator EvtRecTrackIterator
double cos(const BesAngle a)
const HepSymMatrix err() const
const HepVector helix() const
......
RecEmcShower * emcShower()
virtual void setTagData9(unsigned int t)=0
virtual void setTagData1(unsigned int t)=0
virtual void setTagData0(unsigned int t)=0
virtual void setTagData6(unsigned int t)=0
virtual void setTagData2(unsigned int t)=0
virtual void setTagData4(unsigned int t)=0
virtual void setTagData8(unsigned int t)=0
virtual void setTagData5(unsigned int t)=0
virtual void setTagData3(unsigned int t)=0
virtual void setTagData7(unsigned int t)=0
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
_EXTERN_ std::string EvtRecPi0Col
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecVeeVertexCol
_EXTERN_ std::string EvtRecEtaToGGCol
_EXTERN_ std::string EvtRecDTagCol
_EXTERN_ std::string EvtRecTrackCol