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