BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtRhoPi.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: EvtRhoPi.cc
12//
13// Description: Jpsi or psi(2S) decays into 3 pions via rho(1--)pi
14//
15// Modification history:
16//
17// Ping R.-G. Apr., 2007 Module created
18//
19//------------------------------------------------------------------------
20
21#include "EvtGenBase/EvtPatches.hh"
22#include <stdlib.h>
23#include "EvtGenBase/EvtParticle.hh"
24#include "EvtGenBase/EvtGenKine.hh"
25#include "EvtGenBase/EvtPDL.hh"
26#include "EvtGenBase/EvtVector4C.hh"
27#include "EvtGenBase/EvtVector4R.hh"
28#include "EvtGenBase/EvtTensor4C.hh"
29#include "EvtGenBase/EvtDiracParticle.hh"
30#include "EvtGenBase/EvtScalarParticle.hh"
31#include "EvtGenBase/EvtVectorParticle.hh"
32#include "EvtGenBase/EvtTensorParticle.hh"
33#include "EvtGenBase/EvtPhotonParticle.hh"
34#include "EvtGenBase/EvtNeutrinoParticle.hh"
35#include "EvtGenBase/EvtStringParticle.hh"
36#include "EvtGenBase/EvtRaritaSchwingerParticle.hh"
37#include "EvtGenBase/EvtHighSpinParticle.hh"
38#include "EvtGenBase/EvtReport.hh"
39#include "EvtGenModels/EvtRhoPi.hh"
40#include "EvtGenBase/EvtRandom.hh"
41#include "EvtGenModels/EvtVVS.hh"
42#include <string>
43using namespace std; //::endl;
44
46
47void EvtRhoPi::getName(std::string& model_name){
48
49 model_name="RhoPi";
50
51}
52
54
55 return new EvtRhoPi;
56
57}
58
59
60void EvtRhoPi::init(){
61
62// checkNArg(6);
64// if ( parenttype == EvtSpinType::SCALAR ){
65// report(ERROR,"EvtGen")<<"Scalar decays with flat distribution"<<endl;
66// ::abort();
67// }
68}
70 noProbMax();
71
72}
73
74
75static int nrun=1;
76static double max_amps=0.0;
77
79
80///// default use rho(770) as the intermediate state, this set parameter will generate the symmetric momentum distribution for pi+ pi-.
81double ResonanceMass =0.7710;
82double ResonanceWidth=0.1492;
83double r1 =0.9;
84double phase1 =0;
85double r2 =1.1;
86double phase2 =1.5;
87 if(getNArg()>0){
88 ResonanceMass =getArg(0);
89 ResonanceWidth=getArg(1);
90 r1 =getArg(2);
91 phase1 =getArg(3);
92 r2 =getArg(4);
93 phase2 =getArg(5);
94 }
95double amps,SamAmps,rd1;
96// calculated the max amplitude square in 20000 events, is it enough larger?
97 if(nrun==1){
98 int ir,nd;
99 for(ir=0;ir<=20000;ir++){
101 int nd=p->getNDaug(),i;
102 _nd=nd;
103 for(i=0;i<=nd-1;i++){
104 _p4Lab[i]=p->getDaug(i)->getP4Lab();
105 _p4CM[i]=p->getDaug(i)->getP4();
106 }
107 amps=AmplitudeSquare(ResonanceMass,ResonanceWidth,r1,r2,phase1,phase2);
108 if(amps>max_amps) max_amps=amps*1.01;
109 nrun++;
110 }
111 }
112if(max_amps==0.0) {report(ERROR,"EvtGen")<<"The decay amplitude square should be positive number"<<endl;abort();}
113//cout<<"max_amp="<<max_amps<<endl;
114
115
116loop:
118 int i;
119 for(i=0;i<=p->getNDaug()-1;i++){
120 _p4Lab[i]=p->getDaug(i)->getP4Lab();
121 _p4CM[i]=p->getDaug(i)->getP4();
122 }
123// Put phase space results into the daughters.
124 amps=AmplitudeSquare(ResonanceMass,ResonanceWidth,r1,r2,phase1,phase2);
125 SamAmps=amps/max_amps;
126 rd1=EvtRandom::Flat(0.0, 1.0);
127 if(rd1>=SamAmps) goto loop;
128 return ;
129}
130
131
132double EvtRhoPi::AmplitudeSquare(double ResonanceMass, double ResonanceWidth,double r1,double
133r2,double phase1,double phase2){
137 VVS Jpsi2rhopi(dp1,dp2,dp3,ResonanceMass,ResonanceWidth,r1,r2,phase1,phase2);
138 return Jpsi2rhopi.amps();
139
140 }
141
ostream & report(Severity severity, const char *facility)
static EvtSpinType::spintype getSpinType(EvtId i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
double AmplitudeSquare(double ResonanceMass, double ResonanceWidth, double r1, double r2, double phase1, double phase2)