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.
EvtGenericDalitz.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 
24 #include "EvtGenBase/EvtPDL.hh"
26 
28 
30 {
31  return "GENERIC_DALITZ";
32 }
33 
35 {
36  return new EvtGenericDalitz();
37 }
38 
40 {
41  checkNArg( 1 );
42 
43  EvtId parnum = getParentId();
44  EvtId d1 = getDaug( 0 );
45  EvtId d2 = getDaug( 1 );
46  EvtId d3 = getDaug( 2 );
47 
48  std::vector<EvtDalitzDecayInfo> decays =
50 
51  std::vector<EvtDalitzDecayInfo>::iterator i = decays.begin();
52  for ( ; i != decays.end(); i++ ) {
53  EvtId daughter1 = ( *i ).daughter1();
54  EvtId daughter2 = ( *i ).daughter2();
55  EvtId daughter3 = ( *i ).daughter3();
56 
57  if ( d1 == daughter1 && d2 == daughter2 && d3 == daughter3 ) {
58  _d1 = 0;
59  _d2 = 1;
60  _d3 = 2;
61  } else if ( d1 == daughter1 && d2 == daughter3 && d3 == daughter2 ) {
62  _d1 = 0;
63  _d2 = 2;
64  _d3 = 1;
65  } else if ( d1 == daughter2 && d2 == daughter1 && d3 == daughter3 ) {
66  _d1 = 1;
67  _d2 = 0;
68  _d3 = 2;
69  } else if ( d1 == daughter2 && d2 == daughter3 && d3 == daughter1 ) {
70  _d1 = 1;
71  _d2 = 2;
72  _d3 = 0;
73  } else if ( d1 == daughter3 && d2 == daughter1 && d3 == daughter2 ) {
74  _d1 = 2;
75  _d2 = 0;
76  _d3 = 1;
77  } else if ( d1 == daughter3 && d2 == daughter2 && d3 == daughter1 ) {
78  _d1 = 2;
79  _d2 = 1;
80  _d3 = 0;
81  } else {
82  continue;
83  }
84 
85  _resonances = ( *i ).getResonances();
86  setProbMax( ( *i ).getProbMax() );
87  return;
88  }
89 }
90 
92 {
94 
95  EvtVector4R p4_d1 = p->getDaug( _d1 )->getP4();
96  EvtVector4R p4_d2 = p->getDaug( _d2 )->getP4();
97  EvtVector4R p4_d3 = p->getDaug( _d3 )->getP4();
98 
99  double mA = p->getDaug( _d1 )->mass();
100  double mB = p->getDaug( _d2 )->mass();
101  double mC = p->getDaug( _d3 )->mass();
102 
103  double m2AB = ( p4_d1 + p4_d2 ).mass2();
104  double m2CA = ( p4_d1 + p4_d3 ).mass2();
105  double m2BC = ( p4_d2 + p4_d3 ).mass2();
106 
107  EvtDalitzPoint point( mA, mB, mC, m2AB, m2BC, m2CA );
108 
109  EvtComplex amp( 0, 0 );
110  std::vector<std::pair<EvtComplex, EvtDalitzReso>>::iterator i =
111  _resonances.begin();
112  for ( ; i != _resonances.end(); i++ ) {
113  std::pair<EvtComplex, EvtDalitzReso> res = ( *i );
114  amp += res.first * res.second.evaluate( point );
115  }
116 
117  vertex( amp );
118  return;
119 }
120 
121 std::string EvtGenericDalitz::getParamName( int i )
122 {
123  switch ( i ) {
124  case 0:
125  return "xmlFile";
126  default:
127  return "";
128  }
129 }
void init() override
std::string getArgStr(int j) const
Definition: EvtDecayBase.hh:78
void decay(EvtParticle *p) override
EvtDecayBase * clone() override
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
void setProbMax(double prbmx)
Definition: EvtId.hh:27
std::string getParamName(int i) override
EvtId getParentId() const
Definition: EvtDecayBase.hh:61
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtDalitzTable * getInstance(const std::string dec_name="", bool verbose=true)
const EvtVector4R & getP4() const
double mass() const
int getNDaug() const
Definition: EvtDecayBase.hh:65
std::string getName() override
std::vector< std::pair< EvtComplex, EvtDalitzReso > > _resonances
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
std::vector< EvtDalitzDecayInfo > getDalitzTable(const EvtId &parent)
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67