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
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
22
25
27
28#include <fstream>
29#include <stdlib.h>
30using std::endl;
31using std::fstream;
32
33void 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 }
67}
68
69double 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}
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition EvtReport.cpp:32
@ EVTGEN_ERROR
Definition EvtReport.hh:49
double GetMass(int code) override
void init(int, double *) override
static double Flat()
Definition EvtRandom.cpp:95