Converting TEvtGen to native cmake
[u/mrichter/AliRoot.git] / TEvtGen / EvtGen / EvtGenModels / EvtSVVCP.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: EvtSVVCP.cc
12//
13// Description: The decay of a scalar to two vector particles are
14// performed with CP violation. E.g. B->J/psi K*.
15//
16// Modification history:
17//
18// RYD January 19, 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/EvtPDL.hh"
28#include "EvtGenModels/EvtSVVHelAmp.hh"
29#include "EvtGenBase/EvtReport.hh"
30#include "EvtGenModels/EvtSVVCP.hh"
31#include "EvtGenBase/EvtId.hh"
32#include <string>
33#include "EvtGenBase/EvtConst.hh"
34
35EvtSVVCP::~EvtSVVCP() {}
36
37std::string EvtSVVCP::getName(){
38
39 return "SVV_CP";
40
41}
42
43
44EvtDecayBase* EvtSVVCP::clone(){
45
46 return new EvtSVVCP;
47
48}
49
50void EvtSVVCP::init(){
51
52 // check that there are 9 arguments
53 checkNArg(9);
54 checkNDaug(2);
55
56 checkSpinParent(EvtSpinType::SCALAR);
57
58 checkSpinDaughter(0,EvtSpinType::VECTOR);
59 checkSpinDaughter(1,EvtSpinType::VECTOR);
60
61}
62
63void EvtSVVCP::initProbMax(){
64
65 //This is probably not quite right, but it should do as a start...
66 //Anders
67
68 setProbMax(2*(getArg(3)*getArg(3)+getArg(5)*getArg(5)+getArg(7)*getArg(7)));
69
70}
71
72void EvtSVVCP::decay( EvtParticle *p){
73
74 //added by Lange Jan4,2000
75 static EvtId B0=EvtPDL::getId("B0");
76 static EvtId B0B=EvtPDL::getId("anti-B0");
77
78 double t;
79 EvtId other_b;
80
0ca57c2f 81 EvtCPUtil::getInstance()->OtherB(p,t,other_b,0.5);
da0e9ce3 82
83 EvtComplex G0P,G1P,G1M;
84
85 G1P=EvtComplex(getArg(3)*cos(getArg(4)),getArg(3)*sin(getArg(4)));
86 G0P=EvtComplex(getArg(5)*cos(getArg(6)),getArg(5)*sin(getArg(6)));
87 G1M=EvtComplex(getArg(7)*cos(getArg(8)),getArg(7)*sin(getArg(8)));
88
89 EvtComplex lambda_km=EvtComplex(cos(-2*getArg(0)),sin(-2*getArg(0)));
90
91 double cdmt=cos(getArg(1)*t/(2*EvtConst::c));
92 double sdmt=sin(getArg(1)*t/(2*EvtConst::c));
93
94 EvtComplex cG0P,cG1P,cG1M;
95
96 if (other_b==B0B){
97 cG0P=G0P*(cdmt+lambda_km*EvtComplex(0.0,getArg(2)*sdmt));
98 cG1P=G1P*(cdmt+lambda_km*EvtComplex(0.0,getArg(2)*sdmt));
99 cG1M=G1M*(cdmt-lambda_km*EvtComplex(0.0,getArg(2)*sdmt));
100 }
101 if (other_b==B0){
102 cG0P=G0P*(cdmt+(1.0/lambda_km)*EvtComplex(0.0,getArg(2)*sdmt));
103 cG1P=G1P*(cdmt+(1.0/lambda_km)*EvtComplex(0.0,getArg(2)*sdmt));
104 cG1M=-G1M*(cdmt-(1.0/lambda_km)*EvtComplex(0.0,getArg(2)*sdmt));
105
106 }
107
108 EvtComplex A0,AP,AM;
109
110 A0=cG0P/sqrt(2.0);
111 AP=(cG1P+cG1M)/sqrt(2.0);
112 AM=(cG1P-cG1M)/sqrt(2.0);
113
114 EvtSVVHelAmp::SVVHel(p,_amp2,getDaug(0),getDaug(1),AP,A0,AM);
115
116 return ;
117}
118
0ca57c2f 119std::string EvtSVVCP::getParamName(int i) {
120 switch(i) {
121 case 0:
122 return "weakPhase";
123 case 1:
124 return "deltaM";
125 case 2:
126 return "eta";
127 case 3:
128 return "G1Plus";
129 case 4:
130 return "G1PlusPhase";
131 case 5:
132 return "G0Plus";
133 case 6:
134 return "G0PlusPhase";
135 case 7:
136 return "G1Minus";
137 case 8:
138 return "G1MinusPhase";
139 default:
140 return "";
141 }
142}
143
144std::string EvtSVVCP::getParamDefault(int i) {
145 switch(i) {
146 case 3:
147 return "1.0";
148 case 4:
149 return "0.0";
150 case 5:
151 return "1.0";
152 case 6:
153 return "0.0";
154 case 7:
155 return "1.0";
156 case 8:
157 return "0.0";
158 default:
159 return "";
160 }
161}