EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
EvtBtoXsEtap.cpp
Go to the documentation of this file.
1
2/***********************************************************************
3* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4* *
5* This file is part of EvtGen. *
6* *
7* EvtGen is free software: you can redistribute it and/or modify *
8* it under the terms of the GNU General Public License as published by *
9* the Free Software Foundation, either version 3 of the License, or *
10* (at your option) any later version. *
11* *
12* EvtGen is distributed in the hope that it will be useful, *
13* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15* GNU General Public License for more details. *
16* *
17* You should have received a copy of the GNU General Public License *
18* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19***********************************************************************/
20
22
25#include "EvtGenBase/EvtPDL.hh"
29
30#include <stdlib.h>
31#include <string>
32using std::endl;
33
34std::string EvtBtoXsEtap::getName() const
35{
36 return "BTOXSETAP";
37}
38
40{
41 return new EvtBtoXsEtap;
42}
43
45{
46 // check that there are no arguments
47 checkNArg( 0 );
48
49 // check that there are only two daughters
50 checkNDaug( 2 );
51
52 // check that second daughter is eta', which is self conjugate.
53 const EvtId etap = EvtPDL::getId( "eta'" );
54 if ( getDaug( 1 ) != etap ) {
55 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
56 << EvtBtoXsEtap::getName().c_str()
57 << " generator did not get eta' as second daughter." << endl;
58 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
59 << "Will terminate execution!" << endl;
60 ::abort();
61 }
62}
63
68
70{
71 // useless
72 // if ( p->getNDaug() != 0 ) {
73 // //Will end up here because maxrate multiplies by 1.2
74 // EvtGenReport(EVTGEN_DEBUG,"EvtGen") << "In EvtBtoXsEtap: X_s daughters should not be here!"<<endl;
75 // return;
76 //}
77
78 double m_b;
79 int i;
81 EvtParticle* pdaug[2];
82
83 for ( i = 0; i < getNDaug(); i++ ) {
84 pdaug[i] = p->getDaug( i );
85 }
86
87 EvtVector4R p4[2];
88 double mass[2];
89
90 m_b = p->mass();
91
92 // Prepare for phase space routine.
93
94 mass[1] = EvtPDL::getMass( getDaug( 1 ) );
95
96 double xbox, ybox, min, max, hichfit;
97 min = 0.493;
98 max = 4.3;
99 const double TwoPi = EvtConst::twoPi;
100 int Xscode = EvtPDL::getStdHep( getDaug( 0 ) );
101
102 // A five parameters fit, the shape is taken from Atwood & Soni
103
104 // double par[18];
105 double par[6];
106 if ( ( Xscode == 30343 ) || ( Xscode == -30343 ) || ( Xscode == 30353 ) ||
107 ( Xscode == -30353 ) ) { // Xsu or Xsd
108 min = 0.6373; // Just above K pi threshold for Xsd/u
109 //min=0.6333; // K pi threshold for neutral Xsd
110 // par[0]=-2057.2380371094;
111 par[0] = 2.36816;
112 // par[1]=2502.2556152344;
113 par[1] = 0.62325725;
114 // par[2]=1151.5632324219;
115 par[2] = 2.2;
116 // par[3]=0.82431584596634;
117 par[3] = -0.2109375;
118 // par[4]=-4110.5234375000;
119 par[4] = 2.7;
120 // par[5]=8445.6757812500;
121 par[5] = 0.54;
122 // par[6]=-3034.1894531250;
123 // par[7]=1.1557708978653;
124 // par[8]=1765.9311523438;
125 // par[9]=1.3730158805847;
126 // par[10]=0.51371538639069;
127 // par[11]=2.0056934356689;
128 // par[12]=37144.097656250;
129 // par[13]=-50296.781250000;
130 // par[14]=27319.095703125;
131 // par[15]=-7408.0678710938;
132 // par[16]=1000.8093261719;
133 // par[17]=-53.834449768066;
134 } else {
135 EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
136 << "In EvtBtoXsEtap: Particle with id " << Xscode
137 << " is not a Xsd/u particle" << endl;
138 return;
139 }
140
141 double boxheight = par[5];
142 double boxwidth = max - min;
143
144 mass[0] = 0.0;
145 while ( ( mass[0] > max ) || ( mass[0] < min ) ) {
146 xbox = EvtRandom::Flat( boxwidth ) + min;
147 ybox = EvtRandom::Flat( boxheight );
148 if ( xbox < par[2] ) {
149 hichfit = ( 1 / sqrt( TwoPi * par[1] ) ) *
150 exp( -0.5 * pow( ( xbox - par[0] ) / par[1], 2 ) );
151 // alifit=par[0]+par[1]*xbox+par[2]*pow(xbox,2);
152 // } else if (xbox<par[7]) {
153 // alifit=par[4]+par[5]*xbox+par[6]*pow(xbox,2);
154 // } else if (xbox<par[11]) {
155 // alifit=par[8]*exp(-0.5*pow((xbox-par[9])/par[10],2));
156 } else {
157 hichfit = par[3] * pow( ( xbox - par[4] ), 2 ) + par[5];
158 // alifit=par[12]+par[13]*xbox+par[14]*pow(xbox,2)+par[15]*pow(xbox,3)+par[16]*pow(xbox,4)+par[17]*pow(xbox,5);
159 }
160 if ( ybox > hichfit ) {
161 mass[0] = 0.0;
162 } else {
163 mass[0] = xbox;
164 }
165 }
166
167 // debug stuff: EvtGenReport(EVTGEN_INFO,"EvtGen") << "Xscode " << Xscode << " daughter 1 mass " << mass[0] << " daughter 2 mass " << mass[1] << endl;
168
169 EvtGenKine::PhaseSpace( getNDaug(), mass, p4, m_b );
170
171 for ( i = 0; i < getNDaug(); i++ ) {
172 pdaug[i]->init( getDaugs()[i], p4[i] );
173 }
174
175 return;
176}
EvtComplex exp(const EvtComplex &c)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition EvtReport.cpp:32
@ EVTGEN_DEBUG
Definition EvtReport.hh:53
@ EVTGEN_ERROR
Definition EvtReport.hh:49
void init() override
void decay(EvtParticle *p) override
std::string getName() const override
void initProbMax() override
EvtDecayBase * clone() const override
static const double twoPi
Definition EvtConst.hh:27
EvtDecayBase()=default
int getNDaug() const
EvtId getDaug(int i) const
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
const EvtId * getDaugs() const
static double PhaseSpace(int ndaug, double mass[30], EvtVector4R p4[30], double mp)
Definition EvtId.hh:27
static int getStdHep(EvtId id)
Definition EvtPDL.cpp:356
static double getMass(EvtId i)
Definition EvtPDL.cpp:311
static EvtId getId(const std::string &name)
Definition EvtPDL.cpp:283
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle * getDaug(const int i)
double mass() const
void makeDaughters(size_t ndaug, const EvtId *id)
static double Flat()
Definition EvtRandom.cpp:95