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
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
29std::string EvtGenericDalitz::getName() const
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 m_d1 = 0;
59 m_d2 = 1;
60 m_d3 = 2;
61 } else if ( d1 == daughter1 && d2 == daughter3 && d3 == daughter2 ) {
62 m_d1 = 0;
63 m_d2 = 2;
64 m_d3 = 1;
65 } else if ( d1 == daughter2 && d2 == daughter1 && d3 == daughter3 ) {
66 m_d1 = 1;
67 m_d2 = 0;
68 m_d3 = 2;
69 } else if ( d1 == daughter2 && d2 == daughter3 && d3 == daughter1 ) {
70 m_d1 = 1;
71 m_d2 = 2;
72 m_d3 = 0;
73 } else if ( d1 == daughter3 && d2 == daughter1 && d3 == daughter2 ) {
74 m_d1 = 2;
75 m_d2 = 0;
76 m_d3 = 1;
77 } else if ( d1 == daughter3 && d2 == daughter2 && d3 == daughter1 ) {
78 m_d1 = 2;
79 m_d2 = 1;
80 m_d3 = 0;
81 } else {
82 continue;
83 }
84
85 m_resonances = ( *i ).getResonances();
86 setProbMax( ( *i ).getProbMax() );
87 return;
88 }
89}
90
92{
94
95 EvtVector4R p4_d1 = p->getDaug( m_d1 )->getP4();
96 EvtVector4R p4_d2 = p->getDaug( m_d2 )->getP4();
97 EvtVector4R p4_d3 = p->getDaug( m_d3 )->getP4();
98
99 double mA = p->getDaug( m_d1 )->mass();
100 double mB = p->getDaug( m_d2 )->mass();
101 double mC = p->getDaug( m_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 m_resonances.begin();
112 for ( ; i != m_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
122{
123 switch ( i ) {
124 case 0:
125 return "xmlFile";
126 default:
127 return "";
128 }
129}
std::vector< EvtDalitzDecayInfo > getDalitzTable(const EvtId &parent) const
static const EvtDalitzTable & getInstance(const std::string dec_name="", bool verbose=true)
void vertex(const EvtComplex &amp)
EvtDecayBase()=default
int getNDaug() const
void setProbMax(double prbmx)
std::string getArgStr(int j) const
EvtId getParentId() const
EvtId getDaug(int i) const
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
const EvtId * getDaugs() const
void decay(EvtParticle *p) override
std::vector< std::pair< EvtComplex, EvtDalitzReso > > m_resonances
EvtDecayBase * clone() const override
void init() override
std::string getName() const override
std::string getParamName(int i) override
Definition EvtId.hh:27
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
const EvtVector4R & getP4() const
EvtParticle * getDaug(const int i)
double mass() const