Belle II Software development
EvtFlatDaughter.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <generators/evtgen/EvtGenModelRegister.h>
10
11#include <stdlib.h>
12#include <cmath>
13#include "EvtGenBase/EvtRandom.hh"
14#include "EvtGenBase/EvtParticle.hh"
15#include "EvtGenBase/EvtGenKine.hh"
16#include "EvtGenBase/EvtPDL.hh"
17#include "EvtGenBase/EvtReport.hh"
18#include "EvtGenBase/EvtConst.hh"
19#include "EvtGenBase/EvtId.hh"
20
21#include "generators/evtgen/models/EvtFlatDaughter.h"
22
23using std::endl;
24
25namespace Belle2 {
33
35
37 {
38 return "FLAT_DAUGHTER";
39 }
40
41 EvtDecayBase* EvtFlatDaughter::clone()
42 {
43 return new EvtFlatDaughter;
44 }
45
46 void EvtFlatDaughter::decay(EvtParticle* p)
47 {
48 // variables to find.
49 EvtVector4R p4KorKstar;
50 EvtVector4R p4norantin;
51 EvtVector4R p4antinorn;
52
53 // start!
54 p->makeDaughters(getNDaug(), getDaugs());
55
56 EvtParticle* KorKstar = p->getDaug(0);
57 EvtParticle* norantin = p->getDaug(1);
58 EvtParticle* antinorn = p->getDaug(2);
59
60 double mass[3];
61
62 findMasses(p, getNDaug(), getDaugs(), mass);
63
64 double m_B = p->mass();
65 double m_K = mass[0];
66 double m_norantin = mass[1];
67 double m_antinorn = mass[2];
68
69 double M_max = m_B - m_K;
70 double M_min = m_norantin + m_antinorn;
71
72 // determined M_nn
73 double Mnn = EvtRandom::Flat(M_min, M_max);
74
75 // B -> K(*) (nnbar) decay. Momentums are determined in B meson's rest frame
76 EvtVector4R p4Kdin[2];
77
78 double mKdin[2];
79 mKdin[0] = m_K;
80 mKdin[1] = Mnn;
81
82 EvtGenKine::PhaseSpace(2, mKdin, p4Kdin, m_B);
83
84 // (nnbar) -> n nbar decay. Momentums are determined in (nnbar) rest frame
85 EvtVector4R p4nn[2];
86
87 double mnn[2];
88 mnn[0] = m_norantin;
89 mnn[1] = m_antinorn;
90
91 EvtGenKine::PhaseSpace(2, mnn, p4nn, Mnn);
92
93 // boost to B meson rest frame
94 p4norantin = boostTo(p4nn[0], p4Kdin[1]);
95 p4antinorn = boostTo(p4nn[1], p4Kdin[1]);
96
97 // initialize the decay products
98 KorKstar->init(getDaug(0), p4Kdin[0]);
99 norantin->init(getDaug(1), p4norantin);
100 antinorn->init(getDaug(2), p4antinorn);
101
102
103 return;
104
105 }
106
107
109 {
110 noProbMax();
111 }
112
113
115 {
116
117 // check that there are two arguments - Mmin Mmax
118 checkNArg(0);
119
120 // check the number of daughters. It should be 3
121 checkNDaug(3);
122
123 }
124
125
127}
128
129
The evtgen model to produce flat invariant mass distribution for 2nd and 3rd daughters.
EvtFlatDaughter()
Constructor.
void init()
The function for an initialization.
EvtDecayBase * clone()
The function which makes a copy of the model.
void initProbMax()
The function to sets a maximum probability.
std::string getName()
The function which returns the name of the model.
#define B2_EVTGEN_REGISTER_MODEL(classname)
Class to register B2_EVTGEN_REGISTER_MODEL.
virtual ~EvtFlatDaughter()
Destructor.
void decay(EvtParticle *p)
The function to determine kinematics of daughter particles.
Abstract base class for different kinds of events.