]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGen/EvtGenModels/EvtBToDDalitzCPK.cpp
Converting TEvtGen to native cmake
[u/mrichter/AliRoot.git] / TEvtGen / EvtGen / EvtGenModels / EvtBToDDalitzCPK.cpp
CommitLineData
0ca57c2f 1// $Id: EvtBToDDalitzCPK.cpp,v 1.2 2009-03-16 16:28:42 robbep Exp $
2// Include files
3#include "EvtGenBase/EvtPDL.hh"
4#include "EvtGenBase/EvtParticle.hh"
5#include "EvtGenBase/EvtVector4C.hh"
6
7// local
8#include "EvtGenModels/EvtBToDDalitzCPK.hh"
9
10//-----------------------------------------------------------------------------
11// Implementation file for class : EvtBToDDalitzCPK
12// Decay Model for B->D0K with D0->Ks pi+ pi-
13// it is just a way to get the arguments...
14// Works also for other B->D0K decays...
15// 2003-12-08 : Patrick Robbe
16//-----------------------------------------------------------------------------
17
18//=============================================================================
19// Standard destructor
20//=============================================================================
21EvtBToDDalitzCPK::~EvtBToDDalitzCPK ( ) { }
22//=============================================================================
23// Name of the model
24//=============================================================================
25std::string EvtBToDDalitzCPK::getName( )
26{
27 return "BTODDALITZCPK" ;
28}
29//=============================================================================
30// Clone method
31//=============================================================================
32EvtDecayBase * EvtBToDDalitzCPK::clone ( )
33{
34 return new EvtBToDDalitzCPK ;
35}
36//=============================================================================
37// Initialisation method
38//=============================================================================
39void EvtBToDDalitzCPK::init ( )
40{
41 // Check that there are 3 arguments
42 checkNArg( 3 ) ;
43 // Check that there are 2 daughters
44 checkNDaug( 2 ) ;
45 // Check that the particles of the decay are :
46 // B+/- -> D0/bar K+/-
47 // B+/- -> K+/- D0/bar
48 // B0/bar -> K*0/bar D0/bar
49 // and nothing else ...
50 static EvtId BP = EvtPDL::getId( "B+" ) ;
51 static EvtId BM = EvtPDL::getId( "B-" ) ;
52 static EvtId B0 = EvtPDL::getId( "B0" ) ;
53 static EvtId B0B = EvtPDL::getId( "anti-B0" ) ;
54 static EvtId KP = EvtPDL::getId( "K+" ) ;
55 static EvtId KM = EvtPDL::getId( "K-" ) ;
56 static EvtId KS = EvtPDL::getId( "K*0" ) ;
57 static EvtId KSB = EvtPDL::getId( "anti-K*0" ) ;
58 static EvtId D0 = EvtPDL::getId( "D0" ) ;
59 static EvtId D0B = EvtPDL::getId( "anti-D0" ) ;
60
61 _flag = 0 ;
62
63 EvtId parent = getParentId() ;
64 EvtId d1 = getDaug( 0 ) ;
65 EvtId d2 = getDaug( 1 ) ;
66
67 if ( ( ( parent == BP ) || ( parent == BM ) ) &&
68 ( ( d1 == D0 ) || ( d1 == D0B ) ) &&
69 ( ( d2 == KP ) || ( d2 == KM ) ) ) {
70 _flag = 1 ;
71 // PHSP Decay
72 }
73 else if ( ( ( parent == BP ) || ( parent == BM ) ) &&
74 ( ( d1 == KP ) || ( d1 == KM ) ) &&
75 ( ( d2 == D0 ) || ( d2 == D0B ) ) ) {
76 _flag = 1 ;
77 // also PHSP decay
78 }
79 else if ( ( ( parent == B0 ) || ( parent == B0B ) ) &&
80 ( ( d1 == KS ) || ( d1 == KSB ) ) &&
81 ( ( d2 == D0 ) || ( d2 == D0B ) ) ) {
82 _flag = 2 ;
83 // SVS Decay
84 }
85
86 if ( _flag == 0 ) {
87 report( ERROR , "EvtGen" ) << "EvtBToDDalitzCPK : Invalid mode."
88 << std::endl ;
89 assert( 0 ) ;
90 }
91}
92//=============================================================================
93// Set prob max
94//=============================================================================
95void EvtBToDDalitzCPK::initProbMax( )
96{
97 if ( _flag == 1 ) {
98 // PHSP
99 setProbMax ( 0. ) ;
100 }
101 else if ( _flag == 2 ) {
102 // SVS
103 setProbMax ( 1.0 ) ;
104 }
105}
106//=============================================================================
107// decay particle
108//=============================================================================
109void EvtBToDDalitzCPK::decay( EvtParticle * p )
110{
111 if ( _flag == 1 ) {
112 // PHSP
113 p -> initializePhaseSpace( getNDaug() , getDaugs() ) ;
114 vertex ( 0. ) ;
115 }
116 else if ( _flag == 2 ) {
117 // SVS
118 p->initializePhaseSpace(getNDaug(),getDaugs());
119
120 EvtParticle *v;
121 v = p->getDaug(0);
122 double massv = v->mass();
123 EvtVector4R momv = v->getP4();
124 EvtVector4R moms = p->getDaug(1)->getP4();
125 double m_parent = p->mass();
126 EvtVector4R p4_parent = momv+moms;
127
128 double norm=massv/(momv.d3mag()*m_parent);
129 p4_parent = norm*p4_parent;
130 vertex(0,p4_parent*(v->epsParent(0)));
131 vertex(1,p4_parent*(v->epsParent(1)));
132 vertex(2,p4_parent*(v->epsParent(2)));
133 }
134}
135
136