BOSS 8.0.0
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
21#include "EvtRhoPi.hh"
40#include "EvtVVS.hh"
41#include <stdlib.h>
42#include <string>
43using namespace std; //::endl;
44
46
47void EvtRhoPi::getName( std::string& model_name ) { model_name = "RhoPi"; }
48
50
52
53 // checkNArg(6);
55 // if ( parenttype == EvtSpinType::SCALAR ){
56 // report(ERROR,"EvtGen")<<"Scalar decays with flat distribution"<<endl;
57 // ::abort();
58 // }
59}
61
62static int nrun = 1;
63static double max_amps = 0.0;
64
66
67 ///// default use rho(770) as the intermediate state, this set parameter will generate the
68 /// symmetric momentum distribution for pi+ pi-.
69 double ResonanceMass = 0.7710;
70 double ResonanceWidth = 0.1492;
71 double r1 = 0.9;
72 double phase1 = 0;
73 double r2 = 1.1;
74 double phase2 = 1.5;
75 if ( getNArg() > 0 )
76 {
77 ResonanceMass = getArg( 0 );
78 ResonanceWidth = getArg( 1 );
79 r1 = getArg( 2 );
80 phase1 = getArg( 3 );
81 r2 = getArg( 4 );
82 phase2 = getArg( 5 );
83 }
84 double amps, SamAmps, rd1;
85 // calculated the max amplitude square in 20000 events, is it enough larger?
86 if ( nrun == 1 )
87 {
88 int ir, nd;
89 for ( ir = 0; ir <= 20000; ir++ )
90 {
92 int nd = p->getNDaug(), i;
93 _nd = nd;
94 for ( i = 0; i <= nd - 1; i++ )
95 {
96 _p4Lab[i] = p->getDaug( i )->getP4Lab();
97 _p4CM[i] = p->getDaug( i )->getP4();
98 }
99 amps = AmplitudeSquare( ResonanceMass, ResonanceWidth, r1, r2, phase1, phase2 );
100 if ( amps > max_amps ) max_amps = amps * 1.01;
101 nrun++;
102 }
103 }
104 if ( max_amps == 0.0 )
105 {
106 report( ERROR, "EvtGen" ) << "The decay amplitude square should be positive number"
107 << endl;
108 abort();
109 }
110 // cout<<"max_amp="<<max_amps<<endl;
111
112loop:
114 int i;
115 for ( i = 0; i <= p->getNDaug() - 1; i++ )
116 {
117 _p4Lab[i] = p->getDaug( i )->getP4Lab();
118 _p4CM[i] = p->getDaug( i )->getP4();
119 }
120 // Put phase space results into the daughters.
121 amps = AmplitudeSquare( ResonanceMass, ResonanceWidth, r1, r2, phase1, phase2 );
122 SamAmps = amps / max_amps;
123 rd1 = EvtRandom::Flat( 0.0, 1.0 );
124 if ( rd1 >= SamAmps ) goto loop;
125 return;
126}
127
128double EvtRhoPi::AmplitudeSquare( double ResonanceMass, double ResonanceWidth, double r1,
129 double r2, double phase1, double phase2 ) {
130 EvtVector4R dp1 = GetDaugMomLab( 0 );
131 EvtVector4R dp2 = GetDaugMomLab( 1 );
132 EvtVector4R dp3 = GetDaugMomLab( 2 );
133 VVS Jpsi2rhopi( dp1, dp2, dp3, ResonanceMass, ResonanceWidth, r1, r2, phase1, phase2 );
134 return Jpsi2rhopi.amps();
135}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
double getArg(int j)
EvtId getParentId()
EvtId * getDaugs()
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
EvtVector4R getP4Lab()
const EvtVector4R & getP4() const
int getNDaug() const
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition EvtRandom.cc:69
void initProbMax()
Definition EvtRhoPi.cc:60
EvtVector4R GetDaugMomLab(int i)
Definition EvtRhoPi.hh:48
void getName(std::string &name)
Definition EvtRhoPi.cc:47
void init()
Definition EvtRhoPi.cc:51
void decay(EvtParticle *p)
Definition EvtRhoPi.cc:65
virtual ~EvtRhoPi()
Definition EvtRhoPi.cc:45
EvtDecayBase * clone()
Definition EvtRhoPi.cc:49
double AmplitudeSquare(double ResonanceMass, double ResonanceWidth, double r1, double r2, double phase1, double phase2)
Definition EvtRhoPi.cc:128
Definition EvtVVS.hh:34
double amps()
Definition EvtVVS.cc:71