BOSS 8.0.0
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 38 of file EvtDecayTag.hh.

Constructor & Destructor Documentation

◆ EvtDecayTag()

EvtDecayTag::EvtDecayTag ( EvtParticle * par)
inline

Definition at line 42 of file EvtDecayTag.hh.

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

◆ ~EvtDecayTag()

virtual EvtDecayTag::~EvtDecayTag ( )
inlinevirtual

Definition at line 51 of file EvtDecayTag.hh.

51{}

Member Function Documentation

◆ getHdrdBase()

int EvtDecayTag::getHdrdBase ( int index)

Definition at line 172 of file EvtDecayTag.cc.

172 {
173 int ten = 10;
174 int base;
175 if ( index == 0 || index >= 100 && index < 1000 ) { return index; }
176 else
177 {
178 base = index * ten;
179 return getHdrdBase( base );
180 }
181}
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 110 of file EvtDecayTag.cc.

110 {
111 // get ConExc 74110 mode selected index
112 std::vector<int> intFlag = root_par->getIntFlag();
113 if ( intFlag.size() > 0 )
114 {
115 if ( intFlag[0] == 74110 || intFlag[0] == -100 ) return intFlag[1];
116 }
117
118 /**
119 * coding root_parent_mode * 10^9 + daug_0*10^6 + daug_1*10^3
120 **/
121 double seg0, seg1, seg2;
122
123 int three = 1000;
124 int six = 1000000;
125 int themode = 1000000000;
126 //---debugging
127 // for(int im=0;im<_nmode.size();im++){std::cout<<"_nmode["<<im<<"]"<<_nmode[im]<<endl;;}
128
129 if ( _nmode.size() == 1 )
130 {
131 themode += _nmode[0] * six;
132 return themode;
133 }
134 else if ( _nmode.size() == 2 )
135 {
136 seg0 = _nmode[0] * six;
137 seg1 = _nmode[1] * three;
138 themode += seg0 + seg1;
139 return themode;
140 }
141 else if ( _nmode.size() >= 3 )
142 {
143 seg0 = _nmode[0] * six;
144 seg1 = _nmode[1] * three;
145 seg2 = _nmode[2];
146 themode += seg0 + seg1 + seg2;
147 return themode;
148 }
149
150 return 0; // pingrg
151}

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

153 {
154 /**
155 * 10 digit in the order: N_gamma, N_gamma, N_e, N_mu, N_pi,
156 * N_Kaon, N_p, N_Ks, N_Lambda,DecayType
157 **/
158 int thetag = 0;
159 for ( int i = 1; i < 9; i++ )
160 {
161 if ( _multiplicity[i] > 9 ) return 0;
162 }
163 for ( int i = 0; i < 9; i++ )
164 {
165 int ndx = 8 - i;
166 int dig = pow( 10, ndx );
167 thetag += dig * _multiplicity[i];
168 }
169 return thetag;
170}

◆ makeTag()

void EvtDecayTag::makeTag ( EvtParticle * par)

Definition at line 28 of file EvtDecayTag.cc.

28 {
29
30 int ndaug = par->getNDaug();
31 if ( ndaug < 2 )
32 {
33 EvtId id = par->getId();
34 int theTag = TagIndex( id );
35 _multiplicity[theTag]++;
36 }
37 else
38 {
39 //--
40 if ( par == root_par )
41 {
42 int theMode = root_par->getChannel();
43 _nmode.push_back( theMode );
44 }
45 //--
46 int ND = 0;
47 EvtParticle* theD;
48 for ( int i = 0; i < ndaug; i++ )
49 {
50 EvtParticle* theDaug = par->getDaug( i );
51 if ( par == root_par && theDaug->getNDaug() != 0 )
52 {
53 int theMode = theDaug->getChannel();
54 _nmode.push_back( theMode );
55 ND++;
56 theD = theDaug;
57 }
58
59 int id = EvtPDL::getStdHep( theDaug->getId() );
60 if ( id == 310 ) _multiplicity[6]++; // Ks
61 if ( id == 3122 ) _multiplicity[7]++; // Lambda or Lambdabar
62 makeTag( theDaug );
63 }
64 //-- for root particle decays into only one unstable particle, the flag1 further tag the
65 // third decay
66 if ( ND == 1 )
67 {
68 int NDD = theD->getNDaug();
69 for ( int i = 0; i < NDD; i++ )
70 {
71 EvtParticle* theDD = theD->getDaug( i );
72 if ( theDD->getNDaug() != 0 )
73 {
74 int ndd = theDD->getChannel();
75 _nmode.push_back( ndd );
76 break;
77 }
78 }
79 }
80 //-------------------
81 }
82}
int TagIndex(EvtId pid)
static int getStdHep(EvtId id)
Definition EvtPDL.hh:61
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 84 of file EvtDecayTag.cc.

84 {
85 /**
86 * gamma : 0
87 * e+/e- : 1
88 * mu+/- : 2
89 * pi+/- : 3
90 * K+/- : 4
91 * p+/- : 5
92 * Ks : 6
93 * Lambda: 7
94 * others: 8
95 **/
96
97 int id = EvtPDL::getStdHep( pid );
98 int absid = fabs( id );
99 if ( absid == 22 ) { return 0; } // photon
100 else if ( absid == 11 ) { return 1; } // electron
101 else if ( absid == 13 ) { return 2; } // muon
102 else if ( absid == 211 ) { return 3; } // pion
103 else if ( absid == 321 ) { return 4; } // Kaon
104 else if ( absid == 2212 ) { return 5; } // pronton / anti-proton
105 else if ( absid == 310 ) { return 6; } // Ks
106 else if ( absid == 3122 ) { return 7; } // Lambda / Lambdabar
107 else { return 8; }
108}

Referenced by makeTag().


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