BOSS
7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtFSPick.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.hh
12
//
13
// Description: Class to pick out the final state
14
//
15
// Modification history:
16
//
17
// Ping R.-G. December, 2011-Mar. Module created
18
//
19
//------------------------------------------------------------------------
20
//
21
22
#include "
EvtFSPick.hh
"
23
24
25
void
EvtFSPick::FSPick
(
EvtParticle
* par){
26
27
int
ndaug = par->
getNDaug
();
28
EvtId
eid=par->
getId
();
29
if
(ndaug < 2 &&
EvtPDL::getStdHep
(eid) != -22){
30
_EvtFS.push_back(par);
31
_fsid.push_back(eid);
32
// std::cout<<"I get FS "<<EvtPDL::getStdHep(eid)<<std::endl;
33
}
else
{
34
35
int
ND=0;
36
EvtParticle
*theD;
37
for
(
int
i=0;i<ndaug;i++){
38
EvtParticle
*theDaug = par->
getDaug
(i);
39
FSPick
(theDaug);
40
}
41
}
42
}
43
44
45
void
EvtFSPick::setFinalStatePar
(std::vector <std::string> vnames){
46
if
(vnames.size()!= _EvtFS.size())
47
{std::cout<<
"EvtFSPick::The number in final state is inconsistent"
<<std::endl;abort();}
48
for
(
int
i=0;i<vnames.size();i++){
49
50
_vnames.push_back(vnames[i]);
51
EvtId
eid =
EvtPDL::getId
(std::string(vnames[i]));
52
_vId.push_back(eid);
53
54
// std::cout<<"FS= "<<EvtPDL::getStdHep(_vId[i])<<std::endl;
55
}
56
57
}
58
59
60
61
std::vector <EvtVector4R>
EvtFSPick::getP4
(){
62
EvtVector4R
ptep;
63
int
nfs = _vnames.size();
64
std::vector <EvtVector4R> vp4;
65
for
(
int
i=0;i<nfs;i++) {
66
int
xid =
getIndex
(_vId[i]);
67
ptep= _EvtFS[xid]->getP4();
68
vp4.push_back(ptep);
69
}
70
return
vp4;
71
}
72
73
std::vector <EvtVector4R>
EvtFSPick::getP4Lab
(){
74
EvtVector4R
ptep;
75
int
nfs = _vnames.size();
76
std::vector <EvtVector4R> vp4;
77
for
(
int
i=0;i<nfs;i++) {
78
int
xid =
getIndex
(_vId[i]);
79
ptep= _EvtFS[xid]->getP4Lab();
80
vp4.push_back(ptep);
81
}
82
return
vp4;
83
}
84
85
int
EvtFSPick::getIndex
(
EvtId
eid){
86
for
(
int
i=0;i<_vId.size();i++){
87
EvtId
pid = _fsid[i];
88
if
( eid == pid ){
89
EvtId
did =
EvtPDL::getId
(
"d"
);
90
_fsid[i] = did;
91
return
i;
92
}
93
}
94
std::cout<<
"EvtFSPick::Cannot find the particle "
95
<<
EvtPDL::getStdHep
(eid)
96
<<
" in the generated final state"
<<std::endl;
97
abort();
98
}
EvtFSPick.hh
EvtFSPick::getP4Lab
std::vector< EvtVector4R > getP4Lab()
Definition
EvtFSPick.cc:73
EvtFSPick::getIndex
int getIndex(EvtId eid)
Definition
EvtFSPick.cc:85
EvtFSPick::setFinalStatePar
void setFinalStatePar(std::vector< std::string > vnames)
Definition
EvtFSPick.cc:45
EvtFSPick::getP4
std::vector< EvtVector4R > getP4()
Definition
EvtFSPick.cc:61
EvtFSPick::FSPick
void FSPick(EvtParticle *par)
Definition
EvtFSPick.cc:25
EvtId
Definition
EvtId.hh:27
EvtPDL::getStdHep
static int getStdHep(EvtId id)
Definition
EvtPDL.hh:56
EvtPDL::getId
static EvtId getId(const std::string &name)
Definition
EvtPDL.cc:287
EvtParticle
Definition
EvtParticle.hh:42
EvtParticle::getId
EvtId getId() const
Definition
EvtParticle.cc:112
EvtParticle::getNDaug
int getNDaug() const
Definition
EvtParticle.cc:124
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition
EvtParticle.cc:84
EvtVector4R
Definition
EvtVector4R.hh:29
7.1.1
Generator
BesEvtGen
BesEvtGen-00-04-28
src
EvtGen
EvtGenBase
EvtFSPick.cc
Generated by
1.12.0