BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtHelAmp.cc
Go to the documentation of this file.
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: EvtHelAmp.cc
12//
13// Description: Decay model for implementation of generic 2 body
14// decay specified by the helicity amplitudes
15//
16//
17// Modification history:
18//
19// RYD March 14, 1999 Module created
20//
21//------------------------------------------------------------------------
22//
24#include <stdlib.h>
27#include "EvtGenBase/EvtPDL.hh"
30#include "EvtGenBase/EvtId.hh"
31#include <string>
34using std::endl;
35
36
38
39 delete _evalHelAmp;
40
41}
42
43void EvtHelAmp::getName(std::string& model_name){
44
45 model_name="HELAMP";
46
47}
48
49
51
52 return new EvtHelAmp;
53
54}
55
57
58 checkNDaug(2);
59
60
61 //find out how many states each particle have
65
66 if (verbose()){
67 report(INFO,"EvtGen")<<"_nA,_nB,_nC:"
68 <<_nA<<","<<_nB<<","<<_nC<<endl;
69 }
70
71 //find out what 2 times the spin is
75
76 if (verbose()){
77 report(INFO,"EvtGen")<<"_JA2,_JB2,_JC2:"
78 <<_JA2<<","<<_JB2<<","<<_JC2<<endl;
79 }
80
81 //allocate memory
82 int* _lambdaA2=new int[_nA];
83 int* _lambdaB2=new int[_nB];
84 int* _lambdaC2=new int[_nC];
85
86 EvtComplexPtr* _HBC=new EvtComplexPtr[_nB];
87 int ib,ic;
88 for(ib=0;ib<_nB;ib++){
89 _HBC[ib]=new EvtComplex[_nC];
90 }
91
92 int i;
93 //find the allowed helicities (actually 2*times the helicity!)
94 fillHelicity(_lambdaA2,_nA,_JA2,getParentId());
95 fillHelicity(_lambdaB2,_nB,_JB2,getDaug(0));
96 fillHelicity(_lambdaC2,_nC,_JC2,getDaug(1));
97
98 if (verbose()){
99 report(INFO,"EvtGen")<<"Helicity states of particle A:"<<endl;
100 for(i=0;i<_nA;i++){
101 report(INFO,"EvtGen")<<_lambdaA2[i]<<endl;
102 }
103
104 report(INFO,"EvtGen")<<"Helicity states of particle B:"<<endl;
105 for(i=0;i<_nB;i++){
106 report(INFO,"EvtGen")<<_lambdaB2[i]<<endl;
107 }
108
109 report(INFO,"EvtGen")<<"Helicity states of particle C:"<<endl;
110 for(i=0;i<_nC;i++){
111 report(INFO,"EvtGen")<<_lambdaC2[i]<<endl;
112 }
113 }
114
115 //now read in the helicity amplitudes
116
117 int argcounter=0;
118
119 for(ib=0;ib<_nB;ib++){
120 for(ic=0;ic<_nC;ic++){
121 _HBC[ib][ic]=0.0;
122 if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) argcounter+=2;
123 }
124 }
125
126 checkNArg(argcounter);
127
128 argcounter=0;
129
130 for(ib=0;ib<_nB;ib++){
131 for(ic=0;ic<_nC;ic++){
132 if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) {
133 _HBC[ib][ic]=getArg(argcounter)*exp(EvtComplex(0.0,getArg(argcounter+1)));;
134 argcounter+=2;
135 if (verbose()){
136 report(INFO,"EvtGen")<<"_HBC["<<ib<<"]["<<ic<<"]="
137 <<_HBC[ib][ic]<<endl;
138 }
139 }
140 }
141 }
142
146 _HBC);
147
148 // Note: these are not class data members but local variables.
149 delete [] _lambdaA2;
150 delete [] _lambdaB2;
151 delete [] _lambdaC2;
152 for(int ib=0;ib<_nB;ib++){
153 delete [] _HBC[ib];
154 }
155 delete [] _HBC; // _HBC is copied in ctor of EvtEvalHelAmp above.
156
157}
158
159
161
162 double maxprob=_evalHelAmp->probMax();
163
164 if (verbose()){
165 report(INFO,"EvtGen")<<"Calculated probmax"<<maxprob<<endl;
166 }
167
168 setProbMax(maxprob);
169
170}
171
172
174
175 //first generate simple phase space
177
178 _evalHelAmp->evalAmp(p,_amp2);
179
180 return ;
181
182}
183
184
185void EvtHelAmp::fillHelicity(int* lambda2,int n,int J2, EvtId id){
186
187 int i;
188
189 //photon is special case!
190 if (n==2&&J2==2) {
191 lambda2[0]=2;
192 lambda2[1]=-2;
193 return;
194 }
195
196 //and so is the neutrino!
197 if (n==1&&J2==1) {
198 if (EvtPDL::getStdHep(id)>0){
199 //particle i.e. lefthanded
200 lambda2[0]=-1;
201 }else{
202 //anti particle i.e. righthanded
203 lambda2[0]=1;
204 }
205 return;
206 }
207
208 assert(n==J2+1);
209
210 for(i=0;i<n;i++){
211 lambda2[i]=n-i*2-1;
212 }
213
214 return;
215
216}
217
218
219
220
221
222
223
const Int_t n
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ INFO
Definition: EvtReport.hh:52
EvtAmp _amp2
Definition: EvtDecayAmp.hh:66
double getArg(int j)
void setProbMax(double prbmx)
EvtId getParentId()
Definition: EvtDecayBase.hh:60
void checkNDaug(int d1, int d2=-1)
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
EvtId getDaug(int i)
Definition: EvtDecayBase.hh:66
double probMax()
void evalAmp(EvtParticle *p, EvtAmp &amp)
virtual ~EvtHelAmp()
Definition: EvtHelAmp.cc:37
void init()
Definition: EvtHelAmp.cc:56
void decay(EvtParticle *p)
Definition: EvtHelAmp.cc:173
void initProbMax()
Definition: EvtHelAmp.cc:160
EvtDecayBase * clone()
Definition: EvtHelAmp.cc:50
void getName(std::string &name)
Definition: EvtHelAmp.cc:43
Definition: EvtId.hh:27
static int getStdHep(EvtId id)
Definition: EvtPDL.hh:56
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.hh:61
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static int getSpin2(spintype stype)
Definition: EvtSpinType.hh:34
static int getSpinStates(spintype stype)
Definition: EvtSpinType.hh:64