00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "EvtGenBase/EvtPatches.hh"
00017
00018
00019
00020
00021 #include <assert.h>
00022 #include <math.h>
00023 #include <stdio.h>
00024 #include <stdlib.h>
00025
00026 #include "EvtGenBase/EvtId.hh"
00027 #include "EvtGenBase/EvtPDL.hh"
00028 #include "EvtGenBase/EvtConst.hh"
00029 #include "EvtGenBase/EvtComplex.hh"
00030 #include "EvtGenBase/EvtCyclic3.hh"
00031 #include "EvtGenBase/EvtSpinType.hh"
00032 #include "EvtGenBase/EvtPto3PAmp.hh"
00033 #include "EvtGenBase/EvtFlatAmp.hh"
00034 #include "EvtGenBase/EvtPto3PAmpFactory.hh"
00035 #include "EvtGenBase/EvtPropBreitWigner.hh"
00036 #include "EvtGenBase/EvtPropBreitWignerRel.hh"
00037 #include "EvtGenBase/EvtDalitzResPdf.hh"
00038 #include "EvtGenBase/EvtDalitzFlatPdf.hh"
00039
00040 using namespace EvtCyclic3;
00041
00042 void EvtPto3PAmpFactory::processAmp(EvtComplex c, std::vector<std::string> vv, bool conj)
00043 {
00044 if(_verbose) {
00045
00046 printf("Make amplitude\n");
00047 unsigned i;
00048 for(i=0;i<vv.size();i++) printf("%s\n",vv[i].c_str());
00049 printf("\n");
00050 }
00051
00052 EvtAmplitude<EvtDalitzPoint>* amp = 0;
00053 EvtPdf<EvtDalitzPoint>* pdf = 0;
00054 std::string name;
00055
00056 int i;
00057 if(vv[0] == "PHASESPACE") {
00058
00059 pdf = new EvtDalitzFlatPdf(_dp);
00060 amp = new EvtFlatAmp<EvtDalitzPoint>();
00061 name = "NR";
00062 }
00063 else if(vv[0] == "RESONANCE") {
00064
00065 EvtPto3PAmp* partAmp = 0;
00066
00067
00068
00069 Pair pairRes = strToPair(vv[1].c_str());
00070 EvtSpinType::spintype spinR;
00071 double mR, gR;
00072 name = vv[2];
00073 EvtId resId = EvtPDL::getId(vv[2]);
00074 if(_verbose) printf("Particles %s form resonance %s\n",vv[1].c_str(),vv[2].c_str());
00075
00076
00077
00078
00079 if(resId.getId() == -1) {
00080
00081 switch(atoi(vv[2].c_str())) {
00082
00083 case 0: { spinR = EvtSpinType::SCALAR; break; }
00084 case 1: { spinR = EvtSpinType::VECTOR; break; }
00085 case 2: { spinR = EvtSpinType::TENSOR; break; }
00086 case 3: { spinR = EvtSpinType::SPIN3; break; }
00087 case 4: { spinR = EvtSpinType::SPIN4; break; }
00088 default: { assert(0); break; }
00089 }
00090
00091 mR = strtod(vv[3].c_str(),0);
00092 gR = strtod(vv[4].c_str(),0);
00093 i = 4;
00094 }
00095 else {
00096
00097
00098
00099 spinR = EvtPDL::getSpinType(resId);
00100 mR = EvtPDL::getMeanMass(resId);
00101 gR = EvtPDL::getWidth(resId);
00102 i = 2;
00103
00104
00105
00106
00107 if(vv[3] != "ANGULAR") {
00108
00109 if(_verbose)
00110 printf("Setting m(%s)=%s g(%s)=%s\n",
00111 vv[2].c_str(),vv[3].c_str(),vv[2].c_str(),vv[4].c_str());
00112
00113 mR = strtod(vv[3].c_str(),0);
00114 gR = strtod(vv[4].c_str(),0);
00115 i = 4;
00116 }
00117 }
00118
00119
00120
00121 if(vv[++i] != "ANGULAR") {
00122
00123 printf("%s instead of ANGULAR\n",vv[i].c_str());
00124 exit(0);
00125 }
00126 Pair pairAng = strToPair(vv[++i].c_str());
00127 if(_verbose) printf("Angle is measured between particles %s\n",vv[i].c_str());
00128
00129
00130
00131 assert(vv[++i] == "TYPE");
00132 std::string type = vv[++i];
00133 if(_verbose) printf("Propagator type %s\n",vv[i].c_str());
00134
00135 if(type == "NBW") {
00136
00137 EvtPropBreitWigner prop(mR,gR);
00138 partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::NBW);
00139 }
00140 else if(type == "RBW_ZEMACH") {
00141
00142 EvtPropBreitWignerRel prop(mR,gR);
00143 partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_ZEMACH);
00144 }
00145 else if(type == "RBW_KUEHN") {
00146
00147 EvtPropBreitWignerRel prop(mR,gR);
00148 partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_KUEHN);
00149 }
00150 else if(type == "RBW_CLEO") {
00151
00152 EvtPropBreitWignerRel prop(mR,gR);
00153 partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_CLEO);
00154 }
00155 else assert(0);
00156
00157
00158
00159 if(i < vv.size() - 1) {
00160 if(vv[i+1] == "DVFF") {
00161 i++;
00162 if(vv[++i] == "BLATTWEISSKOPF") {
00163
00164 double R = strtod(vv[++i].c_str(),0);
00165 partAmp->set_fd(R);
00166 }
00167 else assert(0);
00168 }
00169 }
00170
00171 if(i < vv.size() - 1) {
00172 if(vv[i+1] == "BVFF") {
00173 i++;
00174 if(vv[++i] == "BLATTWEISSKOPF") {
00175
00176 if(_verbose) printf("BVFF=%s\n",vv[i].c_str());
00177 double R = strtod(vv[++i].c_str(),0);
00178 partAmp->set_fb(R);
00179 }
00180 else assert(0);
00181 }
00182 }
00183
00184 i++;
00185
00186 pdf = new EvtDalitzResPdf(_dp,mR,gR,pairRes);
00187 amp = partAmp;
00188 }
00189
00190 assert(amp);
00191 assert(pdf);
00192
00193 if(!conj) {
00194
00195 _amp->addOwnedTerm(c,amp);
00196 _pc->addOwnedTerm(abs2(c),pdf);
00197 }
00198 else {
00199
00200 _ampConj->addOwnedTerm(c,amp);
00201 delete pdf;
00202 }
00203 _names.push_back(name);
00204 }
00205
00206
00207