BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtBtoKD3P.cc
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// File and Version Information:
3// $Id: EvtBtoKD3P.cc,v 1.2 2009/12/18 08:43:52 pingrg Exp $
4//
5// Environment:
6// This software is part of the EvtGen package developed jointly
7// for the BaBar and CLEO collaborations. If you use all or part
8// of it, please give an appropriate acknowledgement.
9//
10// Copyright Information:
11// Copyright (C) 2003, Colorado State University
12//
13// Module creator:
14// Abi soffer, CSU, 2003
15//-----------------------------------------------------------------------
17
18// Decay model that does the decay B+->D0K, D0->3 psudoscalars
19
20#include <assert.h>
21
26#include "EvtBtoKD3P.hh"
27#include "EvtPto3P.hh"
28
31using std::endl;
32
33//------------------------------------------------------------------
35
36//------------------------------------------------------------------
38
39//------------------------------------------------------------------
41
42//------------------------------------------------------------------
44
45//------------------------------------------------------------------
46void EvtBtoKD3P::getName( std::string& model_name ) { model_name = "BTOKD3P"; }
47
48//------------------------------------------------------------------
50 checkNArg( 2 ); // r, phase
51 checkNDaug( 3 ); // K, D0(allowed), D0(suppressed).
52 // The last two daughters are really one particle
53
54 // check that the mother and all daughters are scalars:
59
60 // Check that the B dtr types are K D D:
61
62 // get the parameters:
63 _r = getArg( 0 );
64 double phase = getArg( 1 );
65 _exp = EvtComplex( cos( phase ), sin( phase ) );
66}
67
68//------------------------------------------------------------------
70 setProbMax( 1 ); // this is later changed in decay()
71}
72
73//------------------------------------------------------------------
75 // tell the subclass that we decay the daughter:
77
78 // the K is the 1st daughter of the B EvtParticle.
79 // The decay mode of the allowed D (the one produced in b->c decay) is 2nd
80 // The decay mode of the suppressed D (the one produced in b->u decay) is 3rd
81 const int KIND = 0;
82 const int D1IND = 1;
83 const int D2IND = 2;
84
85 // generate kinematics of daughters (K and D):
86 EvtId tempDaug[2] = { getDaug( KIND ), getDaug( D1IND ) };
87 p->initializePhaseSpace( 2, tempDaug );
88
89 // Get the D daughter particle and the decay models of the allowed
90 // and suppressed D modes:
91 EvtParticle* theD = p->getDaug( D1IND );
92 EvtPto3P* model1 = (EvtPto3P*)( EvtDecayTable::getDecayFunc( theD ) );
93
94 // for the suppressed mode, re-initialize theD as the suppressed D alias:
95 theD->init( getDaug( D2IND ), theD->getP4() );
96 EvtPto3P* model2 = (EvtPto3P*)( EvtDecayTable::getDecayFunc( theD ) );
97
98 // on the first call:
99 if ( false == _decayedOnce )
100 {
101 _decayedOnce = true;
102
103 // store the D decay model pointers:
104 _model1 = model1;
105 _model2 = model2;
106
107 // check the decay models of the first 2 daughters and that they
108 // have the same final states:
109 std::string name1;
110 std::string name2;
111 model1->getName( name1 );
112 model2->getName( name2 );
113
114 if ( name1 != "PTO3P" )
115 {
116 report( ERROR, "EvtGen" )
117 << "D daughters of EvtBtoKD3P decay must decay via the \"PTO3P\" model" << endl
118 << " but found to decay via " << name1.c_str() << " or " << name2.c_str()
119 << ". Will terminate execution!" << endl;
120 assert( 0 );
121 }
122
123 EvtId* daugs1 = model1->getDaugs();
124 EvtId* daugs2 = model2->getDaugs();
125
126 bool idMatch = true;
127 int d;
128 for ( d = 0; d < 2; ++d )
129 {
130 if ( daugs1[d] != daugs2[d] ) { idMatch = false; }
131 }
132 if ( false == idMatch )
133 {
134 report( ERROR, "EvtGen" )
135 << "D daughters of EvtBtoKD3P decay must decay to the same final state" << endl
136 << " particles in the same order (not CP-conjugate order)," << endl
137 << " but they were found to decay to" << endl;
138 for ( d = 0; d < model1->getNDaug(); ++d )
139 { report( ERROR, "" ) << " " << EvtPDL::name( daugs1[d] ).c_str() << " "; }
140 report( ERROR, "" ) << endl;
141 for ( d = 0; d < model1->getNDaug(); ++d )
142 { report( ERROR, "" ) << " " << EvtPDL::name( daugs2[d] ).c_str() << " "; }
143 report( ERROR, "" ) << endl << ". Will terminate execution!" << endl;
144 assert( 0 );
145 }
146
147 // estimate the probmax. Need to know the probmax's of the 2
148 // models for this:
149 setProbMax( model1->getProbMax( 0 ) + _r * _r * model2->getProbMax( 0 ) +
150 2 * _r * sqrt( model1->getProbMax( 0 ) * model2->getProbMax( 0 ) ) );
151
152 } // end of things to do on the first call
153
154 // make sure the models haven't changed since the first call:
155 if ( _model1 != model1 || _model2 != model2 )
156 {
157 report( ERROR, "EvtGen" )
158 << "D daughters of EvtBtoKD3P decay should have only 1 decay modes, " << endl
159 << " but a new decay mode was found after the first call" << endl
160 << " Will terminate execution!" << endl;
161 assert( 0 );
162 }
163
164 // get the cover function for each of the models and add them up.
165 // They are summed with coefficients 1 because we are willing to
166 // take a small inefficiency (~50%) in order to ensure that the
167 // cover function is large enough without getting into complications
168 // associated with the smallness of _r:
169 EvtPdfSum<EvtDalitzPoint>* pc1 = model1->getPC();
170 EvtPdfSum<EvtDalitzPoint>* pc2 = model2->getPC();
172 pc.addTerm( 1.0, *pc1 );
173 pc.addTerm( 1.0, *pc2 );
174
175 // from this combined cover function, generate the Dalitz point:
177
178 // get the aptitude for each of the models on this point and add them up:
179 EvtComplex amp1 = model1->amplNonCP( x );
180 EvtComplex amp2 = model2->amplNonCP( x );
181 EvtComplex amp = amp1 + amp2 * _r * _exp;
182
183 // get the value of the cover function for this point and set the
184 // relative amplitude for this decay:
185
186 double comp = sqrt( pc.evaluate( x ) );
187 vertex( amp / comp );
188
189 // Make the daughters of theD:
190 theD->generateMassTree();
191
192 // Now generate the p4's of the daughters of theD:
193 std::vector<EvtVector4R> v = model2->initDaughters( x );
194
195 if ( v.size() != theD->getNDaug() )
196 {
197 report( ERROR, "EvtGen" ) << "Number of daughters " << theD->getNDaug() << " != "
198 << "Momentum vector size " << v.size() << endl
199 << " Terminating execution." << endl;
200 assert( 0 );
201 }
202
203 // Apply the new p4's to the daughters:
204 int i;
205 for ( i = 0; i < theD->getNDaug(); ++i )
206 { theD->getDaug( i )->init( model2->getDaugs()[i], v[i] ); }
207}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
void getName(std::string &model_name)
Definition EvtBtoKD3P.cc:46
bool _decayedOnce
Definition EvtBtoKD3P.hh:76
EvtDecayBase * clone()
Definition EvtBtoKD3P.cc:43
virtual void initProbMax()
Definition EvtBtoKD3P.cc:69
EvtComplex _exp
Definition EvtBtoKD3P.hh:71
virtual void init()
Definition EvtBtoKD3P.cc:49
virtual void decay(EvtParticle *p)
Definition EvtBtoKD3P.cc:74
const EvtDecayBase * _model2
Definition EvtBtoKD3P.hh:75
const EvtDecayBase * _model1
Definition EvtBtoKD3P.hh:74
double _r
Definition EvtBtoKD3P.hh:70
virtual ~EvtBtoKD3P()
Definition EvtBtoKD3P.cc:40
void vertex(const EvtComplex &amp)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
double getArg(int j)
void setProbMax(double prbmx)
double getProbMax(double prob)
void checkNDaug(int d1, int d2=-1)
EvtId * getDaugs()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
bool _daugsDecayedByParentModel
EvtId getDaug(int i)
static EvtDecayBase * getDecayFunc(EvtParticle *)
Definition EvtId.hh:27
EvtPdfSum< T > * getPC()
EvtComplex amplNonCP(const T &x)
static std::string name(EvtId i)
Definition EvtPDL.hh:70
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
const EvtVector4R & getP4() const
int getNDaug() const
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void generateMassTree()
void addTerm(double c, const EvtPdf< T > &pdf)
Definition EvtPdfSum.hh:29
virtual T randomPoint()
Definition EvtPdfSum.hh:104
double evaluate(const T &p) const
Definition EvtPdf.hh:64
void getName(std::string &model_name)
Definition EvtPto3P.hh:30
virtual std::vector< EvtVector4R > initDaughters(const EvtDalitzPoint &p) const
Definition EvtPto3P.cc:55