Converting TEvtGen to native cmake
[u/mrichter/AliRoot.git] / TEvtGen / EvtGen / EvtGenModels / EvtBaryonPCR.cpp
CommitLineData
0ca57c2f 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:
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtBaryonVminusA.cc
12//
13// Description: Routine to implement semileptonic decays using realistic
14// dynamics. The form factors are from
15// M.Pervin,S.Capstick,W. Roberts, Phys.Rev. C72 035201(2005).
16//
17//
18// Modification history:
19//
20// R.J. Tesarek May 28, 2004 Module created
21// Karen Gibson 1/20/2006 Module updated for 1/2+->1/2+,
22// 1/2+->1/2-, 1/2+->3/2- Lambda decays
23//
24//------------------------------------------------------------------------
25
26#include "EvtGenBase/EvtPatches.hh"
27#include <stdlib.h>
28#include "EvtGenBase/EvtParticle.hh"
29#include "EvtGenBase/EvtGenKine.hh"
30#include "EvtGenBase/EvtPDL.hh"
31#include "EvtGenBase/EvtReport.hh"
32#include "EvtGenModels/EvtBaryonPCR.hh"
33#include "EvtGenBase/EvtConst.hh"
34#include "EvtGenBase/EvtIdSet.hh"
35#include <string>
36#include "EvtGenModels/EvtBaryonPCRFF.hh"
37
38using namespace std;
39#ifdef D0
40#undef D0
41#endif
42EvtBaryonPCR::EvtBaryonPCR():
43 baryonpcrffmodel(0)
44 ,calcamp(0)
45{}
46
47
48EvtBaryonPCR::~EvtBaryonPCR() {
49 delete baryonpcrffmodel;
50 baryonpcrffmodel=0;
51 delete calcamp;
52 calcamp=0;
53}
54
55std::string EvtBaryonPCR::getName(){
56
57 return "BaryonPCR";
58
59}
60
61
62
63EvtDecayBase* EvtBaryonPCR::clone(){
64
65 return new EvtBaryonPCR;
66
67}
68
69void EvtBaryonPCR::decay( EvtParticle *p ){
70
71 //This is a kludge to avoid warnings because the K_2* mass becomes to large.
72 static EvtIdSet regenerateMasses("K_2*+","K_2*-","K_2*0","anti-K_2*0",
73 "K_1+","K_1-","K_10","anti-K_10",
74 "D'_1+","D'_1-","D'_10","anti-D'_10");
75
76 if (regenerateMasses.contains(getDaug(0))){
77 p->resetFirstOrNot();
78 }
79
80 p->initializePhaseSpace(getNDaug(),getDaugs());
81
82 EvtComplex r00(getArg(0), 0.0 );
83 EvtComplex r01(getArg(1), 0.0 );
84 EvtComplex r10(getArg(2), 0.0 );
85 EvtComplex r11(getArg(3), 0.0 );
86
87 calcamp->CalcAmp(p,_amp2,baryonpcrffmodel, r00, r01, r10, r11);
88
89}
90
91void EvtBaryonPCR::initProbMax() {
92
93 // Baryons (partial list 5/28/04)
94
95 static EvtId SIGC0=EvtPDL::getId("Sigma_c0");
96 static EvtId SIGC0B=EvtPDL::getId("anti-Sigma_c0");
97 static EvtId SIGCP=EvtPDL::getId("Sigma_c+");
98 static EvtId SIGCM=EvtPDL::getId("anti-Sigma_c-");
99 static EvtId SIGCPP=EvtPDL::getId("Sigma_c++");
100 static EvtId SIGCMM=EvtPDL::getId("anti-Sigma_c--");
101 static EvtId LAMCP=EvtPDL::getId("Lambda_c+");
102 static EvtId LAMCM=EvtPDL::getId("anti-Lambda_c-");
103 static EvtId LAMC1P=EvtPDL::getId("Lambda_c(2593)+");
104 static EvtId LAMC1M=EvtPDL::getId("anti-Lambda_c(2593)-");
105 static EvtId LAMC2P=EvtPDL::getId("Lambda_c(2625)+");
106 static EvtId LAMC2M=EvtPDL::getId("anti-Lambda_c(2625)-");
107 static EvtId LAMB=EvtPDL::getId("Lambda_b0");
108 static EvtId LAMBB=EvtPDL::getId("anti-Lambda_b0");
109
110 EvtId parnum,barnum,lnum;
111
112 parnum = getParentId();
113 barnum = getDaug(0);
114 lnum = getDaug(1);
115
116 if( parnum==LAMB || parnum==LAMBB ) {
117 if( barnum==LAMCP|| barnum==LAMCM
118 || barnum==LAMC1P || barnum==LAMC1M || barnum==LAMC2P || barnum==LAMC2M
119 || barnum==SIGC0 || barnum==SIGC0B || barnum==SIGCP || barnum==SIGCM
120 || barnum==SIGCPP || barnum==SIGCMM ) {
121 setProbMax(22000.0);
122 return;
123 }
124 }
125
126 //This is a real cludge.. (ryd)
127 setProbMax(0.0);
128
129}
130
131void EvtBaryonPCR::init(){
132
133 //if (getNArg()!=0) {
134 if (getNArg()!=4) {
135
136 report(ERROR,"EvtGen") << "EvtBaryonPCR generator expected "
137 << " 4 arguments but found:"<<getNArg()<<endl;
138 //<< " 0 arguments but found:"<<getNArg()<<endl;
139 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
140 ::abort();
141
142 }
143
144 if ( getNDaug()!=3 ) {
145 report(ERROR,"EvtGen")
146 << "Wrong number of daughters in EvtBaryonPCR.cc "
147 << " 3 daughters expected but found: "<<getNDaug()<<endl;
148 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
149 ::abort();
150 }
151
152
153 //We expect the parent to be a scalar
154 //and the daughters to be X lepton neutrino
155
156 EvtSpinType::spintype parenttype=EvtPDL::getSpinType(getParentId());
157 EvtSpinType::spintype baryontype=EvtPDL::getSpinType(getDaug(0));
158 EvtSpinType::spintype leptontype=EvtPDL::getSpinType(getDaug(1));
159 EvtSpinType::spintype neutrinotype=EvtPDL::getSpinType(getDaug(2));
160
161 if ( parenttype != EvtSpinType::DIRAC ) {
162 report(ERROR,"EvtGen") << "EvtBaryonPCR generator expected "
163 << " a DIRAC parent, found:"<<
164 EvtPDL::name(getParentId())<<endl;
165 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
166 ::abort();
167 }
168 if ( leptontype != EvtSpinType::DIRAC ) {
169 report(ERROR,"EvtGen") << "EvtBaryonPCR generator expected "
170 << " a DIRAC 2nd daughter, found:"<<
171 EvtPDL::name(getDaug(1))<<endl;
172 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
173 ::abort();
174 }
175 if ( neutrinotype != EvtSpinType::NEUTRINO ) {
176 report(ERROR,"EvtGen") << "EvtBaryonPCR generator expected "
177 << " a NEUTRINO 3rd daughter, found:"<<
178 EvtPDL::name(getDaug(2))<<endl;
179 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
180 ::abort();
181 }
182
183 baryonpcrffmodel = new EvtBaryonPCRFF;
184
185 if ( baryontype==EvtSpinType::DIRAC
186 || baryontype==EvtSpinType::RARITASCHWINGER) {
187 calcamp = new EvtSemiLeptonicBaryonAmp;
188 }
189 else {
190 report(ERROR,"EvtGen")
191 << "Wrong baryon spin type in EvtBaryonPCR.cc "
192 << "Expected spin type " << EvtSpinType::DIRAC
193 << ", found spin type " << baryontype <<endl;
194 report(ERROR,"EvtGen") << "Will terminate execution!" <<endl;
195 ::abort();
196 }
197
198}
199