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.
EvtLb2plnuLCSR.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/EvtConst.hh"
24 #include "EvtGenBase/EvtGenKine.hh"
25 #include "EvtGenBase/EvtIdSet.hh"
26 #include "EvtGenBase/EvtPDL.hh"
28 #include "EvtGenBase/EvtPatches.hh"
29 #include "EvtGenBase/EvtReport.hh"
30 
32 
33 #include <stdlib.h>
34 #include <string>
35 
36 using namespace std;
37 #ifdef D0
38 #undef D0
39 #endif
40 EvtLb2plnuLCSR::EvtLb2plnuLCSR() : ffmodel( 0 ), calcamp( 0 )
41 {
42 }
43 
45 {
46  delete ffmodel;
47  ffmodel = 0;
48  delete calcamp;
49  calcamp = 0;
50 }
51 
53 {
54  return "Lb2plnuLCSR";
55 }
56 
58 {
59  return new EvtLb2plnuLCSR;
60 }
61 
63 {
64  //This is a kludge to avoid warnings because the K_2* mass becomes to large.
65  static EvtIdSet regenerateMasses( "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
66  "K_1+", "K_1-", "K_10", "anti-K_10",
67  "D'_1+", "D'_1-", "D'_10", "anti-D'_10" );
68 
69  if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
70  p->resetFirstOrNot();
71  }
72 
74 
75  EvtComplex r00( getArg( 0 ), 0.0 );
76  EvtComplex r01( getArg( 1 ), 0.0 );
77  EvtComplex r10( getArg( 2 ), 0.0 );
78  EvtComplex r11( getArg( 3 ), 0.0 );
79 
80  calcamp->CalcAmp( p, _amp2, ffmodel, r00, r01, r10, r11 );
81 }
82 
84 {
85  static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
86  static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
87  static EvtId PRO = EvtPDL::getId( "p+" );
88  static EvtId PROB = EvtPDL::getId( "anti-p-" );
89 
90  EvtId parnum, barnum;
91 
92  parnum = getParentId();
93  barnum = getDaug( 0 );
94 
95  if ( ( parnum == LAMB && barnum == PRO ) ||
96  ( parnum == LAMBB && barnum == PROB ) ) {
97  setProbMax( 22000.0 );
98  } else {
99  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
100  << "Decay does not have Lb->p setting ProbMax = 0 " << endl;
101  setProbMax( 0.0 );
102  }
103 }
104 
106 {
107  if ( getNArg() != 4 ) {
108  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
109  << "EvtLb2plnuLCSR generator expected "
110  << " 4 arguments but found:" << getNArg() << endl;
111  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
112  << "Will terminate execution!" << endl;
113  ::abort();
114  }
115 
116  if ( getNDaug() != 3 ) {
117  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
118  << "Wrong number of daughters in EvtLb2plnu.cc "
119  << " 3 daughters expected but found: " << getNDaug() << endl;
120  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
121  << "Will terminate execution!" << endl;
122  ::abort();
123  }
124 
125  //We expect the parent to be a dirac particle
126  //and the daughters to be X lepton neutrino
127 
131  EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
132 
133  if ( parenttype != EvtSpinType::DIRAC ) {
134  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
135  << "EvtLb2plnuLCSR generator expected "
136  << " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
137  << endl;
138  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
139  << "Will terminate execution!" << endl;
140  ::abort();
141  }
142  if ( leptontype != EvtSpinType::DIRAC ) {
143  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
144  << "EvtLb2plnuLCSR generator expected "
145  << " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
146  << endl;
147  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
148  << "Will terminate execution!" << endl;
149  ::abort();
150  }
151  if ( neutrinotype != EvtSpinType::NEUTRINO ) {
152  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
153  << "EvtLb2plnuLCSR generator expected "
154  << " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
155  << endl;
156  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
157  << "Will terminate execution!" << endl;
158  ::abort();
159  }
160 
161  //set ffmodel
163 
164  if ( baryontype == EvtSpinType::DIRAC ) {
165  calcamp = new EvtSLBaryonAmp;
166  } else {
167  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
168  << "Wrong baryon spin type in EvtLb2plnuLCSR.cc "
169  << "Expected spin type " << EvtSpinType::DIRAC
170  << ", found spin type " << baryontype << endl;
171  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
172  << "Will terminate execution!" << endl;
173  ::abort();
174  }
175 }
static std::string name(EvtId i)
Definition: EvtPDL.cpp:382
void resetFirstOrNot()
Definition: EvtParticle.cpp:81
std::string getName() override
double getArg(unsigned int j)
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.cpp:377
void initProbMax() override
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
EvtSLBaryonAmp * calcamp
void setProbMax(double prbmx)
EvtSemiLeptonicFF * ffmodel
Definition: EvtId.hh:27
EvtId getParentId() const
Definition: EvtDecayBase.hh:61
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void decay(EvtParticle *p) override
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
int getNDaug() const
Definition: EvtDecayBase.hh:65
void CalcAmp(EvtParticle *parent, EvtAmp &amp, EvtSemiLeptonicFF *FormFactors) override
EvtAmp _amp2
Definition: EvtDecayAmp.hh:73
int contains(const EvtId id)
Definition: EvtIdSet.cpp:422
EvtDecayBase * clone() override
int getNArg() const
Definition: EvtDecayBase.hh:68
void init() override
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67