BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDecayTag.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of models developed at BES collaboration
5// based on the EvtGen framework. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/BesCopyright
9// Copyright (A) 2006 Ping Rong-Gang @IHEP
10//
11// Module: EvtDecayTag.cc
12//
13// Description: Class to deal with the decay tag, e.g. the decay mode and multiplicity
14//
15// Modification history:
16//
17// Ping R.-G. December, 2011-Jan Module created
18//
19//------------------------------------------------------------------------
20//
21
22
23#include <iostream>
25
26using std::endl;
27using std::fstream;
28
30
31 int ndaug = par->getNDaug();
32 if(ndaug < 2){
33 EvtId id = par->getId();
34 int theTag = TagIndex(id);
35 _multiplicity[theTag]++;
36 } else {
37 //--
38 if(par == root_par) {
39 int theMode = root_par->getChannel();
40 _nmode.push_back(theMode);
41 }
42 //--
43 int ND=0;
44 EvtParticle *theD;
45 for(int i=0;i<ndaug;i++){
46 EvtParticle *theDaug = par->getDaug(i);
47 if(par == root_par && theDaug->getNDaug()!=0){
48 int theMode = theDaug->getChannel();
49 _nmode.push_back(theMode);
50 ND++;
51 theD = theDaug;
52 }
53
54 int id = EvtPDL::getStdHep(theDaug->getId());
55 if (id == 310) _multiplicity[6]++; //Ks
56 if (id ==3122) _multiplicity[7]++; // Lambda or Lambdabar
57 makeTag(theDaug);
58 }
59 //-- for root particle decays into only one unstable particle, the flag1 further tag the third decay
60 if(ND ==1){
61 int NDD= theD->getNDaug();
62 for(int i=0;i<NDD;i++){
63 EvtParticle *theDD=theD->getDaug(i);
64 if(theDD->getNDaug() !=0 ){
65 int ndd = theDD->getChannel();
66 _nmode.push_back(ndd);
67 break;
68 }
69 }
70 }
71 //-------------------
72 }
73
74}
75
77 /**
78 * gamma : 0
79 * e+/e- : 1
80 * mu+/- : 2
81 * pi+/- : 3
82 * K+/- : 4
83 * p+/- : 5
84 * Ks : 6
85 * Lambda: 7
86 * others: 8
87 **/
88
89 int id = EvtPDL::getStdHep(pid);
90 int absid=fabs(id);
91 if( absid == 22 ) {return 0;} //photon
92 else if(absid == 11 ) {return 1;} // electron
93 else if(absid == 13) {return 2;} // muon
94 else if(absid == 211) {return 3;} // pion
95 else if(absid == 321) {return 4;} // Kaon
96 else if(absid ==2212) {return 5;} // pronton / anti-proton
97 else if(absid == 310) {return 6;} // Ks
98 else if(absid ==3122) {return 7;} // Lambda / Lambdabar
99 else {return 8;}
100}
101
103 //get ConExc 74110 mode selected index
104 std::vector<int> intFlag = root_par->getIntFlag();
105 if(intFlag.size()>0){
106 if(intFlag[0]==74110) return intFlag[1];
107 }
108
109 /**
110 * coding root_parent_mode * 10^9 + daug_0*10^6 + daug_1*10^3
111 **/
112 double seg0,seg1,seg2;
113
114 int three = 1000;
115 int six = 1000000;
116 int themode = 1000000000;
117 //---debugging
118 // for(int im=0;im<_nmode.size();im++){std::cout<<"_nmode["<<im<<"]"<<_nmode[im]<<endl;;}
119
120 if(_nmode.size()==1) {themode += _nmode[0]*six; return themode;}
121 else if(_nmode.size() == 2){
122 seg0 = _nmode[0]*six;
123 seg1 = _nmode[1]*three;
124 themode += seg0 + seg1;
125 return themode;
126 }
127 else if(_nmode.size() >= 3){
128 seg0 = _nmode[0]*six;
129 seg1 = _nmode[1]*three;
130 seg2 = _nmode[2];
131 themode += seg0 + seg1 + seg2;
132 return themode;
133 }
134}
135
137 /**
138 * 10 digit in the order: N_gamma, N_gamma, N_e, N_mu, N_pi,
139 * N_Kaon, N_p, N_Ks, N_Lambda,DecayType
140 **/
141 int thetag = 0;
142 for(int i=1; i<9; i++){
143 if (_multiplicity[i] >9) return 0;
144 }
145 for(int i=0; i<9; i++){
146 int ndx = 8-i;
147 int dig = pow(10,ndx);
148 thetag += dig*_multiplicity[i];
149 }
150 return thetag;
151}
152
154 int ten = 10;
155 int base;
156 if( index ==0 || index>=100 && index <1000) { return index;}
157 else {
158 base = index*ten;
159 getHdrdBase(base);
160 }
161}
int getMultTag()
Definition: EvtDecayTag.cc:136
void makeTag(EvtParticle *par)
Definition: EvtDecayTag.cc:29
int getHdrdBase(int index)
Definition: EvtDecayTag.cc:153
int getModeTag()
Definition: EvtDecayTag.cc:102
int TagIndex(EvtId pid)
Definition: EvtDecayTag.cc:76
Definition: EvtId.hh:27
static int getStdHep(EvtId id)
Definition: EvtPDL.hh:56
EvtId getId() const
Definition: EvtParticle.cc:113
int getNDaug() const
Definition: EvtParticle.cc:125
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:85
std::vector< int > getIntFlag()
Definition: EvtParticle.hh:158
int getChannel() const
Definition: EvtParticle.cc:123