BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtRexc.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// pingrg-2014-10-16
3// Model REXC : used to decay vgam to the final state as in ConExc model
4// Name: REXC: R-scan exclusive decay model
5// Decay cards:
6// Decay vgam
7// 1 REXC;
8// Enddecay
9//------------------------------------------------------------------------
10
11#include "EvtRexc.hh"
19#include <stdlib.h>
20#include <string>
21
23
24void EvtRexc::getName( std::string& model_name ) {
25
26 model_name = "REXC"; // R-scan exclusive decay model
27}
28
30
32
33 // check that there are 0 arguments
34 checkNArg( 0 );
35 myconexc = new EvtConExc();
36}
37
39
41 double mhds = p->mass();
42 int mymode = EvtConExc::conexcmode;
43 myconexc->init_mode( mymode );
44 // std::cout<<"EvtRexc:: A selected mode is "<<mymode<<" with Mhds= "<<mhds<<std::endl;
45 // //debugging
46 int _ndaugs = myconexc->getNdaugs();
47 EvtId* daugs = myconexc->getDaugId();
48 // debugging
49 /*
50 std::cout<<"Ndaugs= "<<_ndaugs<<std::endl;
51 for(int i=0;i<_ndaugs;i++){
52 std::cout<<i<<" "<<EvtPDL::getStdHep(daugs[i])<<std::endl;
53 }
54 */
55Loop:
56 double totmass = 0;
57 p->makeDaughters( _ndaugs, daugs );
58 for ( int i = 0; i < _ndaugs; i++ )
59 {
60 EvtParticle* di = p->getDaug( i );
61 double xmi = EvtPDL::getMass( di->getId() );
62 di->setMass( xmi );
63 totmass += xmi;
64 }
65 if ( totmass > p->mass() ) goto Loop;
66
67 double weight = p->initializePhaseSpace( _ndaugs, daugs );
68 // std::cout<<"weight= "<<weight<<std::endl;
69 if ( EvtConExc::multimode == 1 && _ndaugs == 2 )
70 {
71 _daugs[0] = daugs[0];
72 _daugs[1] = daugs[1];
73 EvtVector4R pd1 = p->getDaug( 0 )->getP4();
74 double _cms = EvtPDL::getMass( p->getId() );
75 EvtVector4R pcm( _cms, 0, 0, 0 );
76 bool bang = hadron_angle_sampling( pd1, pcm );
77 if ( !bang ) goto Loop;
78 }
79 else if ( ( 2.5 < mhds && mhds < 3.092 || mhds > 3.1012 ) && !angularSampling( p ) )
80 goto Loop;
81 return;
82}
83
85 bool tagp, tagk;
86 tagk = 0;
87 tagp = 0;
88 int nds = par->getNDaug();
89 for ( int i = 0; i < par->getNDaug(); i++ )
90 {
91 EvtId di = par->getDaug( i )->getId();
92 EvtVector4R p4i = par->getDaug( i )->getP4Lab();
93 int pdgcode = EvtPDL::getStdHep( di );
94 double alpha = 1;
95 double angmax = 1 + alpha;
96 double costheta = cos( p4i.theta() );
97 double ang = 1 + alpha * costheta * costheta;
98 double xratio = ang / angmax;
99 double xi = EvtRandom::Flat( 0., 1 );
100 // std::cout<<"pdgcode "<<pdgcode<<std::endl;
101 // std::cout<<ang<<" "<<angmax<<" "<<xi<<" "<<xratio<<std::endl;
102 if ( xi > xratio ) return false;
103 } // loop over duaghters
104 return true;
105}
106
107double EvtRexc::baryonAng( double mx ) {
108 double mp = 0.938;
109 double u = 0.938 / mx;
110 u = u * u;
111 double u2 = ( 1 + u ) * ( 1 + u );
112 double uu = u * ( 1 + 6 * u );
113 double alpha = ( u2 - uu ) / ( u2 + uu );
114 return alpha;
115}
116
118 EvtVector4R pbst = -1 * pcm;
119 pbst.set( 0, pcm.get( 0 ) );
120 EvtVector4R p4i = boostTo( ppi, pbst );
121 EvtSpinType::spintype type0 = EvtPDL::getSpinType( _daugs[0] );
122 EvtSpinType::spintype type1 = EvtPDL::getSpinType( _daugs[1] );
123 if ( type0 == EvtSpinType::SCALAR && type1 == EvtSpinType::SCALAR )
124 {
125 bool msn_ang = meson_sampling( pcm, p4i );
126 return msn_ang;
127 }
128 else if ( type0 == EvtSpinType::VECTOR && type1 == EvtSpinType::SCALAR ||
129 type1 == EvtSpinType::VECTOR && type0 == EvtSpinType::SCALAR )
130 {
131 bool msn_ang = VP_sampling( pcm, p4i );
132 return msn_ang;
133 }
134 return true;
135}
136
138 EvtHelSys angles( pcm, pi ); // using helicity sys.angles
139 double theta = angles.getHelAng( 1 );
140 double phi = angles.getHelAng( 2 );
141 double costheta = cos( theta ); // using helicity angles in parent system
142
143 double pm = EvtRandom::Flat( 0., 1 );
144 double ang = 1 - costheta * costheta;
145 if ( pm < ang / 1. ) { return true; }
146 else { return false; }
147}
148
150 EvtHelSys angles( pcm, pi ); // using helicity sys.angles
151 double theta = angles.getHelAng( 1 );
152 double phi = angles.getHelAng( 2 );
153 double costheta = cos( theta ); // using helicity angles in parent system
154
155 double pm = EvtRandom::Flat( 0., 1 );
156 double ang = 1 + costheta * costheta;
157 if ( pm < ang / 2. ) { return true; }
158 else { return false; }
159}
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
double alpha
double pi
double mp
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
Definition KarFin.h:34
static int conexcmode
Definition EvtConExc.hh:214
static int multimode
Definition EvtConExc.hh:214
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
double getHelAng(int i)
Definition EvtHelSys.cc:52
Definition EvtId.hh:27
static int getStdHep(EvtId id)
Definition EvtPDL.hh:61
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
static double getMass(EvtId i)
Definition EvtPDL.hh:44
void setMass(double m)
void makeDaughters(int ndaug, EvtId *id)
EvtVector4R getP4Lab()
EvtId getId() const
const EvtVector4R & getP4() const
int getNDaug() const
EvtParticle * getDaug(int i)
double mass() const
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition EvtRandom.cc:69
virtual ~EvtRexc()
Definition EvtRexc.cc:22
void init()
Definition EvtRexc.cc:31
bool hadron_angle_sampling(EvtVector4R ppi, EvtVector4R pcm)
Definition EvtRexc.cc:117
bool VP_sampling(EvtVector4R pcm, EvtVector4R pi)
Definition EvtRexc.cc:149
void decay(EvtParticle *p)
Definition EvtRexc.cc:40
EvtDecayBase * clone()
Definition EvtRexc.cc:29
bool angularSampling(EvtParticle *par)
Definition EvtRexc.cc:84
void initProbMax()
Definition EvtRexc.cc:38
EvtRexc()
Definition EvtRexc.hh:22
double baryonAng(double mx)
Definition EvtRexc.cc:107
bool meson_sampling(EvtVector4R pcm, EvtVector4R pi)
Definition EvtRexc.cc:137
void getName(std::string &name)
Definition EvtRexc.cc:24
double get(int i) const
void set(int i, double d)
double theta()