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

#include <EvtFSPick.hh>

Public Member Functions

 EvtFSPick (EvtParticle *par)
 
virtual ~EvtFSPick ()
 
void FSPick (EvtParticle *par)
 
std::vector< EvtParticle * > getFS ()
 
void setFinalStatePar (std::vector< std::string > vnames)
 
std::vector< EvtVector4RgetP4 ()
 
std::vector< EvtVector4RgetP4Lab ()
 
int getIndex (EvtId eid)
 

Detailed Description

Definition at line 38 of file EvtFSPick.hh.

Constructor & Destructor Documentation

◆ EvtFSPick()

EvtFSPick::EvtFSPick ( EvtParticle * par)
inline

Definition at line 44 of file EvtFSPick.hh.

44 {
45 root_par = par;
46 _EvtFS.clear();
47 _vnames.clear();
48 _vId.clear();
49 _fsid.clear();
50 FSPick(root_par);
51}
void FSPick(EvtParticle *par)
Definition EvtFSPick.cc:25

◆ ~EvtFSPick()

virtual EvtFSPick::~EvtFSPick ( )
inlinevirtual

Definition at line 54 of file EvtFSPick.hh.

54{}

Member Function Documentation

◆ FSPick()

void EvtFSPick::FSPick ( EvtParticle * par)

Definition at line 25 of file EvtFSPick.cc.

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

Referenced by EvtFSPick(), and FSPick().

◆ getFS()

std::vector< EvtParticle * > EvtFSPick::getFS ( )
inline

Definition at line 57 of file EvtFSPick.hh.

57{return _EvtFS;}

◆ getIndex()

int EvtFSPick::getIndex ( EvtId eid)

Definition at line 85 of file EvtFSPick.cc.

85 {
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}
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:287

Referenced by getP4(), and getP4Lab().

◆ getP4()

std::vector< EvtVector4R > EvtFSPick::getP4 ( )

Definition at line 61 of file EvtFSPick.cc.

61 {
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}
int getIndex(EvtId eid)
Definition EvtFSPick.cc:85

◆ getP4Lab()

std::vector< EvtVector4R > EvtFSPick::getP4Lab ( )

Definition at line 73 of file EvtFSPick.cc.

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

◆ setFinalStatePar()

void EvtFSPick::setFinalStatePar ( std::vector< std::string > vnames)

Definition at line 45 of file EvtFSPick.cc.

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

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