9 #include "EvtGenBase/EvtSimpleRandomEngine.hh"
10 #include "EvtGenBase/EvtMTRandomEngine.hh"
11 #include "EvtGenBase/EvtRandom.hh"
12 #include "EvtGenBase/EvtVector4R.hh"
13 #include "EvtGenBase/EvtParticle.hh"
14 #include "EvtGenBase/EvtParticleFactory.hh"
15 #include "EvtGenBase/EvtPDL.hh"
16 #include "EvtGen/EvtGen.hh"
17 #include "EvtGenBase/EvtAbsRadCorr.hh"
18 #include "EvtGenBase/EvtDecayBase.hh"
20 #ifdef EVTGEN_EXTERNAL
21 #include "EvtGenExternal/EvtExternalGenList.hh"
33 void usage(
const char *cmd)
35 printf(
"Usage: %s -d <decayfile> -m <mother> -n <nevents> -f <datfile> -r <rootfile>\n",cmd);
39 int main(
int argc,
char* argv[]) {
41 std::string mother(
"B+");
43 std::string datfile(
"output.dat");
44 std::string decfile =(
"../DECAY_2010.DEC");
50 while ( (c = getopt(argc, argv,
"d:m:n:f:")) != EOF ) {
52 case 'm': mother = std::string(optarg);
break;
53 case 'n': N = atoi(optarg);
break;
54 case 'f': datfile = std::string(optarg);
break;
55 case 'd': decfile = std::string(optarg);
break;
66 eng =
new EvtMTRandomEngine();
71 EvtRandom::setRandomEngine(eng);
74 std::list<EvtDecayBase*> extraModels;
76 #ifdef EVTGEN_EXTERNAL
78 radCorrEngine = genList.getPhotosModel();
79 extraModels = genList.getListOfModels();
82 EvtGen myGenerator(decfile.c_str(),
"../evt.pdl",eng,
83 radCorrEngine, &extraModels);
87 EvtId id = EvtPDL::getId(mother);
91 ofstream df(datfile.c_str());
95 EvtVector4R p_init(EvtPDL::getMass(
id),0.0,0.0,0.0);
96 EvtParticle *root_part=EvtParticleFactory::particleFactory(
id,p_init);
98 myGenerator.generateDecay(root_part);
106 double qAB = (p0+p1).mass2();
107 double qBC = (p1+p2).mass2();
108 double qCA = (p2+p0).mass2();
110 df << qAB <<
" " << qBC <<
" " << qCA <<
" " << endl;
115 }
while(count++ < N);
EvtParticle * getDaug(int i)
EvtVector4R getP4Lab() const
void setDiagonalSpinDensity()