BOSS 8.0.0
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 37 of file EvtFSPick.hh.

Constructor & Destructor Documentation

◆ EvtFSPick()

EvtFSPick::EvtFSPick ( EvtParticle * par)
inline

Definition at line 41 of file EvtFSPick.hh.

41 {
42 root_par = par;
43 _EvtFS.clear();
44 _vnames.clear();
45 _vId.clear();
46 _fsid.clear();
47 FSPick( root_par );
48 }
void FSPick(EvtParticle *par)
Definition EvtFSPick.cc:24

◆ ~EvtFSPick()

virtual EvtFSPick::~EvtFSPick ( )
inlinevirtual

Definition at line 51 of file EvtFSPick.hh.

51{}

Member Function Documentation

◆ FSPick()

void EvtFSPick::FSPick ( EvtParticle * par)

Definition at line 24 of file EvtFSPick.cc.

24 {
25
26 int ndaug = par->getNDaug();
27 EvtId eid = par->getId();
28 if ( ndaug < 2 && EvtPDL::getStdHep( eid ) != -22 )
29 {
30 _EvtFS.push_back( par );
31 _fsid.push_back( eid );
32 // std::cout<<"I get FS "<<EvtPDL::getStdHep(eid)<<std::endl;
33 }
34 else
35 {
36
37 int ND = 0;
38 EvtParticle* theD;
39 for ( int i = 0; i < ndaug; i++ )
40 {
41 EvtParticle* theDaug = par->getDaug( i );
42 FSPick( theDaug );
43 }
44 }
45}
static int getStdHep(EvtId id)
Definition EvtPDL.hh:61
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 54 of file EvtFSPick.hh.

54{ return _EvtFS; }

◆ getIndex()

int EvtFSPick::getIndex ( EvtId eid)

Definition at line 90 of file EvtFSPick.cc.

90 {
91 for ( int i = 0; i < _vId.size(); i++ )
92 {
93 EvtId pid = _fsid[i];
94 if ( eid == pid )
95 {
96 EvtId did = EvtPDL::getId( "d" );
97 _fsid[i] = did;
98 return i;
99 }
100 }
101 std::cout << "EvtFSPick::Cannot find the particle " << EvtPDL::getStdHep( eid )
102 << " in the generated final state" << std::endl;
103 abort();
104}
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272

Referenced by getP4(), and getP4Lab().

◆ getP4()

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

Definition at line 64 of file EvtFSPick.cc.

64 {
65 EvtVector4R ptep;
66 int nfs = _vnames.size();
67 std::vector<EvtVector4R> vp4;
68 for ( int i = 0; i < nfs; i++ )
69 {
70 int xid = getIndex( _vId[i] );
71 ptep = _EvtFS[xid]->getP4();
72 vp4.push_back( ptep );
73 }
74 return vp4;
75}
int getIndex(EvtId eid)
Definition EvtFSPick.cc:90

◆ getP4Lab()

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

Definition at line 77 of file EvtFSPick.cc.

77 {
78 EvtVector4R ptep;
79 int nfs = _vnames.size();
80 std::vector<EvtVector4R> vp4;
81 for ( int i = 0; i < nfs; i++ )
82 {
83 int xid = getIndex( _vId[i] );
84 ptep = _EvtFS[xid]->getP4Lab();
85 vp4.push_back( ptep );
86 }
87 return vp4;
88}

◆ setFinalStatePar()

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

Definition at line 47 of file EvtFSPick.cc.

47 {
48 if ( vnames.size() != _EvtFS.size() )
49 {
50 std::cout << "EvtFSPick::The number in final state is inconsistent" << std::endl;
51 abort();
52 }
53 for ( int i = 0; i < vnames.size(); i++ )
54 {
55
56 _vnames.push_back( vnames[i] );
57 EvtId eid = EvtPDL::getId( std::string( vnames[i] ) );
58 _vId.push_back( eid );
59
60 // std::cout<<"FS= "<<EvtPDL::getStdHep(_vId[i])<<std::endl;
61 }
62}

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