evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtSLPole.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 
23 #include "EvtGenBase/EvtGenKine.hh"
24 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtPatches.hh"
27 #include "EvtGenBase/EvtReport.hh"
31 
33 
34 #include <stdlib.h>
35 #include <string>
36 
37 std::string EvtSLPole::getName()
38 {
39  return "SLPOLE";
40 }
41 
43 {
44  return new EvtSLPole;
45 }
46 
48 {
50  calcamp->CalcAmp( p, _amp2, SLPoleffmodel.get() );
51 }
52 
54 {
55  EvtId parnum, mesnum, lnum, nunum;
56 
57  parnum = getParentId();
58  mesnum = getDaug( 0 );
59  lnum = getDaug( 1 );
60  nunum = getDaug( 2 );
61 
62  double mymaxprob = calcamp->CalcMaxProb( parnum, mesnum, lnum, nunum,
63  SLPoleffmodel.get() );
64 
65  setProbMax( mymaxprob );
66 }
67 
69 {
70  checkNDaug( 3 );
71 
72  //We expect the parent to be a scalar
73  //and the daughters to be X lepton neutrino
74 
78 
80 
81  SLPoleffmodel = std::make_unique<EvtSLPoleFF>( getNArg(), getArgs() );
82 
83  switch ( mesontype ) {
85  calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
86  break;
88  calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
89  break;
91  calcamp = std::make_unique<EvtSemiLeptonicTensorAmp>();
92  break;
93  default:;
94  }
95 
96  _resetDaughterTree = false;
97  if ( getArgStr( getNArg() - 1 ) == "true" )
98  _resetDaughterTree = true;
99 }
std::string getName() override
Definition: EvtSLPole.cpp:37
double * getArgs()
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.cpp:377
std::string getArgStr(int j) const
Definition: EvtDecayBase.hh:78
std::unique_ptr< EvtSemiLeptonicFF > SLPoleffmodel
Definition: EvtSLPole.hh:42
EvtDecayBase * clone() override
Definition: EvtSLPole.cpp:42
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
std::unique_ptr< EvtSemiLeptonicAmp > calcamp
Definition: EvtSLPole.hh:43
void setProbMax(double prbmx)
Definition: EvtId.hh:27
EvtId getParentId() const
Definition: EvtDecayBase.hh:61
bool _resetDaughterTree
Definition: EvtSLPole.hh:45
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void decay(EvtParticle *p) override
Definition: EvtSLPole.cpp:47
void checkNDaug(int d1, int d2=-1)
void checkSpinParent(EvtSpinType::spintype sp)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
int getNDaug() const
Definition: EvtDecayBase.hh:65
EvtAmp _amp2
Definition: EvtDecayAmp.hh:73
void initProbMax() override
Definition: EvtSLPole.cpp:53
void init() override
Definition: EvtSLPole.cpp:68
int getNArg() const
Definition: EvtDecayBase.hh:68
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67