BOSS 8.0.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//-----------------------------------------------------------------------
16#include "EvtPatches.hh"
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 "EvtComplex.hh"
27#include "EvtConst.hh"
28#include "EvtCyclic3.hh"
29#include "EvtDalitzFlatPdf.hh"
30#include "EvtDalitzResPdf.hh"
31#include "EvtFlatAmp.hh"
32#include "EvtId.hh"
33#include "EvtPDL.hh"
34#include "EvtPropBreitWigner.hh"
36#include "EvtPto3PAmp.hh"
37#include "EvtPto3PAmpFactory.hh"
38#include "EvtSpinType.hh"
39
40using namespace EvtCyclic3;
41
42void EvtPto3PAmpFactory::processAmp( EvtComplex c, std::vector<std::string> vv, bool conj ) {
43 if ( _verbose )
44 {
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
60 pdf = new EvtDalitzFlatPdf( _dp );
62 name = "NR";
63 }
64 else if ( vv[0] == "RESONANCE" )
65 {
66
67 EvtPto3PAmp* partAmp = 0;
68
69 // RESONANCE stanza
70
71 Pair pairRes = strToPair( vv[1].c_str() );
73 double mR, gR;
74 name = vv[2];
75 EvtId resId = EvtPDL::getId( vv[2] );
76 if ( _verbose ) printf( "Particles %s form resonance %s\n", vv[1].c_str(), vv[2].c_str() );
77
78 // If no valid particle name is given, assume that
79 // it is the spin, the mass and the width of the particle.
80
81 if ( resId.getId() == -1 )
82 {
83
84 switch ( atoi( vv[2].c_str() ) )
85 {
86
87 case 0: {
88 spinR = EvtSpinType::SCALAR;
89 break;
90 }
91 case 1: {
92 spinR = EvtSpinType::VECTOR;
93 break;
94 }
95 case 2: {
96 spinR = EvtSpinType::TENSOR;
97 break;
98 }
99 case 3: {
100 spinR = EvtSpinType::SPIN3;
101 break;
102 }
103 case 4: {
104 spinR = EvtSpinType::SPIN4;
105 break;
106 }
107 default: {
108 assert( 0 );
109 break;
110 }
111 }
112
113 mR = strtod( vv[3].c_str(), 0 );
114 gR = strtod( vv[4].c_str(), 0 );
115 i = 4;
116 }
117 else
118 {
119
120 // For a valid particle get spin, mass and width
121
122 spinR = EvtPDL::getSpinType( resId );
123 mR = EvtPDL::getMeanMass( resId );
124 gR = EvtPDL::getWidth( resId );
125 i = 2;
126
127 // It's possible to specify mass and width of a particle
128 // explicitly
129
130 if ( vv[3] != "ANGULAR" )
131 {
132
133 if ( _verbose )
134 printf( "Setting m(%s)=%s g(%s)=%s\n", vv[2].c_str(), vv[3].c_str(), vv[2].c_str(),
135 vv[4].c_str() );
136
137 mR = strtod( vv[3].c_str(), 0 );
138 gR = strtod( vv[4].c_str(), 0 );
139 i = 4;
140 }
141 }
142
143 // ANGULAR stanza
144
145 if ( vv[++i] != "ANGULAR" )
146 {
147
148 printf( "%s instead of ANGULAR\n", vv[i].c_str() );
149 exit( 0 );
150 }
151 Pair pairAng = strToPair( vv[++i].c_str() );
152 if ( _verbose ) printf( "Angle is measured between particles %s\n", vv[i].c_str() );
153
154 // TYPE stanza
155
156 assert( vv[++i] == "TYPE" );
157 std::string type = vv[++i];
158 if ( _verbose ) printf( "Propagator type %s\n", vv[i].c_str() );
159
160 if ( type == "NBW" )
161 {
162
163 EvtPropBreitWigner prop( mR, gR );
164 partAmp = new EvtPto3PAmp( _dp, pairAng, pairRes, spinR, prop, EvtPto3PAmp::NBW );
165 }
166 else if ( type == "RBW_ZEMACH" )
167 {
168
169 EvtPropBreitWignerRel prop( mR, gR );
170 partAmp = new EvtPto3PAmp( _dp, pairAng, pairRes, spinR, prop, EvtPto3PAmp::RBW_ZEMACH );
171 }
172 else if ( type == "RBW_KUEHN" )
173 {
174
175 EvtPropBreitWignerRel prop( mR, gR );
176 partAmp = new EvtPto3PAmp( _dp, pairAng, pairRes, spinR, prop, EvtPto3PAmp::RBW_KUEHN );
177 }
178 else if ( type == "RBW_CLEO" )
179 {
180
181 EvtPropBreitWignerRel prop( mR, gR );
182 partAmp = new EvtPto3PAmp( _dp, pairAng, pairRes, spinR, prop, EvtPto3PAmp::RBW_CLEO );
183 }
184 else assert( 0 );
185
186 // Optional DVFF, BVFF stanzas
187
188 if ( i < vv.size() - 1 )
189 {
190 if ( vv[i + 1] == "DVFF" )
191 {
192 i++;
193 if ( vv[++i] == "BLATTWEISSKOPF" )
194 {
195
196 double R = strtod( vv[++i].c_str(), 0 );
197 partAmp->set_fd( R );
198 }
199 else assert( 0 );
200 }
201 }
202
203 if ( i < vv.size() - 1 )
204 {
205 if ( vv[i + 1] == "BVFF" )
206 {
207 i++;
208 if ( vv[++i] == "BLATTWEISSKOPF" )
209 {
210
211 if ( _verbose ) printf( "BVFF=%s\n", vv[i].c_str() );
212 double R = strtod( vv[++i].c_str(), 0 );
213 partAmp->set_fb( R );
214 }
215 else assert( 0 );
216 }
217 }
218
219 i++;
220
221 pdf = new EvtDalitzResPdf( _dp, mR, gR, pairRes );
222 amp = partAmp;
223 }
224
225 assert( amp );
226 assert( pdf );
227
228 if ( !conj )
229 {
230
231 _amp->addOwnedTerm( c, amp );
232 _pc->addOwnedTerm( abs2( c ), pdf );
233 }
234 else
235 {
236
237 _ampConj->addOwnedTerm( c, amp );
238 delete pdf;
239 }
240 _names.push_back( name );
241}
Evt3Rank3C conj(const Evt3Rank3C &t2)
double abs2(const EvtComplex &c)
EvtPdfSum< EvtDalitzPoint > * _pc
EvtAmplitudeSum< EvtDalitzPoint > * _ampConj
EvtAmplitudeSum< EvtDalitzPoint > * _amp
std::vector< std::string > _names
Definition EvtId.hh:27
int getId() const
Definition EvtId.hh:40
static double getWidth(EvtId i)
Definition EvtPDL.hh:59
static double getMeanMass(EvtId i)
Definition EvtPDL.hh:43
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272
virtual void processAmp(EvtComplex c, std::vector< std::string > vv, bool conj)
void set_fb(double R)
void set_fd(double R)
Pair strToPair(const char *str)
char * c_str(Index i)