BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtPto3PAmpFactory.cc
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// File and Version Information:
3// $Id: EvtPto3PAmpFactory.cc,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
4//
5// Environment:
6// This software is part of the EvtGen package developed jointly
7// for the BaBar and CLEO collaborations. If you use all or part
8// of it, please give an appropriate acknowledgement.
9//
10// Copyright Information:
11// Copyright (C) 1998 Caltech, UCSB
12//
13// Module creator:
14// Alexei Dvoretskii, Caltech, 2001-2002.
15//-----------------------------------------------------------------------
17
18// AmpFactory for building a P -> 3P decay
19// (pseudoscalar to three pseudoscalars)
20
21#include <assert.h>
22#include <math.h>
23#include <stdio.h>
24#include <stdlib.h>
25
26#include "EvtGenBase/EvtId.hh"
27#include "EvtGenBase/EvtPDL.hh"
39
40using namespace EvtCyclic3;
41
42void EvtPto3PAmpFactory::processAmp(EvtComplex c, std::vector<std::string> vv, bool conj)
43{
44 if(_verbose) {
45
46 printf("Make amplitude\n");
47 unsigned i;
48 for(i=0;i<vv.size();i++) printf("%s\n",vv[i].c_str());
49 printf("\n");
50 }
51
54 std::string name;
55
56 int i;
57 if(vv[0] == "PHASESPACE") {
58
59 pdf = new EvtDalitzFlatPdf(_dp);
61 name = "NR";
62 }
63 else if(vv[0] == "RESONANCE") {
64
65 EvtPto3PAmp* partAmp = 0;
66
67 // RESONANCE stanza
68
69 Pair pairRes = strToPair(vv[1].c_str());
71 double mR, gR;
72 name = vv[2];
73 EvtId resId = EvtPDL::getId(vv[2]);
74 if(_verbose) printf("Particles %s form resonance %s\n",vv[1].c_str(),vv[2].c_str());
75
76 // If no valid particle name is given, assume that
77 // it is the spin, the mass and the width of the particle.
78
79 if(resId.getId() == -1) {
80
81 switch(atoi(vv[2].c_str())) {
82
83 case 0: { spinR = EvtSpinType::SCALAR; break; }
84 case 1: { spinR = EvtSpinType::VECTOR; break; }
85 case 2: { spinR = EvtSpinType::TENSOR; break; }
86 case 3: { spinR = EvtSpinType::SPIN3; break; }
87 case 4: { spinR = EvtSpinType::SPIN4; break; }
88 default: { assert(0); break; }
89 }
90
91 mR = strtod(vv[3].c_str(),0);
92 gR = strtod(vv[4].c_str(),0);
93 i = 4;
94 }
95 else {
96
97 // For a valid particle get spin, mass and width
98
99 spinR = EvtPDL::getSpinType(resId);
100 mR = EvtPDL::getMeanMass(resId);
101 gR = EvtPDL::getWidth(resId);
102 i = 2;
103
104 // It's possible to specify mass and width of a particle
105 // explicitly
106
107 if(vv[3] != "ANGULAR") {
108
109 if(_verbose)
110 printf("Setting m(%s)=%s g(%s)=%s\n",
111 vv[2].c_str(),vv[3].c_str(),vv[2].c_str(),vv[4].c_str());
112
113 mR = strtod(vv[3].c_str(),0);
114 gR = strtod(vv[4].c_str(),0);
115 i = 4;
116 }
117 }
118
119 // ANGULAR stanza
120
121 if(vv[++i] != "ANGULAR") {
122
123 printf("%s instead of ANGULAR\n",vv[i].c_str());
124 exit(0);
125 }
126 Pair pairAng = strToPair(vv[++i].c_str());
127 if(_verbose) printf("Angle is measured between particles %s\n",vv[i].c_str());
128
129 // TYPE stanza
130
131 assert(vv[++i] == "TYPE");
132 std::string type = vv[++i];
133 if(_verbose) printf("Propagator type %s\n",vv[i].c_str());
134
135 if(type == "NBW") {
136
137 EvtPropBreitWigner prop(mR,gR);
138 partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::NBW);
139 }
140 else if(type == "RBW_ZEMACH") {
141
142 EvtPropBreitWignerRel prop(mR,gR);
143 partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_ZEMACH);
144 }
145 else if(type == "RBW_KUEHN") {
146
147 EvtPropBreitWignerRel prop(mR,gR);
148 partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_KUEHN);
149 }
150 else if(type == "RBW_CLEO") {
151
152 EvtPropBreitWignerRel prop(mR,gR);
153 partAmp = new EvtPto3PAmp(_dp,pairAng,pairRes,spinR,prop,EvtPto3PAmp::RBW_CLEO);
154 }
155 else assert(0);
156
157 // Optional DVFF, BVFF stanzas
158
159 if(i < vv.size() - 1) {
160 if(vv[i+1] == "DVFF") {
161 i++;
162 if(vv[++i] == "BLATTWEISSKOPF") {
163
164 double R = strtod(vv[++i].c_str(),0);
165 partAmp->set_fd(R);
166 }
167 else assert(0);
168 }
169 }
170
171 if(i < vv.size() - 1) {
172 if(vv[i+1] == "BVFF") {
173 i++;
174 if(vv[++i] == "BLATTWEISSKOPF") {
175
176 if(_verbose) printf("BVFF=%s\n",vv[i].c_str());
177 double R = strtod(vv[++i].c_str(),0);
178 partAmp->set_fb(R);
179 }
180 else assert(0);
181 }
182 }
183
184 i++;
185
186 pdf = new EvtDalitzResPdf(_dp,mR,gR,pairRes);
187 amp = partAmp;
188 }
189
190 assert(amp);
191 assert(pdf);
192
193 if(!conj) {
194
195 _amp->addOwnedTerm(c,amp);
196 _pc->addOwnedTerm(abs2(c),pdf);
197 }
198 else {
199
200 _ampConj->addOwnedTerm(c,amp);
201 delete pdf;
202 }
203 _names.push_back(name);
204}
205
206
207
Evt3Rank3C conj(const Evt3Rank3C &t2)
Definition: Evt3Rank3C.cc:175
double abs2(const EvtComplex &c)
Definition: EvtComplex.hh:221
EvtPdfSum< EvtDalitzPoint > * _pc
EvtAmplitudeSum< EvtDalitzPoint > * _ampConj
EvtAmplitudeSum< EvtDalitzPoint > * _amp
std::vector< std::string > _names
void addOwnedTerm(EvtComplex c, EvtAmplitude< T > *amp)
Definition: EvtId.hh:27
int getId() const
Definition: EvtId.hh:41
static double getWidth(EvtId i)
Definition: EvtPDL.hh:54
static double getMeanMass(EvtId i)
Definition: EvtPDL.hh:45
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.hh:61
static EvtId getId(const std::string &name)
Definition: EvtPDL.cc:287
void addOwnedTerm(double c, EvtPdf< T > *pdf)
Definition: EvtPdfSum.hh:35
Definition: EvtPdf.hh:57
virtual void processAmp(EvtComplex c, std::vector< std::string > vv, bool conj)
void set_fb(double R)
Definition: EvtPto3PAmp.cc:62
void set_fd(double R)
Definition: EvtPto3PAmp.cc:57
Pair strToPair(const char *str)
Definition: EvtCyclic3.cc:243
char * c_str(Index i)
Definition: EvtCyclic3.cc:252