BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipi.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: Etap2gpipi.cc
12//
13// Description: Model provided by user, see the mannual
14//
15// Modification history:
16//
17// Ping R.-G. December, 2006 Module created
18// qinlq Sep., 2011 Module created
19//
20//------------------------------------------------------------------------
21
22#include "EvtGenBase/EvtPatches.hh"
23#include <stdlib.h>
24#include "EvtGenBase/EvtParticle.hh"
25#include "EvtGenBase/EvtGenKine.hh"
26#include "EvtGenBase/EvtPDL.hh"
27#include "EvtGenBase/EvtVector4C.hh"
28#include "EvtGenBase/EvtVector4R.hh"
29#include "EvtGenBase/EvtTensor4C.hh"
30#include "EvtGenBase/EvtDiracParticle.hh"
31#include "EvtGenBase/EvtScalarParticle.hh"
32#include "EvtGenBase/EvtVectorParticle.hh"
33#include "EvtGenBase/EvtTensorParticle.hh"
34#include "EvtGenBase/EvtPhotonParticle.hh"
35#include "EvtGenBase/EvtNeutrinoParticle.hh"
36#include "EvtGenBase/EvtStringParticle.hh"
37#include "EvtGenBase/EvtRaritaSchwingerParticle.hh"
38#include "EvtGenBase/EvtHighSpinParticle.hh"
39#include "EvtGenBase/EvtReport.hh"
40#include "EvtGenModels/EvtEtap2gpipi.hh"
41#include "EvtGenBase/EvtRandom.hh"
42#include <string>
43using namespace std; //::endl;
44
46
47void EvtEtap2gpipi::getName(std::string& model_name){
48
49 model_name="Etap2gpipi";
50
51}
52
54 return new EvtEtap2gpipi;
55}
56
57
59 // check that there are 0 arguments
60 checkNArg(1);
61 checkNDaug(3);
63}
64
65
67 noProbMax();
68}
69
70
71int EvtEtap2gpipi::nrun=1;
72double EvtEtap2gpipi::max_amps=0.0;
73
75
76double amps,SamAmps,rd1;
77
78// calculated the max amplitude square in 20000 events, is it enough larger?
79
80 if(nrun==1){
81 int ir,nd;
82 for(ir=0;ir<=2000000;ir++){
83 loop0:
85 int nd=p->getNDaug(),i;
86 _nd=nd;
87 for(i=0;i<=nd-1;i++){
88 _p4Lab[i]=p->getDaug(i)->getP4Lab();
89 _p4CM[i]=p->getDaug(i)->getP4();
90 }
91 amps=AmplitudeSquare();
92 if(amps<0) goto loop0;
93 if(amps>max_amps) max_amps=amps*1.01;
94
95 if(nrun<2){//check decay card
96 EvtId pid0= p->getId();//etaprime
97 EvtId pid1= p->getDaug(0)->getId();//pi+
98 EvtId pid2= p->getDaug(1)->getId();//pi-
99 EvtId pid3= p->getDaug(2)->getId();//gamma
100 if(pid0!= EvtPDL::getId("eta'")) { std::cout<<"Etap2gpipi need specify the parent as etaprime"<<std::endl;abort();}
101 if(pid3!= EvtPDL::getId("gamma")) { std::cout<<"Etap2gpipi need specify the daughters as pi+ pi- gamma"<<std::endl;abort();}
102 }
103
104 nrun++;
105 }
106 }
107
108
109
110if(max_amps==0.0) {report(ERROR,"EvtGen")<<"The decay amplitude square should be positive number"<<endl;abort();}
111
112
113loop:
115 int i;
116 for(i=0;i<=p->getNDaug()-1;i++){
117 _p4Lab[i]=p->getDaug(i)->getP4Lab();
118 _p4CM[i]=p->getDaug(i)->getP4();
119 }
120 amps=AmplitudeSquare();
121 if(amps < 0) goto loop;
122 SamAmps=amps/max_amps;
123 rd1=EvtRandom::Flat(0.0, 1.0);
124 if(rd1>=SamAmps) goto loop;
125 return ;
126}
127
128
ostream & report(Severity severity, const char *facility)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtSpinType::spintype getSpinType(EvtId i)
static EvtId getId(const std::string &name)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)