]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGen/EvtGenModels/EvtSVSCP.cpp
Converting TEvtGen to native cmake
[u/mrichter/AliRoot.git] / TEvtGen / EvtGen / EvtGenModels / EvtSVSCP.cpp
CommitLineData
da0e9ce3 1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtSVSCP.cc
12//
13// Description: Routine to decay scalar -> vectors scalar
14// and has CP violation.
15//
16// Modification history:
17//
18// RYD Febuary 10, 1997 Module created
19//
20//------------------------------------------------------------------------
21//
22#include "EvtGenBase/EvtPatches.hh"
23#include <stdlib.h>
24#include "EvtGenBase/EvtParticle.hh"
25#include "EvtGenBase/EvtGenKine.hh"
26#include "EvtGenBase/EvtCPUtil.hh"
27#include "EvtGenBase/EvtVector4C.hh"
28#include "EvtGenBase/EvtPDL.hh"
29#include "EvtGenBase/EvtReport.hh"
30#include "EvtGenModels/EvtSVSCP.hh"
31#include <string>
32#include "EvtGenBase/EvtConst.hh"
33
34EvtSVSCP::~EvtSVSCP() {}
35
36std::string EvtSVSCP::getName(){
37
38 return "SVS_CP";
39
40}
41
42
43EvtDecayBase* EvtSVSCP::clone(){
44
45 return new EvtSVSCP;
46
47}
48
49void EvtSVSCP::init(){
50
51 // check that there are 7 arguments
52 checkNArg(7);
53 checkNDaug(2);
54
55 checkSpinParent(EvtSpinType::SCALAR);
56
57 checkSpinDaughter(0,EvtSpinType::VECTOR);
58 checkSpinDaughter(1,EvtSpinType::SCALAR);
59
60
61}
62
63
64void EvtSVSCP::initProbMax(){
65
66 //This is probably not quite right, but it should do as a start...
67 //Anders
68
69 setProbMax(2*(getArg(3)*getArg(3)+getArg(5)*getArg(5)));
70
71}
72
73
74void EvtSVSCP::decay( EvtParticle *p ){
75
76 //added by Lange Jan4,2000
77 static EvtId B0=EvtPDL::getId("B0");
78 static EvtId B0B=EvtPDL::getId("anti-B0");
79
80 EvtParticle *v;
81 p->initializePhaseSpace(getNDaug(),getDaugs());
82 v = p->getDaug(0);
83 EvtVector4R momv = v->getP4();
84 EvtVector4R moms = p->getDaug(1)->getP4();
85 double massv = v->mass();
86 double t;
87 EvtId other_b;
88
0ca57c2f 89 EvtCPUtil::getInstance()->OtherB(p,t,other_b,0.5);
da0e9ce3 90
91 EvtComplex amp;
92
93 EvtComplex A,Abar;
94
95 A=EvtComplex(getArg(3)*cos(getArg(4)),getArg(3)*sin(getArg(4)));
96 Abar=EvtComplex(getArg(5)*cos(getArg(6)),getArg(5)*sin(getArg(6)));
97
98 if (other_b==B0B){
99 amp=A*cos(getArg(1)*t/(2*EvtConst::c))+
100 EvtComplex(cos(-2.0*getArg(0)),sin(-2.0*getArg(0)))*
101 getArg(2)*EvtComplex(0.0,1.0)*Abar*sin(getArg(1)*t/(2*EvtConst::c));
102 }
103 if (other_b==B0){
104 amp=A*EvtComplex(cos(2.0*getArg(0)),sin(2.0*getArg(0)))*
105 EvtComplex(0.0,1.0)*sin(getArg(1)*t/(2*EvtConst::c))+
106 getArg(2)*Abar*cos(getArg(1)*t/(2*EvtConst::c));
107 }
108
109 EvtVector4R p4_parent;
110
111 p4_parent=momv+moms;
112
113 double norm=massv/(momv.d3mag()*p4_parent.mass());
114
115 vertex(0,amp*norm*p4_parent*(v->epsParent(0)));
116 vertex(1,amp*norm*p4_parent*(v->epsParent(1)));
117 vertex(2,amp*norm*p4_parent*(v->epsParent(2)));
118
119 return ;
120}
121
0ca57c2f 122std::string EvtSVSCP::getParamName(int i) {
123 switch(i) {
124 case 0:
125 return "weakPhase";
126 case 1:
127 return "deltaM";
128 case 2:
129 return "finalStateCP";
130 case 3:
131 return "Af";
132 case 4:
133 return "AfPhase";
134 case 5:
135 return "Abarf";
136 case 6:
137 return "AbarfPhase";
138 default:
139 return "";
140 }
141}
142
143std::string EvtSVSCP::getParamDefault(int i) {
144 switch(i) {
145 case 3:
146 return "1.0";
147 case 4:
148 return "0.0";
149 case 5:
150 return "1.0";
151 case 6:
152 return "0.0";
153 default:
154 return "";
155 }
156}