BOSS 8.0.0
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//
23#include "EvtHelAmp.hh"
32#include <stdlib.h>
33#include <string>
34using std::endl;
35
36EvtHelAmp::~EvtHelAmp() { delete _evalHelAmp; }
37
38void EvtHelAmp::getName( std::string& model_name ) { model_name = "HELAMP"; }
39
41
43
44 checkNDaug( 2 );
45
46 // find out how many states each particle have
50
51 if ( verbose() )
52 { report( INFO, "EvtGen" ) << "_nA,_nB,_nC:" << _nA << "," << _nB << "," << _nC << endl; }
53
54 // find out what 2 times the spin is
58
59 if ( verbose() )
60 {
61 report( INFO, "EvtGen" ) << "_JA2,_JB2,_JC2:" << _JA2 << "," << _JB2 << "," << _JC2
62 << endl;
63 }
64
65 // allocate memory
66 int* _lambdaA2 = new int[_nA];
67 int* _lambdaB2 = new int[_nB];
68 int* _lambdaC2 = new int[_nC];
69
70 EvtComplexPtr* _HBC = new EvtComplexPtr[_nB];
71 int ib, ic;
72 for ( ib = 0; ib < _nB; ib++ ) { _HBC[ib] = new EvtComplex[_nC]; }
73
74 int i;
75 // find the allowed helicities (actually 2*times the helicity!)
76 fillHelicity( _lambdaA2, _nA, _JA2, getParentId() );
77 fillHelicity( _lambdaB2, _nB, _JB2, getDaug( 0 ) );
78 fillHelicity( _lambdaC2, _nC, _JC2, getDaug( 1 ) );
79
80 if ( verbose() )
81 {
82 report( INFO, "EvtGen" ) << "Helicity states of particle A:" << endl;
83 for ( i = 0; i < _nA; i++ ) { report( INFO, "EvtGen" ) << _lambdaA2[i] << endl; }
84
85 report( INFO, "EvtGen" ) << "Helicity states of particle B:" << endl;
86 for ( i = 0; i < _nB; i++ ) { report( INFO, "EvtGen" ) << _lambdaB2[i] << endl; }
87
88 report( INFO, "EvtGen" ) << "Helicity states of particle C:" << endl;
89 for ( i = 0; i < _nC; i++ ) { report( INFO, "EvtGen" ) << _lambdaC2[i] << endl; }
90 }
91
92 // now read in the helicity amplitudes
93
94 int argcounter = 0;
95
96 for ( ib = 0; ib < _nB; ib++ )
97 {
98 for ( ic = 0; ic < _nC; ic++ )
99 {
100 _HBC[ib][ic] = 0.0;
101 if ( abs( _lambdaB2[ib] - _lambdaC2[ic] ) <= _JA2 ) argcounter += 2;
102 }
103 }
104
105 checkNArg( argcounter );
106
107 argcounter = 0;
108
109 for ( ib = 0; ib < _nB; ib++ )
110 {
111 for ( ic = 0; ic < _nC; ic++ )
112 {
113 if ( abs( _lambdaB2[ib] - _lambdaC2[ic] ) <= _JA2 )
114 {
115 _HBC[ib][ic] =
116 getArg( argcounter ) * exp( EvtComplex( 0.0, getArg( argcounter + 1 ) ) );
117 ;
118 argcounter += 2;
119 if ( verbose() )
120 {
121 report( INFO, "EvtGen" )
122 << "_HBC[" << ib << "][" << ic << "]=" << _HBC[ib][ic] << endl;
123 }
124 }
125 }
126 }
127
128 _evalHelAmp = new EvtEvalHelAmp( EvtPDL::getSpinType( getParentId() ),
130 EvtPDL::getSpinType( getDaug( 1 ) ), _HBC );
131
132 // Note: these are not class data members but local variables.
133 delete[] _lambdaA2;
134 delete[] _lambdaB2;
135 delete[] _lambdaC2;
136 for ( int ib = 0; ib < _nB; ib++ ) { delete[] _HBC[ib]; }
137 delete[] _HBC; // _HBC is copied in ctor of EvtEvalHelAmp above.
138}
139
141
142 double maxprob = _evalHelAmp->probMax();
143
144 if ( verbose() ) { report( INFO, "EvtGen" ) << "Calculated probmax" << maxprob << endl; }
145
146 setProbMax( maxprob );
147}
148
150
151 // first generate simple phase space
153
154 _evalHelAmp->evalAmp( p, _amp2 );
155
156 return;
157}
158
159void EvtHelAmp::fillHelicity( int* lambda2, int n, int J2, EvtId id ) {
160
161 int i;
162
163 // photon is special case!
164 if ( n == 2 && J2 == 2 )
165 {
166 lambda2[0] = 2;
167 lambda2[1] = -2;
168 return;
169 }
170
171 // and so is the neutrino!
172 if ( n == 1 && J2 == 1 )
173 {
174 if ( EvtPDL::getStdHep( id ) > 0 )
175 {
176 // particle i.e. lefthanded
177 lambda2[0] = -1;
178 }
179 else
180 {
181 // anti particle i.e. righthanded
182 lambda2[0] = 1;
183 }
184 return;
185 }
186
187 assert( n == J2 + 1 );
188
189 for ( i = 0; i < n; i++ ) { lambda2[i] = n - i * 2 - 1; }
190
191 return;
192}
const Int_t n
EvtComplex exp(const EvtComplex &c)
EvtComplex * EvtComplexPtr
Definition EvtComplex.hh:68
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ INFO
Definition EvtReport.hh:52
double getArg(int j)
void setProbMax(double prbmx)
EvtId getParentId()
void checkNDaug(int d1, int d2=-1)
EvtId * getDaugs()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
EvtId getDaug(int i)
virtual ~EvtHelAmp()
Definition EvtHelAmp.cc:36
void init()
Definition EvtHelAmp.cc:42
void decay(EvtParticle *p)
Definition EvtHelAmp.cc:149
void initProbMax()
Definition EvtHelAmp.cc:140
EvtDecayBase * clone()
Definition EvtHelAmp.cc:40
void getName(std::string &name)
Definition EvtHelAmp.cc:38
Definition EvtId.hh:27
static int getStdHep(EvtId id)
Definition EvtPDL.hh:61
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static int getSpin2(spintype stype)
static int getSpinStates(spintype stype)