BOSS 7.0.8
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//
15#include <stdlib.h>
18#include "EvtGenBase/EvtPDL.hh"
21#include "EvtLambdac2pKpi.hh"
22#include <string>
23
24std::vector<std::vector<EvtVector4R> > EvtLambdac2pKpi::Evt;
26
27void EvtLambdac2pKpi::getName(std::string& model_name){
28
29 model_name="Lambdac2pKpi";
30
31}
32
34
35 return new EvtLambdac2pKpi;
36
37}
38
39
41
42 // check that there are 0 arguments
43 checkNArg(0);
44 bool idp = getDaugs()[0]==EvtPDL::getId(std::string("p+")) || getDaugs()[0]==EvtPDL::getId(std::string("anti-p-"));
45 bool idk = getDaugs()[1]==EvtPDL::getId(std::string("K+")) || getDaugs()[1]==EvtPDL::getId(std::string("K-")) || getDaugs()[1]==EvtPDL::getId(std::string("K_S0"));;
46 bool idpi = getDaugs()[2]==EvtPDL::getId(std::string("pi+")) || getDaugs()[2]==EvtPDL::getId(std::string("pi-"))|| getDaugs()[2]==EvtPDL::getId(std::string("pi0"));
47 if(!(idp && idk && idpi ) ){std::cout<<"EvtLambdac2pKpi: the daughter sequence should be p K pi"<<std::endl;abort();}
48 std::vector<EvtVector4R> vp4;
49 m_inputFileName=getenv("BESEVTGENROOT");
50 m_inputFileName +="/src/EvtGen/EvtGenModels/EvtLambdac2pKpi.dat";
51 // m_inputFileName="EvtLambdac2pKpi.dat";
52 m_inputFile.open(m_inputFileName.c_str());
53 if (!m_inputFile){
54 cout << "EvtLambdac2pKpi: PROBLEMS OPENING FILE "
55 << m_inputFileName << endl;
56 exit(0);
57 }
58 nParticles=3; //number of daughters
59 Ntot = 100000; //number of events stored in the file m_puthFileName
60 Evt.clear();
61 for(int h=0;h<Ntot;h++){
62 vp4.clear();
63 for (int i = 0; i < nParticles; i++){
64 EvtVector4R p4;
65 m_inputFile >> pxParticle; p4.set(1,pxParticle);
66 m_inputFile >> pyParticle; p4.set(2,pyParticle);
67 m_inputFile >> pzParticle; p4.set(3,pzParticle);
68 m_inputFile >> eParticle; p4.set(0,eParticle);
69 vp4.push_back(p4);
70 }
71 Evt.push_back(vp4);
72 }
73
74}
75
77
78 noProbMax();
79
80}
81
83
85 int rdm= (int)Evt.size()*EvtRandom::Flat(0.0,1.0);
86 //debugging
87 //std::cout<<"rdm= "<<rdm<<" "<<Evt.size()<<std::endl;
88
89 if(Evt.size()==0) {std::cout<<"EvtLambdac2pKpi: out of stored file record"<<std::endl;abort();}
90 for(int i=0;i<nParticles;i++){
91 EvtParticle* daug=p->getDaug(i);
92 daug->init(daug->getId(),Evt[rdm][i]);
93 }
94 // std::cout<<p->getDaug(0)->getP4()<<p->getDaug(1)->getP4()<<p->getDaug(2)->getP4()<<std::endl;
95
96 return ;
97}
98
99
100
*********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
void noProbMax()
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
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:287
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtId getId() const
Definition: EvtParticle.cc:113
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:85
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition: EvtRandom.cc:74
void set(int i, double d)
Definition: EvtVector4R.hh:183