153 {
154
155 int nGoodCharged = 0;
156 int nGoodChargedp = 0;
157 int nGoodChargedm = 0;
158 int nCharged = 0;
159 int nNeutrk = 0;
160 int nTottrk = 0;
161 int totCharged = 0;
162 int npionp = 0;
163 int npionm = 0;
164 int nprotonp = 0;
165 int nprotonm = 0;
166 int nkaonp = 0;
167 int nkaonm = 0;
168 int nlambda = 0;
169 int nalambda= 0;
170 int nks = 0;
171 int ngamma = 0;
172 int neta = 0;
173 int npi0 = 0;
174 int nmuonp = 0;
175 int nmuonm = 0;
176 int nelectronp = 0;
177 int nelectronm = 0;
178
179 Hep3Vector xorigin(0,0,0);
182 xorigin.setX(dbv[0]);
183 xorigin.setY(dbv[1]);
184 xorigin.setZ(dbv[2]);
185 }
186
189
190 nCharged = evtRecEvent->totalCharged();
191 nNeutrk = evtRecEvent->totalNeutral();
192 nTottrk = evtRecEvent->totalTracks();
193
194
195 vector<int> iGood;
196 iGood.clear();
197 for ( Int_t iCharge = 0; iCharge < evtRecEvent->totalCharged(); ++iCharge ) {
199 if(!(*itTrk)->isMdcTrackValid()) continue;
201 HepVector a = mdcTrk->
helix();
202 HepSymMatrix Ea = mdcTrk->
err();
204 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
206 helixip.pivot(IP);
207 HepVector vecipa = helixip.a();
208 double Rvxy0=fabs(vecipa[0]);
209 double Rvz0=vecipa[3];
210 double Rvphi0=vecipa[1];
211 if(fabs(Rvxy0) >= 1.0) continue;
212 if(fabs(Rvz0) >= 10.0) continue;
213 if(mdcTrk->
charge() > 0) nGoodChargedp++;
214 if(mdcTrk->
charge() < 0) nGoodChargedm++;
215 ++nGoodCharged;
216 totCharged +=mdcTrk->
charge();
217 iGood.push_back(iCharge);
218 }
219
220
221
222 for(int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
224 if((*iTrk)->isEmcShowerValid()){
227 ngamma++;
228 }
229 }
230 }
231
232
233 for (int i=0;i<iGood.size();i++){
236
237
246
248 if (mdcKalTrack->
charge() > 0) npionp++;
249 if (mdcKalTrack->
charge() < 0) npionm++;
250 }
251
253 if (mdcKalTrack->
charge() > 0) nkaonp++;
254 if (mdcKalTrack->
charge() < 0) nkaonm++;
255 }
256
258 if (mdcKalTrack->
charge() > 0) nprotonp++;
259 if (mdcKalTrack->
charge() < 0) nprotonm++;
260 }
261
263 if (mdcKalTrack->
charge() > 0) nelectronp++;
264 if (mdcKalTrack->
charge() < 0) nelectronm++;
265 }
266
268 if (mdcKalTrack->
charge() > 0) nmuonp++;
269 if (mdcKalTrack->
charge() < 0) nmuonm++;
270 }
271 }
272
273
275 for (EvtRecEtaToGGCol::iterator iEta = evtRecEtaToGGCol->begin(); iEta != evtRecEtaToGGCol->end(); iEta++){
276 if ((((*iEta)->chisq() < 2500) && ((*iEta)->unconMass() > 0.40) && ((*iEta)->unconMass() < 0.70))){
283 neta++;
284 }
285 }
286 }
287 }
288
289
291 for (EvtRecPi0Col::iterator iPi0 = evtRecPi0Col->begin(); iPi0 != evtRecPi0Col->end(); iPi0++){
292 if ((((*iPi0)->chisq() < 2500) && ((*iPi0)->unconMass() > 0.107) && ((*iPi0)->unconMass() < 0.163))){
299 npi0++;
300 }
301 }
302 }
303 }
304
305
306
307
309 for (EvtRecVeeVertexCol::iterator iKs = evtRecVeeVertexCol->begin(); iKs != evtRecVeeVertexCol->end(); iKs++){
310 if ((*iKs)->vertexId() == 310){
311 if ( ((*iKs)->mass() > 0.471) && ((*iKs)->mass() < 0.524) && ((*iKs)->chi2() < 100) ){
312 nks++;
313 }
314 }
315 }
316
317 for (EvtRecVeeVertexCol::iterator iL = evtRecVeeVertexCol->begin(); iL != evtRecVeeVertexCol->end(); iL++){
318 if ((*iL)->vertexId() == 3122){
319 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
320 nlambda++;
321 }
322 }
323 if ((*iL)->vertexId() == -3122){
324 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
325 nalambda++;
326 }
327 }
328 }
329
330 unsigned int tagdata1 = nGoodCharged;
331 unsigned int tagdata2 =
IntToTag1(nNeutrk, nTottrk, ngamma, npi0);
332 unsigned int tagdata3 =
IntToTag2(npionp, npionm, nkaonp, nkaonm, nprotonp, nprotonm);
333 unsigned int tagdata4 =
IntToTag2(nlambda, nalambda, nelectronp, nelectronm, nmuonp, nmuonm);
334 unsigned int tagdata5 =
IntToTag2(nks, neta, nCharged, nGoodChargedp, nGoodChargedm, totCharged);
335
341
343
344 std::set<UInt_t> Dsmode0, Dsmode1, D0mode0, D0mode1, Dmode0, Dmode1;
345 Dsmode0.clear(); Dsmode1.clear(); D0mode0.clear(); D0mode1.clear(), Dmode0.clear(); Dmode1.clear();
346 if ( evtRecDTagCol ) {
347 EvtRecDTagCol::iterator iter_begin = evtRecDTagCol->begin();
348 EvtRecDTagCol::iterator iter_end = evtRecDTagCol->end();
349
350 for (EvtRecDTagCol::iterator
iter = iter_begin;
iter != iter_end;
iter++) {
351 Int_t type = (*iter)->type();
352 Int_t mode = (*iter)->decayMode();
353
354 if ( mode>=400 && mode<505 ) {
355 if (type==1) {
356 Dsmode1.insert(mode);
357 } else {
358 Dsmode0.insert(mode);
359 }
360 }
361 else if ( mode>=0 && mode<200 ) {
362 if (type==1) {
363 D0mode1.insert(mode);
364 } else {
365 D0mode0.insert(mode);
366 }
367 }
368 else if ( mode>=200 && mode<400 ) {
369 if (type==1) {
370 Dmode1.insert(mode);
371 } else {
372 Dmode0.insert(mode);
373 }
374 }
375 }
376
377 }
378
379 UInt_t Ds_modemap = 0, D0_modemap = 0, D_modemap = 0;
380 int data0=3;
381 std::set<UInt_t>::iterator it1, it0;
382
383 if ( Dsmode1.size()>0 ) {
384 std::cout << "Evt: " << iEvt << " Ds_1 : ";
385 Ds_modemap |= (1<<31);
386 for (it1=Dsmode1.begin(); it1!=Dsmode1.end(); ++it1) {
387 std::cout << ' ' << *it1;
388 Ds_modemap |= (1<<Ds_modeTag[*it1]);
389 }
390 std::cout << endl;
391 } else {
392 if ( Dsmode0.size()>0 ) {
393 std::cout << "Evt: " << iEvt << " Ds_0 : ";
394 for (it0=Dsmode0.begin(); it0!=Dsmode0.end(); ++it0) {
395 std::cout << ' ' << *it0;
396 Ds_modemap |= (1<<Ds_modeTag[*it0]);
397 }
398 std::cout << endl;
399 }
400 }
401
402 if ( D0mode1.size()>0 ) {
403 std::cout << "Evt: " << iEvt << " D0_1 : ";
404 D0_modemap |= (1<<31);
405 for (it1=D0mode1.begin(); it1!=D0mode1.end(); ++it1) {
406 std::cout << ' ' << *it1;
407 D0_modemap |= (1<<D0_modeTag[*it1]);
408 }
409 std::cout << endl;
410 } else {
411 if ( D0mode0.size()>0 ) {
412 std::cout << "Evt: " << iEvt << " D0_0 : ";
413 for (it0=D0mode0.begin(); it0!=D0mode0.end(); ++it0) {
414 std::cout << ' ' << *it0;
415 D0_modemap |= (1<<D0_modeTag[*it0]);
416 }
417 std::cout << endl;
418 }
419 }
420
421 if ( Dmode1.size()>0 ) {
422 std::cout << "Evt: " << iEvt << " D+_1 : ";
423 D_modemap |= (1<<31);
424 for (it1=Dmode1.begin(); it1!=Dmode1.end(); ++it1) {
425 std::cout << ' ' << *it1;
426 D_modemap |= (1<<D_modeTag[*it1]);
427 }
428 std::cout << endl;
429 } else {
430 if ( Dmode0.size()>0 ) {
431 std::cout << "Evt: " << iEvt << " D+_0 : ";
432 for (it0=Dmode0.begin(); it0!=Dmode0.end(); ++it0) {
433 std::cout << ' ' << *it0;
434 D_modemap |= (1<<D_modeTag[*it0]);
435 }
436 std::cout << endl;
437 }
438 }
439
440 if ( Dsmode1.size()>0 ) {
441 data0 = 0;
442 } else if ( D0mode1.size()>0 || Dmode1.size()>0 ) {
443 data0 = 1;
444 } else if ( Dsmode0.size()>0 || D0mode0.size()>0 || Dmode0.size()>0 ) {
445 data0 = 2;
446 }
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
483
484
485
486
487
488
489 iEvt++;
490}
EvtRecTrackCol::iterator EvtRecTrackIterator
double cos(const BesAngle a)
const HepSymMatrix err() const
const HepVector helix() const
......
RecEmcShower * emcShower()
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