BOSS
6.6.4.p03
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>
24
#include "
EvtGenBase/EvtDecayTag.hh
"
25
26
using
std::endl;
27
using
std::fstream;
28
29
void
EvtDecayTag::makeTag
(
EvtParticle
* par){
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
76
int
EvtDecayTag::TagIndex
(
EvtId
pid){
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
102
int
EvtDecayTag::getModeTag
(){
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
}
129
130
int
EvtDecayTag::getMultTag
(){
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
}
146
147
int
EvtDecayTag::getHdrdBase
(
int
index){
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
}
EvtDecayTag.hh
EvtDecayTag::getMultTag
int getMultTag()
Definition:
EvtDecayTag.cc:130
EvtDecayTag::makeTag
void makeTag(EvtParticle *par)
Definition:
EvtDecayTag.cc:29
EvtDecayTag::getHdrdBase
int getHdrdBase(int index)
Definition:
EvtDecayTag.cc:147
EvtDecayTag::getModeTag
int getModeTag()
Definition:
EvtDecayTag.cc:102
EvtDecayTag::TagIndex
int TagIndex(EvtId pid)
Definition:
EvtDecayTag.cc:76
EvtId
Definition:
EvtId.hh:27
EvtPDL::getStdHep
static int getStdHep(EvtId id)
Definition:
EvtPDL.hh:56
EvtParticle
Definition:
EvtParticle.hh:42
EvtParticle::getId
EvtId getId() const
Definition:
EvtParticle.cc:113
EvtParticle::getNDaug
int getNDaug() const
Definition:
EvtParticle.cc:125
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition:
EvtParticle.cc:85
EvtParticle::getChannel
int getChannel() const
Definition:
EvtParticle.cc:123
source
Generator
BesEvtGen
BesEvtGen-00-01-94
src
EvtGen
EvtGenBase
EvtDecayTag.cc
Generated by
1.9.6