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
src
EvtGenModels
EvtBtoXsgamma.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
21
#include "
EvtGenModels/EvtBtoXsgamma.hh
"
22
23
#include "
EvtGenBase/EvtConst.hh
"
24
#include "
EvtGenBase/EvtGenKine.hh
"
25
#include "
EvtGenBase/EvtPDL.hh
"
26
#include "
EvtGenBase/EvtParticle.hh
"
27
#include "
EvtGenBase/EvtReport.hh
"
28
29
#include "
EvtGenModels/EvtBtoXsgammaAliGreub.hh
"
30
#include "
EvtGenModels/EvtBtoXsgammaFixedMass.hh
"
31
#include "
EvtGenModels/EvtBtoXsgammaFlatEnergy.hh
"
32
#include "
EvtGenModels/EvtBtoXsgammaKagan.hh
"
33
34
#include <stdlib.h>
35
#include <string>
36
using
std::endl;
37
38
std::string
EvtBtoXsgamma::getName
()
const
39
{
40
return
"BTOXSGAMMA"
;
41
}
42
43
EvtDecayBase
*
EvtBtoXsgamma::clone
()
const
44
{
45
return
new
EvtBtoXsgamma
;
46
}
47
48
void
EvtBtoXsgamma::init
()
49
{
50
//Arguments:
51
// 0: Ali-Greub model = 1, Kagan model = 2
52
//No more arguments for Ali-Greub model
53
// 1:
54
// 2:
55
// 3:
56
57
// check that at least one b->sg model has been selected
58
if
(
getNArg
() == 0 ) {
59
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
60
<<
EvtBtoXsgamma::getName
().c_str() <<
" generator expected "
61
<<
" at least 1 argument but found: "
<<
getNArg
() << endl;
62
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
63
<<
"Will terminate execution!"
<< endl;
64
::abort();
65
}
66
67
// check that there are only two daughters
68
checkNDaug
( 2 );
69
70
// check that second daughter has photon spin
71
checkSpinDaughter
( 1,
EvtSpinType::PHOTON
);
72
}
73
74
void
EvtBtoXsgamma::initProbMax
()
75
{
76
noProbMax
();
77
}
78
79
void
EvtBtoXsgamma::decay
(
EvtParticle
* p )
80
{
81
//initialize here. -- its too damn slow otherwise.
82
83
if
(
m_model
==
nullptr
) {
84
if
(
getArg
( 0 ) == 1 )
85
m_model
= std::make_unique<EvtBtoXsgammaAliGreub>();
86
else
if
(
getArg
( 0 ) == 2 )
87
m_model
= std::make_unique<EvtBtoXsgammaKagan>();
88
else
if
(
getArg
( 0 ) == 3 )
89
m_model
= std::make_unique<EvtBtoXsgammaFixedMass>();
90
else
if
(
getArg
( 0 ) == 4 )
91
m_model
= std::make_unique<EvtBtoXsgammaFlatEnergy>();
92
else
{
93
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
94
<<
"No valid EvtBtoXsgamma generator model selected "
95
<<
"Set arg(0) to 1 for Ali-Greub model or 2 for "
96
<<
" Kagan model or 3 for a fixed mass"
<< endl;
97
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
98
<<
"Will terminate execution!"
<< endl;
99
::abort();
100
}
101
m_model
->init(
getNArg
(),
getArgs
() );
102
}
103
104
// if ( p->getNDaug() != 0 ) {
105
//Will end up here because maxrate multiplies by 1.2
106
// EvtGenReport(EVTGEN_DEBUG,"EvtGen") << "In EvtBtoXsgamma: X_s daughters should not be here!"<<endl;
107
// return;
108
//}
109
110
double
m_b;
111
int
i;
112
p->
makeDaughters
(
getNDaug
(),
getDaugs
() );
113
EvtParticle
* pdaug[2];
114
115
for
( i = 0; i <
getNDaug
(); i++ ) {
116
pdaug[i] = p->
getDaug
( i );
117
}
118
119
EvtVector4R
p4[2];
120
double
mass[2];
121
122
m_b = p->
mass
();
123
124
mass[1] =
EvtPDL::getMass
(
getDaug
( 1 ) );
125
126
int
Xscode =
EvtPDL::getStdHep
(
getDaug
( 0 ) );
127
128
mass[0] =
m_model
->GetMass( Xscode );
129
130
EvtGenKine::PhaseSpace
(
getNDaug
(), mass, p4, m_b );
131
132
for
( i = 0; i <
getNDaug
(); i++ ) {
133
pdaug[i]->
init
(
getDaugs
()[i], p4[i] );
134
}
135
}
EvtBtoXsgammaAliGreub.hh
EvtBtoXsgammaFixedMass.hh
EvtBtoXsgammaFlatEnergy.hh
EvtBtoXsgammaKagan.hh
EvtBtoXsgamma.hh
EvtConst.hh
EvtGenKine.hh
EvtPDL.hh
EvtParticle.hh
EvtReport.hh
EvtGenReport
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition
EvtReport.cpp:32
EVTGEN_ERROR
@ EVTGEN_ERROR
Definition
EvtReport.hh:49
EvtBtoXsgamma
Definition
EvtBtoXsgamma.hh:34
EvtBtoXsgamma::clone
EvtDecayBase * clone() const override
Definition
EvtBtoXsgamma.cpp:43
EvtBtoXsgamma::m_model
std::unique_ptr< EvtBtoXsgammaAbsModel > m_model
Definition
EvtBtoXsgamma.hh:47
EvtBtoXsgamma::init
void init() override
Definition
EvtBtoXsgamma.cpp:48
EvtBtoXsgamma::decay
void decay(EvtParticle *p) override
Definition
EvtBtoXsgamma.cpp:79
EvtBtoXsgamma::getName
std::string getName() const override
Definition
EvtBtoXsgamma.cpp:38
EvtBtoXsgamma::initProbMax
void initProbMax() override
Definition
EvtBtoXsgamma.cpp:74
EvtDecayBase::checkSpinDaughter
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
Definition
EvtDecayBase.cpp:547
EvtDecayBase::EvtDecayBase
EvtDecayBase()=default
EvtDecayBase::getNDaug
int getNDaug() const
Definition
EvtDecayBase.hh:64
EvtDecayBase::getNArg
int getNArg() const
Definition
EvtDecayBase.hh:67
EvtDecayBase::getArg
double getArg(unsigned int j)
Definition
EvtDecayBase.cpp:578
EvtDecayBase::noProbMax
void noProbMax()
Definition
EvtDecayBase.cpp:301
EvtDecayBase::getDaug
EvtId getDaug(int i) const
Definition
EvtDecayBase.hh:66
EvtDecayBase::getArgs
double * getArgs()
Definition
EvtDecayBase.cpp:561
EvtDecayBase::checkNDaug
void checkNDaug(int d1, int d2=-1)
Definition
EvtDecayBase.cpp:516
EvtDecayBase::getDaugs
const EvtId * getDaugs() const
Definition
EvtDecayBase.hh:65
EvtGenKine::PhaseSpace
static double PhaseSpace(int ndaug, double mass[30], EvtVector4R p4[30], double mp)
Definition
EvtGenKine.cpp:46
EvtPDL::getStdHep
static int getStdHep(EvtId id)
Definition
EvtPDL.cpp:356
EvtPDL::getMass
static double getMass(EvtId i)
Definition
EvtPDL.cpp:311
EvtParticle
Definition
EvtParticle.hh:45
EvtParticle::init
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle::getDaug
EvtParticle * getDaug(const int i)
Definition
EvtParticle.hh:173
EvtParticle::mass
double mass() const
Definition
EvtParticle.cpp:159
EvtParticle::makeDaughters
void makeDaughters(size_t ndaug, const EvtId *id)
Definition
EvtParticle.cpp:1235
EvtSpinType::PHOTON
@ PHOTON
Definition
EvtSpinType.hh:34
EvtVector4R
Definition
EvtVector4R.hh:29
Generated by
1.16.1