EvtGen
2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Toggle main menu visibility
Loading...
Searching...
No Matches
src
EvtGenModels
EvtBtoXsgammaFlatEnergy.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/EvtBtoXsgammaFlatEnergy.hh
"
22
23
#include "
EvtGenBase/EvtRandom.hh
"
24
#include "
EvtGenBase/EvtReport.hh
"
25
26
#include "
EvtGenModels/EvtBtoXsgamma.hh
"
27
28
#include <fstream>
29
#include <stdlib.h>
30
using
std::endl;
31
using
std::fstream;
32
33
void
EvtBtoXsgammaFlatEnergy::init
(
int
nArg,
double
* args )
34
{
35
if
( ( nArg ) > 3 || ( nArg > 1 && nArg < 3 ) ) {
36
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
37
<<
"EvtBtoXsgamma generator model "
38
<<
"EvtBtoXsgammaFlatEnergy expected "
39
<<
"either 1(default config) or two arguments but found: "
<< nArg
40
<< endl;
41
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
42
<<
"Will terminate execution!"
<< endl;
43
::abort();
44
}
45
m_mB0
= 5.2794;
46
double
mPi = 0.140;
47
double
mK = 0.494;
48
if
( nArg == 1 ) {
49
m_eMin
= 1.7;
50
//Invariant mass of Xsd must be greater the m_pi+m_K leads to
51
//Egamma < (m_B**2-(m_pi+m_k)**2)/(2m_B)
52
m_eMax
= ( pow(
m_mB0
, 2 ) - pow( mPi + mK, 2 ) ) / ( 2.0 *
m_mB0
);
53
}
else
{
54
m_eMin
= args[1];
55
m_eMax
= args[2];
56
}
57
if
(
m_eMax
> ( pow(
m_mB0
, 2 ) - pow( mPi + mK, 2 ) ) / ( 2.0 *
m_mB0
) ) {
58
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
59
<<
"Emax greater than Kinematic limit"
<< endl;
60
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
61
<<
"Reset to the kinematic limit"
<< endl;
62
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
63
<<
"(m_B**2-(m_pi+m_k)**2)/(2m_B)"
<< endl;
64
m_eMax
= ( pow(
m_mB0
, 2 ) - pow( mPi + mK, 2 ) ) / ( 2.0 *
m_mB0
);
65
}
66
m_eRange
=
m_eMax
-
m_eMin
;
67
}
68
69
double
EvtBtoXsgammaFlatEnergy::GetMass
(
int
/*Xscode*/
)
70
{
71
double
eGamma =
EvtRandom::Flat
(
m_eRange
) +
m_eMin
;
72
double
mH = sqrt( pow(
m_mB0
, 2 ) - 2.0 *
m_mB0
* eGamma );
73
return
mH;
74
}
EvtBtoXsgammaFlatEnergy.hh
EvtBtoXsgamma.hh
EvtRandom.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
EvtBtoXsgammaFlatEnergy::m_mB0
double m_mB0
Definition
EvtBtoXsgammaFlatEnergy.hh:40
EvtBtoXsgammaFlatEnergy::m_eRange
double m_eRange
Definition
EvtBtoXsgammaFlatEnergy.hh:41
EvtBtoXsgammaFlatEnergy::m_eMax
double m_eMax
Definition
EvtBtoXsgammaFlatEnergy.hh:38
EvtBtoXsgammaFlatEnergy::GetMass
double GetMass(int code) override
Definition
EvtBtoXsgammaFlatEnergy.cpp:69
EvtBtoXsgammaFlatEnergy::init
void init(int, double *) override
Definition
EvtBtoXsgammaFlatEnergy.cpp:33
EvtBtoXsgammaFlatEnergy::m_eMin
double m_eMin
Definition
EvtBtoXsgammaFlatEnergy.hh:37
EvtRandom::Flat
static double Flat()
Definition
EvtRandom.cpp:95
Generated by
1.17.0