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