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 double theta = mdcTrk->
theta();
220 HepVector a = mdcTrk->
helix();
221 HepSymMatrix Ea = mdcTrk->
err();
223 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
225 helixip.pivot(IP);
226 HepVector vecipa = helixip.a();
227 double Rvxy0=fabs(vecipa[0]);
228 double Rvz0=vecipa[3];
229 double Rvphi0=vecipa[1];
230 if(fabs(Rvxy0) >= 1.0) continue;
231 if(fabs(Rvz0) >= 10.0) continue;
232 if(fabs(
cos(theta))>=0.93)
continue;
233 if(mdcTrk->
charge() > 0) nGoodChargedp++;
234 if(mdcTrk->
charge() < 0) nGoodChargedm++;
235 ++nGoodCharged;
236 totCharged +=mdcTrk->
charge();
237 iGood.push_back(iCharge);
238 }
239
240
241
242 for(int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
244 if((*iTrk)->isEmcShowerValid()){
247 ngamma++;
248 }
249 }
250 }
251
252
253 for (int i=0;i<iGood.size();i++){
256
257
266
268 if (mdcKalTrack->
charge() > 0) npionp++;
269 if (mdcKalTrack->
charge() < 0) npionm++;
270 }
271
273 if (mdcKalTrack->
charge() > 0) nkaonp++;
274 if (mdcKalTrack->
charge() < 0) nkaonm++;
275 }
276
278 if (mdcKalTrack->
charge() > 0) nprotonp++;
279 if (mdcKalTrack->
charge() < 0) nprotonm++;
280 }
281
283 if (mdcKalTrack->
charge() > 0) nelectronp++;
284 if (mdcKalTrack->
charge() < 0) nelectronm++;
285 }
286
288 if (mdcKalTrack->
charge() > 0) nmuonp++;
289 if (mdcKalTrack->
charge() < 0) nmuonm++;
290 }
291 }
292
293
295 for (EvtRecEtaToGGCol::iterator iEta = evtRecEtaToGGCol->begin(); iEta != evtRecEtaToGGCol->end(); iEta++){
296 if ((((*iEta)->chisq() < 2500) && ((*iEta)->unconMass() > 0.40) && ((*iEta)->unconMass() < 0.70))){
303 neta++;
304 }
305 }
306 }
307 }
308
309
311 for (EvtRecPi0Col::iterator iPi0 = evtRecPi0Col->begin(); iPi0 != evtRecPi0Col->end(); iPi0++){
312 if ((((*iPi0)->chisq() < 2500) && ((*iPi0)->unconMass() > 0.107) && ((*iPi0)->unconMass() < 0.163))){
319 npi0++;
320 }
321 }
322 }
323 }
324
325
326
327
329 for (EvtRecVeeVertexCol::iterator iKs = evtRecVeeVertexCol->begin(); iKs != evtRecVeeVertexCol->end(); iKs++){
330 if ((*iKs)->vertexId() == 310){
331 if ( ((*iKs)->mass() > 0.471) && ((*iKs)->mass() < 0.524) && ((*iKs)->chi2() < 100) ){
332 nks++;
333 }
334 }
335 }
336
337 for (EvtRecVeeVertexCol::iterator iL = evtRecVeeVertexCol->begin(); iL != evtRecVeeVertexCol->end(); iL++){
338 if ((*iL)->vertexId() == 3122){
339 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
340 nlambda++;
341 }
342 }
343 if ((*iL)->vertexId() == -3122){
344 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
345 nalambda++;
346 }
347 }
348 }
349
350 unsigned int tagdata1 = nGoodCharged;
351 unsigned int tagdata2 =
IntToTag1(nNeutrk, nTottrk, ngamma, npi0);
352 unsigned int tagdata3 =
IntToTag2(npionp, npionm, nkaonp, nkaonm, nprotonp, nprotonm);
353 unsigned int tagdata4 =
IntToTag2(nlambda, nalambda, nelectronp, nelectronm, nmuonp, nmuonm);
354 unsigned int tagdata5 =
IntToTag2(nks, neta, nCharged, nGoodChargedp, nGoodChargedm, totCharged);
355
361
363
364 std::set<UInt_t> Lcmode0, Lcmode1, Dsmode0, Dsmode1, D0mode0, D0mode1, Dmode0, Dmode1;
365 Lcmode0.clear(); Lcmode1.clear(); Dsmode0.clear(); Dsmode1.clear(); D0mode0.clear(); D0mode1.clear(), Dmode0.clear(); Dmode1.clear();
366 if ( evtRecDTagCol ) {
367 EvtRecDTagCol::iterator iter_begin = evtRecDTagCol->begin();
368 EvtRecDTagCol::iterator iter_end = evtRecDTagCol->end();
369
370 for (EvtRecDTagCol::iterator
iter = iter_begin;
iter != iter_end;
iter++) {
371 Int_t type = (*iter)->type();
372 Int_t mode = (*iter)->decayMode();
373
374 if ( mode>=1000 && mode<1066 ) {
375 if (type==1) {
376 Lcmode1.insert(mode);
377 } else {
378 Lcmode0.insert(mode);
379 }
380 }
381 else if ( mode>=400 && mode<505 ) {
382 if (type==1) {
383 Dsmode1.insert(mode);
384 } else {
385 Dsmode0.insert(mode);
386 }
387 }
388 else if ( mode>=0 && mode<200 ) {
389 if (type==1) {
390 D0mode1.insert(mode);
391 } else {
392 D0mode0.insert(mode);
393 }
394 }
395 else if ( mode>=200 && mode<400 ) {
396 if (type==1) {
397 Dmode1.insert(mode);
398 } else {
399 Dmode0.insert(mode);
400 }
401 }
402 }
403
404 }
405
406 UInt_t Lc_modemap = 0, Ds_modemap = 0, D0_modemap = 0, D_modemap = 0;
407 int data0=3;
408 std::set<UInt_t>::iterator it1, it0;
409
410 if ( Lcmode1.size()>0 ) {
411 std::cout << "Evt: " << iEvt << " Lc_1 : ";
412 Lc_modemap |= (1<<31);
413 for (it1=Lcmode1.begin(); it1!=Lcmode1.end(); ++it1) {
414 std::cout << ' ' << *it1;
415 Lc_modemap |= (1<<Lc_modeTag[*it1]);
416 }
417 std::cout << endl;
418 } else {
419 if ( Lcmode0.size()>0 ) {
420 std::cout << "Evt: " << iEvt << " Lc_0 : ";
421 for (it0=Lcmode0.begin(); it0!=Lcmode0.end(); ++it0) {
422 std::cout << ' ' << *it0;
423 Lc_modemap |= (1<<Lc_modeTag[*it0]);
424 }
425 std::cout << endl;
426 }
427 }
428
429 if ( Dsmode1.size()>0 ) {
430 std::cout << "Evt: " << iEvt << " Ds_1 : ";
431 Ds_modemap |= (1<<31);
432 for (it1=Dsmode1.begin(); it1!=Dsmode1.end(); ++it1) {
433 std::cout << ' ' << *it1;
434 Ds_modemap |= (1<<Ds_modeTag[*it1]);
435 }
436 std::cout << endl;
437 } else {
438 if ( Dsmode0.size()>0 ) {
439 std::cout << "Evt: " << iEvt << " 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 << endl;
445 }
446 }
447
448 if ( D0mode1.size()>0 ) {
449 std::cout << "Evt: " << iEvt << " D0_1 : ";
450 D0_modemap |= (1<<31);
451 for (it1=D0mode1.begin(); it1!=D0mode1.end(); ++it1) {
452 std::cout << ' ' << *it1;
453 D0_modemap |= (1<<D0_modeTag[*it1]);
454 }
455 std::cout << endl;
456 } else {
457 if ( D0mode0.size()>0 ) {
458 std::cout << "Evt: " << iEvt << " D0_0 : ";
459 for (it0=D0mode0.begin(); it0!=D0mode0.end(); ++it0) {
460 std::cout << ' ' << *it0;
461 D0_modemap |= (1<<D0_modeTag[*it0]);
462 }
463 std::cout << endl;
464 }
465 }
466
467 if ( Dmode1.size()>0 ) {
468 std::cout << "Evt: " << iEvt << " D+_1 : ";
469 D_modemap |= (1<<31);
470 for (it1=Dmode1.begin(); it1!=Dmode1.end(); ++it1) {
471 std::cout << ' ' << *it1;
472 D_modemap |= (1<<D_modeTag[*it1]);
473 }
474 std::cout << endl;
475 } else {
476 if ( Dmode0.size()>0 ) {
477 std::cout << "Evt: " << iEvt << " D+_0 : ";
478 for (it0=Dmode0.begin(); it0!=Dmode0.end(); ++it0) {
479 std::cout << ' ' << *it0;
480 D_modemap |= (1<<D_modeTag[*it0]);
481 }
482 std::cout << endl;
483 }
484 }
485
486 if ( Lcmode1.size()>0 ) {
487 data0 = 0;
488 } else if ( Dsmode1.size()>0 || D0mode1.size()>0 || Dmode1.size()>0 ) {
489 data0 = 1;
490 } else if ( Lcmode0.size()>0 || Dsmode0.size()>0 || D0mode0.size()>0 || Dmode0.size()>0 ) {
491 data0 = 2;
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
533
534
540
541
542
543
544
545
546 iEvt++;
547}
double cos(const BesAngle a)
EvtRecTrackCol::iterator EvtRecTrackIterator
const double theta() const
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