]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/EvtPto3PAmpSmpResolution.cxx
AliDecayer realisation for the EvtGen code and EvtGen itself.
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtPto3PAmpSmpResolution.cxx
1 #include "EvtGenBase/EvtPatches.hh"
2 /*******************************************************************************
3  * Project: BaBar detector at the SLAC PEP-II B-factory
4  * Package: EvtGenBase
5  *  Author: D. Dujmic, ddujmic@slac.stanford.edu
6  *
7  * Copyright (C) 2005 SLAC
8  *
9  *******************************************************************************/
10
11 #include <assert.h>
12 #include <math.h>
13 #include <iostream>
14 #include "EvtGenBase/EvtComplex.hh"
15 #include "EvtGenBase/EvtPto3PAmpSmpResolution.hh"
16 #include "EvtGenBase/EvtPto3PAmp.hh"
17 #include "EvtGenBase/EvtDalitzCoord.hh"
18 #include "EvtGenBase/EvtCyclic3.hh"
19 using std::cout;
20 using std::endl;
21 using EvtCyclic3::Index;
22 using EvtCyclic3::Pair;
23
24
25
26 EvtPto3PAmpSmpResolution::EvtPto3PAmpSmpResolution(EvtDalitzPlot dp, Pair pairAng, Pair pairRes, 
27                                                    EvtSpinType::spintype spin, 
28                                                    const EvtPropagator& prop, NumType typeN) 
29   : EvtPto3PAmp(dp, pairAng, pairRes, spin, prop, typeN)
30 {}
31
32
33
34 EvtPto3PAmpSmpResolution::EvtPto3PAmpSmpResolution(const EvtPto3PAmp& other) 
35   : EvtPto3PAmp(other)
36 {}
37
38
39 EvtPto3PAmpSmpResolution::~EvtPto3PAmpSmpResolution()
40 {}
41
42
43 EvtComplex 
44 EvtPto3PAmpSmpResolution::evalPropagator(double m) const
45 {
46   EvtComplex prop(0,0);
47   
48   if (_sigma>0) { // convolved
49     int nconv=20;
50     double min=m+_bias-_sigma*2.5;
51     double max=m+_bias+_sigma*2.5;
52     double dm=(max-min)/nconv;
53     static double  sqrt2pi = sqrt(2*3.14159);
54     double ifact = 1./(sqrt2pi*_sigma);
55     for (int i=0;i<nconv; i++) {
56       double mprime = min+dm*(i+0.5);
57       double t = (mprime-m)/_sigma;
58       prop += ifact * exp(-0.5*t*t)*EvtPto3PAmp::evalPropagator(m)*dm;
59     }
60   } else {
61     prop = EvtPto3PAmp::evalPropagator(m);
62   }
63
64   return prop;
65 }