BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDecayTag Class Reference

#include <EvtDecayTag.hh>

Public Member Functions

 EvtDecayTag (EvtParticle *par)
 
virtual ~EvtDecayTag ()
 
void makeTag (EvtParticle *par)
 
int TagIndex (EvtId pid)
 
int getModeTag ()
 
int getMultTag ()
 
int getHdrdBase (int index)
 

Detailed Description

Definition at line 39 of file EvtDecayTag.hh.

Constructor & Destructor Documentation

◆ EvtDecayTag()

EvtDecayTag::EvtDecayTag ( EvtParticle * par)
inline

Definition at line 45 of file EvtDecayTag.hh.

45 {
46 root_par = par;
47 _nmode.clear();
48 _multiplicity.clear();
49 for(int i=0;i<10;i++){_multiplicity.push_back(0);}
50 makeTag(root_par);
51}
void makeTag(EvtParticle *par)

◆ ~EvtDecayTag()

virtual EvtDecayTag::~EvtDecayTag ( )
inlinevirtual

Definition at line 54 of file EvtDecayTag.hh.

54{}

Member Function Documentation

◆ getHdrdBase()

int EvtDecayTag::getHdrdBase ( int index)

Definition at line 153 of file EvtDecayTag.cc.

153 {
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 getHdrdBase(int index)

Referenced by getHdrdBase().

◆ getModeTag()

int EvtDecayTag::getModeTag ( )

coding root_parent_mode * 10^9 + daug_0*10^6 + daug_1*10^3

Definition at line 102 of file EvtDecayTag.cc.

102 {
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 || intFlag[0]==-100) 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}
std::vector< int > getIntFlag()
double precision pisqo6 three
Definition qlconstants.h:4

◆ getMultTag()

int EvtDecayTag::getMultTag ( )

10 digit in the order: N_gamma, N_gamma, N_e, N_mu, N_pi, N_Kaon, N_p, N_Ks, N_Lambda,DecayType

Definition at line 136 of file EvtDecayTag.cc.

136 {
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}

◆ makeTag()

void EvtDecayTag::makeTag ( EvtParticle * par)

Definition at line 29 of file EvtDecayTag.cc.

29 {
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}
int TagIndex(EvtId pid)
Definition EvtId.hh:27
static int getStdHep(EvtId id)
Definition EvtPDL.hh:56
EvtId getId() const
int getNDaug() const
EvtParticle * getDaug(int i)
int getChannel() const

Referenced by EvtDecayTag(), and makeTag().

◆ TagIndex()

int EvtDecayTag::TagIndex ( EvtId pid)

gamma : 0 e+/e- : 1 mu+/- : 2 pi+/- : 3 K+/- : 4 p+/- : 5 Ks : 6 Lambda: 7 others: 8

Definition at line 76 of file EvtDecayTag.cc.

76 {
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}

Referenced by makeTag().


The documentation for this class was generated from the following files: