CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
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
22#include <stdlib.h>
25#include "EvtGenBase/EvtPDL.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
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)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
double getArg(int j)
void noProbMax()
EvtId getParentId()
Definition: EvtDecayBase.hh:60
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.hh:61
EvtVector4R getP4Lab()
Definition: EvtParticle.cc:683
const EvtVector4R & getP4() const
Definition: EvtParticle.cc:121
int getNDaug() const
Definition: EvtParticle.cc:125
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:73
void initProbMax()
Definition: EvtRhoPi.cc:69
EvtVector4R GetDaugMomLab(int i)
Definition: EvtRhoPi.hh:49
void getName(std::string &name)
Definition: EvtRhoPi.cc:47
void init()
Definition: EvtRhoPi.cc:60
void decay(EvtParticle *p)
Definition: EvtRhoPi.cc:78
EvtRhoPi()
Definition: EvtRhoPi.hh:33
virtual ~EvtRhoPi()
Definition: EvtRhoPi.cc:45
EvtDecayBase * clone()
Definition: EvtRhoPi.cc:53
double AmplitudeSquare(double ResonanceMass, double ResonanceWidth, double r1, double r2, double phase1, double phase2)
Definition: EvtRhoPi.cc:132
Definition: EvtVVS.hh:35
double amps()
Definition: EvtVVS.cc:71