Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:20:02

0001 
0002 /***********************************************************************
0003 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
0004 *                                                                      *
0005 * This file is part of EvtGen.                                         *
0006 *                                                                      *
0007 * EvtGen is free software: you can redistribute it and/or modify       *
0008 * it under the terms of the GNU General Public License as published by *
0009 * the Free Software Foundation, either version 3 of the License, or    *
0010 * (at your option) any later version.                                  *
0011 *                                                                      *
0012 * EvtGen is distributed in the hope that it will be useful,            *
0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
0015 * GNU General Public License for more details.                         *
0016 *                                                                      *
0017 * You should have received a copy of the GNU General Public License    *
0018 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
0019 ***********************************************************************/
0020 
0021 #ifndef EVTFLATTE_HH
0022 #define EVTFLATTE_HH
0023 
0024 #include "EvtGenBase/EvtComplex.hh"
0025 #include "EvtGenBase/EvtVector4R.hh"
0026 
0027 #include <vector>
0028 
0029 using std::vector;
0030 
0031 // Helper class
0032 
0033 class EvtFlatteParam {
0034   public:
0035     EvtFlatteParam( double m1, double m2, double g ) :
0036         _m1( m1 ), _m2( m2 ), _g( g )
0037     {
0038     }
0039 
0040     inline double m1() const { return _m1; }
0041     inline double m2() const { return _m2; }
0042     inline double g() const { return _g; }
0043 
0044   private:
0045     double _m1, _m2, _g;
0046 };
0047 
0048 //class declaration
0049 
0050 class EvtFlatte final {
0051   public:
0052     //operator
0053     EvtFlatte& operator=( const EvtFlatte& );
0054 
0055     //constructor with all information about the resonance
0056     EvtFlatte( const EvtVector4R& p4_p, const EvtVector4R& p4_d1,
0057                const EvtVector4R& p4_d2, double ampl, double theta, double mass,
0058                vector<EvtFlatteParam>& params
0059                //           double m1a = 0.0, double m1b = 0.0, double g1 = 0.0,
0060                //           double m2a = 0.0, double m2b = 0.0, double g2 = 0.0
0061     );
0062 
0063     //accessors
0064     //return 4-momenta of the particles involved
0065     inline const EvtVector4R& p4_p() { return _p4_p; }
0066     inline const EvtVector4R& p4_d1() { return _p4_d1; }
0067     inline const EvtVector4R& p4_d2() { return _p4_d2; }
0068 
0069     //return amplitude
0070     inline double amplitude() { return _ampl; }
0071 
0072     //return theta
0073     inline double theta() { return _theta; }
0074 
0075     //return bwm
0076     inline double mass() { return _mass; }
0077 
0078     //functions
0079 
0080     //calculate amplitude for this resonance
0081     EvtComplex resAmpl();
0082 
0083   private:
0084     inline EvtComplex sqrtCplx( double in )
0085     {
0086         return ( in > 0 ) ? EvtComplex( sqrt( in ), 0 )
0087                           : EvtComplex( 0, sqrt( -in ) );
0088     }
0089 
0090     EvtVector4R _p4_p, _p4_d1, _p4_d2;
0091     double _ampl, _theta, _mass;
0092     vector<EvtFlatteParam> _params;
0093     //      double _m1a, _m1b, _g1;
0094     //      double _m2a, _m2b, _g2;
0095 };
0096 
0097 #endif