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.
EvtFlatSqDalitz.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/EvtPDL.hh"
27 #include "EvtGenBase/EvtPatches.hh"
28 #include "EvtGenBase/EvtRandom.hh"
29 #include "EvtGenBase/EvtReport.hh"
30 
31 #include <fstream>
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include <string>
35 using std::fstream;
36 
38 {
39 }
40 
42 {
43  return "FLATSQDALITZ";
44 }
45 
47 {
48  return new EvtFlatSqDalitz;
49 }
50 
52 {
53  noProbMax();
54 }
55 
57 {
58  //check there are 3 daughters
59  checkNDaug( 3 );
60 
61  // check that there are 0 arguments
62  checkNArg( 0, 2, 4 );
63 
64  if ( getNArg() > 0 ) {
65  m_mPrimeMin = getArg( 0 );
66  m_mPrimeMax = getArg( 1 );
67  }
68  if ( getNArg() > 2 ) {
69  m_thetaPrimeMin = getArg( 2 );
70  m_thetaPrimeMax = getArg( 3 );
71  }
72 }
73 
75 {
76  p->makeDaughters( getNDaug(), getDaugs() );
77  p->generateMassTree();
78  const double mParent = p->mass();
79  EvtParticle* daug1 = p->getDaug( 0 );
80  EvtParticle* daug2 = p->getDaug( 1 );
81  EvtParticle* daug3 = p->getDaug( 2 );
82  const double mDaug1 = daug1->mass();
83  const double mDaug2 = daug2->mass();
84  const double mDaug3 = daug3->mass();
85  const double mParentSq = mParent * mParent;
86  const double mDaug1Sq = mDaug1 * mDaug1;
87  const double mDaug2Sq = mDaug2 * mDaug2;
88  const double mDaug3Sq = mDaug3 * mDaug3;
89 
90  // Generate m' and theta'
91  const double mPrime = EvtRandom::Flat( m_mPrimeMin, m_mPrimeMax );
92  const double thetaPrime = EvtRandom::Flat( m_thetaPrimeMin, m_thetaPrimeMax );
93 
94  // calculate m12 and m23
95  const double m12 = 0.5 * ( std::cos( mPrime * EvtConst::pi ) + 1 ) *
96  ( mParent - ( mDaug1 + mDaug2 + mDaug3 ) ) +
97  mDaug1 + mDaug2;
98  const double m12Sq = m12 * m12;
99 
100  const double en1 = ( m12Sq - mDaug2Sq + mDaug1Sq ) / ( 2. * m12 );
101  const double en3 = ( mParentSq - m12Sq - mDaug3Sq ) / ( 2. * m12 );
102 
103  const double p1 = std::sqrt( en1 * en1 - mDaug1Sq );
104  const double p3 = std::sqrt( en3 * en3 - mDaug3Sq );
105  const double m13Sq =
106  mDaug1Sq + mDaug3Sq +
107  2.0 * ( en1 * en3 - p1 * p3 * std::cos( EvtConst::pi * thetaPrime ) );
108  const double m23Sq = mParentSq - m12Sq - m13Sq + mDaug1Sq + mDaug2Sq +
109  mDaug3Sq;
110 
111  // Turn m12 and m23 into momenta
112  EvtGenKine::ThreeBodyKine( m12Sq, m23Sq, p );
113 
114  return;
115 }
void initProbMax() override
double getArg(unsigned int j)
std::string getName() override
EvtDecayBase * clone() override
void makeDaughters(unsigned int ndaug, EvtId *id)
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
static const double pi
Definition: EvtConst.hh:26
bool generateMassTree()
void checkNDaug(int d1, int d2=-1)
static double Flat()
Definition: EvtRandom.cpp:72
static void ThreeBodyKine(const double m12Sq, const double m23Sq, EvtParticle *p)
Definition: EvtGenKine.cpp:350
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
double mass() const
int getNDaug() const
Definition: EvtDecayBase.hh:65
void init() override
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
void decay(EvtParticle *p) override
int getNArg() const
Definition: EvtDecayBase.hh:68