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 double theta = mdcTrk->
theta();
202 HepVector a = mdcTrk->
helix();
203 HepSymMatrix Ea = mdcTrk->
err();
205 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
207 helixip.pivot(IP);
208 HepVector vecipa = helixip.a();
209 double Rvxy0=fabs(vecipa[0]);
210 double Rvz0=vecipa[3];
211 double Rvphi0=vecipa[1];
212 if(fabs(Rvxy0) >= 1.0) continue;
213 if(fabs(Rvz0) >= 10.0) continue;
214 if(fabs(
cos(theta))>=0.93)
continue;
215 if(mdcTrk->
charge() > 0) nGoodChargedp++;
216 if(mdcTrk->
charge() < 0) nGoodChargedm++;
217 ++nGoodCharged;
218 totCharged +=mdcTrk->
charge();
219 iGood.push_back(iCharge);
220 }
221
222
223
224 for(int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
226 if((*iTrk)->isEmcShowerValid()){
229 ngamma++;
230 }
231 }
232 }
233
234
235 for (int i=0;i<iGood.size();i++){
238
239
248
250 if (mdcKalTrack->
charge() > 0) npionp++;
251 if (mdcKalTrack->
charge() < 0) npionm++;
252 }
253
255 if (mdcKalTrack->
charge() > 0) nkaonp++;
256 if (mdcKalTrack->
charge() < 0) nkaonm++;
257 }
258
260 if (mdcKalTrack->
charge() > 0) nprotonp++;
261 if (mdcKalTrack->
charge() < 0) nprotonm++;
262 }
263
265 if (mdcKalTrack->
charge() > 0) nelectronp++;
266 if (mdcKalTrack->
charge() < 0) nelectronm++;
267 }
268
270 if (mdcKalTrack->
charge() > 0) nmuonp++;
271 if (mdcKalTrack->
charge() < 0) nmuonm++;
272 }
273 }
274
275
277 for (EvtRecEtaToGGCol::iterator iEta = evtRecEtaToGGCol->begin(); iEta != evtRecEtaToGGCol->end(); iEta++){
278 if ((((*iEta)->chisq() < 2500) && ((*iEta)->unconMass() > 0.40) && ((*iEta)->unconMass() < 0.70))){
285 neta++;
286 }
287 }
288 }
289 }
290
291
293 for (EvtRecPi0Col::iterator iPi0 = evtRecPi0Col->begin(); iPi0 != evtRecPi0Col->end(); iPi0++){
294 if ((((*iPi0)->chisq() < 2500) && ((*iPi0)->unconMass() > 0.107) && ((*iPi0)->unconMass() < 0.163))){
301 npi0++;
302 }
303 }
304 }
305 }
306
307
308
309
311 for (EvtRecVeeVertexCol::iterator iKs = evtRecVeeVertexCol->begin(); iKs != evtRecVeeVertexCol->end(); iKs++){
312 if ((*iKs)->vertexId() == 310){
313 if ( ((*iKs)->mass() > 0.471) && ((*iKs)->mass() < 0.524) && ((*iKs)->chi2() < 100) ){
314 nks++;
315 }
316 }
317 }
318
319 for (EvtRecVeeVertexCol::iterator iL = evtRecVeeVertexCol->begin(); iL != evtRecVeeVertexCol->end(); iL++){
320 if ((*iL)->vertexId() == 3122){
321 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
322 nlambda++;
323 }
324 }
325 if ((*iL)->vertexId() == -3122){
326 if ( ((*iL)->mass() > 1.100) && ((*iL)->mass() < 1.130) && ((*iL)->chi2() < 100) ){
327 nalambda++;
328 }
329 }
330 }
331
332 unsigned int tagdata1 = nGoodCharged;
333 unsigned int tagdata2 =
IntToTag1(nNeutrk, nTottrk, ngamma, npi0);
334 unsigned int tagdata3 =
IntToTag2(npionp, npionm, nkaonp, nkaonm, nprotonp, nprotonm);
335 unsigned int tagdata4 =
IntToTag2(nlambda, nalambda, nelectronp, nelectronm, nmuonp, nmuonm);
336 unsigned int tagdata5 =
IntToTag2(nks, neta, nCharged, nGoodChargedp, nGoodChargedm, totCharged);
337
343
345
346 std::set<UInt_t> Dsmode0, Dsmode1, D0mode0, D0mode1, Dmode0, Dmode1;
347 Dsmode0.clear(); Dsmode1.clear(); D0mode0.clear(); D0mode1.clear(), Dmode0.clear(); Dmode1.clear();
348 if ( evtRecDTagCol ) {
349 EvtRecDTagCol::iterator iter_begin = evtRecDTagCol->begin();
350 EvtRecDTagCol::iterator iter_end = evtRecDTagCol->end();
351
352 for (EvtRecDTagCol::iterator
iter = iter_begin;
iter != iter_end;
iter++) {
353 Int_t type = (*iter)->type();
354 Int_t mode = (*iter)->decayMode();
355
356 if ( mode>=400 && mode<505 ) {
357 if (type==1) {
358 Dsmode1.insert(mode);
359 } else {
360 Dsmode0.insert(mode);
361 }
362 }
363 else if ( mode>=0 && mode<200 ) {
364 if (type==1) {
365 D0mode1.insert(mode);
366 } else {
367 D0mode0.insert(mode);
368 }
369 }
370 else if ( mode>=200 && mode<400 ) {
371 if (type==1) {
372 Dmode1.insert(mode);
373 } else {
374 Dmode0.insert(mode);
375 }
376 }
377 }
378
379 }
380
381 UInt_t Ds_modemap = 0, D0_modemap = 0, D_modemap = 0;
382 int data0=3;
383 std::set<UInt_t>::iterator it1, it0;
384
385 if ( Dsmode1.size()>0 ) {
386 std::cout << "Evt: " << iEvt << " Ds_1 : ";
387 Ds_modemap |= (1<<31);
388 for (it1=Dsmode1.begin(); it1!=Dsmode1.end(); ++it1) {
389 std::cout << ' ' << *it1;
390 Ds_modemap |= (1<<Ds_modeTag[*it1]);
391 }
392 std::cout << endl;
393 } else {
394 if ( Dsmode0.size()>0 ) {
395 std::cout << "Evt: " << iEvt << " Ds_0 : ";
396 for (it0=Dsmode0.begin(); it0!=Dsmode0.end(); ++it0) {
397 std::cout << ' ' << *it0;
398 Ds_modemap |= (1<<Ds_modeTag[*it0]);
399 }
400 std::cout << endl;
401 }
402 }
403
404 if ( D0mode1.size()>0 ) {
405 std::cout << "Evt: " << iEvt << " D0_1 : ";
406 D0_modemap |= (1<<31);
407 for (it1=D0mode1.begin(); it1!=D0mode1.end(); ++it1) {
408 std::cout << ' ' << *it1;
409 D0_modemap |= (1<<D0_modeTag[*it1]);
410 }
411 std::cout << endl;
412 } else {
413 if ( D0mode0.size()>0 ) {
414 std::cout << "Evt: " << iEvt << " D0_0 : ";
415 for (it0=D0mode0.begin(); it0!=D0mode0.end(); ++it0) {
416 std::cout << ' ' << *it0;
417 D0_modemap |= (1<<D0_modeTag[*it0]);
418 }
419 std::cout << endl;
420 }
421 }
422
423 if ( Dmode1.size()>0 ) {
424 std::cout << "Evt: " << iEvt << " D+_1 : ";
425 D_modemap |= (1<<31);
426 for (it1=Dmode1.begin(); it1!=Dmode1.end(); ++it1) {
427 std::cout << ' ' << *it1;
428 D_modemap |= (1<<D_modeTag[*it1]);
429 }
430 std::cout << endl;
431 } else {
432 if ( Dmode0.size()>0 ) {
433 std::cout << "Evt: " << iEvt << " D+_0 : ";
434 for (it0=Dmode0.begin(); it0!=Dmode0.end(); ++it0) {
435 std::cout << ' ' << *it0;
436 D_modemap |= (1<<D_modeTag[*it0]);
437 }
438 std::cout << endl;
439 }
440 }
441
442 if ( Dsmode1.size()>0 ) {
443 data0 = 0;
444 } else if ( D0mode1.size()>0 || Dmode1.size()>0 ) {
445 data0 = 1;
446 } else if ( Dsmode0.size()>0 || D0mode0.size()>0 || Dmode0.size()>0 ) {
447 data0 = 2;
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
479
480
485
486
487
488
489
490
491 iEvt++;
492}
double cos(const BesAngle a)
EvtRecTrackCol::iterator EvtRecTrackIterator
const double theta() const
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