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
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
22
25#include "EvtGenBase/EvtPDL.hh"
28
33
34#include <stdlib.h>
35#include <string>
36using std::endl;
37
38std::string EvtBtoXsgamma::getName() const
39{
40 return "BTOXSGAMMA";
41}
42
44{
45 return new EvtBtoXsgamma;
46}
47
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
72}
73
78
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;
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}
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition EvtReport.cpp:32
@ EVTGEN_ERROR
Definition EvtReport.hh:49
EvtDecayBase * clone() const override
std::unique_ptr< EvtBtoXsgammaAbsModel > m_model
void init() override
void decay(EvtParticle *p) override
std::string getName() const override
void initProbMax() override
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
EvtDecayBase()=default
int getNDaug() const
int getNArg() const
double getArg(unsigned int j)
EvtId getDaug(int i) const
double * getArgs()
void checkNDaug(int d1, int d2=-1)
const EvtId * getDaugs() const
static double PhaseSpace(int ndaug, double mass[30], EvtVector4R p4[30], double mp)
static int getStdHep(EvtId id)
Definition EvtPDL.cpp:356
static double getMass(EvtId i)
Definition EvtPDL.cpp:311
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)