LCOV - code coverage report
Current view: top level - TEvtGen/EvtGen/EvtGenBase - EvtFlatte.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 29 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 7 0.0 %

          Line data    Source code
       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: See EvtGen/COPYRIGHT
       9             : //      Copyright (C) 1998      Caltech, UCSB
      10             : //
      11             : // Module: EvtFlatte.cc
      12             : //
      13             : // Description: resonance-defining class 
      14             : //
      15             : // Modification history:
      16             : //
      17             : //    ponyisi  18 Feb 2008  created
      18             : //
      19             : //------------------------------------------------------------------------
      20             : // 
      21             : #include "EvtGenBase/EvtPatches.hh"
      22             : #include <math.h>
      23             : #include "EvtGenBase/EvtVector4R.hh"
      24             : #include "EvtGenBase/EvtKine.hh"
      25             : #include "EvtGenBase/EvtComplex.hh"
      26             : #include "EvtGenBase/EvtFlatte.hh"
      27             : #include "EvtGenBase/EvtReport.hh"
      28             : #include "EvtGenBase/EvtConst.hh"
      29             : 
      30           0 : EvtFlatte::~EvtFlatte(){}
      31             : 
      32             : //operator
      33             : 
      34             : EvtFlatte& EvtFlatte::operator = ( const EvtFlatte  &n)
      35             : {
      36           0 :   if ( &n == this ) return *this;
      37           0 :   _p4_p = n._p4_p;
      38           0 :   _p4_d1 = n._p4_d1;
      39           0 :   _p4_d2 = n._p4_d2;
      40           0 :   _ampl = n._ampl;
      41           0 :   _theta = n._theta;
      42           0 :   _mass = n._mass;
      43           0 :   _params = n._params;
      44             :   //  _m1a = n._m1a;
      45             :   //  _m1b = n._m1b;
      46             :   //  _g1 = n._g1;
      47             :   //  _m2a = n._m2a;
      48             :   //  _m2b = n._m2b;
      49             :   //  _g2 = n._g2;
      50           0 :   return  *this;
      51           0 : }
      52             : 
      53             : //constructor
      54             :  
      55             : EvtFlatte::EvtFlatte(const EvtVector4R& p4_p, const EvtVector4R& p4_d1,
      56             :                      const  EvtVector4R& p4_d2, double ampl,
      57             :                      double theta, double mass, 
      58             :                      vector<EvtFlatteParam>& params
      59             :                      //                   double m1a, double m1b, double g1,
      60             :                      //                   double m2a, double m2b, double g2
      61             :                      ): 
      62           0 :   _p4_p(p4_p),_p4_d1(p4_d1), _p4_d2(p4_d2), _ampl(ampl), _theta(theta), 
      63           0 :   _mass(mass),
      64           0 :   _params(params)
      65             :   //  _m1a(m1a), _m1b(m1b), _g1(g1),
      66             :   //  _m2a(m2a), _m2b(m2b), _g2(g2)
      67           0 : {}
      68             : 
      69             : //amplitude function
      70             : 
      71             : EvtComplex EvtFlatte::resAmpl() {
      72             :  
      73           0 :   double pi180inv = 1.0/EvtConst::radToDegrees;
      74             : 
      75             :   //   EvtComplex ampl(cos(_theta*pi180inv), sin(_theta*pi180inv));
      76             :   //   ampl *= _ampl;
      77             : 
      78             :   // SCALARS ONLY
      79           0 :   double mR = (_p4_d1+_p4_d2).mass();
      80             : 
      81           0 :   EvtComplex w;
      82             : 
      83           0 :   for (vector<EvtFlatteParam>::const_iterator param = _params.begin();
      84           0 :        param != _params.end();
      85           0 :        ++param) {
      86             : 
      87           0 :     double m1 = (*param).m1(); double m2 = (*param).m2(); 
      88           0 :     double g = (*param).g();
      89           0 :     w += (g*g
      90           0 :           *sqrtCplx((1-((m1-m2)*(m1-m2))/(mR*mR))*
      91           0 :                     (1-((m1+m2)*(m1+m2))/(mR*mR))));
      92             :     //     cout << m1 << " " << mR << " " << w << endl;
      93             :   }
      94             : 
      95           0 :   EvtComplex denom = _mass*_mass - mR*mR - EvtComplex(0,1)*w;
      96           0 :   EvtComplex ampl = _ampl*EvtComplex(cos(_theta*pi180inv), sin(_theta*pi180inv))/denom;
      97             :   //  cout << abs(1/denom) << endl;
      98             :   return ampl;
      99           0 : }
     100             : 
     101             : 

Generated by: LCOV version 1.11