1 //--------------------------------------------------------------------------
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.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtHelAmp.cc
13 // Description: Decay model for implementation of generic 2 body
14 // decay specified by the helicity amplitudes
17 // Modification history:
19 // RYD March 14, 1999 Module created
21 //------------------------------------------------------------------------
23 #include "EvtGenBase/EvtPatches.hh"
25 #include "EvtGenBase/EvtParticle.hh"
26 #include "EvtGenBase/EvtGenKine.hh"
27 #include "EvtGenBase/EvtPDL.hh"
28 #include "EvtGenBase/EvtReport.hh"
29 #include "EvtGenModels/EvtHelAmp.hh"
30 #include "EvtGenBase/EvtId.hh"
32 #include "EvtGenBase/EvtConst.hh"
33 #include "EvtGenBase/EvtEvalHelAmp.hh"
37 EvtHelAmp::~EvtHelAmp() {
43 std::string EvtHelAmp::getName(){
50 EvtDecayBase* EvtHelAmp::clone(){
56 void EvtHelAmp::init(){
61 //find out how many states each particle have
62 int _nA=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getParentId()));
63 int _nB=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getDaug(0)));
64 int _nC=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getDaug(1)));
67 report(INFO,"EvtGen")<<"_nA,_nB,_nC:"
68 <<_nA<<","<<_nB<<","<<_nC<<endl;
71 //find out what 2 times the spin is
72 int _JA2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getParentId()));
73 int _JB2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getDaug(0)));
74 int _JC2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getDaug(1)));
77 report(INFO,"EvtGen")<<"_JA2,_JB2,_JC2:"
78 <<_JA2<<","<<_JB2<<","<<_JC2<<endl;
82 int* _lambdaA2=new int[_nA];
83 int* _lambdaB2=new int[_nB];
84 int* _lambdaC2=new int[_nC];
86 EvtComplexPtr* _HBC=new EvtComplexPtr[_nB];
87 for(int ib=0;ib<_nB;ib++){
88 _HBC[ib]=new EvtComplex[_nC];
92 //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));
99 report(INFO,"EvtGen")<<"Helicity states of particle A:"<<endl;
101 report(INFO,"EvtGen")<<_lambdaA2[i]<<endl;
104 report(INFO,"EvtGen")<<"Helicity states of particle B:"<<endl;
106 report(INFO,"EvtGen")<<_lambdaB2[i]<<endl;
109 report(INFO,"EvtGen")<<"Helicity states of particle C:"<<endl;
111 report(INFO,"EvtGen")<<_lambdaC2[i]<<endl;
115 //now read in the helicity amplitudes
119 for(int ib=0;ib<_nB;ib++){
120 for(int ic=0;ic<_nC;ic++){
122 if (abs(_lambdaB2[ib]-_lambdaC2[ic])<=_JA2) argcounter+=2;
126 checkNArg(argcounter);
130 for(int ib=0;ib<_nB;ib++){
131 for(int 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)));;
136 report(INFO,"EvtGen")<<"_HBC["<<ib<<"]["<<ic<<"]="
137 <<_HBC[ib][ic]<<endl;
143 _evalHelAmp=new EvtEvalHelAmp(getParentId(),
148 // Note: these are not class data members but local variables.
152 for(int ib=0;ib<_nB;ib++){
155 delete [] _HBC; // _HBC is copied in ctor of EvtEvalHelAmp above.
160 void EvtHelAmp::initProbMax(){
162 double maxprob=_evalHelAmp->probMax();
165 report(INFO,"EvtGen")<<"Calculated probmax"<<maxprob<<endl;
173 void EvtHelAmp::decay( EvtParticle *p){
175 //first generate simple phase space
176 p->initializePhaseSpace(getNDaug(),getDaugs());
178 _evalHelAmp->evalAmp(p,_amp2);
185 void EvtHelAmp::fillHelicity(int* lambda2,int n,int J2, EvtId id){
189 //photon is special case!
196 //and so is the neutrino!
198 if (EvtPDL::getStdHep(id)>0){
199 //particle i.e. lefthanded
202 //anti particle i.e. righthanded