BOSS 8.0.0
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
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}
46
47void EvtFSPick::setFinalStatePar( std::vector<std::string> vnames ) {
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}
63
64std::vector<EvtVector4R> EvtFSPick::getP4() {
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}
76
77std::vector<EvtVector4R> EvtFSPick::getP4Lab() {
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}
89
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}
std::vector< EvtVector4R > getP4Lab()
Definition EvtFSPick.cc:77
int getIndex(EvtId eid)
Definition EvtFSPick.cc:90
void setFinalStatePar(std::vector< std::string > vnames)
Definition EvtFSPick.cc:47
std::vector< EvtVector4R > getP4()
Definition EvtFSPick.cc:64
void FSPick(EvtParticle *par)
Definition EvtFSPick.cc:24
Definition EvtId.hh:27
static int getStdHep(EvtId id)
Definition EvtPDL.hh:61
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272
EvtId getId() const
int getNDaug() const
EvtParticle * getDaug(int i)