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.
EvtMBreitWigner.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/EvtPatches.hh"
24 #include "EvtGenBase/EvtReport.hh"
25 
26 #include <stdlib.h>
27 
28 using std::endl;
29 
30 EvtMBreitWigner::EvtMBreitWigner( const EvtId& id, const vector<string>& args )
31 {
32  if ( args.size() != 0 ) {
33  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
34  << "Unknown input arguments passed in to lineshape." << endl;
35  ::abort();
36  }
37 
38  _id = id;
39  _width = EvtPDL::getWidth( id );
41 }
42 
43 EvtComplex EvtMBreitWigner::shape( const vector<EvtVector4R>& product ) const
44 {
45  static EvtComplex I( 0.0, 1.0 );
46  double mass = _node->get4vector( product ).mass();
47 
48  return sqrt( _width / ( EvtConst::twoPi ) ) * 1 /
49  ( mass - _resmass - I * _width / 2 );
50 }
51 
53 {
54  vector<string> args;
55  EvtMLineShape* tmp = new EvtMBreitWigner( _id, args );
56  return tmp;
57 }
EvtVector4R get4vector(const vector< EvtVector4R > &product) const
Definition: EvtMNode.cpp:25
EvtMRes * _node
Definition: EvtMRes.hh:38
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
double mass() const
Definition: EvtVector4R.cpp:49
static const double twoPi
Definition: EvtConst.hh:27
static double getMeanMass(EvtId i)
Definition: EvtPDL.cpp:314
Definition: EvtId.hh:27
EvtMLineShape * duplicate() const override
static double getWidth(EvtId i)
Definition: EvtPDL.cpp:352
EvtMBreitWigner(const EvtId &id, const vector< string > &args)
const EvtComplex I
Definition: EvtBsMuMuKK.cpp:38
EvtComplex shape(const vector< EvtVector4R > &product) const override