BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtLambdac2pKpi.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Modification history:
4//
5// pingrg January 22, 2014 Module created
6//
7// -------- input file must take the form like:
8// [number of final state particles in this event]
9// [PDG ID of particle 1] [P_x] [P_y] [P_z] [E]
10// [PDG ID of particle 2] [P_x] [P_y] [P_z] [E]
11// and so on
12//------------------------------------------------------------------------
13//
14#include "EvtLambdac2pKpi.hh"
21#include <stdlib.h>
22#include <string>
23
24std::vector<std::vector<EvtVector4R>> EvtLambdac2pKpi::Evt;
26
27void EvtLambdac2pKpi::getName( std::string& model_name ) { model_name = "Lambdac2pKpi"; }
28
30
32
33 // check that there are 0 arguments
34 checkNArg( 0 );
35 bool idp = getDaugs()[0] == EvtPDL::getId( std::string( "p+" ) ) ||
36 getDaugs()[0] == EvtPDL::getId( std::string( "anti-p-" ) );
37 bool idk = getDaugs()[1] == EvtPDL::getId( std::string( "K+" ) ) ||
38 getDaugs()[1] == EvtPDL::getId( std::string( "K-" ) ) ||
39 getDaugs()[1] == EvtPDL::getId( std::string( "K_S0" ) );
40 ;
41 bool idpi = getDaugs()[2] == EvtPDL::getId( std::string( "pi+" ) ) ||
42 getDaugs()[2] == EvtPDL::getId( std::string( "pi-" ) ) ||
43 getDaugs()[2] == EvtPDL::getId( std::string( "pi0" ) );
44 if ( !( idp && idk && idpi ) )
45 {
46 std::cout << "EvtLambdac2pKpi: the daughter sequence should be p K pi" << std::endl;
47 abort();
48 }
49 std::vector<EvtVector4R> vp4;
50 m_inputFileName = getenv( "BESEVTGENROOT" );
51 m_inputFileName += "/src/EvtGen/EvtGenModels/EvtLambdac2pKpi.dat";
52 // m_inputFileName="EvtLambdac2pKpi.dat";
53 m_inputFile.open( m_inputFileName.c_str() );
54 if ( !m_inputFile )
55 {
56 cout << "EvtLambdac2pKpi: PROBLEMS OPENING FILE " << m_inputFileName << endl;
57 exit( 0 );
58 }
59 nParticles = 3; // number of daughters
60 Ntot = 100000; // number of events stored in the file m_puthFileName
61 Evt.clear();
62 for ( int h = 0; h < Ntot; h++ )
63 {
64 vp4.clear();
65 for ( int i = 0; i < nParticles; i++ )
66 {
67 EvtVector4R p4;
68 m_inputFile >> pxParticle;
69 p4.set( 1, pxParticle );
70 m_inputFile >> pyParticle;
71 p4.set( 2, pyParticle );
72 m_inputFile >> pzParticle;
73 p4.set( 3, pzParticle );
74 m_inputFile >> eParticle;
75 p4.set( 0, eParticle );
76 vp4.push_back( p4 );
77 }
78 Evt.push_back( vp4 );
79 }
80}
81
83
85
86 double weight = p->initializePhaseSpace( getNDaug(), getDaugs() );
87 int rdm = (int)Evt.size() * EvtRandom::Flat( 0.0, 1.0 );
88 // debugging
89 // std::cout<<"rdm= "<<rdm<<" "<<Evt.size()<<std::endl;
90
91 if ( Evt.size() == 0 )
92 {
93 std::cout << "EvtLambdac2pKpi: out of stored file record" << std::endl;
94 abort();
95 }
96 for ( int i = 0; i < nParticles; i++ )
97 {
98 EvtParticle* daug = p->getDaug( i );
99 daug->init( daug->getId(), Evt[rdm][i] );
100 }
101 // std::cout<<p->getDaug(0)->getP4()<<p->getDaug(1)->getP4()<<p->getDaug(2)->getP4()<<std::endl;
102
103 return;
104}
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
Definition KarFin.h:34
EvtId * getDaugs()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
void decay(EvtParticle *p)
EvtDecayBase * clone()
virtual ~EvtLambdac2pKpi()
void getName(std::string &name)
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtId getId() const
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition EvtRandom.cc:69
void set(int i, double d)