CGEM BOSS 6.6.5.f
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)
Definition: EvtDecayTag.cc:29

◆ ~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 147 of file EvtDecayTag.cc.

147 {
148 int ten = 10;
149 int base;
150 if( index ==0 || index>=100 && index <1000) { return index;}
151 else {
152 base = index*ten;
153 getHdrdBase(base);
154 }
155}
int getHdrdBase(int index)
Definition: EvtDecayTag.cc:147

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 /**
104 * coding root_parent_mode * 10^9 + daug_0*10^6 + daug_1*10^3
105 **/
106 double seg0,seg1,seg2;
107
108 int three = 1000;
109 int six = 1000000;
110 int themode = 1000000000;
111 //---debugging
112 // for(int im=0;im<_nmode.size();im++){std::cout<<"_nmode["<<im<<"]"<<_nmode[im]<<endl;;}
113
114 if(_nmode.size()==1) {themode += _nmode[0]*six; return themode;}
115 else if(_nmode.size() == 2){
116 seg0 = _nmode[0]*six;
117 seg1 = _nmode[1]*three;
118 themode += seg0 + seg1;
119 return themode;
120 }
121 else if(_nmode.size() >= 3){
122 seg0 = _nmode[0]*six;
123 seg1 = _nmode[1]*three;
124 seg2 = _nmode[2];
125 themode += seg0 + seg1 + seg2;
126 return themode;
127 }
128}

◆ 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 130 of file EvtDecayTag.cc.

130 {
131 /**
132 * 10 digit in the order: N_gamma, N_gamma, N_e, N_mu, N_pi,
133 * N_Kaon, N_p, N_Ks, N_Lambda,DecayType
134 **/
135 int thetag = 0;
136 for(int i=1; i<9; i++){
137 if (_multiplicity[i] >9) return 0;
138 }
139 for(int i=0; i<9; i++){
140 int ndx = 8-i;
141 int dig = pow(10,ndx);
142 thetag += dig*_multiplicity[i];
143 }
144 return thetag;
145}

◆ 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: 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
int getChannel() const
Definition: EvtParticle.cc:123

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: