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
EvtBToXElNu.cpp
Go to the documentation of this file.
1
2/***********************************************************************
3* Copyright 1998-2021 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
24#include "EvtGenBase/EvtPDL.hh"
29
32
33#include <cstdlib>
34#include <string>
35
36using std::endl;
37
38std::string EvtBToXElNu::getName() const
39{
40 return "BTOXELNU";
41}
42
44{
45 return new EvtBToXElNu;
46}
47
49{
51 m_calcamp->CalcAmp( p, m_amp2, m_ffmodel.get() );
52}
53
55{
56 EvtId parnum, mesnum, lnum, nunum;
57
58 parnum = getParentId();
59 mesnum = getDaug( 0 );
60 lnum = getDaug( 1 );
61 nunum = getDaug( 2 );
62
63 const double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, lnum,
64 nunum, m_ffmodel.get() );
65
66 setProbMax( mymaxprob );
67}
68
70{
71 checkNDaug( 3 );
72
73 // We expect the parent to be a scalar
74 // and the daughters to be X lepton neutrino
76
79
81 const std::string model = getArgStr( 0 );
82 EvtGenReport( EVTGEN_INFO, "EvtGen" )
83 << "Using " << model << " EvtGen FF model" << endl;
84
85 // -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL
86 if ( model == "BGL" ) {
87 const EvtId lnum = getDaug( 1 );
88 if ( lnum == EvtPDL::getId( "tau-" ) || lnum == EvtPDL::getId( "tau+" ) ) {
89 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
90 << "The current BGL model should not be used for taus" << endl;
91 ::abort();
92 }
93
94 if ( d1type == EvtSpinType::SCALAR ) {
95 if ( getNArg() == 9 ) {
96 m_ffmodel = std::make_unique<EvtBGLFF>(
97 getArg( 1 ), getArg( 2 ), getArg( 3 ), getArg( 4 ),
98 getArg( 5 ), getArg( 6 ), getArg( 7 ), getArg( 8 ) );
99 m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
100 } else {
101 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
102 << "BGL (N=3) model for scalar meson daughters needs 8 arguments. Sorry."
103 << endl;
104 ::abort();
105 }
106 } else if ( d1type == EvtSpinType::VECTOR ) {
107 if ( getNArg() == 7 ) {
108 m_ffmodel = std::make_unique<EvtBGLFF>( getArg( 1 ),
109 getArg( 2 ), getArg( 3 ),
110 getArg( 4 ), getArg( 5 ),
111 getArg( 6 ) );
112 m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
113 } else {
114 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
115 << "BGL (N=3) model for vector meson daughters needs 6 arguments. Sorry."
116 << endl;
117 ::abort();
118 }
119 } else {
120 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
121 << "Only Scalar and Vector models implemented. Sorry." << endl;
122 ::abort();
123 }
124 // -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL
125 } else if ( model == "BCL" ) {
126 // -- Need to subtract 1 as the first argument is the model name (BCL)
127 const int numArgs = getNArg() - 1;
128 double* args = getArgs();
129 args = &args[1];
130
131 m_ffmodel = std::make_unique<EvtBCLFF>( numArgs, args );
132 if ( d1type == EvtSpinType::SCALAR ) {
133 m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
134 } else if ( d1type == EvtSpinType::VECTOR ) {
135 m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
136 } else {
137 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
138 << "BCL model handles currently only scalar and vector meson daughters. Sorry."
139 << endl;
140 ::abort();
141 }
142 } else {
143 EvtGenReport( EVTGEN_INFO, "EvtGen" )
144 << " Unknown form-factor model, valid options are BGL, BCL"
145 << std::endl;
146 ::abort();
147 }
148}
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition EvtReport.cpp:32
@ EVTGEN_INFO
Definition EvtReport.hh:52
@ EVTGEN_ERROR
Definition EvtReport.hh:49
void initProbMax() override
EvtBToXElNu()=default
std::unique_ptr< EvtSemiLeptonicAmp > m_calcamp
std::unique_ptr< EvtSemiLeptonicFF > m_ffmodel
void decay(EvtParticle *p) override
void init() override
EvtDecayBase * clone() const override
std::string getName() const override
EvtAmp m_amp2
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
EvtDecayBase()=default
int getNDaug() const
void checkSpinParent(EvtSpinType::spintype sp)
int getNArg() const
double getArg(unsigned int j)
void setProbMax(double prbmx)
std::string getArgStr(int j) const
EvtId getParentId() const
EvtId getDaug(int i) const
double * getArgs()
void checkNDaug(int d1, int d2=-1)
const EvtId * getDaugs() const
Definition EvtId.hh:27
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.cpp:371
static EvtId getId(const std::string &name)
Definition EvtPDL.cpp:283
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)