diff --git a/EvtGenBase/EvtDecayBase.hh b/EvtGenBase/EvtDecayBase.hh
index a5e2410..fe195bb 100644
--- a/EvtGenBase/EvtDecayBase.hh
+++ b/EvtGenBase/EvtDecayBase.hh
@@ -1,148 +1,148 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTDECAYBASE_HH
 #define EVTDECAYBASE_HH
 
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 
 #include <stdlib.h>
 #include <string>
 #include <vector>
 class EvtParticle;
 class EvtSpinType;
 
 class EvtDecayBase {
   public:
     //These pure virtual methods has to be implemented
     //by any derived class
     virtual std::string getName() const = 0;
     virtual void decay( EvtParticle* p ) = 0;
     virtual void makeDecay( EvtParticle* p, bool recursive = true ) = 0;
     virtual EvtDecayBase* clone() const = 0;
 
     //These virtual methods can be implemented by the
     //derived class to implement nontrivial functionality.
     virtual void init();
     virtual void initProbMax();
     virtual std::string commandName();
     virtual void command( std::string cmd );
 
     virtual std::string getParamName( int i );
     virtual std::string getParamDefault( int i );
 
     double getProbMax( double prob );
     double resetProbMax( double prob );
 
     EvtDecayBase() = default;
     virtual ~EvtDecayBase() = default;
 
     virtual bool matchingDecay( const EvtDecayBase& other ) const;
 
     EvtId getParentId() const { return m_parent; }
     double getBranchingFraction() const { return m_brfr; }
     void disableCheckQ() { m_chkCharge = false; };
     void checkQ();
     int getNDaug() const { return m_ndaug; }
     const EvtId* getDaugs() const { return m_daug.data(); }
     EvtId getDaug( int i ) const { return m_daug[i]; }
     int getNArg() const { return m_narg; }
     bool getFSR() const { return m_fsr; }
     void setFSR() { m_fsr = true; }
     void setVerbose() { m_verbose = true; }
     void setSummary() { m_summary = true; }
     double* getArgs();
     std::string* getArgsStr() { return m_args.data(); }
     double getArg( unsigned int j );
     double getStoredArg( int j ) const { return m_storedArgs.at( j ); }
     double getNStoredArg() const { return m_storedArgs.size(); }
     std::string getArgStr( int j ) const { return m_args[j]; }
     std::string getModelName() const { return m_modelname; }
     int getDSum() const { return m_dsum; }
     bool summary() const { return m_summary; }
     bool verbose() const { return m_verbose; }
 
     void saveDecayInfo( EvtId ipar, int ndaug, const EvtId* daug, int narg,
                         std::vector<std::string>& args, std::string name,
                         double brfr );
     void printSummary() const;
     void printInfo() const;
 
     //Does not really belong here but I don't have a better place.
-    static void findMasses( EvtParticle* p, int ndaugs, EvtId daugs[10],
+    static void findMasses( EvtParticle* p, int ndaugs, const EvtId daugs[10],
                             double masses[10] );
     static void findMass( EvtParticle* p );
     static double findMaxMass( EvtParticle* p );
 
     //Methods to set the maximum probability.
     void setProbMax( double prbmx );
     void noProbMax();
 
     void checkNArg( int a1, int a2 = -1, int a3 = -1, int a4 = -1 );
     void checkNDaug( int d1, int d2 = -1 );
 
     void checkSpinParent( EvtSpinType::spintype sp );
     void checkSpinDaughter( int d1, EvtSpinType::spintype sp );
 
     // lange - some models can take more daughters
     // than they really have to fool aliases (VSSBMIX for example)
     virtual int nRealDaughters() const { return m_ndaug; }
 
   protected:
     bool m_daugsDecayedByParentModel;
     bool daugsDecayedByParentModel() const
     {
         return m_daugsDecayedByParentModel;
     }
 
   private:
     std::vector<double> m_storedArgs;
     std::vector<EvtId> m_daug;
     std::vector<double> m_argsD;
     std::vector<std::string> m_args;
 
     std::string m_modelname = "**********";
 
     EvtId m_parent = EvtId( -1, -1 );
     int m_ndaug = 0;
     int m_narg = 0;
     double m_brfr = 0;
     int m_dsum = 0;
 
     bool m_fsr = false;
     bool m_summary = false;
     bool m_verbose = false;
 
     // The default is that the user module does _not_ set any probmax.
     bool m_defaultprobmax = true;
     int m_ntimes_prob = 0;
     double m_probmax = 0.0;
 
     //Should charge conservation be checked when model is created?
     //Default is to check that charge is conserved
     bool m_chkCharge = true;
 
     //These are used for gathering statistics.
     double m_sum_prob = 0.0;
     double m_max_prob = 0.0;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBBScalar.hh b/EvtGenModels/EvtBBScalar.hh
index dbe0cb5..c3facb5 100644
--- a/EvtGenModels/EvtBBScalar.hh
+++ b/EvtGenModels/EvtBBScalar.hh
@@ -1,151 +1,151 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBBSCALAR_HH
 #define EVTBBSCALAR_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtDiracParticle.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtScalarParticle.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <bitset>
 #include <map>
 #include <string>
 #include <vector>
 
 // Implementation of the decay B- -> lambda p_bar pi according to
 // hep-ph/0204185, hep-ph/0211240
 // This model is intended to be applicable to all decays of the type B-> baryon baryon scalar
 
 class EvtBBScalar : public EvtDecayAmp {
   public:
     EvtBBScalar();
-    std::string getName() override;
-    EvtBBScalar* clone() override;
+    std::string getName() const override;
+    EvtBBScalar* clone() const override;
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
   private:
     struct FormFactor {
         double m_value;
         double m_sigma1;
         double m_sigma2;
         double m_mV;
     };
 
     enum Baryons
     {
         Lambda,
         Proton,
         Neutron,
         Sigma0,
         Sigma_minus,
         Xi0,
         Xi_minus,
         nBaryons
     };
 
     // used values of constants
     static const EvtComplex m_I;
     static const EvtComplex m_V_ub;
     static const EvtComplex m_V_us_star;
     static const EvtComplex m_a1;
     static const EvtComplex m_V_tb;
     static const EvtComplex m_V_ts_star;
     static const EvtComplex m_a4;
     static const EvtComplex m_a6;
 
     // used parameters in the calculation of the magnetic form factors
     static const double m_x[];
     static const double m_y[];
     // quark masses as used in the model
     static const double m_ms;
     static const double m_mu;
     static const double m_mb;
 
     // used to choose the right m_value for the form factor depending on the type of scalar
     std::string m_scalarType;
     mutable std::map<std::string, FormFactor> m_f0Map;
     mutable std::map<std::string, FormFactor> m_f1Map;
 
     // only consider F1+F2 here
     std::bitset<nBaryons> m_baryonCombination;
     void setKnownBaryonTypes( const EvtId& baryon );
 
     double B_pi_f1( double t ) const;
     double B_pi_f0( double t ) const;
     double baryonF1F2( double t ) const;
     double G_p( double t ) const;
     double G_n( double t ) const;
 
     double baryon_gA( double t ) const;
     double baryon_hA( double t ) const;
     double baryon_gP( double t ) const;
     double baryon_fS( double t ) const;
 
     double D_A( double t ) const;
     double F_A( double t ) const;
     double D_P( double t ) const;
     double F_P( double t ) const;
     double D_S( double t ) const;
     double F_S( double t ) const;
 
     // (mB1 - mB2)/(mq1 - mq1)
     double m_massRatio;
     double m_baryonMassSum;
     double formFactorFit( double t, const std::vector<double>& params ) const;
 
     static const EvtComplex m_const_B;
     static const EvtComplex m_const_C;
     const EvtVector4C amp_A( const EvtVector4R& p4B, const EvtVector4R& p4Scalar );
     const EvtComplex amp_B( const EvtDiracParticle* baryon1,
                             const EvtDiracSpinor& b1Pol,
                             const EvtDiracParticle* baryon2,
                             const EvtDiracSpinor& b2Pol, int index );
     const EvtComplex amp_B_vectorPart( const EvtDiracParticle* baryon1,
                                        const EvtDiracSpinor& b1Pol,
                                        const EvtDiracParticle* baryon2,
                                        const EvtDiracSpinor& b2Pol, int index );
     const EvtComplex amp_B_axialPart( const EvtDiracParticle* baryon1,
                                       const EvtDiracSpinor& b1Pol,
                                       const EvtDiracParticle* baryon2,
                                       const EvtDiracSpinor& b2Pol, int index );
     const EvtComplex amp_C( const EvtDiracParticle* baryon1,
                             const EvtDiracSpinor& b1Pol,
                             const EvtDiracParticle* baryon2,
                             const EvtDiracSpinor& b2Pol, int index );
     const EvtComplex amp_C_scalarPart( const EvtDiracSpinor& b1Pol,
                                        const EvtDiracSpinor& b2Pol, double t );
     const EvtComplex amp_C_pseudoscalarPart( const EvtDiracSpinor& b1Pol,
                                              const EvtDiracSpinor& b2Pol,
                                              double t );
 
     // initialize phasespace and calculate the amplitude for one (i=0,1) state of the photon
     EvtComplex calcAmpliude( const EvtParticle* p, const unsigned int polState );
 };
 
 #endif
diff --git a/EvtGenModels/EvtBLLNuL.hh b/EvtGenModels/EvtBLLNuL.hh
index ca92952..c7fc33e 100644
--- a/EvtGenModels/EvtBLLNuL.hh
+++ b/EvtGenModels/EvtBLLNuL.hh
@@ -1,52 +1,52 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBLLNUL_HH
 #define EVTBLLNUL_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include "EvtGenModels/EvtBLLNuLAmp.hh"
 
 #include <string>
 
 class EvtParticle;
 class EvtbTosllMSFF;    // Form factor class
 
 // Description: The header file for the model "BLLNUL" which simulates
 //              the rare four-leptonic B-decays
 //              B^-(p) -> ell^+(k_1) ell^-(k_2) neu (k_3) ell^-(k_4)
 
 class EvtBLLNuL : public EvtDecayAmp {
   public:
     EvtBLLNuL();
 
-    virtual std::string getName() override;
-    virtual EvtDecayBase* clone() override;
+    virtual std::string getName() const override;
+    virtual EvtDecayBase* clone() const override;
 
     virtual void init() override;
     virtual void initProbMax() override;
     virtual void decay( EvtParticle* p ) override;
 
   private:
     EvtBLLNuLAmp m_calcAmp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBTo3piCP.hh b/EvtGenModels/EvtBTo3piCP.hh
index c91ef04..c13f749 100644
--- a/EvtGenModels/EvtBTo3piCP.hh
+++ b/EvtGenModels/EvtBTo3piCP.hh
@@ -1,47 +1,47 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTO3PICP_HH
 #define EVTBTO3PICP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtBTo3hCP.hh"
 
 class EvtParticle;
 
 class EvtBTo3piCP : public EvtDecayAmp {
   public:
     EvtBTo3piCP() {}
 
-    std::string getName() override;
-    EvtBTo3piCP* clone() override;
+    std::string getName() const override;
+    EvtBTo3piCP* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     EvtBTo3hCP m_generator;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBTo4piCP.hh b/EvtGenModels/EvtBTo4piCP.hh
index a034d8e..0777c07 100644
--- a/EvtGenModels/EvtBTo4piCP.hh
+++ b/EvtGenModels/EvtBTo4piCP.hh
@@ -1,38 +1,38 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTO4PICP_HH
 #define EVTBTO4PICP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtBTo4piCP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtBTo4piCP* clone() override;
+    std::string getName() const override;
+    EvtBTo4piCP* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBToDDalitzCPK.hh b/EvtGenModels/EvtBToDDalitzCPK.hh
index 78e3dbb..a4dca8b 100644
--- a/EvtGenModels/EvtBToDDalitzCPK.hh
+++ b/EvtGenModels/EvtBToDDalitzCPK.hh
@@ -1,48 +1,48 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTGENMODELS_EVTBTODDALITZCPK_HH
 #define EVTGENMODELS_EVTBTODDALITZCPK_HH 1
 
 // Include files
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 /** @class EvtBToDDalitzCPK EvtBToDDalitzCPK.hh EvtGenModels/EvtBToDDalitzCPK.hh
  *  Decay Model for B->DK, (adds the possibility to use D0->Ks pi pi to
  *  find gamma with a Dalitz analysis
  *
  *  @author Patrick Robbe
  *  @date   2003-12-08
  */
 
 class EvtBToDDalitzCPK : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtBToDDalitzCPK* clone() override;
+    std::string getName() const override;
+    EvtBToDDalitzCPK* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
 
     void initProbMax() override;
 
   private:
     int m_flag;
 };
 #endif    // EVTGENMODELS_EVTBTODDALITZCPK_HH
diff --git a/EvtGenModels/EvtBToDiBaryonlnupQCD.hh b/EvtGenModels/EvtBToDiBaryonlnupQCD.hh
index c402b85..4fead41 100644
--- a/EvtGenModels/EvtBToDiBaryonlnupQCD.hh
+++ b/EvtGenModels/EvtBToDiBaryonlnupQCD.hh
@@ -1,52 +1,52 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTODIBARYONLNUPQCD_HH
 #define EVTBTODIBARYONLNUPQCD_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include "EvtGenModels/EvtBToDiBaryonlnupQCDFF.hh"
 #include "EvtGenModels/EvtSLDiBaryonAmp.hh"
 
 #include <memory>
 #include <string>
 
 class EvtParticle;
 
 // Description: Class to handle semileptonic B -> Baryon Anti-baryon l nu decays
 // using the using form factor predictions from pQCD counting rules. Taken
 // from arXiv:1107.0801
 
 class EvtBToDiBaryonlnupQCD : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     std::unique_ptr<EvtBToDiBaryonlnupQCDFF> m_ffModel;
     std::unique_ptr<EvtSLDiBaryonAmp> m_calcAmp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBToKpipiCP.hh b/EvtGenModels/EvtBToKpipiCP.hh
index 4743bff..9163305 100644
--- a/EvtGenModels/EvtBToKpipiCP.hh
+++ b/EvtGenModels/EvtBToKpipiCP.hh
@@ -1,57 +1,57 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOKPIPICP_HH
 #define EVTBTOKPIPICP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtBTo3hCP.hh"
 
 class EvtParticle;
 
 // Description: Routine to decay B->K pi pi
 //              and has CP violation.
 //       --- This is the routine to be called by the Main generator
 //          to get the decay of B0    -->-- K+ pi- pi0
 //          The decay proceeeds through three channels:
 //          a) B0 -->-- K*+ pi-  ; K*+    -->-- K+ pi0
 //          b)          K*0 pi0  ; K*0bar -->-- K+ pi-
 //          c)          K-  rho+ ; rho+   -->-- pi+ pi0
 //         It provides at the same time the CP conjugate decay
 //                              B0bar -->-- K- pi+ pi0
 
 class EvtBToKpipiCP : public EvtDecayAmp {
   public:
     EvtBToKpipiCP() {}
 
-    std::string getName() override;
-    EvtBToKpipiCP* clone() override;
+    std::string getName() const override;
+    EvtBToKpipiCP* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   private:
     EvtBTo3hCP m_generator;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBToPlnuBK.hh b/EvtGenModels/EvtBToPlnuBK.hh
index 943c679..d11398c 100644
--- a/EvtGenModels/EvtBToPlnuBK.hh
+++ b/EvtGenModels/EvtBToPlnuBK.hh
@@ -1,50 +1,50 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOPLNUBK_HH
 #define EVTBTOPLNUBK_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Description:   B->Xu l nu with BK (Becirevic-Kaidalov) parametrization
 //                Xu is a pseudoscalar (pi_plus,pi0,eta or eta_prime)
 
 class EvtBToPlnuBK : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtBToPlnuBK* clone() override;
+    std::string getName() const override;
+    EvtBToPlnuBK* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_BKmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBToVlnuBall.hh b/EvtGenModels/EvtBToVlnuBall.hh
index 4b4c3a6..e54dd72 100644
--- a/EvtGenModels/EvtBToVlnuBall.hh
+++ b/EvtGenModels/EvtBToVlnuBall.hh
@@ -1,48 +1,48 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOVLNUBALL_HH
 #define EVTBTOVLNUBALL_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Description:   B->Xu l nu with the Ball/Zwicky decay model
 //                Xu is a vector (rho, rho0, omega)
 
 class EvtBToVlnuBall : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtBToVlnuBall* clone() override;
+    std::string getName() const override;
+    EvtBToVlnuBall* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_Ballmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
 };
 #endif
diff --git a/EvtGenModels/EvtBToXElNu.hh b/EvtGenModels/EvtBToXElNu.hh
index 3806f49..82672ab 100644
--- a/EvtGenModels/EvtBToXElNu.hh
+++ b/EvtGenModels/EvtBToXElNu.hh
@@ -1,61 +1,61 @@
 
 /***********************************************************************
 * Copyright 1998-2021 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBTOXELNU_HH
 #define EvtBTOXELNU_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 /** The class provides the form factors for orbitally excited semileptonic decays
  */
 class EvtBToXElNu : public EvtDecayAmp {
   public:
     /** Default constructor */
     EvtBToXElNu() = default;
 
     /** Returns name of module */
-    std::string getName() override;
+    std::string getName() const override;
 
     /** Clones module */
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     /** Creates a decay */
     void decay( EvtParticle* p ) override;
 
     /** Sets maximal probab. */
     void initProbMax() override;
 
     /** Initializes module */
     void init() override;
 
   private:
     /** Pointers needed for FFs */
     std::unique_ptr<EvtSemiLeptonicFF> m_ffmodel{ nullptr };
 
     /** Pointers needed to calculate amplitude */
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp{ nullptr };
 };
 #endif
diff --git a/EvtGenModels/EvtBaryonPCR.hh b/EvtGenModels/EvtBaryonPCR.hh
index 7b6196f..e260fb7 100644
--- a/EvtGenModels/EvtBaryonPCR.hh
+++ b/EvtGenModels/EvtBaryonPCR.hh
@@ -1,50 +1,50 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBARYONPCR_HH
 #define EVTBARYONPCR_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicBaryonAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Description:Implementation of the BaryonPCR model
 // Class to handle semileptonic decays using the BaryonVminusA
 // model.
 
 class EvtBaryonPCR : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtBaryonPCR* clone() override;
+    std::string getName() const override;
+    EvtBaryonPCR* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_baryonpcrffmodel;
     std::unique_ptr<EvtSemiLeptonicBaryonAmp> m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcBsNPi.hh b/EvtGenModels/EvtBcBsNPi.hh
index e97ade4..5bf4a4d 100644
--- a/EvtGenModels/EvtBcBsNPi.hh
+++ b/EvtGenModels/EvtBcBsNPi.hh
@@ -1,43 +1,43 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBcBsNpi_HH
 #define EvtBcBsNpi_HH
 
 #include "EvtGenBase/EvtDecayBase.hh"
 
 #include "EvtGenModels/EvtBcToNPi.hh"
 
 #include <string>
 
 // Description: Decay model for Bc -> Bs + npi
 
 class EvtBcBsNPi : public EvtBcToNPi {
   public:
     EvtBcBsNPi();
 
     void init() override;
     void initProbMax() override;
 
-    std::string getName() override;
-    EvtBcBsNPi* clone() override;
+    std::string getName() const override;
+    EvtBcBsNPi* clone() const override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcBsStarNPi.hh b/EvtGenModels/EvtBcBsStarNPi.hh
index 238f8e3..adbeb8e 100644
--- a/EvtGenModels/EvtBcBsStarNPi.hh
+++ b/EvtGenModels/EvtBcBsStarNPi.hh
@@ -1,43 +1,43 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBcBsStarNpi_HH
 #define EvtBcBsStarNpi_HH
 
 #include "EvtGenBase/EvtDecayBase.hh"
 
 #include "EvtGenModels/EvtBcToNPi.hh"
 
 #include <string>
 
 // Description: Decay model for Bc -> Bs* + npi
 
 class EvtBcBsStarNPi : public EvtBcToNPi {
   public:
     EvtBcBsStarNPi();
     void init() override;
 
     void initProbMax() override;
 
-    std::string getName() override;
-    EvtBcBsStarNPi* clone() override;
+    std::string getName() const override;
+    EvtBcBsStarNPi* clone() const override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcPsiNPi.hh b/EvtGenModels/EvtBcPsiNPi.hh
index 99b35cf..60bfa89 100644
--- a/EvtGenModels/EvtBcPsiNPi.hh
+++ b/EvtGenModels/EvtBcPsiNPi.hh
@@ -1,43 +1,43 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBcPsiNpi_HH
 #define EvtBcPsiNpi_HH
 
 #include "EvtGenBase/EvtDecayBase.hh"
 
 #include "EvtGenModels/EvtBcToNPi.hh"
 
 #include <string>
 
 // Description: Decay model for Bc -> J/psi + npi
 
 class EvtBcPsiNPi : public EvtBcToNPi {
   public:
     EvtBcPsiNPi();
 
     void init() override;
     void initProbMax() override;
 
-    std::string getName() override;
-    EvtBcPsiNPi* clone() override;
+    std::string getName() const override;
+    EvtBcPsiNPi* clone() const override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcSMuNu.hh b/EvtGenModels/EvtBcSMuNu.hh
index dee63f2..7e40612 100644
--- a/EvtGenModels/EvtBcSMuNu.hh
+++ b/EvtGenModels/EvtBcSMuNu.hh
@@ -1,53 +1,53 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBcSMuNu_HH
 #define EVTBcSMuNu_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <fstream>
 #include <memory>
 #include <stdio.h>
 
 class EvtParticle;
 
 // Description:Implementation of the model for semileptonic Bc decays
 
 class EvtBcSMuNu : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
 
     void initProbMax() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_ffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
     int m_whichfit;
     int m_idScalar;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcTMuNu.hh b/EvtGenModels/EvtBcTMuNu.hh
index 975978d..ebb0ef3 100644
--- a/EvtGenModels/EvtBcTMuNu.hh
+++ b/EvtGenModels/EvtBcTMuNu.hh
@@ -1,51 +1,51 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBcTMuNu_HH
 #define EVTBcTMuNu_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Description:Implementation of the model for semileptonic Bc decays
 
 class EvtBcTMuNu : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
 
     void initProbMax() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_ffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
     int m_whichfit;
     int m_idTensor;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcToNPi.hh b/EvtGenModels/EvtBcToNPi.hh
index 157e773..3be87dc 100644
--- a/EvtGenModels/EvtBcToNPi.hh
+++ b/EvtGenModels/EvtBcToNPi.hh
@@ -1,80 +1,80 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBcToNPi_HH
 #define EvtBcToNPi_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtDecayBase.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <string>
 
 // Description: General decay model for Bc -> V + npi and Bc -> P + npi
 
 class EvtBcToNPi : public EvtDecayAmp {
   public:
     EvtBcToNPi( bool printAuthorInfo = false );
 
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   protected:
     int m_nCall;
     double m_maxAmp2;
 
     // Bc form factors
     double m_maxProb;
     double m_FA0_N, m_FA0_c1, m_FA0_c2;
     double m_FAm_N, m_FAm_c1, m_FAm_c2;
     double m_FAp_N, m_FAp_c1, m_FAp_c2;
     double m_FV_N, m_FV_c1, m_FV_c2;
 
     double m_Fp_N, m_Fp_c1, m_Fp_c2;
     double m_Fm_N, m_Fm_c1, m_Fm_c2;
 
     // W -> pi... form factors
     double m_beta;
     double m_mRho;
     double m_gammaRho;
     double m_mRhopr;
     double m_gammaRhopr;
     double m_mA1;
     double m_gammaA1;
 
     double energy1( double M, double m1, double m2 );
     double mom1( double M, double m1, double m2 );
     EvtComplex Fpi( EvtVector4R q1, EvtVector4R q2 );
     double pi3G( double m2, int dupD );
 
   private:
     void printAuthorInfo();
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcVHad.hh b/EvtGenModels/EvtBcVHad.hh
index 79ffd66..15b1626 100644
--- a/EvtGenModels/EvtBcVHad.hh
+++ b/EvtGenModels/EvtBcVHad.hh
@@ -1,84 +1,84 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBcVHad_HH
 #define EvtBcVHad_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include "EvtGenModels/EvtBCVFF2.hh"
 #include "EvtGenModels/EvtWHad.hh"
 
 #include <array>
 #include <memory>
 #include <string>
 
 class EvtParticle;
 
 // Description: Module to implement Bc -> psi + (n pi) + (m K) decays
 
 class EvtBcVHad : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* parent ) override;
 
   protected:
     // Hadronic current function
     EvtVector4C hardCurr( EvtParticle* parent ) const;
     void parseDecay();
 
   private:
     // Code of the Bc -> VW formfactor set:
     // 1 - SR
     // 2 - PM
     int m_whichFit;
 
     // Final vector particle code
     int m_idVector;
 
     // Code of the hadronic final state
     // 1:  B_c+ -> V pi+
     // 2:  B_c+ -> V pi+ pi0
     // 3:  B_c+ -> V 2pi+ pi-
     // 4:  B_c+ -> V 2pi+ pi- pi0 (not implemented)
     // 5:  B_c+ -> V 3pi+ 2pi-
     // 6:  B_c+ -> V K+ K- pi+
     // 7:  B_c+ -> V K+ pi+ pi-
     // 8:  B_c+ -> V K_S0 K+
     // 9:  B_c+ -> V K+ K- 2pi+ pi-
     // 10: B_c+ -> V 4pi+ 3pi-
     // 11: B_c+ -> V K+ 2pi+ 2pi-
     int m_outCode;
 
     std::unique_ptr<EvtBCVFF2> m_FFModel;
     std::unique_ptr<EvtWHad> m_WCurr;
 
     std::array<int, 4> m_iPiPlus = { { -1, -1, -1, -1 } };
     std::array<int, 4> m_iPiMinus = { { -1, -1, -1, -1 } };
     std::array<int, 4> m_iPiZero = { { -1, -1, -1, -1 } };
     std::array<int, 4> m_iKPlus = { { -1, -1, -1, -1 } };
     std::array<int, 4> m_iKMinus = { { -1, -1, -1, -1 } };
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcVMuNu.hh b/EvtGenModels/EvtBcVMuNu.hh
index 52f5f5e..1bfb4bb 100644
--- a/EvtGenModels/EvtBcVMuNu.hh
+++ b/EvtGenModels/EvtBcVMuNu.hh
@@ -1,51 +1,51 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBcVMuNu_HH
 #define EVTBcVMuNu_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Description:Implementation of the model for semileptonic Bc decays
 
 class EvtBcVMuNu : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
 
     void initProbMax() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_ffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
     int m_whichfit;
     int m_idVector;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBcVNpi.hh b/EvtGenModels/EvtBcVNpi.hh
index c8256f1..74bcf54 100644
--- a/EvtGenModels/EvtBcVNpi.hh
+++ b/EvtGenModels/EvtBcVNpi.hh
@@ -1,59 +1,59 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBcVNpi_HH
 #define EvtBcVNpi_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtScalarParticle.hh"
 
 #include "EvtGenModels/EvtBCVFF.hh"
 #include "EvtGenModels/EvtWnPi.hh"
 
 #include <iostream>
 #include <memory>
 
 using std::endl;
 using std::string;
 
 class EvtBcVNpi : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 
   protected:
     int m_nCall;
     int m_whichfit, m_idVector;
     std::unique_ptr<EvtBCVFF> m_ffmodel;
     std::unique_ptr<EvtWnPi> m_wcurr;
 
     EvtComplex Fpi( EvtVector4R q1, EvtVector4R q2 );
     EvtComplex BWa( EvtVector4R q );
     EvtComplex BWf( EvtVector4R q );
     EvtComplex BWr( EvtVector4R q );
     EvtVector4C JB( EvtVector4R q1, EvtVector4R q2, EvtVector4R q3,
                     EvtVector4R q4, EvtVector4R q5 );
 };
 #endif
diff --git a/EvtGenModels/EvtBcVPPHad.hh b/EvtGenModels/EvtBcVPPHad.hh
index 7101141..48844bc 100644
--- a/EvtGenModels/EvtBcVPPHad.hh
+++ b/EvtGenModels/EvtBcVPPHad.hh
@@ -1,64 +1,64 @@
 /***********************************************************************
 * Copyright 1998-2023 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBcVPPHad_HH
 #define EvtBcVPPHad_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include "EvtGenModels/EvtBCVFF2.hh"
 #include "EvtGenModels/EvtWHad.hh"
 
 #include <string>
 
 class EvtParticle;
 
 // Description: Module to implement Bc -> psi + p + pbar + pi decays
 
 class EvtBcVPPHad : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* parent ) override;
 
   protected:
     // Hadronic current function
     EvtVector4C hardCurrPP( EvtParticle* parent, int i1, int i2 ) const;
 
   private:
     // Code of the Bc -> VW formfactor set:
     // 1 - SR
     // 2 - PM
     int m_whichFit;
 
     // Final vector particle code
     int m_idVector;
 
     // Code of the hadronic final state
     // 1: p+ p- pi+
     int m_outCode;
 
     std::unique_ptr<EvtBCVFF2> m_FFModel;
     std::unique_ptr<EvtWHad> m_WCurr;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBsMuMuKK.hh b/EvtGenModels/EvtBsMuMuKK.hh
index 0640eb2..30cf749 100644
--- a/EvtGenModels/EvtBsMuMuKK.hh
+++ b/EvtGenModels/EvtBsMuMuKK.hh
@@ -1,94 +1,94 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtBsMuMuKK_HH
 #define EvtBsMuMuKK_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <string>
 
 class EvtParticle;
 
 // Description: Routine to implement Bs -> J/psi KK
 
 class EvtBsMuMuKK : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   protected:
     EvtComplex Flatte( const double m0, const double m ) const;
 
     EvtComplex GetRho( const double m0, const double m ) const;
 
     EvtComplex Breit_Wigner( const double Gamma0, const double m0,
                              const double m, const int J, const double q0,
                              const double q ) const;
 
     double Integral( const double Gamma0, const double m0, const int JR,
                      const int JB, const double q0, const double M_KK_ll,
                      const double M_KK_ul, const int fcntype ) const;
 
     double X_J( const int J, const double q, const int isB ) const;
 
     double Wignerd( int J, int l, int alpha, double theta ) const;
 
     EvtComplex AngularDist( int J, int l, int alpha, double cK, double cL,
                             double chi ) const;
 
     EvtComplex AmpTime( const int q, const EvtComplex& gplus,
                         const EvtComplex& gminus, const double delta,
                         const double lambda_abs, const double Amp,
                         const double phis, const int eta ) const;
 
   private:
     double m_MBs, m_MJpsi, m_Mf0, m_Mphi, m_Mf2p, m_MKp, m_MKm, m_MK0, m_Mpip,
         m_Mpi0, m_Mmu;
     double m_Gamma0phi, m_Gamma0f2p;
     double m_kin_lower_limit, m_kin_upper_limit, m_kin_middle;
     double m_p30Kp_mid_CMS, m_p30Kp_ll_CMS, m_p30Kp_phi_CMS, m_p30Kp_f2p_CMS;
     double m_p30Jpsi_mid_CMS, m_p30Jpsi_ll_CMS, m_p30Jpsi_phi_CMS,
         m_p30Jpsi_f2p_CMS;
     double m_int_const_NR, m_int_Flatte_f0, m_int_BW_phi, m_int_BW_f2p;
     double m_f_S_NR, m_f_f0, m_f_phi, m_f_f2p, m_f_phi_0, m_f_phi_perp,
         m_f_f2p_0, m_f_f2p_perp;
     double m_A_S_NR, m_A_f0, m_A_phi_0, m_A_phi_perp, m_A_phi_par, m_A_f2p_0,
         m_A_f2p_perp;
     double m_A_f2p_par;
     double m_delta_S_NR, m_delta_f0, m_delta_phi_0, m_delta_phi_perp,
         m_delta_phi_par;
     double m_delta_f2p_0, m_delta_f2p_perp, m_delta_f2p_par;
     double m_phis_S_NR, m_phis_f0, m_phis_phi_0, m_phis_phi_perp, m_phis_phi_par;
     double m_phis_f2p_0, m_phis_f2p_perp, m_phis_f2p_par;
     double m_lambda_S_NR_abs, m_lambda_f0_abs, m_lambda_phi_0_abs,
         m_lambda_phi_perp_abs;
     double m_lambda_phi_par_abs, m_lambda_f2p_0_abs, m_lambda_f2p_perp_abs;
     double m_lambda_f2p_par_abs;
     double m_Gamma, m_deltaGamma, m_ctau, m_deltaMs;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBsquark.hh b/EvtGenModels/EvtBsquark.hh
index f06da80..664586c 100644
--- a/EvtGenModels/EvtBsquark.hh
+++ b/EvtGenModels/EvtBsquark.hh
@@ -1,38 +1,38 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBSQUARK_HH
 #define EVTBSQUARK_HH
 
 #include "EvtGenBase/EvtDecayProb.hh"
 
 class EvtParticle;
 
 class EvtBsquark : public EvtDecayProb {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBto2piCPiso.hh b/EvtGenModels/EvtBto2piCPiso.hh
index acc9da5..d64b8c4 100644
--- a/EvtGenModels/EvtBto2piCPiso.hh
+++ b/EvtGenModels/EvtBto2piCPiso.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTO2PICPISO_HH
 #define EVTBTO2PICPISO_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtParticle.hh"
 
 class EvtBto2piCPiso : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBtoKD3P.hh b/EvtGenModels/EvtBtoKD3P.hh
index 3677158..dba123f 100644
--- a/EvtGenModels/EvtBtoKD3P.hh
+++ b/EvtGenModels/EvtBtoKD3P.hh
@@ -1,78 +1,78 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVT_BTOKD3P
 #define EVT_BTOKD3P
 
 class EvtParticle;
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 // Decay model that does the decay B+ -> K+ D , D -> 3 psudoscalars.
 //
 // The B- daughters specified in the decay file should be K-, D0, D0,
 // where the first D0 is produced via b->c decay and the second via b->u.
 // In reality, only one D daughter exists, so the first two
 // daughters must be defined to decay to the same final state using
 // the EvtPto3P model, but with CP-conjugate amplitudes.
 //
 // For a given point in the Pto3P Dalitz plot,
 // the total amplitude is \propto [A1 + A2 r exp(i(phase))], where
 //
 // A1 & A2 are the amplitudes of the D0 and D0bar to decay into that
 // Dalitz plot point,
 //
 // r is the (positive) ratio between the A(B->B0bar K) and A(B->D0 K)
 // B decay amplitudes,
 //
 // phase is the total phase difference (weak phase + strong phase) between
 // A(B->D0bar K) and A(B->B0 K).
 //
 // Note that this model knows nothing about your convention for the
 // sign of the phase, so when specifying the decay of a B- you need to
 // change the order of D0 and D0bar and change the total phase so that
 // the sign of the weak phase flips with respect to the parameters of B+.
 
 class EvtBtoKD3P : public EvtDecayAmp {
   public:
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     // Initialize model
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
     // we really have two daughters, although three are listed in the .dec file:
-    int nRealDaughters() override { return 2; }
+    int nRealDaughters() const override { return 2; }
 
-    std::string getName() override;
+    std::string getName() const override;
 
   protected:
     // parameters:
     double m_r;
     EvtComplex m_exp;
 
     // other:
     const EvtDecayBase* m_model1 = nullptr;
     const EvtDecayBase* m_model2 = nullptr;
     bool m_decayedOnce = false;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBtoKpiCPiso.hh b/EvtGenModels/EvtBtoKpiCPiso.hh
index c4c9a63..1de3560 100644
--- a/EvtGenModels/EvtBtoKpiCPiso.hh
+++ b/EvtGenModels/EvtBtoKpiCPiso.hh
@@ -1,38 +1,38 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOKPICPISO_HH
 #define EVTBTOKPICPISO_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtParticle.hh"
 
 class EvtBtoKpiCPiso : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBtoXsEtap.hh b/EvtGenModels/EvtBtoXsEtap.hh
index b82b1c1..08cca25 100644
--- a/EvtGenModels/EvtBtoXsEtap.hh
+++ b/EvtGenModels/EvtBtoXsEtap.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOXSETAP_HH
 #define EVTBTOXSETAP_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 class EvtParticle;
 
 class EvtBtoXsEtap : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBtoXsgamma.hh b/EvtGenModels/EvtBtoXsgamma.hh
index d9a7e8c..b48f54b 100644
--- a/EvtGenModels/EvtBtoXsgamma.hh
+++ b/EvtGenModels/EvtBtoXsgamma.hh
@@ -1,50 +1,50 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOXSGAMMA_HH
 #define EVTBTOXSGAMMA_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 #include "EvtGenModels/EvtBtoXsgammaAbsModel.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Class to generate non-resonant two-body b->s,gamma decays.
 
 class EvtBtoXsgamma : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     std::unique_ptr<EvtBtoXsgammaAbsModel> m_model;
 };
 
 #endif
diff --git a/EvtGenModels/EvtBtoXsll.hh b/EvtGenModels/EvtBtoXsll.hh
index 20a3414..425a770 100644
--- a/EvtGenModels/EvtBtoXsll.hh
+++ b/EvtGenModels/EvtBtoXsll.hh
@@ -1,63 +1,63 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOXSLL_HH
 #define EVTBTOXSLL_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 #include "EvtGenBase/EvtParticle.hh"
 
 #include "EvtGenModels/EvtBtoXsllUtil.hh"
 
 #include <memory>
 
 class EvtBtoXsllUtil;
 
 // Description:
 // Class to generate inclusive non-resonant B -> Xs l+ l- decays.
 // Description: Routine to generate non-resonant B -> Xs l+ l- decays.
 // It generates a dilepton mass spectrum according to Kruger and Sehgal
 // and then generates the two lepton momenta accoring to Ali et al.
 // The resultant X_s particles may be decayed by JETSET.
 
 class EvtBtoXsll : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     std::unique_ptr<EvtBtoXsllUtil> m_calcprob;
     double m_dGdsProbMax;
     double m_dGdsdupProbMax;
     double m_mb;
     double m_ms;
     double m_mq;
     double m_pf;
     double m_mxmin;
 };
 
 #endif
diff --git a/EvtGenModels/EvtCBTo3piMPP.hh b/EvtGenModels/EvtCBTo3piMPP.hh
index b8ed3c9..16a1ca1 100644
--- a/EvtGenModels/EvtCBTo3piMPP.hh
+++ b/EvtGenModels/EvtCBTo3piMPP.hh
@@ -1,45 +1,45 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTCBTO3PIMPP_HH
 #define EVTCBTO3PIMPP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtBTo3hCP.hh"
 
 class EvtParticle;
 
 class EvtCBTo3piMPP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtCBTo3piMPP* clone() override;
+    std::string getName() const override;
+    EvtCBTo3piMPP* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     EvtBTo3hCP m_generator;
 };
 
 #endif
diff --git a/EvtGenModels/EvtCBTo3piP00.hh b/EvtGenModels/EvtCBTo3piP00.hh
index 1363b25..6ca1890 100644
--- a/EvtGenModels/EvtCBTo3piP00.hh
+++ b/EvtGenModels/EvtCBTo3piP00.hh
@@ -1,47 +1,47 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTCBTO3PIP00_HH
 #define EVTCBTO3PIP00_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtBTo3hCP.hh"
 
 class EvtParticle;
 
 class EvtCBTo3piP00 : public EvtDecayAmp {
   public:
     EvtCBTo3piP00() {}
 
-    std::string getName() override;
-    EvtCBTo3piP00* clone() override;
+    std::string getName() const override;
+    EvtCBTo3piP00* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     EvtBTo3hCP m_generator;
 };
 
 #endif
diff --git a/EvtGenModels/EvtD0ToKspipi.hh b/EvtGenModels/EvtD0ToKspipi.hh
index 6fac31c..9388743 100644
--- a/EvtGenModels/EvtD0ToKspipi.hh
+++ b/EvtGenModels/EvtD0ToKspipi.hh
@@ -1,67 +1,67 @@
 #ifndef EVTD0TOKSPIPI_HH
 #define EVTD0TOKSPIPI_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDalitzPoint.hh"
 #include "EvtGenBase/EvtDalitzReso.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <string>
 #include <utility>
 #include <vector>
 
 class EvtParticle;
 
 class EvtD0ToKspipi : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* parent ) override;
 
   private:
     // Calculate the total amplitude given the Dalitz plot point
     EvtComplex calcTotAmp( const EvtDalitzPoint& point ) const;
 
     // Set particle IDs and PDG masses
     void setPDGValues();
 
     // Setup the Dalitz plot resonances and their amplitude coefficients
     void initResonances();
 
     // Daughter IDs (updated according to decay file ordering)
     int m_d0 = 0;
     int m_d1 = 1;
     int m_d2 = 2;
 
     // Resonance lineshape and complex amplitude coefficient pair
     typedef std::pair<EvtDalitzReso, EvtComplex> ResAmpPair;
 
     // Vector of (resonance, coeff) pairs
     std::vector<ResAmpPair> m_resonances;
 
     // IDs of the relevant particles
     EvtId m_BP;
     EvtId m_BM;
     EvtId m_B0;
     EvtId m_B0B;
     EvtId m_D0;
     EvtId m_D0B;
     EvtId m_KM;
     EvtId m_KP;
     EvtId m_K0;
     EvtId m_K0B;
     EvtId m_KL;
     EvtId m_KS;
     EvtId m_PIM;
     EvtId m_PIP;
 
     // Masses of the relevant particles
     double m_mD0;
     double m_mKs;
     double m_mPi;
     double m_mK;
 };
 #endif
diff --git a/EvtGenModels/EvtD0gammaDalitz.hh b/EvtGenModels/EvtD0gammaDalitz.hh
index bbb0da9..994eff8 100644
--- a/EvtGenModels/EvtD0gammaDalitz.hh
+++ b/EvtGenModels/EvtD0gammaDalitz.hh
@@ -1,100 +1,100 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef __EVTD0GAMMADALITZ_HH__
 #define __EVTD0GAMMADALITZ_HH__
 
 #include "EvtGenBase/EvtCyclic3.hh"
 #include "EvtGenBase/EvtDalitzReso.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtFlatte.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 
 #include <vector>
 
 class EvtParticle;
 
 class EvtD0gammaDalitz : public EvtDecayAmp {
   private:
     int m_d1;
     int m_d2;
     int m_d3;
 
     bool m_isKsPiPi;
 
     // Useful constants.
     static const EvtSpinType::spintype& m_SCALAR;
     static const EvtSpinType::spintype& m_VECTOR;
     static const EvtSpinType::spintype& m_TENSOR;
 
     static const EvtDalitzReso::CouplingType& m_EtaPic;
     static const EvtDalitzReso::CouplingType& m_PicPicKK;
 
     static const EvtDalitzReso::NumType& m_RBW;
     static const EvtDalitzReso::NumType& m_GS;
     static const EvtDalitzReso::NumType& m_KMAT;
 
     static const EvtCyclic3::Pair& m_AB;
     static const EvtCyclic3::Pair& m_AC;
     static const EvtCyclic3::Pair& m_BC;
 
     // Values to be read or computed based on values in the evt.pdl file.
     // IDs of the relevant particles.
     EvtId m_BP;
     EvtId m_BM;
     EvtId m_B0;
     EvtId m_B0B;
     EvtId m_D0;
     EvtId m_D0B;
     EvtId m_KM;
     EvtId m_KP;
     EvtId m_K0;
     EvtId m_K0B;
     EvtId m_KL;
     EvtId m_KS;
     EvtId m_PIM;
     EvtId m_PIP;
 
     // Flavor of the B mother.
     EvtId m_bFlavor;
 
     // Masses of the relevant particles.
     double m_mD0;
     double m_mKs;
     double m_mPi;
     double m_mK;
 
     void readPDGValues();
     void reportInvalidAndExit() const;
 
     EvtComplex dalitzKsPiPi( const EvtDalitzPoint& point ) const;
     EvtComplex dalitzKsKK( const EvtDalitzPoint& point ) const;
 
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtD0mixDalitz.hh b/EvtGenModels/EvtD0mixDalitz.hh
index f10878f..3449590 100644
--- a/EvtGenModels/EvtD0mixDalitz.hh
+++ b/EvtGenModels/EvtD0mixDalitz.hh
@@ -1,134 +1,134 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef __EVTD0MIXDALITZ_HH__
 #define __EVTD0MIXDALITZ_HH__
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtCyclic3.hh"
 #include "EvtGenBase/EvtDalitzPoint.hh"
 #include "EvtGenBase/EvtDalitzReso.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 
 // Description:
 //   The D0mixDalitz model, with many resonances and mixing implemented.
 
 class EvtD0mixDalitz : public EvtDecayAmp {
   private:
     int m_d1;
     int m_d2;
     int m_d3;
 
     // Mixing parameters.
     double m_x;
     double m_y;
 
     // q/p CP violation in the mixing.
     EvtComplex m_qp;
 
     // Checker of the decay mode.
     bool m_isKsPiPi;
     bool m_isRBWmodel;
 
     // Useful constants.
     static const EvtSpinType::spintype& m_SCALAR;
     static const EvtSpinType::spintype& m_VECTOR;
     static const EvtSpinType::spintype& m_TENSOR;
 
     static const EvtDalitzReso::CouplingType& m_EtaPic;
     static const EvtDalitzReso::CouplingType& m_PicPicKK;
 
     static const EvtDalitzReso::NumType& m_RBW;
     static const EvtDalitzReso::NumType& m_GS;
     static const EvtDalitzReso::NumType& m_KMAT;
 
     static const EvtCyclic3::Pair& m_AB;
     static const EvtCyclic3::Pair& m_AC;
     static const EvtCyclic3::Pair& m_BC;
 
     // Values to be read or computed based on values in the evt.pdl file.
     // IDs of the relevant particles.
     EvtId m_D0;
     EvtId m_D0B;
     EvtId m_KM;
     EvtId m_KP;
     EvtId m_K0;
     EvtId m_K0B;
     EvtId m_KL;
     EvtId m_KS;
     EvtId m_PIM;
     EvtId m_PIP;
 
     // Masses of the relevant particles.
     double m_mD0;
     double m_mKs;
     double m_mPi;
     double m_mK;
 
     // Life time and decay rate.
     double m_ctau;
     double m_gamma;
 
     // Some useful integrals over the Dalitz plot.
     EvtComplex m_iChi;
     EvtComplex m_iChi2;
 
     void readPDGValues();
     EvtComplex dalitzKsPiPi( const EvtDalitzPoint& point );
     EvtComplex dalitzKsKK( const EvtDalitzPoint& point );
 
     // Time evolution functions for hamiltonian eigenstates.
     //    Negative exponential part removed.
     EvtComplex h1( const double& ct ) const;
     EvtComplex h2( const double& ct ) const;
 
     void reportInvalidAndExit() const
     {
         EvtGenReport( EVTGEN_ERROR, "EvtD0mixDalitz" )
             << "EvtD0mixDalitz: Invalid mode." << std::endl;
         exit( 1 );
     }
 
   public:
     EvtD0mixDalitz() :
         m_d1( 0 ),
         m_d2( 0 ),
         m_d3( 0 ),
         m_x( 0. ),
         m_y( 0. ),
         m_qp( 1. ),
         m_isKsPiPi( false ),
         m_isRBWmodel( true )
     {
     }
 
     // One-line inline functions.
-    std::string getName() override { return "D0MIXDALITZ"; }
-    EvtDecayBase* clone() override { return new EvtD0mixDalitz; }
+    std::string getName() const override { return "D0MIXDALITZ"; }
+    EvtDecayBase* clone() const override { return new EvtD0mixDalitz; }
     void initProbMax() override { setProbMax( 5200. ); }
 
     void init() override;
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtDDalitz.hh b/EvtGenModels/EvtDDalitz.hh
index b7483d2..f28420a 100644
--- a/EvtGenModels/EvtDDalitz.hh
+++ b/EvtGenModels/EvtDDalitz.hh
@@ -1,52 +1,52 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTDDALITZ_HH
 #define EVTDDALITZ_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtFlatte.hh"
 
 #include <vector>
 
 class EvtParticle;
 
 class EvtDDalitz : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     int m_d1, m_d2, m_d3, m_flag;
 
     EvtComplex amplDtoK0PiPi( EvtVector4R p4_p, EvtVector4R moms1,
                               EvtVector4R moms2, EvtVector4R moms3 );
     EvtComplex amplDtoK0KK( EvtVector4R p4_p, EvtVector4R moms1,
                             EvtVector4R moms2, EvtVector4R moms3 );
 
     vector<EvtFlatteParam> m_kkpi_params;
 };
 
 #endif
diff --git a/EvtGenModels/EvtDMix.hh b/EvtGenModels/EvtDMix.hh
index 0586648..cdb07fb 100644
--- a/EvtGenModels/EvtDMix.hh
+++ b/EvtGenModels/EvtDMix.hh
@@ -1,46 +1,46 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTDMIX_HH
 #define EVTDMIX_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 class EvtParticle;
 
 class EvtDMix : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     double m_rd;
     double m_xpr;
     double m_ypr;
 };
 
 #endif
diff --git a/EvtGenModels/EvtDToKpienu.hh b/EvtGenModels/EvtDToKpienu.hh
index 352debf..ccf6da2 100644
--- a/EvtGenModels/EvtDToKpienu.hh
+++ b/EvtGenModels/EvtDToKpienu.hh
@@ -1,119 +1,119 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTDTOKPIENU_HH
 #define EVTDTOKPIENU_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayProb.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <array>
 
 class EvtParticle;
 
 class EvtDToKpienu : public EvtDecayProb {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   private:
     void KinVGen( const EvtVector4R& vp4_K, const EvtVector4R& vp4_Pi,
                   const EvtVector4R& vp4_Lep, const EvtVector4R& vp4_Nu,
                   const int charm, double& m2, double& q2, double& cosV,
                   double& cosL, double& chi ) const;
     double calPDF( const double m2, const double q2, const double cosV,
                    const double cosL, const double chi ) const;
     void ResonanceP( const double m, const double q, const double mV,
                      const double mA, const double V_0, const double A1_0,
                      const double A2_0, const double m0, const double width0,
                      const double rBW, double& amplitude, double& delta,
                      EvtComplex& F11, EvtComplex& F21, EvtComplex& F31 ) const;
     void NRS( const double m, const double q, const double rS, const double rS1,
               const double a_delta, const double b_delta, const double mA,
               const double m0, const double width0, double& amplitude,
               double& delta, EvtComplex& F10 ) const;
     void ResonanceD( const double m, const double q, const double mV,
                      const double mA, const double TV_0, const double T1_0,
                      const double T2_0, const double m0, const double width0,
                      const double rBW, double& amplitude, double& delta,
                      EvtComplex& F12, EvtComplex& F22, EvtComplex& F32 ) const;
     double getPStar( const double m, const double m1, const double m2 ) const;
     double getF1( const double m, const double m0, const double m_c1,
                   const double m_c2, const double rBW ) const;
     double getF2( const double m, const double m0, const double m_c1,
                   const double m_c2, const double rBW ) const;
     double getWidth0( const double m, const double m0, const double m_c1,
                       const double m_c2, const double width0 ) const;
     double getWidth1( const double m, const double m0, const double m_c1,
                       const double m_c2, const double width0,
                       const double rBW ) const;
     double getWidth2( const double m, const double m0, const double m_c1,
                       const double m_c2, const double width0,
                       const double rBW ) const;
     EvtComplex getCoef( const double rho, const double phi ) const;
 
     int m_nAmps;
     std::array<int, 5> m_type;
 
     double m_rS;
     double m_rS1;
     double m_a_delta;
     double m_b_delta;
     double m_m0_1430_S;
     double m_width0_1430_S;
 
     double m_mV;
     double m_mA;
     double m_V_0;
     double m_A1_0;
     double m_A2_0;
     double m_m0;
     double m_width0;
     double m_rBW;
     double m_rho;
     double m_phi;
     double m_m0_1410;
     double m_width0_1410;
     double m_rho_1410;
     double m_phi_1410;
     double m_TV_0;
     double m_T1_0;
     double m_T2_0;
     double m_m0_1430;
     double m_width0_1430;
     double m_rho_1430;
     double m_phi_1430;
 
     double m_mD;
     double m_mPi;
     double m_mK;
     double m_Pi;
     double m_root2;
     double m_root2d3;
     double m_root1d2;
     double m_root3d2;
 };
 
 #endif
diff --git a/EvtGenModels/EvtDalitzTable.hh b/EvtGenModels/EvtDalitzTable.hh
index c863137..acb95a7 100644
--- a/EvtGenModels/EvtDalitzTable.hh
+++ b/EvtGenModels/EvtDalitzTable.hh
@@ -1,80 +1,80 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTDALITZTABLE_HPP
 #define EVTDALITZTABLE_HPP
 
 #include "EvtGenBase/EvtCyclic3.hh"
 #include "EvtGenBase/EvtDalitzPlot.hh"
 #include "EvtGenBase/EvtDalitzReso.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 
 #include "EvtGenModels/EvtDalitzDecayInfo.hh"
 
 #include <map>
 #include <string>
 #include <vector>
 
 // Description: Model to describe a generic dalitz decay
 
 class EvtDalitzTable {
   public:
     static EvtDalitzTable* getInstance( const std::string dec_name = "",
                                         bool verbose = true );
 
-    bool fileHasBeenRead( const std::string dec_name );
+    bool fileHasBeenRead( const std::string dec_name ) const;
     void readXMLDecayFile( const std::string dec_name, bool verbose = true );
-    void checkParticle( std::string particle );
+    void checkParticle( std::string particle ) const;
 
     void addDecay( EvtId parent, const EvtDalitzDecayInfo& dec );
     void copyDecay( EvtId parent, EvtId* daughters, EvtId copy, EvtId* copyd );
 
     std::vector<EvtDalitzDecayInfo> getDalitzTable( const EvtId& parent );
 
   protected:
     EvtDalitzTable();
     ~EvtDalitzTable();
 
   private:
     EvtDalitzReso getResonance( std::string shape, EvtDalitzPlot dp,
                                 EvtCyclic3::Pair angPair,
                                 EvtCyclic3::Pair resPair,
                                 EvtSpinType::spintype spinType, double mass,
                                 double width, double FFp, double FFr,
                                 double alpha, double aLass, double rLass,
                                 double BLass, double phiBLass, double RLass,
                                 double phiRLass, double cutoffLass );
     int getDaughterPairs(
         EvtId* resDaughter, EvtId* daughter,
         std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>& angAndResPairs );
 
     std::map<EvtId, std::vector<EvtDalitzDecayInfo>> m_dalitztable;
     std::vector<std::string> m_readFiles;
 
     EvtDalitzTable( const EvtDalitzTable& );
     EvtDalitzTable& operator=( const EvtDalitzTable& );
 
     //to calculate probMax
     double calcProbMax( EvtDalitzPlot dp, EvtDalitzDecayInfo* model );
     double calcProb( EvtDalitzPoint point, EvtDalitzDecayInfo* model );
 };
 
 #endif
diff --git a/EvtGenModels/EvtEtaDalitz.hh b/EvtGenModels/EvtEtaDalitz.hh
index a535c24..06f32e6 100644
--- a/EvtGenModels/EvtEtaDalitz.hh
+++ b/EvtGenModels/EvtEtaDalitz.hh
@@ -1,39 +1,39 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTETADALITZ_HH
 #define EVTETADALITZ_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtEtaDalitz : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtEtaLLPiPi.hh b/EvtGenModels/EvtEtaLLPiPi.hh
index e524e66..ef7a7ce 100644
--- a/EvtGenModels/EvtEtaLLPiPi.hh
+++ b/EvtGenModels/EvtEtaLLPiPi.hh
@@ -1,81 +1,81 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVT_ETALLPIPI_HH
 #define EVT_ETALLPIPI_HH
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtDecayProb.hh"
 
 #include <string>
 
 class EvtParticle;
 
 // eta' -> mu+ mu- pi+ pi- or e+ e- pi+ pi-
 // From Zhang Zhen-Yu et al, Chinese Phys. C 36, p926, 2012
 
 class EvtEtaLLPiPi : public EvtDecayProb {
   public:
     EvtEtaLLPiPi() = default;
 
     void init() override;
     void initProbMax() override;
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     void updateMassPars( double mLep, double mPi );
 
     double rhoWidth( double s, double m ) const;
 
     double F0( double sLL, double sPiPi ) const;
 
     double lambda( double a, double b, double c ) const;
 
     double ampSquared( EvtParticle* p ) const;
 
     double m_alpha{ 1.0 / 137.0 };
     double m_eSq{ 4.0 * EvtConst::pi * m_alpha };
     double m_fPi{ 0.0924 };
     double m_f8{ 1.3 * m_fPi };
     double m_f0{ 1.04 * m_fPi };
     double m_thetaMix{ 20.0 * EvtConst::pi / 180.0 };
     double m_mixSq{ 0.0 };
     double m_c1{ 1.0 };
     double m_c2{ 0.0 };
     double m_c3{ m_c1 - m_c2 };    // Eq 9
     double m_par1{ 1.0 - ( 3.0 * ( m_c1 - m_c2 + m_c3 ) / 4.0 ) };
     double m_parLL{ 3.0 * ( m_c1 - m_c2 - m_c3 ) / 4.0 };
     double m_parPiPi{ 3.0 * m_c3 / 2.0 };
     double m_rhoMass{ 0.775 };    // updated in init()
     double m_rhoMassSq{ m_rhoMass * m_rhoMass };
     double m_rhoGamma{ 0.149 };    // updated in init()
     double m_lepMass{ 0.106 };     // modified in updateMassPars()
     double m_lepMassSq{ m_lepMass * m_lepMass };
     double m_piMass{ 0.140 };    // modified in updateMassPars()
     double m_piMassSq{ m_piMass * m_piMass };
     double m_4LepMassSq{ 4.0 * m_lepMassSq };
     double m_4PiMassSq{ 4.0 * m_piMassSq };
 };
 
 #endif
diff --git a/EvtGenModels/EvtFourBodyPhsp.hh b/EvtGenModels/EvtFourBodyPhsp.hh
index f21cb37..b0363df 100644
--- a/EvtGenModels/EvtFourBodyPhsp.hh
+++ b/EvtGenModels/EvtFourBodyPhsp.hh
@@ -1,92 +1,92 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTFOURBODYPHSP_HH
 #define EVTFOURBODYPHSP_HH
 
 #include "EvtGenBase/EvtDecayProb.hh"
 
 #include <array>
 #include <utility>
 #include <vector>
 
 class EvtParticle;
 
 class EvtFourBodyPhsp : public EvtDecayProb {
   public:
     enum Shape
     {
         rectangle = 1,
         trapezoid = 2,
         pentagon = 3,
         variable = 4
     };
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* parent ) override;
 
   private:
     std::array<double, 4> phspFactor( const double mM, const double m12,
                                       const double m34,
                                       std::array<double, 4>& daughters ) const;
     Shape determineBoundaryShape( const double m12Min, const double m12Max,
                                   const double m34Max,
                                   const double mMother ) const;
 
     std::pair<double, double> generatePairMasses(
         const double m12Min, const double m12Max, const double m34Min,
         const double m34Max, const double mMother,
         const EvtFourBodyPhsp::Shape shape ) const;
     std::pair<double, double> generateRectangle( const double m12Min,
                                                  const double m12Max,
                                                  const double m34Min,
                                                  const double m34Max ) const;
     std::pair<double, double> generateTrapezoid( const double m12Min,
                                                  const double m12Max,
                                                  const double m34Min,
                                                  const double mMother ) const;
 
     std::array<double, 4> m_daughterMasses{ -1, -1, -1, -1 };
 
     double m_m12Min;
     double m_m12Max;
     double m_m34Min;
     double m_m34Max;
 
     double m_trapNorm;
     double m_trapCoeff1;
     double m_trapCoeff2;
 
     double m_pentagonSplit;
     double m_pentagonFraction;
 
     Shape m_boundaryShape;
 
     bool m_stableMother{ true };
     bool m_stableDaughters{ true };
     bool m_fixedBoundary{ true };
 };
 
 #endif
diff --git a/EvtGenModels/EvtGenericDalitz.hh b/EvtGenModels/EvtGenericDalitz.hh
index 442f3b6..3483220 100644
--- a/EvtGenModels/EvtGenericDalitz.hh
+++ b/EvtGenModels/EvtGenericDalitz.hh
@@ -1,52 +1,52 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTGENERICDALITZ_HH
 #define EVTGENERICDALITZ_HH
 
 #include "EvtGenBase/EvtDalitzReso.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtFlatte.hh"
 
 #include <string>
 #include <vector>
 
 class EvtParticle;
 
 // Description: Model to describe a generic dalitz decay
 
 class EvtGenericDalitz : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override{};    //prob max will be set in init
 
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
 
   private:
     int m_d1, m_d2, m_d3;
     std::vector<std::pair<EvtComplex, EvtDalitzReso>> m_resonances;
 };
 
 #endif
diff --git a/EvtGenModels/EvtGoityRoberts.hh b/EvtGenModels/EvtGoityRoberts.hh
index c4e7f92..6cf3985 100644
--- a/EvtGenModels/EvtGoityRoberts.hh
+++ b/EvtGenModels/EvtGoityRoberts.hh
@@ -1,45 +1,45 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTGOITYROBERTS_HH
 #define EVTGOITYROBERTS_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 class EvtId;
 
 class EvtGoityRoberts : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
 
   private:
     void DecayBDstarpilnuGR( EvtParticle* pb, EvtId ndstar, EvtId nlep,
                              EvtId nnu );
 
     void DecayBDpilnuGR( EvtParticle* pb, EvtId nd, EvtId nlep, EvtId nnu );
 };
 
 #endif
diff --git a/EvtGenModels/EvtHQET.hh b/EvtGenModels/EvtHQET.hh
index 167e259..353cae6 100644
--- a/EvtGenModels/EvtHQET.hh
+++ b/EvtGenModels/EvtHQET.hh
@@ -1,47 +1,47 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTHQET_HH
 #define EVTHQET_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Description:Implementation of the HQET model
 
 class EvtHQET : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_hqetffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
 };
 #endif
diff --git a/EvtGenModels/EvtHQET2.hh b/EvtGenModels/EvtHQET2.hh
index 367dfec..909fc10 100644
--- a/EvtGenModels/EvtHQET2.hh
+++ b/EvtGenModels/EvtHQET2.hh
@@ -1,48 +1,48 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTHQET2_HH
 #define EVTHQET2_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Description:Implementation of the HQET model with dispersive FF due to
 //             Caprini et al.
 
 class EvtHQET2 : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_hqetffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
 };
 #endif
diff --git a/EvtGenModels/EvtHelAmp.hh b/EvtGenModels/EvtHelAmp.hh
index bd9894a..bc6ac9b 100644
--- a/EvtGenModels/EvtHelAmp.hh
+++ b/EvtGenModels/EvtHelAmp.hh
@@ -1,51 +1,51 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTHELAMP_HH
 #define EVTHELAMP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtId.hh"
 
 #include <memory>
 
 class EvtParticle;
 class EvtEvalHelAmp;
 
 // Description:Decay model for implementation of generic 2 body
 //             decay specified by the helicity amplitudes
 
 class EvtHelAmp : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     void fillHelicity( int* lambda2, int n, int J2, EvtId id );
 
     std::unique_ptr<EvtEvalHelAmp> m_evalHelAmp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtHypNonLepton.hh b/EvtGenModels/EvtHypNonLepton.hh
index f89c12d..05174b5 100644
--- a/EvtGenModels/EvtHypNonLepton.hh
+++ b/EvtGenModels/EvtHypNonLepton.hh
@@ -1,48 +1,48 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTHYBNONLEPTON_HH
 #define EVTHYBNONLEPTON_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 // Desription: Routine to implement Hyperon(s=1/2) -> Baryon(s=1/2) + Scalar decays accroding to
 //             Review Of Particle Physics 2004, Phys.Lett.B, Vol.592, p.864
 
 class EvtHypNonLepton : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
     void calcAmp( EvtAmp* amp, EvtParticle* parent );
 
   private:
     double m_alpha;
     double m_phi;
     EvtComplex m_B_to_A;
-    long m_noTries;
+    std::size_t m_noTries;
 };
 
 #endif
diff --git a/EvtGenModels/EvtISGW.hh b/EvtGenModels/EvtISGW.hh
index e8825e0..ad50dc9 100644
--- a/EvtGenModels/EvtISGW.hh
+++ b/EvtGenModels/EvtISGW.hh
@@ -1,45 +1,45 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTISGW_HH
 #define EVTISGW_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 class EvtParticle;
 
 class EvtISGW : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_isgwffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtKKLambdaC.hh b/EvtGenModels/EvtKKLambdaC.hh
index db54207..23e997f 100644
--- a/EvtGenModels/EvtKKLambdaC.hh
+++ b/EvtGenModels/EvtKKLambdaC.hh
@@ -1,48 +1,48 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTKKLAMBDAC_HH
 #define EVTKKLAMBDAC_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class Evtparticle;
 
 // Description:Semileptonic decays with pole form form factors
 
 class EvtKKLambdaC : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_ffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtKStopizmumu.hh b/EvtGenModels/EvtKStopizmumu.hh
index 31f6204..41d6ae5 100644
--- a/EvtGenModels/EvtKStopizmumu.hh
+++ b/EvtGenModels/EvtKStopizmumu.hh
@@ -1,53 +1,53 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTKSTOPIZMUMU_HH
 #define EVTKSTOPIZMUMU_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <string>
 
 class EvtParticle;
 
 // Description: Routine to implement KS -> pi0 mu mu; see JHEP08(1998)004.
 
 class EvtKStopizmumu : public EvtDecayAmp {
   public:
-    std::string getName() override { return "KS_PI0MUMU"; }
+    std::string getName() const override { return "KS_PI0MUMU"; }
 
-    EvtDecayBase* clone() override { return new EvtKStopizmumu; }
+    EvtDecayBase* clone() const override { return new EvtKStopizmumu; }
 
     void init() override;
 
     void initProbMax() override { setProbMax( 1.0e-10 ); }
 
     void decay( EvtParticle* p ) override;
 
     double F_z( const double& z, const double& rvsq );
     EvtComplex G_z( const double& z );
     double Wpol_z( const double& z, const double& as, const double& bs );
     EvtComplex chi_z( const double& z, const double& rpisq );
     EvtComplex Wpipi_z( const double& z, const double& alpha_s,
                         const double& beta_s, const double& rvsq,
                         const double& rpisq, const double& z0 );
 };
 
 #endif    //EVTKTOPIZMUMU_HH
diff --git a/EvtGenModels/EvtKstarnunu.hh b/EvtGenModels/EvtKstarnunu.hh
index 637de19..2895356 100644
--- a/EvtGenModels/EvtKstarnunu.hh
+++ b/EvtGenModels/EvtKstarnunu.hh
@@ -1,39 +1,39 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTKSTARNUNU_HH
 #define EVTKSTARNUNU_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtKstarnunu : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtLNuGamma.hh b/EvtGenModels/EvtLNuGamma.hh
index be2310a..d926eb5 100644
--- a/EvtGenModels/EvtLNuGamma.hh
+++ b/EvtGenModels/EvtLNuGamma.hh
@@ -1,44 +1,44 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTLNUGAMMA_HH
 #define EVTLNUGAMMA_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: B+ -> l+ nu gamma.  Form factor is tree level, from
 //  Korchemsky, Pirjol, and Yan,Phy Rev D 61 (200) 114510
 
 class EvtLNuGamma : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
     double getFormFactor( double photonEnergy );
 
     bool m_fafvzero = false;
 };
 
 #endif
diff --git a/EvtGenModels/EvtLambdaP_BarGamma.hh b/EvtGenModels/EvtLambdaP_BarGamma.hh
index 4b7a302..b0377f8 100644
--- a/EvtGenModels/EvtLambdaP_BarGamma.hh
+++ b/EvtGenModels/EvtLambdaP_BarGamma.hh
@@ -1,77 +1,77 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTLAMBDAPBARGAMMA_HH
 #define EVTLAMBDAPBARGAMMA_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 
 // Description:Implementation of the decay B- -> lambda p_bar gamma according to
 // Cheng, Yang; hep-ph/0201015
 
 class EvtLambdaP_BarGamma : public EvtDecayAmp {
   public:
     EvtLambdaP_BarGamma();
     ~EvtLambdaP_BarGamma() { ; }
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
   private:
     // some constants to make the code easier to read and maintain
     // these three should be constants... (implementation of getMass() prohibits this)
     double m_mLambdab;    //  = 5.624;                          // Lambda_b mass
     double m_mLambda0;    //  = 1.115684;                       // Lambda0 mass
     double m_c7Eff;    //  = -0.31;                          // Wilson coefficient
     double m_mb;       //  =  4.4;                           // running b mass
     double m_mV;    //  =  5.42;                          // pole mass vector current
     double m_mA;    //  =  5.86;                          // pole mass axial current
     double m_GF;    //  =  1.166E-5;                      // Fermi constant
     double m_gLambdab;    // =  16;                            // coupling constant Lambda_b -> B- p
     double m_e0;    //  =  1;                             // electromagnetic coupling (+1)
     double m_g1;    //  =  0.64;                          // heavy-light form factors at q_mSqare
     double m_g2;            //  = -0.10;
     double m_f1;            //  =  0.64;
     double m_f2;            //  = -0.31;
     double m_VtbVtsStar;    // = 0.038;                          // |V_tb V_ts^*|
 
     // user never needs to call this -> private
     // baryonic form factors f(p), g(p), at p=0
     double f0( const double f_qm,
                int n = 1 ) const;    // calculate f(0) with f(q_max)
     double g0( const double f_qm,
                int n = 1 ) const;    // calculate g(0) with g(q_max)
 
     // shorthand for constants a and b in the formula
     double constA() const;
     double constB() const;
 
     // initialize phasespace and calculate the amplitude for one (i=0,1) state of the photon
     EvtComplex calcAmpliude( const EvtParticle* p, const unsigned int polState );
 };
 
 #endif
diff --git a/EvtGenModels/EvtLambdacPHH.hh b/EvtGenModels/EvtLambdacPHH.hh
index 86bbfa6..2b41a24 100644
--- a/EvtGenModels/EvtLambdacPHH.hh
+++ b/EvtGenModels/EvtLambdacPHH.hh
@@ -1,103 +1,103 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTLAMBDACPHH_HH
 #define EVTLAMBDACPHH_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtResonance2.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <string>
 #include <vector>
 
 class EvtParticle;
 
 // Description: Decay model for Lambda_c -> K- pi+ p using amplitudes
 //              from the Fermilab E791 analysis: arXiv:hep-ex/9912003v1
 
 class EvtLambdacPHH : public EvtDecayAmp {
   public:
     EvtLambdacPHH();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   protected:
     // Resonance enumeration
     enum class LcResLabel
     {
         NonReson = 0,
         Kstar,
         Delta,
         Lambda
     };
 
     // Amplitude functions
     std::vector<EvtComplex> calcResAmpTerms( EvtLambdacPHH::LcResLabel resIndex,
                                              const EvtResonance2& res,
                                              double norm ) const;
 
     EvtComplex DecayAmp3( EvtLambdacPHH::LcResLabel resonance, int m,
                           int mprime, double theta_res, double phi_res,
                           double theta_prime_daughter_res,
                           double phi_prime_daughter_res ) const;
 
     EvtComplex fampl3( double amplitude_res, double phi_res, int spinMother,
                        int m_spinMother, int m_prime_spinMother,
                        double theta_res, float spin_res, float m_spin_res,
                        float m_prime_spin_res, double theta_daughter_res,
                        double phi_prime_daughter_res ) const;
 
     // Find resonance normalisation factors
     void calcNormalisations();
 
     void getFitFractions();
 
     // Inverse cos/sin functions that checks for valid arguments
     double getACos( double num, double denom ) const;
     double getASin( double num, double denom ) const;
 
   private:
     // Daughter ordering for K-, pi+, p
     int m_d1, m_d2, m_d3;
 
     // Resonance parameters
     double m_Nplusplus, m_Nplusminus, m_Nminusplus, m_Nminusminus;
     double m_phiNplusplus, m_phiNplusminus, m_phiNminusplus, m_phiNminusminus;
     double m_E1, m_phiE1, m_E2, m_phiE2, m_E3, m_phiE3, m_E4, m_phiE4;
     double m_F1, m_phiF1, m_F2, m_phiF2, m_H1, m_phiH1, m_H2, m_phiH2;
 
     double m_NRNorm, m_KstarNorm, m_DeltaNorm, m_LambdaNorm;
     double m_KstarM, m_KstarW, m_KstarR;
     double m_DeltaM, m_DeltaW, m_DeltaR;
     double m_LambdaM, m_LambdaW, m_LambdaR;
     double m_Lambda_cR;
 
     EvtVector4R m_zprime, m_p4_Lambda_c;
     double m_zpMag, m_p4_Lambdac_Mag;
 };
 
 #endif
diff --git a/EvtGenModels/EvtLb2Baryonlnu.hh b/EvtGenModels/EvtLb2Baryonlnu.hh
index a5ab973..5d11243 100644
--- a/EvtGenModels/EvtLb2Baryonlnu.hh
+++ b/EvtGenModels/EvtLb2Baryonlnu.hh
@@ -1,52 +1,52 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTLB2BARYONLNU_HH
 #define EVTLB2BARYONLNU_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include "EvtGenModels/EvtSLBaryonAmp.hh"
 
 class EvtParticle;
 
 // Description:Implementation of the Lb2Baryonlnu model
 // Class to handle semileptonic Lb -> p l nu decays using the using form factor predictions based on the quark model.  Here baryon can be Lc+, p, Lc*+, N*+.
 // Description: Routine to implement Lb->N*+ l nu semileptonic decays using form factor predictions based on the quark model.  The form factors are from W. Roberts, M. Pervin, S. Chapstick, (2011). arXiv:nucl-th/0503030v1.  The model can be used for decays to all N*+ states with J^{P} = 1/2^{+}, 1/2^{-}, 3/2^{+}, 3/2^{-} and, in addition, decays to p, Lc+, Lc(2593)+, Lc(2625)+
 
 class EvtLb2Baryonlnu : public EvtDecayAmp {
   public:
     EvtLb2Baryonlnu();
     ~EvtLb2Baryonlnu();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     EvtSemiLeptonicFF* m_ffmodel;
     EvtSLBaryonAmp* m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtLb2plnuLCSR.hh b/EvtGenModels/EvtLb2plnuLCSR.hh
index 286cff8..8d7399e 100644
--- a/EvtGenModels/EvtLb2plnuLCSR.hh
+++ b/EvtGenModels/EvtLb2plnuLCSR.hh
@@ -1,54 +1,54 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTLB2PMUNULCSR_HH
 #define EVTLB2PMUNULCSR_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include "EvtGenModels/EvtSLBaryonAmp.hh"
 
 class EvtParticle;
 
 // Description:Implementation of the Lb2plnuLCSR model
 // Class to handle semileptonic Lb -> p l nu decays using the using form factor predictions from Light Cone Sum Rules.
 // Description: Routine to implement Lb->p l nu semileptonic decays using form factor
 //              predictions form Light Cone Sum Rules.  The form factors are from
 //              A. Khodjamirian, C. Klein, T. Mannel and Y.-M. Wang, arXiv.1108.2971 (2011)
 
 class EvtLb2plnuLCSR : public EvtDecayAmp {
   public:
     EvtLb2plnuLCSR();
     ~EvtLb2plnuLCSR();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     EvtSemiLeptonicFF* m_ffmodel;
     EvtSLBaryonAmp* m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtLb2plnuLQCD.hh b/EvtGenModels/EvtLb2plnuLQCD.hh
index e40232b..063fbb3 100644
--- a/EvtGenModels/EvtLb2plnuLQCD.hh
+++ b/EvtGenModels/EvtLb2plnuLQCD.hh
@@ -1,54 +1,54 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTLB2PMUNULQCD_HH
 #define EVTLB2PMUNULQCD_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include "EvtGenModels/EvtSLBaryonAmp.hh"
 
 class EvtParticle;
 
 // Description:Implementation of the Lb2plnuLQCD model
 // Class to handle semileptonic Lb -> p l nu decays using the using form factor predictions from Lattice QCD.
 // Description: Routine to implement Lb->p l nu semileptonic decays using form factor predictions from LQCD.
 // The form factors are from:
 //            W. Detmold, C-J. Lin, S. Meinel and M.Wingate, arXiv:1306.0446 (2013)
 
 class EvtLb2plnuLQCD : public EvtDecayAmp {
   public:
     EvtLb2plnuLQCD();
     ~EvtLb2plnuLQCD();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     EvtSemiLeptonicFF* m_ffmodel;
     EvtSLBaryonAmp* m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtMelikhov.hh b/EvtGenModels/EvtMelikhov.hh
index 94816ca..151035e 100644
--- a/EvtGenModels/EvtMelikhov.hh
+++ b/EvtGenModels/EvtMelikhov.hh
@@ -1,48 +1,48 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTMELIKHOV_HH
 #define EVTMELIKHOV_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class EvtParticle;
 
 // Description:Implementation of the Melikhov semileptonic model
 
 class EvtMelikhov : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_Melikhovffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtOmegaDalitz.hh b/EvtGenModels/EvtOmegaDalitz.hh
index 80002f9..0564d52 100644
--- a/EvtGenModels/EvtOmegaDalitz.hh
+++ b/EvtGenModels/EvtOmegaDalitz.hh
@@ -1,42 +1,42 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTOMEGADALITZ_HH
 #define EVTOMEGADALITZ_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description:Class to handle the omega -> pi pi pi dalitz decay.
 
 class EvtOmegaDalitz : public EvtDecayAmp {
   public:
     EvtOmegaDalitz() {}
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtPVVCPLH.hh b/EvtGenModels/EvtPVVCPLH.hh
index 5fad95d..30c817e 100644
--- a/EvtGenModels/EvtPVVCPLH.hh
+++ b/EvtGenModels/EvtPVVCPLH.hh
@@ -1,42 +1,42 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTPVVCPLH_HH
 #define EVTPVVCPLH_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtPVVCPLH : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     bool isBsMixed( EvtParticle* p );
 };
 
 #endif
diff --git a/EvtGenModels/EvtPartWave.hh b/EvtGenModels/EvtPartWave.hh
index c1ba5ac..2e92a57 100644
--- a/EvtGenModels/EvtPartWave.hh
+++ b/EvtGenModels/EvtPartWave.hh
@@ -1,52 +1,52 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTPARTWAVE_HH
 #define EVTPARTWAVE_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtEvalHelAmp.hh"
 #include "EvtGenBase/EvtId.hh"
 
 #include <memory>
 
 class EvtParticle;
 class EvtEvalHelAmp;
 
 // Description:Decay model for implementation of generic 2 body
 //             decay specified by the partial waves amplitudes
 
 class EvtPartWave : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     void fillHelicity( int* lambda2, int n, int J2 );
 
     std::unique_ptr<EvtEvalHelAmp> m_evalHelAmp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtPhiDalitz.hh b/EvtGenModels/EvtPhiDalitz.hh
index 7cafbc5..ee4625a 100644
--- a/EvtGenModels/EvtPhiDalitz.hh
+++ b/EvtGenModels/EvtPhiDalitz.hh
@@ -1,51 +1,51 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTPHIDALITZ_HH
 #define EVTPHIDALITZ_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtPhiDalitz : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   private:
     double calc_q( double, double, double ) const;
 
     double m_mRho;
     double m_gRho;
     double m_aD;
     double m_phiD;
     double m_aOmega;
     double m_phiOmega;
     int m_locPip;
     int m_locPim;
     int m_locPi0;
 };
 
 #endif
diff --git a/EvtGenModels/EvtPhspDecaytimeCut.hh b/EvtGenModels/EvtPhspDecaytimeCut.hh
index 3a2f8fc..4ee3fc1 100644
--- a/EvtGenModels/EvtPhspDecaytimeCut.hh
+++ b/EvtGenModels/EvtPhspDecaytimeCut.hh
@@ -1,49 +1,49 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTPHSPDECAYTIMECUT_HH
 #define EVTPHSPDECAYTIMECUT_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 class EvtParticle;
 
 // Description:
 //Class to handle generic phase space decays not done
 //in other decay models.
 
 class EvtPhspDecaytimeCut : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     // Minimum decay time to generate
     double m_minDecayTime;
 };
 
 #endif
diff --git a/EvtGenModels/EvtPhspFlatLifetime.hh b/EvtGenModels/EvtPhspFlatLifetime.hh
index 69350cd..b2a0fc7 100644
--- a/EvtGenModels/EvtPhspFlatLifetime.hh
+++ b/EvtGenModels/EvtPhspFlatLifetime.hh
@@ -1,60 +1,60 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTPHSPFLATLIFETIME_HH
 #define EVTPHSPFLATLIFETIME_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 class EvtParticle;
 
 // Description:
 //   Class to handle generic phase space decays not done
 //   in other decay models, with a flat lifetime
 
 class EvtPhspFlatLifetime : public EvtDecayIncoherent {
   public:
     /// Constructor
     EvtPhspFlatLifetime() : m_maxLifetime( 0. ){};
 
     /// Destructor
     virtual ~EvtPhspFlatLifetime(){};
 
     /// return name of the model
-    std::string getName() override;
+    std::string getName() const override;
 
     /// Clone
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     /// Compute maximum weight
     void initProbMax() override;
 
     /// Initialize the model
     void init() override;
 
     /// Perform the decay
     void decay( EvtParticle* p ) override;
 
   private:
     /// parameter of the model: maximum of the generated lifetime (in ps)
     double m_maxLifetime;
 };
 
 #endif
diff --git a/EvtGenModels/EvtPi0Dalitz.hh b/EvtGenModels/EvtPi0Dalitz.hh
index 9a8bbee..b95219f 100644
--- a/EvtGenModels/EvtPi0Dalitz.hh
+++ b/EvtGenModels/EvtPi0Dalitz.hh
@@ -1,47 +1,47 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTPI0DALITZ_HH
 #define EVTPI0DALITZ_HH
 
 #include "EvtGenBase/EvtDecayProb.hh"
 
 class EvtParticle;
 
 class EvtPi0Dalitz : public EvtDecayProb {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     double m_poleSize{ 0.00000002 };
 
     // Following are rho mass and width, but in order to keep consistency
     // with what was done before do not use data from particle table.
     const double m_m0Sq{ 0.768 * 0.768 };
     const double m_m0SqG0Sq{ m_m0Sq * 0.151 * 0.151 };
 };
 
 #endif
diff --git a/EvtGenModels/EvtPsi2JpsiPiPi.hh b/EvtGenModels/EvtPsi2JpsiPiPi.hh
index 827500d..a0d6eec 100644
--- a/EvtGenModels/EvtPsi2JpsiPiPi.hh
+++ b/EvtGenModels/EvtPsi2JpsiPiPi.hh
@@ -1,56 +1,56 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTPSI2JPSIPIPI_HH
 #define EVTPSI2JPSIPIPI_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <array>
 #include <string>
 
 class EvtDecayBase;
 class EvtParticle;
 
 // Description: Header file for the model "PSI2JPSIPIPI" which generates
 //              psi2S -> J/psi pi+ pi- decays based on hep-ph/1507.07985
 
 class EvtPsi2JpsiPiPi : public EvtDecayAmp {
   public:
     EvtPsi2JpsiPiPi();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 
   private:
     bool m_tree;
     double m_phi;    // LO vs NLO mixing angle (radians)
     double m_cosPhi, m_cos2Phi, m_sinPhi, m_sin2Phi;
     // NLO corrections
     static const int m_nQ = 6;    // number of terms in mPiPi interpolation
     std::array<double, m_nQ> m_c0, m_c1, m_c2, m_s1, m_s2;
 
     void setNLOArrays();
 };
 
 #endif
diff --git a/EvtGenModels/EvtPto3P.hh b/EvtGenModels/EvtPto3P.hh
index d78b381..1acf84d 100644
--- a/EvtGenModels/EvtPto3P.hh
+++ b/EvtGenModels/EvtPto3P.hh
@@ -1,45 +1,45 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVT_PTO3P_HH
 #define EVT_PTO3P_HH
 
 #include "EvtGenBase/EvtDalitzPoint.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtIntervalDecayAmp.hh"
 
 #include <vector>
 
 class EvtPto3P : public EvtIntervalDecayAmp<EvtDalitzPoint> {
   public:
     EvtPto3P() {}
     ~EvtPto3P() {}
-    std::string getName() override { return "PTO3P"; }
-    EvtDecayBase* clone() override { return new EvtPto3P(); }
+    std::string getName() const override { return "PTO3P"; }
+    EvtDecayBase* clone() const override { return new EvtPto3P(); }
 
     EvtAmpFactory<EvtDalitzPoint>* createFactory(
         const EvtMultiChannelParser& parser ) override;
     std::vector<EvtVector4R> initDaughters( const EvtDalitzPoint& p ) const override;
 
     EvtDalitzPlot dp();
 };
 
 #endif
diff --git a/EvtGenModels/EvtRareLbToLll.hh b/EvtGenModels/EvtRareLbToLll.hh
index 455dfe0..9bd08fd 100644
--- a/EvtGenModels/EvtRareLbToLll.hh
+++ b/EvtGenModels/EvtRareLbToLll.hh
@@ -1,68 +1,68 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTRARELBTOLLL_HH
 #define EVTRARELBTOLLL_HH 1
 
 #include "EvtGenBase/EvtAmp.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtParticle.hh"
 
 #include "EvtGenModels/EvtRareLbToLllFFBase.hh"
 #include "EvtGenModels/EvtRareLbToLllWC.hh"
 
 #include <memory>
 
 // Description:
 //      Implements the rare Lb --> Lambda^(*) ell ell models described in
 //      http://arxiv.org/pdf/1108.6129.pdf
 
 class EvtRareLbToLll : public EvtDecayAmp {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
 
     void initProbMax() override;
 
     void decay( EvtParticle* parent ) override;
 
   protected:
     void calcAmp( EvtAmp& amp, const EvtParticle& parent );
 
     void HadronicAmp( const EvtParticle& parent, const EvtParticle& lambda,
                       EvtVector4C* T, const int i, const int j );
 
     void HadronicAmpRS( const EvtParticle& parent, const EvtParticle& lambda,
                         EvtVector4C* T, const int i, const int j );
 
     bool isParticle( const EvtParticle& parent ) const;
 
   private:
     double m_maxProbability;
     double m_poleSize{ 0.00005 };
     bool m_electronMode{ false };
 
     std::unique_ptr<EvtRareLbToLllFFBase> m_ffmodel;
     std::unique_ptr<EvtRareLbToLllWC> m_wcmodel;
 };
 #endif    //
diff --git a/EvtGenModels/EvtSLBKPole.hh b/EvtGenModels/EvtSLBKPole.hh
index 1f4caa2..2c4d166 100644
--- a/EvtGenModels/EvtSLBKPole.hh
+++ b/EvtGenModels/EvtSLBKPole.hh
@@ -1,48 +1,48 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSLBKPOLE_HH    //modified
 #define EVTSLBKPOLE_HH    //modified
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"    //modified
 
 #include <memory>
 class Evtparticle;
 
 // Description:Semileptonic decays with pole form form factors,
 //             according to Becirevic and Kaidalov(BK)
 
 class EvtSLBKPole : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_SLBKPoleffmodel;    //modified
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSLN.hh b/EvtGenModels/EvtSLN.hh
index c3a81a3..6258de0 100644
--- a/EvtGenModels/EvtSLN.hh
+++ b/EvtGenModels/EvtSLN.hh
@@ -1,43 +1,43 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSLN_HH
 #define EVTSLN_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 //Class to handle decays of the type SCALAR -> DIRAC NEUTRINO
 
 class EvtSLN : public EvtDecayAmp {
   public:
     EvtSLN() {}
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSLPole.hh b/EvtGenModels/EvtSLPole.hh
index 0cab8ff..917ac26 100644
--- a/EvtGenModels/EvtSLPole.hh
+++ b/EvtGenModels/EvtSLPole.hh
@@ -1,48 +1,48 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSLPOLE_HH
 #define EVTSLPOLE_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 
 #include <memory>
 
 class Evtparticle;
 
 class EvtSLPole : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
     void init() override;
 
   private:
     std::unique_ptr<EvtSemiLeptonicFF> m_SLPoleffmodel;
     std::unique_ptr<EvtSemiLeptonicAmp> m_calcamp;
     //special case - reset the daughter masses
     bool m_resetDaughterTree;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSSDCP.hh b/EvtGenModels/EvtSSDCP.hh
index b533d72..0618904 100644
--- a/EvtGenModels/EvtSSDCP.hh
+++ b/EvtGenModels/EvtSSDCP.hh
@@ -1,72 +1,72 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSSDCP_HH
 #define EVTSSDCP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: This module is part of the unification of simulation of CP violation in
 //              B decays. This model handles decays of the type B->SD where D is either
 //              a spin 0, 1, or 2 particle. See long writeup for more information.
 
 class EvtSSDCP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 
   private:
     //Arguments
 
     double m_dm;
 
     double m_dgog;
 
     EvtComplex m_qoverp;
     EvtComplex m_poverq;
     EvtComplex m_z;    //FS CPTV parameter
 
     // FS commented next line becuse not used
     //  int m_cp;
 
     EvtComplex m_A_f;
     EvtComplex m_Abar_f;
 
     EvtComplex m_A_fbar;
     EvtComplex m_Abar_fbar;
 
     //Derived quantities
 
     double m_gamma;
     double m_dgamma;
 
     bool m_eigenstate;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSSD_DirectCP.hh b/EvtGenModels/EvtSSD_DirectCP.hh
index e7969bf..ed9e628 100644
--- a/EvtGenModels/EvtSSD_DirectCP.hh
+++ b/EvtGenModels/EvtSSD_DirectCP.hh
@@ -1,53 +1,53 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSSD_DirectCP_HH
 #define EVTSSD_DirectCP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Generation of direct CP violation in hadronic environment
 // Patrick Robbe, LHCb,  08 Nov 2006
 
 class EvtSSD_DirectCP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
     std::string getParamName( int i ) override;
 
   protected:
     void calcAmp( const EvtParticle& parent, EvtAmp& amp ) const;
 
   private:
     bool isB0Mixed( const EvtParticle& p );
     bool isBsMixed( const EvtParticle& p );
 
     //Arguments
 
     double m_acp;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSSSCP.hh b/EvtGenModels/EvtSSSCP.hh
index d7b8ad0..a5e133d 100644
--- a/EvtGenModels/EvtSSSCP.hh
+++ b/EvtGenModels/EvtSSSCP.hh
@@ -1,42 +1,42 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSSSCP_HH
 #define EVTSSSCP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtSSSCP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSSSCPT.hh b/EvtGenModels/EvtSSSCPT.hh
index f5a407b..cc5e781 100644
--- a/EvtGenModels/EvtSSSCPT.hh
+++ b/EvtGenModels/EvtSSSCPT.hh
@@ -1,45 +1,45 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSSSCPT_HH
 #define EVTSSSCPT_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtSSSCPT : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   private:
     // Amplitude coeffs
     EvtComplex m_A, m_Abar;
     EvtComplex m_P, m_Q, m_D, m_Im;
     // Set amplitude coeffs from decay model params
     void setAmpCoeffs();
 };
 
 #endif
diff --git a/EvtGenModels/EvtSSSCPpng.hh b/EvtGenModels/EvtSSSCPpng.hh
index 49c4084..513861b 100644
--- a/EvtGenModels/EvtSSSCPpng.hh
+++ b/EvtGenModels/EvtSSSCPpng.hh
@@ -1,42 +1,42 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSSSCPPNG_HH
 #define EVTSSSCPPNG_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: Routine to decay B -> 2 scalars taking into account penguin
 //              contributions (assuming single quark dominance for penguins)
 
 class EvtSSSCPpng : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSTS.hh b/EvtGenModels/EvtSTS.hh
index d40a4fe..86f5d51 100644
--- a/EvtGenModels/EvtSTS.hh
+++ b/EvtGenModels/EvtSTS.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSTS_HH
 #define EVTSTS_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description:Performs the decay of a scalar -> tensor scalar
 
 class EvtSTS : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSTSCP.hh b/EvtGenModels/EvtSTSCP.hh
index f4d490f..bc74b6d 100644
--- a/EvtGenModels/EvtSTSCP.hh
+++ b/EvtGenModels/EvtSTSCP.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSTSCP_HH
 #define EVTSTSCP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtSTSCP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVP.hh b/EvtGenModels/EvtSVP.hh
index c904f8c..3e430d2 100644
--- a/EvtGenModels/EvtSVP.hh
+++ b/EvtGenModels/EvtSVP.hh
@@ -1,51 +1,51 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtSVP_HH
 #define EvtSVP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <string>
 
 class EvtParticle;
 class EvtDecayBase;
 
 // Description: Routine to implement radiative decay
 //                   chi_c0 -> psi gamma
 //                   chi_c0 -> psi ell ell
 
 class EvtSVP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
 
     void initProbMax() override;
 
   private:
     void decay_2body( EvtParticle* p );
     void decay_3body( EvtParticle* p );
     double m_delta;    // form factor parameter
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVPCP.hh b/EvtGenModels/EvtSVPCP.hh
index af57fb5..d272743 100644
--- a/EvtGenModels/EvtSVPCP.hh
+++ b/EvtGenModels/EvtSVPCP.hh
@@ -1,53 +1,53 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVPCP_HH
 #define EVTSVPCP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: Routine to decay scalar -> vectors+photon
 //              including CP violation effects
 //
 //Class to handle decays of the form SCALAR ->VECTOR PHOTON
 //where the helicity amplitudes must be specified.  The
 //first and third arguements are the magnetudes of the H+
 //and H- helicity amplitudes respectively.  The second and
 //fourth arguements are the phases.
 //Calls EvtSVPHel.
 
 class EvtSVPCP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
     static void SVPHel( EvtParticle* parent, EvtAmp& amp, EvtId n_v1,
                         EvtId n_v2, const EvtComplex& hp, const EvtComplex& hm );
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVPHelAmp.hh b/EvtGenModels/EvtSVPHelAmp.hh
index 4bec9b0..bef4cff 100644
--- a/EvtGenModels/EvtSVPHelAmp.hh
+++ b/EvtGenModels/EvtSVPHelAmp.hh
@@ -1,54 +1,54 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVPHELAMP_HH
 #define EVTSVPHELAMP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 // Description: Routine to decay scalar -> vector + photon
 //              by specifying the helicity amplitudes
 //
 //Class to handle decays of the form SCALAR -> VECTOR PHOTON
 //where the helicity amplitudes must be specified. The
 //first and third arguments are the magnitudes of the H+
 //and H- helicity amplitudes respectively. The second and
 //fourth arguements are the phases.
 //Calls EvtSVPHel.
 
 class EvtParticle;
 class EvtAmp;
 class EvtId;
 
 class EvtSVPHelAmp : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
     static void SVPHel( EvtParticle* parent, EvtAmp& amp, EvtId n_v1,
                         EvtId n_ph, const EvtComplex& hp, const EvtComplex& hm );
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVPHelCPMix.hh b/EvtGenModels/EvtSVPHelCPMix.hh
index 6c75c4f..e74a0d1 100644
--- a/EvtGenModels/EvtSVPHelCPMix.hh
+++ b/EvtGenModels/EvtSVPHelCPMix.hh
@@ -1,47 +1,47 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVPHELCPMIX_HH
 #define EVTSVPHELCPMIX_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: The decay of a scalar Bs meson to a vector particle and a photon is
 //              performed with CP violation and different widths for
 //              the heavy and light states (DeltaGamma_s =! 0). E.g. Bs->phi gamma.
 // Model input arguments:
 //   |H+| arg|H+| |H-| arg|H-| beta_s
 // H+ and H- don't need to be normalized.
 // beta_s in radians.
 
 class EvtSVPHelCPMix : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVSCP.hh b/EvtGenModels/EvtSVSCP.hh
index df7ff23..d1454a0 100644
--- a/EvtGenModels/EvtSVSCP.hh
+++ b/EvtGenModels/EvtSVSCP.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVSCP_HH
 #define EVTSVSCP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtSVSCP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVSCPLH.hh b/EvtGenModels/EvtSVSCPLH.hh
index 00ca803..76c9139 100644
--- a/EvtGenModels/EvtSVSCPLH.hh
+++ b/EvtGenModels/EvtSVSCPLH.hh
@@ -1,51 +1,51 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVSCPLH_HH
 #define EVTSVSCPLH_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: The decay of a scalar to a scalar and a vector particle are
 //              performed with CP violation and different widths for
 //              the cp even and odd states. E.g. B->J/psi K_S.
 
 class EvtSVSCPLH : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     EvtComplex m_Af, m_Abarf;
     EvtComplex m_qop, m_poq;
 
     double m_dm;
     double m_dgamma;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVSCPiso.hh b/EvtGenModels/EvtSVSCPiso.hh
index 528dc67..5773704 100644
--- a/EvtGenModels/EvtSVSCPiso.hh
+++ b/EvtGenModels/EvtSVSCPiso.hh
@@ -1,63 +1,63 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVSCPISO_HH
 #define EVTSVSCPISO_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: Routine to decay scalar -> vectors scalar
 //              with CP violation and isospin amplitudes.
 //              More specifically, it is indended to handle
 //              decays like B->rho pi and B->a1 pi.
 
 class EvtSVSCPiso : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     // Amplitude coefficients
     EvtComplex m_Tp0, m_Tp0_bar, m_T0p, m_T0p_bar;
     EvtComplex m_Tpm, m_Tpm_bar, m_Tmp, m_Tmp_bar;
     EvtComplex m_P1, m_P1_bar, m_P0, m_P0_bar;
 
     // Amplitudes
     EvtComplex m_A_f, m_Abar_f;
     EvtComplex m_A_fbar, m_Abar_fbar;
     EvtComplex m_Apm, m_Apm_bar, m_Amp, m_Amp_bar;
     // Charged mode flag
     int m_charged{ 0 };
 
     // Set amplitude coeffs from decay model pars
     void setAmpCoeffs();
     // Calculate amplitude terms
     void calcAmpTerms();
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVSNONCPEIGEN.hh b/EvtGenModels/EvtSVSNONCPEIGEN.hh
index 6c97ce9..2e23214 100644
--- a/EvtGenModels/EvtSVSNONCPEIGEN.hh
+++ b/EvtGenModels/EvtSVSNONCPEIGEN.hh
@@ -1,49 +1,49 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVSNONCPEIGEN_HH
 #define EVTSVSNONCPEIGEN_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtSVSNONCPEIGEN : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     EvtComplex m_A_f;
     EvtComplex m_Abar_f;
 
     EvtComplex m_A_fbar;
     EvtComplex m_Abar_fbar;
 
     double m_dm;
     double m_phickm;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVVCP.hh b/EvtGenModels/EvtSVVCP.hh
index ef41a70..f73d7ff 100644
--- a/EvtGenModels/EvtSVVCP.hh
+++ b/EvtGenModels/EvtSVVCP.hh
@@ -1,42 +1,42 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVVCP_HH
 #define EVTSVVCP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtSVVCP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVVCPLH.hh b/EvtGenModels/EvtSVVCPLH.hh
index 3015857..ea02557 100644
--- a/EvtGenModels/EvtSVVCPLH.hh
+++ b/EvtGenModels/EvtSVVCPLH.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVVCPLH_HH
 #define EVTSVVCPLH_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtSVVCPLH : public EvtDecayAmp {
   public:
     EvtSVVCPLH() {}
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVVHelAmp.hh b/EvtGenModels/EvtSVVHelAmp.hh
index 8a2c5da..a48c85e 100644
--- a/EvtGenModels/EvtSVVHelAmp.hh
+++ b/EvtGenModels/EvtSVVHelAmp.hh
@@ -1,53 +1,53 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVVHELAMP_HH
 #define EVTSVVHELAMP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 //Class to handle decays of the form SCALAR -> VECTOR VECTOR
 //according the the helicity amplitudes specified by the
 //user.  There are 6 arguements, orders as amplitude then
 //phase for H+, H0, and H-, in that order.
 
 class EvtAmp;
 class EvtParticle;
 class EvtId;
 
 class EvtSVVHelAmp : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
     static void SVVHel( EvtParticle* parent, EvtAmp& amp, EvtId n_v1,
                         EvtId n_v2, const EvtComplex& hp, const EvtComplex& h0,
                         const EvtComplex& hm );
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVVHelCPMix.hh b/EvtGenModels/EvtSVVHelCPMix.hh
index 011ea0f..c4d12fe 100644
--- a/EvtGenModels/EvtSVVHelCPMix.hh
+++ b/EvtGenModels/EvtSVVHelCPMix.hh
@@ -1,78 +1,78 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVVHELCPMIX_HH
 #define EVTSVVHELCPMIX_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 //Class to handle decays of the form SCALAR -> VECTOR VECTOR
 //according the the helicity amplitudes specified by the
 //user.  There are 6 arguements, orders as amplitude then
 //phase for H+, H0, and H-, in that order.
 //
 // Description: Routine to decay scalar -> 2 vectors
 //              by specifying the helicity amplitudes, taking appropriate
 //		weak phases into account to get mixing and CP violation through
 //		interference. Based on EvtSVVHelAmp. Particularly appropriate for
 //		Bs->J/Psi+Phi
 //
 // Model takes the following as user-specified arguments:
 //	deltaM, averageM - mass diference and average of light and heavy mass eigenstates (real scalars)
 //	gamma, deltagamma - average width and width difference of the l and h eigenstates (real scalars)
 //	delta1, delta2 - strong phases (real scalars)
 //	direct weak phase (real scalar) (for Bs->JPsiPhi this will be zero)
 //	weak mixing phase (real scalar) (this is equal to 2*arg(Vts Vtb) for Bs->JPsiPhi)
 //	Magnitudes of helicity amplitudes as in SVV_HELAMP
 // See Phys Rev D 34 p1404 - p1417 and chapters 5 and 7 of Physics Reports 370 p537-680 for more details
 
 class EvtAmp;
 class EvtParticle;
 class EvtId;
 
 class EvtSVVHelCPMix : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
 
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 
   private:
     EvtComplex m_hp;
     EvtComplex m_h0;
     EvtComplex m_hm;
     double m_averageM;
     double m_deltaM;
     double m_gamma;
     double m_deltagamma;
     EvtComplex m_strongphase1;
     EvtComplex m_strongphase2;
     EvtComplex m_weakmixingphase;
     EvtComplex m_weakdirectphase;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSVVNONCPEIGEN.hh b/EvtGenModels/EvtSVVNONCPEIGEN.hh
index 7e0c6bb..0325d62 100644
--- a/EvtGenModels/EvtSVVNONCPEIGEN.hh
+++ b/EvtGenModels/EvtSVVNONCPEIGEN.hh
@@ -1,82 +1,82 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSVVNONCPEIGEN_HH
 #define EVTSVVNONCPEIGEN_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: Routine to decay scalar -> vector vector
 //              and has CP violation.
 //
 //              This model does all the ckm-suppressed decays and mixing for you. It randomly 'overwrites'
 //              any reco or tagging state as set in the Y(4S) decay model (VSS_(B)MIX) with its own generated states.
 //
 //              As such, the corresponding dec file requires only one decay-mode description, for example:
 //              Decay MyB0
 //              1.000    rho+ MyD*-       SVV_NONCPEIGEN dm beta gamma 0.322 0.31 0.941 0 0.107 1.42 0.02 0 0.02 0 0.02 0 ;
 //              EndDecay
 //              and furthermore Y(4S) only needs to decay to B0's (or B0bar's).
 //              The decay above should be a CKM-favored mode (eg. B0->D*-rho+ or B0bar->D*+rho-).
 //              All ckm-suppressed decays and the mixing are derived from this line in the ::Decay function.
 //
 //              There are 15 or 27 arguments. The first three are dm, phase1
 //              and phase2. dm is the B0-B0bar mass difference. Phases 1
 //              and 2 are the CKM weak phases relevant for the particular mode,
 //              eg for B-->DstRho phase1 is beta and phase2 is gamma.
 //
 //              The next arguments are the 2 amplitudes (= 12 input parameters)
 //              in the order: A_f, Abar_f. In the example above, the 'A_f' amplitude now
 //              stands for the ckm-favored decay 'B0->D*-rho+', and 'Abar_f' stands for 'B0bar->D*-rho+'
 //
 //              Each amplitude has its 3 helicity states in the order +, 0, -, which are each
 //              specified by a magnitude and a strong phase.
 //
 //              The last 2 arguments A_fbar and Abar_fbar (=12 input parameters) are not necessary,
 //              but can included if one wants to set them differently from A_f, Abar_f.
 //
 //              Mind you that Hbar_+- = H_-+ (ignoring the weak phase, which flips sign).
 //              It is custumary to select one set of helicity states (eg H_+-) and to adopt these for
 //              the CP-conjugate decays as well (ie. depict Hbar_-+ with H_+-), which is the interpretation
 //              we use for the input-parameters above.
 //              However, the angular decay in EvtGen is just a formula in which helicity amplitudes are 'plugged' in,
 //              making no difference between B0 or B0bar decays. In the model below we (thus) account for the +-
 //              flipping between B0 and B0bar.
 
 class EvtSVVNONCPEIGEN : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 
   private:
     EvtComplex m_A_f[12];
 };
 
 #endif
diff --git a/EvtGenModels/EvtSingleParticle.hh b/EvtGenModels/EvtSingleParticle.hh
index 3e73d4a..ab445b9 100644
--- a/EvtGenModels/EvtSingleParticle.hh
+++ b/EvtGenModels/EvtSingleParticle.hh
@@ -1,47 +1,47 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSINGLEPARTICLE_HH
 #define EVTSINGLEPARTICLE_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 class EvtParticle;
 
 // Description:
 //This is a special decay model to generate single particles.
 
 class EvtSingleParticle : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
 
     void init() override;
     void initProbMax() override;
 
   private:
     double m_pmin, m_pmax;
     double m_cthetamin, m_cthetamax;
     double m_phimin, m_phimax;
 };
 
 #endif
diff --git a/EvtGenModels/EvtSll.hh b/EvtGenModels/EvtSll.hh
index b86551e..f11d498 100644
--- a/EvtGenModels/EvtSll.hh
+++ b/EvtGenModels/EvtSll.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTSLL_HH
 #define EVTSLL_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 //Class to handle decays of the form SCALAR -> DIRAC DIRAC.
 
 class EvtSll : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
 
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtTSS.hh b/EvtGenModels/EvtTSS.hh
index f06d26d..6a21ca0 100644
--- a/EvtGenModels/EvtTSS.hh
+++ b/EvtGenModels/EvtTSS.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTTSS_HH
 #define EVTTSS_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 //Class to handle decays of the form TENSOR -> SCALAR SCALAR.
 //Calls EvtTensorToScalarScalar
 
 class EvtParticle;
 
 class EvtTSS : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void decay( EvtParticle* p ) override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtTVP.hh b/EvtGenModels/EvtTVP.hh
index d05aa29..cdcccc0 100644
--- a/EvtGenModels/EvtTVP.hh
+++ b/EvtGenModels/EvtTVP.hh
@@ -1,52 +1,52 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EvtTVP_HH
 #define EvtTVP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <string>
 
 class EvtDecayBase;
 class EvtParticle;
 
 // Description: Routine to implement radiative decay
 //                   chi_c2 -> psi gamma
 //                   chi_c2 -> psi ell ell
 //		matrix element from [S.P Baranov et al, PRD 85, 014034 (2012)]
 
 class EvtTVP : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
 
     void initProbMax() override;
 
   private:
     void decay_2body( EvtParticle* p );
     void decay_3body( EvtParticle* p );
     double m_delta;    // form factor parameter
 };
 
 #endif
diff --git a/EvtGenModels/EvtTVSPwave.hh b/EvtGenModels/EvtTVSPwave.hh
index 204b73a..55dcfff 100644
--- a/EvtGenModels/EvtTVSPwave.hh
+++ b/EvtGenModels/EvtTVSPwave.hh
@@ -1,46 +1,46 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTTVSPWAVE_HH
 #define EVTTVSPWAVE_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 //Class to handles decays of the form TENSOR -> VECTOR SCALAR,
 //which proceed via S,P, or D partial waves.  There are
 //six arguements, which are the magnetude and phase of
 //each partial wave (S, P then D).  Calls EvtTensorToVectorScalar
 
 class EvtTVSPwave : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtTauHadnu.hh b/EvtGenModels/EvtTauHadnu.hh
index ce7c9d3..7b02487 100644
--- a/EvtGenModels/EvtTauHadnu.hh
+++ b/EvtGenModels/EvtTauHadnu.hh
@@ -1,53 +1,53 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTTAUHADNUKS_HH
 #define EVTTAUHADNUKS_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtTauHadnu : public EvtDecayAmp {
   public:
     EvtTauHadnu() {}
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 
   private:
     double m_beta;
     double m_mRho;
     double m_gammaRho;
     double m_mRhopr;
     double m_gammaRhopr;
     double m_mA1;
     double m_gammaA1;
 
     double gFunc( double m2, int dupD );
     EvtComplex Fpi( double s, double xm1, double xm2 );
     EvtComplex BW( double s, double m, double gamma, double xm1, double xm2 );
 };
 
 #endif
diff --git a/EvtGenModels/EvtTauScalarnu.hh b/EvtGenModels/EvtTauScalarnu.hh
index e2bf14b..3384ed5 100644
--- a/EvtGenModels/EvtTauScalarnu.hh
+++ b/EvtGenModels/EvtTauScalarnu.hh
@@ -1,38 +1,38 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTTAUSCALARNU_HH
 #define EVTTAUSCALARNU_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtTauScalarnu : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtTauVectornu.hh b/EvtGenModels/EvtTauVectornu.hh
index 7e1e276..566b21d 100644
--- a/EvtGenModels/EvtTauVectornu.hh
+++ b/EvtGenModels/EvtTauVectornu.hh
@@ -1,40 +1,40 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTTAUVECTORNU_HH
 #define EVTTAUVECTORNU_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtTauVectornu : public EvtDecayAmp {
   public:
     EvtTauVectornu() {}
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtTaulnunu.hh b/EvtGenModels/EvtTaulnunu.hh
index 8c788a9..0cf47a3 100644
--- a/EvtGenModels/EvtTaulnunu.hh
+++ b/EvtGenModels/EvtTaulnunu.hh
@@ -1,38 +1,38 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTTAULNUNU_HH
 #define EVTTAULNUNU_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtTaulnunu : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtThreeBodyPhsp.hh b/EvtGenModels/EvtThreeBodyPhsp.hh
index c25e2f6..e0e6ca8 100644
--- a/EvtGenModels/EvtThreeBodyPhsp.hh
+++ b/EvtGenModels/EvtThreeBodyPhsp.hh
@@ -1,51 +1,51 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTTHREEBODYPHSP_HH
 #define EVTTHREEBODYPHSP_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 class EvtParticle;
 
 // Description:
 //Class to handle generic phase space decays not done
 //in other decay models.
 
 class EvtThreeBodyPhsp : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     double m_m12SqMin;
     double m_m12SqMax;
     double m_m23SqMin;
     double m_m23SqMax;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVPHOtoVISRHi.hh b/EvtGenModels/EvtVPHOtoVISRHi.hh
index 0af3116..87be97b 100644
--- a/EvtGenModels/EvtVPHOtoVISRHi.hh
+++ b/EvtGenModels/EvtVPHOtoVISRHi.hh
@@ -1,40 +1,40 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVPHOTOVISRHI_HH
 #define EVTVPHOTOVISRHI_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <string>
 
 class EvtParticle;
 
 class EvtVPHOtoVISRHi : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVSPPwave.hh b/EvtGenModels/EvtVSPPwave.hh
index bb720fd..6efa0fd 100644
--- a/EvtGenModels/EvtVSPPwave.hh
+++ b/EvtGenModels/EvtVSPPwave.hh
@@ -1,38 +1,38 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVSPPWAVE_HH
 #define EVTVSPPWAVE_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtVSPPwave : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVSSBMixCPT.hh b/EvtGenModels/EvtVSSBMixCPT.hh
index 7b67d7f..adfdcc9 100644
--- a/EvtGenModels/EvtVSSBMixCPT.hh
+++ b/EvtGenModels/EvtVSSBMixCPT.hh
@@ -1,63 +1,63 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVSSBMIXCPT_HH
 #define EVTVSSBMIXCPT_HH
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtParticle.hh"
 
 // Description:
 //    Routine to decay vector-> scalar scalar with coherent BB-like mixing
 //                              including CPT effects
 //    Based on VSSBMIX
 
 class EvtVSSBMixCPT : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
-    int nRealDaughters() override { return 2; }
+    int nRealDaughters() const override { return 2; }
 
     std::string getParamName( int i ) override;
     std::string getParamDefault( int i ) override;
 
   private:
     double m_freq;    // mixing frequency in hbar/mm
     double m_dGamma;
     EvtComplex m_qoverp;
     EvtComplex m_poverq;
     EvtComplex m_z;
     double m_chib0_b0bar;
     double m_chib0bar_b0;
 
     EvtComplex m_A_f;
     EvtComplex m_Abar_f;
 
     EvtComplex m_A_fbar;
     EvtComplex m_Abar_fbar;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVSSMix.hh b/EvtGenModels/EvtVSSMix.hh
index 4f26e01..da6ea8d 100644
--- a/EvtGenModels/EvtVSSMix.hh
+++ b/EvtGenModels/EvtVSSMix.hh
@@ -1,42 +1,42 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVSSMIX_HH
 #define EVTVSSMIX_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtVSSMix : public EvtDecayAmp {
   public:
     EvtVSSMix() {}
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
     std::string getParamName( int i ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVVP.hh b/EvtGenModels/EvtVVP.hh
index 06e3a4a..47b47a2 100644
--- a/EvtGenModels/EvtVVP.hh
+++ b/EvtGenModels/EvtVVP.hh
@@ -1,52 +1,52 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVVP_HH
 #define EVTVVP_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <string>
 
 class EvtParticle;
 class EvtDecayBase;
 
 // Description: Routine to implement radiative decay
 //                   chi_c1 -> psi gamma
 //                   chi_c1 -> psi ell ell
 
 class EvtVVP : public EvtDecayAmp {
   public:
     EvtVVP() {}
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 
   private:
     void decay_2body( EvtParticle* p );
     void decay_3body( EvtParticle* p );
     double m_delta;    // form factor parameter
 };
 
 #endif
diff --git a/EvtGenModels/EvtVVPIPI_WEIGHTED.hh b/EvtGenModels/EvtVVPIPI_WEIGHTED.hh
index 08e4747..f5ff55f 100644
--- a/EvtGenModels/EvtVVPIPI_WEIGHTED.hh
+++ b/EvtGenModels/EvtVVPIPI_WEIGHTED.hh
@@ -1,43 +1,43 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVVPIPI_WEIGHTED_HH
 #define EVTVVPIPI_WEIGHTED_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <string>
 
 class EvtParticle;
 
 // Description: For decays of a vector to a vector and 2 pions,
 //              the decay is assumed to be dominated by S-wave.
 
 class EvtVVPIPI_WEIGHTED : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVVSPwave.hh b/EvtGenModels/EvtVVSPwave.hh
index f845a4f..d049c3c 100644
--- a/EvtGenModels/EvtVVSPwave.hh
+++ b/EvtGenModels/EvtVVSPwave.hh
@@ -1,40 +1,40 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVVSPWAVE_HH
 #define EVTVVSPWAVE_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtVVSPwave : public EvtDecayAmp {
   public:
     EvtVVSPwave() {}
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVVpipi.hh b/EvtGenModels/EvtVVpipi.hh
index c981886..609efbf 100644
--- a/EvtGenModels/EvtVVpipi.hh
+++ b/EvtGenModels/EvtVVpipi.hh
@@ -1,41 +1,41 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVVPIPI_HH
 #define EVTVVPIPI_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: For decays of a vector to a vector and 2 pions,
 //              the decay is assumed to be dominated by S-wave.
 
 class EvtVVpipi : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVectorIsr.hh b/EvtGenModels/EvtVectorIsr.hh
index 7326650..e34a29c 100644
--- a/EvtGenModels/EvtVectorIsr.hh
+++ b/EvtGenModels/EvtVectorIsr.hh
@@ -1,56 +1,56 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVECTORISR_HH
 #define EVTVECTORISR_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 class EvtParticle;
 
 // Description:
 //   This is a special decay model to generate e+e- -> phi gamma + soft gammas
 //   using soft collinear ISR calculation from AfkQed
 //   This is implemented as a decay of the VPHO.
 
 class EvtVectorIsr : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
 
     void init() override;
 
     void initProbMax() override;
 
     double ckhrad1( double xx, double a, double b );
 
     void ckhrad( const double& e_beam, const double& q2_min, double& e01,
                  double& e02, double& f );
 
   private:
     double m_csfrmn, m_csbkmn;
     double m_fmax;
     bool m_firstorder;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVll.hh b/EvtGenModels/EvtVll.hh
index d2268a0..e13806d 100644
--- a/EvtGenModels/EvtVll.hh
+++ b/EvtGenModels/EvtVll.hh
@@ -1,38 +1,38 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVLL_HH
 #define EVTVLL_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtVll : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* p ) override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVtoSll.hh b/EvtGenModels/EvtVtoSll.hh
index dd56bc5..e645cbd 100644
--- a/EvtGenModels/EvtVtoSll.hh
+++ b/EvtGenModels/EvtVtoSll.hh
@@ -1,45 +1,45 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVTOSLL_HH
 #define EVTVTOSLL_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 class EvtVtoSll : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
     void init() override;
     void decay( EvtParticle* parent ) override;
 
   protected:
     void calcAmp( const EvtParticle& parent, EvtAmp& amp ) const;
 
   private:
     static constexpr double m_poleSize{ 0.00005 };
     bool m_electronMode{ false };
 };
 
 #endif
diff --git a/EvtGenModels/EvtVub.hh b/EvtGenModels/EvtVub.hh
index d1d2bd7..fa2fefa 100644
--- a/EvtGenModels/EvtVub.hh
+++ b/EvtGenModels/EvtVub.hh
@@ -1,64 +1,64 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVUB_HH
 #define EVTVUB_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 #include "EvtGenModels/EvtVubdGamma.hh"
 
 #include <memory>
 #include <vector>
 
 class EvtParticle;
 
 // Description:
 // Class to generate inclusive B to X_u l nu decays according to various
 // decay models. Implemtented are ACCM, parton-model and a QCD model.
 
 class EvtVub : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     double m_mb;        // the b-quark pole mass in GeV (try 4.65 to 4.9)
     double m_a;         // Parameter for the Fermi Motion (1.29 is good)
     double m_alphas;    // Strong Coupling at m_b (around 0.24)
     double m_dGMax;     // max dGamma*p2 value;
     int m_nbins;
     int m_storeQplus;
     std::vector<double> m_masses;
     std::vector<double> m_weights;
 
     std::unique_ptr<EvtVubdGamma> m_dGamma;    // calculates the decay rate
     double findPFermi();
     std::vector<double> m_pf;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVubBLNP.hh b/EvtGenModels/EvtVubBLNP.hh
index 0dbe7d8..29051bb 100644
--- a/EvtGenModels/EvtVubBLNP.hh
+++ b/EvtGenModels/EvtVubBLNP.hh
@@ -1,150 +1,150 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVUBBLNP_HH
 #define EVTVUBBLNP_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 #include <vector>
 
 class EvtParticle;
 
 // Description: Modeled on Riccardo Faccini's EvtVubNLO module
 // tripleDiff from BLNP's notebook (based on BLNP4, hep-ph/0504071)
 
 class EvtVubBLNP : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* Bmeson ) override;
 
   private:
     // Input parameters
     double m_mBB;
     double m_lambda2;
 
     // Shape function parameters
     double m_b;
     double m_Lambda;
     double m_Ecut;
     double m_wzero;
 
     // SF and SSF modes
     int m_itype;
     double m_dtype;
     int m_isubl;
 
     // flags
     int m_flag1;
     int m_flag2;
     int m_flag3;
 
     // Quark mass
     double m_mb;
 
     // Matching scales
     double m_muh;
     double m_mui;
     double m_mubar;
 
     // Perturbative quantities
     double m_CF;
     double m_CA;
 
     double m_beta0;
     double m_beta1;
     double m_beta2;
 
     double m_zeta3;
 
     double m_Gamma0;
     double m_Gamma1;
     double m_Gamma2;
 
     double m_gp0;
     double m_gp1;
 
     double m_Lbar;
     double m_mupisq;
     double m_moment2;
 
     int m_flagpower;
     int m_flag2loop;
 
     int m_maxLoop;
     double m_precision;
 
     std::vector<double> m_gvars;
 
     double rate3( double Pp, double Pl, double Pm );
     double F1( double Pp, double Pm, double muh, double mui, double mubar,
                double doneJS, double done1 );
     double F2( double Pp, double Pm, double muh, double mui, double mubar,
                double done3 );
     double F3( double Pp, double Pm, double muh, double mui, double mubar,
                double done2 );
     double DoneJS( double Pp, double Pm, double mui );
     double Done1( double Pp, double Pm, double mui );
     double Done2( double Pp, double Pm, double mui );
     double Done3( double Pp, double Pm, double mui );
     static double IntJS( double what, const std::vector<double>& vars );
     static double Int1( double what, const std::vector<double>& vars );
     static double Int2( double what, const std::vector<double>& vars );
     static double Int3( double what, const std::vector<double>& vars );
     static double g1( double w, const std::vector<double>& vars );
     static double g2( double w, const std::vector<double>& vars );
     static double g3( double w, const std::vector<double>& vars );
     static double Shat( double w, const std::vector<double>& vars );
     static double Mzero( double muf, double mu, double mupisq,
                          const std::vector<double>& vars );
     double wS( double w );
     double t( double w );
     double u( double w );
     double v( double w );
     double myfunction( double w, double Lbar, double mom2 );
     double myfunctionBIK( double w, double Lbar, double mom2 );
     double dU1nlo( double muh, double mui );
     double U1lo( double muh, double mui );
     double Sfun( double mu1, double mu2, double epsilon );
     double S0( double a1, double r );
     double S1( double a1, double r );
     double S2( double a1, double r );
     double aGamma( double mu1, double mu2, double epsilon );
     double agp( double mu1, double mu2, double epsilon );
     double alo( double muh, double mui );
     double anlo( double muh, double mui );    // d/depsilon of aGamma
     static double alphas( double mu, const std::vector<double>& vars );
     double PolyLog( double v, double z );
     static double Gamma( double z );
     static double Gamma( double a, double x );
     static double gamser( double a, double x, double LogGamma );
     static double gammcf( double a, double x, double LogGamma );
     double findBLNPWhat();
     std::vector<double> m_pf;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVubBLNPHybrid.hh b/EvtGenModels/EvtVubBLNPHybrid.hh
index 085d290..d99e38d 100644
--- a/EvtGenModels/EvtVubBLNPHybrid.hh
+++ b/EvtGenModels/EvtVubBLNPHybrid.hh
@@ -1,181 +1,181 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVUBBLNPHYBRID_HH
 #define EVTVUBBLNPHYBRID_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 #include <vector>
 
 class EvtParticle;
 
 // tripleDiff from BLNPHybrid's notebook, based on hep-ph/0504071
 //
 // Description:
 // Class to generate inclusive B to X_u l nu decays.
 // This class is based on EvtVubBLNP by Sheila Mclachlin with an update to
 // generate the inclusive decays in such a way that the right
 // mix of inclusive and exclusive decays is obtained.
 //
 //NOTE:
 // - A set of weights (for bins in the kinematic variables mX, q2, El)
 //   is read from DECAY.DEC. This set of weights must be consistent
 //   with the other parameters specified (excl. BF, non-res BF, mb, a).
 // - If no binning/weights are specified in DECAY.DEC the hybrid
 //   reweighting is not activated
 
 class EvtVubBLNPHybrid : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* Bmeson ) override;
 
     void readWeights( int startArg = 0 );
 
     double getWeight( double mX, double q2, double El );
 
   private:
     //Input for hybrid modell
     enum
     {
         nParameters = 10,
         nVariables = 3
     };
     bool m_noHybrid = false;
     bool m_storeWhat = true;
     int m_nbins = 0;
     double m_masscut = 0.28;
     std::vector<double> m_bins_mX;
     std::vector<double> m_bins_q2;
     std::vector<double> m_bins_El;
     std::vector<double> m_weights;
 
     // Input parameters
     double m_mBB;
     double m_lambda2;
 
     // Shape function parameters
     double m_b;
     double m_Lambda;
     double m_Ecut;
     double m_wzero;
 
     // SF and SSF modes
     int m_itype;
     double m_dtype;
     int m_isubl;
 
     // flags
     int m_flag1;
     int m_flag2;
     int m_flag3;
 
     // Quark mass
     double m_mb;
 
     // Matching scales
     double m_muh;
     double m_mui;
     double m_mubar;
 
     // Perturbative quantities
     double m_CF;
     double m_CA;
 
     double m_beta0;
     double m_beta1;
     double m_beta2;
 
     double m_zeta3;
 
     double m_Gamma0;
     double m_Gamma1;
     double m_Gamma2;
 
     double m_gp0;
     double m_gp1;
 
     double m_Lbar;
     double m_mupisq;
     double m_moment2;
 
     int m_flagpower;
     int m_flag2loop;
 
     int m_maxLoop;
     double m_precision;
 
     std::vector<double> m_gvars;
 
     double rate3( double Pp, double Pl, double Pm );
     double F1( double Pp, double Pm, double muh, double mui, double mubar,
                double doneJS, double done1 );
     double F2( double Pp, double Pm, double muh, double mui, double mubar,
                double done3 );
     double F3( double Pp, double Pm, double muh, double mui, double mubar,
                double done2 );
     double DoneJS( double Pp, double Pm, double mui );
     double Done1( double Pp, double Pm, double mui );
     double Done2( double Pp, double Pm, double mui );
     double Done3( double Pp, double Pm, double mui );
     static double IntJS( double what, const std::vector<double>& vars );
     static double Int1( double what, const std::vector<double>& vars );
     static double Int2( double what, const std::vector<double>& vars );
     static double Int3( double what, const std::vector<double>& vars );
     static double g1( double w, const std::vector<double>& vars );
     static double g2( double w, const std::vector<double>& vars );
     static double g3( double w, const std::vector<double>& vars );
     static double Shat( double w, const std::vector<double>& vars );
     static double Mzero( double muf, double mu, double mupisq,
                          const std::vector<double>& vars );
     double wS( double w );
     double t( double w );
     double u( double w );
     double v( double w );
     double myfunction( double w, double Lbar, double mom2 );
     double myfunctionBIK( double w, double Lbar, double mom2 );
     double dU1nlo( double muh, double mui );
     double U1lo( double muh, double mui );
     double Sfun( double mu1, double mu2, double epsilon );
     double S0( double a1, double r );
     double S1( double a1, double r );
     double S2( double a1, double r );
     double aGamma( double mu1, double mu2, double epsilon );
     double agp( double mu1, double mu2, double epsilon );
     double alo( double muh, double mui );
     double anlo( double muh, double mui );    // d/depsilon of aGamma
     static double alphas( double mu, const std::vector<double>& vars );
     double PolyLog( double v, double z );
     static double Gamma( double z );
     static double Gamma( double a, double x );
     static double gamser( double a, double x, double LogGamma );
     static double gammcf( double a, double x, double LogGamma );
     double findBLNPWhat();
     std::vector<double> m_pf;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVubHybrid.hh b/EvtGenModels/EvtVubHybrid.hh
index b89b2ac..5606502 100644
--- a/EvtGenModels/EvtVubHybrid.hh
+++ b/EvtGenModels/EvtVubHybrid.hh
@@ -1,91 +1,91 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVUBHYBRID_HH
 #define EVTVUBHYBRID_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 #include "EvtGenModels/EvtVubdGamma.hh"
 
 #include <memory>
 #include <vector>
 
 class EvtParticle;
 class RandGeneral;
 
 // Description:
 // Class to generate inclusive B to X_u l nu decays.
 // This class is based on EvtVub by Sven Menke with an update to
 // generate the inclusive decays in such a way that the right
 // mix of inclusive and exclusive decays is obtained:
 // "Hybrid Model" by Dominique Fortin.
 // NOTE:
 // - A set of weights (for bins in the kinematic variables mX, q2, El)
 //   is read from DECAY.DEC. This set of weights must be consistent
 //   with the other parameters specified (excl. BF, non-res BF, mb, a).
 // - If no binning/weights are specified in DECAY.DEC the hybrid
 //   reweighting is not activated
 
 class EvtVubHybrid : public EvtDecayIncoherent {
   public:
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
     void readWeights( int startArg = 0 );
 
     double getWeight( double mX, double q2, double El );
 
   private:
     double findPFermi();
 
     enum
     {
         nParameters = 3,
         nVariables = 3
     };
 
     bool m_noHybrid =
         false;    // m_noHybrid will be set TRUE if the DECAY.DEC file has no binning or weights
     bool m_storeQplus =
         true;    // m_storeQplus should alwasy be TRUE: writes out Fermi motion parameter
 
     double m_mb = 4.62;        // the b-quark pole mass in GeV (try 4.65 to 4.9)
     double m_a = 2.27;         // Parameter for the Fermi Motion (1.29 is good)
     double m_alphas = 0.22;    // Strong Coupling at m_b (around 0.24)
     double m_dGMax = 3.;       // max dGamma*p2 value;
     int m_nbins = 0;
     double m_masscut = 0.28;
     std::vector<double> m_bins_mX;
     std::vector<double> m_bins_q2;
     std::vector<double> m_bins_El;
     std::vector<double> m_weights;
     std::unique_ptr<EvtVubdGamma> m_dGamma;    // calculates the decay rate
     std::vector<double> m_pf;
 };
 
 #endif
diff --git a/EvtGenModels/EvtVubNLO.hh b/EvtGenModels/EvtVubNLO.hh
index ed8e98a..52213c6 100644
--- a/EvtGenModels/EvtVubNLO.hh
+++ b/EvtGenModels/EvtVubNLO.hh
@@ -1,235 +1,235 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTVUBNLO_HH
 #define EVTVUBNLO_HH
 
 #include "EvtGenBase/EvtDecayIncoherent.hh"
 
 #include <vector>
 
 class EvtParticle;
 class RandGeneral;
 
 // Description:
 // Class to generate inclusive B to X_u l nu decays according to various
 // decay models. Implemtented are ACCM, parton-model and a QCD model.
 // Description: Routine to decay B->Xulnu according to Bosch, Lange, Neubert, and Paz hep-ph/0402094
 //              Equation numbers refer to this paper
 
 class EvtVubNLO : public EvtDecayIncoherent {
   public:
     EvtVubNLO() = default;
     ~EvtVubNLO();
 
-    std::string getName() override;
+    std::string getName() const override;
 
-    EvtDecayBase* clone() override;
+    EvtDecayBase* clone() const override;
 
     void initProbMax() override;
 
     void init() override;
 
     void decay( EvtParticle* p ) override;
 
   private:
     // cache
     double m_lbar;
     double m_mupi2;
 
     double m_mb;    // the b-quark pole mass in GeV
     double m_mB;
     double m_lambdaSF;
     double m_b;    // Parameter for the Fermi Motion
     double m_kpar;
     double m_mui;       // renormalization scale (preferred value=1.5 GeV)
     double m_SFNorm;    // SF normalization
     double m_dGMax;     // max dGamma*p2 value;
     int m_idSF;         // which shape function?
     std::vector<double> m_masses;
     std::vector<double> m_weights;
 
     double m_gmax;
     int m_ngood, m_ntot;
 
     double tripleDiff( double pp, double pl, double pm );
     double SFNorm( const std::vector<double>& coeffs );
     static double integrand( double omega, const std::vector<double>& coeffs );
     double F10( const std::vector<double>& coeffs );
     static double F1Int( double omega, const std::vector<double>& coeffs );
     double F20( const std::vector<double>& coeffs );
     static double F2Int( double omega, const std::vector<double>& coeffs );
     double F30( const std::vector<double>& coeffs );
     static double F3Int( double omega, const std::vector<double>& coeffs );
     static double g1( double y, double z );
     static double g2( double y, double z );
     static double g3( double y, double z );
 
     static double Gamma( double z );    // Euler Gamma Function
     static double dgamma( double t, const std::vector<double>& c )
     {
         return pow( t, c[0] - 1 ) * exp( -t );
     }
     static double Gamma( double z, double tmax );
 
     // theory parameters
     inline double mu_i() { return m_mui; }    // intermediate scale
     inline double mu_bar() { return m_mui; }
     inline double mu_h() { return m_mb / sqrt( 2.0 ); }    // high scale
     inline double lambda1() { return -m_mupi2; }
 
     // expansion coefficients for RGE
     static double beta0( int nf = 4 ) { return 11. - 2. / 3. * nf; }
     static double beta1( int nf = 4 ) { return 34. * 3. - 38. / 3. * nf; }
     static double beta2( int nf = 4 )
     {
         return 1428.5 - 5033. / 18. * nf + 325. / 54. * nf * nf;
     }
     static double gamma0() { return 16. / 3.; }
     static double gamma1( int nf = 4 )
     {
         return 4. / 3. * ( 49.85498 - 40. / 9. * nf );
     }
     static double gamma2( int nf = 4 )
     {
         return 64. / 3. * ( 55.07242 - 8.58691 * nf - nf * nf / 27. );
     } /*  zeta3=1.20206 */
     static double gammap0() { return -20. / 3.; }
     static double gammap1( int nf = 4 )
     {
         return -32. / 3. * ( 6.92653 - 0.9899 * nf );
     } /* ??  zeta3=1.202 */
 
     // running constants
 
     static double alphas( double mu );
     static double C_F( double mu )
     {
         return ( 4.0 / 3.0 ) * alphas( mu ) / 4. / EvtConst::pi;
     }
 
     // Shape Functions
 
     inline double lambda_SF() { return m_lambdaSF; }
     double lambda_bar( double omega0 );
     inline double lambda2() { return 0.12; }
     double mu_pi2( double omega0 );
     inline double lambda( double ) { return m_mB - m_mb; }
 
     // specail for gaussian SF
     static double cGaus( double b )
     {
         return pow( Gamma( 1 + b / 2. ) / Gamma( ( 1 + b ) / 2. ), 2 );
     }
 
     double M0( double mui, double omega0 );
     static double shapeFunction( double omega, const std::vector<double>& coeffs );
     static double expShapeFunction( double omega,
                                     const std::vector<double>& coeffs );
     static double gausShapeFunction( double omega,
                                      const std::vector<double>& coeffs );
     // SSF (not yet implemented)
     double subS( const std::vector<double>& coeffs );
     double subT( const std::vector<double>& coeffs );
     double subU( const std::vector<double>& coeffs );
     double subV( const std::vector<double>& coeffs );
 
     // Sudakov
 
     inline double S0( double a, double r )
     {
         return -gamma0() / 4 / a / pow( beta0(), 2 ) * ( 1 / r - 1 + log( r ) );
     }
     inline double S1( double /*a*/, double r )
     {
         return gamma0() / 4. / pow( beta0(), 2 ) *
                ( pow( log( r ), 2 ) * beta1() / 2. / beta0() +
                  ( gamma1() / gamma0() - beta1() / beta0() ) *
                      ( 1. - r + log( r ) ) );
     }
     inline double S2( double a, double r )
     {
         return gamma0() * a / 4. / pow( beta0(), 2 ) *
                ( -0.5 * pow( ( 1 - r ), 2 ) *
                      ( pow( beta1() / beta0(), 2 ) - beta2() / beta0() -
                        beta1() / beta0() * gamma1() / gamma0() +
                        gamma2() / gamma0() ) +
                  ( pow( beta1() / beta0(), 2 ) - beta2() / beta0() ) *
                      ( 1 - r ) * log( r ) +
                  ( beta1() / beta0() * gamma1() / gamma0() - beta2() / beta0() ) *
                      ( 1 - r + r * log( r ) ) );
     }
     inline double dSudakovdepsi( double mu1, double mu2 )
     {
         return S2( alphas( mu1 ) / ( 4 * EvtConst::pi ),
                    alphas( mu2 ) / alphas( mu1 ) );
     }
     inline double Sudakov( double mu1, double mu2, double epsi = 0 )
     {
         double fp( 4 * EvtConst::pi );
         return S0( alphas( mu1 ) / fp, alphas( mu2 ) / alphas( mu1 ) ) +
                S1( alphas( mu1 ) / fp, alphas( mu2 ) / alphas( mu1 ) ) +
                epsi * dSudakovdepsi( mu1, mu2 );
     }
 
     // RG
     inline double dGdepsi( double mu1, double mu2 )
     {
         return 1. / 8. / EvtConst::pi * ( alphas( mu2 ) - alphas( mu1 ) ) *
                ( gamma1() / beta0() - beta1() * gamma0() / pow( beta0(), 2 ) );
     }
     inline double aGamma( double mu1, double mu2, double epsi = 0 )
     {
         return gamma0() / 2 / beta0() * log( alphas( mu2 ) / alphas( mu1 ) ) +
                epsi * dGdepsi( mu1, mu2 );
     }
     inline double dgpdepsi( double mu1, double mu2 )
     {
         return 1. / 8. / EvtConst::pi * ( alphas( mu2 ) - alphas( mu1 ) ) *
                ( gammap1() / beta0() - beta1() * gammap0() / pow( beta0(), 2 ) );
     }
     inline double agammap( double mu1, double mu2, double epsi = 0 )
     {
         return gammap0() / 2 / beta0() * log( alphas( mu2 ) / alphas( mu1 ) ) +
                epsi * dgpdepsi( mu1, mu2 );
     }
     inline double U1( double mu1, double mu2, double epsi = 0 )
     {
         return exp( 2 * ( Sudakov( mu1, mu2, epsi ) - agammap( mu1, mu2, epsi ) -
                           aGamma( mu1, mu2, epsi ) * log( m_mb / mu1 ) ) );
     }
     inline double U1lo( double mu1, double mu2 ) { return U1( mu1, mu2 ); }
     inline double U1nlo( double mu1, double mu2 )
     {
         return U1( mu1, mu2 ) *
                ( 1 + 2 * ( dSudakovdepsi( mu1, mu2 ) - dgpdepsi( mu1, mu2 ) -
                            log( m_mb / mu1 ) * dGdepsi( mu1, mu2 ) ) );
     }
     inline double alo( double mu1, double mu2 )
     {
         return -2 * aGamma( mu1, mu2 );
     }
     inline double anlo( double mu1, double mu2 )
     {
         return -2 * dGdepsi( mu1, mu2 );
     }
 };
 
 #endif
diff --git a/EvtGenModels/EvtXPsiGamma.hh b/EvtGenModels/EvtXPsiGamma.hh
index 4005f34..15b817b 100644
--- a/EvtGenModels/EvtXPsiGamma.hh
+++ b/EvtGenModels/EvtXPsiGamma.hh
@@ -1,71 +1,71 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTXPSIGAMMA_HH
 #define EVTXPSIGAMMA_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 #include "EvtGenBase/EvtId.hh"
 
 #include <fstream>
 #include <stdio.h>
 
 class EvtComplex;
 class EvtParticle;
 class EvtTensor4C;
 class EvtVector4C;
 class EvtVector4R;
 
 // Description:Implementation of the X3872(2-+) -> J/psi gamma decay
 // Description: Routine to implement radiative decay X3872(2-+) -> J/psi gamma
 //      according to F. Brazzi et al, arXiv:1103.3155
 
 class EvtXPsiGamma : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   protected:
     // This function is not declared const because epsParentPhoton is not const
     void calcAmp( EvtParticle& parent, EvtAmp& amp );
 
   private:
     double calcPstar( double m_parent, double m_1, double m_2 ) const;
 
     EvtComplex fT2( EvtVector4R p, EvtVector4R q, EvtTensor4C epsPI,
                     EvtVector4C epsEps, EvtVector4C epsEta ) const;
     EvtComplex fT3( EvtVector4R p, EvtVector4R q, EvtTensor4C epsPI,
                     EvtVector4C epsEps, EvtVector4C epsEta ) const;
 
     EvtId m_ID0;
 
     double m_gOmega;
     double m_gPOmega;
     double m_gRho;
     double m_gPRho;
     double m_fOmega;
     double m_fRho;
 };
 
 #endif
diff --git a/EvtGenModels/EvtY3SToY1SpipiMoxhay.hh b/EvtGenModels/EvtY3SToY1SpipiMoxhay.hh
index 8946cfc..b345b13 100644
--- a/EvtGenModels/EvtY3SToY1SpipiMoxhay.hh
+++ b/EvtGenModels/EvtY3SToY1SpipiMoxhay.hh
@@ -1,57 +1,57 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTY3STOY1SPIPIMOXHAY_HH
 #define EVTY3STOY1SPIPIMOXHAY_HH
 
 #include "EvtGenBase/EvtDecayProb.hh"
 
 class EvtParticle;
 
 // Description: This model is based on the proposal by Tuan and Lipkin
 //              (Phys.Lett.B206:349-353,1988) and the subsequent model
 //              by Moxhay (Phys.Rev.D39:3497,1989) for the dipion spectrum
 //              in Y(3S) -> pi+ pi- Y(1S). Please Note: in Moxhay's paper,
 //              he wrote the fitted value of the parameter Im(B)/A as
 //              -0.2983. However, using his quoted value leads to the wrong
 //              spectrum. Changing the sign of his quoted Im(B)/A fixes the
 //              shape and reproduces his result. Therefore, please pass
 //              Im(B)/A = 0.2983 and Re(B)/A = 0.2196 to get the correct shape
 //              based on his fit to the CLEO data.
 //
 // Example:
 //
 // Decay  Upsilon(3S)
 //  1.0000    Upsilon  pi+  pi-     Y3STOY1SPIPIMOXHAY 0.2196 0.2983;
 // Enddecay
 //
 //   --> the order of parameters is: Re(B)/A Im(B)/A
 
 class EvtY3SToY1SpipiMoxhay : public EvtDecayProb {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtYmSToYnSpipiCLEO.hh b/EvtGenModels/EvtYmSToYnSpipiCLEO.hh
index 2fd3523..874a6f5 100644
--- a/EvtGenModels/EvtYmSToYnSpipiCLEO.hh
+++ b/EvtGenModels/EvtYmSToYnSpipiCLEO.hh
@@ -1,63 +1,63 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTYMSTOYNSPIPICLEO_HH
 #define EVTYMSTOYNSPIPICLEO_HH
 
 // #include "EvtGenBase/EvtDecayProb.hh"
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 
 // Description: This model is based on matrix element method used by
 //              CLEO in Phys.Rev.D76:072001,2007 to model the dipion mass
 //              and helicity angle distribution in the decays Y(mS) -> pi pi Y(nS),
 //              where m,n are integers and m>n and m<4.
 //              This model has two parameters, Re(B/A) and Im(B/A), which
 //              are coefficients of the matrix element's terms determined by
 //              the CLEO fits.
 //
 // Example:
 //
 // Decay  Upsilon(3S)
 //  1.0000    Upsilon      pi+  pi-     YMSTOYNSPIPICLEO -2.523 1.189;
 // Enddecay
 // Decay  Upsilon(3S)
 //  1.0000    Upsilon(2S)  pi+  pi-     YMSTOYNSPIPICLEO -0.395 0.001;
 // Enddecay
 // Decay  Upsilon(2S)
 //  1.0000    Upsilon      pi+  pi-     YMSTOYNSPIPICLEO -0.753 0.000;
 // Enddecay
 //
 //   --> the order of parameters is: Re(B/A) Im(B/A)
 
 class EvtYmSToYnSpipiCLEO : public EvtDecayAmp {
     //EvtDecayProb  {
 
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 };
 
 #endif
diff --git a/EvtGenModels/EvtbTosllAli.hh b/EvtGenModels/EvtbTosllAli.hh
index 2ba0e09..286f7b7 100644
--- a/EvtGenModels/EvtbTosllAli.hh
+++ b/EvtGenModels/EvtbTosllAli.hh
@@ -1,50 +1,50 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOSLLALI_HH
 #define EVTBTOSLLALI_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <memory>
 
 class EvtbTosllFF;
 #include "EvtGenModels/EvtbTosllAmp.hh"
 #include "EvtGenModels/EvtbTosllFF.hh"
 class EvtParticle;
 
 // Description:Implementation of the b->sll decays according to Ali '01 et al.
 
 class EvtbTosllAli : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
   private:
     std::unique_ptr<EvtbTosllFF> m_aliffmodel;
     std::unique_ptr<EvtbTosllAmp> m_calcamp;
     double m_poleSize;
 };
 
 #endif
diff --git a/EvtGenModels/EvtbTosllBall.hh b/EvtGenModels/EvtbTosllBall.hh
index b1d7f5c..675e680 100644
--- a/EvtGenModels/EvtbTosllBall.hh
+++ b/EvtGenModels/EvtbTosllBall.hh
@@ -1,49 +1,49 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOSLLBALL_HH
 #define EVTBTOSLLBALL_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 #include <memory>
 
 class EvtbTosllFF;
 class EvtbTosllAmp;
 class EvtParticle;
 
 // Description:Implementation of the b->sll decays according to Ball et al.
 
 class EvtbTosllBall : public EvtDecayAmp {
   public:
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void decay( EvtParticle* p ) override;
     void init() override;
     void initProbMax() override;
 
   private:
     std::unique_ptr<EvtbTosllAmp> m_calcamp;
     std::unique_ptr<EvtbTosllFF> m_ballffmodel;
     double m_poleSize;
 };
 
 #endif
diff --git a/EvtGenModels/EvtbTosllMS.hh b/EvtGenModels/EvtbTosllMS.hh
index 82dd0e7..790cb32 100644
--- a/EvtGenModels/EvtbTosllMS.hh
+++ b/EvtGenModels/EvtbTosllMS.hh
@@ -1,56 +1,56 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOSLLMS_HH
 #define EVTBTOSLLMS_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 class EvtbTosllFFNew;    // my class with ff for rare semileptonic B-decays
 class EvtbTosllAmpNew;    // my class with amplitudes for rare semileptonic B-decays
 class EvtbTosllWilsCoeffNLO;    // my class with Wilson coefficients in NLO
 
 // Description: Implementation of the B -> K* ell^+ ell^- decay according
 //              to the paper: D.Melikhov, B.Stech, PRD62, 014006 (2000).
 //
 //              This is the derived class of the base class "EvtDecayAmp",
 //              but the decay amplitude will be calculated in the class
 //              "EvtbTosllAmpNew" (see file EvtbTosllAmpNew.hh).
 
 class EvtbTosllMS : public EvtDecayAmp {
   public:
     EvtbTosllMS(){};
     virtual ~EvtbTosllMS();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   private:
     EvtbTosllFFNew* m_msffmodel;
     EvtbTosllAmpNew* m_calcamp;
     EvtbTosllWilsCoeffNLO* m_wilscoeff;
 };
 
 #endif
diff --git a/EvtGenModels/EvtbTosllMSExt.hh b/EvtGenModels/EvtbTosllMSExt.hh
index bb3cd8f..f8648e0 100644
--- a/EvtGenModels/EvtbTosllMSExt.hh
+++ b/EvtGenModels/EvtbTosllMSExt.hh
@@ -1,57 +1,57 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBTOSLLMSEXT_HH
 #define EVTBTOSLLMSEXT_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 class EvtbTosllFFNew;    // my class with ff for rare semileptonic B-decays
 class EvtbTosllAmpNewExt;    // my class with amplitudes for rare semileptonic B-decays
 class EvtbTosllWilsCoeffNLO;    // my class with Wilson coefficients in NLO
 
 // Description: Implementation of the rare semileptonic B-decays according
 //              to the paper: D.Melikhov, B.Stech, PRD62, 014006 (2000)
 //              with the nonstandart models simuliakr..
 //
 //              This is the derived class of the base class "EvtDecayAmp",
 //              but the decay amplitude will be calculated in the class
 //              "EvtbTosllAmpNew" (see file EvtbTosllAmpNew.hh).
 
 class EvtbTosllMSExt : public EvtDecayAmp {
   public:
     EvtbTosllMSExt(){};
     virtual ~EvtbTosllMSExt();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   private:
     EvtbTosllFFNew* m_msffmodel;
     EvtbTosllAmpNewExt* m_calcamp;
     EvtbTosllWilsCoeffNLO* m_wilscoeff;
 };
 
 #endif
diff --git a/EvtGenModels/Evtbs2llGammaISRFSR.hh b/EvtGenModels/Evtbs2llGammaISRFSR.hh
index 1ddeba4..8afa11d 100644
--- a/EvtGenModels/Evtbs2llGammaISRFSR.hh
+++ b/EvtGenModels/Evtbs2llGammaISRFSR.hh
@@ -1,51 +1,51 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBS2LLGAMMAISRFSR_HH
 #define EVTBS2LLGAMMAISRFSR_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 class Evtbs2llGammaFF;    // my class with ff for rare semileptonic B-decays
 class Evtbs2llGammaISRFSRAmp;    // my class with amplitudes for rare radiative leptonic B-decays
 class EvtbTosllWilsCoeffNLO;    // my class with Wilson coefficients in NLO
 
 // Description: See the Internal LHCb Note LHCb-INT-2011-011.
 
 class Evtbs2llGammaISRFSR : public EvtDecayAmp {
   public:
     Evtbs2llGammaISRFSR() {}
     virtual ~Evtbs2llGammaISRFSR();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   private:
     Evtbs2llGammaFF* m_mntffmodel;
     Evtbs2llGammaISRFSRAmp* m_calcamp;
     EvtbTosllWilsCoeffNLO* m_wilscoeff;
 };
 
 #endif
diff --git a/EvtGenModels/Evtbs2llGammaMNT.hh b/EvtGenModels/Evtbs2llGammaMNT.hh
index d6eb117..3baacad 100644
--- a/EvtGenModels/Evtbs2llGammaMNT.hh
+++ b/EvtGenModels/Evtbs2llGammaMNT.hh
@@ -1,56 +1,56 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #ifndef EVTBS2LLGAMMAMNT_HH
 #define EVTBS2LLGAMMAMNT_HH
 
 #include "EvtGenBase/EvtDecayAmp.hh"
 
 class EvtParticle;
 class Evtbs2llGammaFF;    // my class with ff for rare semileptonic B-decays
 class Evtbs2llGammaAmp;    // my class with amplitudes for rare semileptonic B-decays
 class EvtbTosllWilsCoeffNLO;    // my class with Wilson coefficients in NLO
 
 // Description: the B -> Gamma ell^+ ell^- decay channel description
 //		based on the papers:
 //		D.Melikhov, N.Nikitin, K.Toms, Yad. Fiz. 62, No 11
 //              and
 //              I.Balakireva, D.Melikhov, N.Nikitin, D.Tlisov,
 //                                           e-Print: arXiv:0911.0605 [hep-ph].
 
 class Evtbs2llGammaMNT : public EvtDecayAmp {
   public:
     Evtbs2llGammaMNT() {}
     virtual ~Evtbs2llGammaMNT();
 
-    std::string getName() override;
-    EvtDecayBase* clone() override;
+    std::string getName() const override;
+    EvtDecayBase* clone() const override;
 
     void init() override;
     void initProbMax() override;
     void decay( EvtParticle* p ) override;
 
   private:
     Evtbs2llGammaFF* m_mntffmodel;
     Evtbs2llGammaAmp* m_calcamp;
     EvtbTosllWilsCoeffNLO* m_wilscoeff;
 };
 
 #endif
diff --git a/src/EvtGenBase/EvtDecayBase.cpp b/src/EvtGenBase/EvtDecayBase.cpp
index 9aedbd1..efd23f0 100644
--- a/src/EvtGenBase/EvtDecayBase.cpp
+++ b/src/EvtGenBase/EvtDecayBase.cpp
@@ -1,633 +1,633 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenBase/EvtDecayBase.hh"
 
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtStatus.hh"
 
 #include <ctype.h>
 #include <fstream>
 #include <iostream>
 #include <stdlib.h>
 #include <vector>
 using std::endl;
 using std::fstream;
 void EvtDecayBase::checkQ()
 {
     int i;
     int q = 0;
     int qpar;
 
     //If there are no daughters (jetset etc) then we do not
     //want to do this test.  Why?  Because sometimes the parent
     //will have a nonzero charge.
 
     if ( m_ndaug != 0 ) {
         for ( i = 0; i < m_ndaug; i++ ) {
             q += EvtPDL::chg3( m_daug[i] );
         }
         qpar = EvtPDL::chg3( m_parent );
 
         if ( q != qpar ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << m_modelname.c_str() << " generator expected "
                 << " charge to be conserved, found:" << endl;
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Parent charge of " << ( qpar / 3 ) << endl;
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Sum of daughter charge of " << ( q / 3 ) << endl;
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "The parent is " << EvtPDL::name( m_parent ).c_str() << endl;
             for ( i = 0; i < m_ndaug; i++ ) {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Daughter " << EvtPDL::name( m_daug[i] ).c_str() << endl;
             }
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Will terminate execution!" << endl;
 
             ::abort();
         }
     }
 }
 
 double EvtDecayBase::getProbMax( double prob )
 {
     int i;
 
     //diagnostics
     m_sum_prob += prob;
     if ( prob > m_max_prob )
         m_max_prob = prob;
 
     if ( m_defaultprobmax && m_ntimes_prob <= 500 ) {
         //We are building up m_probmax with this iteration
         m_ntimes_prob += 1;
         if ( prob > m_probmax ) {
             m_probmax = prob;
         }
         if ( m_ntimes_prob == 500 ) {
             m_probmax *= 1.2;
         }
         return 1000000.0 * prob;
     }
 
     if ( prob > m_probmax * 1.0001 ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "prob > probmax:(" << prob << ">" << m_probmax << ")";
         EvtGenReport( EVTGEN_INFO, "" ) << "(" << m_modelname.c_str() << ") ";
         EvtGenReport( EVTGEN_INFO, "" )
             << EvtPDL::name( m_parent ).c_str() << " -> ";
         for ( i = 0; i < m_ndaug; i++ ) {
             EvtGenReport( EVTGEN_INFO, "" )
                 << EvtPDL::name( m_daug[i] ).c_str() << " ";
         }
         EvtGenReport( EVTGEN_INFO, "" ) << endl;
 
         if ( m_defaultprobmax )
             m_probmax = prob;
     }
 
     m_ntimes_prob += 1;
 
     return m_probmax;
 
 }    //getProbMax
 
 double EvtDecayBase::resetProbMax( double prob )
 {
     EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Reseting prob max\n";
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "prob > probmax:(" << prob << ">" << m_probmax << ")";
     EvtGenReport( EVTGEN_INFO, "" ) << "(" << m_modelname.c_str() << ")";
     EvtGenReport( EVTGEN_INFO, "" ) << EvtPDL::getStdHep( m_parent ) << "->";
 
     for ( int i = 0; i < m_ndaug; i++ ) {
         EvtGenReport( EVTGEN_INFO, "" ) << EvtPDL::getStdHep( m_daug[i] ) << " ";
     }
     EvtGenReport( EVTGEN_INFO, "" ) << endl;
 
     m_probmax = 0.0;
     m_defaultprobmax = false;
     m_ntimes_prob = 0;
 
     return prob;
 }
 
 std::string EvtDecayBase::commandName()
 {
     return std::string( "" );
 }
 
 void EvtDecayBase::command( std::string )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Should never call EvtDecayBase::command" << endl;
     ::abort();
 }
 
 std::string EvtDecayBase::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "param00";
         case 1:
             return "param01";
         case 2:
             return "param02";
         case 3:
             return "param03";
         case 4:
             return "param04";
         case 5:
             return "param05";
         case 6:
             return "param06";
         case 7:
             return "param07";
         case 8:
             return "param08";
         case 9:
             return "param09";
         default:
             return "";
     }
 }
 
 std::string EvtDecayBase::getParamDefault( int /*i*/ )
 {
     return "";
 }
 
 void EvtDecayBase::init()
 {
     //This default version of init does nothing;
     //A specialized version of this function can be
     //supplied for each decay model to do initialization.
 
     return;
 }
 
 void EvtDecayBase::initProbMax()
 {
     //This function is called if the decay does not have a
     //specialized initialization.
     //The default is to set the maximum
     //probability to 0 and the number of times called to 0
     //and m_defaultprobmax to 'true' such that the decay will be
     //generated many many times
     //in order to generate a reasonable maximum probability
     //for the decay.
 
     m_defaultprobmax = true;
     m_ntimes_prob = 0;
     m_probmax = 0.0;
 
 }    //initProbMax
 
 void EvtDecayBase::saveDecayInfo( EvtId ipar, int ndaug, const EvtId* daug,
                                   int narg, std::vector<std::string>& args,
                                   std::string name, double brfr )
 {
     int i;
 
     m_brfr = brfr;
     m_ndaug = ndaug;
     m_narg = narg;
     m_parent = ipar;
 
     m_dsum = 0;
 
     if ( m_ndaug > 0 ) {
         m_daug.resize( m_ndaug );
         for ( i = 0; i < m_ndaug; i++ ) {
             m_daug[i] = daug[i];
             m_dsum += daug[i].getAlias();
         }
     } else {
         m_daug.clear();
     }
 
     if ( m_narg > 0 ) {
         m_args.resize( m_narg + 1 );
         for ( i = 0; i < m_narg; i++ ) {
             m_args[i] = args[i];
         }
     } else {
         m_args.clear();
     }
 
     m_modelname = name;
 
     this->init();
     this->initProbMax();
 
     if ( m_chkCharge ) {
         this->checkQ();
     }
 
     if ( m_defaultprobmax ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "No default probmax for ";
         EvtGenReport( EVTGEN_INFO, "" ) << "(" << m_modelname.c_str() << ") ";
         EvtGenReport( EVTGEN_INFO, "" )
             << EvtPDL::name( m_parent ).c_str() << " -> ";
         for ( i = 0; i < m_ndaug; i++ ) {
             EvtGenReport( EVTGEN_INFO, "" )
                 << EvtPDL::name( m_daug[i] ).c_str() << " ";
         }
         EvtGenReport( EVTGEN_INFO, "" ) << endl;
         EvtGenReport( EVTGEN_INFO, "" )
             << "This is fine for development, but must be provided for production."
             << endl;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Never fear though - the decay will use the \n";
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "500 iterations to build up a good probmax \n";
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "before accepting a decay. " << endl;
     }
 }
 
 void EvtDecayBase::printSummary() const
 {
     if ( m_ntimes_prob > 0 ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Calls = " << m_ntimes_prob
             << " eff: " << m_sum_prob / ( m_probmax * m_ntimes_prob )
             << " frac. max:" << m_max_prob / m_probmax;
         EvtGenReport( EVTGEN_INFO, "" )
             << " probmax:" << m_probmax << " max:" << m_max_prob << " : ";
     }
 
     printInfo();
 }
 
 void EvtDecayBase::printInfo() const
 {
     EvtGenReport( EVTGEN_INFO, "" ) << EvtPDL::name( m_parent ).c_str() << " -> ";
     for ( int i = 0; i < m_ndaug; i++ ) {
         EvtGenReport( EVTGEN_INFO, "" )
             << EvtPDL::name( m_daug[i] ).c_str() << " ";
     }
     EvtGenReport( EVTGEN_INFO, "" ) << " (" << m_modelname.c_str() << ")" << endl;
 }
 
 void EvtDecayBase::setProbMax( double prbmx )
 {
     m_defaultprobmax = false;
     m_probmax = prbmx;
 }
 
 void EvtDecayBase::noProbMax()
 {
     m_defaultprobmax = false;
 }
 
 double EvtDecayBase::findMaxMass( EvtParticle* p )
 {
     double maxOkMass = EvtPDL::getMaxMass( p->getId() );
 
     //protect against vphotons
     if ( maxOkMass < 0.0000000001 )
         return 10000000.;
     //and against already determined masses
     if ( p->hasValidP4() )
         maxOkMass = p->mass();
 
     EvtParticle* par = p->getParent();
     if ( par ) {
         double maxParMass = findMaxMass( par );
         size_t i;
         double minDaugMass = 0.;
         for ( i = 0; i < par->getNDaug(); i++ ) {
             EvtParticle* dau = par->getDaug( i );
             if ( dau != p ) {
                 // it might already have a mass
                 if ( dau->isInitialized() || dau->hasValidP4() )
                     minDaugMass += dau->mass();
                 else
                     //give it a bit of phase space
                     minDaugMass += 1.000001 * EvtPDL::getMinMass( dau->getId() );
             }
         }
         if ( maxOkMass > ( maxParMass - minDaugMass ) )
             maxOkMass = maxParMass - minDaugMass;
     }
     return maxOkMass;
 }
 
 // given list of daughters ( by number ) returns a
 // list of viable masses.
 
 void EvtDecayBase::findMass( EvtParticle* p )
 {
     //Need to also check that this mass does not screw
     //up the parent
     //This code assumes that for the ith daughter, 0..i-1
     //already have a mass
     double maxOkMass = findMaxMass( p );
 
     int count = 0;
     double mass;
     bool massOk = false;
     size_t i;
     while ( !massOk ) {
         count++;
         if ( count > 10000 ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" )
                 << "Can not find a valid mass for: "
                 << EvtPDL::name( p->getId() ).c_str() << endl;
             EvtGenReport( EVTGEN_INFO, "EvtGen" )
                 << "Now printing parent and/or grandparent tree\n";
             if ( p->getParent() ) {
                 if ( p->getParent()->getParent() ) {
                     p->getParent()->getParent()->printTree();
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << p->getParent()->getParent()->mass() << endl;
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << p->getParent()->mass() << endl;
                 } else {
                     p->getParent()->printTree();
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << p->getParent()->mass() << endl;
                 }
             } else
                 p->printTree();
             EvtGenReport( EVTGEN_INFO, "EvtGen" )
                 << "maxokmass=" << maxOkMass << " "
                 << EvtPDL::getMinMass( p->getId() ) << " "
                 << EvtPDL::getMaxMass( p->getId() ) << endl;
             if ( p->getNDaug() ) {
                 for ( i = 0; i < p->getNDaug(); i++ ) {
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << p->getDaug( i )->mass() << " ";
                 }
                 EvtGenReport( EVTGEN_INFO, "EvtGen" ) << endl;
             }
             if ( maxOkMass >= EvtPDL::getMinMass( p->getId() ) ) {
                 EvtGenReport( EVTGEN_INFO, "EvtGen" )
                     << "taking a default value\n";
                 p->setMass( maxOkMass );
                 return;
             }
             assert( 0 );
         }
         mass = EvtPDL::getMass( p->getId() );
         //Just need to check that this mass is > than
         //the mass of all daughters
         double massSum = 0.;
         if ( p->getNDaug() ) {
             for ( i = 0; i < p->getNDaug(); i++ ) {
                 massSum += p->getDaug( i )->mass();
             }
         }
         //some special cases are handled with 0 (stable) or 1 (k0->ks/kl) daughters
         if ( p->getNDaug() < 2 )
             massOk = true;
         if ( p->getParent() ) {
             if ( p->getParent()->getNDaug() == 1 )
                 massOk = true;
         }
         if ( !massOk ) {
             if ( massSum < mass )
                 massOk = true;
             if ( mass > maxOkMass )
                 massOk = false;
         }
     }
 
     p->setMass( mass );
 }
 
-void EvtDecayBase::findMasses( EvtParticle* p, int ndaugs, EvtId daugs[10],
-                               double masses[10] )
+void EvtDecayBase::findMasses( EvtParticle* p, int ndaugs,
+                               const EvtId daugs[10], double masses[10] )
 {
     int i;
     double mass_sum;
 
     int count = 0;
 
     if ( !( p->firstornot() ) ) {
         for ( i = 0; i < ndaugs; i++ ) {
             masses[i] = p->getDaug( i )->mass();
         }    //for
     }        //if
     else {
         p->setFirstOrNot();
         // if only one daughter do it
 
         if ( ndaugs == 1 ) {
             masses[0] = p->mass();
             return;
         }
 
         //until we get a combo whose masses are less than the parent mass.
         do {
             mass_sum = 0.0;
 
             for ( i = 0; i < ndaugs; i++ ) {
                 masses[i] = EvtPDL::getMass( daugs[i] );
                 mass_sum = mass_sum + masses[i];
             }
 
             count++;
 
             if ( count == 10000 ) {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Decaying particle:" << EvtPDL::name( p->getId() ).c_str()
                     << " (m=" << p->mass() << ")" << endl;
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "To the following daugthers" << endl;
                 for ( i = 0; i < ndaugs; i++ ) {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << EvtPDL::name( daugs[i] ).c_str() << endl;
                 }
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Has been rejected " << count
                     << " times, will now take minimal masses "
                     << " of daugthers" << endl;
 
                 mass_sum = 0.;
                 for ( i = 0; i < ndaugs; i++ ) {
                     masses[i] = EvtPDL::getMinMass( daugs[i] );
                     mass_sum = mass_sum + masses[i];
                 }
                 if ( mass_sum > p->mass() ) {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Parent mass=" << p->mass()
                         << "to light for daugthers." << endl
                         << "Will throw the event away." << endl;
                     //dont terminate - start over on the event.
                     EvtStatus::setRejectFlag();
                     mass_sum = 0.;
                     //	  ::abort();
                 }
             }
         } while ( mass_sum > p->mass() );
     }    //else
 
     return;
 }
 
 void EvtDecayBase::checkNArg( int a1, int a2, int a3, int a4 )
 {
     if ( m_narg != a1 && m_narg != a2 && m_narg != a3 && m_narg != a4 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << m_modelname.c_str() << " generator expected " << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << a1 << endl;
         ;
         if ( a2 > -1 ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << " or " << a2 << endl;
         }
         if ( a3 > -1 ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << " or " << a3 << endl;
         }
         if ( a4 > -1 ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << " or " << a4 << endl;
         }
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " arguments but found:" << m_narg << endl;
         printSummary();
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 void EvtDecayBase::checkNDaug( int d1, int d2 )
 {
     if ( m_ndaug != d1 && m_ndaug != d2 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << m_modelname.c_str() << " generator expected ";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << d1;
         if ( d2 > -1 ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << " or " << d2;
         }
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " daughters but found:" << m_ndaug << endl;
         printSummary();
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 void EvtDecayBase::checkSpinParent( EvtSpinType::spintype sp )
 {
     EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
     if ( parenttype != sp ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << m_modelname.c_str() << " did not get the correct parent spin\n";
         printSummary();
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 void EvtDecayBase::checkSpinDaughter( int d1, EvtSpinType::spintype sp )
 {
     EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getDaug( d1 ) );
     if ( parenttype != sp ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << m_modelname.c_str()
             << " did not get the correct daughter spin d=" << d1 << endl;
         printSummary();
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 double* EvtDecayBase::getArgs()
 {
     if ( !m_argsD.empty() )
         return m_argsD.data();
     //The user has asked for a list of doubles - the arguments
     //better all be doubles...
     if ( m_narg == 0 )
         return m_argsD.data();
 
     m_argsD.resize( m_narg );
     for ( int i = 0; i < m_narg; i++ ) {
         char* tc;
         m_argsD[i] = strtod( m_args[i].c_str(), &tc );
     }
     return m_argsD.data();
 }
 
 double EvtDecayBase::getArg( unsigned int j )
 {
     // Verify string
     const char* str = m_args[j].c_str();
     int i = 0;
     while ( str[i] != 0 ) {
         if ( isalpha( str[i] ) && str[i] != 'e' ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" )
                 << "String " << str << " is not a number" << endl;
             assert( 0 );
         }
         i++;
     }
 
     char** tc = nullptr;
     double result = strtod( m_args[j].c_str(), tc );
 
     if ( m_storedArgs.size() < j + 1 ) {    // then store the argument's value
         m_storedArgs.push_back( result );
     }
 
     return result;
 }
 
 bool EvtDecayBase::matchingDecay( const EvtDecayBase& other ) const
 {
     if ( m_ndaug != other.m_ndaug )
         return false;
     if ( m_parent != other.m_parent )
         return false;
 
     std::vector<int> useDs;
     for ( int i = 0; i < m_ndaug; i++ )
         useDs.push_back( 0 );
 
     for ( int i = 0; i < m_ndaug; i++ ) {
         bool foundIt = false;
         for ( int j = 0; j < m_ndaug; j++ ) {
             if ( useDs[j] == 1 )
                 continue;
             if ( m_daug[i] == other.m_daug[j] &&
                  m_daug[i].getAlias() == other.m_daug[j].getAlias() ) {
                 foundIt = true;
                 useDs[j] = 1;
                 break;
             }
         }
         if ( foundIt == false )
             return false;
     }
     for ( int i = 0; i < m_ndaug; i++ )
         if ( useDs[i] == 0 )
             return false;
 
     return true;
 }
diff --git a/src/EvtGenModels/EvtBBScalar.cpp b/src/EvtGenModels/EvtBBScalar.cpp
index a5d95d2..bd32526 100644
--- a/src/EvtGenModels/EvtBBScalar.cpp
+++ b/src/EvtGenModels/EvtBBScalar.cpp
@@ -1,502 +1,502 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBBScalar.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGammaMatrix.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 
 #include <cmath>
 
 using namespace std;
 
 const float pi = 3.14159;
 const EvtComplex EvtBBScalar::m_I = EvtComplex( 0, 1 );
 const EvtComplex EvtBBScalar::m_V_ub =
     EvtComplex( 3.67e-3 * cos( 60 / 180 * pi ), 3.67e-3 * cos( 60 / 180 * pi ) );
 const EvtComplex EvtBBScalar::m_V_us_star = EvtComplex( 0.22, 0 );
 const EvtComplex EvtBBScalar::m_a1 = EvtComplex( 1.05, 0 );
 const EvtComplex EvtBBScalar::m_V_tb = EvtComplex( 0.99915, 0 );
 const EvtComplex EvtBBScalar::m_V_ts_star =
     EvtComplex( -0.04029 - 0.000813 * cos( 60 / 180 * pi ),
                 -0.000813 * cos( 60 / 180 * pi ) );
 const EvtComplex EvtBBScalar::m_a4 = EvtComplex( -387.3e-4, -121e-4 );
 const EvtComplex EvtBBScalar::m_a6 = EvtComplex( -555.3e-4, -121e-4 );
 const double EvtBBScalar::m_x[] = { 420.96, -10485.50, 100639.97, -433916.61,
                                     613780.15 };
 const double EvtBBScalar::m_y[] = { 292.62, -735.73 };
 const double EvtBBScalar::m_ms = 0.120;
 const double EvtBBScalar::m_mu = 0.029 * 0.120;
 const double EvtBBScalar::m_mb = 4.88;
 
 EvtBBScalar::EvtBBScalar() :
     EvtDecayAmp(), m_massRatio( 0 ), m_baryonMassSum( 0 )
 {
     FormFactor dummy;
     dummy.m_value = 0.36;
     dummy.m_sigma1 = 0.43;
     dummy.m_sigma2 = 0.0;
     dummy.m_mV = 5.42;
     m_f1Map.insert( make_pair( string( "K" ), dummy ) );
     dummy.m_sigma1 = 0.70;
     dummy.m_sigma2 = 0.27;
     m_f0Map.insert( make_pair( string( "K" ), dummy ) );
     dummy.m_value = 0.29;
     dummy.m_sigma1 = 0.48;
     dummy.m_sigma2 = 0.0;
     dummy.m_mV = 5.32;
     m_f1Map.insert( make_pair( string( "pi" ), dummy ) );
     dummy.m_sigma1 = 0.76;
     dummy.m_sigma2 = 0.28;
     m_f0Map.insert( make_pair( string( "pi" ), dummy ) );
 }
 
-std::string EvtBBScalar::getName()
+std::string EvtBBScalar::getName() const
 {
     return "B_TO_2BARYON_SCALAR";
 }
 
-EvtBBScalar* EvtBBScalar::clone()
+EvtBBScalar* EvtBBScalar::clone() const
 {
     return new EvtBBScalar;
 }
 
 void EvtBBScalar::setKnownBaryonTypes( const EvtId& baryon )
 {
     int baryonId = EvtPDL::getStdHep( baryon );
     if ( EvtPDL::getStdHep( EvtPDL::getId( "Lambda0" ) ) == baryonId or
          EvtPDL::getStdHep( EvtPDL::getId( "anti-Lambda0" ) ) == baryonId ) {
         m_baryonCombination.set( Lambda );
     } else if ( EvtPDL::getStdHep( EvtPDL::getId( "p+" ) ) == baryonId or
                 EvtPDL::getStdHep( EvtPDL::getId( "anti-p-" ) ) == baryonId ) {
         m_baryonCombination.set( Proton );
     } else if ( EvtPDL::getStdHep( EvtPDL::getId( "n0" ) ) == baryonId or
                 EvtPDL::getStdHep( EvtPDL::getId( "anti-n0" ) ) == baryonId ) {
         m_baryonCombination.set( Neutron );
     } else if ( EvtPDL::getStdHep( EvtPDL::getId( "Sigma0" ) ) == baryonId or
                 EvtPDL::getStdHep( EvtPDL::getId( "anti-Sigma0" ) ) == baryonId ) {
         m_baryonCombination.set( Sigma0 );
     } else if ( EvtPDL::getStdHep( EvtPDL::getId( "Sigma-" ) ) == baryonId or
                 EvtPDL::getStdHep( EvtPDL::getId( "anti-Sigma+" ) ) == baryonId ) {
         m_baryonCombination.set( Sigma_minus );
     } else if ( EvtPDL::getStdHep( EvtPDL::getId( "Xi0" ) ) == baryonId or
                 EvtPDL::getStdHep( EvtPDL::getId( "anti-Xi0" ) ) == baryonId ) {
         m_baryonCombination.set( Xi0 );
     } else if ( EvtPDL::getStdHep( EvtPDL::getId( "Xi-" ) ) == baryonId or
                 EvtPDL::getStdHep( EvtPDL::getId( "anti-Xi+" ) ) == baryonId ) {
         m_baryonCombination.set( Xi_minus );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBBScalar::init: Don't know what to do with this type as the first or second baryon\n";
         exit( 2 );
     }
 }
 
 double EvtBBScalar::baryonF1F2( double t ) const
 {
     // check for known form factors for combination of baryons
     if ( m_baryonCombination.test( Lambda ) and
          m_baryonCombination.test( Proton ) ) {
         return -sqrt( 1.5 ) * G_p( t );
     } else if ( m_baryonCombination.test( Sigma0 ) and
                 m_baryonCombination.test( Proton ) ) {
         return -sqrt( 0.5 ) * ( G_p( t ) + 2 * G_n( t ) );
     } else if ( m_baryonCombination.test( Sigma_minus ) and
                 m_baryonCombination.test( Neutron ) ) {
         return -G_p( t ) - 2 * G_n( t );
     } else if ( m_baryonCombination.test( Xi0 ) and
                 m_baryonCombination.test( Sigma_minus ) ) {
         return G_p( t ) - G_n( t );
     } else if ( m_baryonCombination.test( Xi_minus ) and
                 m_baryonCombination.test( Sigma0 ) ) {
         return sqrt( 0.5 ) * ( G_p( t ) - G_n( t ) );
     } else if ( m_baryonCombination.test( Xi_minus ) and
                 m_baryonCombination.test( Lambda ) ) {
         return sqrt( 1.5 ) * ( G_p( t ) + G_n( t ) );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBBScalar::baryonF1F2: Don't know what to do with this type as the first or second baryon\n";
         exit( 2 );
     }
 }
 
 double EvtBBScalar::formFactorFit( double t, const vector<double>& params ) const
 {
     static const double gamma = 2.148;
     static const double Lambda_0 = 0.3;
     double result = 0;
     for ( size_t i = 0; i < params.size(); ++i ) {
         result += params[i] / pow( t, static_cast<int>( i + 1 ) );
     }
     return result * pow( log( t / pow( Lambda_0, 2 ) ), -gamma );
 }
 
 double EvtBBScalar::G_p( double t ) const
 {
     const vector<double> v_x( m_x, m_x + 5 );
     return formFactorFit( t, v_x );
 }
 
 double EvtBBScalar::G_n( double t ) const
 {
     const vector<double> v_y( m_y, m_y + 2 );
     return -formFactorFit( t, v_y );
 }
 
 double EvtBBScalar::baryon_gA( double t ) const
 {
     // check for known form factors for combination of baryons
     if ( m_baryonCombination.test( Lambda ) and
          m_baryonCombination.test( Proton ) ) {
         return -1 / sqrt( 6. ) * ( D_A( t ) + 3 * F_A( t ) );
     } else if ( m_baryonCombination.test( Sigma0 ) and
                 m_baryonCombination.test( Proton ) ) {
         return 1 / sqrt( 2. ) * ( D_A( t ) - F_A( t ) );
     } else if ( m_baryonCombination.test( Sigma_minus ) and
                 m_baryonCombination.test( Neutron ) ) {
         return D_A( t ) - F_A( t );
     } else if ( m_baryonCombination.test( Xi0 ) and
                 m_baryonCombination.test( Sigma_minus ) ) {
         return D_A( t ) + F_A( t );
     } else if ( m_baryonCombination.test( Xi_minus ) and
                 m_baryonCombination.test( Sigma0 ) ) {
         return 1 / sqrt( 2. ) * ( D_A( t ) + F_A( t ) );
     } else if ( m_baryonCombination.test( Xi_minus ) and
                 m_baryonCombination.test( Lambda ) ) {
         return -1 / sqrt( 6. ) * ( D_A( t ) - 3 * F_A( t ) );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBBScalar::baryon_gA: Don't know what to do with this type as the first or second baryon\n";
         exit( 2 );
     }
 }
 
 double EvtBBScalar::baryon_gP( double t ) const
 {
     // check for known form factors for combination of baryons
     if ( m_baryonCombination.test( Lambda ) and
          m_baryonCombination.test( Proton ) ) {
         return -1 / sqrt( 6. ) * ( D_P( t ) + 3 * F_P( t ) );
     } else if ( m_baryonCombination.test( Sigma0 ) and
                 m_baryonCombination.test( Proton ) ) {
         return 1 / sqrt( 2. ) * ( D_P( t ) - F_P( t ) );
     } else if ( m_baryonCombination.test( Sigma_minus ) and
                 m_baryonCombination.test( Neutron ) ) {
         return D_P( t ) - F_P( t );
     } else if ( m_baryonCombination.test( Xi0 ) and
                 m_baryonCombination.test( Sigma_minus ) ) {
         return D_P( t ) + F_P( t );
     } else if ( m_baryonCombination.test( Xi_minus ) and
                 m_baryonCombination.test( Sigma0 ) ) {
         return 1 / sqrt( 2. ) * ( D_P( t ) + F_P( t ) );
     } else if ( m_baryonCombination.test( Xi_minus ) and
                 m_baryonCombination.test( Lambda ) ) {
         return -1 / sqrt( 6. ) * ( D_P( t ) - 3 * F_P( t ) );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBBScalar::baryon_gP: Don't know what to do with this type as the first or second baryon\n";
         exit( 2 );
     }
 }
 
 double EvtBBScalar::baryon_fS( double t ) const
 {
     // check for known form factors for combination of baryons
     if ( m_baryonCombination.test( Lambda ) and
          m_baryonCombination.test( Proton ) ) {
         return -1 / sqrt( 6. ) * ( D_S( t ) + 3 * F_S( t ) );
     } else if ( m_baryonCombination.test( Sigma0 ) and
                 m_baryonCombination.test( Proton ) ) {
         return 1 / sqrt( 2. ) * ( D_S( t ) - F_S( t ) );
     } else if ( m_baryonCombination.test( Sigma_minus ) and
                 m_baryonCombination.test( Neutron ) ) {
         return D_S( t ) - F_S( t );
     } else if ( m_baryonCombination.test( Xi0 ) and
                 m_baryonCombination.test( Sigma_minus ) ) {
         return D_S( t ) + F_S( t );
     } else if ( m_baryonCombination.test( Xi_minus ) and
                 m_baryonCombination.test( Sigma0 ) ) {
         return 1 / sqrt( 2. ) * ( D_S( t ) + F_S( t ) );
     } else if ( m_baryonCombination.test( Xi_minus ) and
                 m_baryonCombination.test( Lambda ) ) {
         return -1 / sqrt( 6. ) * ( D_S( t ) - 3 * F_S( t ) );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBBScalar::baryon_fS: Don't know what to do with this type as the first or second baryon\n";
         exit( 2 );
     }
 }
 
 double EvtBBScalar::D_A( double t ) const
 {
     const double d_tilde[] = { m_x[0] - 1.5 * m_y[0], -478 };
     const vector<double> v_d_tilde( d_tilde, d_tilde + 2 );
     return formFactorFit( t, v_d_tilde );
 }
 
 double EvtBBScalar::F_A( double t ) const
 {
     const double f_tilde[] = { 2. / 3 * m_x[0] + 0.5 * m_y[0], -478 };
     const vector<double> v_f_tilde( f_tilde, f_tilde + 2 );
     return formFactorFit( t, v_f_tilde );
 }
 
 double EvtBBScalar::D_P( double t ) const
 {
     const double d_bar[] = { 1.5 * m_y[0] * m_massRatio, /*-952*/ 0 };
     const vector<double> v_d_bar( d_bar, d_bar + 2 );
     return formFactorFit( t, v_d_bar );
 }
 
 double EvtBBScalar::F_P( double t ) const
 {
     const double f_bar[] = { ( m_x[0] - 0.5 * m_y[0] ) * m_massRatio, /*-952*/ 0 };
     const vector<double> v_f_bar( f_bar, f_bar + 2 );
     return formFactorFit( t, v_f_bar );
 }
 
 double EvtBBScalar::D_S( double t ) const
 {
     return -1.5 * m_massRatio * G_n( t );
 }
 
 double EvtBBScalar::F_S( double t ) const
 {
     return ( G_p( t ) + 0.5 * G_n( t ) ) * m_massRatio;
 }
 
 double EvtBBScalar::baryon_hA( double t ) const
 {
     return ( 1 / m_massRatio * baryon_gP( t ) - baryon_gA( t ) ) *
            pow( m_baryonMassSum, 2 ) / t;
 }
 
 void EvtBBScalar::init()
 {
     // no arguments, daughter lambda p_bar pi
     // charge conservation is checked by base class
     checkNArg( 0 );
     checkNDaug( 3 );
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
     EvtId baryon1 = getDaug( 0 );
     EvtId baryon2 = getDaug( 1 );
     EvtId scalar = getDaug( 2 );
     int scalarId = EvtPDL::getStdHep( scalar );
 
     // Different form factors for the B-pi or B-K transition.
     if ( scalarId == EvtPDL::getStdHep( EvtPDL::getId( "pi+" ) ) or
          scalarId == EvtPDL::getStdHep( EvtPDL::getId( "pi-" ) ) or
          scalarId == EvtPDL::getStdHep( EvtPDL::getId( "pi0" ) ) ) {
         m_scalarType = "pi";
     } else if ( scalarId == EvtPDL::getStdHep( EvtPDL::getId( "K+" ) ) or
                 scalarId == EvtPDL::getStdHep( EvtPDL::getId( "K-" ) ) or
                 scalarId == EvtPDL::getStdHep( EvtPDL::getId( "K0" ) ) or
                 scalarId == EvtPDL::getStdHep( EvtPDL::getId( "anti-K0" ) ) ) {
         m_scalarType = "K";
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBBScalar::init: Can only deal with Kaons or pions as the third particle\n"
             << "\tFound: " << scalarId << endl;
         exit( 2 );
     }
     // check for known particles
     setKnownBaryonTypes( baryon1 );
     setKnownBaryonTypes( baryon2 );
     double mass1 = EvtPDL::getMass( baryon1 );
     double mass2 = EvtPDL::getMass( baryon2 );
     // This whole model deals only with baryons that differ in s-u
     if ( mass1 > mass2 )
         m_massRatio = ( mass1 - mass2 ) / ( m_ms - m_mu );
     else
         m_massRatio = ( mass2 - mass1 ) / ( m_ms - m_mu );
     m_baryonMassSum = mass1 + mass2;
 }
 
 // initialize phasespace and calculate the amplitude
 void EvtBBScalar::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtVector4R B_Momentum = p->getP4Lab();
     EvtDiracParticle* theLambda = dynamic_cast<EvtDiracParticle*>(
         p->getDaug( 0 ) );
     EvtDiracParticle* theAntiP = dynamic_cast<EvtDiracParticle*>(
         p->getDaug( 1 ) );
     EvtScalarParticle* theScalar = dynamic_cast<EvtScalarParticle*>(
         p->getDaug( 2 ) );
     EvtVector4R scalarMomentum = theScalar->getP4Lab();
 
     // The amplitude consists of three matrix elements. These will be calculated one by one here.
 
     // loop over all possible spin states
     for ( int i = 0; i < 2; ++i ) {
         EvtDiracSpinor lambdaPol = theLambda->spParent( i );
         for ( int j = 0; j < 2; ++j ) {
             EvtDiracSpinor antiP_Pol = theAntiP->spParent( j );
             EvtVector4C theAmplitudePartA = amp_A( B_Momentum, scalarMomentum );
             EvtComplex amplitude;
             for ( int index = 0; index < 4; ++index ) {
                 amplitude += theAmplitudePartA.get( index ) *
                              ( m_const_B * amp_B( theLambda, lambdaPol,
                                                   theAntiP, antiP_Pol, index ) +
                                m_const_C * amp_C( theLambda, lambdaPol,
                                                   theAntiP, antiP_Pol, index ) );
             }
             vertex( i, j, amplitude );
         }
     }
 }
 
 void EvtBBScalar::initProbMax()
 {
     // setProbMax(1);
     setProbMax( 0.2 );    // found by trial and error
 }
 
 // Form factor f1 for B-pi transition
 double EvtBBScalar::B_pi_f1( double t ) const
 {
     FormFactor f = m_f1Map[m_scalarType];
     double mv2 = f.m_mV * f.m_mV;
     return f.m_value / ( ( 1 - t / mv2 ) * ( 1 - f.m_sigma1 * t / mv2 +
                                              f.m_sigma2 * t * t / mv2 / mv2 ) );
 }
 
 // Form factor f0 for B-pi transition
 double EvtBBScalar::B_pi_f0( double t ) const
 {
     FormFactor f = m_f0Map[m_scalarType];
     double mv2 = f.m_mV * f.m_mV;
     return f.m_value /
            ( 1 - f.m_sigma1 * t / mv2 + f.m_sigma2 * t * t / mv2 / mv2 );
 }
 
 // constants of the B and C parts of the amplitude
 const EvtComplex EvtBBScalar::m_const_B = m_V_ub * m_V_us_star * m_a1 -
                                           m_V_tb * m_V_ts_star * m_a4;
 const EvtComplex EvtBBScalar::m_const_C = 2 * m_a6 * m_V_tb * m_V_ts_star;
 
 // part A of the amplitude, see hep-ph/0204185
 const EvtVector4C EvtBBScalar::amp_A( const EvtVector4R& p4B,
                                       const EvtVector4R& p4Scalar )
 {
     double mB2 = p4B.mass2();
     double mScalar2 = p4Scalar.mass2();
     double t = ( p4B - p4Scalar ).mass2();
     return ( ( p4B + p4Scalar ) - ( mB2 - mScalar2 ) / t * ( p4B - p4Scalar ) ) *
                B_pi_f1( t ) +
            ( mB2 - mScalar2 ) / t * ( p4B - p4Scalar ) * B_pi_f0( t );
 }
 
 // part B of the amplitude, Vector and Axial Vector parts
 const EvtComplex EvtBBScalar::amp_B( const EvtDiracParticle* baryon1,
                                      const EvtDiracSpinor& b1Pol,
                                      const EvtDiracParticle* baryon2,
                                      const EvtDiracSpinor& b2Pol, int index )
 {
     return amp_B_vectorPart( baryon1, b1Pol, baryon2, b2Pol, index ) -
            amp_B_axialPart( baryon1, b1Pol, baryon2, b2Pol, index );
 }
 
 const EvtComplex EvtBBScalar::amp_B_vectorPart( const EvtDiracParticle* baryon1,
                                                 const EvtDiracSpinor& b1Pol,
                                                 const EvtDiracParticle* baryon2,
                                                 const EvtDiracSpinor& b2Pol,
                                                 int index )
 {
     double t = ( baryon1->getP4Lab() + baryon2->getP4Lab() ).mass2();
     EvtGammaMatrix gamma;
     for ( int i = 0; i < 4; ++i ) {
         gamma += EvtTensor4C::g().get( index, i ) * EvtGammaMatrix::g( i );
     }
     // The F2 contribution that is written out in the paper is neglected here.
     // see hep-ph/0204185
     EvtDiracSpinor A = EvtComplex( baryonF1F2( t ) ) * b2Pol;
     EvtDiracSpinor Adjb1Pol = b1Pol.adjoint();
     EvtDiracSpinor gammaA = gamma * A;
     return Adjb1Pol * gammaA;
     //    return b1Pol.adjoint()*(gamma*(EvtComplex(baryonF1F2(t))*b2Pol));
 }
 
 const EvtComplex EvtBBScalar::amp_B_axialPart( const EvtDiracParticle* baryon1,
                                                const EvtDiracSpinor& b1Pol,
                                                const EvtDiracParticle* baryon2,
                                                const EvtDiracSpinor& b2Pol,
                                                int index )
 {
     EvtGammaMatrix gamma;
     for ( int i = 0; i < 4; ++i ) {
         gamma += EvtTensor4C::g().get( index, i ) * EvtGammaMatrix::g( i );
     }
     double t = ( baryon1->getP4Lab() + baryon2->getP4Lab() ).mass2();
     double mSum = baryon1->mass() + baryon2->mass();
     EvtVector4C momentum_upper = ( baryon1->getP4Lab() + baryon2->getP4Lab() );
     EvtVector4C momentum;
     for ( int mu = 0; mu < 0; ++mu ) {
         EvtComplex dummy;
         for ( int i = 0; i < 4; ++i ) {
             dummy += EvtTensor4C::g().get( index, i ) * momentum_upper.get( i );
         }
         momentum.set( mu, dummy );
     }
     return b1Pol.adjoint() *
            ( ( ( baryon_gA( t ) * gamma + EvtGammaMatrix::id() * baryon_hA( t ) /
                                               mSum * momentum.get( index ) ) *
                EvtGammaMatrix::g5() ) *
              b2Pol );
 }
 
 // part C of the amplitude, Scalar and Pseudoscalar parts
 const EvtComplex EvtBBScalar::amp_C( const EvtDiracParticle* baryon1,
                                      const EvtDiracSpinor& b1Pol,
                                      const EvtDiracParticle* baryon2,
                                      const EvtDiracSpinor& b2Pol, int index )
 {
     EvtVector4C baryonSumP4_upper = baryon1->getP4Lab() + baryon2->getP4Lab();
     EvtVector4C baryonSumP4;
     for ( int mu = 0; mu < 4; ++mu ) {
         EvtComplex dummy;
         for ( int i = 0; i < 4; ++i ) {
             dummy += EvtTensor4C::g().get( mu, i ) * baryonSumP4_upper.get( i );
         }
         baryonSumP4.set( mu, dummy );
     }
     double t = ( baryon1->getP4Lab() + baryon2->getP4Lab() ).mass2();
     return baryonSumP4.get( index ) / ( m_mb - m_mu ) *
            ( amp_C_scalarPart( b1Pol, b2Pol, t ) +
              amp_C_pseudoscalarPart( b1Pol, b2Pol, t ) );
 }
 
 const EvtComplex EvtBBScalar::amp_C_scalarPart( const EvtDiracSpinor& b1Pol,
                                                 const EvtDiracSpinor& b2Pol,
                                                 double t )
 {
     return baryon_fS( t ) * b1Pol.adjoint() * b2Pol;
 }
 
 const EvtComplex EvtBBScalar::amp_C_pseudoscalarPart(
     const EvtDiracSpinor& b1Pol, const EvtDiracSpinor& b2Pol, double t )
 {
     return baryon_gP( t ) * b1Pol.adjoint() * ( EvtGammaMatrix::g5() * b2Pol );
 }
diff --git a/src/EvtGenModels/EvtBLLNuL.cpp b/src/EvtGenModels/EvtBLLNuL.cpp
index eba956a..72286a5 100644
--- a/src/EvtGenModels/EvtBLLNuL.cpp
+++ b/src/EvtGenModels/EvtBLLNuL.cpp
@@ -1,148 +1,148 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBLLNuL.hh"
 
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 
 EvtBLLNuL::EvtBLLNuL() : m_calcAmp()
 {
 }
 
-std::string EvtBLLNuL::getName()
+std::string EvtBLLNuL::getName() const
 {
     // The model name
     return "BLLNUL";
 }
 
-EvtDecayBase* EvtBLLNuL::clone()
+EvtDecayBase* EvtBLLNuL::clone() const
 {
     return new EvtBLLNuL();
 }
 
 void EvtBLLNuL::init()
 {
     // check that there are 4 daughters
     checkNDaug( 4 );
 
     // We expect that the parent to be a scalar (B meson) and
     // the daughters to be ell+ (k1), ell- (k2), neutrino (k3)
     // and the last lepton ell- (k4)
 
     // Check spin types
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::DIRAC );       // ell+(k_1)
     checkSpinDaughter( 1, EvtSpinType::DIRAC );       // ell-(k_2)
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );    // neu (k_3)
     checkSpinDaughter( 3, EvtSpinType::DIRAC );       // ell-(k_4)
 
     // Check that we have a charged B parent
-    static EvtIdSet BMesons{ "B-", "B+" };
+    static const EvtIdSet BMesons{ "B-", "B+" };
     if ( !BMesons.contains( getParentId() ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtBLLNuL" )
             << "Expecting the parent to be a charged B. Found PDG = "
             << EvtPDL::getStdHep( getParentId() ) << std::endl;
         ::abort();
     }
 
     // Make sure the first two leptons are charged conjugates of each other
     int id1 = EvtPDL::getStdHep( getDaug( 0 ) );
     int id2 = EvtPDL::getStdHep( getDaug( 1 ) );
     if ( id1 != -id2 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtBLLNuL" )
             << "Expecting the first 2 leptons, with PDG codes " << id1 << " and "
             << id2 << ", to be charged conjugates of each other" << std::endl;
         ::abort();
     }
 
     // Check that the last lepton has the same charge as the B parent
     int q3 = EvtPDL::chg3( getDaug( 3 ) ) / 3;
     int qB = EvtPDL::chg3( getParentId() ) / 3;
     if ( q3 != qB ) {
         EvtGenReport( EVTGEN_ERROR, "EvtBLLNuL" )
             << "The 3rd lepton charge " << q3 << " does not match the B charge "
             << qB << std::endl;
         ::abort();
     }
 
     // Also check that the 2nd lepton has the same charge as the 3rd one
     int q2 = EvtPDL::chg3( getDaug( 1 ) ) / 3;
     if ( q2 != q3 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtBLLNuL" )
             << "The 2nd lepton charge " << q2
             << " does not match the 3rd lepton charge " << q3 << std::endl;
         ::abort();
     }
 
     // Identify if the decay has 3 charged leptons with the same flavour.
     // If so, then we need to include amplitude terms where the 2nd and 3rd
     // same-sign leptons are interchanged: k2 <-> k4
     bool symmetry( false );
     int id3 = EvtPDL::getStdHep( getDaug( 3 ) );
 
     if ( abs( id1 ) == abs( id2 ) && abs( id1 ) == abs( id3 ) ) {
         symmetry = true;
     }
 
     // Specify the qSq minimum cut-off as 4*(muon mass)^2 = 0.044655 and the
     // kSq minimum cut off as 4*(electron mass)^2 = 1.044e-6
     double muMass = EvtPDL::getMeanMass( EvtPDL::getId( "mu+" ) );
     double eMass = EvtPDL::getMeanMass( EvtPDL::getId( "e+" ) );
     double qSqMin = 4.0 * muMass * muMass;
     double kSqMin = 4.0 * eMass * eMass;
 
     // Optionally set these cut-offs using two decay file parameters. We may
     // have a 3rd parameter (max prob), so check for at least 2 parameters
     if ( getNArg() >= 2 ) {
         qSqMin = getArg( 0 );
         kSqMin = getArg( 1 );
     }
 
     // Define the amplitude qSq and kSq cut-offs, also
     // specifying if the decay mode has flavour symmetry
     m_calcAmp.setParameters( qSqMin, kSqMin, symmetry );
 }
 
 void EvtBLLNuL::initProbMax()
 {
     // Set the maximum probability of the decay
     double maxProb( 3.2 );
 
     // Optional 3rd decay file parameter, e.g. if qSq and/or kSq min have changed.
     // Note that both qSq and kSq parameters must still be specified in the decay
     // file to ensure that the maximum probability value is the 3rd parameter!
     if ( getNArg() == 3 ) {
         maxProb = getArg( 2 );
     }
 
     setProbMax( maxProb );
 }
 
 void EvtBLLNuL::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     m_calcAmp.CalcAmp( p, m_amp2 );
 }
diff --git a/src/EvtGenModels/EvtBTo3hCP.cpp b/src/EvtGenModels/EvtBTo3hCP.cpp
index f3eab88..83d9d72 100644
--- a/src/EvtGenModels/EvtBTo3hCP.cpp
+++ b/src/EvtGenModels/EvtBTo3hCP.cpp
@@ -1,1223 +1,1223 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBTo3hCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <cmath>
 #include <stdlib.h>
 #include <string>
 
 #define square( x ) ( ( x ) * ( x ) )
 
 /*
  * MK - 25/Aug/2016
  * The code bellow is not necessarilly well writen as it is 1-to-1 rewrite
  * from FORTRAN code (which is spread over 4 different source codes in not
  * fully obvious way). Once it is rewriten and giving correct results, I
  * will think how to give it more proper structure (mainly by checking what
  * is duplicated and how to simplify it).
  */
 
 void EvtBTo3hCP::setConstants( double balpha, double bbeta )
 {
     m_alphaCP = balpha;
     double calpha = cos( m_alphaCP );
     double salpha = sin( m_alphaCP );
     m_betaCP = bbeta;
     double cbeta = cos( m_betaCP );
     double sbeta = sin( m_betaCP );
 
     m_MA2 = square( m_M_B ) + square( m_M_pip ) + square( m_M_pi0 ) +
             square( m_M_pi0 );
     m_MB2 = square( m_M_B ) + square( m_M_pip ) + square( m_M_pim ) +
             square( m_M_pi0 );
     m_MC2 = square( m_M_B ) + square( m_M_Kp ) + square( m_M_pim ) +
             square( m_M_pi0 );
 
     double StrongPhase = 0;
     EvtComplex StrongExp( cos( StrongPhase ), sin( StrongPhase ) );
 
     EvtComplex Mat_Tp0( calpha, -salpha );
     Mat_Tp0 *= 1.09;
     EvtComplex Mat_Tm0( calpha, -salpha );
     Mat_Tm0 *= 1.09;
     EvtComplex Mat_T0p( calpha, -salpha );
     Mat_T0p *= 0.66;
     EvtComplex Mat_T0m( calpha, -salpha );
     Mat_T0m *= 0.66;
     EvtComplex Mat_Tpm( calpha, -salpha );
     Mat_Tpm *= 1.00;
     EvtComplex Mat_Tmp( calpha, -salpha );
     Mat_Tmp *= 0.47;
 
     EvtComplex Mat_Ppm( cos( -0.5 ), sin( -0.5 ) );
     Mat_Ppm *= -0.2;
     EvtComplex Mat_Pmp( cos( 2. ), sin( 2. ) );
     Mat_Pmp *= 0.15;
 
     EvtComplex Mat_P1 = 0.5 * ( Mat_Ppm - Mat_Pmp );
     EvtComplex Mat_P0 = 0.5 * ( Mat_Ppm + Mat_Pmp );
     EvtComplex Nat_Tp0( calpha, salpha );
     Nat_Tp0 *= 1.09;
     EvtComplex Nat_Tm0( calpha, salpha );
     Nat_Tm0 *= 1.09;
     EvtComplex Nat_T0p( calpha, salpha );
     Nat_T0p *= 0.66;
     EvtComplex Nat_T0m( calpha, salpha );
     Nat_T0m *= 0.66;
     EvtComplex Nat_Tpm( calpha, salpha );
     Nat_Tpm *= 1.00;
     EvtComplex Nat_Tmp( calpha, salpha );
     Nat_Tmp *= 0.47;
     EvtComplex Nat_P1 = Mat_P1;
     EvtComplex Nat_P0 = Mat_P0;
 
     Mat_Tpm = StrongExp * Mat_Tpm;
     Nat_Tpm = StrongExp * Nat_Tpm;
 
     m_Mat_S1 = Mat_Tp0 + 2. * Mat_P1;
     m_Mat_S2 = Mat_T0p - 2. * Mat_P1;
     m_Mat_S3 = Mat_Tpm + Mat_P1 + Mat_P0;
     m_Mat_S4 = Mat_Tmp - Mat_P1 + Mat_P0;
     m_Mat_S5 = -Mat_Tpm - Mat_Tmp + Mat_Tp0 + Mat_T0p - 2. * Mat_P0;
 
     m_Nat_S1 = Nat_Tp0 + 2. * Nat_P1;
     m_Nat_S2 = Nat_T0p - 2. * Nat_P1;
     m_Nat_S3 = Nat_Tpm + Nat_P1 + Nat_P0;
     m_Nat_S4 = Nat_Tmp - Nat_P1 + Nat_P0;
     m_Nat_S5 = -Nat_Tpm - Nat_Tmp + Nat_Tp0 + Nat_T0p - 2. * Nat_P0;
 
     // B0    -->-- K*+ pi- Amplitudes (Trees + Penguins)
     m_MatKstarp = EvtComplex( calpha, -salpha ) * EvtComplex( 0.220, 0. ) +
                   EvtComplex( cbeta, sbeta ) * EvtComplex( -1.200, 0. );
     // B0    -->-- K*0 pi0 Amplitudes (Trees + Penguins)
     m_MatKstar0 = EvtComplex( calpha, -salpha ) * EvtComplex( 0.015, 0. ) +
                   EvtComplex( cbeta, sbeta ) * EvtComplex( 0.850, 0. );
     // B0    -->-- K+ rho- Amplitudes (Trees + Penguins)
     m_MatKrho = EvtComplex( calpha, -salpha ) * EvtComplex( 0.130, 0. ) +
                 EvtComplex( cbeta, sbeta ) * EvtComplex( 0.160, 0. );
     // B0bar -->-- K*+ pi- Amplitudes (Trees + Penguins)
     m_NatKstarp = EvtComplex( 0., 0. );
     // B0bar -->-- K*0 pi0 Amplitudes (Trees + Penguins)
     m_NatKstar0 = EvtComplex( 0., 0. );
     // B0bar -->-- K+ rho- Amplitudes (Trees + Penguins)
     m_NatKrho = EvtComplex( 0., 0. );
 }
 
 void EvtBTo3hCP::Evt3pi( double alpha, int iset, EvtVector4R& p_pi_plus,
                          EvtVector4R& p_pi_minus, EvtVector4R& p_gamma_1,
                          EvtVector4R& p_gamma_2, double& Real_B0,
                          double& Imag_B0, double& Real_B0bar, double& Imag_B0bar )
 {
     EvtVector4R p_p2;
     double AB0, AB0bar, Ainter, R1, R2;
     double factor;
     int ierr = 0;
 
     // Ghm : beta is not needed for this generation - put a default value
     setConstants( alpha, 0.362 );
 
     if ( iset == 0 ) {
         p_pi_plus.set( m_M_pip, 0, 0, 0 );
         p_p2.set( m_M_pi0, 0, 0, 0 );
         p_pi_minus.set( m_M_pim, 0, 0, 0 );
 
         do {
             firstStep( p_pi_plus, p_p2, p_pi_minus, 1 );
             ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0,
                                Real_B0bar, Imag_B0bar, iset );
         } while ( ierr != 0 );
     } else if ( iset < 0 ) {
         p_p2 = p_gamma_1 + p_gamma_2;
         ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0,
                            Real_B0bar, Imag_B0bar, iset );
         if ( ierr != 0 ) {
             std::cout << "Provided kinematics is not physical\n";
             std::cout << "Program will stop\n";
             exit( 1 );
         }
     } else    // iset > 0
     {
         m_factor_max = 0;
 
         int endLoop = iset;
         for ( int i = 0; i < endLoop; ++i ) {
             p_pi_plus.set( m_M_pip, 0, 0, 0 );
             p_p2.set( m_M_pi0, 0, 0, 0 );
             p_pi_minus.set( m_M_pim, 0, 0, 0 );
 
             firstStep( p_pi_plus, p_p2, p_pi_minus, 1 );
             ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0,
                                Real_B0bar, Imag_B0bar, iset );
             if ( ierr != 0 ) {
                 continue;
             }
             AB0 = square( Real_B0 ) + square( Imag_B0 );
             AB0bar = square( Real_B0bar ) + square( Imag_B0bar );
             Ainter = Real_B0 * Imag_B0bar - Imag_B0 * Real_B0bar;
             R1 = ( AB0 - AB0bar ) / ( AB0 + AB0bar );
             R2 = ( 2.0 * Ainter ) / ( AB0 + AB0bar );
             factor = ( 1.0 + sqrt( square( R1 ) + square( R2 ) ) ) *
                      ( AB0 + AB0bar ) / 2.0;
             if ( factor > m_factor_max )
                 m_factor_max = factor;
         }
         m_factor_max = 1.0 / std::sqrt( m_factor_max );
     }
 
     Real_B0 *= m_factor_max;
     Imag_B0 *= m_factor_max;
     Real_B0bar *= m_factor_max;
     Imag_B0bar *= m_factor_max;
 
     if ( iset < 0 ) {
         return;
     }
 
     rotation( p_pi_plus, 1 );
     rotation( p_p2, 0 );
     rotation( p_pi_minus, 0 );
 
     gammaGamma( p_p2, p_gamma_1, p_gamma_2 );
 }
 
 void EvtBTo3hCP::Evt3piMPP( double alpha, int iset, EvtVector4R& p_p1,
                             EvtVector4R& p_p2, EvtVector4R& p_p3,
                             double& Real_B0, double& Imag_B0,
                             double& Real_B0bar, double& Imag_B0bar )
 {
     double ABp, ABm;
     int ierr = 0;
 
     // Ghm : beta is not needed for this generation - put a default value
     setConstants( alpha, 0.362 );
 
     if ( iset == 0 ) {
         p_p1.set( m_M_pim, 0, 0, 0 );
         p_p2.set( m_M_pip, 0, 0, 0 );
         p_p3.set( m_M_pip, 0, 0, 0 );
 
         do {
             firstStep( p_p1, p_p2, p_p3, 2 );
             ierr = compute3piMPP( p_p1, p_p2, p_p3, Real_B0, Imag_B0,
                                   Real_B0bar, Imag_B0bar, iset );
         } while ( ierr != 0 );
     } else if ( iset < 0 ) {
         ierr = compute3piMPP( p_p1, p_p2, p_p3, Real_B0, Imag_B0, Real_B0bar,
                               Imag_B0bar, iset );
         if ( ierr != 0 ) {
             std::cout << "Provided kinematics is not physical\n";
             std::cout << "Program will stop\n";
             exit( 1 );
         }
     } else    // iset > 0
     {
         m_factor_max = 0;
 
         int endLoop = iset;
         for ( int i = 0; i < endLoop; ++i ) {
             p_p1.set( m_M_pim, 0, 0, 0 );
             p_p2.set( m_M_pip, 0, 0, 0 );
             p_p3.set( m_M_pip, 0, 0, 0 );
 
             firstStep( p_p1, p_p2, p_p3, 2 );
             ierr = compute3piMPP( p_p1, p_p2, p_p3, Real_B0, Imag_B0,
                                   Real_B0bar, Imag_B0bar, iset );
             if ( ierr != 0 ) {
                 continue;
             }
             ABp = square( Real_B0 ) + square( Imag_B0 );
             ABm = square( Real_B0bar ) + square( Imag_B0bar );
             if ( ABp > m_factor_max )
                 m_factor_max = ABp;
             if ( ABm > m_factor_max )
                 m_factor_max = ABm;
         }
         m_factor_max = 1.0 / std::sqrt( m_factor_max );
     }
 
     Real_B0 *= m_factor_max;
     Imag_B0 *= m_factor_max;
     Real_B0bar *= m_factor_max;
     Imag_B0bar *= m_factor_max;
 
     if ( iset < 0 ) {
         return;
     }
 
     rotation( p_p1, 1 );
     rotation( p_p2, 0 );
     rotation( p_p3, 0 );
 }
 
 void EvtBTo3hCP::Evt3piP00( double alpha, int iset, EvtVector4R& p_p1,
                             EvtVector4R& p_p1_gamma1, EvtVector4R& p_p1_gamma2,
                             EvtVector4R& p_p2_gamma1, EvtVector4R& p_p2_gamma2,
                             double& Real_B0, double& Imag_B0,
                             double& Real_B0bar, double& Imag_B0bar )
 {
     double ABp, ABm;
     EvtVector4R p_p2, p_p3;
     int ierr = 0;
 
     // Ghm : beta is not needed for this generation - put a default value
     setConstants( alpha, 0.362 );
 
     if ( iset == 0 ) {
         p_p1.set( m_M_pip, 0, 0, 0 );
         p_p2.set( m_M_pi0, 0, 0, 0 );
         p_p3.set( m_M_pi0, 0, 0, 0 );
 
         do {
             firstStep( p_p1, p_p2, p_p3, 3 );
             ierr = compute3piP00( p_p1, p_p2, p_p3, Real_B0, Imag_B0,
                                   Real_B0bar, Imag_B0bar, iset );
         } while ( ierr != 0 );
     } else if ( iset < 0 ) {
         p_p2 = p_p1_gamma1 + p_p1_gamma2;
         p_p3 = p_p2_gamma1 + p_p2_gamma2;
         ierr = compute3piP00( p_p1, p_p2, p_p3, Real_B0, Imag_B0, Real_B0bar,
                               Imag_B0bar, iset );
         if ( ierr != 0 ) {
             std::cout << "Provided kinematics is not physical\n";
             std::cout << "Program will stop\n";
             exit( 1 );
         }
     } else    // iset > 0
     {
         m_factor_max = 0;
 
         int endLoop = iset;
         for ( int i = 0; i < endLoop; ++i ) {
             p_p1.set( m_M_pip, 0, 0, 0 );
             p_p2.set( m_M_pi0, 0, 0, 0 );
             p_p3.set( m_M_pi0, 0, 0, 0 );
 
             firstStep( p_p1, p_p2, p_p3, 3 );
             ierr = compute3piP00( p_p1, p_p2, p_p3, Real_B0, Imag_B0,
                                   Real_B0bar, Imag_B0bar, iset );
             if ( ierr != 0 ) {
                 continue;
             }
             ABp = square( Real_B0 ) + square( Imag_B0 );
             ABm = square( Real_B0bar ) + square( Imag_B0bar );
             if ( ABp > m_factor_max )
                 m_factor_max = ABp;
             if ( ABm > m_factor_max )
                 m_factor_max = ABm;
         }
         m_factor_max = 1.0 / std::sqrt( m_factor_max );
     }
 
     Real_B0 *= m_factor_max;
     Imag_B0 *= m_factor_max;
     Real_B0bar *= m_factor_max;
     Imag_B0bar *= m_factor_max;
 
     if ( iset < 0 ) {
         return;
     }
 
     rotation( p_p1, 1 );
     rotation( p_p2, 0 );
     rotation( p_p3, 0 );
 
     gammaGamma( p_p2, p_p1_gamma1, p_p1_gamma2 );
     gammaGamma( p_p3, p_p2_gamma1, p_p2_gamma2 );
 }
 
 void EvtBTo3hCP::EvtKpipi( double alpha, double beta, int iset,
                            EvtVector4R& p_K_plus, EvtVector4R& p_pi_minus,
                            EvtVector4R& p_gamma_1, EvtVector4R& p_gamma_2,
                            double& Real_B0, double& Imag_B0, double& Real_B0bar,
                            double& Imag_B0bar )
 {
     EvtVector4R p_p3;
     double ABp, ABm;
     int ierr = 0;
 
     setConstants( alpha, beta );
 
     if ( iset == 0 ) {
         p_K_plus.set( m_M_Kp, 0, 0, 0 );
         p_pi_minus.set( m_M_pim, 0, 0, 0 );
         p_p3.set( m_M_pi0, 0, 0, 0 );
 
         do {
             firstStep( p_K_plus, p_pi_minus, p_p3, 0 );
             ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0,
                                  Real_B0bar, Imag_B0bar, iset );
         } while ( ierr != 0 );
     } else if ( iset < 0 ) {
         p_p3 = p_gamma_1 + p_gamma_2;
         ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0,
                              Real_B0bar, Imag_B0bar, iset );
         if ( ierr != 0 ) {
             std::cout << "Provided kinematics is not physical\n";
             std::cout << "Program will stop\n";
             exit( 1 );
         }
     } else    // iset > 0
     {
         m_factor_max = 0;
 
         int endLoop = iset;
         for ( int i = 0; i < endLoop; ++i ) {
             p_K_plus.set( m_M_Kp, 0, 0, 0 );
             p_pi_minus.set( m_M_pim, 0, 0, 0 );
             p_p3.set( m_M_pi0, 0, 0, 0 );
             firstStep( p_K_plus, p_pi_minus, p_p3, 0 );
             ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0,
                                  Real_B0bar, Imag_B0bar, iset );
             if ( ierr != 0 ) {
                 continue;
             }
             ABp = square( Real_B0 ) + square( Imag_B0 );
             ABm = square( Real_B0bar ) + square( Imag_B0bar );
 
             if ( ABp > m_factor_max ) {
                 m_factor_max = ABp;
             }
             if ( ABm > m_factor_max ) {
                 m_factor_max = ABm;
             }
         }
         m_factor_max = 1.0 / std::sqrt( m_factor_max );
     }
 
     Real_B0 *= m_factor_max;
     Imag_B0 *= m_factor_max;
     Real_B0bar *= m_factor_max;
     Imag_B0bar *= m_factor_max;
 
     if ( iset < 0 ) {
         return;
     }
 
     rotation( p_K_plus, 1 );
     rotation( p_pi_minus, 0 );
     rotation( p_p3, 0 );
 
     gammaGamma( p_p3, p_gamma_1, p_gamma_2 );
 }
 
 void EvtBTo3hCP::firstStep( EvtVector4R& p1, EvtVector4R& p2, EvtVector4R& p3,
                             int mode )
 {
     const double m1sq = p1.mass2();
     const double m2sq = p2.mass2();
     const double m3sq = p3.mass2();
     double min_m12, min_m13, min_m23;
 
     double max_m12 = square( m_M_B );
     double max_m13 = square( m_M_B );
     double max_m23 = square( m_M_B );
 
     if ( mode == 0 ) {
         min_m12 = m1sq + m2sq + 2 * sqrt( m1sq * m2sq );
         min_m13 = m1sq + m3sq + 2 * sqrt( m1sq * m3sq );
         min_m23 = m2sq + m3sq + 2 * sqrt( m2sq * m3sq );
     } else {
         min_m12 = m1sq + m2sq;
         min_m13 = m1sq + m3sq;
         min_m23 = m2sq + m3sq;
     }
 
     bool eventOK;
     double m13, m12, m23;
     double E1;
     double E2;
     double E3;
     double p1mom;
     double p2mom;
     double p3mom;
     double cost13;
     double cost12;
     double cost23;
     eventOK = false;
 
     do {
         switch ( mode ) {
             case 0:
                 generateSqMasses_Kpipi( m12, m13, m23, m_MC2, m1sq, m2sq, m3sq );
                 break;
             case 1:
                 generateSqMasses_3pi( m12, m13, m23, m_MB2, m1sq, m2sq, m3sq );
                 break;
             case 2:
                 generateSqMasses_3piMPP( m12, m13, m23, m_MB2, m1sq, m2sq, m3sq );
                 break;
             case 3:
                 generateSqMasses_3piP00( m12, m13, m23, m_MA2, m1sq, m2sq, m3sq );
                 break;
             default:
                 break;
         }
         // Check whether event is physical
         if ( ( m23 < min_m23 ) || ( m23 > max_m23 ) )
             continue;
         if ( ( m13 < min_m13 ) || ( m13 > max_m13 ) )
             continue;
         if ( ( m12 < min_m12 ) || ( m12 > max_m12 ) )
             continue;
 
         // Now check the cosines of the angles
         E1 = ( square( m_M_B ) + m1sq - m23 ) / ( 2. * m_M_B );
         E2 = ( square( m_M_B ) + m2sq - m13 ) / ( 2. * m_M_B );
         E3 = ( square( m_M_B ) + m3sq - m12 ) / ( 2. * m_M_B );
         p1mom = square( E1 ) - m1sq;
         p2mom = square( E2 ) - m2sq;
         p3mom = square( E3 ) - m3sq;
         if ( p1mom < 0 || p2mom < 0 || p3mom < 0 ) {
             //      std::cout<<"Momenta magnitude negative\n";
             continue;
         }
         p1mom = sqrt( p1mom );
         p2mom = sqrt( p2mom );
         p3mom = sqrt( p3mom );
 
         cost13 = ( 2. * E1 * E3 + m1sq + m3sq - m13 ) / ( 2. * p1mom * p3mom );
         cost12 = ( 2. * E1 * E2 + m1sq + m2sq - m12 ) / ( 2. * p1mom * p2mom );
         cost23 = ( 2. * E2 * E3 + m2sq + m3sq - m23 ) / ( 2. * p2mom * p3mom );
         if ( cost13 < -1. || cost13 > 1. || cost12 < -1. || cost12 > 1. ||
              cost23 < -1. || cost23 > 1. ) {
             continue;
         }
         eventOK = true;
     } while ( eventOK == false );
 
     // Now is time to fill 4-vectors
     p3.set( E3, 0, 0, p3mom );
     p1.set( E1, p1mom * sqrt( 1 - square( cost13 ) ), 0, p1mom * cost13 );
     p2.set( 0, E2 );
     for ( int i = 1; i < 4; ++i ) {
         p2.set( i, -p1.get( i ) - p3.get( i ) );
     }
     if ( p1.get( 0 ) < p1.d3mag() ) {
         std::cout << "Unphysical p1 generated: " << p1 << std::endl;
     }
     if ( p2.get( 0 ) < p2.d3mag() ) {
         std::cout << "Unphysical p2 generated: " << p2 << std::endl;
     }
     if ( p3.get( 0 ) < p3.d3mag() ) {
         std::cout << "Unphysical p3 generated: " << p3 << std::endl;
     }
     double testMB2 = m_MB2;
     switch ( mode ) {
         case 0:
             testMB2 = m_MC2;
             break;
         case 1:
         case 2:
             testMB2 = m_MB2;
             break;
         case 3:
             testMB2 = m_MA2;
             break;
     }
 
     if ( fabs( m12 + m13 + m23 - testMB2 ) > 1e-4 ) {
         std::cout << "Unphysical event generated: " << m12 << " " << m13 << " "
                   << m23 << std::endl;
     }
 }
 
 void EvtBTo3hCP::generateSqMasses_Kpipi( double& m12, double& m13, double& m23,
                                          double MB2, double m1sq, double m2sq,
                                          double m3sq )
 {
     /*
   C There is two ways of generating the events:
   C The first one used a pole-compensation method to generate the
   C events efficiently taking into account the poles due to the
   C Breit-Wigners of the rho s. It is activated by setting
   C Phase_Space to .false.
   C The second one generates events according to phase space. It is
   C inneficient but allows the exploration of the full Dalitz plot
   C in an uniform way. It was found to be usefull fopr some peculiar
   C applications. It is activated by setting
   C Phase_space to .true.
   C Note that in that case, the generation is no longer correct.
   */
-    static bool phaseSpace = false;
+    static const bool phaseSpace = false;
 
     double max_m12 = square( m_M_B );
     double min_m12 = m1sq + m2sq + 2 * sqrt( m1sq * m2sq );
 
     double max_m13 = square( m_M_B );
     double min_m13 = m1sq + m3sq + 2 * sqrt( m1sq * m3sq );
 
     double max_m23 = square( m_M_B );
     double min_m23 = m2sq + m3sq + 2 * sqrt( m2sq * m3sq );
 
     double z = 3. * EvtRandom::Flat();
     if ( z < 1. )    // K*+
     {
         if ( phaseSpace ) {
             m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         } else {
             double y = EvtRandom::Flat() * m_pi - m_pi / 2;
             double x = std::tan( y );
             double mass = x * m_Gam_Kstarp / 2. + m_Mass_Kstarp;
             m13 = square( mass );
         }
         m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         m23 = MB2 - m12 - m13;
     } else if ( z < 2. )    // K*0
     {
         if ( phaseSpace ) {
             m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         } else {
             double y = EvtRandom::Flat() * m_pi - m_pi / 2;
             double x = std::tan( y );
             double mass = x * m_Gam_Kstar0 / 2. + m_Mass_Kstar0;
             m12 = square( mass );
         }
         m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         m23 = MB2 - m12 - m13;
     } else    // rho-
     {
         if ( phaseSpace ) {
             m23 = EvtRandom::Flat() * ( max_m23 - min_m23 ) + min_m23;
         } else {
             double y = EvtRandom::Flat() * m_pi - m_pi / 2;
             double x = std::tan( y );
             double mass = x * m_Gam_rho / 2. + m_Mass_rho;
             m23 = square( mass );
         }
         m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         m12 = MB2 - m23 - m13;
     }
 }
 
 void EvtBTo3hCP::generateSqMasses_3pi( double& m12, double& m13, double& m23,
                                        double MB2, double m1sq, double m2sq,
                                        double m3sq )
 {
     /*
   C There is two ways of generating the events:
   C The first one used a pole-compensation method to generate the
   C events efficiently taking into account the poles due to the
   C Breit-Wigners of the rho s. It is activated by setting
   C Phase_Space to .false.
   C The second one generates events according to phase space. It is
   C inneficient but allows the exploration of the full Dalitz plot
   C in an uniform way. It was found to be usefull fopr some peculiar
   C applications. It is activated by setting
   C Phase_space to .true.
   C Note that in that case, the generation is no longer correct.
   */
-    static bool phaseSpace = false;
+    static const bool phaseSpace = false;
 
     double max_m12 = square( m_M_B );
     double min_m12 = m1sq + m2sq;
 
     double max_m13 = square( m_M_B );
     double min_m13 = m1sq + m3sq;
 
     double max_m23 = square( m_M_B );
     double min_m23 = m2sq + m3sq;
     double mass = 0;
 
     if ( !phaseSpace ) {
         double y = EvtRandom::Flat() * m_pi - m_pi / 2;
         double x = std::tan( y );
         mass = x * m_Gam_rho / 2. + m_Mass_rho;
     }
 
     double z = 3. * EvtRandom::Flat();
     if ( z < 1. ) {
         if ( phaseSpace ) {
             m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         } else {
             m12 = square( mass );
         }
         m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         m23 = MB2 - m12 - m13;
     } else if ( z < 2. ) {
         if ( phaseSpace ) {
             m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         } else {
             m13 = square( mass );
         }
         m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         m23 = MB2 - m12 - m13;
     } else {
         if ( phaseSpace ) {
             m23 = EvtRandom::Flat() * ( max_m23 - min_m23 ) + min_m23;
         } else {
             m23 = square( mass );
         }
         m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         m13 = MB2 - m12 - m23;
     }
 }
 
 void EvtBTo3hCP::generateSqMasses_3piMPP( double& m12, double& m13, double& m23,
                                           double MB2, double m1sq, double m2sq,
                                           double m3sq )
 {
     /*
   C There is two ways of generating the events:
   C The first one used a pole-compensation method to generate the
   C events efficiently taking into account the poles due to the
   C Breit-Wigners of the rho s. It is activated by setting
   C Phase_Space to .false.
   C The second one generates events according to phase space. It is
   C inneficient but allows the exploration of the full Dalitz plot
   C in an uniform way. It was found to be usefull fopr some peculiar
   C applications. It is activated by setting
   C Phase_space to .true.
   C Note that in that case, the generation is no longer correct.
   */
-    static bool phaseSpace = false;
+    static const bool phaseSpace = false;
 
     double max_m12 = square( m_M_B );
     double min_m12 = m1sq + m2sq;
 
     double max_m13 = square( m_M_B );
     double min_m13 = m1sq + m3sq;
 
     double mass = 0;
 
     if ( !phaseSpace ) {
         double y = EvtRandom::Flat() * m_pi - m_pi / 2;
         double x = std::tan( y );
         mass = x * m_Gam_rho / 2. + m_Mass_rho;
     }
 
     double z = EvtRandom::Flat();
     if ( z < 0.5 ) {
         if ( phaseSpace ) {
             m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         } else {
             m12 = square( mass );
         }
         m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         m23 = MB2 - m12 - m13;
     } else {
         if ( phaseSpace ) {
             m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         } else {
             m13 = square( mass );
         }
         m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         m23 = MB2 - m12 - m13;
     }
 }
 
 void EvtBTo3hCP::generateSqMasses_3piP00( double& m12, double& m13, double& m23,
                                           double MB2, double m1sq, double m2sq,
                                           double m3sq )
 {
     /*
   C There is two ways of generating the events:
   C The first one used a pole-compensation method to generate the
   C events efficiently taking into account the poles due to the
   C Breit-Wigners of the rho s. It is activated by setting
   C Phase_Space to .false.
   C The second one generates events according to phase space. It is
   C inneficient but allows the exploration of the full Dalitz plot
   C in an uniform way. It was found to be usefull fopr some peculiar
   C applications. It is activated by setting
   C Phase_space to .true.
   C Note that in that case, the generation is no longer correct.
   */
-    static bool phaseSpace = false;
+    static const bool phaseSpace = false;
 
     double max_m12 = square( m_M_B );
     double min_m12 = m1sq + m2sq;
 
     double max_m13 = square( m_M_B );
     double min_m13 = m1sq + m3sq;
 
     double mass = 0;
 
     if ( !phaseSpace ) {
         double y = EvtRandom::Flat() * m_pi - m_pi / 2;
         double x = std::tan( y );
         mass = x * m_Gam_rho / 2. + m_Mass_rho;
     }
 
     double z = EvtRandom::Flat();
     if ( z < 0.5 ) {
         if ( phaseSpace ) {
             m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         } else {
             m12 = square( mass );
         }
         m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         m23 = MB2 - m12 - m13;
     } else {
         if ( phaseSpace ) {
             m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
         } else {
             m13 = square( mass );
         }
         m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
         m23 = MB2 - m12 - m13;
     }
 }
 int EvtBTo3hCP::compute3pi( EvtVector4R& p1, EvtVector4R& p2, EvtVector4R& p3,
                             double& real_B0, double& imag_B0,
                             double& real_B0bar, double& imag_B0bar, int iset )
 {
     int ierr = 0;
 
     double m12 = ( p1 + p2 ).mass();
     double m13 = ( p1 + p3 ).mass();
     double m23 = ( p2 + p3 ).mass();
 
     double W12 =
         1. / ( ( square( m_Mass_rho - m12 ) + square( m_Gam_rho / 2. ) ) * m12 );
     double W13 =
         1. / ( ( square( m_Mass_rho - m13 ) + square( m_Gam_rho / 2. ) ) * m13 );
     double W23 =
         1. / ( ( square( m_Mass_rho - m23 ) + square( m_Gam_rho / 2. ) ) * m23 );
 
     double Wtot = 1.;
     if ( iset >= 0 ) {
         Wtot = 1. / sqrt( W12 + W13 + W23 );
     }
 
     EvtComplex Mat_rhop = BreitWigner( p1, p2, p3, ierr );
     EvtComplex Mat_rhom = BreitWigner( p2, p3, p1, ierr );
     EvtComplex Mat_rho0 = BreitWigner( p1, p3, p2, ierr );
 
     EvtComplex Mat_1 = m_Mat_S3 * Mat_rhop;
     EvtComplex Mat_2 = m_Mat_S4 * Mat_rhom;
     EvtComplex Mat_3 = m_Mat_S5 * Mat_rho0 * 0.5;
 
     EvtComplex MatBp = ( Mat_1 + Mat_2 + Mat_3 ) * Wtot;
 
     Mat_1 = m_Nat_S3 * Mat_rhom;
     Mat_2 = m_Nat_S4 * Mat_rhop;
     Mat_3 = m_Nat_S5 * Mat_rho0 * 0.5;
 
     EvtComplex MatBm = ( Mat_1 + Mat_2 + Mat_3 ) * Wtot;
 
     real_B0 = real( MatBp );
     imag_B0 = imag( MatBp );
 
     real_B0bar = real( MatBm );
     imag_B0bar = imag( MatBm );
 
     return ierr;
 }
 
 int EvtBTo3hCP::compute3piMPP( EvtVector4R& p1, EvtVector4R& p2,
                                EvtVector4R& p3, double& real_B0, double& imag_B0,
                                double& real_B0bar, double& imag_B0bar, int iset )
 {
     int ierr = 0;
     const double ASHQ = sqrt( 2. );
     double m12 = ( p1 + p2 ).mass();
     double m13 = ( p1 + p3 ).mass();
 
     double W12 =
         1. / ( ( square( m_Mass_rho - m12 ) + square( m_Gam_rho / 2. ) ) * m12 );
     double W13 =
         1. / ( ( square( m_Mass_rho - m13 ) + square( m_Gam_rho / 2. ) ) * m13 );
 
     double Wtot = 1.;
     if ( iset >= 0 ) {
         Wtot = 1. / sqrt( W12 + W13 );
     }
 
     EvtComplex Mat_rhop = BreitWigner( p1, p2, p3, ierr ) +
                           BreitWigner( p1, p3, p2, ierr );
 
     EvtComplex MatBp = m_Mat_S2 * Mat_rhop * Wtot * ASHQ;
     EvtComplex MatBm = m_Nat_S2 * Mat_rhop * Wtot * ASHQ;
 
     real_B0 = real( MatBp );
     imag_B0 = imag( MatBp );
 
     real_B0bar = real( MatBm );
     imag_B0bar = imag( MatBm );
 
     return ierr;
 }
 
 int EvtBTo3hCP::compute3piP00( EvtVector4R& p1, EvtVector4R& p2,
                                EvtVector4R& p3, double& real_B0, double& imag_B0,
                                double& real_B0bar, double& imag_B0bar, int iset )
 {
     int ierr = 0;
     const double ASHQ = sqrt( 2. );
     double m12 = ( p1 + p2 ).mass();
     double m13 = ( p1 + p3 ).mass();
 
     double W12 =
         1. / ( ( square( m_Mass_rho - m12 ) + square( m_Gam_rho / 2. ) ) * m12 );
     double W13 =
         1. / ( ( square( m_Mass_rho - m13 ) + square( m_Gam_rho / 2. ) ) * m13 );
 
     double Wtot = 1.;
     if ( iset >= 0 ) {
         Wtot = 1. / sqrt( W12 + W13 );
     }
 
     EvtComplex Mat_rhop = BreitWigner( p1, p2, p3, ierr ) +
                           BreitWigner( p1, p3, p2, ierr );
 
     EvtComplex MatBp = m_Mat_S1 * Mat_rhop * Wtot * ASHQ;
     EvtComplex MatBm = m_Nat_S1 * Mat_rhop * Wtot * ASHQ;
 
     real_B0 = real( MatBp );
     imag_B0 = imag( MatBp );
 
     real_B0bar = real( MatBm );
     imag_B0bar = imag( MatBm );
 
     return ierr;
 }
 
 int EvtBTo3hCP::computeKpipi( EvtVector4R& p1, EvtVector4R& p2, EvtVector4R& p3,
                               double& real_B0, double& imag_B0,
                               double& real_B0bar, double& imag_B0bar, int iset )
 {
     int ierr = 0;
 
     double m12 = ( p1 + p2 ).mass();
     double m13 = ( p1 + p3 ).mass();
     double m23 = ( p2 + p3 ).mass();
 
     double W12 =
         1. / ( ( square( m_Mass_Kstar0 - m12 ) + square( m_Gam_Kstar0 / 2. ) ) *
                m12 );
     double W13 =
         1. / ( ( square( m_Mass_Kstarp - m13 ) + square( m_Gam_Kstarp / 2. ) ) *
                m13 );
     double W23 =
         1. / ( ( square( m_Mass_rho - m23 ) + square( m_Gam_rho / 2. ) ) * m23 );
 
     double Wtot = 1.;
     if ( iset >= 0 ) {
         Wtot = 1. / sqrt( W12 + W13 + W23 );
     }
 
     EvtComplex BW13 = BreitWigner( p1, p3, p2, ierr, m_Mass_Kstarp, m_Gam_Kstarp );
     if ( ierr != 0 )
         return ierr;
     EvtComplex BW12 = BreitWigner( p1, p2, p3, ierr, m_Mass_Kstar0, m_Gam_Kstar0 );
     if ( ierr != 0 )
         return ierr;
     /*
    If the rho is to be treated on the same footing as K* ==> use the line below
     EvtComplex BW23=BreitWigner(p2, p3, p1, ierr, Mass_Rho, Gam_Rho);
   */
     EvtComplex BW23 = BreitWigner( p2, p3, p1, ierr );
     if ( ierr != 0 )
         return ierr;
 
     // Build up amplitudes
     EvtComplex MatB0 = m_MatKstarp * BW13 + m_MatKstar0 * BW12 + m_MatKrho * BW23;
     EvtComplex MatB0bar = m_NatKstarp * BW13 + m_NatKstar0 * BW12 +
                           m_NatKrho * BW23;
 
     real_B0 = real( MatB0 ) * Wtot;
     imag_B0 = imag( MatB0 ) * Wtot;
     real_B0bar = real( MatB0bar ) * Wtot;
     imag_B0bar = imag( MatB0bar ) * Wtot;
 
     return ierr;
 }
 
 void EvtBTo3hCP::rotation( EvtVector4R& p, int newRot )
 {
     if ( newRot ) {
         double phi2 = EvtRandom::Flat() * 2. * m_pi;
         double phi3 = EvtRandom::Flat() * 2. * m_pi;
 
         double c1 = 2. * EvtRandom::Flat() - 1.;
         double c2 = cos( phi2 );
         double c3 = cos( phi3 );
 
         double s1 = sqrt( 1. - square( c1 ) );
         double s2 = sin( phi2 );
         double s3 = sin( phi3 );
 
         m_rotMatrix[0][0] = c1;
         m_rotMatrix[0][1] = s1 * c3;
         m_rotMatrix[0][2] = s1 * s3;
         m_rotMatrix[1][0] = -s1 * c2;
         m_rotMatrix[1][1] = c1 * c2 * c3 - s2 * s3;
         m_rotMatrix[1][2] = c1 * c2 * s3 + s2 * c3;
         m_rotMatrix[2][0] = s1 * s2;
         m_rotMatrix[2][1] = -c1 * s2 * c3 - c2 * s3;
         m_rotMatrix[2][2] = -c1 * s2 * s3 + c2 * c3;
     }
 
     double mom[3];
     for ( int i = 1; i < 4; ++i ) {
         mom[i - 1] = p.get( i );
         p.set( i, 0 );
     }
     for ( int i = 0; i < 3; ++i ) {
         for ( int j = 0; j < 3; ++j ) {
             p.set( i + 1, p.get( i + 1 ) + m_rotMatrix[i][j] * mom[j] );
         }
     }
 }
 
 void EvtBTo3hCP::gammaGamma( EvtVector4R& p, EvtVector4R& pgamma1,
                              EvtVector4R& pgamma2 )
 {
     double EGammaCmsPi0 = sqrt( p.mass2() ) / 2.;
 
     double cosThetaRot = EvtRandom::Flat() * 2. - 1.;
     double sinThetaRot = sqrt( 1. - square( cosThetaRot ) );
     double PhiRot = EvtRandom::Flat() * 2. * m_pi;
 
     pgamma1.set( 1, EGammaCmsPi0 * sinThetaRot * cos( PhiRot ) );
     pgamma1.set( 2, EGammaCmsPi0 * sinThetaRot * sin( PhiRot ) );
     pgamma1.set( 3, EGammaCmsPi0 * cosThetaRot );
     pgamma1.set( 0, EGammaCmsPi0 );
 
     for ( int i = 1; i < 4; ++i ) {
         pgamma2.set( i, -pgamma1.get( i ) );
     }
     pgamma2.set( 0, pgamma1.get( 0 ) );
 
     pgamma1.applyBoostTo( p );
     pgamma2.applyBoostTo( p );
 }
 
 EvtComplex EvtBTo3hCP::BreitWigner( EvtVector4R& p1, EvtVector4R& p2,
                                     EvtVector4R& p3, int& ierr, double Mass,
                                     double Width )
 {
     bool pipiMode = true;
 
     if ( Mass > 1e-5 ) {
         pipiMode = false;
     }
 
     bool relatBW = true;
     bool aleph = true;
     EvtComplex result( 0, 0 );
     ierr = 0;
 
     double m12 = ( p1 + p2 ).mass();
     double e12 = ( p1 + p2 ).get( 0 );
     double argu = 1. - square( m12 ) / square( e12 );
     double beta = 0;
     if ( argu > 0 ) {
         beta = sqrt( argu );
     } else {
         std::cout << "Abnormal beta ! Argu  = " << argu << std::endl;
         argu = 0;
     }
     double gamma = e12 / m12;
 
     double m13sq = ( p1 + p3 ).mass2();
     double costet = ( 2. * p1.get( 0 ) * p3.get( 0 ) - m13sq + p1.mass2() +
                       p3.mass2() ) /
                     ( 2. * p1.d3mag() * p3.d3mag() );
 
     double p1z = p1.d3mag() * costet;
     double p1zcms12 = gamma * ( p1z + beta * p1.get( 0 ) );
     double e1cms12 = gamma * ( p1.get( 0 ) + beta * p1z );
     double p1cms12 = sqrt( square( e1cms12 ) - p1.mass2() );
     double coscms = p1zcms12 / p1cms12;
 
     if ( pipiMode ) {
         if ( aleph ) {
             double m12_2 = square( m12 );
             result = coscms * EvtCRhoF_W( m12_2 );
         } else {
             double factor = 2 * ( square( m_Mass_rho - m12 ) +
                                   square( 0.5 * m_Gam_rho ) );
             factor = coscms * m_Gam_rho / factor;
             double numReal = ( m_Mass_rho - m12 ) * factor;
             double numImg = 0.5 * m_Gam_rho * factor;
             result = EvtComplex( numReal, numImg );
         }
     } else {
         if ( relatBW ) {
             double Am2Min = p1.mass2() + p2.mass2() + 2 * p1.mass() * p2.mass();
             result = coscms *
                      EvtRBW( square( m12 ), square( Mass ), Width, Am2Min );
         } else {
             double factor = 2 * ( square( Mass - m12 ) + square( 0.5 * Width ) );
             factor = coscms * Width / factor;
             double numReal = ( Mass - m12 ) * factor;
             double numImg = 0.5 * Width * factor;
             result = EvtComplex( numReal, numImg );
         }
     }
 
     return result;
 }
 
 EvtComplex EvtBTo3hCP::EvtCRhoF_W( double s )
 {
     const bool kuhn_santa = true;    // type of Breit-Wigner formula
                                      //  double lambda = 1.0;
 
     double AmRho, GamRho, AmRhoP, GamRhoP, beta, AmRhoPP, GamRhoPP, gamma;
     if ( kuhn_santa ) {
         //...rho(770)
         AmRho = 0.7734;
         GamRho = 0.1477;
         //...rho(1450)
         AmRhoP = 1.465;
         GamRhoP = 0.696;
         beta = -0.229;
         //...rho(1700)
         AmRhoPP = 1.760;
         GamRhoPP = 0.215;
         gamma = 0.075;
     } else {
         //...rho(770)
         AmRho = 0.7757;
         GamRho = 0.1508;
         //...rho(1450)
         AmRhoP = 1.448;
         GamRhoP = 0.503;
         beta = -0.161;
         //...rho(1700)
         AmRhoPP = 1.757;
         GamRhoPP = 0.237;
         gamma = 0.076;
     }
 
     EvtComplex result( 0, 0 );
 
     if ( kuhn_santa ) {
         result = ( EvtcBW_KS( s, square( AmRho ), GamRho ) +    //!...BW-rho( 770)
                    EvtcBW_KS( s, square( AmRhoP ), GamRhoP ) *
                        ( beta ) +    //!...BW-rho(1450)
                    EvtcBW_KS( s, square( AmRhoPP ), GamRhoPP ) *
                        ( gamma ) ) /    //!...BW-rho(1700)
                  ( 1. + beta + gamma );
     } else {
         result = ( EvtcBW_GS( s, square( AmRho ), GamRho ) +
                    EvtcBW_GS( s, square( AmRhoP ), GamRhoP ) * ( beta ) +
                    EvtcBW_GS( s, square( AmRhoPP ), GamRhoPP ) * ( gamma ) ) /
                  ( 1. + beta + gamma );
     }
     return result;
 }
 
 EvtComplex EvtBTo3hCP::EvtRBW( double s, double Am2, double Gam, double Am2Min )
 {
     EvtComplex result( 0, 0 );
 
     if ( s < Am2Min ) {
         return result;
     }
 
     double tmp = ( ( s - Am2Min ) / ( Am2 - Am2Min ) );
     double G = Gam * ( Am2 / s ) * sqrt( square( tmp ) * tmp );
     double D = square( Am2 - s ) + s * square( G );
     double X = Am2 * ( Am2 - s );
     double Y = Am2 * sqrt( s ) * G;
 
     result = EvtComplex( X / D, Y / D );
     return result;
 }
 
 EvtComplex EvtBTo3hCP::EvtcBW_KS( double s, double Am2, double Gam )
 {
     EvtComplex result( 0, 0 );
     const double AmPi2 = square( 0.13956995 );
     return EvtRBW( s, Am2, Gam, 4. * AmPi2 );
 }
 
 EvtComplex EvtBTo3hCP::EvtcBW_GS( double s, double Am2, double Gam )
 {
     EvtComplex result( 0, 0 );
     const double AmPi2 = square( 0.13956995 );
 
     if ( s < 4. * AmPi2 ) {
         return result;
     }
 
     double tmp = ( ( s - 4. * AmPi2 ) / ( Am2 - 4. * AmPi2 ) );
 
     double G = Gam * ( Am2 / s ) * sqrt( square( tmp ) * tmp );
     double z1 = Am2 - s + Evtfs( s, Am2, Gam );
     double z2 = sqrt( s ) * G;
     double z3 = Am2 + d( Am2 ) * Gam * sqrt( Am2 );
 
     double X = z3 * z1;
     double Y = z3 * z2;
     double N = square( z1 ) + square( z2 );
 
     result = EvtComplex( X / N, Y / N );
 
     return result;
 }
 
 double EvtBTo3hCP::d( double AmRho2 )
 {
     const double AmPi = 0.13956995;
     const double AmPi2 = square( AmPi );
     double AmRho = sqrt( AmRho2 );
     double k_AmRho2 = k( AmRho2 );
     double result = 3. / m_pi * AmPi2 / square( k_AmRho2 ) *
                         log( ( AmRho + 2. * k_AmRho2 ) / ( 2. * AmPi ) ) +
                     AmRho / ( 2. * m_pi * k_AmRho2 ) -
                     AmPi2 * AmRho / ( m_pi * ( square( k_AmRho2 ) * k_AmRho2 ) );
     return result;
 }
 
 double EvtBTo3hCP::k( double s )
 {
     const double AmPi2 = square( 0.13956995 );
     return 0.5 * sqrt( s - 4. * AmPi2 );
 }
 
 double EvtBTo3hCP::Evtfs( double s, double AmRho2, double GamRho )
 {
     double k_s = k( s );
     double k_Am2 = k( AmRho2 );
 
     return GamRho * AmRho2 / ( square( k_Am2 ) * k_Am2 ) *
            ( square( k_s ) * ( h( s ) - h( AmRho2 ) ) +
              ( AmRho2 - s ) * square( k_Am2 ) * dh_ds( AmRho2 ) );
 }
 
 double EvtBTo3hCP::h( double s )
 {
     const double AmPi = 0.13956995;
     double sqrts = sqrt( s );
     double k_s = k( s );
     return 2. / m_pi * ( k_s / sqrts ) *
            log( ( sqrts + 2. * k_s ) / ( 2. * AmPi ) );
 }
 
 double EvtBTo3hCP::dh_ds( double s )
 {
     return h( s ) * ( 1. / ( 8. * square( k( s ) ) ) - 1. / ( 2 * s ) ) +
            1. / ( 2. * m_pi * s );
 }
diff --git a/src/EvtGenModels/EvtBTo3piCP.cpp b/src/EvtGenModels/EvtBTo3piCP.cpp
index 8a0bf97..9a34496 100644
--- a/src/EvtGenModels/EvtBTo3piCP.cpp
+++ b/src/EvtGenModels/EvtBTo3piCP.cpp
@@ -1,139 +1,139 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBTo3piCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtBTo3piCP::getName()
+std::string EvtBTo3piCP::getName() const
 {
     return "BTO3PI_CP";
 }
 
-EvtBTo3piCP* EvtBTo3piCP::clone()
+EvtBTo3piCP* EvtBTo3piCP::clone() const
 {
     return new EvtBTo3piCP;
 }
 
 void EvtBTo3piCP::init()
 {
     // check that there are 2 arguments
     checkNArg( 2 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 }
 
 void EvtBTo3piCP::initProbMax()
 {
     // perform common blocks initialization before
     // first use
     double alpha = getArg( 1 );
     int iset;
 
     iset = 10000;
 
     EvtVector4R p4piplus, p4piminus, p4gamm1, p4gamm2;
 
     double realA, imgA, realbarA, imgbarA;
 
     m_generator.Evt3pi( alpha, iset, p4piplus, p4piminus, p4gamm1, p4gamm2,
                         realA, imgA, realbarA, imgbarA );
 
     setProbMax( 1.5 );
 }
 
 void EvtBTo3piCP::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     EvtParticle *pip, *pim, *pi0;
 
     p->makeDaughters( getNDaug(), getDaugs() );
 
     //  p->init_daug(SCALAR,&pip,SCALAR,&pim,SCALAR,&pi0);
     pip = p->getDaug( 0 );
     pim = p->getDaug( 1 );
     pi0 = p->getDaug( 2 );
 
     EvtVector4R p4[3];
 
     double dm = getArg( 0 );
     double alpha = getArg( 1 );
     int iset;
 
     iset = 0;
 
     EvtVector4R p4piplus, p4piminus, p4gamm1, p4gamm2;
 
     double realA, imgA, realbarA, imgbarA;
 
     m_generator.Evt3pi( alpha, iset, p4[0], p4[1], p4gamm1, p4gamm2, realA,
                         imgA, realbarA, imgbarA );
 
     p4[2] = p4gamm1 + p4gamm2;
 
     if ( pip->getId() == EvtPDL::getId( "pi+" ) ) {
         pip->init( getDaug( 0 ), p4[0] );
         pim->init( getDaug( 1 ), p4[1] );
     } else {
         pip->init( getDaug( 0 ), p4[1] );
         pim->init( getDaug( 1 ), p4[0] );
     }
 
     pi0->init( getDaug( 2 ), p4[2] );
 
     EvtComplex amp;
 
     EvtComplex A( realA, imgA );
     EvtComplex Abar( realbarA, imgbarA );
 
     if ( other_b == B0B ) {
         amp = A * cos( dm * t / ( 2 * EvtConst::c ) ) +
               EvtComplex( 0., 1. ) * Abar * sin( dm * t / ( 2 * EvtConst::c ) );
     }
     if ( other_b == B0 ) {
         amp = Abar * cos( dm * t / ( 2 * EvtConst::c ) ) +
               EvtComplex( 0., 1. ) * A * sin( dm * t / ( 2 * EvtConst::c ) );
     }
 
     vertex( amp );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtBTo4piCP.cpp b/src/EvtGenModels/EvtBTo4piCP.cpp
index fc32950..3d4df52 100644
--- a/src/EvtGenModels/EvtBTo4piCP.cpp
+++ b/src/EvtGenModels/EvtBTo4piCP.cpp
@@ -1,265 +1,265 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBTo4piCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <stdlib.h>
 #include <string>
 
 EvtComplex EvtAmpA2( const EvtVector4R& p4pi1, const EvtVector4R& p4pi2,
                      const EvtVector4R& p4pi3, const EvtVector4R& p4pi4 )
 {
     //added by Lange Jan4,2000
-    static EvtId A2M = EvtPDL::getId( "a_2-" );
-    static EvtId RHO0 = EvtPDL::getId( "rho0" );
+    static const EvtId A2M = EvtPDL::getId( "a_2-" );
+    static const EvtId RHO0 = EvtPDL::getId( "rho0" );
 
     EvtVector4R p4a2, p4rho, p4b;
 
     p4rho = p4pi1 + p4pi2;
 
     p4a2 = p4rho + p4pi3;
 
     p4b = p4a2 + p4pi4;
 
     EvtVector4R p4b_a2, p4rho_a2, p4pi1_a2, p4a2_a2;
 
     p4b_a2 = boostTo( p4b, p4a2 );
     p4rho_a2 = boostTo( p4rho, p4a2 );
     p4pi1_a2 = boostTo( p4pi1, p4a2 );
     p4a2_a2 = boostTo( p4a2, p4a2 );
 
     EvtVector4R p4pi1_rho;
 
     p4pi1_rho = boostTo( p4pi1_a2, p4rho_a2 );
 
     EvtVector4R vb, vrho, vpi, t;
 
     vb = p4b_a2 / p4b_a2.d3mag();
     vrho = p4rho_a2 / p4rho_a2.d3mag();
     vpi = p4pi1_rho / p4pi1_rho.d3mag();
 
     t.set( 1.0, 0.0, 0.0, 0.0 );
 
     //  EvtComplex amp_a1,amp_a2;
     EvtComplex amp_a2;
 
     //  double bwm_a1=EvtPDL::getMeanMass(A1M);
     //  double gamma_a1=EvtPDL::getWidth(A1M);
     double bwm_a2 = EvtPDL::getMeanMass( A2M );
     double gamma_a2 = EvtPDL::getWidth( A2M );
     double bwm_rho = EvtPDL::getMeanMass( RHO0 );
     double gamma_rho = EvtPDL::getWidth( RHO0 );
 
     amp_a2 =
         ( sqrt( gamma_a2 / EvtConst::twoPi ) /
           ( ( p4a2 ).mass() - bwm_a2 - EvtComplex( 0.0, 0.5 * gamma_a2 ) ) ) *
         ( sqrt( gamma_rho / EvtConst::twoPi ) /
           ( ( p4rho ).mass() - bwm_rho - EvtComplex( 0.0, 0.5 * gamma_rho ) ) );
 
     return amp_a2 *
            ( vb.get( 1 ) * vrho.get( 1 ) + vb.get( 2 ) * vrho.get( 2 ) +
              vb.get( 3 ) * vrho.get( 3 ) ) *
            ( vpi.get( 1 ) *
                  ( vb.get( 2 ) * vrho.get( 3 ) - vb.get( 3 ) * vrho.get( 2 ) ) +
              vpi.get( 2 ) *
                  ( vb.get( 3 ) * vrho.get( 1 ) - vb.get( 1 ) * vrho.get( 3 ) ) +
              vpi.get( 3 ) *
                  ( vb.get( 1 ) * vrho.get( 2 ) - vb.get( 2 ) * vrho.get( 1 ) ) );
 }
 
 EvtComplex EvtAmpA1( const EvtVector4R& p4pi1, const EvtVector4R& p4pi2,
                      const EvtVector4R& p4pi3, const EvtVector4R& p4pi4 )
 {
     //added by Lange Jan4,2000
-    static EvtId A1M = EvtPDL::getId( "a_1-" );
-    static EvtId RHO0 = EvtPDL::getId( "rho0" );
+    static const EvtId A1M = EvtPDL::getId( "a_1-" );
+    static const EvtId RHO0 = EvtPDL::getId( "rho0" );
 
     EvtVector4R p4a1, p4rho, p4b;
 
     p4rho = p4pi1 + p4pi2;
 
     p4a1 = p4rho + p4pi3;
 
     p4b = p4a1 + p4pi4;
 
     EvtVector4R p4b_a1, p4rho_a1, p4pi1_a1, p4a1_a1;
 
     p4b_a1 = boostTo( p4b, p4a1 );
     p4rho_a1 = boostTo( p4rho, p4a1 );
     p4pi1_a1 = boostTo( p4pi1, p4a1 );
     p4a1_a1 = boostTo( p4a1, p4a1 );
 
     EvtVector4R p4pi1_rho;
 
     p4pi1_rho = boostTo( p4pi1_a1, p4rho_a1 );
 
     EvtVector4R vb, vrho, vpi, t;
 
     vb = p4b_a1 / p4b_a1.d3mag();
     vrho = p4rho_a1 / p4rho_a1.d3mag();
     vpi = p4pi1_rho / p4pi1_rho.d3mag();
 
     t.set( 1.0, 0.0, 0.0, 0.0 );
 
     EvtComplex amp_a1;
 
     double bwm_a1 = EvtPDL::getMeanMass( A1M );
     double gamma_a1 = EvtPDL::getWidth( A1M );
     //  double bwm_a2=EvtPDL::getMeanMass(A2M);
     //  double gamma_a2=EvtPDL::getWidth(A2M);
     double bwm_rho = EvtPDL::getMeanMass( RHO0 );
     double gamma_rho = EvtPDL::getWidth( RHO0 );
 
     amp_a1 =
         ( sqrt( gamma_a1 / EvtConst::twoPi ) /
           ( ( p4a1 ).mass() - bwm_a1 - EvtComplex( 0.0, 0.5 * gamma_a1 ) ) ) *
         ( sqrt( gamma_rho / EvtConst::twoPi ) /
           ( ( p4rho ).mass() - bwm_rho - EvtComplex( 0.0, 0.5 * gamma_rho ) ) );
 
     return amp_a1 * ( vb.get( 1 ) * vpi.get( 1 ) + vb.get( 2 ) * vpi.get( 2 ) +
                       vb.get( 3 ) * vpi.get( 3 ) );
 }
 
-std::string EvtBTo4piCP::getName()
+std::string EvtBTo4piCP::getName() const
 {
     return "BTO4PI_CP";
 }
 
-EvtBTo4piCP* EvtBTo4piCP::clone()
+EvtBTo4piCP* EvtBTo4piCP::clone() const
 {
     return new EvtBTo4piCP;
 }
 
 void EvtBTo4piCP::initProbMax()
 {
     setProbMax( 50.0 );
 }
 
 void EvtBTo4piCP::init()
 {
     // check that there are 18 arguments
     checkNArg( 18 );
     checkNDaug( 4 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
     checkSpinDaughter( 3, EvtSpinType::SCALAR );
 }
 
 void EvtBTo4piCP::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtVector4R mom1 = p->getDaug( 0 )->getP4();
     EvtVector4R mom2 = p->getDaug( 1 )->getP4();
     EvtVector4R mom3 = p->getDaug( 2 )->getP4();
     EvtVector4R mom4 = p->getDaug( 3 )->getP4();
 
     //  double alpha=getArg(0);
     //double dm=getArg(1);
 
     EvtComplex amp;
 
     EvtComplex A, Abar;
 
     EvtComplex A_a1p, Abar_a1p, A_a2p, Abar_a2p;
     EvtComplex A_a1m, Abar_a1m, A_a2m, Abar_a2m;
 
     A_a1p = EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                         getArg( 2 ) * sin( getArg( 3 ) ) );
     Abar_a1p = EvtComplex( getArg( 4 ) * cos( getArg( 5 ) ),
                            getArg( 4 ) * sin( getArg( 5 ) ) );
 
     A_a2p = EvtComplex( getArg( 6 ) * cos( getArg( 7 ) ),
                         getArg( 6 ) * sin( getArg( 7 ) ) );
     Abar_a2p = EvtComplex( getArg( 8 ) * cos( getArg( 9 ) ),
                            getArg( 8 ) * sin( getArg( 9 ) ) );
 
     A_a1m = EvtComplex( getArg( 10 ) * cos( getArg( 11 ) ),
                         getArg( 10 ) * sin( getArg( 11 ) ) );
     Abar_a1m = EvtComplex( getArg( 12 ) * cos( getArg( 13 ) ),
                            getArg( 12 ) * sin( getArg( 13 ) ) );
 
     A_a2m = EvtComplex( getArg( 14 ) * cos( getArg( 15 ) ),
                         getArg( 14 ) * sin( getArg( 15 ) ) );
     Abar_a2m = EvtComplex( getArg( 16 ) * cos( getArg( 17 ) ),
                            getArg( 16 ) * sin( getArg( 17 ) ) );
 
     EvtComplex a2p_amp = EvtAmpA2( mom1, mom2, mom3, mom4 ) +
                          EvtAmpA2( mom1, mom4, mom3, mom2 ) +
                          EvtAmpA2( mom3, mom2, mom1, mom4 ) +
                          EvtAmpA2( mom3, mom4, mom1, mom2 );
 
     EvtComplex a2m_amp = EvtAmpA2( mom2, mom3, mom4, mom1 ) +
                          EvtAmpA2( mom2, mom1, mom4, mom3 ) +
                          EvtAmpA2( mom4, mom3, mom2, mom1 ) +
                          EvtAmpA2( mom4, mom1, mom2, mom3 );
 
     EvtComplex a1p_amp = EvtAmpA1( mom1, mom2, mom3, mom4 ) +
                          EvtAmpA1( mom1, mom4, mom3, mom2 ) +
                          EvtAmpA1( mom3, mom2, mom1, mom4 ) +
                          EvtAmpA1( mom3, mom4, mom1, mom2 );
 
     EvtComplex a1m_amp = EvtAmpA1( mom2, mom3, mom4, mom1 ) +
                          EvtAmpA1( mom2, mom1, mom4, mom3 ) +
                          EvtAmpA1( mom4, mom3, mom2, mom1 ) +
                          EvtAmpA1( mom4, mom1, mom2, mom3 );
 
     A = A_a2p * a2p_amp + A_a1p * a1p_amp + A_a2m * a2m_amp + A_a1m * a1m_amp;
     Abar = Abar_a2p * a2p_amp + Abar_a1p * a1p_amp + Abar_a2m * a2m_amp +
            Abar_a1m * a1m_amp;
 
     if ( other_b == B0B ) {
         amp = A * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               EvtComplex( cos( -2.0 * getArg( 0 ) ), sin( -2.0 * getArg( 0 ) ) ) *
                   getArg( 2 ) * EvtComplex( 0.0, 1.0 ) * Abar *
                   sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     }
     if ( other_b == B0 ) {
         amp = A * EvtComplex( cos( 2.0 * getArg( 0 ) ), sin( 2.0 * getArg( 0 ) ) ) *
                   EvtComplex( 0.0, 1.0 ) *
                   sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               getArg( 2 ) * Abar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     }
 
     vertex( amp );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtBToDDalitzCPK.cpp b/src/EvtGenModels/EvtBToDDalitzCPK.cpp
index d14413d..b3e7362 100644
--- a/src/EvtGenModels/EvtBToDDalitzCPK.cpp
+++ b/src/EvtGenModels/EvtBToDDalitzCPK.cpp
@@ -1,142 +1,142 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBToDDalitzCPK.hh"
 
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 //-----------------------------------------------------------------------------
 // Implementation file for class : EvtBToDDalitzCPK
 // Decay Model for B->D0K with D0->Ks pi+ pi-
 // it is just a way to get the arguments...
 // Works also for other B->D0K decays...
 // 2003-12-08 : Patrick Robbe
 //-----------------------------------------------------------------------------
 
 //=============================================================================
 // Name of the model
 //=============================================================================
-std::string EvtBToDDalitzCPK::getName()
+std::string EvtBToDDalitzCPK::getName() const
 {
     return "BTODDALITZCPK";
 }
 //=============================================================================
 // Clone method
 //=============================================================================
-EvtBToDDalitzCPK* EvtBToDDalitzCPK::clone()
+EvtBToDDalitzCPK* EvtBToDDalitzCPK::clone() const
 {
     return new EvtBToDDalitzCPK;
 }
 //=============================================================================
 // Initialisation method
 //=============================================================================
 void EvtBToDDalitzCPK::init()
 {
     // Check that there are 3 arguments
     checkNArg( 3 );
     // Check that there are 2 daughters
     checkNDaug( 2 );
     // Check that the particles of the decay are :
     // B+/-   -> D0/bar K+/-
     // B+/-   -> K+/- D0/bar
     // B0/bar -> K*0/bar D0/bar
     // and nothing else ...
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
-    static EvtId KP = EvtPDL::getId( "K+" );
-    static EvtId KM = EvtPDL::getId( "K-" );
-    static EvtId KS = EvtPDL::getId( "K*0" );
-    static EvtId KSB = EvtPDL::getId( "anti-K*0" );
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId KP = EvtPDL::getId( "K+" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId KS = EvtPDL::getId( "K*0" );
+    static const EvtId KSB = EvtPDL::getId( "anti-K*0" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
 
     m_flag = 0;
 
     EvtId parent = getParentId();
     EvtId d1 = getDaug( 0 );
     EvtId d2 = getDaug( 1 );
 
     if ( ( ( parent == BP ) || ( parent == BM ) ) &&
          ( ( d1 == D0 ) || ( d1 == D0B ) ) && ( ( d2 == KP ) || ( d2 == KM ) ) ) {
         m_flag = 1;
         // PHSP Decay
     } else if ( ( ( parent == BP ) || ( parent == BM ) ) &&
                 ( ( d1 == KP ) || ( d1 == KM ) ) &&
                 ( ( d2 == D0 ) || ( d2 == D0B ) ) ) {
         m_flag = 1;
         // also PHSP decay
     } else if ( ( ( parent == B0 ) || ( parent == B0B ) ) &&
                 ( ( d1 == KS ) || ( d1 == KSB ) ) &&
                 ( ( d2 == D0 ) || ( d2 == D0B ) ) ) {
         m_flag = 2;
         // SVS Decay
     }
 
     if ( m_flag == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBToDDalitzCPK : Invalid mode." << std::endl;
         assert( 0 );
     }
 }
 //=============================================================================
 // Set prob max
 //=============================================================================
 void EvtBToDDalitzCPK::initProbMax()
 {
     if ( m_flag == 1 ) {
         // PHSP
         setProbMax( 0. );
     } else if ( m_flag == 2 ) {
         // SVS
         setProbMax( 1.0 );
     }
 }
 //=============================================================================
 // decay particle
 //=============================================================================
 void EvtBToDDalitzCPK::decay( EvtParticle* p )
 {
     if ( m_flag == 1 ) {
         // PHSP
         p->initializePhaseSpace( getNDaug(), getDaugs() );
         vertex( 0. );
     } else if ( m_flag == 2 ) {
         // SVS
         p->initializePhaseSpace( getNDaug(), getDaugs() );
 
         EvtParticle* v;
         v = p->getDaug( 0 );
         double massv = v->mass();
         EvtVector4R momv = v->getP4();
         EvtVector4R moms = p->getDaug( 1 )->getP4();
         double parentMass = p->mass();
         EvtVector4R p4_parent = momv + moms;
 
         double norm = massv / ( momv.d3mag() * parentMass );
         p4_parent = norm * p4_parent;
         vertex( 0, p4_parent * ( v->epsParent( 0 ) ) );
         vertex( 1, p4_parent * ( v->epsParent( 1 ) ) );
         vertex( 2, p4_parent * ( v->epsParent( 2 ) ) );
     }
 }
diff --git a/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp b/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
index 2ca88cd..e811292 100644
--- a/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
+++ b/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
@@ -1,227 +1,229 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBToDiBaryonlnupQCD.hh"
 
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtScalarParticle.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
-std::string EvtBToDiBaryonlnupQCD::getName()
+std::string EvtBToDiBaryonlnupQCD::getName() const
 {
     return "BToDiBaryonlnupQCD";
 }
 
-EvtDecayBase* EvtBToDiBaryonlnupQCD::clone()
+EvtDecayBase* EvtBToDiBaryonlnupQCD::clone() const
 {
     return new EvtBToDiBaryonlnupQCD;
 }
 
 void EvtBToDiBaryonlnupQCD::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs(), true );
 
     m_calcAmp->CalcAmp( p, m_amp2 );
 }
 
 void EvtBToDiBaryonlnupQCD::init()
 {
     if ( !( getNArg() == 6 || getNArg() == 7 ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBToDiBaryonlnupQCD model expected "
             << " 6 or 7 arguments but found:" << getNArg() << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     if ( getNDaug() != 4 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong number of daughters in EvtBToDiBaryonlnupQCD model: "
             << "4 daughters expected but found: " << getNDaug() << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     // We expect B -> baryon baryon lepton neutrino
     EvtSpinType::spintype parentType = EvtPDL::getSpinType( getParentId() );
     EvtSpinType::spintype leptonType = EvtPDL::getSpinType( getDaug( 2 ) );
     EvtSpinType::spintype neutrinoType = EvtPDL::getSpinType( getDaug( 3 ) );
 
     if ( parentType != EvtSpinType::SCALAR ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBToDiBaryonlnupQCD model expected "
             << " a SCALAR parent, found:" << EvtPDL::name( getParentId() )
             << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     if ( leptonType != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBToDiBaryonlnupQCD model expected "
             << " a DIRAC 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
             << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     if ( neutrinoType != EvtSpinType::NEUTRINO ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBToDiBaryonlnupQCD model expected "
             << " a NEUTRINO 4th daughter, found:" << EvtPDL::name( getDaug( 3 ) )
             << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     // Get the 6 form factor D parameters from model arguments in the decay file
     std::vector<double> DPars( 6 );
     for ( int i = 0; i < 6; i++ ) {
         DPars[i] = getArg( i );
     }
 
     // Form factor model
     m_ffModel = std::make_unique<EvtBToDiBaryonlnupQCDFF>( DPars );
 
     // Set amplitude calculation pointer.
     // Accomodate for spin 1/2 (DIRAC) or 3/2 (RARITASCHWINGER) baryons
     EvtSpinType::spintype baryon1Type = EvtPDL::getSpinType( getDaug( 0 ) );
     EvtSpinType::spintype baryon2Type = EvtPDL::getSpinType( getDaug( 1 ) );
 
     if ( ( baryon1Type == EvtSpinType::DIRAC &&
            baryon2Type == EvtSpinType::RARITASCHWINGER ) ||
          ( baryon1Type == EvtSpinType::RARITASCHWINGER &&
            baryon2Type == EvtSpinType::DIRAC ) ||
          ( baryon1Type == EvtSpinType::DIRAC &&
            baryon2Type == EvtSpinType::DIRAC ) ) {
         m_calcAmp = std::make_unique<EvtSLDiBaryonAmp>( *m_ffModel );
 
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong baryon spin type in EvtBToDiBaryonlnupQCD model. "
             << "Expected spin type " << EvtSpinType::DIRAC << " or "
             << EvtSpinType::RARITASCHWINGER << ", found spin types "
             << baryon1Type << " and " << baryon2Type << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 }
 
 void EvtBToDiBaryonlnupQCD::initProbMax()
 {
     // Set maximum prob using dec file parameter if present
     if ( getNArg() == 7 ) {
         setProbMax( getArg( 6 ) );
 
     } else {
         // Default probability for the B -> p p l nu mode, where l = e, mu or tau
         setProbMax( 3.0e6 );
 
         // Specific decay modes, where we have one proton plus a second
         // baryon that can be any (excited) state. They all have lower
         // maximum probabilities compared to the default pp mode in order
         // to improve accept/reject generation efficiency
-        static EvtIdSet BMesons{ "B-", "B+" };
-        static EvtIdSet Delta{ "Delta+", "anti-Delta-" };
-        static EvtIdSet LambdaC{ "Lambda_c+", "anti-Lambda_c-" };
-        static EvtIdSet LambdaC1{ "Lambda_c(2593)+", "anti-Lambda_c(2593)-" };
-        static EvtIdSet LambdaC2{ "Lambda_c(2625)+", "anti-Lambda_c(2625)-" };
-        static EvtIdSet N1440{ "N(1440)+", "anti-N(1440)-" };
-        static EvtIdSet N1520{ "N(1520)+", "anti-N(1520)-" };
-        static EvtIdSet N1535{ "N(1535)+", "anti-N(1535)-" };
-        static EvtIdSet N1650{ "N(1650)+", "anti-N(1650)-" };
-        static EvtIdSet N1700{ "N(1700)+", "anti-N(1700)-" };
-        static EvtIdSet N1710{ "N(1710)+", "anti-N(1710)-" };
-        static EvtIdSet N1720{ "N(1720)+", "anti-N(1720)-" };
+        static const EvtIdSet BMesons{ "B-", "B+" };
+        static const EvtIdSet Delta{ "Delta+", "anti-Delta-" };
+        static const EvtIdSet LambdaC{ "Lambda_c+", "anti-Lambda_c-" };
+        static const EvtIdSet LambdaC1{ "Lambda_c(2593)+",
+                                        "anti-Lambda_c(2593)-" };
+        static const EvtIdSet LambdaC2{ "Lambda_c(2625)+",
+                                        "anti-Lambda_c(2625)-" };
+        static const EvtIdSet N1440{ "N(1440)+", "anti-N(1440)-" };
+        static const EvtIdSet N1520{ "N(1520)+", "anti-N(1520)-" };
+        static const EvtIdSet N1535{ "N(1535)+", "anti-N(1535)-" };
+        static const EvtIdSet N1650{ "N(1650)+", "anti-N(1650)-" };
+        static const EvtIdSet N1700{ "N(1700)+", "anti-N(1700)-" };
+        static const EvtIdSet N1710{ "N(1710)+", "anti-N(1710)-" };
+        static const EvtIdSet N1720{ "N(1720)+", "anti-N(1720)-" };
 
         EvtId parId = getParentId();
         EvtId bar1Id = getDaug( 0 );
         EvtId bar2Id = getDaug( 1 );
 
         // These probabilties are sensitive to the sub-decay modes of the excited baryon states,
         // which limit the available phase space and allows for events to be generated within the
         // 10,000 event trial limit. Otherwise the amplitude varies too much (by more than a factor
         // of a million) and events fail to be generated correctly. In case of problems, specify
         // the maximum probability by passing an extra 7th model parameter
         if ( BMesons.contains( parId ) ) {
             if ( Delta.contains( bar1Id ) || Delta.contains( bar2Id ) ) {
                 // Delta
                 setProbMax( 1e7 );
 
             } else if ( LambdaC.contains( bar1Id ) ||
                         LambdaC.contains( bar2Id ) ) {
                 // Lambda_c+
                 setProbMax( 1000.0 );
 
             } else if ( LambdaC1.contains( bar1Id ) ||
                         LambdaC1.contains( bar2Id ) ) {
                 // Lambda_c+(2593)
                 setProbMax( 200.0 );
 
             } else if ( LambdaC2.contains( bar1Id ) ||
                         LambdaC2.contains( bar2Id ) ) {
                 // Lambda_c+(2625)
                 setProbMax( 500.0 );
 
             } else if ( N1440.contains( bar1Id ) || N1440.contains( bar2Id ) ) {
                 // N(1440)
                 setProbMax( 8e5 );
 
             } else if ( N1520.contains( bar1Id ) || N1520.contains( bar2Id ) ) {
                 // N(1520)
                 setProbMax( 8e6 );
 
             } else if ( N1535.contains( bar1Id ) || N1535.contains( bar2Id ) ) {
                 // N(1535)
                 setProbMax( 8e5 );
 
             } else if ( N1650.contains( bar1Id ) || N1650.contains( bar2Id ) ) {
                 // N(1650)
                 setProbMax( 8e5 );
 
             } else if ( N1700.contains( bar1Id ) || N1700.contains( bar2Id ) ) {
                 // N(1700)
                 setProbMax( 4e6 );
 
             } else if ( N1710.contains( bar1Id ) || N1710.contains( bar2Id ) ) {
                 // N(1710)
                 setProbMax( 5e5 );
 
             } else if ( N1720.contains( bar1Id ) || N1720.contains( bar2Id ) ) {
                 // N(1720)
                 setProbMax( 4e6 );
 
             }    // Baryon combinations
 
         }    // B parent
 
     }    // Specific modes
 }
diff --git a/src/EvtGenModels/EvtBToKpipiCP.cpp b/src/EvtGenModels/EvtBToKpipiCP.cpp
index 9186b7f..1b48a1d 100644
--- a/src/EvtGenModels/EvtBToKpipiCP.cpp
+++ b/src/EvtGenModels/EvtBToKpipiCP.cpp
@@ -1,129 +1,129 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBToKpipiCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtBToKpipiCP::getName()
+std::string EvtBToKpipiCP::getName() const
 {
     return "BTOKPIPI_CP";
 }
 
-EvtBToKpipiCP* EvtBToKpipiCP::clone()
+EvtBToKpipiCP* EvtBToKpipiCP::clone() const
 {
     return new EvtBToKpipiCP;
 }
 
 void EvtBToKpipiCP::init()
 {
     // check that there are 3 arguments
     checkNArg( 3 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 
     double alpha = getArg( 1 );
     double beta = getArg( 2 );
     int iset;
     iset = 10000;
 
     EvtVector4R p4Kplus, p4piminus, p4gamm1, p4gamm2;
 
     double realA, imgA, realbarA, imgbarA;
 
     m_generator.EvtKpipi( alpha, beta, iset, p4Kplus, p4piminus, p4gamm1,
                           p4gamm2, realA, imgA, realbarA, imgbarA );
 }
 
 void EvtBToKpipiCP::initProbMax()
 {
     setProbMax( 1.2 );
 }
 
 void EvtBToKpipiCP::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     EvtParticle *Kp, *pim, *pi0;
 
     p->makeDaughters( getNDaug(), getDaugs() );
     Kp = p->getDaug( 0 );
     pim = p->getDaug( 1 );
     pi0 = p->getDaug( 2 );
 
     EvtVector4R p4[3];
 
     //double dm=getArg(0);
     double alpha = getArg( 1 );
     double beta = getArg( 2 );
     int iset;
 
     iset = 0;
 
     EvtVector4R p4Kplus, p4piminus, p4gamm1, p4gamm2;
 
     double realA, imgA, realbarA, imgbarA;
 
     m_generator.EvtKpipi( alpha, beta, iset, p4[0], p4[1], p4gamm1, p4gamm2,
                           realA, imgA, realbarA, imgbarA );
 
     p4[2] = p4gamm1 + p4gamm2;
 
     Kp->init( getDaug( 0 ), p4[0] );
     pim->init( getDaug( 1 ), p4[1] );
     pi0->init( getDaug( 2 ), p4[2] );
 
     EvtComplex amp;
 
     EvtComplex A( realA, imgA );
     EvtComplex Abar( realbarA, imgbarA );
 
     if ( other_b == B0B ) {
         amp = Abar;
     }
     if ( other_b == B0 ) {
         amp = A;
     }
 
     vertex( amp );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtBToPlnuBK.cpp b/src/EvtGenModels/EvtBToPlnuBK.cpp
index b5569b8..919d70c 100644
--- a/src/EvtGenModels/EvtBToPlnuBK.cpp
+++ b/src/EvtGenModels/EvtBToPlnuBK.cpp
@@ -1,90 +1,90 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBToPlnuBK.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 
 #include "EvtGenModels/EvtBToPlnuBKFF.hh"
 
 #include <assert.h>
 #include <stdlib.h>
 
 using std::cout;
 using std::endl;
 using std::fstream;
 
-std::string EvtBToPlnuBK::getName()
+std::string EvtBToPlnuBK::getName() const
 {
     return "BTOPLNUBK";
 }
 
-EvtBToPlnuBK* EvtBToPlnuBK::clone()
+EvtBToPlnuBK* EvtBToPlnuBK::clone() const
 {
     return new EvtBToPlnuBK;
 }
 
 void EvtBToPlnuBK::initProbMax()
 {
     EvtId parnum, mesnum, lnum, nunum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
     nunum = getDaug( 2 );
 
     double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, lnum, nunum,
                                                m_BKmodel.get() );
 
     setProbMax( mymaxprob );
 }
 
 void EvtBToPlnuBK::init()
 {
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
     if ( d1type == EvtSpinType::SCALAR ) {
         checkNArg( 2 );
         m_BKmodel = std::make_unique<EvtBToPlnuBKFF>( getArg( 0 ), getArg( 1 ) );
         m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "BK model handles only scalar meson daughters. Sorry." << endl;
         ::abort();
     }
 }
 
 void EvtBToPlnuBK::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_BKmodel.get() );
 }
diff --git a/src/EvtGenModels/EvtBToVlnuBall.cpp b/src/EvtGenModels/EvtBToVlnuBall.cpp
index 4b4e6ac..b229822 100644
--- a/src/EvtGenModels/EvtBToVlnuBall.cpp
+++ b/src/EvtGenModels/EvtBToVlnuBall.cpp
@@ -1,91 +1,91 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBToVlnuBall.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtBToVlnuBallFF.hh"
 
 #include <assert.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtBToVlnuBall::getName()
+std::string EvtBToVlnuBall::getName() const
 {
     return "BTOVLNUBALL";
 }
 
-EvtBToVlnuBall* EvtBToVlnuBall::clone()
+EvtBToVlnuBall* EvtBToVlnuBall::clone() const
 {
     return new EvtBToVlnuBall;
 }
 
 void EvtBToVlnuBall::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_Ballmodel.get() );
 }
 
 void EvtBToVlnuBall::initProbMax()
 {
     EvtId parnum, mesnum, lnum, nunum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
     nunum = getDaug( 2 );
 
     double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, lnum, nunum,
                                                m_Ballmodel.get() );
 
     setProbMax( mymaxprob );
 }
 
 void EvtBToVlnuBall::init()
 {
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
     if ( d1type == EvtSpinType::VECTOR ) {
         checkNArg( 8 );    // the number of arguments needed for the Ball model
         m_Ballmodel = std::make_unique<EvtBToVlnuBallFF>(
             getArg( 0 ), getArg( 1 ), getArg( 2 ), getArg( 3 ), getArg( 4 ),
             getArg( 5 ), getArg( 6 ), getArg( 7 ) );
         m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Ball model handles only vector meson daughters. Sorry." << endl;
         ::abort();
     }
 }
diff --git a/src/EvtGenModels/EvtBToXElNu.cpp b/src/EvtGenModels/EvtBToXElNu.cpp
index dff39c9..65dce01 100644
--- a/src/EvtGenModels/EvtBToXElNu.cpp
+++ b/src/EvtGenModels/EvtBToXElNu.cpp
@@ -1,148 +1,148 @@
 
 /***********************************************************************
 * Copyright 1998-2021 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBToXElNu.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtBCLFF.hh"
 #include "EvtGenModels/EvtBGLFF.hh"
 
 #include <cstdlib>
 #include <string>
 
 using std::endl;
 
-std::string EvtBToXElNu::getName()
+std::string EvtBToXElNu::getName() const
 {
     return "BTOXELNU";
 }
 
-EvtDecayBase* EvtBToXElNu::clone()
+EvtDecayBase* EvtBToXElNu::clone() const
 {
     return new EvtBToXElNu;
 }
 
 void EvtBToXElNu::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_ffmodel.get() );
 }
 
 void EvtBToXElNu::initProbMax()
 {
     EvtId parnum, mesnum, lnum, nunum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
     nunum = getDaug( 2 );
 
     const double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, lnum,
                                                      nunum, m_ffmodel.get() );
 
     setProbMax( mymaxprob );
 }
 
 void EvtBToXElNu::init()
 {
     checkNDaug( 3 );
 
     // We expect the parent to be a scalar
     // and the daughters to be X lepton neutrino
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
     const std::string model = getArgStr( 0 );
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "Using " << model << " EvtGen FF model" << endl;
 
     // -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL -- BGL
     if ( model == "BGL" ) {
         const EvtId lnum = getDaug( 1 );
         if ( lnum == EvtPDL::getId( "tau-" ) || lnum == EvtPDL::getId( "tau+" ) ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "The current BGL model should not be used for taus" << endl;
             ::abort();
         }
 
         if ( d1type == EvtSpinType::SCALAR ) {
             if ( getNArg() == 9 ) {
                 m_ffmodel = std::make_unique<EvtBGLFF>(
                     getArg( 1 ), getArg( 2 ), getArg( 3 ), getArg( 4 ),
                     getArg( 5 ), getArg( 6 ), getArg( 7 ), getArg( 8 ) );
                 m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "BGL (N=3) model for scalar meson daughters needs 8 arguments. Sorry."
                     << endl;
                 ::abort();
             }
         } else if ( d1type == EvtSpinType::VECTOR ) {
             if ( getNArg() == 7 ) {
                 m_ffmodel = std::make_unique<EvtBGLFF>( getArg( 1 ),
                                                         getArg( 2 ), getArg( 3 ),
                                                         getArg( 4 ), getArg( 5 ),
                                                         getArg( 6 ) );
                 m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "BGL (N=3) model for vector meson daughters needs 6 arguments. Sorry."
                     << endl;
                 ::abort();
             }
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Only Scalar and Vector models implemented. Sorry." << endl;
             ::abort();
         }
         // -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL -- BCL
     } else if ( model == "BCL" ) {
         // -- Need to subtract 1 as the first argument is the model name (BCL)
         const int numArgs = getNArg() - 1;
         double* args = getArgs();
         args = &args[1];
 
         m_ffmodel = std::make_unique<EvtBCLFF>( numArgs, args );
         if ( d1type == EvtSpinType::SCALAR ) {
             m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
         } else if ( d1type == EvtSpinType::VECTOR ) {
             m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "BCL model handles currently only scalar and vector meson daughters. Sorry."
                 << endl;
             ::abort();
         }
     } else {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "  Unknown form-factor model, valid options are BGL, BCL"
             << std::endl;
         ::abort();
     }
 }
diff --git a/src/EvtGenModels/EvtBaryonPCR.cpp b/src/EvtGenModels/EvtBaryonPCR.cpp
index c68719a..c34da03 100644
--- a/src/EvtGenModels/EvtBaryonPCR.cpp
+++ b/src/EvtGenModels/EvtBaryonPCR.cpp
@@ -1,182 +1,182 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBaryonPCR.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtBaryonPCRFF.hh"
 
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 #ifdef D0
 #undef D0
 #endif
 
-std::string EvtBaryonPCR::getName()
+std::string EvtBaryonPCR::getName() const
 {
     return "BaryonPCR";
 }
 
-EvtBaryonPCR* EvtBaryonPCR::clone()
+EvtBaryonPCR* EvtBaryonPCR::clone() const
 {
     return new EvtBaryonPCR;
 }
 
 void EvtBaryonPCR::decay( EvtParticle* p )
 {
     //This is a kludge to avoid warnings because the K_2* mass becomes to large.
-    static EvtIdSet regenerateMasses{ "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
-                                      "K_1+",  "K_1-",  "K_10",  "anti-K_10",
-                                      "D'_1+", "D'_1-", "D'_10", "anti-D'_10" };
+    static const EvtIdSet regenerateMasses{
+        "K_2*+", "K_2*-",     "K_2*0", "anti-K_2*0", "K_1+",  "K_1-",
+        "K_10",  "anti-K_10", "D'_1+", "D'_1-",      "D'_10", "anti-D'_10" };
 
     if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
         p->resetFirstOrNot();
     }
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex r00( getArg( 0 ), 0.0 );
     EvtComplex r01( getArg( 1 ), 0.0 );
     EvtComplex r10( getArg( 2 ), 0.0 );
     EvtComplex r11( getArg( 3 ), 0.0 );
 
     m_calcamp->CalcAmp( p, m_amp2, m_baryonpcrffmodel.get(), r00, r01, r10, r11 );
 }
 
 void EvtBaryonPCR::initProbMax()
 {
     // Baryons (partial list 5/28/04)
 
-    static EvtId SIGC0 = EvtPDL::getId( "Sigma_c0" );
-    static EvtId SIGC0B = EvtPDL::getId( "anti-Sigma_c0" );
-    static EvtId SIGCP = EvtPDL::getId( "Sigma_c+" );
-    static EvtId SIGCM = EvtPDL::getId( "anti-Sigma_c-" );
-    static EvtId SIGCPP = EvtPDL::getId( "Sigma_c++" );
-    static EvtId SIGCMM = EvtPDL::getId( "anti-Sigma_c--" );
-    static EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
-    static EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
-    static EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
-    static EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
-    static EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
-    static EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId SIGC0 = EvtPDL::getId( "Sigma_c0" );
+    static const EvtId SIGC0B = EvtPDL::getId( "anti-Sigma_c0" );
+    static const EvtId SIGCP = EvtPDL::getId( "Sigma_c+" );
+    static const EvtId SIGCM = EvtPDL::getId( "anti-Sigma_c-" );
+    static const EvtId SIGCPP = EvtPDL::getId( "Sigma_c++" );
+    static const EvtId SIGCMM = EvtPDL::getId( "anti-Sigma_c--" );
+    static const EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
+    static const EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
+    static const EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
+    static const EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
+    static const EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
+    static const EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
 
     EvtId parnum, barnum, lnum;
 
     parnum = getParentId();
     barnum = getDaug( 0 );
     lnum = getDaug( 1 );
 
     if ( parnum == LAMB || parnum == LAMBB ) {
         if ( barnum == LAMCP || barnum == LAMCM || barnum == LAMC1P ||
              barnum == LAMC1M || barnum == LAMC2P || barnum == LAMC2M ||
              barnum == SIGC0 || barnum == SIGC0B || barnum == SIGCP ||
              barnum == SIGCM || barnum == SIGCPP || barnum == SIGCMM ) {
             setProbMax( 22000.0 );
             return;
         }
     }
 
     //This is a real cludge.. (ryd)
     setProbMax( 0.0 );
 }
 
 void EvtBaryonPCR::init()
 {
     //if (getNArg()!=0) {
     if ( getNArg() != 4 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBaryonPCR generator expected "
             << " 4 arguments but found:" << getNArg() << endl;
         //<< " 0 arguments but found:"<<getNArg()<<endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     if ( getNDaug() != 3 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong number of daughters in EvtBaryonPCR.cc "
             << " 3 daughters expected but found: " << getNDaug() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
     EvtSpinType::spintype baryontype = EvtPDL::getSpinType( getDaug( 0 ) );
     EvtSpinType::spintype leptontype = EvtPDL::getSpinType( getDaug( 1 ) );
     EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
 
     if ( parenttype != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBaryonPCR generator expected "
             << " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     if ( leptontype != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBaryonPCR generator expected "
             << " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     if ( neutrinotype != EvtSpinType::NEUTRINO ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBaryonPCR generator expected "
             << " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     m_baryonpcrffmodel = std::make_unique<EvtBaryonPCRFF>();
 
     if ( baryontype == EvtSpinType::DIRAC ||
          baryontype == EvtSpinType::RARITASCHWINGER ) {
         m_calcamp = std::make_unique<EvtSemiLeptonicBaryonAmp>();
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong baryon spin type in EvtBaryonPCR.cc "
             << "Expected spin type " << EvtSpinType::DIRAC
             << ", found spin type " << baryontype << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
diff --git a/src/EvtGenModels/EvtBaryonPCRFF.cpp b/src/EvtGenModels/EvtBaryonPCRFF.cpp
index c643241..a3f606a 100644
--- a/src/EvtGenModels/EvtBaryonPCRFF.cpp
+++ b/src/EvtGenModels/EvtBaryonPCRFF.cpp
@@ -1,279 +1,279 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBaryonPCRFF.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <math.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
 void EvtBaryonPCRFF::getdiracff( EvtId parent, EvtId daught, double q2,
                                  double /* mass */, double* f1, double* f2,
                                  double* f3, double* g1, double* g2, double* g3 )
 {
     // Baryons (partial list 5/28/04)
-    static EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
-    static EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
-    static EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
-    static EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
+    static const EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
+    static const EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
+    static const EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
 
     double F1, F2, F3, G1, G2, G3;
 
     if ( parent == LAMB || parent == LAMBB ) {
         // Implement constituent quark model form factors predicted
         // by M. Pervin, W. Roberst, and S. Capstick, Phys. Rev. C72, 035201 (2005)
 
         if ( daught == LAMCP || daught == LAMCM ) {
             //  Parameters needed in the calculation;
             double mQ = 5.28;
             double mq = 1.89;
             double md = 0.40;
             double MLamB = EvtPDL::getMass( parent );
             double MLamC = EvtPDL::getMass( daught );
 
             double aL = 0.59;
             double aLp = 0.55;
 
             double aL2 = aL * aL;
             double aLp2 = aLp * aLp;
             double aLLp2 = 0.5 * ( aL2 + aLp2 );
 
             // relativistic correction factor
             double k2 = 1.0;
             double rho2 = 3. * md * md / ( 2. * k2 * aLLp2 );
 
             // w = scalar product of the 4 velocities of the Lb and Lc.
             double w = 0.5 * ( MLamB * MLamB + MLamC * MLamC - q2 ) / MLamB /
                        MLamC;
 
             double I = pow( aL * aLp / aLLp2, 1.5 ) *
                        exp( -rho2 * ( w * w - 1. ) );
 
             // Calculate the form factors
             F1 = I * ( 1.0 + ( md / aLLp2 ) * ( ( aLp2 / mq ) + ( aL2 / mQ ) ) );
             F2 = -I * ( ( md / mq ) * ( aLp2 / aLLp2 ) -
                         aL2 * aLp2 / ( 4. * aLLp2 * mq * mQ ) );
             F3 = -I * md * aL2 / ( mQ * aLLp2 );
 
             G1 = I * ( 1.0 - ( aL2 * aLp2 ) / ( 12. * aLLp2 * mq * mQ ) );
             G2 = -I * ( md * aLp2 / ( mq * aLLp2 ) +
                         ( aL2 * aLp2 ) / ( 12. * aLLp2 * mq * mQ ) *
                             ( 1. + 12. * md * md / aLLp2 ) );
             G3 = I * ( md * aL2 / ( mQ * aLLp2 ) +
                        md * md * aL2 * aLp2 / ( mq * mQ * aLLp2 * aLLp2 ) );
 
             // Set form factors to be passed to the amplitude calc.
             *f1 = F1;
             *f2 = F2;
             *f3 = F3;
             *g1 = G1;
             *g2 = G2;
             *g3 = G3;
 
         }
 
         else if ( daught == LAMC1P || daught == LAMC1M ) {
             double mQ = 5.28;
             double mq = 1.89;
             double md = 0.40;
             double MLamB = EvtPDL::getMass( parent );
             double MLamC = EvtPDL::getMass( daught );
 
             double aL = 0.59;
             double aLp = 0.47;
 
             double aL2 = aL * aL;
             double aLp2 = aLp * aLp;
             double aLLp2 = 0.5 * ( aL2 + aLp2 );
 
             // relativistic correction factor
             double k2 = 1.0;
             double rho2 = 3. * md * md / ( 2. * k2 * aLLp2 );
 
             // w = scalar product of the 4 velocities of the Lb and Lc.
             double w = 0.5 * ( MLamB * MLamB + MLamC * MLamC - q2 ) / MLamB /
                        MLamC;
 
             double I = pow( aL * aLp / aLLp2, 2.5 ) *
                        exp( -rho2 * ( w * w - 1. ) );
 
             // Calculate the form factors
             F1 = I * aL / 6.0 * ( 3.0 / mq - 1.0 / mQ );
             F2 = -I * ( 2.0 * md / aL - aL / ( 2.0 * mq ) +
                         2. * md * md * aL / ( mQ * aLLp2 ) -
                         ( md * aL / ( 6. * mq * mQ * aLLp2 ) ) *
                             ( 3. * aL2 - 2. * aLp2 ) );
             F3 = I * 2. * md * md * aL / ( mQ * aLLp2 );
 
             G1 = I * ( 2.0 * md / aL - aL / ( 6. * mQ ) +
                        ( md * aL / ( 6. * mq * mQ * aLLp2 ) ) *
                            ( 3. * aL2 - 2. * aLp2 ) );
             G2 = I * ( -2. * md / aL + aL / ( 2. * mq ) + aL / ( 3. * mQ ) );
             G3 = I * aL / ( 3. * mQ ) *
                  ( 1.0 - ( md / ( 2. * mq * aLLp2 ) ) * ( 3. * aL2 - 2. * aLp2 ) );
 
             // Set form factors to be passed to the amplitude calc.
             *f1 = F1;
             *f2 = F2;
             *f3 = F3;
             *g1 = G1;
             *g2 = G2;
             *g3 = G3;
         }
     }
 
     else {
         *f1 = 1.0;
         *f2 = 1.0;
         *f3 = 0.0;
         *g1 = 1.0;
         *g2 = 1.0;
         *g3 = 0.0;
     }
 
     return;
 }
 
 void EvtBaryonPCRFF::getraritaff( EvtId parent, EvtId daught, double q2,
                                   double /* mass */, double* f1, double* f2,
                                   double* f3, double* f4, double* g1,
                                   double* g2, double* g3, double* g4 )
 {
     // Baryons (partial list 5/28/04)
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
-    static EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
+    static const EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
 
     double F1, F2, F3, F4, G1, G2, G3, G4;
 
     if ( parent == LAMB || parent == LAMBB ) {
         // Implement constituent quark model form factors predicted
         // by M. Pervin, W. Roberst, and S. Capstick, Phys. Rev. C72, 035201 (2005)
 
         if ( daught == LAMC2P || daught == LAMC2M ) {
             double mQ = 5.28;
             double mq = 1.89;
             double md = 0.40;
             double MLamB = EvtPDL::getMass( parent );
             double MLamC = EvtPDL::getMass( daught );
 
             double aL = 0.59;
             double aLp = 0.47;
 
             double aL2 = aL * aL;
             double aLp2 = aLp * aLp;
             double aLLp2 = 0.5 * ( aL2 + aLp2 );
 
             // relativistic correction factor
             double k2 = 1.0;
             double rho2 = 3. * md * md / ( 2. * k2 * aLLp2 );
 
             // w = scalar product of the 4 velocities of the Lb and Lc.
             double w = 0.5 * ( MLamB * MLamB + MLamC * MLamC - q2 ) / MLamB /
                        MLamC;
 
             double I = -( 1. / sqrt( 3. ) ) * pow( aL * aLp / aLLp2, 2.5 ) *
                        exp( -rho2 * ( w * w - 1. ) );
 
             // Calculate the form factors
             F1 = I * 3.0 * md / aL *
                  ( 1.0 + ( md / aLLp2 ) * ( ( aLp2 / mq ) + ( aL2 / mQ ) ) );
             F2 = -I * ( ( 3. * md * md / mq ) * ( aLp2 / ( aLLp2 * aL2 ) ) -
                         5. * aL * aLp2 * md / ( 4. * aLLp2 * mq * mQ ) );
             F3 = -I * ( 3. * md * md * aL / ( mQ * aLLp2 ) + aL / ( 2. * mQ ) );
             F4 = I * aL / mQ;
 
             G1 = I * ( 3.0 * md / aL -
                        ( aL / ( 2. * mQ ) ) *
                            ( 1. + 3. * md * aLp2 / ( 2. * aLLp2 * mq ) ) );
             G2 = -I * ( ( 3. * md * md / mq ) * ( aLp2 / ( aLLp2 * aL ) ) +
                         aL * aLp2 * md / ( 4. * aLLp2 * aLLp2 * mq * mQ ) *
                             ( aLLp2 + 12. * md * md ) );
             G3 = I * aL / ( mQ * aLLp2 ) *
                  ( aLLp2 / 2. + 3. * md * md +
                    aLp2 * md / ( mq * aLLp2 ) * ( aLLp2 + 6. * md * md ) );
             G4 = -I * ( aL / mQ + md / ( mq * mQ ) * aLp2 * aL / aLLp2 );
 
             // Set form factors to be passed to the amplitude calc.
             *f1 = F1;
             *f2 = F2;
             *f3 = F3;
             *f4 = F4;
             *g1 = G1;
             *g2 = G2;
             *g3 = G3;
             *g4 = G4;
         }
     }
 
     else {
         *f1 = 1.0;
         *f2 = 1.0;
         *f3 = 0.0;
         *f4 = 0.0;
         *g1 = 1.0;
         *g2 = 1.0;
         *g3 = 0.0;
         *g4 = 0.0;
     }
 
     return;
 }
 
 void EvtBaryonPCRFF::getscalarff( EvtId, EvtId, double, double, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getscalarff in EvtBaryonPCRFF.\n";
     ::abort();
 }
 
 void EvtBaryonPCRFF::getvectorff( EvtId, EvtId, double, double, double*,
                                   double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getvectorff in EvtBaryonPCRFF.\n";
     ::abort();
 }
 
 void EvtBaryonPCRFF::gettensorff( EvtId, EvtId, double, double, double*,
                                   double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :gettensorff in EvtBaryonPCRFF.\n";
     ::abort();
 }
 
 void EvtBaryonPCRFF::getbaryonff( EvtId, EvtId, double, double, double*,
                                   double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getbaryonff in EvtBaryonPCRFF.\n";
     ::abort();
 }
diff --git a/src/EvtGenModels/EvtBcBsNPi.cpp b/src/EvtGenModels/EvtBcBsNPi.cpp
index 73f70cc..dd47c94 100644
--- a/src/EvtGenModels/EvtBcBsNPi.cpp
+++ b/src/EvtGenModels/EvtBcBsNPi.cpp
@@ -1,75 +1,75 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcBsNPi.hh"
 
 #include "EvtGenBase/EvtSpinType.hh"
 
 EvtBcBsNPi::EvtBcBsNPi()
 {
     m_beta = -0.108;
     m_mRho = 0.775;
     m_gammaRho = 0.149;
     m_mRhopr = 1.364;
     m_gammaRhopr = 0.400;
     m_mA1 = 1.23;
     m_gammaA1 = 0.4;
     //		Fp_N=1.3; Fp_c1=0.30; Fp_c2=0.069;
     m_Fp_N = 3 * 1.3;
     m_Fp_c1 = 0.30;
     m_Fp_c2 = 0.069;
     m_Fm_N = 0.0;
     m_Fm_c1 = 0.0;
     m_Fm_c2 = 0.0;
 }
 
-std::string EvtBcBsNPi::getName()
+std::string EvtBcBsNPi::getName() const
 {
     return "BC_BS_NPI";
 }
 
-EvtBcBsNPi* EvtBcBsNPi::clone()
+EvtBcBsNPi* EvtBcBsNPi::clone() const
 {
     return new EvtBcBsNPi;
 }
 
 void EvtBcBsNPi::init()
 {
     checkNArg( 0 );
 
     // check spins
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     // the others are scalar
     for ( int i = 1; i <= ( getNDaug() - 1 ); i++ ) {
         checkSpinDaughter( i, EvtSpinType::SCALAR );
     }
 }
 
 void EvtBcBsNPi::initProbMax()
 {
     if ( getNDaug() == 2 ) {
         setProbMax( 250. );
     } else if ( getNDaug() == 3 ) {
         setProbMax( 25000. );    // checked at 30k events
     } else if ( getNDaug() == 4 ) {
         setProbMax( 45000. );    // checked at 30k events
     }
 }
diff --git a/src/EvtGenModels/EvtBcBsStarNPi.cpp b/src/EvtGenModels/EvtBcBsStarNPi.cpp
index feaf318..72843d2 100644
--- a/src/EvtGenModels/EvtBcBsStarNPi.cpp
+++ b/src/EvtGenModels/EvtBcBsStarNPi.cpp
@@ -1,81 +1,81 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcBsStarNPi.hh"
 
 #include "EvtGenBase/EvtSpinType.hh"
 
 EvtBcBsStarNPi::EvtBcBsStarNPi()
 {
     m_beta = -0.108;
     m_mRho = 0.775;
     m_gammaRho = 0.149;
     m_mRhopr = 1.364;
     m_gammaRhopr = 0.400;
     m_mA1 = 1.23;
     m_gammaA1 = 0.4;
 
     m_FA0_N = 8.1;
     m_FA0_c1 = 0.30;
     m_FA0_c2 = 0.069;
     m_FAm_N = 0.0;
     m_FAm_c1 = 0.0;
     m_FAm_c2 = 0.0;
     m_FAp_N = 0.15;
     m_FAp_c1 = 0.30;
     m_FAp_c2 = 0.069;
     m_FV_N = 1.08;
     m_FV_c1 = 0.30;
     m_FV_c2 = 0.069;
 }
 
-std::string EvtBcBsStarNPi::getName()
+std::string EvtBcBsStarNPi::getName() const
 {
     return "BC_BSSTAR_NPI";
 }
 
-EvtBcBsStarNPi* EvtBcBsStarNPi::clone()
+EvtBcBsStarNPi* EvtBcBsStarNPi::clone() const
 {
     return new EvtBcBsStarNPi;
 }
 
 void EvtBcBsStarNPi::init()
 {
     checkNArg( 0 );
 
     // check spins
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     // the others are scalar
     for ( int i = 1; i <= ( getNDaug() - 1 ); i++ ) {
         checkSpinDaughter( i, EvtSpinType::SCALAR );
     }
 }
 
 void EvtBcBsStarNPi::initProbMax()
 {
     if ( getNDaug() == 2 ) {
         setProbMax( 100. );
     } else if ( getNDaug() == 3 ) {
         setProbMax( 40000. );
     } else if ( getNDaug() == 4 ) {
         setProbMax( 620. );    // checked, 30k events
     }
 }
diff --git a/src/EvtGenModels/EvtBcPsiNPi.cpp b/src/EvtGenModels/EvtBcPsiNPi.cpp
index 2a28a76..c1fb5b6 100644
--- a/src/EvtGenModels/EvtBcPsiNPi.cpp
+++ b/src/EvtGenModels/EvtBcPsiNPi.cpp
@@ -1,82 +1,82 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcPsiNPi.hh"
 
 #include "EvtGenBase/EvtSpinType.hh"
 
 EvtBcPsiNPi::EvtBcPsiNPi()
 {
     m_beta = -0.108;
     m_mRho = 0.775;
     m_gammaRho = 0.149;
     m_mRhopr = 1.364;
     m_gammaRhopr = 0.400;
     m_mA1 = 1.23;
     m_gammaA1 = 0.4;
 
     m_FA0_N = 5.9;
     m_FA0_c1 = 0.049;
     m_FA0_c2 = 0.0015;
     m_FAm_N = 0.0;
     m_FAm_c1 = 0.0;
     m_FAm_c2 = 0.0;
     m_FAp_N = -0.074;
     m_FAp_c1 = 0.049;
     m_FAp_c2 = 0.0015;
     m_FV_N = 0.11;
     m_FV_c1 = 0.049;
     m_FV_c2 = 0.0015;
 }
 
-std::string EvtBcPsiNPi::getName()
+std::string EvtBcPsiNPi::getName() const
 {
     return "BC_PSI_NPI";
 }
 
-EvtBcPsiNPi* EvtBcPsiNPi::clone()
+EvtBcPsiNPi* EvtBcPsiNPi::clone() const
 {
     return new EvtBcPsiNPi;
 }
 
 void EvtBcPsiNPi::init()
 {
     checkNArg( 0 );
 
     // check spins
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     // the others are scalar
     for ( int i = 1; i <= ( getNDaug() - 1 ); i++ ) {
         checkSpinDaughter( i, EvtSpinType::SCALAR );
     }
 }
 
 void EvtBcPsiNPi::initProbMax()
 {
     setProbMax( 100. );
     if ( getNDaug() == 2 ) {
         setProbMax( 330. );
     } else if ( getNDaug() == 3 ) {
         setProbMax( 11000. );    // checked with 30k events
     } else if ( getNDaug() == 4 ) {
         setProbMax( 36000. );
     }
 }
diff --git a/src/EvtGenModels/EvtBcSMuNu.cpp b/src/EvtGenModels/EvtBcSMuNu.cpp
index 0ed9467..3c57608 100644
--- a/src/EvtGenModels/EvtBcSMuNu.cpp
+++ b/src/EvtGenModels/EvtBcSMuNu.cpp
@@ -1,92 +1,92 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcSMuNu.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 
 #include "EvtGenModels/EvtBCSFF.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 
-std::string EvtBcSMuNu::getName()
+std::string EvtBcSMuNu::getName() const
 {
     return "BC_SMN";
 }
 
-EvtDecayBase* EvtBcSMuNu::clone()
+EvtDecayBase* EvtBcSMuNu::clone() const
 {
     return new EvtBcSMuNu;
 }
 
 void EvtBcSMuNu::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_ffmodel.get() );
 }
 
 void EvtBcSMuNu::init()
 {
     checkNArg( 1 );
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     m_idScalar = getDaug( 0 ).getId();
     m_whichfit = int( getArg( 0 ) + 0.1 );
 
     m_ffmodel = std::make_unique<EvtBCSFF>( m_idScalar, m_whichfit );
 
     m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
 }
 
 void EvtBcSMuNu::initProbMax()
 {
     EvtId parId = getParentId();
     EvtId mesonId = getDaug( 0 );
     EvtId lepId = getDaug( 1 );
     EvtId nuId = getDaug( 2 );
 
     int nQ2Bins = 200;
     double maxProb = m_calcamp->CalcMaxProb( parId, mesonId, lepId, nuId,
                                              m_ffmodel.get(), nQ2Bins );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtBcSMuNu" )
             << "Max prob = " << maxProb << endl;
     }
 
     setProbMax( maxProb );
 }
diff --git a/src/EvtGenModels/EvtBcTMuNu.cpp b/src/EvtGenModels/EvtBcTMuNu.cpp
index 7942671..35d3b8a 100644
--- a/src/EvtGenModels/EvtBcTMuNu.cpp
+++ b/src/EvtGenModels/EvtBcTMuNu.cpp
@@ -1,92 +1,92 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcTMuNu.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicTensorAmp.hh"
 
 #include "EvtGenModels/EvtBCTFF.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 
-std::string EvtBcTMuNu::getName()
+std::string EvtBcTMuNu::getName() const
 {
     return "BC_TMN";
 }
 
-EvtDecayBase* EvtBcTMuNu::clone()
+EvtDecayBase* EvtBcTMuNu::clone() const
 {
     return new EvtBcTMuNu;
 }
 
 void EvtBcTMuNu::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_ffmodel.get() );
 }
 
 void EvtBcTMuNu::init()
 {
     checkNArg( 1 );
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::TENSOR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     m_idTensor = getDaug( 0 ).getId();
     m_whichfit = int( getArg( 0 ) + 0.1 );
 
     m_ffmodel = std::make_unique<EvtBCTFF>( m_idTensor, m_whichfit );
 
     m_calcamp = std::make_unique<EvtSemiLeptonicTensorAmp>();
 }
 
 void EvtBcTMuNu::initProbMax()
 {
     EvtId parId = getParentId();
     EvtId mesonId = getDaug( 0 );
     EvtId lepId = getDaug( 1 );
     EvtId nuId = getDaug( 2 );
 
     int nQ2Bins = 200;
     double maxProb = m_calcamp->CalcMaxProb( parId, mesonId, lepId, nuId,
                                              m_ffmodel.get(), nQ2Bins );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtBcTMuNu" )
             << "Max prob = " << maxProb << endl;
     }
 
     setProbMax( maxProb );
 }
diff --git a/src/EvtGenModels/EvtBcToNPi.cpp b/src/EvtGenModels/EvtBcToNPi.cpp
index 2b90f78..12fe565 100644
--- a/src/EvtGenModels/EvtBcToNPi.cpp
+++ b/src/EvtGenModels/EvtBcToNPi.cpp
@@ -1,378 +1,378 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcToNPi.hh"
 
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtScalarParticle.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 using std::endl;
 
 EvtBcToNPi::EvtBcToNPi( bool printAuthorInfo )
 {
     m_nCall = 0;
     m_maxAmp2 = 0;
     if ( printAuthorInfo == true ) {
         this->printAuthorInfo();
     }
 }
 
-std::string EvtBcToNPi::getName()
+std::string EvtBcToNPi::getName() const
 {
     return "EvtBcToNPi";
 }
 
-EvtDecayBase* EvtBcToNPi::clone()
+EvtDecayBase* EvtBcToNPi::clone() const
 {
     return new EvtBcToNPi;
 }
 
 void EvtBcToNPi::init()
 {
     // check spins
     checkSpinParent( EvtSpinType::SCALAR );
 
     // the others are scalar
     for ( int i = 1; i <= ( getNDaug() - 1 ); i++ ) {
         checkSpinDaughter( i, EvtSpinType::SCALAR );
     };
 
     m_beta = -0.108;
     m_mRho = 0.775;
     m_gammaRho = 0.149;
     m_mRhopr = 1.364;
     m_gammaRhopr = 0.400;
     m_mA1 = 1.23;
     m_gammaA1 = 0.4;
 
     // read arguments
     if ( EvtPDL::getSpinType( getDaug( 0 ) ) == EvtSpinType::VECTOR ) {
         checkNArg( 10 );
         int n = 0;
         m_maxProb = getArg( n++ );
         m_FA0_N = getArg( n++ );
         m_FA0_c1 = getArg( n++ );
         m_FA0_c2 = getArg( n++ );
         m_FAp_N = getArg( n++ );
         m_FAp_c1 = getArg( n++ );
         m_FAp_c2 = getArg( n++ );
         m_FV_N = getArg( n++ );
         m_FV_c1 = getArg( n++ );
         m_FV_c2 = getArg( n++ );
         m_FAm_N = 0;
         m_FAm_c1 = 0;
         m_FAm_c2 = 0;
     } else if ( EvtPDL::getSpinType( getDaug( 0 ) ) == EvtSpinType::SCALAR ) {
         checkNArg( 4 );
         int n = 0;
         m_maxProb = getArg( n++ );
         m_Fp_N = getArg( n++ );
         m_Fp_c1 = getArg( n++ );
         m_Fp_c2 = getArg( n++ );
         m_Fm_N = 0;
         m_Fm_c1 = 0;
         m_Fm_c2 = 0;
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Have not yet implemented this final state in BCPSINPI model"
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
         for ( int id = 0; id < ( getNDaug() - 1 ); id++ )
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
                 << endl;
         return;
     };
 
     if ( getNDaug() < 2 || getNDaug() > 4 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Have not yet implemented this final state in BCPSINPI model"
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
         for ( int id = 0; id < ( getNDaug() - 1 ); id++ )
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
                 << endl;
         return;
     }
 }
 
 double EvtBcToNPi::energy1( double M, double m1, double m2 )
 {
     return ( M * M + m1 * m1 - m2 * m2 ) / ( 2 * M );
 }
 
 double EvtBcToNPi::mom1( double M, double m1, double m2 )
 {
     double e1 = energy1( M, m1, m2 );
     return sqrt( e1 * e1 - m1 * m1 );
 }
 
 void EvtBcToNPi::initProbMax()
 {
     if ( m_maxProb > 0. )
         setProbMax( m_maxProb );
     else {
         EvtId id = getParentId();
         EvtScalarParticle* p = new EvtScalarParticle();
         p->init( id, EvtPDL::getMass( id ), 0., 0., 0. );
         p->setDiagonalSpinDensity();
         // add daughters
         p->makeDaughters( getNDaug(), getDaugs() );
 
         // fill the momenta
         if ( getNDaug() == 2 ) {
             double M = EvtPDL::getMass( id ),
                    m1 = EvtPDL::getMass( getDaug( 0 ) ),
                    m2 = EvtPDL::getMass( getDaug( 1 ) );
             double p1 = mom1( M, m1, m2 );
             p->getDaug( 0 )->setP4(
                 EvtVector4R( energy1( M, m1, m2 ), 0., 0., p1 ) );
             p->getDaug( 1 )->setP4(
                 EvtVector4R( energy1( M, m2, m1 ), 0., 0., -p1 ) );
         } else if ( getNDaug() == 3 ) {
             double M = EvtPDL::getMass( id ),
                    m1 = EvtPDL::getMass( getDaug( 0 ) ),
                    m2 = EvtPDL::getMass( getDaug( 1 ) ),
                    m3 = EvtPDL::getMass( getDaug( 2 ) );
             double pRho = mom1( M, m1, m_mRho ), pPi = mom1( m_mRho, m2, m3 );
             p->getDaug( 0 )->setP4(
                 EvtVector4R( energy1( M, m1, m_mRho ), 0., 0., pRho ) );
             EvtVector4R p4Rho( energy1( M, m_mRho, m1 ), 0., 0., -pRho );
             EvtVector4R p4_2( energy1( m_mRho, m2, m3 ), 0., 0., pPi );
             p4_2.applyBoostTo( p4Rho );
             EvtVector4R p4_3( energy1( m_mRho, m2, m3 ), 0., 0., -pPi );
             p4_3.applyBoostTo( p4Rho );
             p->getDaug( 1 )->setP4( p4_2 );
             p->getDaug( 2 )->setP4( p4_3 );
 
         } else if ( getNDaug() == 4 ) {
             double M = EvtPDL::getMass( id ),
                    m1 = EvtPDL::getMass( getDaug( 0 ) ),
                    m2 = EvtPDL::getMass( getDaug( 1 ) ),
                    m3 = EvtPDL::getMass( getDaug( 2 ) ),
                    m4 = EvtPDL::getMass( getDaug( 3 ) );
             if ( M < m1 + m_mA1 )
                 return;
             double pA1 = mom1( M, m1, m_mA1 ), pRho = mom1( m_mA1, m_mRho, m4 ),
                    pPi = mom1( m_mRho, m2, m3 );
             p->getDaug( 0 )->setP4(
                 EvtVector4R( energy1( M, m1, m_mRho ), 0., 0., pA1 ) );
             EvtVector4R p4A1( energy1( M, m_mA1, m1 ), 0., 0., -pA1 );
             EvtVector4R p4Rho( energy1( m_mA1, m_mRho, m4 ), 0, 0, pRho );
             p4Rho.applyBoostTo( p4A1 );
             EvtVector4R p4_4( energy1( m_mA1, m4, m_mRho ), 0, 0, -pRho );
             p4_4.applyBoostTo( p4A1 );
             p->getDaug( 3 )->setP4( p4_4 );
             EvtVector4R p4_2( energy1( m_mRho, m2, m3 ), 0, 0, pPi );
             p4_2.applyBoostTo( p4Rho );
             p->getDaug( 1 )->setP4( p4_2 );
             EvtVector4R p4_3( energy1( m_mRho, m2, m3 ), 0, 0, -pPi );
             p4_2.applyBoostTo( p4Rho );
             p->getDaug( 2 )->setP4( p4_3 );
         };
 
         m_amp2.init( p->getId(), getNDaug(), getDaugs() );
 
         decay( p );
 
         EvtSpinDensity rho = m_amp2.getSpinDensity();
 
         double prob = p->getSpinDensityForward().normalizedProb( rho );
 
         if ( prob > 0 )
             setProbMax( 0.9 * prob );
     };
 }
 
 void EvtBcToNPi::decay( EvtParticle* root_particle )
 {
     ++m_nCall;
 
     EvtIdSet thePis{ "pi+", "pi-", "pi0" };
     EvtComplex I = EvtComplex( 0.0, 1.0 );
 
     root_particle->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtVector4R p( root_particle->mass(), 0., 0., 0. ),    // Bc momentum
         k = root_particle->getDaug( 0 )->getP4(),          // J/psi momenta
         Q = p - k;
 
     double Q2 = Q.mass2();
 
     // check pi-mesons and calculate hadronic current
     EvtVector4C hardCur;
     bool foundHadCurr = false;
 
     if ( getNDaug() == 2 )    // Bc -> psi pi+
     {
         hardCur = Q;
         foundHadCurr = true;
     } else if ( getNDaug() == 3 )    // Bc -> psi pi+ pi0
     {
         EvtVector4R p1, p2;
         p1 = root_particle->getDaug( 1 )->getP4(),        // pi+ momenta
             p2 = root_particle->getDaug( 2 )->getP4(),    // pi0 momentum
             hardCur = Fpi( p1, p2 ) * ( p1 - p2 );
         foundHadCurr = true;
     } else if ( getNDaug() == 4 )    // Bc -> psi pi+ pi pi
     {
         int diffPi( 0 ), samePi1( 0 ), samePi2( 0 );
         if ( getDaug( 1 ) == getDaug( 2 ) ) {
             diffPi = 3;
             samePi1 = 1;
             samePi2 = 2;
         }
         if ( getDaug( 1 ) == getDaug( 3 ) ) {
             diffPi = 2;
             samePi1 = 1;
             samePi2 = 3;
         }
         if ( getDaug( 2 ) == getDaug( 3 ) ) {
             diffPi = 1;
             samePi1 = 2;
             samePi2 = 3;
         }
 
         EvtVector4R p1 = root_particle->getDaug( samePi1 )->getP4();
         EvtVector4R p2 = root_particle->getDaug( samePi2 )->getP4();
         EvtVector4R p3 = root_particle->getDaug( diffPi )->getP4();
 
         EvtComplex BA1;
         double GA1 = m_gammaA1 * pi3G( Q2, samePi1 ) /
                      pi3G( m_mA1 * m_mA1, samePi1 );
         EvtComplex denBA1( m_mA1 * m_mA1 - Q.mass2(), -1. * m_mA1 * GA1 );
         BA1 = m_mA1 * m_mA1 / denBA1;
 
         hardCur = BA1 * ( ( p1 - p3 ) -
                           ( Q * ( Q * ( p1 - p3 ) ) / Q2 ) * Fpi( p2, p3 ) +
                           ( p2 - p3 ) -
                           ( Q * ( Q * ( p2 - p3 ) ) / Q2 ) * Fpi( p1, p3 ) );
         foundHadCurr = true;
     }
 
     if ( !foundHadCurr ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Have not yet implemented this final state in BCNPI model"
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
         int id;
         for ( id = 0; id < ( getNDaug() - 1 ); id++ )
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
                 << endl;
         ::abort();
     };
 
     double amp2 = 0.;
     if ( root_particle->getDaug( 0 )->getSpinType() == EvtSpinType::VECTOR ) {
         EvtTensor4C H;
         double FA0 = m_FA0_N * exp( m_FA0_c1 * Q2 + m_FA0_c2 * Q2 * Q2 );
         double FAp = m_FAp_N * exp( m_FAp_c1 * Q2 + m_FAp_c2 * Q2 * Q2 );
         double FAm = m_FAm_N * exp( m_FAm_c1 * Q2 + m_FAm_c2 * Q2 * Q2 );
         double FV = m_FV_N * exp( m_FV_c1 * Q2 + m_FV_c2 * Q2 * Q2 );
         H = -FA0 * EvtTensor4C::g() -
             FAp * EvtGenFunctions::directProd( p, p + k ) +
             FAm * EvtGenFunctions::directProd( p, p - k ) +
             2 * I * FV * dual( EvtGenFunctions::directProd( p, k ) );
         EvtVector4C Heps = H.cont2( hardCur );
 
         for ( int i = 0; i < 3; i++ ) {
             EvtVector4C eps = root_particle->getDaug( 0 )
                                   ->epsParent( i )
                                   .conj();    // psi-meson polarization vector
             EvtComplex amp = eps * Heps;
             vertex( i, amp );
             amp2 += pow( abs( amp ), 2 );
         }
     } else if ( root_particle->getDaug( 0 )->getSpinType() ==
                 EvtSpinType::SCALAR ) {
         double Fp = m_Fp_N * exp( m_Fp_c1 * Q2 + m_Fp_c2 * Q2 * Q2 );
         double Fm = m_Fm_N * exp( m_Fm_c1 * Q2 + m_Fm_c2 * Q2 * Q2 );
         EvtVector4C H = Fp * ( p + k ) + Fm * ( p - k );
         EvtComplex amp = H * hardCur;
         vertex( amp );
         amp2 += pow( abs( amp ), 2 );
     };
     if ( amp2 > m_maxAmp2 )
         m_maxAmp2 = amp2;
 
     return;
 }
 
 EvtComplex EvtBcToNPi::Fpi( EvtVector4R q1, EvtVector4R q2 )
 {
     double m1 = q1.mass();
     double m2 = q2.mass();
 
     EvtVector4R Q = q1 + q2;
     double mQ2 = Q * Q;
 
     // momenta in the rho->pipi decay
     double dRho = m_mRho * m_mRho - m1 * m1 - m2 * m2;
     double pPiRho = ( 1.0 / m_mRho ) *
                     sqrt( ( dRho * dRho ) / 4.0 - m1 * m1 * m2 * m2 );
 
     double dRhopr = m_mRhopr * m_mRhopr - m1 * m1 - m2 * m2;
     double pPiRhopr = ( 1.0 / m_mRhopr ) *
                       sqrt( ( dRhopr * dRhopr ) / 4.0 - m1 * m1 * m2 * m2 );
 
     double dQ = mQ2 - m1 * m1 - m2 * m2;
     double pPiQ = ( 1.0 / sqrt( mQ2 ) ) *
                   sqrt( ( dQ * dQ ) / 4.0 - m1 * m1 * m2 * m2 );
 
     double gammaRho = m_gammaRho * m_mRho / sqrt( mQ2 ) *
                       pow( ( pPiQ / pPiRho ), 3 );
     EvtComplex BRhoDem( m_mRho * m_mRho - mQ2, -1.0 * m_mRho * gammaRho );
     EvtComplex BRho = m_mRho * m_mRho / BRhoDem;
 
     double gammaRhopr = m_gammaRhopr * m_mRhopr / sqrt( mQ2 ) *
                         pow( ( pPiQ / pPiRhopr ), 3 );
     EvtComplex BRhoprDem( m_mRhopr * m_mRhopr - mQ2, -1.0 * m_mRho * gammaRhopr );
     EvtComplex BRhopr = m_mRhopr * m_mRhopr / BRhoprDem;
 
     return ( BRho + m_beta * BRhopr ) / ( 1 + m_beta );
 }
 
 double EvtBcToNPi::pi3G( double m2, int dupD )
 {
     double mPi = EvtPDL::getMeanMass( getDaug( dupD ) );
     if ( m2 > ( m_mRho + mPi ) ) {
         return m2 * ( 1.623 + 10.38 / m2 - 9.32 / ( m2 * m2 ) +
                       0.65 / ( m2 * m2 * m2 ) );
     } else {
         double t1 = m2 - 9.0 * mPi * mPi;
         return 4.1 * pow( t1, 3.0 ) * ( 1.0 - 3.3 * t1 + 5.8 * t1 * t1 );
     }
 }
 
 void EvtBcToNPi::printAuthorInfo()
 {
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "Defining EvtBcToNPi model: Bc -> V + npi and Bc -> P + npi decays\n"
         << "from A.V. Berezhnoy, A.K. Likhoded, A.V. Luchinsky: "
         << "Phys.Rev.D 82, 014012 (2010) and arXiV:1104.0808." << endl;
 }
diff --git a/src/EvtGenModels/EvtBcVHad.cpp b/src/EvtGenModels/EvtBcVHad.cpp
index 36e6df8..c0b6e35 100644
--- a/src/EvtGenModels/EvtBcVHad.cpp
+++ b/src/EvtGenModels/EvtBcVHad.cpp
@@ -1,436 +1,436 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcVHad.hh"
 
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtBCVFF2.hh"
 #include "EvtGenModels/EvtWHad.hh"
 
 #include <iostream>
 
-std::string EvtBcVHad::getName()
+std::string EvtBcVHad::getName() const
 {
     return "BC_VHAD";
 }
 
-EvtDecayBase* EvtBcVHad::clone()
+EvtDecayBase* EvtBcVHad::clone() const
 {
     return new EvtBcVHad;
 }
 
 //======================================================
 
 void EvtBcVHad::init()
 {
     // The following decay m_outCodes are supported:
     // 1:  B_c+ -> V pi+
     // 2:  B_c+ -> V pi+ pi0
     // 3:  B_c+ -> V 2pi+ pi-
     // 4:  B_c+ -> V 2pi+ pi- pi0 (not implemented)
     // 5:  B_c+ -> V 3pi+ 2pi-
     // 6:  B_c+ -> V K+ K- pi+
     // 7:  B_c+ -> V K+ pi+ pi-
     // 8:  B_c+ -> V K_S0 K+
     // 9:  B_c+ -> V K+ K- 2pi+ pi-
     // 10: B_c+ -> V 4pi+ 3pi-
     // 11: B_c+ -> V K+ 2pi+ 2pi-
 
     checkNArg( 1 );
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     for ( int i = 1; i <= ( getNDaug() - 1 ); i++ ) {
         checkSpinDaughter( i, EvtSpinType::SCALAR );
     }
 
     m_idVector = getDaug( 0 ).getId();
     m_whichFit = int( getArg( 0 ) + 0.1 );
     m_FFModel = std::make_unique<EvtBCVFF2>( m_idVector, m_whichFit );
 
     m_WCurr = std::make_unique<EvtWHad>();
 
     // Determine the code of the final hadronic state
     parseDecay();
 }
 
 //======================================================
 
 void EvtBcVHad::parseDecay()
 {
     const EvtIdSet BcPlusID{ "B_c+" }, BcMinusID{ "B_c-" };
     const EvtIdSet theK{ "K+", "K-", "K_S0" };
     const int cMode = BcMinusID.contains( getParentId() );
 
     const EvtIdSet PiPlusID{ cMode == 0 ? "pi+" : "pi-" };
     const EvtIdSet PiMinusID{ cMode == 0 ? "pi-" : "pi+" };
     const EvtIdSet PiZeroID{ "pi0" };
     const EvtIdSet KPlusID{ cMode == 0 ? "K+" : "K-" };
     const EvtIdSet KMinusID{ cMode == 0 ? "K-" : "K+" };
     EvtGenReport( EVTGEN_INFO, "EvtBcVHad" )
         << "parentId = " << getParentId() << std::endl;
 
     int PiPlusFound = 0, PiMinusFound = 0, PiZeroFound = 0, KPlusFound = 0,
         KMinusFound = 0;
     for ( int iDaughter = 0; iDaughter < getNDaug(); ++iDaughter ) {
         const EvtId daugId = getDaug( iDaughter );
         EvtGenReport( EVTGEN_INFO, "EvtBcVHad" )
             << "iDaughter = " << iDaughter
             << " id = " << getDaug( iDaughter ).getName() << std::endl;
         if ( PiPlusID.contains( daugId ) && PiPlusFound < 4 ) {
             m_iPiPlus[PiPlusFound] = iDaughter;
             PiPlusFound++;
         } else if ( PiMinusID.contains( daugId ) && PiMinusFound < 4 ) {
             m_iPiMinus[PiMinusFound] = iDaughter;
             PiMinusFound++;
         } else if ( PiZeroID.contains( daugId ) && PiZeroFound < 4 ) {
             m_iPiZero[PiZeroFound] = iDaughter;
             PiZeroFound++;
         } else if ( KPlusID.contains( daugId ) && KPlusFound < 4 ) {
             m_iKPlus[KPlusFound] = iDaughter;
             KPlusFound++;
         } else if ( KMinusID.contains( daugId ) && KMinusFound < 4 ) {
             m_iKMinus[KMinusFound] = iDaughter;
             KMinusFound++;
         }
     }
 
     if ( getNDaug() == 2 && PiPlusFound == 1 ) {
         m_outCode = 1;    // pi+
     } else if ( getNDaug() == 3 && PiPlusFound == 1 && PiZeroFound == 1 ) {
         m_outCode = 2;    // pi+ pi0
     } else if ( getNDaug() == 4 && PiPlusFound == 2 && PiMinusFound == 1 ) {
         m_outCode = 3;    // pi+ pi+ pi-
     } else if ( getNDaug() == 5 && PiPlusFound == 2 && PiMinusFound == 1 &&
                 PiZeroFound == 1 ) {
         m_outCode = 4;    // pi+ pi+ pi- pi0
     } else if ( getNDaug() == 6 && PiPlusFound == 3 && PiMinusFound == 2 ) {
         m_outCode = 5;    // 5pi
     } else if ( getNDaug() == 4 && KPlusFound == 1 && KMinusFound == 1 &&
                 PiPlusFound == 1 ) {
         m_outCode = 6;    // KKpi
     } else if ( getNDaug() == 4 && KPlusFound == 1 && PiPlusFound == 1 &&
                 PiMinusFound == 1 ) {
         m_outCode = 7;    // K+ pi+ pi-
     } else if ( getNDaug() == 3 && theK.contains( getDaug( 1 ) ) &&
                 theK.contains( getDaug( 2 ) ) ) {
         m_outCode = 8;    // KK
     } else if ( getNDaug() == 6 && KPlusFound == 1 && KMinusFound == 1 &&
                 PiPlusFound == 2 && PiMinusFound == 1 ) {
         m_outCode = 9;    // K+ K- pi+ pi+ pi-
     } else if ( getNDaug() == 8 && PiPlusFound == 4 && PiMinusFound == 3 ) {
         m_outCode = 10;    // 7pi
     } else if ( getNDaug() == 6 && KPlusFound == 1 && PiPlusFound == 2 &&
                 PiMinusFound == 2 ) {
         m_outCode = 11;    // K+ pi+ pi+ pi- pi-
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtBcVHad" )
             << "Init: unknown decay" << std::endl;
     }
 
     EvtGenReport( EVTGEN_INFO, "EvtBcVHad" )
         << "m_outCode = " << m_outCode << ", m_whichFit = " << m_whichFit
         << std::endl;
     for ( int i = 0; i < 4; ++i ) {
         EvtGenReport( EVTGEN_INFO, "EvtBcVHad" )
             << " i = " << i << ", m_iPiPlus = " << m_iPiPlus[i]
             << ", m_iPiMinus = " << m_iPiMinus[i]
             << ", m_iPiZero = " << m_iPiZero[i] << ", m_iKPlus = " << m_iKPlus[i]
             << ", m_iKMinus = " << m_iKMinus[i] << std::endl;
     }
     EvtGenReport( EVTGEN_INFO, "EvtBcVHad" )
         << "PiPlusFound = " << PiPlusFound << ", PiMinusFound = " << PiMinusFound
         << ", PiZeroFound = " << PiZeroFound << ", KPlusFound = " << KPlusFound
         << ", KMinusFound = " << KMinusFound << std::endl;
 }
 
 //======================================================
 
 void EvtBcVHad::initProbMax()
 {
     if ( m_outCode == 1 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
              m_whichFit == 1 && getNDaug() == 2 )
             setProbMax( 500. );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 && getNDaug() == 2 )
             setProbMax( 300. );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 && getNDaug() == 2 )
             setProbMax( 17. );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 && getNDaug() == 2 )
             setProbMax( 40. );
     } else if ( m_outCode == 2 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
              m_whichFit == 1 && getNDaug() == 3 )
             setProbMax( 10950. );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 && getNDaug() == 3 )
             setProbMax( 4200. );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 && getNDaug() == 3 )
             setProbMax( 500. );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 && getNDaug() == 3 )
             setProbMax( 700. );
     } else if ( m_outCode == 3 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
              m_whichFit == 1 && getNDaug() == 4 )
             setProbMax( 42000. );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 && getNDaug() == 4 )
             setProbMax( 90000. );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 && getNDaug() == 4 )
             setProbMax( 1660. );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 && getNDaug() == 4 )
             setProbMax( 2600. );
     } else if ( m_outCode == 5 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
              m_whichFit == 1 && getNDaug() == 6 )
             setProbMax( 720000. );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 && getNDaug() == 6 )
             setProbMax( 519753. );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 && getNDaug() == 6 )
             setProbMax( 40000. );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 && getNDaug() == 6 )
             setProbMax( 30000. );
     } else if ( m_outCode == 6 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() && m_whichFit == 1 )
             setProbMax( 50000. );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 22000.0 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 )
             setProbMax( 2300.0 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 1700.00 );
     } else if ( m_outCode == 7 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() && m_whichFit == 1 )
             setProbMax( 2.2e+06 );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 930000 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 )
             setProbMax( 92000.0 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 93000.0 );
     } else if ( m_outCode == 8 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() && m_whichFit == 1 )
             setProbMax( 2e2 );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 80 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 )
             setProbMax( 10 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 10 );
     } else if ( m_outCode == 9 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() && m_whichFit == 1 )
             setProbMax( 3e4 );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 18540 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 )
             setProbMax( 0.15 * 1e4 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 2 * 500 );
     } else if ( m_outCode == 10 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() && m_whichFit == 1 )
             setProbMax( 2e6 );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 5e6 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 )
             setProbMax( 1.5e5 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 1e5 );
     } else if ( m_outCode == 11 ) {
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() && m_whichFit == 1 )
             setProbMax( 2.5e8 );
         else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 1.4e7 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 1 )
             setProbMax( 2e6 );
         else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
                   m_whichFit == 2 )
             setProbMax( 8e4 );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtBcHad" )
             << "probmax: Have not yet implemented this final state in BC_VHAD model, m_outCode = "
             << m_outCode << std::endl;
         for ( int id = 0; id < ( getNDaug() - 1 ); id++ ) {
             EvtGenReport( EVTGEN_ERROR, "EvtBcVHad" )
                 << "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
                 << std::endl;
         }
     }
 }
 
 //======================================================
 
 EvtVector4C EvtBcVHad::hardCurr( EvtParticle* parent ) const
 {
     EvtVector4C hardCur;
 
     if ( m_outCode == 1 ) {
         // pi+
         hardCur = m_WCurr->WCurrent( parent->getDaug( m_iPiPlus[0] )->getP4() );
 
     } else if ( m_outCode == 2 ) {
         // pi+ pi0
         hardCur = m_WCurr->WCurrent( parent->getDaug( m_iPiPlus[0] )->getP4(),
                                      parent->getDaug( m_iPiZero[0] )->getP4() );
 
     } else if ( m_outCode == 3 ) {
         // pi+ pi+ pi-
         hardCur = m_WCurr->WCurrent( parent->getDaug( m_iPiPlus[0] )->getP4(),
                                      parent->getDaug( m_iPiPlus[1] )->getP4(),
                                      parent->getDaug( m_iPiMinus[0] )->getP4() );
     } else if ( m_outCode == 5 ) {
         // Bc -> psi pi+ pi+ pi- pi- pi+ from Kuhn & Was, hep-ph/0602162
         hardCur =
             m_WCurr->WCurrent_5pi( parent->getDaug( m_iPiPlus[0] )->getP4(),
                                    parent->getDaug( m_iPiPlus[1] )->getP4(),
                                    parent->getDaug( m_iPiPlus[2] )->getP4(),
                                    parent->getDaug( m_iPiMinus[0] )->getP4(),
                                    parent->getDaug( m_iPiMinus[1] )->getP4() );
 
     } else if ( m_outCode == 6 ) {
         // K+ K- pi+
         hardCur =
             m_WCurr->WCurrent_KKP( parent->getDaug( m_iKPlus[0] )->getP4(),
                                    parent->getDaug( m_iKMinus[0] )->getP4(),
                                    parent->getDaug( m_iPiPlus[0] )->getP4() );
 
     } else if ( m_outCode == 7 ) {
         // K+ pi+ pi-
         hardCur =
             m_WCurr->WCurrent_KPP( parent->getDaug( m_iKPlus[0] )->getP4(),
                                    parent->getDaug( m_iPiPlus[0] )->getP4(),
                                    parent->getDaug( m_iPiMinus[0] )->getP4() );
 
     } else if ( m_outCode == 8 ) {
         // K_S0 K+
         hardCur = m_WCurr->WCurrent_KSK( parent->getDaug( 1 )->getP4(),
                                          parent->getDaug( 2 )->getP4() );
 
     } else if ( m_outCode == 9 ) {
         // K+ K- pi+ pi+ pi-
         hardCur = m_WCurr->WCurrent_KKPPP(
             parent->getDaug( m_iKPlus[0] )->getP4(),     // K+
             parent->getDaug( m_iKMinus[0] )->getP4(),    // K-
             parent->getDaug( m_iPiPlus[0] )->getP4(),    // pi+
             parent->getDaug( m_iPiPlus[1] )->getP4(),    // pi+
             parent->getDaug( m_iPiMinus[0] )->getP4()    // pi-
         );
     } else if ( m_outCode == 10 ) {
         // 1=pi+ 2=pi+ 3=pi+ 4=pi+ 5=pi- 6=pi- 7=pi- with symmetrization of identical particles
         hardCur = m_WCurr->WCurrent_7pi(
             parent->getDaug( m_iPiPlus[0] )->getP4(),     // pi+
             parent->getDaug( m_iPiPlus[1] )->getP4(),     // pi+
             parent->getDaug( m_iPiPlus[2] )->getP4(),     // pi+
             parent->getDaug( m_iPiPlus[3] )->getP4(),     // pi+
             parent->getDaug( m_iPiMinus[0] )->getP4(),    // pi-
             parent->getDaug( m_iPiMinus[1] )->getP4(),    // pi-
             parent->getDaug( m_iPiMinus[2] )->getP4()     // pi-
         );
     } else if ( m_outCode == 11 ) {
         // 1=K+ 2 = pi+ 3 = pi+ 4 = pi- 5 = pi- with symmetrization
         hardCur = m_WCurr->WCurrent_K4pi(
             parent->getDaug( m_iKPlus[0] )->getP4(),      // K+
             parent->getDaug( m_iPiPlus[0] )->getP4(),     // pi+
             parent->getDaug( m_iPiPlus[1] )->getP4(),     // pi+
             parent->getDaug( m_iPiMinus[0] )->getP4(),    // pi-
             parent->getDaug( m_iPiMinus[1] )->getP4()     // pi-
         );
     }
 
     return hardCur;
 }
 
 //======================================================
 
 void EvtBcVHad::decay( EvtParticle* parent )
 {
     parent->initializePhaseSpace( getNDaug(), getDaugs() );
 
     // Calculate hadronic current
     const EvtVector4C hardCur = hardCurr( parent );
 
     EvtParticle* Jpsi = parent->getDaug( 0 );
     //std::cout<<"4th comp: "<<Jpsi->eps(3)<<std::endl;
 
     const EvtVector4R p4b( parent->mass(), 0., 0., 0. ),    // Bc momentum
         p4meson = Jpsi->getP4(),                            // J/psi momenta
         Q = p4b - p4meson, p4Sum = p4meson + p4b;
     const double Q2 = Q.mass2();
 
     // Calculate Bc -> V W form-factors
     double a1f( 0.0 ), a2f( 0.0 ), vf( 0.0 ), a0f( 0.0 );
 
     const double mMeson = Jpsi->mass();
     const double mB = parent->mass();
     const double mVar = mB + mMeson;
 
     m_FFModel->getvectorff( parent->getId(), Jpsi->getId(), Q2, mMeson, &a1f,
                             &a2f, &vf, &a0f );
 
     const double a3f = ( mVar / ( 2.0 * mMeson ) ) * a1f -
                        ( ( mB - mMeson ) / ( 2.0 * mMeson ) ) * a2f;
 
     // Calculate Bc -> V W current
     EvtTensor4C H = a1f * mVar * EvtTensor4C::g();
     H.addDirProd( ( -a2f / mVar ) * p4b, p4Sum );
     H += EvtComplex( 0.0, vf / mVar ) *
          dual( EvtGenFunctions::directProd( p4Sum, Q ) );
     H.addDirProd( ( a0f - a3f ) * 2.0 * ( mMeson / Q2 ) * p4b, Q );
     const EvtVector4C Heps = H.cont2( hardCur );
 
     for ( int i = 0; i < 3; i++ ) {
         const EvtVector4C eps =
             Jpsi->epsParent( i ).conj();    // psi-meson polarization vector
         const EvtComplex amp = eps * Heps;
         vertex( i, amp );
     }
 }
diff --git a/src/EvtGenModels/EvtBcVMuNu.cpp b/src/EvtGenModels/EvtBcVMuNu.cpp
index 2617213..ff95600 100644
--- a/src/EvtGenModels/EvtBcVMuNu.cpp
+++ b/src/EvtGenModels/EvtBcVMuNu.cpp
@@ -1,92 +1,92 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcVMuNu.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtBCVFF.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 
-std::string EvtBcVMuNu::getName()
+std::string EvtBcVMuNu::getName() const
 {
     return "BC_VMN";
 }
 
-EvtDecayBase* EvtBcVMuNu::clone()
+EvtDecayBase* EvtBcVMuNu::clone() const
 {
     return new EvtBcVMuNu;
 }
 
 void EvtBcVMuNu::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_ffmodel.get() );
 }
 
 void EvtBcVMuNu::init()
 {
     checkNArg( 1 );
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     m_idVector = getDaug( 0 ).getId();
     m_whichfit = int( getArg( 0 ) + 0.1 );
 
     m_ffmodel = std::make_unique<EvtBCVFF>( m_idVector, m_whichfit );
 
     m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
 }
 
 void EvtBcVMuNu::initProbMax()
 {
     EvtId parId = getParentId();
     EvtId mesonId = getDaug( 0 );
     EvtId lepId = getDaug( 1 );
     EvtId nuId = getDaug( 2 );
 
     int nQ2Bins = 200;
     double maxProb = m_calcamp->CalcMaxProb( parId, mesonId, lepId, nuId,
                                              m_ffmodel.get(), nQ2Bins );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtBcVMuNu" )
             << "Max prob = " << maxProb << endl;
     }
 
     setProbMax( maxProb );
 }
diff --git a/src/EvtGenModels/EvtBcVNpi.cpp b/src/EvtGenModels/EvtBcVNpi.cpp
index e80b17b..e7a73ed 100644
--- a/src/EvtGenModels/EvtBcVNpi.cpp
+++ b/src/EvtGenModels/EvtBcVNpi.cpp
@@ -1,192 +1,192 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcVNpi.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParser.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include "EvtGenModels/EvtTauHadnu.hh"
 #include "EvtGenModels/EvtWnPi.hh"
 
 #include <ctype.h>
 #include <stdlib.h>
 
-std::string EvtBcVNpi::getName()
+std::string EvtBcVNpi::getName() const
 {
     return "BC_VNPI";
 }
 
-EvtDecayBase* EvtBcVNpi::clone()
+EvtDecayBase* EvtBcVNpi::clone() const
 {
     return new EvtBcVNpi;
 }
 
 //======================================================
 void EvtBcVNpi::init()
 {
     //cout<<"BcVNpi::init()"<<endl;
 
     checkNArg( 1 );
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     for ( int i = 1; i <= ( getNDaug() - 1 ); i++ ) {
         checkSpinDaughter( i, EvtSpinType::SCALAR );
     };
 
     if ( getNDaug() < 2 || getNDaug() > 6 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Have not yet implemented this final state in BcVNpi model"
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
         for ( int id = 0; id < ( getNDaug() - 1 ); id++ )
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
                 << endl;
         return;
     }
 
     //     for(int i=0; i<getNDaug(); i++)
     //       cout<<"BcVNpi::init \t\t daughter "<<i<<" : "<<getDaug(i).getId()<<"   "<<EvtPDL::name(getDaug(i)).c_str()<<endl;
 
     m_idVector = getDaug( 0 ).getId();
     m_whichfit = int( getArg( 0 ) + 0.1 );
     //     cout<<"BcVNpi: m_whichfit ="<<m_whichfit<<"  m_idVector="<<m_idVector<<endl;
     m_ffmodel = std::make_unique<EvtBCVFF>( m_idVector, m_whichfit );
 
     m_wcurr = std::make_unique<EvtWnPi>();
 
     m_nCall = 0;
 }
 
 //======================================================
 void EvtBcVNpi::initProbMax()
 {
     //     cout<<"BcVNpi::initProbMax()"<<endl;
     if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() && m_whichfit == 1 &&
          getNDaug() == 6 )
         setProbMax( 720000. );
     else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
               m_whichfit == 2 && getNDaug() == 6 )
         setProbMax( 471817. );
     else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
               m_whichfit == 1 && getNDaug() == 4 )
         setProbMax( 42000. );
     else if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() &&
               m_whichfit == 2 && getNDaug() == 4 )
         setProbMax( 16000. );
 
     else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
               m_whichfit == 1 && getNDaug() == 4 )
         setProbMax( 1200. );
     else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
               m_whichfit == 2 && getNDaug() == 4 )
         setProbMax( 2600. );
     else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
               m_whichfit == 1 && getNDaug() == 6 )
         setProbMax( 40000. );
     else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() &&
               m_whichfit == 2 && getNDaug() == 6 )
         setProbMax( 30000. );
 }
 
 //======================================================
 void EvtBcVNpi::decay( EvtParticle* root_particle )
 {
     ++m_nCall;
     //     cout<<"BcVNpi::decay()"<<endl;
     root_particle->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtVector4R p4b( root_particle->mass(), 0., 0., 0. ),    // Bc momentum
         p4meson = root_particle->getDaug( 0 )->getP4(),      // J/psi momenta
         Q = p4b - p4meson;
     double Q2 = Q.mass2();
 
     // check pi-mesons and calculate hadronic current
     EvtVector4C hardCur;
     //     bool foundHadCurr=false;
     if ( getNDaug() == 2 ) {
         hardCur = m_wcurr->WCurrent( root_particle->getDaug( 1 )->getP4() );
         //       foundHadCurr=true;
     } else if ( getNDaug() == 3 ) {
         hardCur = m_wcurr->WCurrent( root_particle->getDaug( 1 )->getP4(),
                                      root_particle->getDaug( 2 )->getP4() );
         //       foundHadCurr=true;
     } else if ( getNDaug() == 4 ) {
         hardCur = m_wcurr->WCurrent( root_particle->getDaug( 1 )->getP4(),
                                      root_particle->getDaug( 2 )->getP4(),
                                      root_particle->getDaug( 3 )->getP4() );
         //       foundHadCurr=true;
     } else if ( getNDaug() ==
                 6 )    // Bc -> psi pi+ pi+ pi- pi- pi+ from [Kuhn, Was, hep-ph/0602162
     {
         hardCur = m_wcurr->WCurrent( root_particle->getDaug( 1 )->getP4(),
                                      root_particle->getDaug( 2 )->getP4(),
                                      root_particle->getDaug( 3 )->getP4(),
                                      root_particle->getDaug( 4 )->getP4(),
                                      root_particle->getDaug( 5 )->getP4() );
         // 		foundHadCurr=true;
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Have not yet implemented this final state in BCNPI model"
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
         int id;
         for ( id = 0; id < ( getNDaug() - 1 ); id++ )
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
                 << endl;
         ::abort();
     };
 
     // calculate Bc -> V W form-factors
     double a1f, a2f, vf, a0f;
     double m_meson = root_particle->getDaug( 0 )->mass();
     double m_b = root_particle->mass();
     m_ffmodel->getvectorff( root_particle->getId(),
                             root_particle->getDaug( 0 )->getId(), Q2, m_meson,
                             &a1f, &a2f, &vf, &a0f );
     double a3f = ( ( m_b + m_meson ) / ( 2.0 * m_meson ) ) * a1f -
                  ( ( m_b - m_meson ) / ( 2.0 * m_meson ) ) * a2f;
 
     // calculate Bc -> V W current
     EvtTensor4C H;
     H = a1f * ( m_b + m_meson ) * EvtTensor4C::g();
     H.addDirProd( ( -a2f / ( m_b + m_meson ) ) * p4b, p4b + p4meson );
     H += EvtComplex( 0.0, vf / ( m_b + m_meson ) ) *
          dual( EvtGenFunctions::directProd( p4meson + p4b, p4b - p4meson ) );
     H.addDirProd( ( a0f - a3f ) * 2.0 * ( m_meson / Q2 ) * p4b, p4b - p4meson );
     EvtVector4C Heps = H.cont2( hardCur );
 
     for ( int i = 0; i < 3; i++ ) {
         EvtVector4C eps = root_particle->getDaug( 0 )
                               ->epsParent( i )
                               .conj();    // psi-meson polarization vector
         EvtComplex amp = eps * Heps;
         vertex( i, amp );
     };
 }
diff --git a/src/EvtGenModels/EvtBcVPPHad.cpp b/src/EvtGenModels/EvtBcVPPHad.cpp
index abdb5b6..d31e1e3 100644
--- a/src/EvtGenModels/EvtBcVPPHad.cpp
+++ b/src/EvtGenModels/EvtBcVPPHad.cpp
@@ -1,166 +1,166 @@
 /***********************************************************************
 * Copyright 1998-2023 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBcVPPHad.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <iostream>
 
-std::string EvtBcVPPHad::getName()
+std::string EvtBcVPPHad::getName() const
 {
     return "BC_VPPHAD";
 }
 
-EvtDecayBase* EvtBcVPPHad::clone()
+EvtDecayBase* EvtBcVPPHad::clone() const
 {
     return new EvtBcVPPHad;
 }
 
 //======================================================
 
 void EvtBcVPPHad::init()
 {
     checkNArg( 1 );
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
     for ( int i = 3; i <= ( getNDaug() - 1 ); i++ ) {
         checkSpinDaughter( i, EvtSpinType::SCALAR );
     }
 
     m_idVector = getDaug( 0 ).getId();
     m_whichFit = int( getArg( 0 ) + 0.1 );
     m_FFModel = std::make_unique<EvtBCVFF2>( m_idVector, m_whichFit );
 
     m_WCurr = std::make_unique<EvtWHad>();
 
     // determine the code of final hadronic state
     const EvtIdSet thePis{ "pi+", "pi-", "pi0" };
     const EvtIdSet theK{ "K+", "K-", "K_S0" };
     const EvtIdSet thePs{ "p+", "anti-p-" };
 
     if ( getNDaug() == 4 && thePs.contains( getDaug( 1 ) ) &&
          thePs.contains( getDaug( 2 ) ) && thePis.contains( getDaug( 3 ) ) ) {
         m_outCode = 1;    // p+ p- pi+
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtBcPPHad::init has unknown decay mode" );
     }
     EvtGenReport( EVTGEN_INFO, "EvtBcVPPHad" )
         << ": m_outCode = " << m_outCode << ", m_whichFit = " << m_whichFit
         << std::endl;
 }
 
 //======================================================
 
 void EvtBcVPPHad::initProbMax()
 {
     if ( m_outCode == 1 ) {
         // p+ p- pi+
         if ( m_idVector == EvtPDL::getId( "J/psi" ).getId() ) {
             if ( m_whichFit == 2 ) {
                 setProbMax( 550.0 );
             } else {
                 setProbMax( 1100.0 );
             }
         } else if ( m_idVector == EvtPDL::getId( "psi(2S)" ).getId() ) {
             if ( m_whichFit == 2 ) {
                 setProbMax( 7.0 );
             } else {
                 setProbMax( 50.0 );
             }
         }
     } else {
         EvtGenReport(
             EVTGEN_ERROR,
             "probmax: Have not yet implemented this final state in BC_VPPHAD model, m_outCode = " )
             << m_outCode << std::endl;
     }
 }
 
 //======================================================
 EvtVector4C EvtBcVPPHad::hardCurrPP( EvtParticle* parent, int i1, int i2 ) const
 {
     EvtVector4C hardCur;
     const EvtVector4R p1 = parent->getDaug( 1 )->getP4();
     const EvtDiracSpinor sp1 = parent->getDaug( 1 )->spParent( i1 );
 
     const EvtVector4R p2 = parent->getDaug( 2 )->getP4();
     const EvtDiracSpinor sp2 = parent->getDaug( 2 )->spParent( i2 );
 
     if ( m_outCode == 1 ) {
         const EvtVector4R k = parent->getDaug( 3 )->getP4();
         hardCur = m_WCurr->WCurrent_ppPi( p1, sp1, p2, sp2, k );
     }
     return hardCur;
 }
 
 //======================================================
 void EvtBcVPPHad::decay( EvtParticle* parent )
 {
     parent->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle* Jpsi = parent->getDaug( 0 );
 
     const EvtVector4R p4b( parent->mass(), 0., 0., 0. ),    // Bc momentum
         p4meson = Jpsi->getP4(),                            // J/psi momenta
         Q = p4b - p4meson, p4Sum = p4meson + p4b;
     const double Q2 = Q.mass2();
 
     // Calculate Bc -> V W form-factors
     double a1f( 0.0 ), a2f( 0.0 ), vf( 0.0 ), a0f( 0.0 );
 
     const double mMeson = Jpsi->mass();
     const double mB = parent->mass();
     const double mVar = mB + mMeson;
 
     m_FFModel->getvectorff( parent->getId(), Jpsi->getId(), Q2, mMeson, &a1f,
                             &a2f, &vf, &a0f );
 
     const double a3f = ( mVar / ( 2.0 * mMeson ) ) * a1f -
                        ( ( mB - mMeson ) / ( 2.0 * mMeson ) ) * a2f;
 
     // Calculate Bc -> V W current
     EvtTensor4C H = a1f * mVar * EvtTensor4C::g();
     H.addDirProd( ( -a2f / mVar ) * p4b, p4Sum );
     H += EvtComplex( 0.0, vf / mVar ) *
          dual( EvtGenFunctions::directProd( p4Sum, Q ) );
     H.addDirProd( ( a0f - a3f ) * 2.0 * ( mMeson / Q2 ) * p4b, Q );
 
     for ( int i1 = 0; i1 < 2; ++i1 ) {
         for ( int i2 = 0; i2 < 2; ++i2 ) {
             const EvtVector4C hardCur = hardCurrPP( parent, i1, i2 );
             const EvtVector4C Heps = H.cont2( hardCur );
             for ( int i = 0; i < 3; i++ ) {
                 // psi-meson polarization vector
                 const EvtVector4C eps = Jpsi->epsParent( i ).conj();
                 const EvtComplex amp = eps * Heps;
                 vertex( i, i1, i2, amp );
             }
         }
     }
 }
diff --git a/src/EvtGenModels/EvtBsMuMuKK.cpp b/src/EvtGenModels/EvtBsMuMuKK.cpp
index 7f8a387..3f63c2d 100644
--- a/src/EvtGenModels/EvtBsMuMuKK.cpp
+++ b/src/EvtGenModels/EvtBsMuMuKK.cpp
@@ -1,684 +1,687 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBsMuMuKK.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector3R.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 #include "EvtGenBase/EvtdFunction.hh"
 
 const double pi = EvtConst::pi;
 const EvtComplex I = EvtComplex( 0.0, 1.0 );
 const double sq2 = sqrt( 2.0 );
 
-std::string EvtBsMuMuKK::getName()
+std::string EvtBsMuMuKK::getName() const
 {
     return "BS_MUMUKK";
 }
 
-EvtDecayBase* EvtBsMuMuKK::clone()
+EvtDecayBase* EvtBsMuMuKK::clone() const
 {
     return new EvtBsMuMuKK;
 }
 
 void EvtBsMuMuKK::init()
 {
     // DecFile parameters
     checkNArg( 37 );
 
     // Non-resonant S wave
     m_f_S_NR = getArg( 0 );
     m_delta_S_NR = getArg( 1 );
     m_phis_S_NR = getArg( 2 );
     m_lambda_S_NR_abs = getArg( 3 );
 
     // f0 (S wave)
     m_f_f0 = getArg( 4 );
     m_delta_f0 = getArg( 5 );
     m_phis_f0 = getArg( 6 );
     m_lambda_f0_abs = getArg( 7 );
 
     // phi (P wave)
     m_f_phi = getArg( 8 );
     m_f_phi_0 = getArg( 9 );
     m_delta_phi_0 = getArg( 10 );
     m_phis_phi_0 = getArg( 11 );
     m_lambda_phi_0_abs = getArg( 12 );
     m_f_phi_perp = getArg( 13 );
     m_delta_phi_perp = pi - getArg( 14 );
     m_phis_phi_perp = getArg( 15 );
     m_lambda_phi_perp_abs = getArg( 16 );
     m_delta_phi_par = pi - getArg( 17 );
     m_phis_phi_par = getArg( 18 );
     m_lambda_phi_par_abs = getArg( 19 );
 
     // f2' (D wave)
     m_f_f2p_0 = getArg( 20 );
     m_delta_f2p_0 = getArg( 21 );
     m_phis_f2p_0 = getArg( 22 );
     m_lambda_f2p_0_abs = getArg( 23 );
     m_f_f2p_perp = getArg( 24 );
     m_delta_f2p_perp = pi - getArg( 25 );
     m_phis_f2p_perp = getArg( 26 );
     m_lambda_f2p_perp_abs = getArg( 27 );
     m_delta_f2p_par = pi - getArg( 28 );
     m_phis_f2p_par = getArg( 29 );
     m_lambda_f2p_par_abs = getArg( 30 );
 
     // Time dependence
     m_Gamma = getArg( 31 );
     m_deltaGamma = getArg( 32 );
     m_deltaMs = getArg( 33 );
 
     // mKK window
     m_Mf0 = getArg( 34 );
     m_kin_lower_limit = getArg( 35 );    // the minimum is approx 2.03*MKp
     m_kin_upper_limit = getArg( 36 );
 
     // PDG masses
     m_MBs = EvtPDL::getMass( EvtPDL::getId( "B_s0" ) );
     m_MJpsi = EvtPDL::getMeanMass( EvtPDL::getId( "J/psi" ) );
     m_Mphi = EvtPDL::getMeanMass( EvtPDL::getId( "phi" ) );
     m_Mf2p = EvtPDL::getMeanMass( EvtPDL::getId( "f'_2" ) );
     m_MKp = EvtPDL::getMass( EvtPDL::getId( "K+" ) );
     m_MKm = EvtPDL::getMass( EvtPDL::getId( "K-" ) );
     m_MK0 = EvtPDL::getMass( EvtPDL::getId( "K0" ) );
     m_Mpip = EvtPDL::getMass( EvtPDL::getId( "pi+" ) );
     m_Mpi0 = EvtPDL::getMass( EvtPDL::getId( "pi0" ) );
     m_Mmu = EvtPDL::getMass( EvtPDL::getId( "mu+" ) );
 
     double MBsSq = m_MBs * m_MBs;
 
     // Amplitudes and other time parameters
     m_A_S_NR = sqrt( m_f_S_NR );
     m_A_f0 = sqrt( m_f_f0 );
 
     m_A_phi_0 = sqrt( m_f_phi_0 * m_f_phi );
     m_A_phi_perp = sqrt( m_f_phi_perp * m_f_phi );
     // Use fabs to make sure subtractions are >= 0, since subtracting 0 from 0 can give -0
     m_A_phi_par = sqrt(
         fabs( m_f_phi - m_A_phi_perp * m_A_phi_perp - m_A_phi_0 * m_A_phi_0 ) );
 
     m_f_f2p = fabs( 1.0 - m_f_S_NR - m_f_f0 - m_f_phi );
     m_A_f2p_0 = sqrt( m_f_f2p_0 * m_f_f2p );
     m_A_f2p_perp = sqrt( m_f_f2p_perp * m_f_f2p );
     m_A_f2p_par = sqrt(
         fabs( m_f_f2p - m_A_f2p_perp * m_A_f2p_perp - m_A_f2p_0 * m_A_f2p_0 ) );
 
     m_ctau = 1.0 / m_Gamma;
     m_Gamma0phi = EvtPDL::getWidth( EvtPDL::getId( "phi" ) );
     m_Gamma0f2p = EvtPDL::getWidth( EvtPDL::getId( "f'_2" ) );
 
     m_kin_middle = 0.5 * ( m_kin_upper_limit + m_kin_lower_limit );
 
     m_int_const_NR = sqrt( Integral( 1.0, 1.0, 0, 1, 1.0, m_kin_lower_limit,
                                      m_kin_upper_limit, 0 ) );
 
     m_int_Flatte_f0 = sqrt( Integral( 1.0, m_Mf0, 0, 1, 1.0, m_kin_lower_limit,
                                       m_kin_upper_limit, 1 ) );
 
     m_p30Kp_mid_CMS = sqrt( ( pow( m_kin_middle, 2 ) - pow( m_MKp + m_MKm, 2 ) ) *
                             ( pow( m_kin_middle, 2 ) - pow( m_MKp - m_MKm, 2 ) ) ) /
                       ( 2.0 * m_kin_middle );
 
     m_p30Kp_ll_CMS =
         sqrt( ( pow( m_kin_lower_limit, 2 ) - pow( m_MKp + m_MKm, 2 ) ) *
               ( pow( m_kin_lower_limit, 2 ) - pow( m_MKp - m_MKm, 2 ) ) ) /
         ( 2.0 * m_kin_lower_limit );
 
     m_p30Kp_phi_CMS = sqrt( ( m_Mphi * m_Mphi - pow( m_MKp + m_MKm, 2 ) ) *
                             ( m_Mphi * m_Mphi - pow( m_MKp - m_MKm, 2 ) ) ) /
                       ( 2.0 * m_Mphi );
 
     m_p30Kp_f2p_CMS = sqrt( ( m_Mf2p * m_Mf2p - pow( m_MKp + m_MKm, 2 ) ) *
                             ( m_Mf2p * m_Mf2p - pow( m_MKp - m_MKm, 2 ) ) ) /
                       ( 2.0 * m_Mf2p );
 
     m_p30Jpsi_mid_CMS = sqrt( ( MBsSq - pow( m_kin_middle + m_MJpsi, 2 ) ) *
                               ( MBsSq - pow( m_kin_middle - m_MJpsi, 2 ) ) ) /
                         ( 2.0 * m_MBs );
 
     m_p30Jpsi_ll_CMS = sqrt( ( MBsSq - pow( m_kin_lower_limit + m_MJpsi, 2 ) ) *
                              ( MBsSq - pow( m_kin_lower_limit - m_MJpsi, 2 ) ) ) /
                        ( 2.0 * m_MBs );
 
     m_p30Jpsi_phi_CMS = sqrt( ( MBsSq - pow( m_Mphi + m_MJpsi, 2 ) ) *
                               ( MBsSq - pow( m_Mphi - m_MJpsi, 2 ) ) ) /
                         ( 2.0 * m_MBs );
 
     m_p30Jpsi_f2p_CMS = sqrt( ( MBsSq - pow( m_Mf2p + m_MJpsi, 2 ) ) *
                               ( MBsSq - pow( m_Mf2p - m_MJpsi, 2 ) ) ) /
                         ( 2.0 * m_MBs );
 
     m_int_BW_phi = sqrt( Integral( m_Gamma0phi, m_Mphi, 1, 0, m_p30Kp_phi_CMS,
                                    m_kin_lower_limit, m_kin_upper_limit, 2 ) );
 
     m_int_BW_f2p = sqrt( Integral( m_Gamma0f2p, m_Mf2p, 2, 1, m_p30Kp_f2p_CMS,
                                    m_kin_lower_limit, m_kin_upper_limit, 2 ) );
 
     // 4 daughters
     checkNDaug( 4 );
 
     // Spin-0 parent
     checkSpinParent( EvtSpinType::SCALAR );    // B_s0 (anti-B_s0)
 
     // Daughters
     checkSpinDaughter( 0, EvtSpinType::DIRAC );     // mu+  (mu-)
     checkSpinDaughter( 1, EvtSpinType::DIRAC );     // mu-  (mu+)
     checkSpinDaughter( 2, EvtSpinType::SCALAR );    // K+   (K-)
     checkSpinDaughter( 3, EvtSpinType::SCALAR );    // K-   (K+)
 
     // B_s0 parent (Parent must be B_s0 or anti-B_s0)
     const EvtId p = getParentId();
     if ( p != EvtPDL::getId( "B_s0" ) && p != EvtPDL::getId( "anti-B_s0" ) ) {
         assert( 0 );
     }
 
     // Daughter types and ordering (should be mu+-, mu-+, K+-, K-+)
     const EvtId d1 = getDaug( 0 );
     const EvtId d2 = getDaug( 1 );
     const EvtId d3 = getDaug( 2 );
     const EvtId d4 = getDaug( 3 );
     if ( !( ( d1 == EvtPDL::getId( "mu+" ) || d1 == EvtPDL::getId( "mu-" ) ) &&
             ( d2 == EvtPDL::getId( "mu-" ) || d2 == EvtPDL::getId( "mu+" ) ) &&
             ( d3 == EvtPDL::getId( "K+" ) || d3 == EvtPDL::getId( "K-" ) ) &&
             ( d4 == EvtPDL::getId( "K-" ) || d4 == EvtPDL::getId( "K+" ) ) ) ) {
         assert( 0 );
     }
 }
 
 // Get ProbMax
 void EvtBsMuMuKK::initProbMax()
 {
     const EvtComplex term11 = sqrt( m_p30Jpsi_f2p_CMS * m_p30Kp_f2p_CMS );
 
     const EvtComplex term12 =
         X_J( 2, m_p30Kp_f2p_CMS, 0 ) * X_J( 1, m_p30Jpsi_f2p_CMS, 1 ) *
         m_p30Kp_f2p_CMS * m_p30Kp_f2p_CMS * m_p30Jpsi_f2p_CMS *
         ( m_A_f2p_0 + 0.3 * m_A_f2p_perp + 0.3 * m_A_f2p_par );
 
     const EvtComplex term13 = m_f_f2p *
                               Breit_Wigner( m_Gamma0f2p, m_Mf2p, m_Mf2p, 2,
                                             m_p30Kp_f2p_CMS, m_p30Kp_f2p_CMS ) /
                               m_int_BW_f2p;
 
     const EvtComplex term21 = sqrt( m_p30Jpsi_phi_CMS * m_p30Kp_phi_CMS );
 
     const EvtComplex term22 = X_J( 1, m_p30Kp_phi_CMS, 0 ) * m_p30Kp_phi_CMS *
                               ( 0.65 * m_A_phi_0 + 0.6 * m_A_phi_perp +
                                 0.6 * m_A_phi_par );
 
     const EvtComplex term23 = m_f_phi *
                               Breit_Wigner( m_Gamma0phi, m_Mphi, m_Mphi, 1,
                                             m_p30Kp_phi_CMS, m_p30Kp_phi_CMS ) /
                               m_int_BW_phi;
 
     const EvtComplex term31 = sqrt( m_p30Jpsi_ll_CMS * m_p30Kp_ll_CMS );
 
     const EvtComplex term32 = X_J( 1, m_p30Jpsi_ll_CMS, 1 ) * m_p30Jpsi_ll_CMS;
 
     const EvtComplex term33 = m_f_f0 * Flatte( m_Mf0, m_kin_lower_limit ) /
                               m_int_Flatte_f0;
 
     const EvtComplex term41 = sqrt( m_p30Jpsi_mid_CMS * m_p30Kp_mid_CMS );
 
     const EvtComplex term42 = X_J( 1, m_p30Jpsi_mid_CMS, 1 ) * m_p30Jpsi_mid_CMS;
 
     const EvtComplex term43 = 1.2 * m_f_S_NR / m_int_const_NR;
 
     const EvtComplex hm = term11 * term12 * term13 + term21 * term22 * term23 +
                           term31 * term32 * term33 + term41 * term42 * term43;
 
     // Increase by 10%
     setProbMax( 0.5 * abs2( hm ) * 1.1 );
 }
 
 // Decay function
 void EvtBsMuMuKK::decay( EvtParticle* p )
 {
     EvtId other_b;
     double time( 0.0 );
     EvtCPUtil::getInstance()->OtherB( p, time, other_b );
     time = -log( EvtRandom::Flat() ) *
            m_ctau;    // This overrules the ctau made in OtherB
 
     if ( EvtCPUtil::getInstance()->isBsMixed( p ) ) {
         p->getParent()->setLifetime( time * EvtConst::c / 1e12 );    // units: mm
     } else {
         p->setLifetime( time * EvtConst::c / 1e12 );    // units: mm
     }
 
     double DGtime = 0.25 * m_deltaGamma * time;
     double DMtime = 0.5 * m_deltaMs * time;
     double mt = exp( -DGtime );
     double pt = exp( +DGtime );
     double cDMt = cos( DMtime );
     double sDMt = sin( DMtime );
     EvtComplex termplus = EvtComplex( cDMt, sDMt );
     EvtComplex terminus = EvtComplex( cDMt, -sDMt );
 
     EvtComplex gplus = 0.5 * ( mt * termplus + pt * terminus );
     EvtComplex gminus = 0.5 * ( mt * termplus - pt * terminus );
 
     EvtId BSB = EvtPDL::getId( "anti-B_s0" );
 
     // Flavour: first assume B_s0, otherwise choose anti-B_s0
     int q( 1 );
     if ( other_b == BSB ) {
         q = -1;
     }
     p->setAttribute( "q", q );
 
     // Amplitudes
     EvtComplex a_S_NR = AmpTime( q, gplus, gminus, m_delta_S_NR,
                                  m_lambda_S_NR_abs, m_A_S_NR, m_phis_S_NR, -1 );
 
     EvtComplex a_f0 = AmpTime( q, gplus, gminus, m_delta_f0, m_lambda_f0_abs,
                                m_A_f0, m_phis_f0, -1 );
 
     EvtComplex a0_phi = AmpTime( q, gplus, gminus, m_delta_phi_0,
                                  m_lambda_phi_0_abs, m_A_phi_0, m_phis_phi_0, 1 );
 
     EvtComplex aperp_phi = AmpTime( q, gplus, gminus, m_delta_phi_perp,
                                     m_lambda_phi_perp_abs, m_A_phi_perp,
                                     m_phis_phi_perp, -1 );
 
     EvtComplex apar_phi = AmpTime( q, gplus, gminus, m_delta_phi_par,
                                    m_lambda_phi_par_abs, m_A_phi_par,
                                    m_phis_phi_par, 1 );
 
     EvtComplex a0_f2p = AmpTime( q, gplus, gminus, m_delta_f2p_0,
                                  m_lambda_f2p_0_abs, m_A_f2p_0, m_phis_f2p_0,
                                  -1 );
 
     EvtComplex aperp_f2p = AmpTime( q, gplus, gminus, m_delta_f2p_perp,
                                     m_lambda_f2p_perp_abs, m_A_f2p_perp,
                                     m_phis_f2p_perp, 1 );
 
     EvtComplex apar_f2p = AmpTime( q, gplus, gminus, m_delta_f2p_par,
                                    m_lambda_f2p_par_abs, m_A_f2p_par,
                                    m_phis_f2p_par, -1 );
 
     // Generate 4-momenta
     double mKK = EvtRandom::Flat( m_kin_lower_limit, m_kin_upper_limit );
     double mass[10] = { m_MJpsi, mKK, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
     double Kmass[10] = { m_MKp, m_MKm, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
     double muMass[10] = { m_Mmu, m_Mmu, 0.0, 0.0, 0.0,
                           0.0,   0.0,   0.0, 0.0, 0.0 };
 
     EvtVector4R mypV[2], mypK[2], mypmu[2];
     EvtGenKine::PhaseSpace( 2, mass, mypV, m_MBs );
     EvtGenKine::PhaseSpace( 2, Kmass, mypK, mKK );
     EvtGenKine::PhaseSpace( 2, muMass, mypmu, m_MJpsi );
 
     EvtVector4R p4mup = boostTo( mypmu[0], mypV[0] );
     EvtVector4R p4mum = boostTo( mypmu[1], mypV[0] );
     EvtVector4R p4Kp = boostTo( mypK[0], mypV[1] );
     EvtVector4R p4Km = boostTo( mypK[1], mypV[1] );
 
     p->makeDaughters( getNDaug(), getDaugs() );
 
     EvtParticle* thisparticle;
     EvtParticle *muplus, *muminus, *Kplus, *Kminus;
 
     // Check particle ID
     for ( int k = 0; k <= 3; k++ ) {
         thisparticle = p->getDaug( k );
         EvtId pId = thisparticle->getId();
 
         if ( pId == EvtPDL::getId( "mu+" ) ) {
             muplus = thisparticle;
             muplus->init( getDaug( k ), p4mup );
 
         } else if ( pId == EvtPDL::getId( "mu-" ) ) {
             muminus = thisparticle;
             muminus->init( getDaug( k ), p4mum );
 
         } else if ( pId == EvtPDL::getId( "K+" ) ) {
             Kplus = thisparticle;
             Kplus->init( getDaug( k ), p4Kp );
 
         } else if ( pId == EvtPDL::getId( "K-" ) ) {
             Kminus = thisparticle;
             Kminus->init( getDaug( k ), p4Km );
         }
     }
 
     EvtVector4R p4KK = p4Kp + p4Km;
     EvtVector4R p4mumu = p4mup + p4mum;
     EvtVector4R p4Bs = p4mumu + p4KK;
 
     double p4KK_mass2 = p4KK.mass2();
     double p4KK_mass = p4KK.mass();
     double p4Bs_mass2 = p4Bs.mass2();
     double p4Bs_mass = p4Bs.mass();
 
     // Kp momentum in the KK CMS
     double p3Kp_KK_CMS = sqrt( ( p4KK_mass2 - pow( m_MKp + m_MKm, 2 ) ) *
                                ( p4KK_mass2 - pow( m_MKp - m_MKm, 2 ) ) ) /
                          ( 2.0 * p4KK_mass );
 
     // J/psi momentum in the KK CMS
     double p3Jpsi_KK_CMS = sqrt( ( p4Bs_mass2 - pow( p4KK_mass + m_MJpsi, 2 ) ) *
                                  ( p4Bs_mass2 - pow( p4KK_mass - m_MJpsi, 2 ) ) ) /
                            ( 2.0 * p4Bs_mass );
 
     // Mass lineshapes
 
     // Non-resonant S wave
     EvtComplex P_NR = 1.0 / m_int_const_NR;
 
     // f0 Flatte
     EvtComplex F_f0 = Flatte( m_Mf0, p4KK_mass ) / m_int_Flatte_f0;
 
     // phi Breit Wigner
     EvtComplex BW_phi = Breit_Wigner( m_Gamma0phi, m_Mphi, p4KK_mass, 1,
                                       m_p30Kp_phi_CMS, p3Kp_KK_CMS ) /
                         m_int_BW_phi;
 
     // f2' Breit Wigner
     EvtComplex BW_f2p = Breit_Wigner( m_Gamma0f2p, m_Mf2p, p4KK_mass, 1,
                                       m_p30Kp_f2p_CMS, p3Kp_KK_CMS ) /
                         m_int_BW_f2p;
 
     // Barrier factors: Always taking the lowest Bs L
     double X_KK_0 = 1.0;
     double X_KK_1 = X_J( 1, p3Kp_KK_CMS, 0 );
     double X_KK_2 = X_J( 2, p3Kp_KK_CMS, 0 );
     double X_NR_Jpsi_1 = X_J( 1, p3Jpsi_KK_CMS, 1 );
     double X_f0_Jpsi_1 = X_J( 1, p3Jpsi_KK_CMS, 1 );
     double X_phi_Jpsi_0 = 1.0;
     double X_f2p_Jpsi_1 = X_J( 1, p3Jpsi_KK_CMS, 1 );
 
     // Birth momentum factors: pow(p3(K+),LR)* pow(p3(J/psi),LB)
     double f_PHSP = sqrt( p3Jpsi_KK_CMS * p3Kp_KK_CMS );
     double f_BMF_NR = p3Jpsi_KK_CMS;
     double f_BMF_f0 = p3Jpsi_KK_CMS;
     double f_BMF_phi = p3Kp_KK_CMS;
     double f_BMF_f2p = p3Kp_KK_CMS * p3Kp_KK_CMS * p3Jpsi_KK_CMS;
 
     // Angular distribution and sum over KK states
     double CosK = EvtDecayAngle( p4Bs, p4KK, p4Kp );
     double CosMu = EvtDecayAngle( p4Bs, p4mumu, p4mup );
     double chi = EvtDecayAngleChi( p4Bs, p4mup, p4mum, p4Kp, p4Km );
 
     // Build helicity amplitudes
 
     // phi
     EvtComplex H0_phi = a0_phi;
     EvtComplex Hp_phi = ( apar_phi + aperp_phi ) / sq2;
     EvtComplex Hm_phi = ( apar_phi - aperp_phi ) / sq2;
 
     // f2p
     EvtComplex H0_f2p = a0_f2p;
     EvtComplex Hp_f2p = ( apar_f2p + aperp_f2p ) / sq2;
     EvtComplex Hm_f2p = ( apar_f2p - aperp_f2p ) / sq2;
 
     // muon polarization +1
     EvtComplex swaveangdist1 = AngularDist( 0, 0, 1, CosK, CosMu, chi );
 
     // KK Spin-0 NR
     EvtComplex mp_hS_NR = a_S_NR * swaveangdist1;
     EvtComplex Amp_p_NR = P_NR * X_KK_0 * X_NR_Jpsi_1 * f_BMF_NR * mp_hS_NR;
 
     // KK Spin-0 f0
     EvtComplex mp_h_f0 = a_f0 * swaveangdist1;
     EvtComplex Amp_p_f0 = F_f0 * X_KK_0 * X_f0_Jpsi_1 * f_BMF_f0 * mp_h_f0;
 
     // KK Spin-1
     EvtComplex mp_h0_phi = H0_phi * AngularDist( 1, 0, 1, CosK, CosMu, chi );
     EvtComplex mp_hp_phi = Hp_phi * AngularDist( 1, 1, 1, CosK, CosMu, chi );
     EvtComplex mp_hm_phi = Hm_phi * AngularDist( 1, -1, 1, CosK, CosMu, chi );
     EvtComplex Amp_p_phi = BW_phi * X_KK_1 * X_phi_Jpsi_0 * f_BMF_phi *
                            ( mp_h0_phi + mp_hp_phi + mp_hm_phi );
 
     // KK Spin-2
     EvtComplex mp_h0_f2p = H0_f2p * AngularDist( 2, 0, 1, CosK, CosMu, chi );
     EvtComplex mp_hp_f2p = Hp_f2p * AngularDist( 2, 1, 1, CosK, CosMu, chi );
     EvtComplex mp_hm_f2p = Hm_f2p * AngularDist( 2, -1, 1, CosK, CosMu, chi );
     EvtComplex Amp_p_f2p = BW_f2p * X_KK_2 * X_f2p_Jpsi_1 * f_BMF_f2p *
                            ( mp_h0_f2p + mp_hp_f2p + mp_hm_f2p );
 
     // muon polarization -1
     EvtComplex swaveangdist2 = AngularDist( 0, 0, -1, CosK, CosMu, chi );
 
     // KK Spin-0 NR
     EvtComplex mm_hS_NR = a_S_NR * swaveangdist2;
     EvtComplex Amp_m_NR = P_NR * X_KK_0 * X_NR_Jpsi_1 * f_BMF_NR * mm_hS_NR;
 
     // KK Spin-0
     EvtComplex mm_h_f0 = a_f0 * swaveangdist2;
     EvtComplex Amp_m_f0 = F_f0 * X_KK_0 * X_f0_Jpsi_1 * f_BMF_f0 * mm_h_f0;
 
     // KK Spin-1
     EvtComplex mm_h0_phi = H0_phi * AngularDist( 1, 0, -1, CosK, CosMu, chi );
     EvtComplex mm_hp_phi = Hp_phi * AngularDist( 1, +1, -1, CosK, CosMu, chi );
     EvtComplex mm_hm_phi = Hm_phi * AngularDist( 1, -1, -1, CosK, CosMu, chi );
     EvtComplex Amp_m_phi = BW_phi * X_KK_1 * X_phi_Jpsi_0 * f_BMF_phi *
                            ( mm_h0_phi + mm_hp_phi + mm_hm_phi );
 
     // KK Spin-2
     EvtComplex mm_h0_f2p = H0_f2p * AngularDist( 2, 0, -1, CosK, CosMu, chi );
     EvtComplex mm_hp_f2p = Hp_f2p * AngularDist( 2, 1, -1, CosK, CosMu, chi );
     EvtComplex mm_hm_f2p = Hm_f2p * AngularDist( 2, -1, -1, CosK, CosMu, chi );
     EvtComplex Amp_m_f2p = BW_f2p * X_KK_2 * X_f2p_Jpsi_1 * f_BMF_f2p *
                            ( mm_h0_f2p + mm_hp_f2p + mm_hm_f2p );
 
     // Total amplitudes
     EvtComplex Amp_tot_plus = f_PHSP *
                               ( Amp_p_NR + Amp_p_f0 + Amp_p_phi + Amp_p_f2p );
     EvtComplex Amp_tot_minus = f_PHSP *
                                ( Amp_m_NR + Amp_m_f0 + Amp_m_phi + Amp_m_f2p );
 
     vertex( 0, 0, 0.0 );
     vertex( 0, 1, Amp_tot_plus );
     vertex( 1, 0, Amp_tot_minus );
     vertex( 1, 1, 0.0 );
 }
 
 // Rho function
 EvtComplex EvtBsMuMuKK::GetRho( const double m0, const double m ) const
 {
     double rho_sq = 1.0 - ( 4.0 * m0 * m0 / ( m * m ) );
     EvtComplex rho;
 
     if ( rho_sq > 0.0 ) {
         rho = EvtComplex( sqrt( rho_sq ), 0.0 );
     } else {
         rho = EvtComplex( 0.0, sqrt( -rho_sq ) );
     }
 
     return rho;
 }
 
 // Flatte function
 EvtComplex EvtBsMuMuKK::Flatte( const double m0, const double m ) const
 {
     double gpipi = 0.167;
     double gKK = 3.05 * gpipi;
 
     EvtComplex term1 = ( 2.0 * GetRho( m_Mpip, m ) + GetRho( m_Mpi0, m ) ) / 3.0;
     EvtComplex term2 = ( GetRho( m_MKp, m ) + GetRho( m_MK0, m ) ) / 2.0;
 
     EvtComplex w = gpipi * term1 + gKK * term2;
 
     EvtComplex Flatte_0 = 1.0 / ( m0 * m0 - m * m - I * m0 * w );
 
     return Flatte_0;
 }
 
 // Breit-Wigner function
 EvtComplex EvtBsMuMuKK::Breit_Wigner( const double Gamma0, const double m0,
                                       const double m, const int J,
                                       const double q0, const double q ) const
 {
     double X_J_q0_sq = pow( X_J( J, q0, 0 ), 2 );
     double X_J_q_sq = pow( X_J( J, q, 0 ), 2 );
 
     double Gamma = Gamma0 * pow( q / q0, 2 * J + 1 ) * ( m0 / m ) *
                    ( X_J_q_sq / X_J_q0_sq );
 
     return 1.0 / ( m0 * m0 - m * m - I * m0 * Gamma );
 }
 
 // Integral
 double EvtBsMuMuKK::Integral( const double Gamma0, const double m0, const int JR,
                               const int JB, const double q0, const double M_KK_ll,
                               const double M_KK_ul, const int fcntype ) const
 {
-    int bins = 1000;
-    double bin_width = ( M_KK_ul - M_KK_ll ) / static_cast<double>( bins );
+    const int bins = 1000;
+    const double bin_width = ( M_KK_ul - M_KK_ll ) / static_cast<double>( bins );
+    const double sumMKpKm2 = pow( m_MKp + m_MKm, 2 );
+    const double diffMKpKm2 = pow( m_MKp - m_MKm, 2 );
+    const double MBs2 = pow( m_MBs, 2 );
+
     EvtComplex integral( 0.0, 0.0 );
-    double sumMKpKm2 = pow( m_MKp + m_MKm, 2 );
-    double diffMKpKm2 = pow( m_MKp - m_MKm, 2 );
-    double MBs2 = pow( m_MBs, 2 );
 
     for ( int i = 0; i < bins; i++ ) {
-        double M_KK_i = M_KK_ll + static_cast<double>( i ) * bin_width;
-        double M_KK_f = M_KK_ll + static_cast<double>( i + 1 ) * bin_width;
-        double M_KK_i_sq = M_KK_i * M_KK_i;
-        double M_KK_f_sq = M_KK_f * M_KK_f;
-
-        double p3Kp_KK_CMS_i = sqrt( ( M_KK_i_sq - sumMKpKm2 ) *
-                                     ( M_KK_i_sq - diffMKpKm2 ) ) /
-                               ( 2.0 * M_KK_i );
-        double p3Kp_KK_CMS_f = sqrt( ( M_KK_f_sq - sumMKpKm2 ) *
-                                     ( M_KK_f_sq - diffMKpKm2 ) ) /
-                               ( 2.0 * M_KK_f );
-
-        double p3Jpsi_Bs_CMS_i = sqrt( ( MBs2 - pow( M_KK_i + m_MJpsi, 2 ) ) *
-                                       ( MBs2 - pow( M_KK_i - m_MJpsi, 2 ) ) ) /
-                                 ( 2.0 * m_MBs );
-        double p3Jpsi_Bs_CMS_f = sqrt( ( MBs2 - pow( M_KK_f + m_MJpsi, 2 ) ) *
-                                       ( MBs2 - pow( M_KK_f - m_MJpsi, 2 ) ) ) /
-                                 ( 2.0 * m_MBs );
-
-        double f_PHSP_i = sqrt( p3Kp_KK_CMS_i * p3Jpsi_Bs_CMS_i );
-        double f_PHSP_f = sqrt( p3Kp_KK_CMS_f * p3Jpsi_Bs_CMS_f );
-
-        double f_MBF_KK_i = pow( p3Kp_KK_CMS_i, JR );
-        double f_MBF_KK_f = pow( p3Kp_KK_CMS_f, JR );
-
-        double f_MBF_Bs_i = pow( p3Jpsi_Bs_CMS_i, JB );
-        double f_MBF_Bs_f = pow( p3Jpsi_Bs_CMS_f, JB );
-
-        double X_JR_i = X_J( JR, p3Kp_KK_CMS_i, 0 );
-        double X_JR_f = X_J( JR, p3Kp_KK_CMS_f, 0 );
-
-        double X_JB_i = X_J( JB, p3Jpsi_Bs_CMS_i, 1 );
-        double X_JB_f = X_J( JB, p3Jpsi_Bs_CMS_f, 1 );
+        const double M_KK_i = M_KK_ll + static_cast<double>( i ) * bin_width;
+        const double M_KK_f = M_KK_ll + static_cast<double>( i + 1 ) * bin_width;
+        const double M_KK_i_sq = M_KK_i * M_KK_i;
+        const double M_KK_f_sq = M_KK_f * M_KK_f;
+
+        const double p3Kp_KK_CMS_i = sqrt( ( M_KK_i_sq - sumMKpKm2 ) *
+                                           ( M_KK_i_sq - diffMKpKm2 ) ) /
+                                     ( 2.0 * M_KK_i );
+        const double p3Kp_KK_CMS_f = sqrt( ( M_KK_f_sq - sumMKpKm2 ) *
+                                           ( M_KK_f_sq - diffMKpKm2 ) ) /
+                                     ( 2.0 * M_KK_f );
+
+        const double p3Jpsi_Bs_CMS_i =
+            sqrt( ( MBs2 - pow( M_KK_i + m_MJpsi, 2 ) ) *
+                  ( MBs2 - pow( M_KK_i - m_MJpsi, 2 ) ) ) /
+            ( 2.0 * m_MBs );
+        const double p3Jpsi_Bs_CMS_f =
+            sqrt( ( MBs2 - pow( M_KK_f + m_MJpsi, 2 ) ) *
+                  ( MBs2 - pow( M_KK_f - m_MJpsi, 2 ) ) ) /
+            ( 2.0 * m_MBs );
+
+        const double f_PHSP_i = sqrt( p3Kp_KK_CMS_i * p3Jpsi_Bs_CMS_i );
+        const double f_PHSP_f = sqrt( p3Kp_KK_CMS_f * p3Jpsi_Bs_CMS_f );
+
+        const double f_MBF_KK_i = pow( p3Kp_KK_CMS_i, JR );
+        const double f_MBF_KK_f = pow( p3Kp_KK_CMS_f, JR );
+
+        const double f_MBF_Bs_i = pow( p3Jpsi_Bs_CMS_i, JB );
+        const double f_MBF_Bs_f = pow( p3Jpsi_Bs_CMS_f, JB );
+
+        const double X_JR_i = X_J( JR, p3Kp_KK_CMS_i, 0 );
+        const double X_JR_f = X_J( JR, p3Kp_KK_CMS_f, 0 );
+
+        const double X_JB_i = X_J( JB, p3Jpsi_Bs_CMS_i, 1 );
+        const double X_JB_f = X_J( JB, p3Jpsi_Bs_CMS_f, 1 );
 
         EvtComplex fcn_i( 1.0, 0.0 ), fcn_f( 1.0, 0.0 );
 
         if ( fcntype == 1 ) {
             fcn_i = Flatte( m0, M_KK_i );
             fcn_f = Flatte( m0, M_KK_f );
 
         } else if ( fcntype == 2 ) {
             fcn_i = Breit_Wigner( Gamma0, m0, M_KK_i, JR, q0, p3Kp_KK_CMS_i );
             fcn_f = Breit_Wigner( Gamma0, m0, M_KK_f, JR, q0, p3Kp_KK_CMS_f );
         }
 
-        EvtComplex a_i = f_PHSP_i * f_MBF_KK_i * f_MBF_Bs_i * X_JR_i * X_JB_i *
-                         fcn_i;
-        EvtComplex a_st_i = conj( a_i );
-        EvtComplex a_f = f_PHSP_f * f_MBF_KK_f * f_MBF_Bs_f * X_JR_f * X_JB_f *
-                         fcn_f;
-        EvtComplex a_st_f = conj( a_f );
+        const EvtComplex a_i = f_PHSP_i * f_MBF_KK_i * f_MBF_Bs_i * X_JR_i *
+                               X_JB_i * fcn_i;
+        const EvtComplex a_st_i = conj( a_i );
+        const EvtComplex a_f = f_PHSP_f * f_MBF_KK_f * f_MBF_Bs_f * X_JR_f *
+                               X_JB_f * fcn_f;
+        const EvtComplex a_st_f = conj( a_f );
 
         integral += 0.5 * bin_width * ( a_i * a_st_i + a_f * a_st_f );
     }
 
     return sqrt( abs2( integral ) );
 }
 
 // Blatt-Weisskopf barrier factors
 double EvtBsMuMuKK::X_J( const int J, const double q, const int isB ) const
 {
     double r_BW = 1.0;
 
     if ( isB == 0 ) {
         r_BW = 1.5;
     } else if ( isB == 1 ) {
         r_BW = 5.0;
     }
 
     double zsq = pow( r_BW * q, 2 );
 
     double X_J( 1.0 );
 
     if ( J == 1 ) {
         X_J = sqrt( 1.0 / ( 1.0 + zsq ) );
     } else if ( J == 2 ) {
         X_J = sqrt( 1.0 / ( zsq * zsq + 3.0 * zsq + 9.0 ) );
     }
 
     return X_J;
 }
 
 // EvtGen d matrix: Input is 2J instead of J etc
 double EvtBsMuMuKK::Wignerd( const int J, const int l, const int alpha,
                              const double theta ) const
 {
     return EvtdFunction::d( 2 * J, 2 * l, 2 * alpha, theta );
 }
 
 // J spin of KK, l spin proj of J/psi, alpha dimuon spin
 EvtComplex EvtBsMuMuKK::AngularDist( const int J, const int l, const int alpha,
                                      const double cK, const double cL,
                                      const double chi ) const
 {
     double thetaL = acos( cL );
     double thetaK = acos( cK );
 
     EvtComplex out = 0.5 * sqrt( ( 2 * J + 1 ) / pi ) *
                      exp( EvtComplex( 0, -l * chi ) );
 
     out *= Wignerd( 1, l, alpha, thetaL ) * Wignerd( J, -l, 0, thetaK );
 
     return out;
 }
 
 // Time-dependent amplitude calculation
 EvtComplex EvtBsMuMuKK::AmpTime( const int q, const EvtComplex& gplus,
                                  const EvtComplex& gminus, const double delta,
                                  const double lambda_abs, const double Amp,
                                  const double phis, const int eta ) const
 {
     EvtComplex amp_time = Amp * EvtComplex( cos( -delta ), sin( -delta ) );
     double qphis = q * phis;
     amp_time *= ( gplus + eta * pow( lambda_abs, -1.0 * q ) *
                               EvtComplex( cos( qphis ), sin( qphis ) ) * gminus );
 
     if ( q == 1 ) {
         amp_time *= eta;
     }
 
     return amp_time;
 }
diff --git a/src/EvtGenModels/EvtBsquark.cpp b/src/EvtGenModels/EvtBsquark.cpp
index b91be3a..76e6858 100644
--- a/src/EvtGenModels/EvtBsquark.cpp
+++ b/src/EvtGenModels/EvtBsquark.cpp
@@ -1,203 +1,203 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBsquark.hh"
 
 #include "EvtGenBase/EvtDiracParticle.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGammaMatrix.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <iostream>
 #include <string>
 
-std::string EvtBsquark::getName()
+std::string EvtBsquark::getName() const
 {
     return "BSQUARK";
 }
 
-EvtDecayBase* EvtBsquark::clone()
+EvtDecayBase* EvtBsquark::clone() const
 {
     return new EvtBsquark;
 }
 
 void EvtBsquark::init()
 {
     // check that there are 5 arguments
     checkNArg( 5 );
 }
 
 void EvtBsquark::initProbMax()
 {
     setProbMax( 1e-6 );
 }
 
 void EvtBsquark::decay( EvtParticle* p )
 {
-    static EvtId cquark = EvtPDL::getId( "c" );
-    static EvtId anticquark = EvtPDL::getId( "anti-c" );
+    static const EvtId cquark = EvtPDL::getId( "c" );
+    static const EvtId anticquark = EvtPDL::getId( "anti-c" );
 
-    static EvtIdSet leptons{ "e-", "mu-", "tau-" };
+    static const EvtIdSet leptons{ "e-", "mu-", "tau-" };
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     int charge = 1;
 
     EvtParticle* lepton;
     lepton = p->getDaug( 1 );
     if ( leptons.contains( lepton->getId() ) ) {
         charge = -1;
     }
 
     EvtDiracParticle charmquark;
 
     //this is a very crude approximation...
     if ( charge == -1 ) {
         charmquark.init( cquark, p->getDaug( 0 )->getP4() );
     } else {
         charmquark.init( anticquark, p->getDaug( 0 )->getP4() );
     }
 
     EvtVector4R p4c = p->getDaug( 0 )->getP4();
 
     EvtVector4R p4sn = p->getDaug( 2 )->getP4();
 
     EvtVector4R p4b( p->mass(), 0.0, 0.0, 0.0 );
 
     EvtComplex M[2][2];
 
     int il, ic;
 
     //project out the right handed current
     EvtGammaMatrix PR = 0.5 * ( EvtGammaMatrix::id() + EvtGammaMatrix::g5() );
 
     double tanbeta = getArg( 1 );
     double cosbeta = cos( atan( tanbeta ) );
     double sinbeta = sin( atan( tanbeta ) );
 
     double mb = 4.9;
     double mc = 1.3;
     double mw = 80.4;
 
     double Mass = getArg( 2 );
     double mu = getArg( 3 );
     double mchargino = getArg( 4 );
 
     double tan2phim = 2 * sqrt( 2.0 ) * mw * ( mu * cosbeta + Mass * sinbeta ) /
                       ( Mass * Mass - mu * mu +
                         2 * mw * mw * cos( 2 * atan( tanbeta ) ) );
 
     double phim = 0.5 * atan( tan2phim );
 
     EvtComplex U11 = cos( phim );
     EvtComplex U12 = sin( phim );
     EvtComplex U21 = -sin( phim );
     EvtComplex U22 = cos( phim );
 
     double tan2phip = 2 * sqrt( 2.0 ) * mw * ( mu * cosbeta + Mass * sinbeta ) /
                       ( Mass * Mass - mu * mu -
                         2 * mw * mw * cos( 2 * atan( tanbeta ) ) );
 
     double phip = 0.5 * atan( tan2phip );
 
     EvtComplex V11 = cos( phip );
     EvtComplex V12 = sin( phip );
     EvtComplex V21 = -sin( phip );
     EvtComplex V22 = cos( phip );
 
     double theta = getArg( 0 );
     double ctheta = cos( theta );
     double stheta = sin( theta );
 
     double vcsb = 0.08;
     double mchi1 = mchargino;
     double mchi2 = mchargino;
 
     //overall scale factor
     double g = 1.0;
 
     EvtComplex a1 = mchi1 * ( U11 * ctheta - mb * U12 * stheta /
                                                  ( sqrt( 2.0 ) * mw * cosbeta ) );
     EvtComplex a2 = mchi2 * ( U21 * ctheta - mb * U22 * stheta /
                                                  ( sqrt( 2.0 ) * mw * cosbeta ) );
 
     EvtComplex b1 = mc * conj( V12 ) * ctheta / ( sqrt( 2.0 ) * mw * sinbeta );
     EvtComplex b2 = mc * conj( V22 ) * ctheta / ( sqrt( 2.0 ) * mw * sinbeta );
 
     EvtComplex f1 = -( g * g * V11 * vcsb ) /
                     ( ( p4b - p4c ).mass2() - mchi1 * mchi1 );
     EvtComplex f2 = -( g * g * V21 * vcsb ) /
                     ( ( p4b - p4c ).mass2() - mchi1 * mchi2 );
 
     //EvtGenReport(EVTGEN_INFO,"EvtGen") <<g<<" "<<V11<<" "<<FL<<" "<<vcsb<<" "<<mchi1<<endl;
     //EvtGenReport(EVTGEN_INFO,"EvtGen") << "f1:"<<f1<<" "<<(p4b-p4c).mass2()<<endl;
     //EvtGenReport(EVTGEN_INFO,"EvtGen") << "f2:"<<f2<<" "<<(p4b-p4c).mass2()<<endl;
 
     //EvtGenReport(EVTGEN_INFO,"EvtGen") << "p4sn:"<<p4sn<<endl;
 
     EvtGammaMatrix pslash = p4sn.get( 0 ) * EvtGammaMatrix::g0() -
                             p4sn.get( 1 ) * EvtGammaMatrix::g1() -
                             p4sn.get( 2 ) * EvtGammaMatrix::g2() -
                             p4sn.get( 3 ) * EvtGammaMatrix::g3();
 
     //EvtGenReport(EVTGEN_INFO,"EvtGen") << "pslash:"<<pslash<<endl;
 
     for ( il = 0; il < 2; il++ ) {
         for ( ic = 0; ic < 2; ic++ ) {
             EvtComplex a = 0.0;
             EvtComplex b = 0.0;
 
             if ( charge == -1 ) {
                 a = charmquark.spParent( ic ) * ( PR * lepton->spParent( il ) );
                 b = charmquark.spParent( ic ) *
                     ( ( pslash * PR ) * lepton->spParent( il ) );
             } else {
                 a = lepton->spParent( il ) * ( PR * charmquark.spParent( ic ) );
                 b = lepton->spParent( il ) *
                     ( ( pslash * PR ) * charmquark.spParent( ic ) );
             }
 
             //EvtGenReport(EVTGEN_INFO,"EvtGen") <<"pslash*PR:"<<pslash*PR<<endl;
             //EvtGenReport(EVTGEN_INFO,"EvtGen") <<"sp charm:"<<charmquark.spParent(ic)<<endl;
             //EvtGenReport(EVTGEN_INFO,"EvtGen") <<"sp lepton:"<<lepton->spParent(il)<<endl;
 
             M[ic][il] = f1 * ( a1 * a + b1 * b ) + f2 * ( a2 * a + b2 * b );
 
             //EvtGenReport(EVTGEN_INFO,"EvtGen") << "Contr1:"<<a1<<" "<<a<<" "<<b1<<" "<<b<<endl;
             //EvtGenReport(EVTGEN_INFO,"EvtGen") << "Contr2:"<<a2<<" "<<a<<" "<<b2<<" "<<b<<endl;
 
             //EvtGenReport(EVTGEN_INFO,"EvtGen") <<"case1:"<<f1<<" "<<a1<<" "<<b1<<" "<<a<<" "<<b<<endl;
             //EvtGenReport(EVTGEN_INFO,"EvtGen") <<"case2:"<<f2<<" "<<a2<<" "<<b2<<" "<<a<<" "<<b<<endl;
         }
     }
 
     double prob = real( M[0][0] * conj( M[0][0] ) + M[1][0] * conj( M[1][0] ) +
                         M[0][1] * conj( M[0][1] ) + M[1][1] * conj( M[1][1] ) );
 
     //EvtGenReport(EVTGEN_INFO,"EvtGen") <<"prob:"<<prob<<endl;
 
     setProb( prob );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtBto2piCPiso.cpp b/src/EvtGenModels/EvtBto2piCPiso.cpp
index c22706c..25b7256 100644
--- a/src/EvtGenModels/EvtBto2piCPiso.cpp
+++ b/src/EvtGenModels/EvtBto2piCPiso.cpp
@@ -1,240 +1,240 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBto2piCPiso.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtBto2piCPiso::getName()
+std::string EvtBto2piCPiso::getName() const
 {
     return "BTO2PI_CP_ISO";
 }
 
-EvtDecayBase* EvtBto2piCPiso::clone()
+EvtDecayBase* EvtBto2piCPiso::clone() const
 {
     return new EvtBto2piCPiso;
 }
 
 void EvtBto2piCPiso::init()
 {
     // check that there are 10 arguments
 
     checkNArg( 10 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtBto2piCPiso::initProbMax()
 {
     //added by Lange Jan4,2000
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
 
     //this may need to be revised
 
     if ( ( ( getDaugs()[0] == PIP ) && ( getDaugs()[1] == PIM ) ) ||
          ( ( getDaugs()[0] == PIM ) && ( getDaugs()[1] == PIP ) ) ) {
         setProbMax( 4.0 *
                     ( getArg( 2 ) * getArg( 2 ) + getArg( 4 ) * getArg( 4 ) ) );
     }
 
     if ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PI0 ) ) {
         setProbMax( 2.0 * ( 4.0 * getArg( 2 ) * getArg( 2 ) +
                             getArg( 4 ) * getArg( 4 ) ) );
     }
 
     if ( ( ( getDaugs()[0] == PIP ) && ( getDaugs()[1] == PI0 ) ) ||
          ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PIP ) ) ) {
         setProbMax( 6.0 * getArg( 2 ) * getArg( 2 ) );
     }
 
     if ( ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PIM ) ) ||
          ( ( getDaugs()[0] == PIM ) && ( getDaugs()[1] == PI0 ) ) ) {
         setProbMax( 6.0 * getArg( 4 ) * getArg( 4 ) );
     }
 }
 
 void EvtBto2piCPiso::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
 
     double t;
     EvtId other_b;
     int charged = 0;
 
     //randomly generate the tag (B0 or B0B)
 
     double tag = EvtRandom::Flat( 0.0, 1.0 );
     if ( tag < 0.5 ) {
         EvtCPUtil::getInstance()->OtherB( p, t, other_b, 1.0 );
         other_b = B0;
     } else {
         EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.0 );
         other_b = B0B;
     }
 
     EvtComplex amp;
 
     EvtComplex A, Abar;
     EvtComplex A2, A2_bar, A0, A0_bar;
 
     A2 = EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                      getArg( 2 ) * sin( getArg( 3 ) ) );
     A2_bar = EvtComplex( getArg( 4 ) * cos( getArg( 5 ) ),
                          getArg( 4 ) * sin( getArg( 5 ) ) );
 
     A0 = EvtComplex( getArg( 6 ) * cos( getArg( 7 ) ),
                      getArg( 6 ) * sin( getArg( 7 ) ) );
     A0_bar = EvtComplex( getArg( 8 ) * cos( getArg( 9 ) ),
                          getArg( 8 ) * sin( getArg( 9 ) ) );
 
     //depending on what combination of pi pi we have, there will be different
     //A and Abar
 
     if ( ( ( getDaugs()[0] == PIP ) && ( getDaugs()[1] == PI0 ) ) ||
          ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PIP ) ) ) {
         //pi+ pi0, so just A_2
 
         charged = 1;
         A = 3.0 * A2;
     }
 
     if ( ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PIM ) ) ||
          ( ( getDaugs()[0] == PIM ) && ( getDaugs()[1] == PI0 ) ) ) {
         //pi- pi0, so just A2_bar
 
         charged = 1;
         A = 3.0 * A2_bar;
     }
 
     if ( ( ( getDaugs()[0] == PIP ) && ( getDaugs()[1] == PIM ) ) ||
          ( ( getDaugs()[0] == PIM ) && ( getDaugs()[1] == PIP ) ) ) {
         //pi+ pi-, so A_2 - A_0
 
         charged = 0;
         A = sqrt( 2.0 ) * ( A2 - A0 );
         Abar = sqrt( 2.0 ) * ( A2_bar - A0_bar );
     }
 
     if ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PI0 ) ) {
         //pi0 pi0, so 2*A_2 + A_0
 
         charged = 0;
         A = 2.0 * A2 + A0;
         Abar = 2.0 * A2_bar + A0_bar;
     }
 
     if ( charged == 0 ) {
         if ( other_b == B0B ) {
             amp = A * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
                   EvtComplex( cos( -2.0 * getArg( 0 ) ),
                               sin( -2.0 * getArg( 0 ) ) ) *
                       EvtComplex( 0.0, 1.0 ) * Abar *
                       sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
         }
         if ( other_b == B0 ) {
             amp = A *
                       EvtComplex( cos( 2.0 * getArg( 0 ) ),
                                   sin( 2.0 * getArg( 0 ) ) ) *
                       EvtComplex( 0.0, 1.0 ) *
                       sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
                   Abar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
         }
     } else
         amp = A;
 
     vertex( amp );
 
     return;
 }
 
 std::string EvtBto2piCPiso::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "weakPhase";
         case 1:
             return "deltaM";
         case 2:
             return "A2";
         case 3:
             return "A2Phase";
         case 4:
             return "A2bar";
         case 5:
             return "A2barPhase";
         case 6:
             return "A0";
         case 7:
             return "A0Phase";
         case 8:
             return "A0bar";
         case 9:
             return "A0barPhase";
         default:
             return "";
     }
 }
 
 std::string EvtBto2piCPiso::getParamDefault( int i )
 {
     switch ( i ) {
         case 2:
             return "1.0";
         case 3:
             return "0.0";
         case 4:
             return "1.0";
         case 5:
             return "0.0";
         case 6:
             return "1.0";
         case 7:
             return "0.0";
         case 8:
             return "1.0";
         case 9:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtBtoKD3P.cpp b/src/EvtGenModels/EvtBtoKD3P.cpp
index 70499d0..cc740f0 100644
--- a/src/EvtGenModels/EvtBtoKD3P.cpp
+++ b/src/EvtGenModels/EvtBtoKD3P.cpp
@@ -1,227 +1,227 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBtoKD3P.hh"
 
 #include "EvtGenBase/EvtCyclic3.hh"
 #include "EvtGenBase/EvtDalitzPoint.hh"
 #include "EvtGenBase/EvtDecayTable.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtPto3P.hh"
 
 #include <assert.h>
 using std::endl;
 
 //------------------------------------------------------------------
-EvtDecayBase* EvtBtoKD3P::clone()
+EvtDecayBase* EvtBtoKD3P::clone() const
 {
     return new EvtBtoKD3P();
 }
 
 //------------------------------------------------------------------
-std::string EvtBtoKD3P::getName()
+std::string EvtBtoKD3P::getName() const
 {
     return "BTOKD3P";
 }
 
 //------------------------------------------------------------------
 void EvtBtoKD3P::init()
 {
     checkNArg( 2 );     // r, phase
     checkNDaug( 3 );    // K, D0(allowed), D0(suppressed).
                         // The last two daughters are really one particle
 
     // check that the mother and all daughters are scalars:
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 
     // Check that the B dtr types are K D D:
 
     // get the parameters:
     m_r = getArg( 0 );
     double phase = getArg( 1 );
     m_exp = EvtComplex( cos( phase ), sin( phase ) );
 }
 
 //------------------------------------------------------------------
 void EvtBtoKD3P::initProbMax()
 {
     setProbMax( 1 );    // this is later changed in decay()
 }
 
 //------------------------------------------------------------------
 void EvtBtoKD3P::decay( EvtParticle* p )
 {
     // tell the subclass that we decay the daughter:
     m_daugsDecayedByParentModel = true;
 
     // the K is the 1st daughter of the B EvtParticle.
     // The decay mode of the allowed D (the one produced in b->c decay) is 2nd
     // The decay mode of the suppressed D (the one produced in b->u decay) is 3rd
     const int KIND = 0;
     const int D1IND = 1;
     const int D2IND = 2;
 
     // generate kinematics of daughters (K and D):
     EvtId tempDaug[2] = { getDaug( KIND ), getDaug( D1IND ) };
     p->initializePhaseSpace( 2, tempDaug );
 
     // Get the D daughter particle and the decay models of the allowed
     // and suppressed D modes:
     EvtParticle* theD = p->getDaug( D1IND );
     EvtPto3P* model1 =
         (EvtPto3P*)( EvtDecayTable::getInstance()->getDecayFunc( theD ) );
 
     // For the suppressed mode, re-initialize theD as the suppressed D alias.
     // First set the id, then re-initialize (since it matches the expected id)
     theD->setId( getDaug( D2IND ) );
     theD->init( getDaug( D2IND ), theD->getP4() );
     EvtPto3P* model2 =
         (EvtPto3P*)( EvtDecayTable::getInstance()->getDecayFunc( theD ) );
 
     // on the first call:
     if ( false == m_decayedOnce ) {
         m_decayedOnce = true;
 
         // store the D decay model pointers:
         m_model1 = model1;
         m_model2 = model2;
 
         // check the decay models of the first 2 daughters and that they
         // have the same final states:
         std::string name1 = model1->getName();
         std::string name2 = model2->getName();
 
         if ( name1 != "PTO3P" ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "D daughters of EvtBtoKD3P decay must decay via the \"PTO3P\" model"
                 << endl
                 << "    but found to decay via " << name1.c_str() << " or "
                 << name2.c_str() << ". Will terminate execution!" << endl;
             assert( 0 );
         }
 
-        EvtId* daugs1 = model1->getDaugs();
-        EvtId* daugs2 = model2->getDaugs();
+        const EvtId* daugs1 = model1->getDaugs();
+        const EvtId* daugs2 = model2->getDaugs();
 
         bool idMatch = true;
         int d;
         for ( d = 0; d < 2; ++d ) {
             if ( daugs1[d] != daugs2[d] ) {
                 idMatch = false;
             }
         }
         if ( false == idMatch ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "D daughters of EvtBtoKD3P decay must decay to the same final state"
                 << endl
                 << "   particles in the same order (not CP-conjugate order),"
                 << endl
                 << "   but they were found to decay to" << endl;
             for ( d = 0; d < model1->getNDaug(); ++d ) {
                 EvtGenReport( EVTGEN_ERROR, "" )
                     << "   " << EvtPDL::name( daugs1[d] ).c_str() << " ";
             }
             EvtGenReport( EVTGEN_ERROR, "" ) << endl;
             for ( d = 0; d < model1->getNDaug(); ++d ) {
                 EvtGenReport( EVTGEN_ERROR, "" )
                     << "   " << EvtPDL::name( daugs2[d] ).c_str() << " ";
             }
             EvtGenReport( EVTGEN_ERROR, "" )
                 << endl
                 << ". Will terminate execution!" << endl;
             assert( 0 );
         }
 
         // estimate the probmax. Need to know the probmax's of the 2
         // models for this:
         setProbMax(
             model1->getProbMax( 0 ) + m_r * m_r * model2->getProbMax( 0 ) +
             2 * m_r * sqrt( model1->getProbMax( 0 ) * model2->getProbMax( 0 ) ) );
 
     }    // end of things to do on the first call
 
     // make sure the models haven't changed since the first call:
     if ( m_model1 != model1 || m_model2 != model2 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "D daughters of EvtBtoKD3P decay should have only 1 decay modes, "
             << endl
             << "    but a new decay mode was found after the first call" << endl
             << "    Will terminate execution!" << endl;
         assert( 0 );
     }
 
     // Reset the D id to the 1st D
     theD->setId( getDaug( D1IND ) );
     theD->init( getDaug( D1IND ), theD->getP4() );
 
     // get the cover function for each of the models and add them up.
     // They are summed with coefficients 1 because we are willing to
     // take a small inefficiency (~50%) in order to ensure that the
     // cover function is large enough without getting into complications
     // associated with the smallness of m_r:
     EvtPdfSum<EvtDalitzPoint>* pc1 = model1->getPC();
     EvtPdfSum<EvtDalitzPoint>* pc2 = model2->getPC();
     EvtPdfSum<EvtDalitzPoint> pc;
     pc.addTerm( 1.0, *pc1 );
     pc.addTerm( 1.0, *pc2 );
 
     // from this combined cover function, generate the Dalitz point:
     EvtDalitzPoint x = pc.randomPoint();
 
     // get the aptitude for each of the models on this point and add them up:
     EvtComplex amp1 = model1->amplNonCP( x );
     EvtComplex amp2 = model2->amplNonCP( x );
     EvtComplex amp = amp1 + amp2 * m_r * m_exp;
 
     // get the value of the cover function for this point and set the
     // relative amplitude for this decay:
 
     double comp = sqrt( pc.evaluate( x ) );
     vertex( amp / comp );
 
     // Make the daughters of theD:
     bool massTreeOK = theD->generateMassTree();
     if ( massTreeOK == false ) {
         return;
     }
 
     // Now generate the p4's of the daughters of theD:
     std::vector<EvtVector4R> v = model2->initDaughters( x );
 
     if ( v.size() != theD->getNDaug() ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Number of daughters " << theD->getNDaug() << " != "
             << "Momentum vector size " << v.size() << endl
             << "     Terminating execution." << endl;
         assert( 0 );
     }
 
     // Apply the new p4's to the daughters:
     for ( unsigned int i = 0; i < theD->getNDaug(); ++i ) {
         theD->getDaug( i )->init( model2->getDaugs()[i], v[i] );
     }
 }
diff --git a/src/EvtGenModels/EvtBtoKpiCPiso.cpp b/src/EvtGenModels/EvtBtoKpiCPiso.cpp
index d6ddf4a..2253a79 100644
--- a/src/EvtGenModels/EvtBtoKpiCPiso.cpp
+++ b/src/EvtGenModels/EvtBtoKpiCPiso.cpp
@@ -1,200 +1,200 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBtoKpiCPiso.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtBtoKpiCPiso::getName()
+std::string EvtBtoKpiCPiso::getName() const
 {
     return "BTOKPI_CP_ISO";
 }
 
-EvtDecayBase* EvtBtoKpiCPiso::clone()
+EvtDecayBase* EvtBtoKpiCPiso::clone() const
 {
     return new EvtBtoKpiCPiso;
 }
 
 void EvtBtoKpiCPiso::init()
 {
     // check that there are 14 arguments
     checkNArg( 14 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtBtoKpiCPiso::initProbMax()
 {
     //this might need to be revised
 
     //added by Lange Jan4,2000
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId K0 = EvtPDL::getId( "K0" );
-    static EvtId KB = EvtPDL::getId( "anti-K0" );
-    static EvtId KP = EvtPDL::getId( "K+" );
-    static EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId K0 = EvtPDL::getId( "K0" );
+    static const EvtId KB = EvtPDL::getId( "anti-K0" );
+    static const EvtId KP = EvtPDL::getId( "K+" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
 
     if ( ( ( getDaug( 0 ) == PI0 ) && ( getDaug( 1 ) == KP ) ) ||
          ( ( getDaug( 0 ) == KP ) && ( getDaug( 1 ) == PI0 ) ) ) {
         setProbMax(
             2.0 * ( getArg( 2 ) * getArg( 2 ) + getArg( 10 ) * getArg( 10 ) ) );
     }
 
     if ( ( ( getDaug( 0 ) == PI0 ) && ( getDaug( 1 ) == KM ) ) ||
          ( ( getDaug( 0 ) == KM ) && ( getDaug( 1 ) == PI0 ) ) ) {
         setProbMax(
             2.0 * ( getArg( 4 ) * getArg( 4 ) + getArg( 12 ) * getArg( 12 ) ) );
     }
 
     if ( ( ( getDaug( 0 ) == PIP ) && ( getDaug( 1 ) == K0 ) ) ||
          ( ( getDaug( 0 ) == K0 ) && ( getDaug( 1 ) == PIP ) ) ) {
         setProbMax(
             4.0 * ( getArg( 6 ) * getArg( 6 ) + getArg( 10 ) * getArg( 10 ) ) );
     }
 
     if ( ( ( getDaug( 0 ) == PIM ) && ( getDaug( 1 ) == KB ) ) ||
          ( ( getDaug( 0 ) == KB ) && ( getDaug( 1 ) == PIM ) ) ) {
         setProbMax(
             4.0 * ( getArg( 8 ) * getArg( 8 ) + getArg( 12 ) * getArg( 12 ) ) );
     }
 
     if ( ( ( getDaug( 0 ) == PI0 ) && ( getDaug( 1 ) == K0 ) ) ||
          ( ( getDaug( 0 ) == K0 ) && ( getDaug( 1 ) == PI0 ) ) ) {
         setProbMax(
             2.0 * ( getArg( 2 ) * getArg( 2 ) + getArg( 10 ) * getArg( 10 ) ) );
     }
 
     if ( ( ( getDaug( 0 ) == PI0 ) && ( getDaug( 1 ) == KB ) ) ||
          ( ( getDaug( 0 ) == KB ) && ( getDaug( 1 ) == PI0 ) ) ) {
         setProbMax(
             2.0 * ( getArg( 4 ) * getArg( 4 ) + getArg( 12 ) * getArg( 12 ) ) );
     }
 
     if ( ( ( getDaug( 0 ) == PIM ) && ( getDaug( 1 ) == KP ) ) ||
          ( ( getDaug( 0 ) == KP ) && ( getDaug( 1 ) == PIM ) ) ) {
         setProbMax(
             4.0 * ( getArg( 6 ) * getArg( 6 ) + getArg( 10 ) * getArg( 10 ) ) );
     }
 
     if ( ( ( getDaug( 0 ) == PIP ) && ( getDaug( 1 ) == KM ) ) ||
          ( ( getDaug( 0 ) == KM ) && ( getDaug( 1 ) == PIP ) ) ) {
         setProbMax(
             4.0 * ( getArg( 8 ) * getArg( 8 ) + getArg( 12 ) * getArg( 12 ) ) );
     }
 }
 
 void EvtBtoKpiCPiso::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     //added by Lange Jan4,2000
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId K0 = EvtPDL::getId( "K0" );
-    static EvtId KB = EvtPDL::getId( "anti-K0" );
-    static EvtId KP = EvtPDL::getId( "K+" );
-    static EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId K0 = EvtPDL::getId( "K0" );
+    static const EvtId KB = EvtPDL::getId( "anti-K0" );
+    static const EvtId KP = EvtPDL::getId( "K+" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
 
     EvtComplex A;
     EvtComplex U, Ubar, V, Vbar, W, Wbar;
 
     U = EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                     getArg( 2 ) * sin( getArg( 3 ) ) );
     Ubar = EvtComplex( getArg( 4 ) * cos( getArg( 5 ) ),
                        getArg( 4 ) * sin( getArg( 5 ) ) );
     V = EvtComplex( getArg( 6 ) * cos( getArg( 7 ) ),
                     getArg( 6 ) * sin( getArg( 7 ) ) );
     Vbar = EvtComplex( getArg( 8 ) * cos( getArg( 9 ) ),
                        getArg( 8 ) * sin( getArg( 9 ) ) );
     W = EvtComplex( getArg( 10 ) * cos( getArg( 11 ) ),
                     getArg( 10 ) * sin( getArg( 11 ) ) );
     Wbar = EvtComplex( getArg( 12 ) * cos( getArg( 13 ) ),
                        getArg( 12 ) * sin( getArg( 13 ) ) );
 
     //depending on what combination of K pi we have, there will be different
     //A and Abar (only A given in comments!)
 
     if ( ( ( getDaug( 0 ) == PI0 ) && ( getDaug( 1 ) == KP ) ) ||
          ( ( getDaug( 0 ) == KP ) && ( getDaug( 1 ) == PI0 ) ) ) {
         //pi0 K+, so U - W
 
         A = U - W;
     }
 
     if ( ( ( getDaug( 0 ) == PI0 ) && ( getDaug( 1 ) == KM ) ) ||
          ( ( getDaug( 0 ) == KM ) && ( getDaug( 1 ) == PI0 ) ) ) {
         //pi0 K-, so Ubar - Wbar
 
         A = Ubar - Wbar;
     }
 
     if ( ( ( getDaug( 0 ) == PIP ) && ( getDaug( 1 ) == K0 ) ) ||
          ( ( getDaug( 0 ) == K0 ) && ( getDaug( 1 ) == PIP ) ) ) {
         //pi+ K0, so V + W
 
         A = sqrt( 2.0 ) * ( V + W );
     }
 
     if ( ( ( getDaug( 0 ) == PIM ) && ( getDaug( 1 ) == KB ) ) ||
          ( ( getDaug( 0 ) == KB ) && ( getDaug( 1 ) == PIM ) ) ) {
         //pi- K0bar, so Vbar + Wbar
         A = sqrt( 2.0 ) * ( Vbar + Wbar );
     }
 
     if ( ( ( getDaug( 0 ) == PI0 ) && ( getDaug( 1 ) == K0 ) ) ||
          ( ( getDaug( 0 ) == K0 ) && ( getDaug( 1 ) == PI0 ) ) ) {
         //pi0 K0, so U + W
 
         A = U + W;
     }
 
     if ( ( ( getDaug( 0 ) == PI0 ) && ( getDaug( 1 ) == KB ) ) ||
          ( ( getDaug( 0 ) == KB ) && ( getDaug( 1 ) == PI0 ) ) ) {
         A = Ubar + Wbar;
     }
 
     if ( ( ( getDaug( 0 ) == PIM ) && ( getDaug( 1 ) == KP ) ) ||
          ( ( getDaug( 0 ) == KP ) && ( getDaug( 1 ) == PIM ) ) ) {
         //pi- K+, so V - W
 
         A = sqrt( 2.0 ) * ( V - W );
     }
 
     if ( ( ( getDaug( 0 ) == PIP ) && ( getDaug( 1 ) == KM ) ) ||
          ( ( getDaug( 0 ) == KM ) && ( getDaug( 1 ) == PIP ) ) ) {
         A = sqrt( 2.0 ) * ( Vbar - Wbar );
     }
 
     vertex( A );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtBtoXsEtap.cpp b/src/EvtGenModels/EvtBtoXsEtap.cpp
index daab13d..d90ba3d 100644
--- a/src/EvtGenModels/EvtBtoXsEtap.cpp
+++ b/src/EvtGenModels/EvtBtoXsEtap.cpp
@@ -1,163 +1,163 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBtoXsEtap.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtBtoXsEtap::getName()
+std::string EvtBtoXsEtap::getName() const
 {
     return "BTOXSETAP";
 }
 
-EvtDecayBase* EvtBtoXsEtap::clone()
+EvtDecayBase* EvtBtoXsEtap::clone() const
 {
     return new EvtBtoXsEtap;
 }
 
 void EvtBtoXsEtap::init()
 {
     // check that there are no arguments
 
     checkNArg( 0 );
 }
 
 void EvtBtoXsEtap::initProbMax()
 {
     noProbMax();
 }
 
 void EvtBtoXsEtap::decay( EvtParticle* p )
 {
     // useless
     //  if ( p->getNDaug() != 0 ) {
     //  //Will end up here because maxrate multiplies by 1.2
     //  EvtGenReport(EVTGEN_DEBUG,"EvtGen") << "In EvtBtoXsEtap: X_s daughters should not be here!"<<endl;
     //  return;
     //}
 
     double m_b;
     int i;
     p->makeDaughters( getNDaug(), getDaugs() );
     EvtParticle* pdaug[MAX_DAUG];
 
     for ( i = 0; i < getNDaug(); i++ ) {
         pdaug[i] = p->getDaug( i );
     }
 
-    static EvtVector4R p4[MAX_DAUG];
-    static double mass[MAX_DAUG];
+    EvtVector4R p4[MAX_DAUG];
+    double mass[MAX_DAUG];
 
     m_b = p->mass();
 
     // Prepare for phase space routine.
 
     mass[1] = EvtPDL::getMass( getDaug( 1 ) );
 
     double xbox, ybox, min, max, hichfit;
     min = 0.493;
     max = 4.3;
     const double TwoPi = EvtConst::twoPi;
     int Xscode = EvtPDL::getStdHep( getDaug( 0 ) );
 
     // A five parameters fit, the shape is taken from Atwood & Soni
 
     //  double par[18];
     double par[6];
     if ( ( Xscode == 30343 ) || ( Xscode == -30343 ) || ( Xscode == 30353 ) ||
          ( Xscode == -30353 ) ) {    // Xsu or Xsd
         min = 0.6373;                //  Just above K pi threshold for Xsd/u
         //min=0.6333; //  K pi threshold for neutral Xsd
         //    par[0]=-2057.2380371094;
         par[0] = 2.36816;
         //    par[1]=2502.2556152344;
         par[1] = 0.62325725;
         //    par[2]=1151.5632324219;
         par[2] = 2.2;
         //    par[3]=0.82431584596634;
         par[3] = -0.2109375;
         //    par[4]=-4110.5234375000;
         par[4] = 2.7;
         //    par[5]=8445.6757812500;
         par[5] = 0.54;
         //    par[6]=-3034.1894531250;
         //    par[7]=1.1557708978653;
         //    par[8]=1765.9311523438;
         //    par[9]=1.3730158805847;
         //    par[10]=0.51371538639069;
         //    par[11]=2.0056934356689;
         //    par[12]=37144.097656250;
         //    par[13]=-50296.781250000;
         //    par[14]=27319.095703125;
         //    par[15]=-7408.0678710938;
         //    par[16]=1000.8093261719;
         //    par[17]=-53.834449768066;
     } else {
         EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
             << "In EvtBtoXsEtap: Particle with id " << Xscode
             << " is not a Xsd/u particle" << endl;
         return;
     }
 
     double boxheight = par[5];
     double boxwidth = max - min;
 
     mass[0] = 0.0;
     while ( ( mass[0] > max ) || ( mass[0] < min ) ) {
         xbox = EvtRandom::Flat( boxwidth ) + min;
         ybox = EvtRandom::Flat( boxheight );
         if ( xbox < par[2] ) {
             hichfit = ( 1 / sqrt( TwoPi * par[1] ) ) *
                       exp( -0.5 * pow( ( xbox - par[0] ) / par[1], 2 ) );
             //      alifit=par[0]+par[1]*xbox+par[2]*pow(xbox,2);
             //    } else if (xbox<par[7]) {
             //      alifit=par[4]+par[5]*xbox+par[6]*pow(xbox,2);
             //    } else if (xbox<par[11]) {
             //      alifit=par[8]*exp(-0.5*pow((xbox-par[9])/par[10],2));
         } else {
             hichfit = par[3] * pow( ( xbox - par[4] ), 2 ) + par[5];
             //      alifit=par[12]+par[13]*xbox+par[14]*pow(xbox,2)+par[15]*pow(xbox,3)+par[16]*pow(xbox,4)+par[17]*pow(xbox,5);
         }
         if ( ybox > hichfit ) {
             mass[0] = 0.0;
         } else {
             mass[0] = xbox;
         }
     }
 
     // debug stuff:  EvtGenReport(EVTGEN_INFO,"EvtGen") << "Xscode " << Xscode << " daughter 1 mass " << mass[0] << " daughter 2 mass " << mass[1] << endl;
 
     EvtGenKine::PhaseSpace( getNDaug(), mass, p4, m_b );
 
     for ( i = 0; i < getNDaug(); i++ ) {
         pdaug[i]->init( getDaugs()[i], p4[i] );
     }
 
     return;
 }
diff --git a/src/EvtGenModels/EvtBtoXsgamma.cpp b/src/EvtGenModels/EvtBtoXsgamma.cpp
index e0d254d..23ad596 100644
--- a/src/EvtGenModels/EvtBtoXsgamma.cpp
+++ b/src/EvtGenModels/EvtBtoXsgamma.cpp
@@ -1,129 +1,129 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBtoXsgamma.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtBtoXsgammaAliGreub.hh"
 #include "EvtGenModels/EvtBtoXsgammaFixedMass.hh"
 #include "EvtGenModels/EvtBtoXsgammaFlatEnergy.hh"
 #include "EvtGenModels/EvtBtoXsgammaKagan.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtBtoXsgamma::getName()
+std::string EvtBtoXsgamma::getName() const
 {
     return "BTOXSGAMMA";
 }
 
-EvtDecayBase* EvtBtoXsgamma::clone()
+EvtDecayBase* EvtBtoXsgamma::clone() const
 {
     return new EvtBtoXsgamma;
 }
 
 void EvtBtoXsgamma::init()
 {
     //Arguments:
     // 0: Ali-Greub model = 1, Kagan model = 2
     //No more arguments for Ali-Greub model
     // 1:
     // 2:
     // 3:
 
     // check that at least one b->sg model has been selected
     if ( getNArg() == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtBtoXsgamma generator expected "
             << " at least 1 argument but found: " << getNArg() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 void EvtBtoXsgamma::initProbMax()
 {
     noProbMax();
 }
 
 void EvtBtoXsgamma::decay( EvtParticle* p )
 {
     //initialize here. -- its too damn slow otherwise.
 
     if ( m_model == nullptr ) {
         if ( getArg( 0 ) == 1 )
             m_model = std::make_unique<EvtBtoXsgammaAliGreub>();
         else if ( getArg( 0 ) == 2 )
             m_model = std::make_unique<EvtBtoXsgammaKagan>();
         else if ( getArg( 0 ) == 3 )
             m_model = std::make_unique<EvtBtoXsgammaFixedMass>();
         else if ( getArg( 0 ) == 4 )
             m_model = std::make_unique<EvtBtoXsgammaFlatEnergy>();
         else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "No valid EvtBtoXsgamma generator model selected "
                 << "Set arg(0) to 1 for Ali-Greub model or 2 for "
                 << " Kagan model or 3 for a fixed mass" << endl;
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Will terminate execution!" << endl;
             ::abort();
         }
         m_model->init( getNArg(), getArgs() );
     }
 
     //  if ( p->getNDaug() != 0 ) {
     //Will end up here because maxrate multiplies by 1.2
     //  EvtGenReport(EVTGEN_DEBUG,"EvtGen") << "In EvtBtoXsgamma: X_s daughters should not be here!"<<endl;
     //  return;
     //}
 
     double m_b;
     int i;
     p->makeDaughters( getNDaug(), getDaugs() );
     EvtParticle* pdaug[MAX_DAUG];
 
     for ( i = 0; i < getNDaug(); i++ ) {
         pdaug[i] = p->getDaug( i );
     }
 
-    static EvtVector4R p4[MAX_DAUG];
-    static double mass[MAX_DAUG];
+    EvtVector4R p4[MAX_DAUG];
+    double mass[MAX_DAUG];
 
     m_b = p->mass();
 
     mass[1] = EvtPDL::getMass( getDaug( 1 ) );
 
     int Xscode = EvtPDL::getStdHep( getDaug( 0 ) );
 
     mass[0] = m_model->GetMass( Xscode );
 
     EvtGenKine::PhaseSpace( getNDaug(), mass, p4, m_b );
 
     for ( i = 0; i < getNDaug(); i++ ) {
         pdaug[i]->init( getDaugs()[i], p4[i] );
     }
 }
diff --git a/src/EvtGenModels/EvtBtoXsll.cpp b/src/EvtGenModels/EvtBtoXsll.cpp
index 4793881..f1020eb 100644
--- a/src/EvtGenModels/EvtBtoXsll.cpp
+++ b/src/EvtGenModels/EvtBtoXsll.cpp
@@ -1,396 +1,397 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtBtoXsll.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtBtoXsllUtil.hh"
 #include "EvtGenModels/EvtbTosllAmp.hh"
 
 #include <stdlib.h>
 using std::endl;
 
-std::string EvtBtoXsll::getName()
+std::string EvtBtoXsll::getName() const
 {
     return "BTOXSLL";
 }
 
-EvtDecayBase* EvtBtoXsll::clone()
+EvtDecayBase* EvtBtoXsll::clone() const
 {
     return new EvtBtoXsll;
 }
 
 void EvtBtoXsll::init()
 {
     // check that there are no arguments
 
     checkNArg( 0, 4, 5 );
 
     checkNDaug( 3 );
 
     // Check that the two leptons are the same type
 
     EvtId lepton1type = getDaug( 1 );
     EvtId lepton2type = getDaug( 2 );
 
     int etyp = 0;
     int mutyp = 0;
     int tautyp = 0;
     if ( lepton1type == EvtPDL::getId( "e+" ) ||
          lepton1type == EvtPDL::getId( "e-" ) ) {
         etyp++;
     }
     if ( lepton2type == EvtPDL::getId( "e+" ) ||
          lepton2type == EvtPDL::getId( "e-" ) ) {
         etyp++;
     }
     if ( lepton1type == EvtPDL::getId( "mu+" ) ||
          lepton1type == EvtPDL::getId( "mu-" ) ) {
         mutyp++;
     }
     if ( lepton2type == EvtPDL::getId( "mu+" ) ||
          lepton2type == EvtPDL::getId( "mu-" ) ) {
         mutyp++;
     }
     if ( lepton1type == EvtPDL::getId( "tau+" ) ||
          lepton1type == EvtPDL::getId( "tau-" ) ) {
         tautyp++;
     }
     if ( lepton2type == EvtPDL::getId( "tau+" ) ||
          lepton2type == EvtPDL::getId( "tau-" ) ) {
         tautyp++;
     }
 
     if ( etyp != 2 && mutyp != 2 && tautyp != 2 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Expect two leptons of the same type in EvtBtoXsll.cc\n";
         ::abort();
     }
 
     // Check that the second and third entries are leptons with positive
     // and negative charge, respectively
 
     int lpos = 0;
     int lneg = 0;
     if ( lepton1type == EvtPDL::getId( "e+" ) ||
          lepton1type == EvtPDL::getId( "mu+" ) ||
          lepton1type == EvtPDL::getId( "tau+" ) ) {
         lpos++;
     }
     if ( lepton2type == EvtPDL::getId( "e-" ) ||
          lepton2type == EvtPDL::getId( "mu-" ) ||
          lepton2type == EvtPDL::getId( "tau-" ) ) {
         lneg++;
     }
 
     if ( lpos != 1 || lneg != 1 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Expect 2nd and 3rd particles to be positive and negative leptons in EvtBtoXsll.cc\n";
         ::abort();
     }
 
     m_mb = 4.8;
     m_ms = 0.2;
     m_mq = 0.;
     m_pf = 0.41;
     m_mxmin = 1.1;
     if ( getNArg() == 4 ) {
         // b-quark mass
         m_mb = getArg( 0 );
         // s-quark mass
         m_ms = getArg( 1 );
         // spectator quark mass
         m_mq = getArg( 2 );
         // Fermi motion parameter
         m_pf = getArg( 3 );
     }
     if ( getNArg() == 5 ) {
         m_mxmin = getArg( 4 );
     }
 
     m_calcprob = std::make_unique<EvtBtoXsllUtil>();
 
     double ml = EvtPDL::getMeanMass( getDaug( 1 ) );
 
     // determine the maximum probability density from dGdsProb
 
     int i, j;
     int nsteps = 100;
     double s = 0.0;
     double smin = 4.0 * ml * ml;
     double smax = ( m_mb - m_ms ) * ( m_mb - m_ms );
     double probMax = -10000.0;
     double sProbMax = -10.0;
     double uProbMax = -10.0;
 
     for ( i = 0; i < nsteps; i++ ) {
         s = smin + ( i + 0.002 ) * ( smax - smin ) / (double)nsteps;
         double prob = m_calcprob->dGdsProb( m_mb, m_ms, ml, s );
         if ( prob > probMax ) {
             sProbMax = s;
             probMax = prob;
         }
     }
 
     m_dGdsProbMax = probMax;
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "dGdsProbMax = " << probMax << " for s = " << sProbMax << endl;
     }
 
     // determine the maximum probability density from dGdsdupProb
 
     probMax = -10000.0;
     sProbMax = -10.0;
 
     for ( i = 0; i < nsteps; i++ ) {
         s = smin + ( i + 0.002 ) * ( smax - smin ) / (double)nsteps;
         double umax = sqrt( ( s - ( m_mb + m_ms ) * ( m_mb + m_ms ) ) *
                             ( s - ( m_mb - m_ms ) * ( m_mb - m_ms ) ) );
         for ( j = 0; j < nsteps; j++ ) {
             double u = -umax + ( j + 0.002 ) * ( 2.0 * umax ) / (double)nsteps;
             double prob = m_calcprob->dGdsdupProb( m_mb, m_ms, ml, s, u );
             if ( prob > probMax ) {
                 sProbMax = s;
                 uProbMax = u;
                 probMax = prob;
             }
         }
     }
 
     m_dGdsdupProbMax = 2.0 * probMax;
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "dGdsdupProbMax = " << probMax << " for s = " << sProbMax
             << " and u = " << uProbMax << endl;
     }
 }
 
 void EvtBtoXsll::initProbMax()
 {
     noProbMax();
 }
 
 void EvtBtoXsll::decay( EvtParticle* p )
 {
     p->makeDaughters( getNDaug(), getDaugs() );
 
     EvtParticle* xhadron = p->getDaug( 0 );
     EvtParticle* leptonp = p->getDaug( 1 );
     EvtParticle* leptonn = p->getDaug( 2 );
 
     double mass[3];
 
     findMasses( p, getNDaug(), getDaugs(), mass );
 
     double mB = p->mass();
     double ml = mass[1];
     double pb( 0. );
 
-    static int nmsg = 0;
+    static thread_local int nmsg = 0;
+
     double xhadronMass = -999.0;
 
     EvtVector4R p4xhadron;
     EvtVector4R p4leptonp;
     EvtVector4R p4leptonn;
 
     // require the hadronic system has mass greater than that of a Kaon pion pair
 
     //  while (xhadronMass < 0.6333)
     // the above minimum value of K+pi mass appears to be too close
     // to threshold as far as JETSET is concerned
     // (JETSET gets caught in an infinite loop)
     // so we choose a lightly larger value for the threshold
     while ( xhadronMass < m_mxmin ) {
         // Apply Fermi motion and determine effective b-quark mass
 
         // Old BaBar MC parameters
         //    double pf = 0.25;
         //    double ms = 0.2;
         //    double mq = 0.3;
 
         double mb = 0.0;
 
         double xbox, ybox;
 
         while ( mb <= 0.0 ) {
             pb = m_calcprob->FermiMomentum( m_pf );
 
             // effective b-quark mass
             mb = mB * mB + m_mq * m_mq - 2.0 * mB * sqrt( pb * pb + m_mq * m_mq );
             if ( mb > 0. && sqrt( mb ) - m_ms < 2.0 * ml )
                 mb = -10.;
         }
         mb = sqrt( mb );
 
         //    cout << "b-quark momentum = " << pb << " mass = " <<  mb << endl;
 
         // generate a dilepton invariant mass
 
         double s = 0.0;
         double smin = 4.0 * ml * ml;
         double smax = ( mb - m_ms ) * ( mb - m_ms );
 
         while ( s == 0.0 ) {
             xbox = EvtRandom::Flat( smin, smax );
             ybox = EvtRandom::Flat( m_dGdsProbMax );
             double prob = m_calcprob->dGdsProb( mb, m_ms, ml, xbox );
             if ( !( prob >= 0.0 ) && !( prob <= 0.0 ) ) {
                 //	EvtGenReport(EVTGEN_INFO,"EvtGen") << "nan from dGdsProb " << prob << " " << mb << " " << m_ms << " " << ml << " " << xbox << std::endl;
             }
             if ( ybox < prob )
                 s = xbox;
         }
 
         //    cout << "dGdsProb(s) = " << m_calcprob->dGdsProb(mb, m_ms, ml, s)
         //         << " for s = " << s << endl;
 
         // two-body decay of b quark at rest into s quark and dilepton pair:
         // b -> s (ll)
 
         EvtVector4R p4sdilep[2];
 
         double msdilep[2];
         msdilep[0] = m_ms;
         msdilep[1] = sqrt( s );
 
         EvtGenKine::PhaseSpace( 2, msdilep, p4sdilep, mb );
 
         // generate dilepton decay with the expected asymmetry: (ll) -> l+ l-
 
         EvtVector4R p4ll[2];
 
         double mll[2];
         mll[0] = ml;
         mll[1] = ml;
 
         double tmp = 0.0;
 
         while ( tmp == 0.0 ) {
             // (ll) -> l+ l- decay in dilepton rest frame
 
             EvtGenKine::PhaseSpace( 2, mll, p4ll, msdilep[1] );
 
             // boost to b-quark rest frame
 
             p4ll[0] = boostTo( p4ll[0], p4sdilep[1] );
             p4ll[1] = boostTo( p4ll[1], p4sdilep[1] );
 
             // compute kinematical variable u
 
             EvtVector4R p4slp = p4sdilep[0] + p4ll[0];
             EvtVector4R p4sln = p4sdilep[0] + p4ll[1];
 
             double u = p4slp.mass2() - p4sln.mass2();
 
             ybox = EvtRandom::Flat( m_dGdsdupProbMax );
 
             double prob = m_calcprob->dGdsdupProb( mb, m_ms, ml, s, u );
             if ( !( prob >= 0.0 ) && !( prob <= 0.0 ) ) {
                 EvtGenReport( EVTGEN_INFO, "EvtGen" )
                     << "nan from dGdsProb " << prob << " " << mb << " " << m_ms
                     << " " << ml << " " << s << " " << u << std::endl;
             }
             if ( prob > m_dGdsdupProbMax && nmsg < 20 ) {
                 EvtGenReport( EVTGEN_INFO, "EvtGen" )
                     << "d2gdsdup GT d2gdsdup_max:" << prob << " "
                     << m_dGdsdupProbMax << " for s = " << s << " u = " << u
                     << " mb = " << mb << endl;
                 nmsg++;
             }
             if ( ybox < prob ) {
                 tmp = 1.0;
                 //        cout << "dGdsdupProb(s) = " << prob
                 //             << " for u = " << u << endl;
             }
         }
 
         // assign 4-momenta to valence quarks inside B meson in B rest frame
 
         double phi = EvtRandom::Flat( EvtConst::twoPi );
         double costh = EvtRandom::Flat( -1.0, 1.0 );
         double sinth = sqrt( 1.0 - costh * costh );
 
         // b-quark four-momentum in B meson rest frame
 
         EvtVector4R p4b( sqrt( mb * mb + pb * pb ), pb * sinth * sin( phi ),
                          pb * sinth * cos( phi ), pb * costh );
 
         // B meson in its rest frame
         //
         //    EvtVector4R p4B(mB, 0.0, 0.0, 0.0);
         //
         // boost B meson to b-quark rest frame
         //
         //    p4B = boostTo(p4B, p4b);
         //
         //    cout << " B meson mass in b-quark rest frame = " << p4B.mass() << endl;
 
         // boost s, l+ and l- to B meson rest frame
 
         //    EvtVector4R p4s = boostTo(p4sdilep[0], p4B);
         //    p4leptonp       = boostTo(p4ll[0],     p4B);
         //    p4leptonn       = boostTo(p4ll[1],     p4B);
 
         EvtVector4R p4s = boostTo( p4sdilep[0], p4b );
         p4leptonp = boostTo( p4ll[0], p4b );
         p4leptonn = boostTo( p4ll[1], p4b );
 
         // spectator quark in B meson rest frame
 
         EvtVector4R p4q( sqrt( pb * pb + m_mq * m_mq ), -p4b.get( 1 ),
                          -p4b.get( 2 ), -p4b.get( 3 ) );
 
         // hadron system in B meson rest frame
 
         p4xhadron = p4s + p4q;
         xhadronMass = p4xhadron.mass();
     }
 
     // initialize the decay products
 
     xhadron->init( getDaug( 0 ), p4xhadron );
 
     // For B-bar mesons (i.e. containing a b quark) we have the normal
     // order of leptons
     if ( p->getId() == EvtPDL::getId( "anti-B0" ) ||
          p->getId() == EvtPDL::getId( "B-" ) ) {
         leptonp->init( getDaug( 1 ), p4leptonp );
         leptonn->init( getDaug( 2 ), p4leptonn );
     }
     // For B mesons (i.e. containing a b-bar quark) we need to flip the
     // role of the positive and negative leptons in order to produce the
     // correct forward-backward asymmetry between the two leptons
     else {
         leptonp->init( getDaug( 1 ), p4leptonn );
         leptonn->init( getDaug( 2 ), p4leptonp );
     }
 
     return;
 }
diff --git a/src/EvtGenModels/EvtCBTo3piMPP.cpp b/src/EvtGenModels/EvtCBTo3piMPP.cpp
index 356c1e7..9bb8c6c 100644
--- a/src/EvtGenModels/EvtCBTo3piMPP.cpp
+++ b/src/EvtGenModels/EvtCBTo3piMPP.cpp
@@ -1,114 +1,114 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtCBTo3piMPP.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtCBTo3piMPP::getName()
+std::string EvtCBTo3piMPP::getName() const
 {
     return "CB3PI-MPP";
 }
 
-EvtCBTo3piMPP* EvtCBTo3piMPP::clone()
+EvtCBTo3piMPP* EvtCBTo3piMPP::clone() const
 {
     return new EvtCBTo3piMPP;
 }
 
 void EvtCBTo3piMPP::init()
 {
     // check that there are 1 argument
     checkNArg( 1 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 
     EvtVector4R p4[3];
     double alpha = getArg( 0 );
 
     int iset( 10000 );
     double realA, imgA, realbarA, imgbarA;
 
     m_generator.Evt3piMPP( alpha, iset, p4[0], p4[1], p4[2], realA, imgA,
                            realbarA, imgbarA );
 }
 
 void EvtCBTo3piMPP::initProbMax()
 {
     setProbMax( 1.5 );
 }
 
 void EvtCBTo3piMPP::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
 
     EvtParticle *pi1, *pi2, *pi3;
 
     p->makeDaughters( getNDaug(), getDaugs() );
     pi1 = p->getDaug( 0 );
     pi2 = p->getDaug( 1 );
     pi3 = p->getDaug( 2 );
 
     EvtVector4R p4[3];
     double alpha = getArg( 0 );
 
     int iset( 0 );
     double realA, imgA, realbarA, imgbarA;
 
     m_generator.Evt3piMPP( alpha, iset, p4[0], p4[1], p4[2], realA, imgA,
                            realbarA, imgbarA );
 
     pi1->init( getDaug( 0 ), p4[0] );
     pi2->init( getDaug( 1 ), p4[1] );
     pi3->init( getDaug( 2 ), p4[2] );
 
     EvtComplex A( realA, imgA );
     EvtComplex Abar( realbarA, imgbarA );
 
     //amp is filled just to make sure the compiler will
     //do its job!! but one has to define amp differently
     // if one wants the B+ or the B- to decay to 3pi!
     //
 
     EvtComplex amp;
     if ( p->getId() == BP ) {
         amp = A;
     }
     if ( p->getId() == BM ) {
         amp = Abar;
     }
 
     vertex( amp );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtCBTo3piP00.cpp b/src/EvtGenModels/EvtCBTo3piP00.cpp
index 6c86384..c06c038 100644
--- a/src/EvtGenModels/EvtCBTo3piP00.cpp
+++ b/src/EvtGenModels/EvtCBTo3piP00.cpp
@@ -1,111 +1,111 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtCBTo3piP00.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtCBTo3piP00::getName()
+std::string EvtCBTo3piP00::getName() const
 {
     return "CB3PI-P00";
 }
 
-EvtCBTo3piP00* EvtCBTo3piP00::clone()
+EvtCBTo3piP00* EvtCBTo3piP00::clone() const
 {
     return new EvtCBTo3piP00;
 }
 
 void EvtCBTo3piP00::init()
 {
     // check that there are 1 argument
     checkNArg( 1 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 
     int iset( 10000 );
     double alpha = getArg( 0 );
     EvtVector4R pin, p4pi1, p4Gamma11, p4Gamma12;
     EvtVector4R p4Gamma21, p4Gamma22;
     double realA, imgA, realbarA, imgbarA;
     m_generator.Evt3piP00( alpha, iset, pin, p4Gamma11, p4Gamma12, p4Gamma21,
                            p4Gamma22, realA, imgA, realbarA, imgbarA );
 }
 
 void EvtCBTo3piP00::initProbMax()
 {
     setProbMax( 1.5 );
 }
 
 void EvtCBTo3piP00::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
 
     EvtParticle *pi1, *pi2, *pi3;
 
     p->makeDaughters( getNDaug(), getDaugs() );
     pi1 = p->getDaug( 0 );
     pi2 = p->getDaug( 1 );
     pi3 = p->getDaug( 2 );
 
     EvtVector4R p4[3];
     double alpha = getArg( 0 );
     int iset( 0 );
 
     EvtVector4R p4pi1, p4Gamma11, p4Gamma12;
     EvtVector4R p4Gamma21, p4Gamma22;
 
     double realA, imgA, realbarA, imgbarA;
     m_generator.Evt3piP00( alpha, iset, p4[0], p4Gamma11, p4Gamma12, p4Gamma21,
                            p4Gamma22, realA, imgA, realbarA, imgbarA );
 
     p4[1] = p4Gamma11 + p4Gamma12;
     p4[2] = p4Gamma21 + p4Gamma22;
     pi1->init( getDaug( 0 ), p4[0] );
     pi2->init( getDaug( 1 ), p4[1] );
     pi3->init( getDaug( 2 ), p4[2] );
 
     EvtComplex A( realA, imgA );
     EvtComplex Abar( realbarA, imgbarA );
 
     EvtComplex amp;
     if ( p->getId() == BP ) {
         amp = A;
     }
     if ( p->getId() == BM ) {
         amp = Abar;
     }
 
     vertex( amp );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtD0ToKspipi.cpp b/src/EvtGenModels/EvtD0ToKspipi.cpp
index dd95e9e..fff52ef 100644
--- a/src/EvtGenModels/EvtD0ToKspipi.cpp
+++ b/src/EvtGenModels/EvtD0ToKspipi.cpp
@@ -1,325 +1,325 @@
 #include "EvtGenModels/EvtD0ToKspipi.hh"
 
 #include "EvtGenBase/EvtDecayTable.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <iostream>
 
-std::string EvtD0ToKspipi::getName()
+std::string EvtD0ToKspipi::getName() const
 {
     return "D0TOKSPIPI";
 }
 
-EvtDecayBase* EvtD0ToKspipi::clone()
+EvtDecayBase* EvtD0ToKspipi::clone() const
 {
     return new EvtD0ToKspipi;
 }
 
 void EvtD0ToKspipi::init()
 {
     // Check that there are 0 arguments
     checkNArg( 0 );
 
     // Check parent and daughter types
     checkNDaug( 3 );
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
     checkSpinParent( EvtSpinType::SCALAR );
 
     // Set the particle IDs and PDG masses
     setPDGValues();
 
     // Set the EvtId of the three D0 daughters
     const int nDaug = 3;
     std::vector<EvtId> dau;
     for ( int index = 0; index < nDaug; index++ ) {
         dau.push_back( getDaug( index ) );
     }
 
     // Look for K0bar h+ h-. The order will be K[0SL] h+ h-
     for ( int index = 0; index < nDaug; index++ ) {
         if ( ( dau[index] == m_K0B ) || ( dau[index] == m_KS ) ||
              ( dau[index] == m_KL ) ) {
             m_d0 = index;
         } else if ( dau[index] == m_PIP ) {
             m_d1 = index;
         } else if ( dau[index] == m_PIM ) {
             m_d2 = index;
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtD0ToKspipi" )
                 << "Daughter " << index << " has wrong ID" << std::endl;
         }
     }
 
     // Setup the Dalitz plot resonances and their amplitude coefficients
     initResonances();
 }
 
 void EvtD0ToKspipi::initProbMax()
 {
     setProbMax( 6000.0 );
 }
 
 void EvtD0ToKspipi::decay( EvtParticle* p )
 {
     // Phase space generation and 4-momenta
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     const EvtVector4R p0 = p->getDaug( m_d0 )->getP4();
     const EvtVector4R p1 = p->getDaug( m_d1 )->getP4();
     const EvtVector4R p2 = p->getDaug( m_d2 )->getP4();
 
     // Squared invariant masses
     const double mSq01 = ( p0 + p1 ).mass2();
     const double mSq02 = ( p0 + p2 ).mass2();
     const double mSq12 = ( p1 + p2 ).mass2();
 
     // For the decay amplitude
     EvtComplex amp( 0.0, 0.0 );
 
     // Direct and conjugated Dalitz points
     const EvtDalitzPoint pointD0( m_mKs, m_mPi, m_mPi, mSq02, mSq12, mSq01 );
     const EvtDalitzPoint pointD0b( m_mKs, m_mPi, m_mPi, mSq01, mSq12, mSq02 );
 
     // Check if the D is from a B+- -> D0 K+- decay with the appropriate model
     EvtParticle* parent = p->getParent();
     EvtDecayBase* decayFun = ( parent != nullptr )
-                                 ? EvtDecayTable::getInstance()->getDecayFunc(
+                                 ? EvtDecayTable::getInstance().getDecayFunc(
                                        parent )
                                  : nullptr;
     if ( parent != nullptr && decayFun != nullptr &&
          decayFun->getName() == "BTODDALITZCPK" ) {
         const EvtId parId = parent->getId();
         if ( ( parId == m_BP ) || ( parId == m_BM ) || ( parId == m_B0 ) ||
              ( parId == m_B0B ) ) {
             // D0 parent particle is a B meson from the BTODDALITZCPK decay model.
             // D0 decay amplitude combines the interference of D0 and D0bar.
             // Read the D decay parameters from the B decay model.
             // Gamma angle in radians
             const double gamma = decayFun->getArg( 0 );
             // Strong phase in radians
             const double delta = decayFun->getArg( 1 );
             // Ratio between B -> D0 K and B -> D0bar K
             const double rB = decayFun->getArg( 2 );
 
             // Direct and conjugated amplitudes
             const EvtComplex ampD0 = calcTotAmp( pointD0 );
             const EvtComplex ampD0b = calcTotAmp( pointD0b );
 
             if ( parId == m_BP || parId == m_B0 ) {
                 // B+ or B0
                 const EvtComplex iPhase( 0.0, delta + gamma );
                 const EvtComplex expo( exp( iPhase ) );
                 amp = ampD0b + rB * expo * ampD0;
             } else {
                 // B- or B0bar
                 const EvtComplex iPhase( 0.0, delta - gamma );
                 const EvtComplex expo( exp( iPhase ) );
                 amp = ampD0 + rB * expo * ampD0b;
             }
         }
     } else if ( !parent ) {
         // D0 has no parent particle. Use direct or conjugated amplitude
         if ( p->getId() == m_D0 ) {
             amp = calcTotAmp( pointD0 );
         } else {
             amp = calcTotAmp( pointD0b );
         }
     }
 
     // Set the decay vertex amplitude
     vertex( amp );
 }
 
 EvtComplex EvtD0ToKspipi::calcTotAmp( const EvtDalitzPoint& point ) const
 {
     // Initialise the total amplitude
     EvtComplex totAmp( 0.0, 0.0 );
     // Check that the Dalitz plot point is OK
     if ( point.isValid() == false ) {
         return totAmp;
     }
 
     // Add the resonance amplitudes by iterating over the (resonance, coeff) pairs.
     // This includes the BW and LASS lineshapes, as well as the K-matrix contributions
     for ( const auto& [res, amp] : m_resonances ) {
         // Evaluate the resonance amplitude and multiply by the coeff
         totAmp += res.evaluate( point ) * amp;
     }
     // Return the total amplitude
     return totAmp;
 }
 
 void EvtD0ToKspipi::initResonances()
 {
     // Dalitz plot model from combined BaBar and BELLE paper hep-ex/1804.06153
 
     // Define the Dalitz plot axes
     const EvtCyclic3::Pair AB = EvtCyclic3::AB;
     const EvtCyclic3::Pair AC = EvtCyclic3::AC;
     const EvtCyclic3::Pair BC = EvtCyclic3::BC;
 
     // Define the particle spin and lineshape types
     const EvtSpinType::spintype vector = EvtSpinType::VECTOR;
     const EvtSpinType::spintype tensor = EvtSpinType::TENSOR;
     const EvtDalitzReso::NumType RBW = EvtDalitzReso::RBW_CLEO_ZEMACH;
     const EvtDalitzReso::NumType KMAT = EvtDalitzReso::K_MATRIX;
 
     // Define the Dalitz plot
     const EvtDalitzPlot DP( m_mKs, m_mPi, m_mPi, m_mD0, 0, 0 );
 
     // Clear the internal vector of (resonance, coeff) pairs
     m_resonances.clear();
 
     // rho BW
     const EvtDalitzReso rhoBW( DP, AB, BC, vector, 0.77155, 0.13469, RBW, 5.0,
                                1.5 );
     const EvtComplex rhoCoeff( 1.0, 0.0 );
     m_resonances.push_back( std::make_pair( rhoBW, rhoCoeff ) );
 
     // Omega BW
     const EvtDalitzReso omegaBW( DP, AB, BC, vector, 0.78265, 0.00849, RBW, 5.0,
                                  1.5 );
     const EvtComplex omegaCoeff( -0.019829903319132, 0.033339785741436 );
     m_resonances.push_back( std::make_pair( omegaBW, omegaCoeff ) );
 
     // K*(892)- BW
     const EvtDalitzReso KstarBW( DP, BC, AB, vector, 0.893709298220334,
                                  0.047193287094108, RBW, 5.0, 1.5 );
     const EvtComplex KstarCoeff( -1.255025021860793, 1.176780750003210 );
     m_resonances.push_back( std::make_pair( KstarBW, KstarCoeff ) );
 
     // K*0(1430)- LASS
     const double LASS_F = 0.955319683174069;
     const double LASS_phi_F = 0.001737032480754;
     const double LASS_R = 1.0;
     const double LASS_phi_R = -1.914503836666840;
     const double LASS_a = 0.112673863011817;
     const double LASS_r = -33.799002116066454;
     const EvtDalitzReso Kstar0_1430LASS = EvtDalitzReso(
         DP, AB, 1.440549945739415, 0.192611512914605, LASS_a, LASS_r, LASS_F,
         LASS_phi_F, LASS_R, LASS_phi_R, -1.0, false );
     const EvtComplex Kstar0_1430Coeff( -0.386469884688245, 2.330315087713914 );
     m_resonances.push_back( std::make_pair( Kstar0_1430LASS, Kstar0_1430Coeff ) );
 
     // K*2(1430)- BW
     const EvtDalitzReso Kstar2_1430BW( DP, BC, AB, tensor, 1.4256, 0.0985, RBW,
                                        5.0, 1.5 );
     const EvtComplex Kstar2_1430Coeff( 0.914470111251261, -0.885129049790117 );
     m_resonances.push_back( std::make_pair( Kstar2_1430BW, Kstar2_1430Coeff ) );
 
     // K*(1680)- BW
     const EvtDalitzReso Kstar_1680BW( DP, BC, AB, vector, 1.717, 0.322, RBW,
                                       5.0, 1.5 );
     const EvtComplex Kstar_1680Coeff( -1.560837188791231, -2.916210561577914 );
     m_resonances.push_back( std::make_pair( Kstar_1680BW, Kstar_1680Coeff ) );
 
     // K*(1410)- BW
     const EvtDalitzReso Kstar_1410BW( DP, BC, AB, vector, 1.414, 0.232, RBW,
                                       5.0, 1.5 );
     const EvtComplex Kstar_1410Coeff( -0.046795079734847, 0.283085379985959 );
     m_resonances.push_back( std::make_pair( Kstar_1410BW, Kstar_1410Coeff ) );
 
     // K*(892)+ DCS BW
     const EvtDalitzReso Kstar_DCSBW( DP, BC, AC, vector, 0.893709298220334,
                                      0.047193287094108, RBW, 5.0, 1.5 );
     const EvtComplex Kstar_DCSCoeff( 0.121693743404499, -0.110206354657867 );
     m_resonances.push_back( std::make_pair( Kstar_DCSBW, Kstar_DCSCoeff ) );
 
     // K*0(1430)+ DCS LASS
     const EvtDalitzReso Kstar0_1430_DCSLASS = EvtDalitzReso(
         DP, AC, 1.440549945739415, 0.192611512914605, LASS_a, LASS_r, LASS_F,
         LASS_phi_F, LASS_R, LASS_phi_R, -1.0, false );
     const EvtComplex Kstar0_1430_DCSCoeff( -0.101484805664368, 0.032368302993344 );
     m_resonances.push_back(
         std::make_pair( Kstar0_1430_DCSLASS, Kstar0_1430_DCSCoeff ) );
 
     // K*2(1430)+ DCS BW
     const EvtDalitzReso Kstar2_1430_DCSBW( DP, AB, AC, tensor, 1.4256, 0.0985,
                                            RBW, 5.0, 1.5 );
     const EvtComplex Kstar2_1430_DCSCoeff( 0.000699701539252, -0.102571188336701 );
     m_resonances.push_back(
         std::make_pair( Kstar2_1430_DCSBW, Kstar2_1430_DCSCoeff ) );
 
     // K*(1410)+ DCS BW
     const EvtDalitzReso Kstar_1410_DCSBW( DP, BC, AC, vector, 1.414, 0.232, RBW,
                                           5.0, 1.5 );
     const EvtComplex Kstar_1410_DCSCoeff( -0.181330401419455, 0.103990039950039 );
     m_resonances.push_back(
         std::make_pair( Kstar_1410_DCSBW, Kstar_1410_DCSCoeff ) );
 
     // f2(1270) BW
     const EvtDalitzReso f2_1270BW( DP, AB, BC, tensor, 1.2751, 0.1842, RBW, 5.0,
                                    1.5 );
     const EvtComplex f2_1270Coeff( 1.151785277682948, -0.845612891825272 );
     m_resonances.push_back( std::make_pair( f2_1270BW, f2_1270Coeff ) );
 
     // rho(1450) BW
     const EvtDalitzReso rho_1450BW( DP, AB, BC, vector, 1.465, 0.400, RBW, 5.0,
                                     1.5 );
     const EvtComplex rho_1450Coeff( -0.597963342540235, 2.787903868470057 );
     m_resonances.push_back( std::make_pair( rho_1450BW, rho_1450Coeff ) );
 
     // K-matrix pole 1
     const double sProd0 = -0.07;
     const EvtDalitzReso pole1( DP, BC, "Pole1", KMAT, 0, 0, 0, 0, sProd0 );
     const EvtComplex p1Coeff( 3.122415682166643, 7.928823290976309 );
     m_resonances.push_back( std::make_pair( pole1, p1Coeff ) );
 
     // K-matrix pole 2
     const EvtDalitzReso pole2( DP, BC, "Pole2", KMAT, 0, 0, 0, 0, sProd0 );
     const EvtComplex p2Coeff( 11.139907856904129, 4.948420661321371 );
     m_resonances.push_back( std::make_pair( pole2, p2Coeff ) );
 
     // K-matrix pole 3
     const EvtDalitzReso pole3( DP, BC, "Pole3", KMAT, 0, 0, 0, 0, sProd0 );
     const EvtComplex p3Coeff( 29.146102368470210, -0.053588781806890 );
     m_resonances.push_back( std::make_pair( pole3, p3Coeff ) );
 
     // K-matrix pole 4
     const EvtDalitzReso pole4( DP, BC, "Pole4", KMAT, 0, 0, 0, 0, sProd0 );
     const EvtComplex p4Coeff( 6.631556203215280, -8.455370251307063 );
     m_resonances.push_back( std::make_pair( pole4, p4Coeff ) );
 
     // K-matrix pole 5 is not included since its amplitude coefficient is zero
 
     // K-matrix slowly varying part
     const EvtComplex fProd11( -4.724094278696236, -6.511009103363590 );
     const EvtComplex fProd12( -23.289333360304212, -12.215597571354197 );
     const EvtComplex fProd13( -1.860311896516422, -32.982507366353126 );
     const EvtComplex fProd14( -13.638752211193912, -22.339804683783186 );
     const EvtComplex fProd15( 0.0, 0.0 );
 
     const EvtDalitzReso KMSVP( DP, BC, "f11prod", KMAT, fProd12 / fProd11,
                                fProd13 / fProd11, fProd14 / fProd11,
                                fProd15 / fProd11, sProd0 );
     m_resonances.push_back( std::make_pair( KMSVP, fProd11 ) );
 }
 
 void EvtD0ToKspipi::setPDGValues()
 {
     // Set the EvtIds
     m_BP = EvtPDL::getId( "B+" );
     m_BM = EvtPDL::getId( "B-" );
     m_B0 = EvtPDL::getId( "B0" );
     m_B0B = EvtPDL::getId( "anti-B0" );
     m_D0 = EvtPDL::getId( "D0" );
     m_D0B = EvtPDL::getId( "anti-D0" );
     m_KM = EvtPDL::getId( "K-" );
     m_KP = EvtPDL::getId( "K+" );
     m_K0 = EvtPDL::getId( "K0" );
     m_K0B = EvtPDL::getId( "anti-K0" );
     m_KL = EvtPDL::getId( "K_L0" );
     m_KS = EvtPDL::getId( "K_S0" );
     m_PIM = EvtPDL::getId( "pi-" );
     m_PIP = EvtPDL::getId( "pi+" );
 
     // Set the particle masses
     m_mD0 = EvtPDL::getMeanMass( m_D0 );
     m_mKs = EvtPDL::getMeanMass( m_KS );
     m_mPi = EvtPDL::getMeanMass( m_PIP );
     m_mK = EvtPDL::getMeanMass( m_KP );
 }
diff --git a/src/EvtGenModels/EvtD0gammaDalitz.cpp b/src/EvtGenModels/EvtD0gammaDalitz.cpp
index 4a54b67..9bc91c6 100644
--- a/src/EvtGenModels/EvtD0gammaDalitz.cpp
+++ b/src/EvtGenModels/EvtD0gammaDalitz.cpp
@@ -1,318 +1,321 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtD0gammaDalitz.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtDecayTable.hh"
 #include "EvtGenBase/EvtFlatte.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtResonance.hh"
 #include "EvtGenBase/EvtResonance2.hh"
 
 #include <cmath>
 #include <cstdlib>
 #include <string>
 
 // Initialize the static variables.
 const EvtSpinType::spintype& EvtD0gammaDalitz::m_SCALAR = EvtSpinType::SCALAR;
 const EvtSpinType::spintype& EvtD0gammaDalitz::m_VECTOR = EvtSpinType::VECTOR;
 const EvtSpinType::spintype& EvtD0gammaDalitz::m_TENSOR = EvtSpinType::TENSOR;
 
 const EvtDalitzReso::CouplingType& EvtD0gammaDalitz::m_EtaPic =
     EvtDalitzReso::EtaPic;
 const EvtDalitzReso::CouplingType& EvtD0gammaDalitz::m_PicPicKK =
     EvtDalitzReso::PicPicKK;
 
 const EvtDalitzReso::NumType& EvtD0gammaDalitz::m_RBW =
     EvtDalitzReso::RBW_CLEO_ZEMACH;
 const EvtDalitzReso::NumType& EvtD0gammaDalitz::m_GS =
     EvtDalitzReso::GS_CLEO_ZEMACH;
 const EvtDalitzReso::NumType& EvtD0gammaDalitz::m_KMAT = EvtDalitzReso::K_MATRIX;
 
 const EvtCyclic3::Pair& EvtD0gammaDalitz::m_AB = EvtCyclic3::AB;
 const EvtCyclic3::Pair& EvtD0gammaDalitz::m_AC = EvtCyclic3::AC;
 const EvtCyclic3::Pair& EvtD0gammaDalitz::m_BC = EvtCyclic3::BC;
 
-std::string EvtD0gammaDalitz::getName()
+std::string EvtD0gammaDalitz::getName() const
 {
     return "D0GAMMADALITZ";
 }
 
-EvtDecayBase* EvtD0gammaDalitz::clone()
+EvtDecayBase* EvtD0gammaDalitz::clone() const
 {
     return new EvtD0gammaDalitz;
 }
 
 void EvtD0gammaDalitz::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
 
     // Check that this model is valid for the specified decay.
     checkNDaug( 3 );
     checkSpinParent( m_SCALAR );
     checkSpinDaughter( 0, m_SCALAR );
     checkSpinDaughter( 1, m_SCALAR );
     checkSpinDaughter( 2, m_SCALAR );
 
     // Get the values of the EvtId objects from the data files.
     readPDGValues();
 
     // Get the EvtId of the D0 and its 3 daughters.
     getParentId();
 
     EvtId dau[3];
     for ( int index = 0; index < 3; index++ ) {
         dau[index] = getDaug( index );
     }
 
     // Look for K0bar h+ h-. The order will be K[0SL] h+ h-
     for ( int index = 0; index < 3; index++ ) {
         if ( ( dau[index] == m_K0B ) || ( dau[index] == m_KS ) ||
              ( dau[index] == m_KL ) ) {
             m_d1 = index;
         } else if ( ( dau[index] == m_PIP ) || ( dau[index] == m_KP ) ) {
             m_d2 = index;
         } else if ( ( dau[index] == m_PIM ) || ( dau[index] == m_KM ) ) {
             m_d3 = index;
         } else {
             reportInvalidAndExit();
         }
     }
 
     // Check if we're dealing with Ks pi pi or with Ks K K.
     m_isKsPiPi = false;
     if ( dau[m_d2] == m_PIP || dau[m_d2] == m_PIM ) {
         m_isKsPiPi = true;
     }
 }
 
 void EvtD0gammaDalitz::initProbMax()
 {
     setProbMax( 5200. );
 }
 
 void EvtD0gammaDalitz::decay( EvtParticle* part )
 {
     // Check if the D is from a B+- -> D0 K+- decay with the appropriate model.
     EvtParticle* parent =
         part->getParent();    // If there are no mistakes, should be B+ or B-.
     if ( parent != nullptr &&
          EvtDecayTable::getInstance()->getDecayFunc( parent )->getName() ==
              "BTODDALITZCPK" ) {
         EvtId parId = parent->getId();
         if ( ( parId == m_BP ) || ( parId == m_BM ) || ( parId == m_B0 ) ||
              ( parId == m_B0B ) ) {
             m_bFlavor = parId;
         } else {
             reportInvalidAndExit();
         }
     } else {
         reportInvalidAndExit();
     }
 
     // Read the D decay parameters from the B decay model.
     // Gamma angle in rad.
     double gamma = EvtDecayTable::getInstance()->getDecayFunc( parent )->getArg(
         0 );
     // Strong phase in rad.
     double delta = EvtDecayTable::getInstance()->getDecayFunc( parent )->getArg(
         1 );
     // Ratio between B->D0K and B->D0barK
     double rB = EvtDecayTable::getInstance()->getDecayFunc( parent )->getArg( 2 );
 
     // Same structure for all of these decays.
     part->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtVector4R pA = part->getDaug( m_d1 )->getP4();
     EvtVector4R pB = part->getDaug( m_d2 )->getP4();
     EvtVector4R pC = part->getDaug( m_d3 )->getP4();
 
     // Squared invariant masses.
     double mSqAB = ( pA + pB ).mass2();
     double mSqAC = ( pA + pC ).mass2();
     double mSqBC = ( pB + pC ).mass2();
 
     EvtComplex amp( 1.0, 0.0 );
 
     // Direct and conjugated amplitudes.
     EvtComplex ampDir;
     EvtComplex ampCnj;
 
     if ( m_isKsPiPi ) {
         // Direct and conjugated Dalitz points.
         EvtDalitzPoint pointDir( m_mKs, m_mPi, m_mPi, mSqAB, mSqBC, mSqAC );
         EvtDalitzPoint pointCnj( m_mKs, m_mPi, m_mPi, mSqAC, mSqBC, mSqAB );
 
         // Direct and conjugated amplitudes.
         ampDir = dalitzKsPiPi( pointDir );
         ampCnj = dalitzKsPiPi( pointCnj );
     } else {
         // Direct and conjugated Dalitz points.
         EvtDalitzPoint pointDir( m_mKs, m_mK, m_mK, mSqAB, mSqBC, mSqAC );
         EvtDalitzPoint pointCnj( m_mKs, m_mK, m_mK, mSqAC, mSqBC, mSqAB );
 
         // Direct and conjugated amplitudes.
         ampDir = dalitzKsKK( pointDir );
         ampCnj = dalitzKsKK( pointCnj );
     }
 
     if ( m_bFlavor == m_BP || m_bFlavor == m_B0 ) {
         amp = ampCnj + rB * exp( EvtComplex( 0., delta + gamma ) ) * ampDir;
     } else {
         amp = ampDir + rB * exp( EvtComplex( 0., delta - gamma ) ) * ampCnj;
     }
 
     vertex( amp );
 
     return;
 }
 
 EvtComplex EvtD0gammaDalitz::dalitzKsPiPi( const EvtDalitzPoint& point ) const
 {
     static const EvtDalitzPlot plot( m_mKs, m_mPi, m_mPi, m_mD0 );
 
     EvtComplex amp = 0.;
 
     // This corresponds to relativistic Breit-Wigner distributions. Not K-matrix.
     // Defining resonances.
-    static EvtDalitzReso KStarm( plot, m_BC, m_AC, m_VECTOR, 0.893606,
-                                 0.0463407, m_RBW );
-    static EvtDalitzReso KStarp( plot, m_BC, m_AB, m_VECTOR, 0.893606,
-                                 0.0463407, m_RBW );
-    static EvtDalitzReso rho0( plot, m_AC, m_BC, m_VECTOR, 0.7758, 0.1464, m_GS );
-    static EvtDalitzReso omega( plot, m_AC, m_BC, m_VECTOR, 0.78259, 0.00849,
-                                m_RBW );
-    static EvtDalitzReso f0_980( plot, m_AC, m_BC, m_SCALAR, 0.975, 0.044, m_RBW );
-    static EvtDalitzReso f0_1370( plot, m_AC, m_BC, m_SCALAR, 1.434, 0.173,
-                                  m_RBW );
-    static EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754, 0.1851,
-                                  m_RBW );
-    static EvtDalitzReso K0Starm_1430( plot, m_BC, m_AC, m_SCALAR, 1.459, 0.175,
+    static const EvtDalitzReso KStarm( plot, m_BC, m_AC, m_VECTOR, 0.893606,
+                                       0.0463407, m_RBW );
+    static const EvtDalitzReso KStarp( plot, m_BC, m_AB, m_VECTOR, 0.893606,
+                                       0.0463407, m_RBW );
+    static const EvtDalitzReso rho0( plot, m_AC, m_BC, m_VECTOR, 0.7758, 0.1464,
+                                     m_GS );
+    static const EvtDalitzReso omega( plot, m_AC, m_BC, m_VECTOR, 0.78259,
+                                      0.00849, m_RBW );
+    static const EvtDalitzReso f0_980( plot, m_AC, m_BC, m_SCALAR, 0.975, 0.044,
                                        m_RBW );
-    static EvtDalitzReso K0Starp_1430( plot, m_BC, m_AB, m_SCALAR, 1.459, 0.175,
-                                       m_RBW );
-    static EvtDalitzReso K2Starm_1430( plot, m_BC, m_AC, m_TENSOR, 1.4256,
-                                       0.0985, m_RBW );
-    static EvtDalitzReso K2Starp_1430( plot, m_BC, m_AB, m_TENSOR, 1.4256,
-                                       0.0985, m_RBW );
-    static EvtDalitzReso sigma( plot, m_AC, m_BC, m_SCALAR, 0.527699, 0.511861,
-                                m_RBW );
-    static EvtDalitzReso sigma2( plot, m_AC, m_BC, m_SCALAR, 1.03327, 0.0987890,
-                                 m_RBW );
-    static EvtDalitzReso KStarm_1680( plot, m_BC, m_AC, m_VECTOR, 1.677, 0.205,
-                                      m_RBW );
+    static const EvtDalitzReso f0_1370( plot, m_AC, m_BC, m_SCALAR, 1.434,
+                                        0.173, m_RBW );
+    static const EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754,
+                                        0.1851, m_RBW );
+    static const EvtDalitzReso K0Starm_1430( plot, m_BC, m_AC, m_SCALAR, 1.459,
+                                             0.175, m_RBW );
+    static const EvtDalitzReso K0Starp_1430( plot, m_BC, m_AB, m_SCALAR, 1.459,
+                                             0.175, m_RBW );
+    static const EvtDalitzReso K2Starm_1430( plot, m_BC, m_AC, m_TENSOR, 1.4256,
+                                             0.0985, m_RBW );
+    static const EvtDalitzReso K2Starp_1430( plot, m_BC, m_AB, m_TENSOR, 1.4256,
+                                             0.0985, m_RBW );
+    static const EvtDalitzReso sigma( plot, m_AC, m_BC, m_SCALAR, 0.527699,
+                                      0.511861, m_RBW );
+    static const EvtDalitzReso sigma2( plot, m_AC, m_BC, m_SCALAR, 1.03327,
+                                       0.0987890, m_RBW );
+    static const EvtDalitzReso KStarm_1680( plot, m_BC, m_AC, m_VECTOR, 1.677,
+                                            0.205, m_RBW );
 
     // Adding terms to the amplitude with their corresponding amplitude and phase terms.
     amp += EvtComplex( .848984, .893618 );
     amp += EvtComplex( -1.16356, 1.19933 ) * KStarm.evaluate( point );
     amp += EvtComplex( .106051, -.118513 ) * KStarp.evaluate( point );
     amp += EvtComplex( 1.0, 0.0 ) * rho0.evaluate( point );
     amp += EvtComplex( -.0249569, .0388072 ) * omega.evaluate( point );
     amp += EvtComplex( -.423586, -.236099 ) * f0_980.evaluate( point );
     amp += EvtComplex( -2.16486, 3.62385 ) * f0_1370.evaluate( point );
     amp += EvtComplex( .217748, -.133327 ) * f2_1270.evaluate( point );
     amp += EvtComplex( 1.62128, 1.06816 ) * K0Starm_1430.evaluate( point );
     amp += EvtComplex( .148802, .0897144 ) * K0Starp_1430.evaluate( point );
     amp += EvtComplex( 1.15489, -.773363 ) * K2Starm_1430.evaluate( point );
     amp += EvtComplex( .140865, -.165378 ) * K2Starp_1430.evaluate( point );
     amp += EvtComplex( -1.55556, -.931685 ) * sigma.evaluate( point );
     amp += EvtComplex( -.273791, -.0535596 ) * sigma2.evaluate( point );
     amp += EvtComplex( -1.69720, .128038 ) * KStarm_1680.evaluate( point );
 
     return amp;
 }
 
 EvtComplex EvtD0gammaDalitz::dalitzKsKK( const EvtDalitzPoint& point ) const
 {
     static const EvtDalitzPlot plot( m_mKs, m_mK, m_mK, m_mD0 );
 
     // Defining resonances.
-    static EvtDalitzReso a00_980( plot, m_AC, m_BC, m_SCALAR, 0.999, m_RBW,
-                                  .550173, .324, m_EtaPic );
-    static EvtDalitzReso phi( plot, m_AC, m_BC, m_VECTOR, 1.01943, .00459319,
-                              m_RBW );
-    static EvtDalitzReso a0p_980( plot, m_AC, m_AB, m_SCALAR, 0.999, m_RBW,
-                                  .550173, .324, m_EtaPic );
-    static EvtDalitzReso f0_1370( plot, m_AC, m_BC, m_SCALAR, 1.350, .265, m_RBW );
-    static EvtDalitzReso a0m_980( plot, m_AB, m_AC, m_SCALAR, 0.999, m_RBW,
-                                  .550173, .324, m_EtaPic );
-    static EvtDalitzReso f0_980( plot, m_AC, m_BC, m_SCALAR, 0.965, m_RBW, .695,
-                                 .165, m_PicPicKK );
-    static EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754, .1851,
-                                  m_RBW );
-    static EvtDalitzReso a00_1450( plot, m_AC, m_BC, m_SCALAR, 1.474, .265,
-                                   m_RBW );
-    static EvtDalitzReso a0p_1450( plot, m_AC, m_AB, m_SCALAR, 1.474, .265,
-                                   m_RBW );
-    static EvtDalitzReso a0m_1450( plot, m_AB, m_AC, m_SCALAR, 1.474, .265,
-                                   m_RBW );
+    static const EvtDalitzReso a00_980( plot, m_AC, m_BC, m_SCALAR, 0.999,
+                                        m_RBW, .550173, .324, m_EtaPic );
+    static const EvtDalitzReso phi( plot, m_AC, m_BC, m_VECTOR, 1.01943,
+                                    .00459319, m_RBW );
+    static const EvtDalitzReso a0p_980( plot, m_AC, m_AB, m_SCALAR, 0.999,
+                                        m_RBW, .550173, .324, m_EtaPic );
+    static const EvtDalitzReso f0_1370( plot, m_AC, m_BC, m_SCALAR, 1.350, .265,
+                                        m_RBW );
+    static const EvtDalitzReso a0m_980( plot, m_AB, m_AC, m_SCALAR, 0.999,
+                                        m_RBW, .550173, .324, m_EtaPic );
+    static const EvtDalitzReso f0_980( plot, m_AC, m_BC, m_SCALAR, 0.965, m_RBW,
+                                       .695, .165, m_PicPicKK );
+    static const EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754,
+                                        .1851, m_RBW );
+    static const EvtDalitzReso a00_1450( plot, m_AC, m_BC, m_SCALAR, 1.474,
+                                         .265, m_RBW );
+    static const EvtDalitzReso a0p_1450( plot, m_AC, m_AB, m_SCALAR, 1.474,
+                                         .265, m_RBW );
+    static const EvtDalitzReso a0m_1450( plot, m_AB, m_AC, m_SCALAR, 1.474,
+                                         .265, m_RBW );
 
     // Adding terms to the amplitude with their corresponding amplitude and phase terms.
     EvtComplex amp( 0., 0. );    // Phase space amplitude.
     amp += EvtComplex( 1.0, 0.0 ) * a00_980.evaluate( point );
     amp += EvtComplex( -.126314, .188701 ) * phi.evaluate( point );
     amp += EvtComplex( -.561428, .0135338 ) * a0p_980.evaluate( point );
     amp += EvtComplex( .035, -.00110488 ) * f0_1370.evaluate( point );
     amp += EvtComplex( -.0872735, .0791190 ) * a0m_980.evaluate( point );
     amp += EvtComplex( 0., 0. ) * f0_980.evaluate( point );
     amp += EvtComplex( .257341, -.0408343 ) * f2_1270.evaluate( point );
     amp += EvtComplex( -.0614342, -.649930 ) * a00_1450.evaluate( point );
     amp += EvtComplex( -.104629, .830120 ) * a0p_1450.evaluate( point );
     amp += EvtComplex( 0., 0. ) * a0m_1450.evaluate( point );
 
     return 2.8 *
            amp;    // Multiply by 2.8 in order to reuse the same probmax as Ks pi pi.
 }
 
 void EvtD0gammaDalitz::readPDGValues()
 {
     // Define the EvtIds.
     m_BP = EvtPDL::getId( "B+" );
     m_BM = EvtPDL::getId( "B-" );
     m_B0 = EvtPDL::getId( "B0" );
     m_B0B = EvtPDL::getId( "anti-B0" );
     m_D0 = EvtPDL::getId( "D0" );
     m_D0B = EvtPDL::getId( "anti-D0" );
     m_KM = EvtPDL::getId( "K-" );
     m_KP = EvtPDL::getId( "K+" );
     m_K0 = EvtPDL::getId( "K0" );
     m_K0B = EvtPDL::getId( "anti-K0" );
     m_KL = EvtPDL::getId( "K_L0" );
     m_KS = EvtPDL::getId( "K_S0" );
     m_PIM = EvtPDL::getId( "pi-" );
     m_PIP = EvtPDL::getId( "pi+" );
 
     // Read the relevant masses.
     m_mD0 = EvtPDL::getMass( m_D0 );
     m_mKs = EvtPDL::getMass( m_KS );
     m_mPi = EvtPDL::getMass( m_PIP );
     m_mK = EvtPDL::getMass( m_KP );
 }
 
 void EvtD0gammaDalitz::reportInvalidAndExit() const
 {
     EvtGenReport( EVTGEN_ERROR, "EvtD0gammaDalitz" )
         << "EvtD0gammaDalitz: Invalid mode." << std::endl;
     exit( 1 );
 }
diff --git a/src/EvtGenModels/EvtD0mixDalitz.cpp b/src/EvtGenModels/EvtD0mixDalitz.cpp
index 3a34381..2b78b65 100644
--- a/src/EvtGenModels/EvtD0mixDalitz.cpp
+++ b/src/EvtGenModels/EvtD0mixDalitz.cpp
@@ -1,383 +1,385 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtD0mixDalitz.hh"
 
 #include "EvtGenBase/EvtDalitzPlot.hh"
 #include "EvtGenBase/EvtDalitzReso.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtResonance.hh"
 
 #include <cmath>    // for std::fabs
 
 // Initialize the static variables.
 const EvtSpinType::spintype& EvtD0mixDalitz::m_SCALAR = EvtSpinType::SCALAR;
 const EvtSpinType::spintype& EvtD0mixDalitz::m_VECTOR = EvtSpinType::VECTOR;
 const EvtSpinType::spintype& EvtD0mixDalitz::m_TENSOR = EvtSpinType::TENSOR;
 
 const EvtDalitzReso::CouplingType& EvtD0mixDalitz::m_EtaPic = EvtDalitzReso::EtaPic;
 const EvtDalitzReso::CouplingType& EvtD0mixDalitz::m_PicPicKK =
     EvtDalitzReso::PicPicKK;
 
 const EvtDalitzReso::NumType& EvtD0mixDalitz::m_RBW =
     EvtDalitzReso::RBW_CLEO_ZEMACH;
 const EvtDalitzReso::NumType& EvtD0mixDalitz::m_GS = EvtDalitzReso::GS_CLEO_ZEMACH;
 const EvtDalitzReso::NumType& EvtD0mixDalitz::m_KMAT = EvtDalitzReso::K_MATRIX;
 
 const EvtCyclic3::Pair& EvtD0mixDalitz::m_AB = EvtCyclic3::AB;
 const EvtCyclic3::Pair& EvtD0mixDalitz::m_AC = EvtCyclic3::AC;
 const EvtCyclic3::Pair& EvtD0mixDalitz::m_BC = EvtCyclic3::BC;
 
 void EvtD0mixDalitz::init()
 {
     // check that there are 0 arguments
     checkNDaug( 3 );
 
     if ( getNArg() ) {
         if ( getNArg() == 2 ) {
             m_x = getArg( 0 );
             m_y = getArg( 1 );
         } else if ( getNArg() == 4 ) {
             m_x = getArg( 0 );
             m_y = getArg( 1 );
             m_qp = EvtComplex( getArg( 2 ), getArg( 3 ) );
         } else if ( getNArg() == 5 ) {
             m_x = getArg( 0 );
             m_y = getArg( 1 );
             m_qp = EvtComplex( getArg( 2 ), getArg( 3 ) );
             m_isRBWmodel = !getArg(
                 4 );    // RBW by default. If arg4 is set, do K-matrix.
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtD0mixDalitz" )
                 << "Number of arguments for this model must be 0, 2, 4 or 5:"
                 << std::endl
                 << "[ x y ][ qp.re qp.im ][ doK-matrix ]" << std::endl
                 << "Check your dec file." << std::endl;
             exit( 1 );
         }
     }
 
     checkSpinParent( m_SCALAR );
     checkSpinDaughter( 0, m_SCALAR );
     checkSpinDaughter( 1, m_SCALAR );
     checkSpinDaughter( 2, m_SCALAR );
 
     readPDGValues();
 
     // Get the EvtId of the D0 and its (3) daughters.
     EvtId parId = getParentId();
 
     EvtId dau[3];
     for ( int index = 0; index < 3; index++ )
         dau[index] = getDaug( index );
 
     if ( parId == m_D0 )    // Look for K0bar h+ h-. The order must be K[0SL] h+ h-
         for ( int index = 0; index < 3; index++ )
             if ( ( dau[index] == m_K0B ) || ( dau[index] == m_KS ) ||
                  ( dau[index] == m_KL ) )
                 m_d1 = index;
             else if ( ( dau[index] == m_PIP ) || ( dau[index] == m_KP ) )
                 m_d2 = index;
             else if ( ( dau[index] == m_PIM ) || ( dau[index] == m_KM ) )
                 m_d3 = index;
             else
                 reportInvalidAndExit();
     else if ( parId == m_D0B )    // Look for K0 h+ h-. The order must be K[0SL] h- h+
         for ( int index = 0; index < 3; index++ )
             if ( ( dau[index] == m_K0 ) || ( dau[index] == m_KS ) ||
                  ( dau[index] == m_KL ) )
                 m_d1 = index;
             else if ( ( dau[index] == m_PIM ) || ( dau[index] == m_KM ) )
                 m_d2 = index;
             else if ( ( dau[index] == m_PIP ) || ( dau[index] == m_KP ) )
                 m_d3 = index;
             else
                 reportInvalidAndExit();
     else
         reportInvalidAndExit();
 
     // If the D meson is a D0bar, the expressions should use p/q instead of q/p.
     if ( parId == m_D0B )
         m_qp = 1.0 / m_qp;
 
     // At this point, if parId is D0bar, the amplitude is the D0bar amplitude, the conjugated amplitude
     //    is the amplitude of the D0 decay, and m_qp means p/q, so it is like changing the meaning of
     //    A <-> Abar, and p <-> q. It is just a trick so after this point the code for D0bar can be the
     //    same as the code for D0.
 
     // Check if we're dealing with Ks pi pi or with Ks K K.
     m_isKsPiPi = false;
     if ( dau[m_d2] == m_PIP || dau[m_d2] == m_PIM )
         m_isKsPiPi = true;
 }
 
 void EvtD0mixDalitz::decay( EvtParticle* part )
 {
     // Same structure for all of these decays.
     part->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtVector4R pA = part->getDaug( m_d1 )->getP4();
     EvtVector4R pB = part->getDaug( m_d2 )->getP4();
     EvtVector4R pC = part->getDaug( m_d3 )->getP4();
 
     // Squared invariant masses.
     double m2AB = ( pA + pB ).mass2();
     double m2AC = ( pA + pC ).mass2();
     double m2BC = ( pB + pC ).mass2();
 
     // Dalitz amplitudes of the decay of the particle and that of the antiparticle.
     EvtComplex ampDalitz;
     EvtComplex ampAntiDalitz;
 
     if ( m_isKsPiPi ) {    // For Ks pi pi
         EvtDalitzPoint point( m_mKs, m_mPi, m_mPi, m2AB, m2BC, m2AC );
         EvtDalitzPoint antiPoint( m_mKs, m_mPi, m_mPi, m2AC, m2BC, m2AB );
 
         ampDalitz = dalitzKsPiPi( point );
         ampAntiDalitz = dalitzKsPiPi( antiPoint );
     } else {    // For Ks K K
         EvtDalitzPoint point( m_mKs, m_mK, m_mK, m2AB, m2BC, m2AC );
         EvtDalitzPoint antiPoint( m_mKs, m_mK, m_mK, m2AC, m2BC, m2AB );
 
         ampDalitz = dalitzKsKK( point );
         ampAntiDalitz = dalitzKsKK( antiPoint );
     }
 
     // Assume there's no direct CP violation.
     EvtComplex barAOverA = ampAntiDalitz / ampDalitz;
 
     // CP violation in the interference. m_qp implements CP violation in the mixing.
     EvtComplex chi = m_qp * barAOverA;
 
     // Generate a negative exponential life time. p( gt ) = ( 1 - y ) * e^{ - ( 1 - y ) gt }
     double gt = -log( EvtRandom::Flat() ) / ( 1.0 - std::fabs( m_y ) );
     part->setLifetime( gt / m_gamma );
 
     // Compute time dependent amplitude.
     EvtComplex amp = 0.5 * ampDalitz * exp( -std::fabs( m_y ) * gt / 2.0 ) *
                      ( ( 1.0 + chi ) * h1( gt ) + ( 1.0 - chi ) * h2( gt ) );
 
     vertex( amp );
 
     return;
 }
 
 void EvtD0mixDalitz::readPDGValues()
 {
     // Define the EvtIds.
     m_D0 = EvtPDL::getId( "D0" );
     m_D0B = EvtPDL::getId( "anti-D0" );
     m_KM = EvtPDL::getId( "K-" );
     m_KP = EvtPDL::getId( "K+" );
     m_K0 = EvtPDL::getId( "K0" );
     m_K0B = EvtPDL::getId( "anti-K0" );
     m_KL = EvtPDL::getId( "K_L0" );
     m_KS = EvtPDL::getId( "K_S0" );
     m_PIM = EvtPDL::getId( "pi-" );
     m_PIP = EvtPDL::getId( "pi+" );
 
     // Read the relevant masses.
     m_mD0 = EvtPDL::getMass( m_D0 );
     m_mKs = EvtPDL::getMass( m_KS );
     m_mPi = EvtPDL::getMass( m_PIP );
     m_mK = EvtPDL::getMass( m_KP );
 
     // Compute the decay rate from the parameter in the evt.pdl file.
     m_ctau = EvtPDL::getctau( EvtPDL::getId( "D0" ) );
 
     m_gamma = 1.0 / m_ctau;    // ALERT: Gamma is not 1 / tau.
 }
 
 EvtComplex EvtD0mixDalitz::dalitzKsPiPi( const EvtDalitzPoint& point )
 {
     static const EvtDalitzPlot plot( m_mKs, m_mPi, m_mPi, m_mD0 );
 
     EvtComplex amp = 0.;
 
     if ( m_isRBWmodel ) {
         // This corresponds to relativistic Breit-Wigner distributions. Not K-matrix.
         // Defining resonances.
-        static EvtDalitzReso KStarm( plot, m_BC, m_AC, m_VECTOR, 0.893606,
-                                     0.0463407, m_RBW );
-        static EvtDalitzReso KStarp( plot, m_BC, m_AB, m_VECTOR, 0.893606,
-                                     0.0463407, m_RBW );
-        static EvtDalitzReso rho0( plot, m_AC, m_BC, m_VECTOR, 0.7758, 0.1464,
-                                   m_GS );
-        static EvtDalitzReso omega( plot, m_AC, m_BC, m_VECTOR, 0.78259,
-                                    0.00849, m_RBW );
-        static EvtDalitzReso f0_980( plot, m_AC, m_BC, m_SCALAR, 0.975, 0.044,
-                                     m_RBW );
-        static EvtDalitzReso f0_1370( plot, m_AC, m_BC, m_SCALAR, 1.434, 0.173,
-                                      m_RBW );
-        static EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754,
-                                      0.1851, m_RBW );
-        static EvtDalitzReso K0Starm_1430( plot, m_BC, m_AC, m_SCALAR, 1.459,
-                                           0.175, m_RBW );
-        static EvtDalitzReso K0Starp_1430( plot, m_BC, m_AB, m_SCALAR, 1.459,
-                                           0.175, m_RBW );
-        static EvtDalitzReso K2Starm_1430( plot, m_BC, m_AC, m_TENSOR, 1.4256,
-                                           0.0985, m_RBW );
-        static EvtDalitzReso K2Starp_1430( plot, m_BC, m_AB, m_TENSOR, 1.4256,
-                                           0.0985, m_RBW );
-        static EvtDalitzReso sigma( plot, m_AC, m_BC, m_SCALAR, 0.527699,
-                                    0.511861, m_RBW );
-        static EvtDalitzReso sigma2( plot, m_AC, m_BC, m_SCALAR, 1.03327,
-                                     0.0987890, m_RBW );
-        static EvtDalitzReso KStarm_1680( plot, m_BC, m_AC, m_VECTOR, 1.677,
-                                          0.205, m_RBW );
+        static const EvtDalitzReso KStarm( plot, m_BC, m_AC, m_VECTOR, 0.893606,
+                                           0.0463407, m_RBW );
+        static const EvtDalitzReso KStarp( plot, m_BC, m_AB, m_VECTOR, 0.893606,
+                                           0.0463407, m_RBW );
+        static const EvtDalitzReso rho0( plot, m_AC, m_BC, m_VECTOR, 0.7758,
+                                         0.1464, m_GS );
+        static const EvtDalitzReso omega( plot, m_AC, m_BC, m_VECTOR, 0.78259,
+                                          0.00849, m_RBW );
+        static const EvtDalitzReso f0_980( plot, m_AC, m_BC, m_SCALAR, 0.975,
+                                           0.044, m_RBW );
+        static const EvtDalitzReso f0_1370( plot, m_AC, m_BC, m_SCALAR, 1.434,
+                                            0.173, m_RBW );
+        static const EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754,
+                                            0.1851, m_RBW );
+        static const EvtDalitzReso K0Starm_1430( plot, m_BC, m_AC, m_SCALAR,
+                                                 1.459, 0.175, m_RBW );
+        static const EvtDalitzReso K0Starp_1430( plot, m_BC, m_AB, m_SCALAR,
+                                                 1.459, 0.175, m_RBW );
+        static const EvtDalitzReso K2Starm_1430( plot, m_BC, m_AC, m_TENSOR,
+                                                 1.4256, 0.0985, m_RBW );
+        static const EvtDalitzReso K2Starp_1430( plot, m_BC, m_AB, m_TENSOR,
+                                                 1.4256, 0.0985, m_RBW );
+        static const EvtDalitzReso sigma( plot, m_AC, m_BC, m_SCALAR, 0.527699,
+                                          0.511861, m_RBW );
+        static const EvtDalitzReso sigma2( plot, m_AC, m_BC, m_SCALAR, 1.03327,
+                                           0.0987890, m_RBW );
+        static const EvtDalitzReso KStarm_1680( plot, m_BC, m_AC, m_VECTOR,
+                                                1.677, 0.205, m_RBW );
 
         // Adding terms to the amplitude with their corresponding amplitude and phase terms.
         amp += EvtComplex( 0.848984, 0.893618 );
         amp += EvtComplex( -1.16356, 1.19933 ) * KStarm.evaluate( point );
         amp += EvtComplex( 0.106051, -0.118513 ) * KStarp.evaluate( point );
         amp += EvtComplex( 1.0, 0.0 ) * rho0.evaluate( point );
         amp += EvtComplex( -0.0249569, 0.0388072 ) * omega.evaluate( point );
         amp += EvtComplex( -0.423586, -0.236099 ) * f0_980.evaluate( point );
         amp += EvtComplex( -2.16486, 3.62385 ) * f0_1370.evaluate( point );
         amp += EvtComplex( 0.217748, -0.133327 ) * f2_1270.evaluate( point );
         amp += EvtComplex( 1.62128, 1.06816 ) * K0Starm_1430.evaluate( point );
         amp += EvtComplex( 0.148802, 0.0897144 ) * K0Starp_1430.evaluate( point );
         amp += EvtComplex( 1.15489, -0.773363 ) * K2Starm_1430.evaluate( point );
         amp += EvtComplex( 0.140865, -0.165378 ) * K2Starp_1430.evaluate( point );
         amp += EvtComplex( -1.55556, -0.931685 ) * sigma.evaluate( point );
         amp += EvtComplex( -0.273791, -0.0535596 ) * sigma2.evaluate( point );
         amp += EvtComplex( -1.69720, 0.128038 ) * KStarm_1680.evaluate( point );
     } else {
         // This corresponds to the complete model (RBW, GS, LASS and K-matrix).
         // Defining resonances.
-        static EvtDalitzReso KStarm( plot, m_BC, m_AC, m_VECTOR, 0.893619,
-                                     0.0466508, m_RBW );
-        static EvtDalitzReso KStarp( plot, m_BC, m_AB, m_VECTOR, 0.893619,
-                                     0.0466508, m_RBW );
-        static EvtDalitzReso rho0( plot, m_AC, m_BC, m_VECTOR, 0.7758, 0.1464,
-                                   m_GS );
-        static EvtDalitzReso omega( plot, m_AC, m_BC, m_VECTOR, 0.78259,
-                                    0.00849, m_RBW );
-        static EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754,
-                                      0.1851, m_RBW );
-        static EvtDalitzReso K0Starm_1430( plot, m_AC, 1.46312, 0.232393, 1.0746,
-                                           -1.83214, .803516, 2.32788, 1.0,
-                                           -5.31306 );    // LASS
-        static EvtDalitzReso K0Starp_1430( plot, m_AB, 1.46312, 0.232393, 1.0746,
-                                           -1.83214, .803516, 2.32788, 1.0,
-                                           -5.31306 );    // LASS
-        static EvtDalitzReso K2Starm_1430( plot, m_BC, m_AC, m_TENSOR, 1.4256,
-                                           0.0985, m_RBW );
-        static EvtDalitzReso K2Starp_1430( plot, m_BC, m_AB, m_TENSOR, 1.4256,
-                                           0.0985, m_RBW );
-        static EvtDalitzReso KStarm_1680( plot, m_BC, m_AC, m_VECTOR, 1.677,
-                                          0.205, m_RBW );
+        static const EvtDalitzReso KStarm( plot, m_BC, m_AC, m_VECTOR, 0.893619,
+                                           0.0466508, m_RBW );
+        static const EvtDalitzReso KStarp( plot, m_BC, m_AB, m_VECTOR, 0.893619,
+                                           0.0466508, m_RBW );
+        static const EvtDalitzReso rho0( plot, m_AC, m_BC, m_VECTOR, 0.7758,
+                                         0.1464, m_GS );
+        static const EvtDalitzReso omega( plot, m_AC, m_BC, m_VECTOR, 0.78259,
+                                          0.00849, m_RBW );
+        static const EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754,
+                                            0.1851, m_RBW );
+        static const EvtDalitzReso K0Starm_1430( plot, m_AC, 1.46312, 0.232393,
+                                                 1.0746, -1.83214, .803516,
+                                                 2.32788, 1.0,
+                                                 -5.31306 );    // LASS
+        static const EvtDalitzReso K0Starp_1430( plot, m_AB, 1.46312, 0.232393,
+                                                 1.0746, -1.83214, .803516,
+                                                 2.32788, 1.0,
+                                                 -5.31306 );    // LASS
+        static const EvtDalitzReso K2Starm_1430( plot, m_BC, m_AC, m_TENSOR,
+                                                 1.4256, 0.0985, m_RBW );
+        static const EvtDalitzReso K2Starp_1430( plot, m_BC, m_AB, m_TENSOR,
+                                                 1.4256, 0.0985, m_RBW );
+        static const EvtDalitzReso KStarm_1680( plot, m_BC, m_AC, m_VECTOR,
+                                                1.677, 0.205, m_RBW );
 
         // Defining K-matrix.
-        static EvtComplex fr12( 1.87981, -0.628378 );
-        static EvtComplex fr13( 4.3242, 2.75019 );
-        static EvtComplex fr14( 3.22336, 0.271048 );
-        static EvtComplex fr15( 0.0, 0.0 );
-        static EvtDalitzReso Pole1( plot, m_BC, "Pole1", m_KMAT, fr12, fr13,
-                                    fr14, fr15, -0.0694725 );
-        static EvtDalitzReso Pole2( plot, m_BC, "Pole2", m_KMAT, fr12, fr13,
-                                    fr14, fr15, -0.0694725 );
-        static EvtDalitzReso Pole3( plot, m_BC, "Pole3", m_KMAT, fr12, fr13,
-                                    fr14, fr15, -0.0694725 );
-        static EvtDalitzReso Pole4( plot, m_BC, "Pole4", m_KMAT, fr12, fr13,
-                                    fr14, fr15, -0.0694725 );
-        static EvtDalitzReso kmatrix( plot, m_BC, "f11prod", m_KMAT, fr12, fr13,
-                                      fr14, fr15, -0.0694725 );
+        static const EvtComplex fr12( 1.87981, -0.628378 );
+        static const EvtComplex fr13( 4.3242, 2.75019 );
+        static const EvtComplex fr14( 3.22336, 0.271048 );
+        static const EvtComplex fr15( 0.0, 0.0 );
+        static const EvtDalitzReso Pole1( plot, m_BC, "Pole1", m_KMAT, fr12,
+                                          fr13, fr14, fr15, -0.0694725 );
+        static const EvtDalitzReso Pole2( plot, m_BC, "Pole2", m_KMAT, fr12,
+                                          fr13, fr14, fr15, -0.0694725 );
+        static const EvtDalitzReso Pole3( plot, m_BC, "Pole3", m_KMAT, fr12,
+                                          fr13, fr14, fr15, -0.0694725 );
+        static const EvtDalitzReso Pole4( plot, m_BC, "Pole4", m_KMAT, fr12,
+                                          fr13, fr14, fr15, -0.0694725 );
+        static const EvtDalitzReso kmatrix( plot, m_BC, "f11prod", m_KMAT, fr12,
+                                            fr13, fr14, fr15, -0.0694725 );
 
         // Adding terms to the amplitude with their corresponding amplitude and phase terms.
         amp += EvtComplex( -1.31394, 1.14072 ) * KStarm.evaluate( point );
         amp += EvtComplex( 0.116239, -0.107287 ) * KStarp.evaluate( point );
         amp += EvtComplex( 1.0, 0.0 ) * rho0.evaluate( point );
         amp += EvtComplex( -0.0313343, 0.0424013 ) * omega.evaluate( point );
         amp += EvtComplex( 0.559412, -0.232336 ) * f2_1270.evaluate( point );
         amp += EvtComplex( 7.35400, -3.67637 ) * K0Starm_1430.evaluate( point );
         amp += EvtComplex( 0.255913, -0.190459 ) * K0Starp_1430.evaluate( point );
         amp += EvtComplex( 1.05397, -0.936297 ) * K2Starm_1430.evaluate( point );
         amp += EvtComplex( -0.00760136, -0.0908624 ) *
                K2Starp_1430.evaluate( point );
         amp += EvtComplex( -1.45336, -0.164494 ) * KStarm_1680.evaluate( point );
         amp += EvtComplex( -1.81830, 9.10680 ) * Pole1.evaluate( point );
         amp += EvtComplex( 10.1751, 3.87961 ) * Pole2.evaluate( point );
         amp += EvtComplex( 23.6569, -4.94551 ) * Pole3.evaluate( point );
         amp += EvtComplex( 0.0725431, -9.16264 ) * Pole4.evaluate( point );
         amp += EvtComplex( -2.19449, -7.62666 ) * kmatrix.evaluate( point );
 
         amp *= 0.97;    // Multiply by a constant in order to use the same maximum as RBW model.
     }
 
     return amp;
 }
 
 EvtComplex EvtD0mixDalitz::dalitzKsKK( const EvtDalitzPoint& point )
 {
     static const EvtDalitzPlot plot( m_mKs, m_mK, m_mK, m_mD0 );
 
     // Defining resonances.
-    static EvtDalitzReso a00_980( plot, m_AC, m_BC, m_SCALAR, 0.999, m_RBW,
-                                  0.550173, 0.324, m_EtaPic );
-    static EvtDalitzReso phi( plot, m_AC, m_BC, m_VECTOR, 1.01943, 0.00459319,
-                              m_RBW );
-    static EvtDalitzReso a0p_980( plot, m_AC, m_AB, m_SCALAR, 0.999, m_RBW,
-                                  0.550173, 0.324, m_EtaPic );
-    static EvtDalitzReso f0_1370( plot, m_AC, m_BC, m_SCALAR, 1.350, 0.265,
-                                  m_RBW );
-    static EvtDalitzReso a0m_980( plot, m_AB, m_AC, m_SCALAR, 0.999, m_RBW,
-                                  0.550173, 0.324, m_EtaPic );
-    static EvtDalitzReso f0_980( plot, m_AC, m_BC, m_SCALAR, 0.965, m_RBW,
-                                 0.695, 0.165, m_PicPicKK );
-    static EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754, 0.1851,
-                                  m_RBW );
-    static EvtDalitzReso a00_1450( plot, m_AC, m_BC, m_SCALAR, 1.474, 0.265,
-                                   m_RBW );
-    static EvtDalitzReso a0p_1450( plot, m_AC, m_AB, m_SCALAR, 1.474, 0.265,
-                                   m_RBW );
-    static EvtDalitzReso a0m_1450( plot, m_AB, m_AC, m_SCALAR, 1.474, 0.265,
-                                   m_RBW );
+    static const EvtDalitzReso a00_980( plot, m_AC, m_BC, m_SCALAR, 0.999,
+                                        m_RBW, 0.550173, 0.324, m_EtaPic );
+    static const EvtDalitzReso phi( plot, m_AC, m_BC, m_VECTOR, 1.01943,
+                                    0.00459319, m_RBW );
+    static const EvtDalitzReso a0p_980( plot, m_AC, m_AB, m_SCALAR, 0.999,
+                                        m_RBW, 0.550173, 0.324, m_EtaPic );
+    static const EvtDalitzReso f0_1370( plot, m_AC, m_BC, m_SCALAR, 1.350,
+                                        0.265, m_RBW );
+    static const EvtDalitzReso a0m_980( plot, m_AB, m_AC, m_SCALAR, 0.999,
+                                        m_RBW, 0.550173, 0.324, m_EtaPic );
+    static const EvtDalitzReso f0_980( plot, m_AC, m_BC, m_SCALAR, 0.965, m_RBW,
+                                       0.695, 0.165, m_PicPicKK );
+    static const EvtDalitzReso f2_1270( plot, m_AC, m_BC, m_TENSOR, 1.2754,
+                                        0.1851, m_RBW );
+    static const EvtDalitzReso a00_1450( plot, m_AC, m_BC, m_SCALAR, 1.474,
+                                         0.265, m_RBW );
+    static const EvtDalitzReso a0p_1450( plot, m_AC, m_AB, m_SCALAR, 1.474,
+                                         0.265, m_RBW );
+    static const EvtDalitzReso a0m_1450( plot, m_AB, m_AC, m_SCALAR, 1.474,
+                                         0.265, m_RBW );
 
     // Adding terms to the amplitude with their corresponding amplitude and phase terms.
     EvtComplex amp( 0., 0. );    // Phase space amplitude.
     amp += EvtComplex( 1.0, 0.0 ) * a00_980.evaluate( point );
     amp += EvtComplex( -0.126314, 0.188701 ) * phi.evaluate( point );
     amp += EvtComplex( -0.561428, 0.0135338 ) * a0p_980.evaluate( point );
     amp += EvtComplex( 0.035, -0.00110488 ) * f0_1370.evaluate( point );
     amp += EvtComplex( -0.0872735, 0.0791190 ) * a0m_980.evaluate( point );
     amp += EvtComplex( 0.0, 0.0 ) * f0_980.evaluate( point );
     amp += EvtComplex( 0.257341, -0.0408343 ) * f2_1270.evaluate( point );
     amp += EvtComplex( -0.0614342, -0.649930 ) * a00_1450.evaluate( point );
     amp += EvtComplex( -0.104629, 0.830120 ) * a0p_1450.evaluate( point );
     amp += EvtComplex( 0.0, 0.0 ) * a0m_1450.evaluate( point );
 
     return 2.8 *
            amp;    // Multiply by 2.8 in order to reuse the same probmax as Ks pi pi.
 }
 
 // < f | H | D^0 (t) > = 1/2 * [ ( 1 + \chi_f ) * A_f * e_1(gt) + ( 1 - \chi_f ) * A_f * e_2(gt) ]
 // < f | H | D^0 (t) > = 1/2 * exp( -gamma t / 2 ) * [ ( 1 + \chi_f ) * A_f * h_1(t) + ( 1 - \chi_f ) * A_f * h_2(t) ]
 // e{1,2}( gt ) = exp( -gt / 2 ) * h{1,2}( gt ).
 EvtComplex EvtD0mixDalitz::h1( const double& gt ) const
 {
     return exp( -EvtComplex( m_y, m_x ) * gt / 2. );
 }
 
 EvtComplex EvtD0mixDalitz::h2( const double& gt ) const
 {
     return exp( EvtComplex( m_y, m_x ) * gt / 2. );
 }
diff --git a/src/EvtGenModels/EvtDDalitz.cpp b/src/EvtGenModels/EvtDDalitz.cpp
index b7f7de9..df19912 100644
--- a/src/EvtGenModels/EvtDDalitz.cpp
+++ b/src/EvtGenModels/EvtDDalitz.cpp
@@ -1,887 +1,882 @@
 
 /***********************************************************************
 * Copyright 1998-2023 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtDDalitz.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtDecayTable.hh"
 #include "EvtGenBase/EvtFlatte.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtResonance.hh"
 #include "EvtGenBase/EvtResonance2.hh"
 
 #include <algorithm>
 #include <stdlib.h>
 #include <string>
 #include <utility>
 #include <vector>
 
 using std::endl;
 
-std::string EvtDDalitz::getName()
+std::string EvtDDalitz::getName() const
 {
     return "D_DALITZ";
 }
 
-EvtDecayBase* EvtDDalitz::clone()
+EvtDecayBase* EvtDDalitz::clone() const
 {
     return new EvtDDalitz;
 }
 
 bool isNeutralKaon( const EvtId& theId )
 {
     // See if the particle id matches that for a neutral kaon
     bool result( false );
 
-    static EvtId K0 = EvtPDL::getId( "K0" );
-    static EvtId KB = EvtPDL::getId( "anti-K0" );
-    static EvtId KL = EvtPDL::getId( "K_L0" );
-    static EvtId KS = EvtPDL::getId( "K_S0" );
+    static const EvtId K0 = EvtPDL::getId( "K0" );
+    static const EvtId KB = EvtPDL::getId( "anti-K0" );
+    static const EvtId KL = EvtPDL::getId( "K_L0" );
+    static const EvtId KS = EvtPDL::getId( "K_S0" );
 
     // Compare EvtId integers, which are unique for each particle type,
     // corresponding to the order particles appear in the "evt.pdl" table.
     // Aliased particles will have the same ids (but different "alias" values)
     if ( theId == KB || theId == K0 || theId == KL || theId == KS ) {
         result = true;
     }
 
     return result;
 }
 
 bool compareIds( const std::pair<EvtId, int>& left,
                  const std::pair<EvtId, int>& right )
 {
     // Compare id numbers to achieve the ordering KB/K0/KS/KL, KM, PIM, PI0, PIP, KP, i.e.
     // neutral kaon first, then normal PDG id ordering for the other particles.
 
     // The current 12 decay modes do not use two or more neutral kaons. If in the future
     // such modes are added, the ordering will be KM, KB, PIM, PI0, KL, PIP, KS, K0, KP
 
     bool result( false );
 
     if ( isNeutralKaon( left.first ) == true &&
          isNeutralKaon( right.first ) == false ) {
         // Left is a neutral kaon, right is not
         result = true;
 
     } else if ( isNeutralKaon( left.first ) == false &&
                 isNeutralKaon( right.first ) == true ) {
         // Right is a neutral kaon, left is not
         result = false;
 
     } else {
         // Just compare PDG integers to achieve ascending order
         int leftPDGid = EvtPDL::getStdHep( left.first );
         int rightPDGid = EvtPDL::getStdHep( right.first );
 
         if ( leftPDGid < rightPDGid ) {
             result = true;
         }
     }
 
     return result;
 }
 
 void EvtDDalitz::init()
 {
-    static EvtId DM = EvtPDL::getId( "D-" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
-    static EvtId KM = EvtPDL::getId( "K-" );
-    static EvtId KP = EvtPDL::getId( "K+" );
-
-    //static EvtId K0=EvtPDL::getId("K0");
-    //static EvtId KB=EvtPDL::getId("anti-K0");
-    //static EvtId KL=EvtPDL::getId("K_L0");
-    //static EvtId KS=EvtPDL::getId("K_S0");
-
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
-
-    static double MPI = EvtPDL::getMeanMass( PI0 );
-    static double MKP = EvtPDL::getMeanMass( KP );
+    static const EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId KP = EvtPDL::getId( "K+" );
+
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
+
+    static const double MPI = EvtPDL::getMeanMass( PI0 );
+    static const double MKP = EvtPDL::getMeanMass( KP );
 
     // check that there are 0 arguments and 3 daughters
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 
     EvtId parnum = getParentId();
 
     /*
    * To decide which decay we have, we take the list of daughters (or charge
    * conjugate of daughters for D-, D0B or Ds-), sort these in the order
    * KB/K0/KS/KL, KM, PIM, PI0, PIP, KP, keeping track which daughter is which,
    * and at the end have a single if statement picking up the decay and assigning
    * the correct order for the daughters (same condition used for charm and anti-charm).
    * If we have two or more neutral kaons in the daughter list, then the compareIds()
    * ordering will simply follow ascending PDG ids: KM, KB, PIM, PI0, KL, PIP, KS, K0, KP
    */
 
     std::vector<std::pair<EvtId, int>> daughters;
     if ( parnum == D0 || parnum == DP || parnum == DSP ) {
         for ( int i = 0; i < 3; ++i ) {
             daughters.push_back( std::make_pair( getDaug( i ), i ) );
         }
     } else {
         for ( int i = 0; i < 3; ++i ) {
             daughters.push_back(
                 std::make_pair( EvtPDL::chargeConj( getDaug( i ) ), i ) );
         }
     }
 
     // Sort daughters, they will end up in the order KB/K0/KS/KL, KM, PIM, PI0, PIP, KP
     // for the current 12 decay modes
     std::sort( daughters.begin(), daughters.end(), compareIds );
 
     /*
   std::cout << "DDALITZ sorting: ";
   for (int i=0; i<3; ++i ) {
     std::cout << EvtPDL::getStdHep(daughters[i].first) << " ";
   }
   std::cout << std::endl;
 */
 
     m_flag = 0;
 
     // D0 or anti-D0 modes. We only need to check the particle modes, since anti-particle
     // modes have their ordered daughter ids charged-conjugated above
 
     if ( parnum == D0 || parnum == D0B ) {
         // Look for D0 to K- pi+ pi0
         if ( daughters[0].first == KM && daughters[1].first == PI0 &&
              daughters[2].first == PIP ) {
             m_flag = 4;
             m_d1 = daughters[0].second;
             m_d2 = daughters[2].second;
             m_d3 = daughters[1].second;
         }
 
         // Look for D0 to KB pi- pi+
         if ( isNeutralKaon( daughters[0].first ) == true &&
              daughters[1].first == PIM && daughters[2].first == PIP ) {
             m_flag = 3;
             m_d1 = daughters[0].second;
             m_d2 = daughters[1].second;
             m_d3 = daughters[2].second;
         }
 
         // Look for D0 to KB K+ K-
         if ( isNeutralKaon( daughters[0].first ) == true &&
              daughters[1].first == KM && daughters[2].first == KP ) {
             m_flag = 5;
             m_d1 = daughters[0].second;
             m_d2 = daughters[2].second;
             m_d3 = daughters[1].second;
         }
 
         // Look for D0 to pi- pi+ pi0
         if ( daughters[0].first == PIM && daughters[1].first == PI0 &&
              daughters[2].first == PIP ) {
             m_flag = 12;
             m_d1 = daughters[0].second;
             m_d2 = daughters[2].second;
             m_d3 = daughters[1].second;
         }
     }
 
     // D+ (or D-) modes
     if ( parnum == DP || parnum == DM ) {
         // Look for D+ to KB pi+ pi0
         if ( isNeutralKaon( daughters[0].first ) == true &&
              daughters[1].first == PI0 && daughters[2].first == PIP ) {
             m_flag = 2;
             m_d1 = daughters[0].second;
             m_d2 = daughters[2].second;
             m_d3 = daughters[1].second;
         }
 
         // Look for D+ to K- pi+ pi+
         if ( daughters[0].first == KM && daughters[1].first == PIP &&
              daughters[2].first == PIP ) {
             m_flag = 1;
             m_d1 = daughters[0].second;
             m_d2 = daughters[1].second;
             m_d3 = daughters[2].second;
         }
 
         // Look for D+ to K- K+ pi+
         if ( daughters[0].first == KM && daughters[1].first == PIP &&
              daughters[2].first == KP ) {
             m_flag = 7;
             m_d1 = daughters[0].second;
             m_d2 = daughters[2].second;
             m_d3 = daughters[1].second;
         }
 
         // Look for D+ to pi- pi+ K+
         if ( daughters[0].first == PIM && daughters[1].first == PIP &&
              daughters[2].first == KP ) {
             m_flag = 8;
             m_d1 = daughters[0].second;
             m_d2 = daughters[1].second;
             m_d3 = daughters[2].second;
         }
 
         // Look for D+ to pi- pi+ pi+
         if ( daughters[0].first == PIM && daughters[1].first == PIP &&
              daughters[2].first == PIP ) {
             m_flag = 10;
             m_d1 = daughters[0].second;
             m_d2 = daughters[1].second;
             m_d3 = daughters[2].second;
         }
     }
 
     // Ds+ (or Ds-) modes
     if ( parnum == DSP || parnum == DSM ) {
         // Look for Ds+ to K- K+ pi+
         if ( daughters[0].first == KM && daughters[1].first == PIP &&
              daughters[2].first == KP ) {
             m_flag = 6;
             m_d1 = daughters[0].second;
             m_d2 = daughters[2].second;
             m_d3 = daughters[1].second;
         }
 
         // Look for Ds+ to pi- pi+ K+
         if ( daughters[0].first == PIM && daughters[1].first == PIP &&
              daughters[2].first == KP ) {
             m_flag = 9;
             m_d1 = daughters[0].second;
             m_d2 = daughters[1].second;
             m_d3 = daughters[2].second;
         }
 
         // Look for Ds+ to pi- pi+ pi+
         if ( daughters[0].first == PIM && daughters[1].first == PIP &&
              daughters[2].first == PIP ) {
             m_flag = 11;
             m_d1 = daughters[0].second;
             m_d2 = daughters[1].second;
             m_d3 = daughters[2].second;
         }
     }
 
     if ( m_flag == 6 ) {
         m_kkpi_params.push_back( EvtFlatteParam( MPI, MPI, 0.406 ) );
         m_kkpi_params.push_back( EvtFlatteParam( MKP, MKP, 0.800 ) );
     }
 
     if ( m_flag == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtDDaltiz: Invalid mode." << endl;
         assert( 0 );
     }
 
     /*
   EvtGenReport(EVTGEN_INFO,"EvtGen") << "DDALITZ ordering for " << parnum.getName()
 			<< " with mode = " << m_flag << ": "
 			<< getDaug(m_d1).getName() << " "
 			<< getDaug(m_d2).getName() << " "
 			<< getDaug(m_d3).getName() << std::endl;
   */
 }
 
 void EvtDDalitz::initProbMax()
 {
     // probmax different for different modes!
 
     if ( m_flag == 1 ) {
         setProbMax( 2500.0 );
     }
     if ( m_flag == 2 ) {
         setProbMax( 150.0 );
     }
     if ( m_flag == 3 ) {
         setProbMax( 3000.0 );
     }
     if ( m_flag == 4 ) {
         setProbMax( 600.0 );
     }
     if ( m_flag == 5 ) {
         setProbMax( 2500000.0 );
     }
     if ( m_flag == 6 ) {
         setProbMax( 45000.0 );
     }
     if ( m_flag == 7 ) {
         setProbMax( 35000.0 );
     }
     if ( m_flag == 8 ) {
         setProbMax( 2500.0 );
     }
     if ( m_flag == 9 ) {
         setProbMax( 1700.0 );
     }
     if ( m_flag == 10 ) {
         setProbMax( 1300.0 );
     }
     if ( m_flag == 11 ) {
         setProbMax( 2200.0 );
     }
     if ( m_flag == 12 ) {
         setProbMax( 1000.0 );
     }
 }
 
 void EvtDDalitz::decay( EvtParticle* p )
 {
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
 
     double oneby2 = 0.707106782;
 
     bool isBToDK = false;
     if ( p->getParent() ) {
         EvtId parId = p->getParent()->getId();
         if ( ( BP == parId ) || ( BM == parId ) || ( B0 == parId ) ||
              ( B0B == parId ) )
             if ( EvtDecayTable::getInstance()
                      ->getDecayFunc( p->getParent() )
                      ->getName() == "BTODDALITZCPK" )
                 isBToDK = true;
     }
 
     //same structure for all of these decays
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtVector4R moms1 = p->getDaug( m_d1 )->getP4();
     EvtVector4R moms2 = p->getDaug( m_d2 )->getP4();
     EvtVector4R moms3 = p->getDaug( m_d3 )->getP4();
 
     EvtVector4R p4_p;
     p4_p.set( p->mass(), 0.0, 0.0, 0.0 );
 
     EvtComplex amp( 1.0, 0.0 );
 
     //now determine which D and which decay
 
     //data from Anjos et al, Phys.Rev.D 1993, v.48,num.1,p.56 (E691 resuls)
     //for D+ -> K- pi+ pi+, and from Adler et al, Phys.Lett. B196 (1987), 107
     //(Mark III results) for D+ -> K0bar pi+ pi0.
     //CLEO results for D0->k-pi+pi0
 
     if ( m_flag == 1 ) {
         // D+ -> K- pi+ pi+ decay, or charge conjugate
 
         //     //Anjos etal e691 - Phys Rev D48, 56 (1993)
         // EvtResonance DplusRes11(p4_p,moms1,moms2,0.78,-60.0,0.0498,0.89610,1);
         //     EvtResonance DplusRes12(p4_p,moms3,moms1,0.78,-60.0,0.0498,0.89610,1);//K*(892)
 
         //     EvtResonance DplusRes21(p4_p,moms1,moms2,0.53,132.0,0.287,1.429,0);
         //     EvtResonance DplusRes22(p4_p,moms3,moms1,0.53,132.0,0.287,1.429,0);//K*(1430)
 
         //     EvtResonance DplusRes31(p4_p,moms1,moms2,0.47,-51.0,0.323,1.714,1);
         //     EvtResonance DplusRes32(p4_p,moms3,moms1,0.47,-51.0,0.323,1.714,1);//K*(1680)
 
         //     amp = amp + oneby2*(-DplusRes11.resAmpl()+DplusRes12.resAmpl()) + oneby2*(DplusRes21.resAmpl() + DplusRes22.resAmpl()) + oneby2*(-DplusRes31.resAmpl()+ DplusRes32.resAmpl());
 
         //    EvtResonance DplusRes11(p4_p,moms1,moms2,amp,phase,width,mass,L);
         //CLEO-c p15,arxiv:0802.4214v2
         EvtResonance2 DplusRes11( p4_p, moms1, moms2, 1.0, 0.0, 0.0503, 0.896,
                                   1, true );
         EvtResonance2 DplusRes12( p4_p, moms3, moms1, 1.0, 0.0, 0.0503, 0.896,
                                   1, true );    //K*(892)
         EvtResonance2 DplusRes21( p4_p, moms1, moms2, 3.0, 49.7 - 180.0, 0.164,
                                   1.463, 0 );
         EvtResonance2 DplusRes22( p4_p, moms3, moms1, 3.0, 49.7 - 180.0, 0.164,
                                   1.463, 0 );    //K*(1430)
         EvtResonance2 DplusRes31( p4_p, moms1, moms2, 0.96, -29.9 + 180.0,
                                   0.109, 1.4324, 2, true );
         EvtResonance2 DplusRes32( p4_p, moms3, moms1, 0.96, -29.9 + 180.0,
                                   0.109, 1.4324, 2, true );    // K*_2(1430)
         EvtResonance2 DplusRes41( p4_p, moms1, moms2, 6.5, 29.0, 0.323, 1.717,
                                   1, true );
         EvtResonance2 DplusRes42( p4_p, moms3, moms1, 6.5, 29.0, 0.323, 1.717,
                                   1, true );    //K*(1680)
         EvtResonance2 DplusRes51( p4_p, moms1, moms2, 5.01, -163.7 + 180.0,
                                   0.470, 0.809, 0 );
         EvtResonance2 DplusRes52( p4_p, moms3, moms1, 5.01, -163.7 + 180.0,
                                   0.470, 0.809, 0 );    //kappa(800)
         double pi180inv = 1.0 / EvtConst::radToDegrees;
         amp = EvtComplex( 7.4 * cos( ( -18.4 + 180.0 ) * pi180inv ),
                           7.4 * sin( ( -18.4 + 180.0 ) * pi180inv ) ) +
               oneby2 * ( -DplusRes11.resAmpl() + DplusRes12.resAmpl() ) +
               oneby2 * ( DplusRes21.resAmpl() + DplusRes22.resAmpl() ) +
               oneby2 * ( DplusRes31.resAmpl() + DplusRes32.resAmpl() ) +
               oneby2 * ( -DplusRes41.resAmpl() + DplusRes42.resAmpl() ) +
               oneby2 * ( DplusRes51.resAmpl() + DplusRes52.resAmpl() );
         //amp = amp+oneby2*(-DplusRes11.resAmpl()+DplusRes12.resAmpl());
     }
 
     if ( m_flag == 2 ) {
         //have a D+ -> K0bar pi+ pi0 decay
         //adler etal MarkIII - Phys Lett B196, 107 (1987)
         // Results in this paper:
         //   Kbar rho+    FitFraction = 68+/-8+/-12    Phase   0
         //   Kbar* pi+                  19+/-6+/-6            43+/-23
         //   nonres                     13+/-7+/-8           250+/-19
         // These numbers below seem not to be exactly the same
         // the phases are equiv to -106=254 and 41
         //
         EvtResonance DplusKpipi0Res1( p4_p, moms2, moms3, 1.00, 0.00, 0.1512,
                                       0.7699, 1 );    //rho+
         EvtResonance DplusKpipi0Res2( p4_p, moms3, moms1, 0.8695, 0.7191,
                                       0.0498, 0.89159, 1 );    //K*0
 
         amp = 0.9522 * EvtComplex( cos( -1.8565 ), sin( -1.8565 ) ) +
               1.00 * DplusKpipi0Res1.relBrWig( 0 ) +
               0.8695 * EvtComplex( cos( 0.7191 ), sin( 0.7191 ) ) *
                   DplusKpipi0Res2.relBrWig( 1 );
     }
 
     if ( m_flag == 3 ) {
         // D0 -> K0bar pi- pi+ & CC
         // If it does not come from a B->DK, decay it as D0 or D0bar separately
         // if p4_p is D0, moms1 is K0, moms2 is pi-, moms3 is pi+
         // if p4_p is D0bar, moms1 is K0, moms2 is pi+, moms3 is pi-
 
         if ( isBToDK ) {
             // Gamma angle in rad.
             double gamma = EvtDecayTable::getInstance()
                                ->getDecayFunc( p->getParent() )
                                ->getArg( 0 );
             // Strong phase in rad.
             double delta = EvtDecayTable::getInstance()
                                ->getDecayFunc( p->getParent() )
                                ->getArg( 1 );
             // Ratio between B->D0K and B->D0barK
             double A = EvtDecayTable::getInstance()
                            ->getDecayFunc( p->getParent() )
                            ->getArg( 2 );
 
             EvtComplex Factor( fabs( A ) * cos( delta ),
                                fabs( A ) * sin( delta ) );
 
             if ( ( p->getParent()->getId() == BP ) ||
                  ( p->getParent()->getId() == B0 ) ) {
                 // the ratio D/Dbar
                 Factor = Factor * EvtComplex( cos( gamma ), sin( gamma ) );
                 if ( p->getId() == D0 ) {
                     // the flavor of the particle has no meaning. But we need
                     // it to know which daughter is pi+ or pi-
                     // M( B+ or B0 ) = f(Dbar) + factor * f(D)
                     // f(Dbar) = amplDtoK0PiPi(pD, K0, pi+, pi-)
                     // f(D)    = amplDtoK0PiPi(pD, K0, pi-, pi+)
                     // Then ...
                     amp = amplDtoK0PiPi( p4_p, moms1, moms3, moms2 ) +
                           Factor * amplDtoK0PiPi( p4_p, moms1, moms2, moms3 );
                 } else {
                     amp = amplDtoK0PiPi( p4_p, moms1, moms2, moms3 ) +
                           Factor * amplDtoK0PiPi( p4_p, moms1, moms3, moms2 );
                 }
             } else if ( ( p->getParent()->getId() == BM ) ||
                         ( p->getParent()->getId() == B0B ) ) {
                 Factor = Factor * EvtComplex( cos( gamma ), -sin( gamma ) );
                 // here M( B- or B0bar ) = f(D) + factor * f(Dbar) then ...
                 if ( p->getId() == D0 ) {
                     amp = amplDtoK0PiPi( p4_p, moms1, moms2, moms3 ) +
                           Factor * amplDtoK0PiPi( p4_p, moms1, moms3, moms2 );
                 } else {
                     amp = amplDtoK0PiPi( p4_p, moms1, moms3, moms2 ) +
                           Factor * amplDtoK0PiPi( p4_p, moms1, moms2, moms3 );
                 }
             }
         } else {
             amp = amplDtoK0PiPi( p4_p, moms1, moms2, moms3 );
         }
     }
 
     if ( m_flag == 4 ) {
         // D0 to K- pi+ pi0
         EvtResonance2 DKpipi0Res1( p4_p, moms2, moms3, 1.0, 0.0, 0.1507, 0.770,
                                    1 );    //rho
         EvtResonance2 DKpipi0Res2( p4_p, moms1, moms2, 0.39, -0.2, 0.0505,
                                    0.8961, 1 );    //k*0
         EvtResonance2 DKpipi0Res3( p4_p, moms1, moms3, 0.44, 163.0, 0.050,
                                    0.8915, 1 );    //k*-
 
         EvtResonance2 DKpipi0Res4( p4_p, moms1, moms3, 0.77, 55.5, 0.294, 1.412,
                                    0 );    //k01430-
         EvtResonance2 DKpipi0Res5( p4_p, moms1, moms2, 0.85, 166.0, 0.294,
                                    1.412, 0 );    //k01430bar
         EvtResonance2 DKpipi0Res6( p4_p, moms2, moms3, 2.5, 171.0, 0.240, 1.700,
                                    1 );    //rho1700
         EvtResonance2 DKpipi0Res7( p4_p, moms1, moms3, 2.5, 103.0, 0.322, 1.717,
                                    1 );    //K*1680-
 
         double pi180inv = 1.0 / EvtConst::radToDegrees;
 
         amp = EvtComplex( 1.75 * cos( 31.2 * pi180inv ),
                           1.75 * sin( 31.2 * pi180inv ) ) +
               DKpipi0Res1.resAmpl() + DKpipi0Res2.resAmpl() +
               DKpipi0Res3.resAmpl() + DKpipi0Res4.resAmpl() +
               DKpipi0Res5.resAmpl() + DKpipi0Res6.resAmpl() +
               DKpipi0Res7.resAmpl();
     }
 
     if ( m_flag == 5 ) {
         // D0 -> K0bar K+ K- & CC
         // If it does not come from a B->DK, decay it as D0 or D0bar separately
         // if p4_p is D0, moms1 is K0, moms2 is pi-, moms3 is pi+
         // if p4_p is D0bar, moms1 is K0, moms2 is pi+, moms3 is pi-
 
         if ( isBToDK ) {
             // Gamma angle in rad.
             double gamma = EvtDecayTable::getInstance()
                                ->getDecayFunc( p->getParent() )
                                ->getArg( 0 );
             // Strong phase in rad.
             double delta = EvtDecayTable::getInstance()
                                ->getDecayFunc( p->getParent() )
                                ->getArg( 1 );
             // Ratio between B->D0K and B->D0barK
             double A = EvtDecayTable::getInstance()
                            ->getDecayFunc( p->getParent() )
                            ->getArg( 2 );
 
             EvtComplex Factor( fabs( A ) * cos( delta ),
                                fabs( A ) * sin( delta ) );
 
             if ( ( p->getParent()->getId() == BP ) ||
                  ( p->getParent()->getId() == B0 ) ) {
                 // the ratio D/Dbar
                 Factor = Factor * EvtComplex( cos( gamma ), sin( gamma ) );
                 if ( p->getId() == D0 ) {
                     // the flavor of the particle has no meaning. But we need
                     // it to know which daughter is pi+ or pi-
                     // M( B+ or B0 ) = f(Dbar) + factor * f(D)
                     // f(Dbar) = amplDtoK0PiPi(pD, K0, K+, K-)
                     // f(D)    = amplDtoK0PiPi(pD, K0, K-, K+)
                     // Then ...
                     amp = amplDtoK0KK( p4_p, moms1, moms3, moms2 ) +
                           Factor * amplDtoK0KK( p4_p, moms1, moms2, moms3 );
                 } else {
                     amp = amplDtoK0KK( p4_p, moms1, moms2, moms3 ) +
                           Factor * amplDtoK0KK( p4_p, moms1, moms3, moms2 );
                 }
             } else if ( ( p->getParent()->getId() == BM ) ||
                         ( p->getParent()->getId() == B0B ) ) {
                 Factor = Factor * EvtComplex( cos( gamma ), -sin( gamma ) );
                 // here M( B- or B0bar ) = f(D) + factor * f(Dbar) then ...
                 if ( p->getId() == D0 ) {
                     amp = amplDtoK0KK( p4_p, moms1, moms2, moms3 ) +
                           Factor * amplDtoK0KK( p4_p, moms1, moms3, moms2 );
                 } else {
                     amp = amplDtoK0KK( p4_p, moms1, moms3, moms2 ) +
                           Factor * amplDtoK0KK( p4_p, moms1, moms2, moms3 );
                 }
             }
         } else {
             amp = amplDtoK0KK( p4_p, moms1, moms2, moms3 );
         }
     }
 
     // Ds+ -> K- K+ pi+
     //Babar, arxiv:1011.4190
     if ( m_flag == 6 ) {
         EvtResonance2 DsKKpiRes1( p4_p, moms3, moms1, 1.0, 0.0, 0.0455, 0.8944,
                                   1, true );    // K*(892)
         EvtResonance2 DsKKpiRes2( p4_p, moms3, moms1, 1.48, 138., 0.290, 1.414,
                                   0 );    // K*_0(1430)
         EvtFlatte DsKKpiRes3( p4_p, moms1, moms2, 5.07, 156., 0.965,
                               m_kkpi_params );    // f_0(980)
         EvtResonance2 DsKKpiRes4( p4_p, moms1, moms2, 1.15, -10., 0.00426,
                                   1.019455, 1, true );    // phi(1020)
         EvtResonance2 DsKKpiRes5( p4_p, moms1, moms2, 1.28, 53., 0.265, 1.350,
                                   0 );    // f_0(1370)
         EvtResonance2 DsKKpiRes6( p4_p, moms1, moms2, 1.19, 87., 0.137, 1.724,
                                   0 );    // f_0(1710)
         amp = DsKKpiRes1.resAmpl() + DsKKpiRes2.resAmpl() + DsKKpiRes3.resAmpl() +
               DsKKpiRes4.resAmpl() + DsKKpiRes5.resAmpl() + DsKKpiRes6.resAmpl();
     }
 
     //D+ -> K- K+ pi+
     //CLEO PRD 78, 072003 (2008) Fit A
     if ( m_flag == 7 ) {
         EvtResonance2 DpKKpiRes1( p4_p, moms3, moms1, 1.0, 0.0, 0.0503, 0.8960,
                                   1, true );    // K*(892)
         EvtResonance2 DpKKpiRes2( p4_p, moms3, moms1, 3.7, 73.0, 0.290, 1.414,
                                   0 );    // K*_0(1430)
         EvtResonance2 DpKKpiRes3( p4_p, moms1, moms2, 1.189, -179.0 + 180.0,
                                   0.00426, 1.019455, 1, true );    // phi(1020)
         EvtResonance2 DpKKpiRes4( p4_p, moms1, moms2, 1.72, 123., 0.265, 1.474,
                                   0 );    // a_0(1450)
         EvtResonance2 DpKKpiRes5( p4_p, moms1, moms2, 1.9, -52.0 + 180.0, 0.15,
                                   1.68, 1, true );    // phi(1680)
         EvtResonance2 DpKKpiRes6( p4_p, moms3, moms1, 6.4, 150., 0.109, 1.4324,
                                   2, true );    // K*_2(1430)
         double pi180inv = 1.0 / EvtConst::radToDegrees;
         amp = EvtComplex( 5.1 * cos( ( 53.0 ) * pi180inv ),
                           5.1 * sin( ( 53.0 ) * pi180inv ) ) +
               DpKKpiRes1.resAmpl() + DpKKpiRes2.resAmpl() + DpKKpiRes3.resAmpl() +
               DpKKpiRes4.resAmpl() + DpKKpiRes5.resAmpl() + DpKKpiRes6.resAmpl();
     }
 
     //D+ -> pi- pi+ K+ WS (DCS)
     //FOCUS PLB 601 10 (2004) ; amplitudes there are individually normalized (although not explicit in the paper)
     // thus the magnitudes appearing below come from dividing the ones appearing in the paper by the sqrt of the
     // integral over the DP of the corresponding squared amplitude. Writing as pi- pi+ K+ so pipi resonances are (12)
     // and Kpi resonances are (31); masses and widths corresponds to PDG 2010
     if ( m_flag == 8 ) {
         EvtResonance2 DpKpipiDCSRes1( p4_p, moms1, moms2, 1.0, 0.0, 0.149,
                                       0.775, 1, true );    // rho(770)
         EvtResonance2 DpKpipiDCSRes2( p4_p, moms3, moms1, 1.0971, -167.1,
                                       0.0487, 0.896, 1, true );    // K*(890)
         EvtResonance2 DpKpipiDCSRes3( p4_p, moms1, moms2, 0.4738, -134.5, 0.059,
                                       0.972, 0 );    // f0(980) as simple BW
         EvtResonance2 DpKpipiDCSRes4( p4_p, moms3, moms1, 2.2688, 54.4, 0.109,
                                       1.432, 2, true );    // K*2(1430)
         amp = DpKpipiDCSRes1.resAmpl() + DpKpipiDCSRes2.resAmpl() +
               DpKpipiDCSRes3.resAmpl() + DpKpipiDCSRes4.resAmpl();
     }
 
     //Ds+ -> pi- pi+ K+ WS (CS)
     //FOCUS PLB 601 10 (2004) ; amplitudes there are individually normalized (although not explicit in the paper)
     // thus the magnitudes appearing below come from dividing the ones appearing in the paper by the sqrt of the
     // integral over the DP of the corresponding squared amplitude. Writing as pi- pi+ K+ so pipi resonances are (12)
     // and Kpi resonances are (31); masses and widths corresponds to PDG 2010
     // PROBLEM: by simply doing the procedure for D+, the resulting DP and projections do not resemble what is
     // in the paper; the best model is by adding 180 to the vector Kpi resonances
     if ( m_flag == 9 ) {
         EvtResonance2 DsKpipiCSRes1( p4_p, moms1, moms2, 1.0, 0.0, 0.149, 0.775,
                                      1, true );    // rho(770)
         EvtResonance2 DsKpipiCSRes2( p4_p, moms3, moms1, 0.7236, -18.3, 0.0487,
                                      0.896, 1, true );    // K*(890)
         EvtResonance2 DsKpipiCSRes3( p4_p, moms3, moms1, 2.711, 145.2, 0.232,
                                      1.414, 1, true );    // K*(1410)
         EvtResonance2 DsKpipiCSRes4( p4_p, moms3, moms1, 1.7549, 59.3, 0.270,
                                      1.425, 0 );    // K*0(1430)
         EvtResonance2 DsKpipiCSRes5( p4_p, moms1, moms2, 7.0589, -151.7, 0.400,
                                      1.465, 1, true );    // rho(1450)
         double pi180inv = 1.0 / EvtConst::radToDegrees;
         amp = EvtComplex( 3.98 * cos( 43.1 * pi180inv ),
                           3.98 * sin( 43.1 * pi180inv ) ) +
               DsKpipiCSRes1.resAmpl() + DsKpipiCSRes2.resAmpl() +
               DsKpipiCSRes3.resAmpl() + DsKpipiCSRes4.resAmpl() +
               DsKpipiCSRes5.resAmpl();
     }
     // D+ -> pi- pi+ pi+  from E791  [PRL 86 770 (2001)]
     // masses and widths below correspond to what they used; there, the amplitudes were individually normalized
     // (although not explicit) so magnitudes here are obtained after correcting for that
     // Breit-Wigner has a factor of (-1) there which changes the relative phase of the NR wrt to the resonances
     // thus the NR magnitude is set as negative
     if ( m_flag == 10 ) {
         EvtResonance2 DppipipiRes11( p4_p, moms1, moms2, 1.0, 0.0, 0.150, 0.769,
                                      1, true );    // rho(770)
         EvtResonance2 DppipipiRes12( p4_p, moms3, moms1, 1.0, 0.0, 0.150, 0.769,
                                      1, true );    // rho(770)
         EvtResonance2 DppipipiRes21( p4_p, moms1, moms2, 2.2811, 205.7, 0.324,
                                      0.478, 0 );    // sigma(500)
         EvtResonance2 DppipipiRes22( p4_p, moms3, moms1, 2.2811, 205.7, 0.324,
                                      0.478, 0 );    // sigma(500)
         EvtResonance2 DppipipiRes31( p4_p, moms1, moms2, 0.4265, 165.0, 0.044,
                                      0.977, 0 );    // f0(980) simple BW
         EvtResonance2 DppipipiRes32( p4_p, moms3, moms1, 0.4265, 165.0, 0.044,
                                      0.977, 0 );    // f0(980) simple BW
         EvtResonance2 DppipipiRes41( p4_p, moms1, moms2, 2.0321, 57.3, 0.185,
                                      1.275, 2, true );    // f2(1270)
         EvtResonance2 DppipipiRes42( p4_p, moms3, moms1, 2.0321, 57.3, 0.185,
                                      1.275, 2, true );    // f2(1270)
         EvtResonance2 DppipipiRes51( p4_p, moms1, moms2, 0.7888, 105.4, 0.173,
                                      1.434, 0 );    // f0(1370)
         EvtResonance2 DppipipiRes52( p4_p, moms3, moms1, 0.7888, 105.4, 0.173,
                                      1.434, 0 );    // f0(1370)
         EvtResonance2 DppipipiRes61( p4_p, moms1, moms2, 0.7363, 319.1, 0.310,
                                      1.465, 1, true );    // rho(1450)
         EvtResonance2 DppipipiRes62( p4_p, moms3, moms1, 0.7363, 319.1, 0.310,
                                      1.465, 1, true );    // rho(1450)
         double pi180inv = 1.0 / EvtConst::radToDegrees;
         amp = EvtComplex( -3.98 * cos( 57.3 * pi180inv ),
                           -3.98 * sin( 57.3 * pi180inv ) ) +
               ( DppipipiRes11.resAmpl() - DppipipiRes12.resAmpl() )    //spin1
               + ( DppipipiRes21.resAmpl() + DppipipiRes22.resAmpl() ) +
               ( DppipipiRes31.resAmpl() + DppipipiRes32.resAmpl() ) +
               ( DppipipiRes41.resAmpl() + DppipipiRes42.resAmpl() ) +
               ( DppipipiRes51.resAmpl() + DppipipiRes52.resAmpl() ) +
               ( DppipipiRes61.resAmpl() - DppipipiRes62.resAmpl() );    //spin1
     }
     // Ds+ -> pi- pi+ pi+  from E791  [PRL 86 765 (2001)]
     // masses and widths below correspond to what they used; there, the amplitudes were individually normalized
     // (although not explicit) so magnitudes here are obtained after correcting for that
     // Breit-Wigner has a factor of (-1) there which changes the relative phase of the NR wrt to the resonances
     // thus the NR magnitude is set as negative
     if ( m_flag == 11 ) {
         EvtResonance2 DspipipiRes11( p4_p, moms1, moms2, 0.288, 109., 0.150,
                                      0.769, 1, true );    // rho(770)
         EvtResonance2 DspipipiRes12( p4_p, moms3, moms1, 0.288, 109., 0.150,
                                      0.769, 1, true );    // rho(770)
         EvtResonance2 DspipipiRes21( p4_p, moms1, moms2, 1.0, 0.0, 0.044, 0.977,
                                      0 );    // f0(980) simple BW
         EvtResonance2 DspipipiRes22( p4_p, moms3, moms1, 1.0, 0.0, 0.044, 0.977,
                                      0 );    // f0(980) simple BW
         EvtResonance2 DspipipiRes31( p4_p, moms1, moms2, 1.075, 133., 0.185,
                                      1.275, 2, true );    // f2(1270)
         EvtResonance2 DspipipiRes32( p4_p, moms3, moms1, 1.075, 133., 0.185,
                                      1.275, 2, true );    // f2(1270)
         EvtResonance2 DspipipiRes41( p4_p, moms1, moms2, 2.225, 198., 0.173,
                                      1.434, 0 );    // f0(1370)
         EvtResonance2 DspipipiRes42( p4_p, moms3, moms1, 2.225, 198., 0.173,
                                      1.434, 0 );    // f0(1370)
         EvtResonance2 DspipipiRes51( p4_p, moms1, moms2, 1.107, 162., 0.310,
                                      1.465, 1, true );    // rho(1450)
         EvtResonance2 DspipipiRes52( p4_p, moms3, moms1, 1.107, 162., 0.310,
                                      1.465, 1, true );    // rho(1450)
         double pi180inv = 1.0 / EvtConst::radToDegrees;
         amp = EvtComplex( -0.723 * cos( 181. * pi180inv ),
                           -0.723 * sin( 181. * pi180inv ) ) +
               ( DspipipiRes11.resAmpl() - DspipipiRes12.resAmpl() )    //spin1
               + ( DspipipiRes21.resAmpl() + DspipipiRes22.resAmpl() ) +
               ( DspipipiRes31.resAmpl() + DspipipiRes32.resAmpl() ) +
               ( DspipipiRes41.resAmpl() + DspipipiRes42.resAmpl() ) +
               ( DspipipiRes51.resAmpl() - DspipipiRes52.resAmpl() );    //spin1
     }
 
     //D0 -> pi- pi+ pi0
     //PRL 99, 251801 (2007)
     //arXiv:hep-ex/0703037
     // Amplitude magnitudes taken from the above paper, but corrected for normalization
     // For details, see https://phab.hepforge.org/T219
     if ( m_flag == 12 ) {
         EvtResonance2 DpipipiRes1p( p4_p, moms2, moms3, 1.0, 0.0, 0.149, 0.775,
                                     1, true );    //rho+(770)
         EvtResonance2 DpipipiRes1( p4_p, moms1, moms2, 0.6237, 16.2, 0.149,
                                    0.775, 1, true );    //rho0(770)
         EvtResonance2 DpipipiRes1m( p4_p, moms3, moms1, 0.7143, -2.0, 0.149,
                                     0.775, 1, true );    //rho-(770)
         EvtResonance2 DpipipiRes2p( p4_p, moms2, moms3, 0.2587, -146.0, 0.400,
                                     1.465, 1, true );    //rho+(1450)
         EvtResonance2 DpipipiRes2( p4_p, moms1, moms2, 0.4258, 10.0, 0.400,
                                    1.465, 1, true );    //rho0(1450)
         EvtResonance2 DpipipiRes2m( p4_p, moms3, moms1, 1.043, 16.0, 0.400,
                                     1.465, 1, true );    //rho-(1450)
         EvtResonance2 DpipipiRes3p( p4_p, moms2, moms3, 4.155, -17.0, 0.250,
                                     1.720, 1, true );    //rho+(1700)
         EvtResonance2 DpipipiRes3( p4_p, moms1, moms2, 4.508, -17.0, 0.250,
                                    1.720, 1, true );    //rho0(1700)
         EvtResonance2 DpipipiRes3m( p4_p, moms3, moms1, 3.670, -50.0, 0.250,
                                     1.720, 1, true );    //rho-(1700)
         EvtResonance2 DpipipiRes4( p4_p, moms1, moms2, 0.07289, -59.0, 0.07,
                                    0.980, 0 );    //f0(980)
         EvtResonance2 DpipipiRes5( p4_p, moms1, moms2, 0.3186, 156.0, 0.350,
                                    1.370, 0 );    //f0(1370)
         EvtResonance2 DpipipiRes6( p4_p, moms1, moms2, 0.2075, 12.0, 0.109,
                                    1.505, 0 );    //f0(1500)
         EvtResonance2 DpipipiRes7( p4_p, moms1, moms2, 0.3823, 51.0, 0.135,
                                    1.720, 0 );    //f0(1720)
         EvtResonance2 DpipipiRes8( p4_p, moms1, moms2, 0.3878, -171.0, 0.185,
                                    1.275, 2, true );    //f2(1270)
         EvtResonance2 DpipipiRes9( p4_p, moms1, moms2, 0.3249, 8.0, 0.600, 0.400,
                                    0 );    //sigma(400)
 
         double pi180inv = 1.0 / EvtConst::radToDegrees;
         amp = EvtComplex( 0.6087 * cos( -11.0 * pi180inv ),
                           0.6087 * sin( -11.0 * pi180inv ) ) +
               DpipipiRes1p.resAmpl() + DpipipiRes1.resAmpl() +
               DpipipiRes1m.resAmpl() + DpipipiRes2p.resAmpl() +
               DpipipiRes2.resAmpl() + DpipipiRes2m.resAmpl() +
               DpipipiRes3p.resAmpl() + DpipipiRes3.resAmpl() +
               DpipipiRes3m.resAmpl() + DpipipiRes4.resAmpl() +
               DpipipiRes5.resAmpl() + DpipipiRes6.resAmpl() +
               DpipipiRes7.resAmpl() + DpipipiRes8.resAmpl() +
               DpipipiRes9.resAmpl();
     }
 
     vertex( amp );
 
     return;
 }
 
 EvtComplex EvtDDalitz::amplDtoK0PiPi( EvtVector4R p4_p, EvtVector4R moms1,
                                       EvtVector4R moms2, EvtVector4R moms3 )
 {
     //K*(892)-
     EvtResonance2 DK2piRes1( p4_p, moms1, moms2, 1.418, -190.0, 0.0508, 0.89166,
                              1 );
     //K0*(1430)-
     EvtResonance2 DK2piRes2( p4_p, moms1, moms2, 1.818, -337.0, 0.294, 1.412, 0 );
     //K2*(1430)-
     EvtResonance2 DK2piRes3( p4_p, moms1, moms2, 0.909, -5.0, 0.0985, 1.4256, 2 );
     //K*(1680)-
     EvtResonance2 DK2piRes4( p4_p, moms1, moms2, 5.091, -166.0, 0.322, 1.717, 1 );
     //DCS K*(892)+
     EvtResonance2 DK2piRes5( p4_p, moms1, moms3, 0.100, -19.0, 0.0508, 0.89166,
                              1 );
 
     //Rho0
     EvtResonance2 DK2piRes6( p4_p, moms3, moms2, 0.909, -340.0, 0.1502, 0.7693,
                              1 );
     //Omega
     EvtResonance2 DK2piRes7( p4_p, moms3, moms2, .0336, -226.0, 0.00844,
                              0.78257, 1 );
     //f0(980)
     EvtResonance2 DK2piRes8( p4_p, moms3, moms2, 0.309, -152.0, 0.05, 0.977, 0 );
     //f0(1370)
     EvtResonance2 DK2piRes9( p4_p, moms3, moms2, 1.636, -255.0, 0.272, 1.31, 0 );
     //f2(1270)
     EvtResonance2 DK2piRes10( p4_p, moms3, moms2, 0.636, -32.0, 0.1851, 1.2754,
                               2 );
 
     return EvtComplex( 1.0, 0.0 ) + DK2piRes1.resAmpl() + DK2piRes2.resAmpl() +
            DK2piRes3.resAmpl() + DK2piRes4.resAmpl() + DK2piRes5.resAmpl() +
            DK2piRes6.resAmpl() + DK2piRes7.resAmpl() + DK2piRes8.resAmpl() +
            DK2piRes9.resAmpl() + DK2piRes10.resAmpl();
 }
 
 //
 // BaBar decay amplitudes for D0->Ks K+ K-
 //
 // p4_p is D0
 // moms1 is K0s
 // moms2 is K+
 // moms3 is K-
 // Amplitudes and phases are taken from BaBar hep-ex/0207089
 // with convention : Non Resonant = Amp 1. / Phase 0.
 
 EvtComplex EvtDDalitz::amplDtoK0KK( EvtVector4R p4_p, EvtVector4R moms1,
                                     EvtVector4R moms2, EvtVector4R moms3 )
 {
     //phi
     EvtResonance DK0KKRes1( p4_p, moms2, moms3, 113.75, -40.0, 0.0043, 1.019456,
                             1 );
     //a0(980)
     EvtResonance DK0KKRes2( p4_p, moms2, moms3, 152.25, 69.0, 0.1196, 0.9847, 0 );
     //f0(980)
     EvtResonance DK0KKRes3( p4_p, moms2, moms3, 30.5, -201.0, 0.05, 0.980, 0 );
     //a0(980)+
     EvtResonance DK0KKRes4( p4_p, moms1, moms2, 85.75, -93.0, 0.1196, 0.9847, 0 );
     //a0(980)-
     EvtResonance DK0KKRes5( p4_p, moms3, moms1, 8., -53.0, 0.1196, 0.9847, 0 );
 
     return EvtComplex( 1.0, 0.0 ) + DK0KKRes1.resAmpl() + DK0KKRes2.resAmpl() +
            DK0KKRes3.resAmpl() + DK0KKRes4.resAmpl() + DK0KKRes5.resAmpl();
 }
diff --git a/src/EvtGenModels/EvtDMix.cpp b/src/EvtGenModels/EvtDMix.cpp
index 94cd954..f80dff2 100644
--- a/src/EvtGenModels/EvtDMix.cpp
+++ b/src/EvtGenModels/EvtDMix.cpp
@@ -1,95 +1,95 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtDMix.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtDMix::getName()
+std::string EvtDMix::getName() const
 {
     return "DMIX";
 }
 
-EvtDecayBase* EvtDMix::clone()
+EvtDecayBase* EvtDMix::clone() const
 {
     return new EvtDMix;
 }
 
 void EvtDMix::init()
 {
     // check arguments
     checkNArg( 3 );
     m_rd = getArg( 0 );
     m_xpr = getArg( 1 );
     m_ypr = getArg( 2 );
 }
 
 void EvtDMix::initProbMax()
 {
     noProbMax();
 }
 
 void EvtDMix::decay( EvtParticle* p )
 {
     //unneeded - lange - may13-02
     //if ( p->getNDaug() != 0 ) {
     //Will end up here because maxrate multiplies by 1.2
     //  EvtGenReport(EVTGEN_DEBUG,"EvtGen") << "In EvtDMix: has "
     //			   <<" daugthers should not be here!"<<endl;
     //  return;
     //}
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     double ctau = EvtPDL::getctau( p->getId() );
     if ( ctau == 0. )
         return;
 
     double pdf, random, gt, weight;
 
     double maxPdf = m_rd + sqrt( m_rd ) * m_ypr * 50. +
                     2500.0 * ( m_xpr * m_xpr + m_ypr * m_ypr ) / 4.0;
     bool keepGoing = true;
     while ( keepGoing ) {
         random = EvtRandom::Flat();
         gt = -log( random );
         weight = random;
         pdf = m_rd + sqrt( m_rd ) * m_ypr * gt +
               gt * gt * ( m_xpr * m_xpr + m_ypr * m_ypr ) / 4.0;
         pdf *= exp( -1.0 * gt );
         pdf /= weight;
         if ( pdf > maxPdf )
             std::cout << pdf << " " << weight << " " << maxPdf << " " << gt
                       << std::endl;
         if ( pdf > maxPdf * EvtRandom::Flat() )
             keepGoing = false;
     }
 
     p->setLifetime( gt * ctau );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtDToKpienu.cpp b/src/EvtGenModels/EvtDToKpienu.cpp
index 0bb2744..9b9fdb5 100644
--- a/src/EvtGenModels/EvtDToKpienu.cpp
+++ b/src/EvtGenModels/EvtDToKpienu.cpp
@@ -1,519 +1,519 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtDToKpienu.hh"
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDecayTable.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
-std::string EvtDToKpienu::getName()
+std::string EvtDToKpienu::getName() const
 {
     return "DToKpienu";
 }
 
-EvtDecayBase* EvtDToKpienu::clone()
+EvtDecayBase* EvtDToKpienu::clone() const
 {
     return new EvtDToKpienu;
 }
 
 void EvtDToKpienu::init()
 {
     checkNArg( 0 );
     checkNDaug( 4 );
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "EvtDToKpienu ==> Initialization !" << std::endl;
     m_nAmps = 2;
 
     m_rS = -11.57;    // S-wave
     m_rS1 = 0.08;
     m_a_delta = 1.94;
     m_b_delta = -0.81;
     m_m0_1430_S = 1.425;
     m_width0_1430_S = 0.270;
     m_type[0] = 0;
 
     m_mV = 1.81;
     m_mA = 2.61;
     m_V_0 = 1.411;
     m_A1_0 = 1;
     m_A2_0 = 0.788;
 
     m_m0 = 0.8946;    // P-wave K*
     m_width0 = 0.04642;
     m_rBW = 3.07;
     m_rho = 1;
     m_phi = 0;
     m_type[1] = 1;
 
     m_m0_1410 = 1.414;    // P-wave K*(1410)
     m_width0_1410 = 0.232;
     m_rho_1410 = 0.1;
     m_phi_1410 = 0.;
     m_type[2] = 2;
 
     m_TV_0 = 1;    // D-wave K*2(1430)
     m_T1_0 = 1;
     m_T2_0 = 1;
     m_m0_1430 = 1.4324;
     m_width0_1430 = 0.109;
     m_rho_1430 = 15;
     m_phi_1430 = 0;
     m_type[3] = 3;
 
     m_mD = 1.86962;
     m_mPi = 0.13957;
     m_mK = 0.49368;
     m_Pi = atan2( 0.0, -1.0 );
     m_root2 = sqrt( 2. );
     m_root2d3 = sqrt( 2. / 3 );
     m_root1d2 = sqrt( 0.5 );
     m_root3d2 = sqrt( 1.5 );
 }
 
 void EvtDToKpienu::initProbMax()
 {
     /*
    * This piece of code could in principle be used to calculate maximum
    * probablity on fly. But as it uses high number of points and model
    * deals with single final state, we keep hardcoded number for now rather
    * than adapting code to work here.
 
      double maxprob = 0.0;
      for(int ir=0;ir<=60000000;ir++){
         p->initializePhaseSpace(getNDaug(),getDaugs());
         EvtVector4R _K  = p->getDaug(0)->getP4();
         EvtVector4R _pi = p->getDaug(1)->getP4();
         EvtVector4R _e  = p->getDaug(2)->getP4();
         EvtVector4R _nu = p->getDaug(3)->getP4();
         int pid = EvtPDL::getStdHep(p->getDaug(0)->getId());
         int charm;
         if(pid == -321) charm = 1;
         else charm = -1;
         double m2, q2, cosV, cosL, chi;
         KinVGen(_K, _pi, _e, _nu, charm, m2, q2, cosV, cosL, chi);
         double _prob = calPDF(m2, q2, cosV, cosL, chi);
         if(_prob>maxprob) {
             maxprob=_prob;
             EvtGenReport(EVTGEN_INFO,"EvtGen") << "Max PDF = " << ir << " charm= " << charm << " prob= "
      << _prob << std::endl;
         }
      }
      EvtGenReport(EVTGEN_INFO,"EvtGen") << "Max!!!!!!!!!!! " << maxprob<< std::endl;
   */
     setProbMax( 22750.0 );
 }
 
 void EvtDToKpienu::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtVector4R K = p->getDaug( 0 )->getP4();
     EvtVector4R pi = p->getDaug( 1 )->getP4();
     EvtVector4R e = p->getDaug( 2 )->getP4();
     EvtVector4R nu = p->getDaug( 3 )->getP4();
 
     int pid = EvtPDL::getStdHep( p->getDaug( 0 )->getId() );
     int charm;
     if ( pid == -321 ) {
         charm = 1;
     } else {
         charm = -1;
     }
     double m2, q2, cosV, cosL, chi;
     KinVGen( K, pi, e, nu, charm, m2, q2, cosV, cosL, chi );
     double prob = calPDF( m2, q2, cosV, cosL, chi );
     setProb( prob );
     return;
 }
 
 void EvtDToKpienu::KinVGen( const EvtVector4R& vp4_K, const EvtVector4R& vp4_Pi,
                             const EvtVector4R& vp4_Lep, const EvtVector4R& vp4_Nu,
                             const int charm, double& m2, double& q2,
                             double& cosV, double& cosL, double& chi ) const
 {
     EvtVector4R vp4_KPi = vp4_K + vp4_Pi;
     EvtVector4R vp4_W = vp4_Lep + vp4_Nu;
 
     m2 = vp4_KPi.mass2();
     q2 = vp4_W.mass2();
 
     EvtVector4R boost;
     boost.set( vp4_KPi.get( 0 ), -vp4_KPi.get( 1 ), -vp4_KPi.get( 2 ),
                -vp4_KPi.get( 3 ) );
     EvtVector4R vp4_Kp = boostTo( vp4_K, boost );
     cosV = vp4_Kp.dot( vp4_KPi ) / ( vp4_Kp.d3mag() * vp4_KPi.d3mag() );
 
     boost.set( vp4_W.get( 0 ), -vp4_W.get( 1 ), -vp4_W.get( 2 ), -vp4_W.get( 3 ) );
     EvtVector4R vp4_Lepp = boostTo( vp4_Lep, boost );
     cosL = vp4_Lepp.dot( vp4_W ) / ( vp4_Lepp.d3mag() * vp4_W.d3mag() );
 
     EvtVector4R V = vp4_KPi / vp4_KPi.d3mag();
     EvtVector4R C = vp4_Kp.cross( V );
     C /= C.d3mag();
     EvtVector4R D = vp4_Lepp.cross( V );
     D /= D.d3mag();
     double sinx = C.cross( V ).dot( D );
     double cosx = C.dot( D );
     chi = sinx > 0 ? acos( cosx ) : -acos( cosx );
     if ( charm == -1 )
         chi = -chi;
 }
 
 double EvtDToKpienu::calPDF( const double m2, const double q2, const double cosV,
                              const double cosL, const double chi ) const
 {
     double m = sqrt( m2 );
     double q = sqrt( q2 );
 
     // begin to calculate form factor
     EvtComplex F10( 0.0, 0.0 );
     EvtComplex F11( 0.0, 0.0 );
     EvtComplex F21( 0.0, 0.0 );
     EvtComplex F31( 0.0, 0.0 );
     EvtComplex F12( 0.0, 0.0 );
     EvtComplex F22( 0.0, 0.0 );
     EvtComplex F32( 0.0, 0.0 );
 
     EvtComplex f10( 0.0, 0.0 );
     EvtComplex f11( 0.0, 0.0 );
     EvtComplex f21( 0.0, 0.0 );
     EvtComplex f31( 0.0, 0.0 );
     EvtComplex f12( 0.0, 0.0 );
     EvtComplex f22( 0.0, 0.0 );
     EvtComplex f32( 0.0, 0.0 );
     EvtComplex coef( 0.0, 0.0 );
     double amplitude_temp, delta_temp;
 
     for ( int index = 0; index < m_nAmps; index++ ) {
         switch ( m_type[index] ) {
             case 0:    // calculate form factor of S wave
             {
                 NRS( m, q, m_rS, m_rS1, m_a_delta, m_b_delta, m_mA, m_m0_1430_S,
                      m_width0_1430_S, amplitude_temp, delta_temp, f10 );
                 F10 = F10 + f10;
                 break;
             }
             case 1:    // calculate form factor of P wave (K*)
             {
                 ResonanceP( m, q, m_mV, m_mA, m_V_0, m_A1_0, m_A2_0, m_m0,
                             m_width0, m_rBW, amplitude_temp, delta_temp, f11,
                             f21, f31 );
                 coef = getCoef( m_rho, m_phi );
                 F11 = F11 + coef * f11;
                 F21 = F21 + coef * f21;
                 F31 = F31 + coef * f31;
                 break;
             }
             case 2:    // calculate form factor of P wave (K*(1410))
             {
                 ResonanceP( m, q, m_mV, m_mA, m_V_0, m_A1_0, m_A2_0, m_m0_1410,
                             m_width0_1410, m_rBW, amplitude_temp, delta_temp,
                             f11, f21, f31 );
                 coef = getCoef( m_rho_1410, m_phi_1410 );
                 F11 = F11 + coef * f11;
                 F21 = F21 + coef * f21;
                 F31 = F31 + coef * f31;
                 break;
             }
             case 3:    // calculate form factor of D wave
             {
                 ResonanceD( m, q, m_mV, m_mA, m_TV_0, m_T1_0, m_T2_0, m_m0_1430,
                             m_width0_1430, m_rBW, amplitude_temp, delta_temp,
                             f12, f22, f32 );
                 coef = getCoef( m_rho_1430, m_phi_1430 );
                 F12 = F12 + coef * f12;
                 F22 = F22 + coef * f22;
                 F32 = F32 + coef * f32;
                 break;
             }
             default: {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "No such form factor type!!!" << std::endl;
                 break;
             }
         }
     }
 
     // begin to calculate pdf value
     double I, I1, I2, I3, I4, I5, I6, I7, I8, I9;
 
     double cosV2 = cosV * cosV;
     double sinV = sqrt( 1.0 - cosV2 );
     double sinV2 = sinV * sinV;
 
     EvtComplex F1 = F10 + F11 * cosV + F12 * ( 1.5 * cosV2 - 0.5 );
     EvtComplex F2 = F21 * m_root1d2 + F22 * cosV * m_root3d2;
     EvtComplex F3 = F31 * m_root1d2 + F32 * cosV * m_root3d2;
 
     I1 = 0.25 * ( abs2( F1 ) + 1.5 * sinV2 * ( abs2( F2 ) + abs2( F3 ) ) );
     I2 = -0.25 * ( abs2( F1 ) - 0.5 * sinV2 * ( abs2( F2 ) + abs2( F3 ) ) );
     I3 = -0.25 * ( abs2( F2 ) - abs2( F3 ) ) * sinV2;
     I4 = real( conj( F1 ) * F2 ) * sinV * 0.5;
     I5 = real( conj( F1 ) * F3 ) * sinV;
     I6 = real( conj( F2 ) * F3 ) * sinV2;
     I7 = imag( conj( F2 ) * F1 ) * sinV;
     I8 = imag( conj( F3 ) * F1 ) * sinV * 0.5;
     I9 = imag( conj( F3 ) * F2 ) * sinV2 * ( -0.5 );
 
     double coschi = cos( chi );
     double sinchi = sin( chi );
     double sin2chi = 2.0 * sinchi * coschi;
     double cos2chi = 1.0 - 2.0 * sinchi * sinchi;
 
     double sinL = sqrt( 1. - cosL * cosL );
     double sinL2 = sinL * sinL;
     double sin2L = 2.0 * sinL * cosL;
     double cos2L = 1.0 - 2.0 * sinL2;
 
     I = I1 + I2 * cos2L + I3 * sinL2 * cos2chi + I4 * sin2L * coschi +
         I5 * sinL * coschi + I6 * cosL + I7 * sinL * sinchi +
         I8 * sin2L * sinchi + I9 * sinL2 * sin2chi;
     return I;
 }
 
 void EvtDToKpienu::ResonanceP( const double m, const double q, const double mV,
                                const double mA, const double V_0,
                                const double A1_0, const double A2_0,
                                const double m0, const double width0,
                                const double rBW, double& amplitude,
                                double& delta, EvtComplex& F11, EvtComplex& F21,
                                EvtComplex& F31 ) const
 {
     double pKPi = getPStar( m_mD, m, q );
     double mD2 = m_mD * m_mD;
     double m2 = m * m;
     double m02 = m0 * m0;
     double q2 = q * q;
     double mV2 = mV * mV;
     double mA2 = mA * mA;
     double summDm = m_mD + m;
     double V = V_0 / ( 1.0 - q2 / ( mV2 ) );
     double A1 = A1_0 / ( 1.0 - q2 / ( mA2 ) );
     double A2 = A2_0 / ( 1.0 - q2 / ( mA2 ) );
     double A = summDm * A1;
     double B = 2.0 * m_mD * pKPi / summDm * V;
 
     // construct the helicity form factor
     double H0 = 0.5 / ( m * q ) *
                 ( ( mD2 - m2 - q2 ) * summDm * A1 -
                   4.0 * ( mD2 * pKPi * pKPi ) / summDm * A2 );
     double Hp = A - B;
     double Hm = A + B;
 
     // calculate alpha
     double B_Kstar = 2. / 3.;    // B_Kstar = Br(Kstar(892)->k pi)
     double pStar0 = getPStar( m0, m_mPi, m_mK );
     double alpha = sqrt( 3. * m_Pi * B_Kstar / ( pStar0 * width0 ) );
 
     // construct amplitudes of (non)resonance
     double F = getF1( m, m0, m_mPi, m_mK, rBW );
     double width = getWidth1( m, m0, m_mPi, m_mK, width0, rBW );
 
     EvtComplex C( m0 * width0 * F, 0.0 );
     double AA = m02 - m2;
     double BB = -m0 * width;
     EvtComplex amp = C / EvtComplex( AA, BB );
     amplitude = abs( amp );
     delta = atan2( imag( amp ), real( amp ) );
 
     double alpham2 = alpha * 2.0;
     F11 = amp * alpham2 * q * H0 * m_root2;
     F21 = amp * alpham2 * q * ( Hp + Hm );
     F31 = amp * alpham2 * q * ( Hp - Hm );
 }
 
 void EvtDToKpienu::NRS( const double m, const double q, const double rS,
                         const double rS1, const double a_delta,
                         const double b_delta, const double mA, const double m0,
                         const double width0, double& amplitude, double& delta,
                         EvtComplex& F10 ) const
 {
     static const double tmp = ( m_mK + m_mPi ) * ( m_mK + m_mPi );
 
     double m2 = m * m;
     double q2 = q * q;
     double mA2 = mA * mA;
     double pKPi = getPStar( m_mD, m, q );
     double m_K0_1430 = m0;
     double width_K0_1430 = width0;
     double m2_K0_1430 = m_K0_1430 * m_K0_1430;
     double width = getWidth0( m, m_K0_1430, m_mPi, m_mK, width_K0_1430 );
 
     // calculate modul of the amplitude
     double x, Pm;
     if ( m < m_K0_1430 ) {
         x = sqrt( m2 / tmp - 1.0 );
         Pm = 1.0 + rS1 * x;
     } else {
         x = sqrt( m2_K0_1430 / tmp - 1.0 );
         Pm = 1.0 + rS1 * x;
         Pm *= m_K0_1430 * width_K0_1430 /
               sqrt( ( m2_K0_1430 - m2 ) * ( m2_K0_1430 - m2 ) +
                     m2_K0_1430 * width * width );
     }
 
     // calculate phase of the amplitude
     double pStar = getPStar( m, m_mPi, m_mK );
     double delta_bg = atan( 2. * a_delta * pStar /
                             ( 2. + a_delta * b_delta * pStar * pStar ) );
     delta_bg = ( delta_bg > 0 ) ? delta_bg : ( delta_bg + m_Pi );
 
     double delta_K0_1430 = atan( m_K0_1430 * width / ( m2_K0_1430 - m2 ) );
     delta_K0_1430 = ( delta_K0_1430 > 0 ) ? delta_K0_1430
                                           : ( delta_K0_1430 + m_Pi );
     delta = delta_bg + delta_K0_1430;
 
     EvtComplex ci( cos( delta ), sin( delta ) );
     EvtComplex amp = ci * rS * Pm;
     amplitude = rS * Pm;
 
     F10 = amp * pKPi * m_mD / ( 1. - q2 / mA2 );
 }
 
 void EvtDToKpienu::ResonanceD( const double m, const double q, const double mV,
                                const double mA, const double TV_0,
                                const double T1_0, const double T2_0,
                                const double m0, const double width0,
                                const double rBW, double& amplitude,
                                double& delta, EvtComplex& F12, EvtComplex& F22,
                                EvtComplex& F32 ) const
 {
     double pKPi = getPStar( m_mD, m, q );
     double mD2 = m_mD * m_mD;
     double m2 = m * m;
     double m02 = m0 * m0;
     double q2 = q * q;
     double mV2 = mV * mV;
     double mA2 = mA * mA;
     double summDm = m_mD + m;
     double TV = TV_0 / ( 1.0 - q2 / ( mV2 ) );
     double T1 = T1_0 / ( 1.0 - q2 / ( mA2 ) );
     double T2 = T2_0 / ( 1.0 - q2 / ( mA2 ) );
 
     // construct amplitudes of (non)resonance
     double F = getF2( m, m0, m_mPi, m_mK, rBW );
     double width = getWidth2( m, m0, m_mPi, m_mK, width0, rBW );
     EvtComplex C( m0 * width0 * F, 0.0 );
     double AA = m02 - m2;
     double BB = -m0 * width;
 
     EvtComplex amp = C / EvtComplex( AA, BB );
     amplitude = abs( amp );
     delta = atan2( imag( amp ), real( amp ) );
 
     F12 = amp * m_mD * pKPi / 3. *
           ( ( mD2 - m2 - q2 ) * summDm * T1 - mD2 * pKPi * pKPi / summDm * T2 );
     F22 = amp * m_root2d3 * m_mD * m * q * pKPi * summDm * T1;
     F32 = amp * m_root2d3 * 2. * mD2 * m * q * pKPi * pKPi / summDm * TV;
 }
 
 double EvtDToKpienu::getPStar( const double m, const double m1,
                                const double m2 ) const
 {
     double s = m * m;
     double s1 = m1 * m1;
     double s2 = m2 * m2;
     double x = s + s1 - s2;
     double t = 0.25 * x * x / s - s1;
     double p;
     if ( t > 0.0 ) {
         p = sqrt( t );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " Hello, pstar is less than 0.0" << std::endl;
         p = 0.04;
     }
     return p;
 }
 
 double EvtDToKpienu::getF1( const double m, const double m0, const double m_c1,
                             const double m_c2, const double rBW ) const
 {
     double pStar = getPStar( m, m_c1, m_c2 );
     double pStar0 = getPStar( m0, m_c1, m_c2 );
     double rBW2 = rBW * rBW;
     double pStar2 = pStar * pStar;
     double pStar02 = pStar0 * pStar0;
     double B = 1. / sqrt( 1. + rBW2 * pStar2 );
     double B0 = 1. / sqrt( 1. + rBW2 * pStar02 );
     double F = pStar / pStar0 * B / B0;
     return F;
 }
 
 double EvtDToKpienu::getF2( const double m, const double m0, const double m_c1,
                             const double m_c2, const double rBW ) const
 {
     double pStar = getPStar( m, m_c1, m_c2 );
     double pStar0 = getPStar( m0, m_c1, m_c2 );
     double rBW2 = rBW * rBW;
     double pStar2 = pStar * pStar;
     double pStar02 = pStar0 * pStar0;
     double B = 1. / sqrt( ( rBW2 * pStar2 - 3. ) * ( rBW2 * pStar2 - 3. ) +
                           9. * rBW2 * pStar2 );
     double B0 = 1. / sqrt( ( rBW2 * pStar02 - 3. ) * ( rBW2 * pStar02 - 3. ) +
                            9. * rBW2 * pStar02 );
     double F = pStar2 / pStar02 * B / B0;
     return F;
 }
 
 double EvtDToKpienu::getWidth0( const double m, const double m0,
                                 const double m_c1, const double m_c2,
                                 const double width0 ) const
 {
     double pStar = getPStar( m, m_c1, m_c2 );
     double pStar0 = getPStar( m0, m_c1, m_c2 );
     double width = width0 * pStar / pStar0 * m0 / m;
     return width;
 }
 
 double EvtDToKpienu::getWidth1( const double m, const double m0,
                                 const double m_c1, const double m_c2,
                                 const double width0, const double rBW ) const
 {
     double pStar = getPStar( m, m_c1, m_c2 );
     double pStar0 = getPStar( m0, m_c1, m_c2 );
     double F = getF1( m, m0, m_c1, m_c2, rBW );
     double width = width0 * pStar / pStar0 * m0 / m * F * F;
     return width;
 }
 
 double EvtDToKpienu::getWidth2( const double m, const double m0,
                                 const double m_c1, const double m_c2,
                                 const double width0, const double rBW ) const
 {
     double pStar = getPStar( m, m_c1, m_c2 );
     double pStar0 = getPStar( m0, m_c1, m_c2 );
     double F = getF2( m, m0, m_c1, m_c2, rBW );
     double width = width0 * pStar / pStar0 * m0 / m * F * F;
     return width;
 }
 
 EvtComplex EvtDToKpienu::getCoef( const double rho, const double phi ) const
 {
     EvtComplex coef( rho * cos( phi ), rho * sin( phi ) );
     return coef;
 }
diff --git a/src/EvtGenModels/EvtDalitzTable.cpp b/src/EvtGenModels/EvtDalitzTable.cpp
index d7bcd87..bf447d0 100644
--- a/src/EvtGenModels/EvtDalitzTable.cpp
+++ b/src/EvtGenModels/EvtDalitzTable.cpp
@@ -1,673 +1,673 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtDalitzTable.hh"
 
 #include "EvtGenBase/EvtCyclic3.hh"
 #include "EvtGenBase/EvtDalitzPlot.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParserXml.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 
 #include <sstream>
 #include <stdlib.h>
 
 using std::endl;
 using std::fstream;
 using std::ifstream;
 
 EvtDalitzTable::EvtDalitzTable()
 {
     m_dalitztable.clear();
     m_readFiles.clear();
 }
 
 EvtDalitzTable::~EvtDalitzTable()
 {
     m_dalitztable.clear();
     m_readFiles.clear();
 }
 
 EvtDalitzTable* EvtDalitzTable::getInstance( const std::string dec_name,
                                              bool verbose )
 {
-    static EvtDalitzTable* theDalitzTable = nullptr;
+    static thread_local EvtDalitzTable* theDalitzTable = nullptr;
 
     if ( theDalitzTable == nullptr ) {
         theDalitzTable = new EvtDalitzTable();
     }
 
     if ( !theDalitzTable->fileHasBeenRead( dec_name ) ) {
         theDalitzTable->readXMLDecayFile( dec_name, verbose );
     }
 
     return theDalitzTable;
 }
 
-bool EvtDalitzTable::fileHasBeenRead( const std::string dec_name )
+bool EvtDalitzTable::fileHasBeenRead( const std::string dec_name ) const
 {
-    std::vector<std::string>::iterator i = m_readFiles.begin();
+    std::vector<std::string>::const_iterator i = m_readFiles.begin();
     for ( ; i != m_readFiles.end(); i++ ) {
         if ( ( *i ).compare( dec_name ) == 0 ) {
             return true;
         }
     }
     return false;
 }
 
 void EvtDalitzTable::readXMLDecayFile( const std::string dec_name, bool verbose )
 {
     if ( verbose ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "EvtDalitzTable: Reading in xml parameter file " << dec_name
             << endl;
     }
 
     m_readFiles.push_back( dec_name );
 
     EvtDalitzDecayInfo* dalitzDecay = nullptr;
     double probMax = 0;
     EvtId ipar;
     std::string decayParent = "";
     std::string daugStr = "";
     EvtId daughter[3];
 
     EvtDalitzPlot dp;
     EvtComplex cAmp;
     std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>> angAndResPairs;
     std::string shape( "" );
     EvtSpinType::spintype spinType( EvtSpinType::SCALAR );
     double mass( 0. ), width( 0. ), FFp( 0. ), FFr( 0. );
     std::vector<EvtFlatteParam> flatteParams;
     //Nonres parameters
     double alpha( 0. );
     //LASS parameters
     double aLass( 0. ), rLass( 0. ), BLass( 0. ), phiBLass( 0. ), RLass( 0. ),
         phiRLass( 0. ), cutoffLass( -1. );
 
     EvtParserXml parser;
     parser.open( dec_name );
 
     bool endReached = false;
 
     while ( parser.readNextTag() ) {
         //TAGS FOUND UNDER DATA
         if ( parser.getParentTagTitle() == "data" ) {
             if ( parser.getTagTitle() == "dalitzDecay" ) {
                 int nDaughters = 0;
 
                 decayParent = parser.readAttribute( "particle" );
                 daugStr = parser.readAttribute( "daughters" );
                 probMax = parser.readAttributeDouble( "probMax", -1 );
 
                 checkParticle( decayParent );
                 ipar = EvtPDL::getId( decayParent );
 
                 std::istringstream daugStream( daugStr );
 
                 std::string daugh;
                 while ( std::getline( daugStream, daugh, ' ' ) ) {
                     checkParticle( daugh );
                     daughter[nDaughters++] = EvtPDL::getId( daugh );
                 }
 
                 if ( nDaughters != 3 ) {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Expected to find three daughters for dalitzDecay of "
                         << decayParent << " near line "
                         << parser.getLineNumber() << ", "
                         << "found " << nDaughters << endl;
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Will terminate execution!" << endl;
                     ::abort();
                 }
 
                 double m_d1 = EvtPDL::getMass( daughter[0] ),
                        m_d2 = EvtPDL::getMass( daughter[1] ),
                        m_d3 = EvtPDL::getMass( daughter[2] ),
                        M = EvtPDL::getMass( ipar );
 
                 dp = EvtDalitzPlot( m_d1, m_d2, m_d3, M );
 
                 dalitzDecay = new EvtDalitzDecayInfo( daughter[0], daughter[1],
                                                       daughter[2] );
 
             } else if ( parser.getTagTitle() == "copyDalitz" ) {
                 int nDaughters = 0;
                 int nCopyDaughters = 0;
                 EvtId copyDaughter[3];
 
                 decayParent = parser.readAttribute( "particle" );
                 daugStr = parser.readAttribute( "daughters" );
 
                 std::string copyParent = parser.readAttribute( "copy" );
                 std::string copyDaugStr = parser.readAttribute( "copyDaughters" );
 
                 checkParticle( decayParent );
                 ipar = EvtPDL::getId( decayParent );
 
                 checkParticle( copyParent );
                 EvtId copypar = EvtPDL::getId( copyParent );
 
                 std::istringstream daugStream( daugStr );
                 std::istringstream copyDaugStream( copyDaugStr );
 
                 std::string daugh;
                 while ( std::getline( daugStream, daugh, ' ' ) ) {
                     checkParticle( daugh );
                     daughter[nDaughters++] = EvtPDL::getId( daugh );
                 }
                 while ( std::getline( copyDaugStream, daugh, ' ' ) ) {
                     checkParticle( daugh );
                     copyDaughter[nCopyDaughters++] = EvtPDL::getId( daugh );
                 }
 
                 if ( nDaughters != 3 || nCopyDaughters != 3 ) {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Expected to find three daughters for copyDecay of "
                         << decayParent << " from " << copyParent
                         << " near line " << parser.getLineNumber() << ", "
                         << "found " << nDaughters << " and " << nCopyDaughters
                         << endl;
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Will terminate execution!" << endl;
                     ::abort();
                 }
 
                 copyDecay( ipar, daughter, copypar, copyDaughter );
 
             } else if ( parser.getTagTitle() == "/data" ) {    //end of data
                 endReached = true;
                 parser.close();
                 break;
             }
             //TAGS FOUND UNDER DALITZDECAY
         } else if ( parser.getParentTagTitle() == "dalitzDecay" ) {
             if ( parser.getTagTitle() == "resonance" ) {
                 flatteParams.clear();
 
                 //Amplitude
                 EvtComplex ampFactor(
                     parser.readAttributeDouble( "ampFactorReal", 1. ),
                     parser.readAttributeDouble( "ampFactorImag", 0. ) );
                 double mag = parser.readAttributeDouble( "mag", -999. );
                 double phase = parser.readAttributeDouble( "phase", -999. );
                 double real = parser.readAttributeDouble( "real", -999. );
                 double imag = parser.readAttributeDouble( "imag", -999. );
 
                 if ( ( real != -999. || imag != -999. ) && mag == -999. &&
                      phase == -999. ) {
                     if ( real == -999. ) {
                         real = 0;
                     }
                     if ( imag == -999. ) {
                         imag = 0;
                     }
                     mag = sqrt( real * real + imag * imag );
                     phase = atan2( imag, real ) * EvtConst::radToDegrees;
                 }
                 if ( mag == -999. ) {
                     mag = 1.;
                 }
                 if ( phase == -999. ) {
                     phase = 0.;
                 }
 
                 cAmp = ampFactor *
                        EvtComplex( cos( phase * 1.0 / EvtConst::radToDegrees ),
                                    sin( phase * 1.0 / EvtConst::radToDegrees ) ) *
                        mag;
 
                 //Resonance particle properties
                 mass = 0.;
                 width = 0.;
                 spinType = EvtSpinType::SCALAR;
 
                 std::string particle = parser.readAttribute( "particle" );
                 if ( particle != "" ) {
                     EvtId resId = EvtPDL::getId( particle );
                     if ( resId == EvtId( -1, -1 ) ) {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Unknown particle name:" << particle.c_str()
                             << endl;
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Will terminate execution!" << endl;
                         ::abort();
                     } else {
                         mass = EvtPDL::getMeanMass( resId );
                         width = EvtPDL::getWidth( resId );
                         spinType = EvtPDL::getSpinType( resId );
                     }
                 }
 
                 width = parser.readAttributeDouble( "width", width );
                 mass = parser.readAttributeDouble( "mass", mass );
                 switch ( parser.readAttributeInt( "spin", -1 ) ) {
                     case -1:    //not set here
                         break;
                     case 0:
                         spinType = EvtSpinType::SCALAR;
                         break;
                     case 1:
                         spinType = EvtSpinType::VECTOR;
                         break;
                     case 2:
                         spinType = EvtSpinType::TENSOR;
                         break;
                     default:
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Unsupported spin near line "
                             << parser.getLineNumber() << " of XML file." << endl;
                         ::abort();
                 }
 
                 //Shape and form factors
                 shape = parser.readAttribute( "shape" );
                 FFp = parser.readAttributeDouble( "BlattWeisskopfFactorParent",
                                                   0.0 );
                 FFr = parser.readAttributeDouble( "BlattWeisskopfFactorResonance",
                                                   1.5 );
 
                 //Shape specific attributes
                 if ( shape == "NonRes_Exp" ) {
                     alpha = parser.readAttributeDouble( "alpha", 0.0 );
                 }
                 if ( shape == "LASS" ) {
                     aLass = parser.readAttributeDouble( "a", 2.07 );
                     rLass = parser.readAttributeDouble( "r", 3.32 );
                     BLass = parser.readAttributeDouble( "B", 1.0 );
                     phiBLass = parser.readAttributeDouble( "phiB", 0.0 );
                     RLass = parser.readAttributeDouble( "R", 1.0 );
                     phiRLass = parser.readAttributeDouble( "phiR", 0.0 );
                     cutoffLass = parser.readAttributeDouble( "cutoff", -1.0 );
                 }
 
                 //Daughter pairs for resonance
                 angAndResPairs.clear();
 
                 std::string resDaugStr = parser.readAttribute( "resDaughters" );
                 if ( resDaugStr != "" ) {
                     std::istringstream resDaugStream( resDaugStr );
                     std::string resDaug;
                     int nResDaug( 0 );
                     EvtId resDaughter[2];
                     while ( std::getline( resDaugStream, resDaug, ' ' ) ) {
                         checkParticle( resDaug );
                         resDaughter[nResDaug++] = EvtPDL::getId( resDaug );
                     }
                     if ( nResDaug != 2 ) {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Resonance must have exactly 2 daughters near line "
                             << parser.getLineNumber() << " of XML file." << endl;
                         ::abort();
                     }
                     int nRes = getDaughterPairs( resDaughter, daughter,
                                                  angAndResPairs );
                     if ( nRes == 0 ) {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Resonance daughters must match decay daughters near line "
                             << parser.getLineNumber() << " of XML file." << endl;
                         ::abort();
                     }
                     if ( parser.readAttributeBool( "normalise", true ) )
                         cAmp /= sqrt( nRes );
                 }
                 if ( angAndResPairs.empty() ) {
                     switch ( parser.readAttributeInt( "daughterPair" ) ) {
                         case 1:
                             angAndResPairs.push_back(
                                 std::make_pair( EvtCyclic3::BC, EvtCyclic3::AB ) );
                             break;
                         case 2:
                             angAndResPairs.push_back(
                                 std::make_pair( EvtCyclic3::CA, EvtCyclic3::BC ) );
                             break;
                         case 3:
                             angAndResPairs.push_back(
                                 std::make_pair( EvtCyclic3::AB, EvtCyclic3::CA ) );
                             break;
                         default:
                             if ( shape ==
                                  "NonRes" ) {    //We don't expect a pair for non-resonant terms but add dummy values for convenience
                                 angAndResPairs.push_back( std::make_pair(
                                     EvtCyclic3::AB, EvtCyclic3::AB ) );
                                 break;
                             }
                             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                                 << "Daughter pair must be 1, 2 or 3 near line "
                                 << parser.getLineNumber() << " of XML file."
                                 << endl;
                             ::abort();
                     }
                 }
 
                 if ( parser.isTagInline() ) {
                     std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>::iterator
                         it = angAndResPairs.begin();
                     for ( ; it != angAndResPairs.end(); it++ ) {
                         std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair> pairs = *it;
                         EvtDalitzReso resonance = getResonance(
                             shape, dp, pairs.first, pairs.second, spinType,
                             mass, width, FFp, FFr, alpha, aLass, rLass, BLass,
                             phiBLass, RLass, phiRLass, cutoffLass );
                         dalitzDecay->addResonance( cAmp, resonance );
                     }
                 }
             } else if ( parser.getTagTitle() == "/dalitzDecay" ) {
                 if ( probMax < 0 ) {
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << "probMax is not defined for " << decayParent
                         << " -> " << daugStr << endl;
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << "Will now estimate probMax. This may take a while. Once probMax is calculated, update the XML file to skip this step in future."
                         << endl;
                     probMax = calcProbMax( dp, dalitzDecay );
                 }
                 dalitzDecay->setProbMax( probMax );
                 addDecay( ipar, *dalitzDecay );
                 delete dalitzDecay;
                 dalitzDecay = nullptr;
             } else if ( verbose ) {
                 EvtGenReport( EVTGEN_INFO, "EvtGen" )
                     << "Unexpected tag " << parser.getTagTitle()
                     << " found in XML decay file near line "
                     << parser.getLineNumber() << ". Tag will be ignored."
                     << endl;
             }
             //TAGS FOUND UNDER RESONANCE
         } else if ( parser.getParentTagTitle() == "resonance" ) {
             if ( parser.getTagTitle() == "flatteParam" ) {
                 EvtFlatteParam param( parser.readAttributeDouble( "mass1" ),
                                       parser.readAttributeDouble( "mass2" ),
                                       parser.readAttributeDouble( "g" ) );
                 flatteParams.push_back( param );
             } else if ( parser.getTagTitle() == "/resonance" ) {
                 std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>::iterator
                     it = angAndResPairs.begin();
                 for ( ; it != angAndResPairs.end(); it++ ) {
                     std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair> pairs = *it;
                     EvtDalitzReso resonance = getResonance(
                         shape, dp, pairs.first, pairs.second, spinType, mass,
                         width, FFp, FFr, alpha, aLass, rLass, BLass, phiBLass,
                         RLass, phiRLass, cutoffLass );
 
                     std::vector<EvtFlatteParam>::iterator flatteIt =
                         flatteParams.begin();
                     for ( ; flatteIt != flatteParams.end(); flatteIt++ ) {
                         resonance.addFlatteParam( ( *flatteIt ) );
                     }
 
                     dalitzDecay->addResonance( cAmp, resonance );
                 }
             }
         }
     }
 
     if ( !endReached ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Either the decay file ended prematurely or the file is badly formed.\n"
             << "Error occured near line" << parser.getLineNumber() << endl;
         ::abort();
     }
 }
 
-void EvtDalitzTable::checkParticle( std::string particle )
+void EvtDalitzTable::checkParticle( std::string particle ) const
 {
     if ( EvtPDL::getId( particle ) == EvtId( -1, -1 ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Unknown particle name:" << particle.c_str() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 void EvtDalitzTable::addDecay( EvtId parent, const EvtDalitzDecayInfo& dec )
 {
     if ( m_dalitztable.find( parent ) != m_dalitztable.end() ) {
         m_dalitztable[parent].push_back( dec );
     } else {
         m_dalitztable[parent].push_back( dec );
     }
 }
 
 void EvtDalitzTable::copyDecay( EvtId parent, EvtId* daughters, EvtId copy,
                                 EvtId* copyd )
 {
     EvtDalitzDecayInfo decay( daughters[0], daughters[1], daughters[2] );
     std::vector<EvtDalitzDecayInfo> copyTable = getDalitzTable( copy );
     std::vector<EvtDalitzDecayInfo>::iterator i = copyTable.begin();
     for ( ; i != copyTable.end(); i++ ) {
         EvtId daughter1 = ( *i ).daughter1();
         EvtId daughter2 = ( *i ).daughter2();
         EvtId daughter3 = ( *i ).daughter3();
 
         if ( ( copyd[0] == daughter1 && copyd[1] == daughter2 &&
                copyd[2] == daughter3 ) ||
              ( copyd[0] == daughter1 && copyd[1] == daughter3 &&
                copyd[2] == daughter2 ) ||
              ( copyd[0] == daughter2 && copyd[1] == daughter1 &&
                copyd[2] == daughter3 ) ||
              ( copyd[0] == daughter2 && copyd[1] == daughter3 &&
                copyd[2] == daughter1 ) ||
              ( copyd[0] == daughter3 && copyd[1] == daughter1 &&
                copyd[2] == daughter2 ) ||
              ( copyd[0] == daughter3 && copyd[1] == daughter2 &&
                copyd[2] == daughter1 ) ) {
             decay.setProbMax( ( *i ).getProbMax() );
             std::vector<std::pair<EvtComplex, EvtDalitzReso>>::const_iterator j =
                 ( *i ).getResonances().begin();
             for ( ; j != ( *i ).getResonances().end(); j++ ) {
                 decay.addResonance( ( *j ) );
             }
             addDecay( parent, decay );
             return;
         }
     }
     //if we get here then there was no match
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Did not find dalitz decays for particle:" << copy << "\n";
 }
 
 std::vector<EvtDalitzDecayInfo> EvtDalitzTable::getDalitzTable( const EvtId& parent )
 {
     std::vector<EvtDalitzDecayInfo> table;
     if ( m_dalitztable.find( parent ) != m_dalitztable.end() ) {
         table = m_dalitztable[parent];
     }
 
     if ( table.empty() ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Did not find dalitz decays for particle:" << parent << "\n";
     }
 
     return table;
 }
 
 EvtDalitzReso EvtDalitzTable::getResonance(
     std::string shape, EvtDalitzPlot dp, EvtCyclic3::Pair angPair,
     EvtCyclic3::Pair resPair, EvtSpinType::spintype spinType, double mass,
     double width, double FFp, double FFr, double alpha, double aLass,
     double rLass, double BLass, double phiBLass, double RLass, double phiRLass,
     double cutoffLass )
 {
     if ( shape == "RBW" || shape == "RBW_CLEO" ) {
         return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
                               EvtDalitzReso::RBW_CLEO, FFp, FFr );
     } else if ( shape == "RBW_CLEO_ZEMACH" ) {
         return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
                               EvtDalitzReso::RBW_CLEO_ZEMACH, FFp, FFr );
     } else if ( shape == "GS" || shape == "GS_CLEO" ) {
         return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
                               EvtDalitzReso::GS_CLEO, FFp, FFr );
     } else if ( shape == "GS_CLEO_ZEMACH" ) {
         return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
                               EvtDalitzReso::GS_CLEO_ZEMACH, FFp, FFr );
     } else if ( shape == "GAUSS" || shape == "GAUSS_CLEO" ) {
         return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
                               EvtDalitzReso::GAUSS_CLEO, FFp, FFr );
     } else if ( shape == "GAUSS_CLEO_ZEMACH" ) {
         return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
                               EvtDalitzReso::GAUSS_CLEO_ZEMACH, FFp, FFr );
     } else if ( shape == "Flatte" ) {
         return EvtDalitzReso( dp, resPair, mass );
     } else if ( shape == "LASS" ) {
         return EvtDalitzReso( dp, resPair, mass, width, aLass, rLass, BLass,
                               phiBLass, RLass, phiRLass, cutoffLass, true );
     } else if ( shape == "NonRes" ) {
         return EvtDalitzReso();
     } else if ( shape == "NonRes_Linear" ) {
         return EvtDalitzReso( dp, resPair, EvtDalitzReso::NON_RES_LIN );
     } else if ( shape == "NonRes_Exp" ) {
         return EvtDalitzReso( dp, resPair, EvtDalitzReso::NON_RES_EXP, alpha );
     } else {    //NBW
         if ( shape != "NBW" )
             EvtGenReport( EVTGEN_WARNING, "EvtGen" )
                 << "EvtDalitzTable: shape " << shape
                 << " is unknown. Defaulting to NBW." << endl;
         return EvtDalitzReso( dp, angPair, resPair, spinType, mass, width,
                               EvtDalitzReso::NBW, FFp, FFr );
     }
 }
 
 int EvtDalitzTable::getDaughterPairs(
     EvtId* resDaughter, EvtId* daughter,
     std::vector<std::pair<EvtCyclic3::Pair, EvtCyclic3::Pair>>& angAndResPairs )
 {
     int n( 0 );
     if ( resDaughter[0] == daughter[0] && resDaughter[1] == daughter[1] ) {
         angAndResPairs.push_back(
             std::make_pair( EvtCyclic3::BC, EvtCyclic3::AB ) );
         n++;
     } else if ( resDaughter[0] == daughter[1] && resDaughter[1] == daughter[0] ) {
         angAndResPairs.push_back(
             std::make_pair( EvtCyclic3::CA, EvtCyclic3::AB ) );
         n++;
     }
 
     if ( resDaughter[0] == daughter[1] && resDaughter[1] == daughter[2] ) {
         angAndResPairs.push_back(
             std::make_pair( EvtCyclic3::CA, EvtCyclic3::BC ) );
         n++;
     } else if ( resDaughter[0] == daughter[2] && resDaughter[1] == daughter[1] ) {
         angAndResPairs.push_back(
             std::make_pair( EvtCyclic3::AB, EvtCyclic3::BC ) );
         n++;
     }
 
     if ( resDaughter[0] == daughter[2] && resDaughter[1] == daughter[0] ) {
         angAndResPairs.push_back(
             std::make_pair( EvtCyclic3::AB, EvtCyclic3::CA ) );
         n++;
     } else if ( resDaughter[0] == daughter[0] && resDaughter[1] == daughter[2] ) {
         angAndResPairs.push_back(
             std::make_pair( EvtCyclic3::BC, EvtCyclic3::CA ) );
         n++;
     }
 
     return n;
 }
 
 double EvtDalitzTable::calcProbMax( EvtDalitzPlot dp, EvtDalitzDecayInfo* model )
 {
     double factor = 1.2;    //factor to increase our final answer by
     int nStep( 1000 );    //number of steps - total points will be 3*nStep*nStep
 
     double maxProb( 0 );
     double min( 0 ), max( 0 ), step( 0 ), min2( 0 ), max2( 0 ), step2( 0 );
 
     //first do AB, BC
     min = dp.qAbsMin( EvtCyclic3::AB );
     max = dp.qAbsMax( EvtCyclic3::AB );
     step = ( max - min ) / nStep;
     for ( int i = 0; i < nStep; ++i ) {
         double qAB = min + i * step;
         min2 = dp.qMin( EvtCyclic3::BC, EvtCyclic3::AB, qAB );
         max2 = dp.qMax( EvtCyclic3::BC, EvtCyclic3::AB, qAB );
         step2 = ( max2 - min2 ) / nStep;
         for ( int j = 0; j < nStep; ++j ) {
             double qBC = min2 + j * step2;
             EvtDalitzCoord coord( EvtCyclic3::AB, qAB, EvtCyclic3::BC, qBC );
             EvtDalitzPoint point( dp, coord );
             double prob = calcProb( point, model );
             if ( prob > maxProb )
                 maxProb = prob;
         }
     }
 
     //next do BC, CA
     min = dp.qAbsMin( EvtCyclic3::BC );
     max = dp.qAbsMax( EvtCyclic3::BC );
     step = ( max - min ) / nStep;
     for ( int i = 0; i < nStep; ++i ) {
         double qBC = min + i * step;
         min2 = dp.qMin( EvtCyclic3::CA, EvtCyclic3::BC, qBC );
         max2 = dp.qMax( EvtCyclic3::CA, EvtCyclic3::BC, qBC );
         step2 = ( max2 - min2 ) / nStep;
         for ( int j = 0; j < nStep; ++j ) {
             double qCA = min2 + j * step2;
             EvtDalitzCoord coord( EvtCyclic3::BC, qBC, EvtCyclic3::CA, qCA );
             EvtDalitzPoint point( dp, coord );
             double prob = calcProb( point, model );
             if ( prob > maxProb )
                 maxProb = prob;
         }
     }
 
     //finally do CA, AB
     min = dp.qAbsMin( EvtCyclic3::CA );
     max = dp.qAbsMax( EvtCyclic3::CA );
     step = ( max - min ) / nStep;
     for ( int i = 0; i < nStep; ++i ) {
         double qCA = min + i * step;
         min2 = dp.qMin( EvtCyclic3::AB, EvtCyclic3::CA, qCA );
         max2 = dp.qMax( EvtCyclic3::AB, EvtCyclic3::CA, qCA );
         step2 = ( max2 - min2 ) / nStep;
         for ( int j = 0; j < nStep; ++j ) {
             double qAB = min2 + j * step2;
             EvtDalitzCoord coord( EvtCyclic3::CA, qCA, EvtCyclic3::AB, qAB );
             EvtDalitzPoint point( dp, coord );
             double prob = calcProb( point, model );
             if ( prob > maxProb )
                 maxProb = prob;
         }
     }
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "Largest probability found was " << maxProb << endl;
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "Setting probMax to " << factor * maxProb << endl;
     return factor * maxProb;
 }
 
 double EvtDalitzTable::calcProb( EvtDalitzPoint point, EvtDalitzDecayInfo* model )
 {
     std::vector<std::pair<EvtComplex, EvtDalitzReso>> resonances =
         model->getResonances();
 
     EvtComplex amp( 0, 0 );
     std::vector<std::pair<EvtComplex, EvtDalitzReso>>::iterator i =
         resonances.begin();
     for ( ; i != resonances.end(); i++ ) {
         std::pair<EvtComplex, EvtDalitzReso> res = ( *i );
         amp += res.first * res.second.evaluate( point );
     }
     return abs2( amp );
 }
diff --git a/src/EvtGenModels/EvtEtaDalitz.cpp b/src/EvtGenModels/EvtEtaDalitz.cpp
index ea3acaa..7ba64fc 100644
--- a/src/EvtGenModels/EvtEtaDalitz.cpp
+++ b/src/EvtGenModels/EvtEtaDalitz.cpp
@@ -1,82 +1,82 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtEtaDalitz.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtEtaDalitz::getName()
+std::string EvtEtaDalitz::getName() const
 {
     return "ETA_DALITZ";
 }
 
-EvtDecayBase* EvtEtaDalitz::clone()
+EvtDecayBase* EvtEtaDalitz::clone() const
 {
     return new EvtEtaDalitz;
 }
 
 void EvtEtaDalitz::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 }
 
 void EvtEtaDalitz::initProbMax()
 {
     setProbMax( 2.1 );
 }
 
 void EvtEtaDalitz::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtVector4R mompi0 = p->getDaug( 2 )->getP4();
     double masspip = p->getDaug( 0 )->mass();
     double masspim = p->getDaug( 1 )->mass();
     double masspi0 = p->getDaug( 2 )->mass();
     double m_eta = p->mass();
 
     double y;
 
     //The decay amplitude coems from Layter et al PRD 7 2565 (1973).
 
     y = ( mompi0.get( 0 ) - masspi0 ) *
             ( 3.0 / ( m_eta - masspip - masspim - masspi0 ) ) -
         1.0;
 
     EvtComplex amp( sqrt( 1.0 - 1.07 * y ), 0.0 );
 
     vertex( amp );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtEtaLLPiPi.cpp b/src/EvtGenModels/EvtEtaLLPiPi.cpp
index 3a36b17..10a05da 100644
--- a/src/EvtGenModels/EvtEtaLLPiPi.cpp
+++ b/src/EvtGenModels/EvtEtaLLPiPi.cpp
@@ -1,219 +1,219 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtEtaLLPiPi.hh"
 
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <cmath>
 
 // eta' -> mu+ mu- pi+ pi- or e+ e- pi+ pi-
 // From Zhang Zhen-Yu et al, Chinese Phys. C 36, p926, 2012
 
 void EvtEtaLLPiPi::init()
 {
     // Check for 0 or 1 (maxProb) arguments
     checkNArg( 0, 1 );
 
     // Check particle types
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
     checkSpinDaughter( 3, EvtSpinType::SCALAR );
 
     // Mass and width of rho0 from particle properties file
     m_rhoMass = EvtPDL::getMeanMass( EvtPDL::getId( "rho0" ) );
     m_rhoMassSq = m_rhoMass * m_rhoMass;
     m_rhoGamma = EvtPDL::getWidth( EvtPDL::getId( "rho0" ) );
 
     // Mixing parameter squared, using Eq 6
     const double denom = 8.0 * pow( EvtConst::pi * m_fPi, 2 );
     const double factor = m_eSq / ( denom * denom * 3.0 );
     const double fTerm8 = sin( m_thetaMix ) / m_f8;
     const double fTerm0 = 2.0 * sqrt( 2.0 ) * cos( m_thetaMix ) / m_f0;
     m_mixSq = factor * pow( fTerm8 + fTerm0, 2 );
 }
 
 void EvtEtaLLPiPi::initProbMax()
 {
     if ( getNArg() == 1 ) {
         setProbMax( getArg( 0 ) );
 
     } else {
         int lepId = getDaug( 0 ).getId();
         if ( lepId == EvtPDL::getId( "e-" ).getId() ||
              lepId == EvtPDL::getId( "e+" ).getId() ) {
             setProbMax( 27500.0 );
 
         } else if ( lepId == EvtPDL::getId( "mu-" ).getId() ||
                     lepId == EvtPDL::getId( "mu+" ).getId() ) {
             setProbMax( 20.0 );
         }
     }
 }
 
-std::string EvtEtaLLPiPi::getName()
+std::string EvtEtaLLPiPi::getName() const
 {
     return "ETA_LLPIPI";
 }
 
-EvtDecayBase* EvtEtaLLPiPi::clone()
+EvtDecayBase* EvtEtaLLPiPi::clone() const
 {
     return new EvtEtaLLPiPi();
 }
 
 void EvtEtaLLPiPi::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     const double mLep = p->getDaug( 0 )->mass();
     const double mPi = p->getDaug( 2 )->mass();
 
     updateMassPars( mLep, mPi );
 
     const double prob = ampSquared( p );
     setProb( prob );
 }
 
 void EvtEtaLLPiPi::updateMassPars( double mLep, double mPi )
 {
     // Update mass parameters used in various functions
     m_lepMass = mLep;
     m_lepMassSq = mLep * mLep;
     m_4LepMassSq = 4.0 * m_lepMassSq;
 
     m_piMass = mPi;
     m_piMassSq = mPi * mPi;
     m_4PiMassSq = 4.0 * m_piMassSq;
 }
 
 double EvtEtaLLPiPi::rhoWidth( double s, double m ) const
 {
     // Define width of rho using modified vector meson dynamics, Eq 8
     double gamma( 0.0 );
 
     if ( s >= m_4PiMassSq ) {
         const double mSq = m * m;
         const double num = 1.0 - ( 4.0 * mSq / s );
         const double denom = 1.0 - ( 4.0 * mSq / m_rhoMassSq );
         const double ratio = denom > 0.0 ? num / denom : 0.0;
         gamma = m_rhoGamma * ( s / m_rhoMassSq ) * pow( ratio, 1.5 );
     }
 
     return gamma;
 }
 
 double EvtEtaLLPiPi::F0( double sLL, double sPiPi ) const
 {
     // Equation 7
     double ampSq( 0.0 );
 
     const double rhoWidthL = rhoWidth( sLL, m_lepMass );
     const double rhoWidthPi = rhoWidth( sPiPi, m_piMass );
 
     const double mSqDiffL = m_rhoMassSq - sLL;
     const double mRhoWidthL = m_rhoMass * rhoWidthL;
 
     const double mSqDiffPi = m_rhoMassSq - sPiPi;
     const double mRhoWidthPi = m_rhoMass * rhoWidthPi;
 
     const double denomLL = mSqDiffL * mSqDiffL + mRhoWidthL * mRhoWidthL;
     const double denomPiPi = mSqDiffPi * mSqDiffPi + mRhoWidthPi * mRhoWidthPi;
 
     if ( denomLL > 0.0 && denomPiPi > 0.0 ) {
         const double mRho4 = m_rhoMassSq * m_rhoMassSq;
         const double denomProd = denomLL * denomPiPi;
 
         double realAmp = m_par1 + m_parLL * ( m_rhoMassSq * mSqDiffL / denomLL );
         realAmp += m_parPiPi * mRho4 *
                    ( ( mSqDiffPi * mSqDiffL ) - mRhoWidthL * mRhoWidthPi ) /
                    denomProd;
 
         double imagAmp = m_parLL * ( m_rhoMassSq * mRhoWidthL / denomLL );
         imagAmp += m_parPiPi * mRho4 *
                    ( mRhoWidthPi * mSqDiffL + mRhoWidthL * mSqDiffPi ) /
                    denomProd;
 
         ampSq = realAmp * realAmp + imagAmp * imagAmp;
     }
 
     return ampSq;
 }
 
 double EvtEtaLLPiPi::lambda( double a, double b, double c ) const
 {
     const double sumSq = a * a + b * b + c * c;
     const double prod = a * b + b * c + c * a;
     const double L = sumSq - 2.0 * prod;
     return L;
 }
 
 double EvtEtaLLPiPi::ampSquared( EvtParticle* p ) const
 {
     // Equation 3
     const double zeroProb( 0.0 );
 
     // Mass of eta' meson
     const double mEta = p->mass();
 
     const EvtVector4R pL1 = p->getDaug( 0 )->getP4();
     const EvtVector4R pL2 = p->getDaug( 1 )->getP4();
     const EvtVector4R pPi1 = p->getDaug( 2 )->getP4();
     const EvtVector4R pPi2 = p->getDaug( 3 )->getP4();
 
     const EvtVector4R pLL = pL1 + pL2;
     const double sLL = pLL.mass2();
     const EvtVector4R pPiPi = pPi1 + pPi2;
     const double sPiPi = pPiPi.mass2();
 
     if ( sLL < 1e-4 || sPiPi < m_4PiMassSq || sLL < m_4LepMassSq ) {
         // To avoid negative square roots etc
         return zeroProb;
     }
 
     // Angles theta_p, theta_k and phi defined in Fig 1
     const EvtVector4R pSum = pLL + pPiPi;
     // Helicity angle of first lepton
     const double cosThp = -EvtDecayAngle( pSum, pLL, pL1 );
     const double sinThp = sqrt( 1.0 - cosThp * cosThp );
     // Helicity angle of first pion
     const double cosThk = -EvtDecayAngle( pSum, pPiPi, pPi2 );
     const double sinThk = sqrt( 1.0 - cosThk * cosThk );
     // Angle between the dilepton and dipion decay planes
     const double phi = EvtDecayAngleChi( pSum, pL1, pL2, pPi1, pPi2 );
     const double sinPhi = sin( phi );
 
     const double betaLL = sqrt( 1.0 - ( m_4LepMassSq / sLL ) );
     const double betaPiPi = sqrt( 1.0 - ( m_4PiMassSq / sPiPi ) );
 
     const double betaProd = ( 1.0 - pow( betaLL * sinThp * sinPhi, 2 ) ) *
                             sPiPi * pow( betaPiPi * sinThk, 2 );
     const double L = lambda( mEta * mEta, sLL, sPiPi );
     const double ampSq = m_eSq * F0( sLL, sPiPi ) * m_mixSq * L * betaProd /
                          ( 8.0 * sLL );
 
     return ampSq;
 }
diff --git a/src/EvtGenModels/EvtFourBodyPhsp.cpp b/src/EvtGenModels/EvtFourBodyPhsp.cpp
index d2d6463..010421e 100644
--- a/src/EvtGenModels/EvtFourBodyPhsp.cpp
+++ b/src/EvtGenModels/EvtFourBodyPhsp.cpp
@@ -1,446 +1,446 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtFourBodyPhsp.hh"
 
 #include "EvtGenBase/EvtKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <cmath>
 
-std::string EvtFourBodyPhsp::getName()
+std::string EvtFourBodyPhsp::getName() const
 {
     return "FOURBODYPHSP";
 }
 
-EvtDecayBase* EvtFourBodyPhsp::clone()
+EvtDecayBase* EvtFourBodyPhsp::clone() const
 {
     return new EvtFourBodyPhsp;
 }
 
 std::array<double, 4> EvtFourBodyPhsp::phspFactor(
     const double mM, const double m12, const double m34,
     std::array<double, 4>& daughters ) const
 {
     std::array<double, 4> result;
     result[1] = twoBodyMomentum( mM, m12, m34 );
     result[2] = twoBodyMomentum( m12, daughters[0], daughters[1] );
     result[3] = twoBodyMomentum( m34, daughters[2], daughters[3] );
     result[0] = result[1] * result[2] * result[3];
 
     return result;
 }
 
 void EvtFourBodyPhsp::init()
 {
     // Check that we have right number of daughters
     checkNDaug( 4 );
 
     // Check whether mother is quasi-stable
     auto parent = getParentId();
     double width = EvtPDL::getWidth( parent );
     if ( width > 1e-6 ) {
         m_stableMother = false;
     }
 
     // Check whether all daughters are stable
     for ( int i = 0; i < 4; ++i ) {
         auto daughter = getDaug( i );
         width = EvtPDL::getWidth( daughter );
         if ( width > 1e-6 ) {
             m_stableDaughters = false;
             m_daughterMasses[i] = EvtPDL::getMinMass( daughter );
         } else {
             m_daughterMasses[i] = EvtPDL::getMass( daughter );
         }
     }
 
     // check correct number of arguments
     checkNArg( 0, 2, 4 );
     double mass1 = m_daughterMasses[0];
     double mass2 = m_daughterMasses[1];
     double mass3 = m_daughterMasses[2];
     double mass4 = m_daughterMasses[3];
     double mMother = EvtPDL::getMaxMass( parent );
     if ( getNArg() > 2 ) {
         m_m12Min = getArg( 0 );
         m_m12Max = getArg( 1 );
         m_m34Min = getArg( 2 );
         m_m34Max = getArg( 3 );
     } else {
         if ( getNArg() > 0 ) {
             m_m12Min = getArg( 0 );
             m_m12Max = getArg( 1 );
         } else {
             m_m12Min = mass1 + mass2;
             m_m12Max = mMother - mass3 - mass4;
         }
         m_m34Min = mass3 + mass4;
         m_m34Max = mMother - mass1 - mass2;
         if ( m_stableDaughters == false || m_stableMother == false ) {
             m_fixedBoundary = false;
         }
     }
     // Make sure that we have correct boundaries
     if ( m_m12Min < mass1 + mass2 ) {
         m_m12Min = mass1 + mass2;
     }
     if ( m_m12Max > mMother - mass3 - mass4 ) {
         m_m12Max = mMother - mass3 - mass4;
     }
     if ( m_m34Min < mass3 + mass4 ) {
         m_m34Min = mass3 + mass4;
     }
     if ( m_m34Max > mMother - mass1 - mass2 ) {
         m_m34Max = mMother - mass1 - mass2;
     }
 
     if ( m_stableDaughters && m_stableMother ) {
         m_boundaryShape = determineBoundaryShape( m_m12Min, m_m12Max, m_m34Max,
                                                   mMother );
     } else {
         m_boundaryShape = Shape::variable;
     }
     // If we have fixed boundary, we can precalculate some variables for
     // m12 and m34 generation
     if ( m_fixedBoundary ) {
         if ( m_boundaryShape == Shape::trapezoid ) {
             const double m12Diff = m_m12Max - m_m12Min;
             const double minSum = m_m12Min + m_m34Min;
             m_trapNorm = ( mMother - m_m34Min ) * m12Diff -
                          0.5 * ( m12Diff * ( m_m12Max + m_m12Min ) );
             m_trapCoeff1 = mMother - m_m34Min;
             m_trapCoeff2 = mMother * mMother - 2 * mMother * minSum +
                            minSum * minSum;
         }
         if ( m_boundaryShape == Shape::pentagon ) {
             m_pentagonSplit = mMother - m_m34Max;
             const double area1 = ( m_pentagonSplit - m_m12Min ) *
                                  ( m_m34Max - m_m34Min );
             const double pm12Diff = m_m12Max - m_pentagonSplit;
             const double area2 = 0.5 * pm12Diff *
                                      ( mMother + m_m34Max - m_m12Max ) -
                                  pm12Diff * m_m34Min;
             m_pentagonFraction = area1 / ( area1 + area2 );
             const double m12Diff = m_m12Max - m_pentagonSplit;
             const double minSum = m_pentagonSplit + m_m34Min;
             m_trapNorm = ( mMother - m_m34Min ) * m12Diff -
                          0.5 * ( m12Diff * ( m_m12Max + m_pentagonSplit ) );
             m_trapCoeff1 = mMother - m_m34Min;
             m_trapCoeff2 = mMother * mMother - 2 * mMother * minSum +
                            minSum * minSum;
         }
     }
 }
 
 void EvtFourBodyPhsp::initProbMax()
 {
     double startM12 = m_m12Min + ( m_m12Max - m_m12Min ) / 20.;
     double startM34 = m_m34Min + ( m_m34Max - m_m34Min ) / 20.;
     bool contCond = true;
     int iteration = 0;
 
     auto parent = getParentId();
     double mMother = EvtPDL::getMaxMass( parent );
 
     double funcValue = 0;
     while ( contCond ) {
         ++iteration;
         double currentM12 = startM12;
         double currentM34 = startM34;
         funcValue = phspFactor( mMother, currentM12, currentM34,
                                 m_daughterMasses )[0];
         // Maximum along m12
         double step = ( m_m12Max - m_m12Min ) / 100.;
         while ( step > 1e-4 ) {
             double point1 = currentM12 + step;
             if ( point1 > m_m12Max ) {
                 point1 = m_m12Max;
             }
             if ( currentM34 > mMother - point1 ) {
                 point1 = mMother - currentM34;
             }
             double point2 = currentM12 - step;
             if ( point2 < m_m12Min ) {
                 point2 = m_m12Min;
             }
             double value1 = phspFactor( mMother, point1, currentM34,
                                         m_daughterMasses )[0];
             double value2 = phspFactor( mMother, point2, currentM34,
                                         m_daughterMasses )[0];
             if ( value1 > funcValue && value1 > value2 ) {
                 currentM12 = point1;
                 funcValue = value1;
             } else if ( value2 > funcValue ) {
                 currentM12 = point2;
                 funcValue = value2;
             }
             step /= 2.;
         }
         // Maximum along m34
         step = ( mMother - currentM12 - m_m34Min ) / 100.;
         while ( step > 1e-4 ) {
             double point1 = currentM34 + step;
             if ( point1 > m_m34Max ) {
                 point1 = m_m34Max;
             }
             if ( point1 > mMother - currentM12 ) {
                 point1 = mMother - currentM12;
             }
             double point2 = currentM34 - step;
             if ( point2 < m_m34Min ) {
                 point2 = m_m34Min;
             }
             double value1 = phspFactor( mMother, currentM12, point1,
                                         m_daughterMasses )[0];
             double value2 = phspFactor( mMother, currentM12, point2,
                                         m_daughterMasses )[0];
             if ( value1 > funcValue && value1 > value2 ) {
                 currentM34 = point1;
                 funcValue = value1;
             } else if ( value2 > funcValue ) {
                 currentM34 = point2;
                 funcValue = value2;
             }
             step /= 2.;
         }
 
         // Check termination condition
         double m12Diff = currentM12 - startM12;
         double m34Diff = currentM34 - startM34;
         double distSq = m12Diff * m12Diff + m34Diff * m34Diff;
         if ( distSq < 1e-8 || iteration > 50 ) {
             contCond = false;
         }
         startM12 = currentM12;
         startM34 = currentM34;
     }
 
     setProbMax( funcValue * 1.05 );
 }
 
 void EvtFourBodyPhsp::decay( EvtParticle* parent )
 {
     parent->makeDaughters( getNDaug(), getDaugs() );
     bool massTreeStatus = parent->generateMassTree();
     if ( !massTreeStatus ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Failed to generate daughters masses in EvtFourBodyPhsp."
             << std::endl;
         ::abort();
     }
 
     double mMother = parent->mass();
 
     // Need to check whether boundaries are OK and whether we need to work
     // out boundary shape
     double cM12Min, cM12Max;
     double cM34Min, cM34Max;
     EvtFourBodyPhsp::Shape cShape;
     if ( m_fixedBoundary ) {
         cM12Min = m_m12Min;
         cM12Max = m_m12Max;
         cM34Min = m_m34Min;
         cM34Max = m_m34Max;
         cShape = m_boundaryShape;
     } else {
         // In this case at least one particle has non-zero width and thus
         // boundaries and shape of the region can change
         for ( int i = 0; i < 4; ++i ) {
             auto daughter = parent->getDaug( i );
             m_daughterMasses[i] = daughter->mass();
         }
         cM12Min = m_m12Min > ( m_daughterMasses[0] + m_daughterMasses[1] )
                       ? m_m12Min
                       : m_daughterMasses[0] + m_daughterMasses[1];
         cM12Max = m_m12Max <
                           ( mMother - m_daughterMasses[2] - m_daughterMasses[3] )
                       ? m_m12Max
                       : mMother - m_daughterMasses[2] - m_daughterMasses[3];
         cM34Min = m_m34Min > ( m_daughterMasses[2] + m_daughterMasses[3] )
                       ? m_m34Min
                       : m_daughterMasses[2] + m_daughterMasses[3];
         cM34Max = m_m34Max <
                           ( mMother - m_daughterMasses[0] - m_daughterMasses[1] )
                       ? m_m34Max
                       : mMother - m_daughterMasses[0] - m_daughterMasses[1];
         cShape = determineBoundaryShape( cM12Min, cM12Max, cM34Max, mMother );
     }
 
     // Generate m12 and m34
     auto masses = generatePairMasses( cM12Min, cM12Max, cM34Min, cM34Max,
                                       mMother, cShape );
     const double m12 = masses.first;
     const double m34 = masses.second;
 
     // calculate probability, it will return array with 4 elements with
     // probability, q, p1 and p3
     auto probEval = phspFactor( mMother, m12, m34, m_daughterMasses );
     setProb( probEval[0] );
 
     // initialise kinematics
     const double cosTheta1 = EvtRandom::Flat( -1.0, 1.0 );
     const double sinTheta1 = std::sqrt( 1 - cosTheta1 * cosTheta1 );
     const double cosTheta3 = EvtRandom::Flat( -1.0, 1.0 );
     const double sinTheta3 = std::sqrt( 1 - cosTheta3 * cosTheta3 );
     const double phi = EvtRandom::Flat( 0., EvtConst::twoPi );
     // m12 and m34 are put along z-axis, 1 and 2 go to x-z plane and 3-4
     // plane is rotated by phi compared to 1-2 plane. All momenta are set
     // in 12 and 34 rest frames and then boosted to parent rest frame
     const double p1x = probEval[2] * sinTheta1;
     const double p1z = probEval[2] * cosTheta1;
     const double p1Sq = probEval[2] * probEval[2];
     const double en1 = std::sqrt( m_daughterMasses[0] * m_daughterMasses[0] +
                                   p1Sq );
     const double en2 = std::sqrt( m_daughterMasses[1] * m_daughterMasses[1] +
                                   p1Sq );
     const double p3T = probEval[3] * sinTheta3;
     const double p3x = p3T * std::cos( phi );
     const double p3y = p3T * std::sin( phi );
     const double p3z = probEval[3] * cosTheta3;
     const double p3Sq = probEval[3] * probEval[3];
     const double en3 = std::sqrt( m_daughterMasses[2] * m_daughterMasses[2] +
                                   p3Sq );
     const double en4 = std::sqrt( m_daughterMasses[3] * m_daughterMasses[3] +
                                   p3Sq );
 
     EvtVector4R mom1( en1, p1x, 0.0, p1z );
     EvtVector4R mom2( en2, -p1x, 0.0, -p1z );
     EvtVector4R mom3( en3, p3x, p3y, p3z );
     EvtVector4R mom4( en4, -p3x, -p3y, -p3z );
 
     const double qSq = probEval[1] * probEval[1];
     const double en12 = std::sqrt( m12 * m12 + qSq );
     const double en34 = std::sqrt( m34 * m34 + qSq );
     EvtVector4R q12( en12, 0.0, 0.0, probEval[1] );
     EvtVector4R q34( en34, 0.0, 0.0, -probEval[1] );
     mom1.applyBoostTo( q12 );
     mom2.applyBoostTo( q12 );
     mom3.applyBoostTo( q34 );
     mom4.applyBoostTo( q34 );
 
     // As final step, rotate everything randomly in space
     const double euler1 = EvtRandom::Flat( 0., EvtConst::twoPi );
     const double euler2 = std::acos( EvtRandom::Flat( -1.0, 1.0 ) );
     const double euler3 = EvtRandom::Flat( 0., EvtConst::twoPi );
     mom1.applyRotateEuler( euler1, euler2, euler3 );
     mom2.applyRotateEuler( euler1, euler2, euler3 );
     mom3.applyRotateEuler( euler1, euler2, euler3 );
     mom4.applyRotateEuler( euler1, euler2, euler3 );
 
     // Set momenta for daughters
     auto daug = parent->getDaug( 0 );
     daug->init( daug->getId(), mom1 );
     daug = parent->getDaug( 1 );
     daug->init( daug->getId(), mom2 );
     daug = parent->getDaug( 2 );
     daug->init( daug->getId(), mom3 );
     daug = parent->getDaug( 3 );
     daug->init( daug->getId(), mom4 );
 }
 
 EvtFourBodyPhsp::Shape EvtFourBodyPhsp::determineBoundaryShape(
     const double m12Min, const double m12Max, const double m34Max,
     const double mMother ) const
 {
     double maxY = mMother - m12Min;
     const bool corner1 = m34Max < maxY;
     maxY = mMother - m12Max;
     const bool corner2 = m34Max < maxY;
 
     if ( corner1 && corner2 ) {
         return Shape::rectangle;
     } else if ( !corner1 && !corner2 ) {
         return Shape::trapezoid;
     }
     return Shape::pentagon;
 }
 
 std::pair<double, double> EvtFourBodyPhsp::generatePairMasses(
     const double m12Min, const double m12Max, const double m34Min,
     const double m34Max, const double mMother,
     const EvtFourBodyPhsp::Shape shape ) const
 {
     switch ( shape ) {
         case EvtFourBodyPhsp::Shape::rectangle:
             return generateRectangle( m12Min, m12Max, m34Min, m34Max );
             break;
         case EvtFourBodyPhsp::Shape::trapezoid:
             return generateTrapezoid( m12Min, m12Max, m34Min, mMother );
             break;
         case EvtFourBodyPhsp::Shape::pentagon:
             double split, fraction;
             if ( m_fixedBoundary ) {
                 split = m_pentagonSplit;
                 fraction = m_pentagonFraction;
             } else {
                 split = mMother - m34Max;
                 const double area1 = ( split - m12Min ) * ( m34Max - m34Min );
                 const double pm12Diff = m12Max - split;
                 const double area2 = 0.5 * pm12Diff *
                                          ( mMother + m34Max - m12Max ) -
                                      pm12Diff * m34Min;
                 fraction = area1 / ( area1 + area2 );
             }
             if ( EvtRandom::Flat() < fraction ) {
                 return generateRectangle( m12Min, split, m34Min, m34Max );
             } else {
                 return generateTrapezoid( split, m12Max, m34Min, mMother );
             }
             break;
         default:
             return std::make_pair( m12Min, m34Min );
             break;
     }
 }
 
 std::pair<double, double> EvtFourBodyPhsp::generateRectangle(
     const double m12Min, const double m12Max, const double m34Min,
     const double m34Max ) const
 {
     return std::make_pair( EvtRandom::Flat( m12Min, m12Max ),
                            EvtRandom::Flat( m34Min, m34Max ) );
 }
 
 std::pair<double, double> EvtFourBodyPhsp::generateTrapezoid(
     const double m12Min, const double m12Max, const double m34Min,
     const double mMother ) const
 {
     double norm, coeff1, coeff2;
     if ( m_fixedBoundary ) {
         norm = m_trapNorm;
         coeff1 = m_trapCoeff1;
         coeff2 = m_trapCoeff2;
     } else {
         const double m12Diff = m12Max - m12Min;
         const double minSum = m12Min + m34Min;
         norm = ( mMother - m34Min ) * m12Diff -
                0.5 * ( m12Diff * ( m12Max + m12Min ) );
         coeff1 = mMother - m34Min;
         coeff2 = mMother * mMother - 2 * mMother * minSum + minSum * minSum;
     }
     const double rnd = EvtRandom::Flat();
     const double m12 = coeff1 - std::sqrt( -2.0 * rnd * norm + coeff2 );
     const double m34 = EvtRandom::Flat( m34Min, mMother - m12 );
     return std::make_pair( m12, m34 );
 }
diff --git a/src/EvtGenModels/EvtGenericDalitz.cpp b/src/EvtGenModels/EvtGenericDalitz.cpp
index cf16d1b..8ea73b9 100644
--- a/src/EvtGenModels/EvtGenericDalitz.cpp
+++ b/src/EvtGenModels/EvtGenericDalitz.cpp
@@ -1,129 +1,129 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtGenericDalitz.hh"
 
 #include "EvtGenBase/EvtDalitzPoint.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 
 #include "EvtGenModels/EvtDalitzTable.hh"
 
-std::string EvtGenericDalitz::getName()
+std::string EvtGenericDalitz::getName() const
 {
     return "GENERIC_DALITZ";
 }
 
-EvtDecayBase* EvtGenericDalitz::clone()
+EvtDecayBase* EvtGenericDalitz::clone() const
 {
     return new EvtGenericDalitz();
 }
 
 void EvtGenericDalitz::init()
 {
     checkNArg( 1 );
 
     EvtId parnum = getParentId();
     EvtId d1 = getDaug( 0 );
     EvtId d2 = getDaug( 1 );
     EvtId d3 = getDaug( 2 );
 
     std::vector<EvtDalitzDecayInfo> decays =
         EvtDalitzTable::getInstance( getArgStr( 0 ) )->getDalitzTable( parnum );
 
     std::vector<EvtDalitzDecayInfo>::iterator i = decays.begin();
     for ( ; i != decays.end(); i++ ) {
         EvtId daughter1 = ( *i ).daughter1();
         EvtId daughter2 = ( *i ).daughter2();
         EvtId daughter3 = ( *i ).daughter3();
 
         if ( d1 == daughter1 && d2 == daughter2 && d3 == daughter3 ) {
             m_d1 = 0;
             m_d2 = 1;
             m_d3 = 2;
         } else if ( d1 == daughter1 && d2 == daughter3 && d3 == daughter2 ) {
             m_d1 = 0;
             m_d2 = 2;
             m_d3 = 1;
         } else if ( d1 == daughter2 && d2 == daughter1 && d3 == daughter3 ) {
             m_d1 = 1;
             m_d2 = 0;
             m_d3 = 2;
         } else if ( d1 == daughter2 && d2 == daughter3 && d3 == daughter1 ) {
             m_d1 = 1;
             m_d2 = 2;
             m_d3 = 0;
         } else if ( d1 == daughter3 && d2 == daughter1 && d3 == daughter2 ) {
             m_d1 = 2;
             m_d2 = 0;
             m_d3 = 1;
         } else if ( d1 == daughter3 && d2 == daughter2 && d3 == daughter1 ) {
             m_d1 = 2;
             m_d2 = 1;
             m_d3 = 0;
         } else {
             continue;
         }
 
         m_resonances = ( *i ).getResonances();
         setProbMax( ( *i ).getProbMax() );
         return;
     }
 }
 
 void EvtGenericDalitz::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtVector4R p4_d1 = p->getDaug( m_d1 )->getP4();
     EvtVector4R p4_d2 = p->getDaug( m_d2 )->getP4();
     EvtVector4R p4_d3 = p->getDaug( m_d3 )->getP4();
 
     double mA = p->getDaug( m_d1 )->mass();
     double mB = p->getDaug( m_d2 )->mass();
     double mC = p->getDaug( m_d3 )->mass();
 
     double m2AB = ( p4_d1 + p4_d2 ).mass2();
     double m2CA = ( p4_d1 + p4_d3 ).mass2();
     double m2BC = ( p4_d2 + p4_d3 ).mass2();
 
     EvtDalitzPoint point( mA, mB, mC, m2AB, m2BC, m2CA );
 
     EvtComplex amp( 0, 0 );
     std::vector<std::pair<EvtComplex, EvtDalitzReso>>::iterator i =
         m_resonances.begin();
     for ( ; i != m_resonances.end(); i++ ) {
         std::pair<EvtComplex, EvtDalitzReso> res = ( *i );
         amp += res.first * res.second.evaluate( point );
     }
 
     vertex( amp );
     return;
 }
 
 std::string EvtGenericDalitz::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "xmlFile";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtGoityRoberts.cpp b/src/EvtGenModels/EvtGoityRoberts.cpp
index f100c78..28c07e0 100644
--- a/src/EvtGenModels/EvtGoityRoberts.cpp
+++ b/src/EvtGenModels/EvtGoityRoberts.cpp
@@ -1,486 +1,486 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtGoityRoberts.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtGoityRoberts::getName()
+std::string EvtGoityRoberts::getName() const
 {
     return "GOITY_ROBERTS";
 }
 
-EvtDecayBase* EvtGoityRoberts::clone()
+EvtDecayBase* EvtGoityRoberts::clone() const
 {
     return new EvtGoityRoberts;
 }
 
 void EvtGoityRoberts::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 4 );
 
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
     checkSpinDaughter( 3, EvtSpinType::NEUTRINO );
 }
 
 void EvtGoityRoberts::initProbMax()
 {
     setProbMax( 3000.0 );
 }
 
 void EvtGoityRoberts::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId DST0 = EvtPDL::getId( "D*0" );
-    static EvtId DSTB = EvtPDL::getId( "anti-D*0" );
-    static EvtId DSTP = EvtPDL::getId( "D*+" );
-    static EvtId DSTM = EvtPDL::getId( "D*-" );
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId DST0 = EvtPDL::getId( "D*0" );
+    static const EvtId DSTB = EvtPDL::getId( "anti-D*0" );
+    static const EvtId DSTP = EvtPDL::getId( "D*+" );
+    static const EvtId DSTM = EvtPDL::getId( "D*-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
     EvtId meson = getDaug( 0 );
 
     if ( meson == DST0 || meson == DSTP || meson == DSTM || meson == DSTB ) {
         DecayBDstarpilnuGR( p, getDaug( 0 ), getDaug( 2 ), getDaug( 3 ) );
     } else {
         if ( meson == D0 || meson == DP || meson == DM || meson == D0B ) {
             DecayBDpilnuGR( p, getDaug( 0 ), getDaug( 2 ), getDaug( 3 ) );
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Wrong daugther in EvtGoityRoberts!\n";
         }
     }
     return;
 }
 
 void EvtGoityRoberts::DecayBDstarpilnuGR( EvtParticle* pb, EvtId ndstar,
                                           EvtId nlep, EvtId /*nnu*/ )
 {
     pb->initializePhaseSpace( getNDaug(), getDaugs() );
 
     //added by Lange Jan4,2000
-    static EvtId EM = EvtPDL::getId( "e-" );
-    static EvtId EP = EvtPDL::getId( "e+" );
-    static EvtId MUM = EvtPDL::getId( "mu-" );
-    static EvtId MUP = EvtPDL::getId( "mu+" );
+    static const EvtId EM = EvtPDL::getId( "e-" );
+    static const EvtId EP = EvtPDL::getId( "e+" );
+    static const EvtId MUM = EvtPDL::getId( "mu-" );
+    static const EvtId MUP = EvtPDL::getId( "mu+" );
 
     EvtParticle *dstar, *pion, *lepton, *neutrino;
 
     // pb->makeDaughters(getNDaug(),getDaugs());
     dstar = pb->getDaug( 0 );
     pion = pb->getDaug( 1 );
     lepton = pb->getDaug( 2 );
     neutrino = pb->getDaug( 3 );
 
     EvtVector4C l1, l2, et0, et1, et2;
 
     EvtVector4R v, vp, p4_pi;
     double w;
 
     v.set( 1.0, 0.0, 0.0, 0.0 );    //4-velocity of B meson
     vp = ( 1.0 / dstar->getP4().mass() ) * dstar->getP4();    //4-velocity of D*
     p4_pi = pion->getP4();
 
     w = v * vp;    //four velocity transfere.
 
     EvtTensor4C omega;
 
     double mb = EvtPDL::getMeanMass( pb->getId() );    //B mass
     double md = EvtPDL::getMeanMass( ndstar );         //D* mass
 
     EvtComplex dmb( 0.0460, -0.5 * 0.00001 );    // B*-B mass splitting ?
     EvtComplex dmd( 0.1421, -0.5 * 0.00006 );
     // The last two sets of numbers should
     // be correctly calculated from the
     // dstar and pion charges.
     double g = 0.5;    // EvtAmplitude proportional to these coupling constants
     double alpha3 = 0.690;    // See table I in G&R's paper
     double alpha1 = -1.430;
     double alpha2 = -0.140;
     double f0 = 0.093;    // The pion decay constants set to 93 MeV
 
     EvtComplex dmt3( 0.563, -0.5 * 0.191 );    // Mass splitting = dmt - iGamma/2
     EvtComplex dmt1( 0.392, -0.5 * 1.040 );
     EvtComplex dmt2( 0.709, -0.5 * 0.405 );
 
     double betas = 0.285;    // magic number for meson wave function ground state
     double betap = 0.280;    // magic number for meson wave function state "1"
     double betad = 0.260;    // magic number for meson wave function state "2"
     double betasp = betas * betas + betap * betap;
     double betasd = betas * betas + betad * betad;
 
     double lambdabar = 0.750;    //M(0-,1-) - mQ From Goity&Roberts's code
 
     // Isgur&Wise fct
     double xi = exp( lambdabar * lambdabar * ( 1.0 - w * w ) /
                      ( 4 * betas * betas ) );
     double xi1 =
         -1.0 * sqrt( 2.0 / 3.0 ) *
         ( lambdabar * lambdabar * ( w * w - 1.0 ) / ( 4 * betas * betas ) ) *
         exp( lambdabar * lambdabar * ( 1.0 - w * w ) / ( 4 * betas * betas ) );
     double rho1 = sqrt( 1.0 / 2.0 ) * ( lambdabar / betas ) *
                   pow( ( 2 * betas * betap / ( betasp ) ), 2.5 ) *
                   exp( lambdabar * lambdabar * ( 1.0 - w * w ) / ( 2 * betasp ) );
     double rho2 = sqrt( 1.0 / 8.0 ) *
                   ( lambdabar * lambdabar / ( betas * betas ) ) *
                   pow( ( 2 * betas * betad / ( betasd ) ), 3.5 ) *
                   exp( lambdabar * lambdabar * ( 1.0 - w * w ) / ( 2 * betasd ) );
 
     //EvtGenReport(EVTGEN_INFO,"EvtGen") <<"rho's:"<<rho1<<rho2<<endl;
 
     EvtComplex h1nr, h2nr, h3nr, f1nr, f2nr;
     EvtComplex f3nr, f4nr, f5nr, f6nr, knr, g1nr, g2nr, g3nr, g4nr, g5nr;
     EvtComplex h1r, h2r, h3r, f1r, f2r, f3r, f4r, f5r, f6r, kr, g1r, g2r, g3r,
         g4r, g5r;
     EvtComplex h1, h2, h3, f1, f2, f3, f4, f5, f6, k, g1, g2, g3, g4, g5;
 
     // Non-resonance part
     h1nr = -g * xi * ( p4_pi * v ) /
            ( f0 * mb * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) );
     h2nr = -g * xi / ( f0 * mb * ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) );
     h3nr = -( g * xi / ( f0 * md ) ) *
            ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) -
              EvtComplex( ( 1.0 + w ) / ( p4_pi * vp ), 0.0 ) );
 
     f1nr = -( g * xi / ( 2 * f0 * mb ) ) *
            ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) -
              1.0 / ( EvtComplex( p4_pi * vp, 0.0 ) + dmd ) );
     f2nr = f1nr * mb / md;
     f3nr = EvtComplex( 0.0 );
     f4nr = EvtComplex( 0.0 );
     f5nr = ( g * xi / ( 2 * f0 * mb * md ) ) *
            ( EvtComplex( 1.0, 0.0 ) +
              ( p4_pi * v ) / ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) );
     f6nr = ( g * xi / ( 2 * f0 * mb ) ) *
            ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) -
              EvtComplex( 1.0 / ( p4_pi * vp ), 0.0 ) );
 
     knr = ( g * xi / ( 2 * f0 ) ) *
           ( ( p4_pi * ( vp - w * v ) ) / ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) +
             EvtComplex( ( p4_pi * ( v - w * vp ) ) / ( p4_pi * vp ), 0.0 ) );
 
     g1nr = EvtComplex( 0.0 );
     g2nr = EvtComplex( 0.0 );
     g3nr = EvtComplex( 0.0 );
     g4nr = ( g * xi ) / ( f0 * md * EvtComplex( p4_pi * vp ) );
     g5nr = EvtComplex( 0.0 );
 
     // Resonance part (D** removed by hand - alainb)
     h1r = -alpha1 * rho1 * ( p4_pi * v ) /
               ( f0 * mb * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmt1 ) ) +
           alpha2 * rho2 * ( p4_pi * ( v + 2.0 * w * v - vp ) ) /
               ( 3 * f0 * mb * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) -
           alpha3 * xi1 * ( p4_pi * v ) /
               ( f0 * mb * md * EvtComplex( p4_pi * v, 0.0 ) + dmt3 );
     h2r = -alpha2 * ( 1 + w ) * rho2 /
               ( 3 * f0 * mb * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) -
           alpha3 * xi1 / ( f0 * mb * ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) );
     h3r = alpha2 * rho2 * ( 1 + w ) /
               ( 3 * f0 * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) -
           alpha3 * xi1 / ( f0 * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) );
 
     f1r = -alpha2 * rho2 * ( w - 1.0 ) /
               ( 6 * f0 * mb * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) -
           alpha3 * xi1 /
               ( 2 * f0 * mb * ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) );
     f2r = f1r * mb / md;
     f3r = EvtComplex( 0.0 );
     f4r = EvtComplex( 0.0 );
     f5r = alpha1 * rho1 * ( p4_pi * v ) /
               ( 2 * f0 * mb * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmt1 ) ) +
           alpha2 * rho2 * ( p4_pi * ( vp - v / 3.0 - 2.0 / 3.0 * w * v ) ) /
               ( 2 * f0 * mb * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) +
           alpha3 * xi1 * ( p4_pi * v ) /
               ( 2 * f0 * mb * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) );
     f6r = alpha2 * rho2 * ( w - 1.0 ) /
               ( 6 * f0 * mb * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) +
           alpha3 * xi1 /
               ( 2 * f0 * mb * ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) );
 
     kr = -alpha1 * rho1 * ( w - 1.0 ) * ( p4_pi * v ) /
              ( 2 * f0 * ( EvtComplex( p4_pi * v, 0.0 ) + dmt1 ) ) -
          alpha2 * rho2 * ( w - 1.0 ) * ( p4_pi * ( vp - w * v ) ) /
              ( 3 * f0 * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) +
          alpha3 * xi1 * ( p4_pi * ( vp - w * v ) ) /
              ( 2 * f0 * ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) );
 
     g1r = EvtComplex( 0.0 );
     g2r = EvtComplex( 0.0 );
     g3r = -g2r;
     g4r = 2.0 * alpha2 * rho2 /
           ( 3 * f0 * md * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) );
     g5r = EvtComplex( 0.0 );
 
     //Sum
     h1 = h1nr + h1r;
     h2 = h2nr + h2r;
     h3 = h3nr + h3r;
 
     f1 = f1nr + f1r;
     f2 = f2nr + f2r;
     f3 = f3nr + f3r;
     f4 = f4nr + f4r;
     f5 = f5nr + f5r;
     f6 = f6nr + f6r;
 
     k = knr + kr;
 
     g1 = g1nr + g1r;
     g2 = g2nr + g2r;
     g3 = g3nr + g3r;
     g4 = g4nr + g4r;
     g5 = g5nr + g5r;
 
     EvtTensor4C g_metric;
     g_metric.setdiag( 1.0, -1.0, -1.0, -1.0 );
 
     if ( nlep == EM || nlep == MUM ) {
         omega =
             EvtComplex( 0.0, 0.5 ) *
                 dual( h1 * mb * md * EvtGenFunctions::directProd( v, vp ) +
                       h2 * mb * EvtGenFunctions::directProd( v, p4_pi ) +
                       h3 * md * EvtGenFunctions::directProd( vp, p4_pi ) ) +
             f1 * mb * EvtGenFunctions::directProd( v, p4_pi ) +
             f2 * md * EvtGenFunctions::directProd( vp, p4_pi ) +
             f3 * EvtGenFunctions::directProd( p4_pi, p4_pi ) +
             f4 * mb * mb * EvtGenFunctions::directProd( v, v ) +
             f5 * mb * md * EvtGenFunctions::directProd( vp, v ) +
             f6 * mb * EvtGenFunctions::directProd( p4_pi, v ) + k * g_metric +
             EvtComplex( 0.0, 0.5 ) *
                 EvtGenFunctions::directProd(
                     dual( EvtGenFunctions::directProd( vp, p4_pi ) ).cont2( v ),
                     ( g1 * p4_pi + g2 * mb * v ) ) +
             EvtComplex( 0.0, 0.5 ) *
                 EvtGenFunctions::directProd(
                     ( g3 * mb * v + g4 * md * vp + g5 * p4_pi ),
                     dual( EvtGenFunctions::directProd( vp, p4_pi ) ).cont2( v ) );
 
         l1 = EvtLeptonVACurrent( lepton->spParent( 0 ),
                                  neutrino->spParentNeutrino() );
         l2 = EvtLeptonVACurrent( lepton->spParent( 1 ),
                                  neutrino->spParentNeutrino() );
     } else {
         if ( nlep == EP || nlep == MUP ) {
             omega =
                 EvtComplex( 0.0, -0.5 ) *
                     dual( h1 * mb * md * EvtGenFunctions::directProd( v, vp ) +
                           h2 * mb * EvtGenFunctions::directProd( v, p4_pi ) +
                           h3 * md * EvtGenFunctions::directProd( vp, p4_pi ) ) +
                 f1 * mb * EvtGenFunctions::directProd( v, p4_pi ) +
                 f2 * md * EvtGenFunctions::directProd( vp, p4_pi ) +
                 f3 * EvtGenFunctions::directProd( p4_pi, p4_pi ) +
                 f4 * mb * mb * EvtGenFunctions::directProd( v, v ) +
                 f5 * mb * md * EvtGenFunctions::directProd( vp, v ) +
                 f6 * mb * EvtGenFunctions::directProd( p4_pi, v ) + k * g_metric +
                 EvtComplex( 0.0, -0.5 ) *
                     EvtGenFunctions::directProd(
                         dual( EvtGenFunctions::directProd( vp, p4_pi ) ).cont2( v ),
                         ( g1 * p4_pi + g2 * mb * v ) ) +
                 EvtComplex( 0.0, -0.5 ) *
                     EvtGenFunctions::directProd(
                         ( g3 * mb * v + g4 * md * vp + g5 * p4_pi ),
                         dual( EvtGenFunctions::directProd( vp, p4_pi ) ).cont2( v ) );
 
             l1 = EvtLeptonVACurrent( neutrino->spParentNeutrino(),
                                      lepton->spParent( 0 ) );
             l2 = EvtLeptonVACurrent( neutrino->spParentNeutrino(),
                                      lepton->spParent( 1 ) );
         } else {
             EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
                 << "42387dfs878w wrong lepton number\n";
         }
     }
 
     et0 = omega.cont2( dstar->epsParent( 0 ).conj() );
     et1 = omega.cont2( dstar->epsParent( 1 ).conj() );
     et2 = omega.cont2( dstar->epsParent( 2 ).conj() );
 
     vertex( 0, 0, l1.cont( et0 ) );
     vertex( 0, 1, l2.cont( et0 ) );
 
     vertex( 1, 0, l1.cont( et1 ) );
     vertex( 1, 1, l2.cont( et1 ) );
 
     vertex( 2, 0, l1.cont( et2 ) );
     vertex( 2, 1, l2.cont( et2 ) );
 
     return;
 }
 
 void EvtGoityRoberts::DecayBDpilnuGR( EvtParticle* pb, EvtId nd, EvtId nlep,
                                       EvtId /*nnu*/ )
 
 {
     //added by Lange Jan4,2000
-    static EvtId EM = EvtPDL::getId( "e-" );
-    static EvtId EP = EvtPDL::getId( "e+" );
-    static EvtId MUM = EvtPDL::getId( "mu-" );
-    static EvtId MUP = EvtPDL::getId( "mu+" );
+    static const EvtId EM = EvtPDL::getId( "e-" );
+    static const EvtId EP = EvtPDL::getId( "e+" );
+    static const EvtId MUM = EvtPDL::getId( "mu-" );
+    static const EvtId MUP = EvtPDL::getId( "mu+" );
 
     EvtParticle *d, *pion, *lepton, *neutrino;
 
     pb->initializePhaseSpace( getNDaug(), getDaugs() );
     d = pb->getDaug( 0 );
     pion = pb->getDaug( 1 );
     lepton = pb->getDaug( 2 );
     neutrino = pb->getDaug( 3 );
 
     EvtVector4C l1, l2, et0, et1, et2;
 
     EvtVector4R v, vp, p4_pi;
     double w;
 
     v.set( 1.0, 0.0, 0.0, 0.0 );                      //4-velocity of B meson
     vp = ( 1.0 / d->getP4().mass() ) * d->getP4();    //4-velocity of D
     p4_pi = pion->getP4();                            //4-momentum of pion
     w = v * vp;                                       //four velocity transfer.
 
     double mb = EvtPDL::getMeanMass( pb->getId() );    //B mass
     double md = EvtPDL::getMeanMass( nd );             //D* mass
     EvtComplex dmb( 0.0460, -0.5 * 0.00001 );          //B mass splitting ?
         //The last two numbers should be
         //correctly calculated from the
         //dstar and pion particle number.
 
     double g = 0.5;    // Amplitude proportional to these coupling constants
     double alpha3 = 0.690;    // See table I in G&R's paper
     double alpha1 = -1.430;
     double alpha2 = -0.140;
     double f0 = 0.093;    // The pion decay constant set to 93 MeV
 
     EvtComplex dmt3( 0.563, -0.5 * 0.191 );    // Mass splitting = dmt - iGamma/2
     EvtComplex dmt1( 0.392, -0.5 * 1.040 );
     EvtComplex dmt2( 0.709, -0.5 * 0.405 );
 
     double betas = 0.285;    // magic number for meson wave function ground state
     double betap = 0.280;    // magic number for meson wave function state "1"
     double betad = 0.260;    // magic number for meson wave function state "2"
     double betasp = betas * betas + betap * betap;
     double betasd = betas * betas + betad * betad;
 
     double lambdabar = 0.750;    //M(0-,1-) - mQ From Goity&Roberts's code
 
     // Isgur&Wise fct
     double xi = exp( lambdabar * lambdabar * ( 1.0 - w * w ) /
                      ( 4 * betas * betas ) );
     double xi1 =
         -1.0 * sqrt( 2.0 / 3.0 ) *
         ( lambdabar * lambdabar * ( w * w - 1.0 ) / ( 4 * betas * betas ) ) *
         exp( lambdabar * lambdabar * ( 1.0 - w * w ) / ( 4 * betas * betas ) );
     double rho1 = sqrt( 1.0 / 2.0 ) * ( lambdabar / betas ) *
                   pow( ( 2 * betas * betap / ( betasp ) ), 2.5 ) *
                   exp( lambdabar * lambdabar * ( 1.0 - w * w ) / ( 2 * betasp ) );
     double rho2 = sqrt( 1.0 / 8.0 ) *
                   ( lambdabar * lambdabar / ( betas * betas ) ) *
                   pow( ( 2 * betas * betad / ( betasd ) ), 3.5 ) *
                   exp( lambdabar * lambdabar * ( 1.0 - w * w ) / ( 2 * betasd ) );
 
     EvtComplex h, a1, a2, a3;
     EvtComplex hnr, a1nr, a2nr, a3nr;
     EvtComplex hr, a1r, a2r, a3r;
 
     // Non-resonance part (D* and D** removed by hand - alainb)
     hnr = g * xi * ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) ) /
           ( 2 * f0 * mb * md );
     a1nr = -1.0 * g * xi * ( 1 + w ) *
            ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) ) / ( 2 * f0 );
     a2nr = g * xi *
            ( ( p4_pi * ( v + vp ) ) / ( EvtComplex( p4_pi * v, 0.0 ) + dmb ) ) /
            ( 2 * f0 * mb );
     a3nr = EvtComplex( 0.0, 0.0 );
 
     // Resonance part (D** remove by hand - alainb)
     hr = alpha2 * rho2 * ( w - 1 ) *
              ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) /
              ( 6 * f0 * mb * md ) +
          alpha3 * xi1 * ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) ) /
              ( 2 * f0 * mb * md );
     a1r = -1.0 * alpha2 * rho2 * ( w * w - 1 ) *
               ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) / ( 6 * f0 ) -
           alpha3 * xi1 * ( 1 + w ) *
               ( 1.0 / ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) ) / ( 2 * f0 );
     a2r = alpha1 * rho1 *
               ( ( p4_pi * v ) / ( EvtComplex( p4_pi * v, 0.0 ) + dmt1 ) ) /
               ( 2 * f0 * mb ) +
           alpha2 * rho2 *
               ( 0.5 * p4_pi * ( w * vp - v ) + p4_pi * ( vp - w * v ) ) /
               ( 3 * f0 * mb * ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) +
           alpha3 * xi1 *
               ( ( p4_pi * ( v + vp ) ) / ( EvtComplex( p4_pi * v, 0.0 ) + dmt3 ) ) /
               ( 2 * f0 * mb );
     a3r = -1.0 * alpha1 * rho1 *
               ( ( p4_pi * v ) / ( EvtComplex( p4_pi * v, 0.0 ) + dmt1 ) ) /
               ( 2 * f0 * md ) -
           alpha2 * rho2 *
               ( ( p4_pi * ( vp - w * v ) ) /
                 ( EvtComplex( p4_pi * v, 0.0 ) + dmt2 ) ) /
               ( 2 * f0 * md );
 
     // Sum
     h = hnr + hr;
     a1 = a1nr + a1r;
     a2 = a2nr + a2r;
     a3 = a3nr + a3r;
 
     EvtVector4C omega;
 
     if ( nlep == EM || nlep == MUM ) {
         omega = EvtComplex( 0.0, -1.0 ) * h * mb * md *
                     dual( EvtGenFunctions::directProd( vp, p4_pi ) ).cont2( v ) +
                 a1 * p4_pi + a2 * mb * v + a3 * md * vp;
         l1 = EvtLeptonVACurrent( lepton->spParent( 0 ),
                                  neutrino->spParentNeutrino() );
         l2 = EvtLeptonVACurrent( lepton->spParent( 1 ),
                                  neutrino->spParentNeutrino() );
     } else {
         if ( nlep == EP || nlep == MUP ) {
             omega = EvtComplex( 0.0, 1.0 ) * h * mb * md *
                         dual( EvtGenFunctions::directProd( vp, p4_pi ) ).cont2( v ) +
                     a1 * p4_pi + a2 * mb * v + a3 * md * vp;
             l1 = EvtLeptonVACurrent( neutrino->spParentNeutrino(),
                                      lepton->spParent( 0 ) );
             l2 = EvtLeptonVACurrent( neutrino->spParentNeutrino(),
                                      lepton->spParent( 1 ) );
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "42387dfs878w wrong lepton number\n";
         }
     }
 
     vertex( 0, l1 * omega );
     vertex( 1, l2 * omega );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtHQET.cpp b/src/EvtGenModels/EvtHQET.cpp
index 1a08644..6c837f2 100644
--- a/src/EvtGenModels/EvtHQET.cpp
+++ b/src/EvtGenModels/EvtHQET.cpp
@@ -1,103 +1,103 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtHQET.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtHQETFF.hh"
 
 #include <assert.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtHQET::getName()
+std::string EvtHQET::getName() const
 {
     return "HQET";
 }
 
-EvtDecayBase* EvtHQET::clone()
+EvtDecayBase* EvtHQET::clone() const
 {
     return new EvtHQET;
 }
 
 void EvtHQET::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_hqetffmodel.get() );
 }
 
 void EvtHQET::initProbMax()
 {
     EvtId parnum, mesnum, lnum, nunum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
     nunum = getDaug( 2 );
 
     double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, lnum, nunum,
                                                m_hqetffmodel.get() );
 
     setProbMax( mymaxprob );
 }
 
 void EvtHQET::init()
 {
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
     if ( d1type == EvtSpinType::SCALAR ) {
         checkNArg( 1, 2 );
         if ( getNArg() == 1 )
             m_hqetffmodel = std::make_unique<EvtHQETFF>( getArg( 0 ) );
         else
             m_hqetffmodel = std::make_unique<EvtHQETFF>( getArg( 0 ),
                                                          getArg( 1 ) );
         m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
     } else if ( d1type == EvtSpinType::VECTOR ) {
         checkNArg( 3, 4 );
         if ( getNArg() == 3 )
             m_hqetffmodel = std::make_unique<EvtHQETFF>( getArg( 0 ), getArg( 1 ),
                                                          getArg( 2 ) );
         else
             m_hqetffmodel = std::make_unique<EvtHQETFF>(
                 getArg( 0 ), getArg( 1 ), getArg( 2 ), getArg( 3 ) );
         m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "HQET model handles only scalar and vector meson daughters. Sorry."
             << endl;
         ::abort();
     }
 }
diff --git a/src/EvtGenModels/EvtHQET2.cpp b/src/EvtGenModels/EvtHQET2.cpp
index 3fb1959..b91dc29 100644
--- a/src/EvtGenModels/EvtHQET2.cpp
+++ b/src/EvtGenModels/EvtHQET2.cpp
@@ -1,123 +1,123 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtHQET2.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtHQET2FF.hh"
 
 #include <assert.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtHQET2::getName()
+std::string EvtHQET2::getName() const
 {
     return "HQET2";
 }
 
-EvtDecayBase* EvtHQET2::clone()
+EvtDecayBase* EvtHQET2::clone() const
 {
     return new EvtHQET2;
 }
 
 void EvtHQET2::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_hqetffmodel.get() );
 }
 
 void EvtHQET2::initProbMax()
 {
     EvtId parnum, mesnum, lnum, nunum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
     nunum = getDaug( 2 );
 
     double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, lnum, nunum,
                                                m_hqetffmodel.get() );
 
     setProbMax( mymaxprob );
 }
 
 void EvtHQET2::init()
 {
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
     if ( d1type == EvtSpinType::SCALAR ) {
         if ( getNArg() == 2 ) {
             m_hqetffmodel = std::make_unique<EvtHQET2FF>( getArg( 0 ),
                                                           getArg( 1 ) );
             m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
 
         } else if ( getNArg() == 3 ) {
             m_hqetffmodel = std::make_unique<EvtHQET2FF>( getArg( 0 ),
                                                           getArg( 1 ),
                                                           getArg( 2 ) );
             m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
 
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "HQET2 model for scalar meson daughters needs 2 arguments for normal mode or 3 for extended. Sorry."
                 << endl;
             ::abort();
         }
 
     } else if ( d1type == EvtSpinType::VECTOR ) {
         if ( getNArg() == 4 ) {
             m_hqetffmodel = std::make_unique<EvtHQET2FF>(
                 getArg( 0 ), getArg( 1 ), getArg( 2 ), getArg( 3 ) );
             m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
 
         } else if ( getNArg() == 5 ) {
             m_hqetffmodel = std::make_unique<EvtHQET2FF>(
                 getArg( 0 ), getArg( 1 ), getArg( 2 ), getArg( 3 ), getArg( 4 ) );
             m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
 
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "HQET2 model for vector meson daughtersneeds 4 arguments for normal mode or 5 for extended. Sorry."
                 << endl;
             ::abort();
         }
 
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "HQET2 model handles only scalar and vector meson daughters. Sorry."
             << endl;
         ::abort();
     }
 }
diff --git a/src/EvtGenModels/EvtHelAmp.cpp b/src/EvtGenModels/EvtHelAmp.cpp
index 365602f..ba7ab35 100644
--- a/src/EvtGenModels/EvtHelAmp.cpp
+++ b/src/EvtGenModels/EvtHelAmp.cpp
@@ -1,198 +1,198 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtHelAmp.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtEvalHelAmp.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <string>
 #include <vector>
 using std::endl;
 
-std::string EvtHelAmp::getName()
+std::string EvtHelAmp::getName() const
 {
     return "HELAMP";
 }
 
-EvtDecayBase* EvtHelAmp::clone()
+EvtDecayBase* EvtHelAmp::clone() const
 {
     return new EvtHelAmp;
 }
 
 void EvtHelAmp::init()
 {
     checkNDaug( 2 );
 
     //find out how many states each particle have
     int _nA = EvtSpinType::getSpinStates( EvtPDL::getSpinType( getParentId() ) );
     int _nB = EvtSpinType::getSpinStates( EvtPDL::getSpinType( getDaug( 0 ) ) );
     int _nC = EvtSpinType::getSpinStates( EvtPDL::getSpinType( getDaug( 1 ) ) );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "_nA,_nB,_nC:" << _nA << "," << _nB << "," << _nC << endl;
     }
 
     //find out what 2 times the spin is
     int _JA2 = EvtSpinType::getSpin2( EvtPDL::getSpinType( getParentId() ) );
     int _JB2 = EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 0 ) ) );
     int _JC2 = EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 1 ) ) );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "_JA2,_JB2,_JC2:" << _JA2 << "," << _JB2 << "," << _JC2 << endl;
     }
 
     //allocate memory
     std::vector<int> _lambdaA2( _nA );
     std::vector<int> _lambdaB2( _nB );
     std::vector<int> _lambdaC2( _nC );
 
     EvtComplexPtr* _HBC = new EvtComplexPtr[_nB];
     for ( int ib = 0; ib < _nB; ib++ ) {
         _HBC[ib] = new EvtComplex[_nC];
     }
 
     int i;
     //find the allowed helicities (actually 2*times the helicity!)
 
     fillHelicity( _lambdaA2.data(), _nA, _JA2, getParentId() );
     fillHelicity( _lambdaB2.data(), _nB, _JB2, getDaug( 0 ) );
     fillHelicity( _lambdaC2.data(), _nC, _JC2, getDaug( 1 ) );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Helicity states of particle A:" << endl;
         for ( i = 0; i < _nA; i++ ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" ) << _lambdaA2[i] << endl;
         }
 
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Helicity states of particle B:" << endl;
         for ( i = 0; i < _nB; i++ ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" ) << _lambdaB2[i] << endl;
         }
 
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Helicity states of particle C:" << endl;
         for ( i = 0; i < _nC; i++ ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" ) << _lambdaC2[i] << endl;
         }
     }
 
     //now read in the helicity amplitudes
 
     int argcounter = 0;
 
     for ( int ib = 0; ib < _nB; ib++ ) {
         for ( int ic = 0; ic < _nC; ic++ ) {
             _HBC[ib][ic] = 0.0;
             if ( abs( _lambdaB2[ib] - _lambdaC2[ic] ) <= _JA2 )
                 argcounter += 2;
         }
     }
 
     checkNArg( argcounter );
 
     argcounter = 0;
 
     for ( int ib = 0; ib < _nB; ib++ ) {
         for ( int ic = 0; ic < _nC; ic++ ) {
             if ( abs( _lambdaB2[ib] - _lambdaC2[ic] ) <= _JA2 ) {
                 _HBC[ib][ic] = getArg( argcounter ) *
                                exp( EvtComplex( 0.0, getArg( argcounter + 1 ) ) );
                 ;
                 argcounter += 2;
                 if ( verbose() ) {
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << "_HBC[" << ib << "][" << ic << "]=" << _HBC[ib][ic]
                         << endl;
                 }
             }
         }
     }
 
     m_evalHelAmp = std::make_unique<EvtEvalHelAmp>( getParentId(), getDaug( 0 ),
                                                     getDaug( 1 ), _HBC );
 
     // Note: these are not class data members but local variables.
     for ( int ib = 0; ib < _nB; ib++ ) {
         delete[] _HBC[ib];
     }
     delete[] _HBC;    // _HBC is copied in ctor of EvtEvalHelAmp above.
 }
 
 void EvtHelAmp::initProbMax()
 {
     double maxprob = m_evalHelAmp->probMax();
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Calculated probmax" << maxprob << endl;
     }
 
     setProbMax( maxprob );
 }
 
 void EvtHelAmp::decay( EvtParticle* p )
 {
     //first generate simple phase space
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     m_evalHelAmp->evalAmp( p, m_amp2 );
 }
 
 void EvtHelAmp::fillHelicity( int* lambda2, int n, int J2, EvtId id )
 {
     int i;
 
     //photon is special case!
     if ( n == 2 && J2 == 2 ) {
         lambda2[0] = 2;
         lambda2[1] = -2;
         return;
     }
 
     //and so is the neutrino!
     if ( n == 1 && J2 == 1 ) {
         if ( EvtPDL::getStdHep( id ) > 0 ) {
             //particle i.e. lefthanded
             lambda2[0] = -1;
         } else {
             //anti particle i.e. righthanded
             lambda2[0] = 1;
         }
         return;
     }
 
     assert( n == J2 + 1 );
 
     for ( i = 0; i < n; i++ ) {
         lambda2[i] = n - i * 2 - 1;
     }
 
     return;
 }
diff --git a/src/EvtGenModels/EvtHypNonLepton.cpp b/src/EvtGenModels/EvtHypNonLepton.cpp
index 4920088..f9a8988 100644
--- a/src/EvtGenModels/EvtHypNonLepton.cpp
+++ b/src/EvtGenModels/EvtHypNonLepton.cpp
@@ -1,189 +1,189 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtHypNonLepton.hh"
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGammaMatrix.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
-EvtDecayBase* EvtHypNonLepton::clone()
+EvtDecayBase* EvtHypNonLepton::clone() const
 {
     return new EvtHypNonLepton;
 }
 
-std::string EvtHypNonLepton::getName()
+std::string EvtHypNonLepton::getName() const
 {
     return "HypNonLepton";
 }
 
 void EvtHypNonLepton::init()
 {
     if ( getNArg() < 2 || getNArg() > 3 ) {    // alpha phi gamma delta
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " ERROR: EvtHypNonLepton generator expected 2 or 3 arguments but found: "
             << getNArg() << std::endl;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "  1. Decay asymmetry parameter - alpha" << std::endl;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "  2. Parameter phi - in degrees (not radians)" << std::endl;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "  3. Note on every x-th decay" << std::endl;
         ::abort();
     }
 
     if ( getNDaug() != 2 ) {    // Check that there are 2 daughters only
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " ERROR: EvtHypNonLepton generator expected 2 daughters but found: "
             << getNDaug() << std::endl;
         ::abort();
     }
 
     // Check particles spins
     if ( EvtSpinType::getSpin2( EvtPDL::getSpinType( getParentId() ) ) != 1 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " ERROR: EvtHypNonLepton generator expected dirac parent particle, but found "
             << EvtSpinType::getSpin2( EvtPDL::getSpinType( getParentId() ) )
             << " spin degrees of freedom" << std::endl;
         ::abort();
     }
     if ( EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 0 ) ) ) != 1 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " ERROR: EvtHypNonLepton generator expected the first child to be dirac particle, but found "
             << EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 0 ) ) )
             << " spin degrees of freedom" << std::endl;
         ::abort();
     }
     if ( EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 1 ) ) ) != 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " ERROR: EvtHypNonLepton generator expected the second child to be scalar particle, but found "
             << EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 1 ) ) )
             << " spin degrees of freedom" << std::endl;
         ::abort();
     }
 
     // Read all parameters
     m_alpha = getArg( 0 );
     m_phi = getArg( 1 ) * EvtConst::pi / 180;
     if ( getNArg() == 3 )
-        m_noTries = static_cast<long>( getArg( 2 ) );
+        m_noTries = static_cast<decltype( m_noTries )>( getArg( 2 ) );
     else
         m_noTries = 0;
 
     // calculate additional parameters
     double p, M, m1, m2;
     double p_to_s, beta, delta, gamma;
 
     M = EvtPDL::getMass( getParentId() );
     m1 = EvtPDL::getMass( getDaug( 0 ) );
     m2 = EvtPDL::getMass( getDaug( 1 ) );
 
     if ( m1 + m2 >= M ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " ERROR: EvtHypNonLepton found impossible decay: " << M
             << " --> " << m1 << " + " << m2 << " GeV\n"
             << std::endl;
         ::abort();
     }
 
     p = sqrt( M * M - ( m1 + m2 ) * ( m1 + m2 ) ) *
         sqrt( M * M - ( m1 - m2 ) * ( m1 - m2 ) ) / 2. / M;
 
     beta = sqrt( 1. - m_alpha * m_alpha ) * sin( m_phi );
     delta = -atan2( beta, m_alpha );
     gamma = sqrt( 1. - m_alpha * m_alpha - beta * beta );
     p_to_s = sqrt( ( 1. - gamma ) / ( 1. + gamma ) );
 
     m_B_to_A = p_to_s * ( m1 + sqrt( p * p + m1 * m1 ) ) / p *
                EvtComplex( cos( delta ), sin( delta ) );
 }
 
 void EvtHypNonLepton::initProbMax()
 {
     double maxProb, m1, m2, M, p;
 
     M = EvtPDL::getMass( getParentId() );
     m1 = EvtPDL::getMass( getDaug( 0 ) );
     m2 = EvtPDL::getMass( getDaug( 1 ) );
 
     if ( m1 + m2 >= M ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " ERROR: EvtHypNonLepton found impossible decay: " << M
             << " --> " << m1 << " + " << m2 << " GeV\n"
             << std::endl;
         ::abort();
     }
 
     p = sqrt( M * M - ( m1 + m2 ) * ( m1 + m2 ) ) *
         sqrt( M * M - ( m1 - m2 ) * ( m1 - m2 ) ) / 2 / M;
     maxProb = 16 * M *
               ( sqrt( p * p + m1 * m1 ) + m1 +
                 abs( m_B_to_A ) * abs( m_B_to_A ) *
                     ( sqrt( p * p + m1 * m1 ) - m1 ) );
     //maxProb *= G_F*M_pi*M_pi;
 
     setProbMax( maxProb );
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " EvtHypNonLepton set up maximum probability to " << maxProb
         << std::endl;
 }
 
 void EvtHypNonLepton::decay( EvtParticle* parent )
 {
     parent->initializePhaseSpace( getNDaug(), getDaugs() );
     calcAmp( &m_amp2, parent );
 }
 
 void EvtHypNonLepton::calcAmp( EvtAmp* amp, EvtParticle* parent )
 {
-    static long noTries = 0;
+    static thread_local decltype( m_noTries ) noTries = 0;
     int i;
     EvtComplex Matrix[2][2];
 
     //G_F  = 1.16637e-5;
     //M_pi = 0.13957;
 
     for ( i = 0; i < 4; i++ ) {
         //std::cout << "--------------------------------------------------" << std::endl;
         Matrix[i / 2][i % 2] = EvtLeptonSCurrent(
             parent->sp( i / 2 ), parent->getDaug( 0 )->spParent( i % 2 ) );
         //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
         Matrix[i / 2][i % 2] -=
             m_B_to_A *
             EvtLeptonPCurrent( parent->sp( i / 2 ),
                                parent->getDaug( 0 )->spParent( i % 2 ) );
         //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
         //Matrix[i/2][i%2] *= G_F*M_pi*M_pi;
         //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
         //std::cout << "--------------------------------------------------" << std::endl;
         amp->vertex( i / 2, i % 2, Matrix[i / 2][i % 2] );
     }
 
     if ( m_noTries > 0 )
         if ( !( ( ++noTries ) % m_noTries ) )
             EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
                 << " EvtHypNonLepton already finished " << noTries
                 << " matrix element calculations" << std::endl;
 }
diff --git a/src/EvtGenModels/EvtISGW.cpp b/src/EvtGenModels/EvtISGW.cpp
index e167aea..d7049e9 100644
--- a/src/EvtGenModels/EvtISGW.cpp
+++ b/src/EvtGenModels/EvtISGW.cpp
@@ -1,86 +1,86 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtISGW.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicTensorAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtISGWFF.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtISGW::getName()
+std::string EvtISGW::getName() const
 {
     return "ISGW";
 }
 
-EvtDecayBase* EvtISGW::clone()
+EvtDecayBase* EvtISGW::clone() const
 {
     return new EvtISGW;
 }
 
 void EvtISGW::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     m_calcamp->CalcAmp( p, m_amp2, m_isgwffmodel.get() );
 }
 
 void EvtISGW::init()
 {
     checkNArg( 0 );
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     m_isgwffmodel = std::make_unique<EvtISGWFF>();
 
     switch ( mesontype ) {
         case EvtSpinType::SCALAR:
             m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
             break;
         case EvtSpinType::VECTOR:
             m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
             break;
         case EvtSpinType::TENSOR:
             m_calcamp = std::make_unique<EvtSemiLeptonicTensorAmp>();
             break;
         default:;
     }
 }
 
 void EvtISGW::initProbMax()
 {
     setProbMax( 10000.0 );
 }
diff --git a/src/EvtGenModels/EvtISGW2.cpp b/src/EvtGenModels/EvtISGW2.cpp
index c516c8e..a8a2703 100644
--- a/src/EvtGenModels/EvtISGW2.cpp
+++ b/src/EvtGenModels/EvtISGW2.cpp
@@ -1,733 +1,733 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtISGW2.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicTensorAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtISGW2FF.hh"
 
 #include <stdlib.h>
 #include <string>
 
 std::string EvtISGW2::getName() const
 {
     return "ISGW2";
 }
 
 EvtDecayBase* EvtISGW2::clone() const
 {
     return new EvtISGW2;
 }
 
 void EvtISGW2::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     m_calcamp->CalcAmp( p, m_amp2, m_isgw2ffmodel.get() );
 }
 
 void EvtISGW2::initProbMax()
 {
     //added by Lange Jan4,2000
-    static EvtId EM = EvtPDL::getId( "e-" );
-    static EvtId EP = EvtPDL::getId( "e+" );
-    static EvtId MUM = EvtPDL::getId( "mu-" );
-    static EvtId MUP = EvtPDL::getId( "mu+" );
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
-    static EvtId TAUP = EvtPDL::getId( "tau+" );
-
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
-    static EvtId BCP = EvtPDL::getId( "B_c+" );
-    static EvtId BCM = EvtPDL::getId( "B_c-" );
-
-    static EvtId DST0 = EvtPDL::getId( "D*0" );
-    static EvtId DSTB = EvtPDL::getId( "anti-D*0" );
-    static EvtId DSTP = EvtPDL::getId( "D*+" );
-    static EvtId DSTM = EvtPDL::getId( "D*-" );
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
-
-    static EvtId D1P1P = EvtPDL::getId( "D_1+" );
-    static EvtId D1P1N = EvtPDL::getId( "D_1-" );
-    static EvtId D1P10 = EvtPDL::getId( "D_10" );
-    static EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
-
-    static EvtId D3P2P = EvtPDL::getId( "D_2*+" );
-    static EvtId D3P2N = EvtPDL::getId( "D_2*-" );
-    static EvtId D3P20 = EvtPDL::getId( "D_2*0" );
-    static EvtId D3P2B = EvtPDL::getId( "anti-D_2*0" );
-
-    static EvtId D3P1P = EvtPDL::getId( "D'_1+" );
-    static EvtId D3P1N = EvtPDL::getId( "D'_1-" );
-    static EvtId D3P10 = EvtPDL::getId( "D'_10" );
-    static EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
-
-    static EvtId D3P0P = EvtPDL::getId( "D_0*+" );
-    static EvtId D3P0N = EvtPDL::getId( "D_0*-" );
-    static EvtId D3P00 = EvtPDL::getId( "D_0*0" );
-    static EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
-
-    static EvtId D21S0P = EvtPDL::getId( "D(2S)+" );
-    static EvtId D21S0N = EvtPDL::getId( "D(2S)-" );
-    static EvtId D21S00 = EvtPDL::getId( "D(2S)0" );
-    static EvtId D21S0B = EvtPDL::getId( "anti-D(2S)0" );
-
-    static EvtId D23S1P = EvtPDL::getId( "D*(2S)+" );
-    static EvtId D23S1N = EvtPDL::getId( "D*(2S)-" );
-    static EvtId D23S10 = EvtPDL::getId( "D*(2S)0" );
-    static EvtId D23S1B = EvtPDL::getId( "anti-D*(2S)0" );
-
-    static EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
-    static EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
-    static EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
-    static EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
-    static EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
-
-    static EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
-    static EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
-    static EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
-
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
-
-    static EvtId RHOP = EvtPDL::getId( "rho+" );
-    static EvtId RHOM = EvtPDL::getId( "rho-" );
-    static EvtId RHO0 = EvtPDL::getId( "rho0" );
-
-    static EvtId A2P = EvtPDL::getId( "a_2+" );
-    static EvtId A2M = EvtPDL::getId( "a_2-" );
-    static EvtId A20 = EvtPDL::getId( "a_20" );
-
-    static EvtId A1P = EvtPDL::getId( "a_1+" );
-    static EvtId A1M = EvtPDL::getId( "a_1-" );
-    static EvtId A10 = EvtPDL::getId( "a_10" );
-
-    static EvtId A0P = EvtPDL::getId( "a_0+" );
-    static EvtId A0M = EvtPDL::getId( "a_0-" );
-    static EvtId A00 = EvtPDL::getId( "a_00" );
-
-    static EvtId B1P = EvtPDL::getId( "b_1+" );
-    static EvtId B1M = EvtPDL::getId( "b_1-" );
-    static EvtId B10 = EvtPDL::getId( "b_10" );
-
-    static EvtId H1 = EvtPDL::getId( "h_1" );
-    static EvtId H1PR = EvtPDL::getId( "h'_1" );
-
-    static EvtId F1 = EvtPDL::getId( "f_1" );
-    static EvtId F1PR = EvtPDL::getId( "f'_1" );
-    static EvtId F0 = EvtPDL::getId( "f_0" );
-    static EvtId F0PR = EvtPDL::getId( "f'_0" );
-    static EvtId F2 = EvtPDL::getId( "f_2" );
-    static EvtId F2PR = EvtPDL::getId( "f'_2" );
-
-    static EvtId ETA = EvtPDL::getId( "eta" );
-    static EvtId ETAPR = EvtPDL::getId( "eta'" );
-    static EvtId OMEG = EvtPDL::getId( "omega" );
-
-    static EvtId KP = EvtPDL::getId( "K+" );
-    static EvtId KM = EvtPDL::getId( "K-" );
-    static EvtId K0 = EvtPDL::getId( "K0" );
-    static EvtId KB = EvtPDL::getId( "anti-K0" );
-    static EvtId K0S = EvtPDL::getId( "K_S0" );
-    static EvtId K0L = EvtPDL::getId( "K_L0" );
-
-    static EvtId KSTP = EvtPDL::getId( "K*+" );
-    static EvtId KSTM = EvtPDL::getId( "K*-" );
-    static EvtId KST0 = EvtPDL::getId( "K*0" );
-    static EvtId KSTB = EvtPDL::getId( "anti-K*0" );
-
-    static EvtId K1P = EvtPDL::getId( "K_1+" );
-    static EvtId K1M = EvtPDL::getId( "K_1-" );
-    static EvtId K10 = EvtPDL::getId( "K_10" );
-    static EvtId K1B = EvtPDL::getId( "anti-K_10" );
-
-    static EvtId K1STP = EvtPDL::getId( "K'_1+" );
-    static EvtId K1STM = EvtPDL::getId( "K'_1-" );
-    static EvtId K1ST0 = EvtPDL::getId( "K'_10" );
-    static EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
-
-    static EvtId K2STP = EvtPDL::getId( "K_2*+" );
-    static EvtId K2STM = EvtPDL::getId( "K_2*-" );
-    static EvtId K2ST0 = EvtPDL::getId( "K_2*0" );
-    static EvtId K2STB = EvtPDL::getId( "anti-K_2*0" );
-
-    static EvtId PHI = EvtPDL::getId( "phi" );
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
-
-    static EvtId DSSTP = EvtPDL::getId( "D_s*+" );
-    static EvtId DSSTM = EvtPDL::getId( "D_s*-" );
-    static EvtId DS1P = EvtPDL::getId( "D_s1+" );
-    static EvtId DS1M = EvtPDL::getId( "D_s1-" );
-    static EvtId DS0STP = EvtPDL::getId( "D_s0*+" );
-    static EvtId DS0STM = EvtPDL::getId( "D_s0*-" );
-    static EvtId DPS1P = EvtPDL::getId( "D'_s1+" );
-    static EvtId DPS1M = EvtPDL::getId( "D'_s1-" );
-    static EvtId DS2STP = EvtPDL::getId( "D_s2*+" );
-    static EvtId DS2STM = EvtPDL::getId( "D_s2*-" );
+    static const EvtId EM = EvtPDL::getId( "e-" );
+    static const EvtId EP = EvtPDL::getId( "e+" );
+    static const EvtId MUM = EvtPDL::getId( "mu-" );
+    static const EvtId MUP = EvtPDL::getId( "mu+" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId TAUP = EvtPDL::getId( "tau+" );
+
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BCP = EvtPDL::getId( "B_c+" );
+    static const EvtId BCM = EvtPDL::getId( "B_c-" );
+
+    static const EvtId DST0 = EvtPDL::getId( "D*0" );
+    static const EvtId DSTB = EvtPDL::getId( "anti-D*0" );
+    static const EvtId DSTP = EvtPDL::getId( "D*+" );
+    static const EvtId DSTM = EvtPDL::getId( "D*-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
+
+    static const EvtId D1P1P = EvtPDL::getId( "D_1+" );
+    static const EvtId D1P1N = EvtPDL::getId( "D_1-" );
+    static const EvtId D1P10 = EvtPDL::getId( "D_10" );
+    static const EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
+
+    static const EvtId D3P2P = EvtPDL::getId( "D_2*+" );
+    static const EvtId D3P2N = EvtPDL::getId( "D_2*-" );
+    static const EvtId D3P20 = EvtPDL::getId( "D_2*0" );
+    static const EvtId D3P2B = EvtPDL::getId( "anti-D_2*0" );
+
+    static const EvtId D3P1P = EvtPDL::getId( "D'_1+" );
+    static const EvtId D3P1N = EvtPDL::getId( "D'_1-" );
+    static const EvtId D3P10 = EvtPDL::getId( "D'_10" );
+    static const EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
+
+    static const EvtId D3P0P = EvtPDL::getId( "D_0*+" );
+    static const EvtId D3P0N = EvtPDL::getId( "D_0*-" );
+    static const EvtId D3P00 = EvtPDL::getId( "D_0*0" );
+    static const EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
+
+    static const EvtId D21S0P = EvtPDL::getId( "D(2S)+" );
+    static const EvtId D21S0N = EvtPDL::getId( "D(2S)-" );
+    static const EvtId D21S00 = EvtPDL::getId( "D(2S)0" );
+    static const EvtId D21S0B = EvtPDL::getId( "anti-D(2S)0" );
+
+    static const EvtId D23S1P = EvtPDL::getId( "D*(2S)+" );
+    static const EvtId D23S1N = EvtPDL::getId( "D*(2S)-" );
+    static const EvtId D23S10 = EvtPDL::getId( "D*(2S)0" );
+    static const EvtId D23S1B = EvtPDL::getId( "anti-D*(2S)0" );
+
+    static const EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
+    static const EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
+    static const EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
+    static const EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
+    static const EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
+
+    static const EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
+    static const EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
+    static const EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
+
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
+
+    static const EvtId RHOP = EvtPDL::getId( "rho+" );
+    static const EvtId RHOM = EvtPDL::getId( "rho-" );
+    static const EvtId RHO0 = EvtPDL::getId( "rho0" );
+
+    static const EvtId A2P = EvtPDL::getId( "a_2+" );
+    static const EvtId A2M = EvtPDL::getId( "a_2-" );
+    static const EvtId A20 = EvtPDL::getId( "a_20" );
+
+    static const EvtId A1P = EvtPDL::getId( "a_1+" );
+    static const EvtId A1M = EvtPDL::getId( "a_1-" );
+    static const EvtId A10 = EvtPDL::getId( "a_10" );
+
+    static const EvtId A0P = EvtPDL::getId( "a_0+" );
+    static const EvtId A0M = EvtPDL::getId( "a_0-" );
+    static const EvtId A00 = EvtPDL::getId( "a_00" );
+
+    static const EvtId B1P = EvtPDL::getId( "b_1+" );
+    static const EvtId B1M = EvtPDL::getId( "b_1-" );
+    static const EvtId B10 = EvtPDL::getId( "b_10" );
+
+    static const EvtId H1 = EvtPDL::getId( "h_1" );
+    static const EvtId H1PR = EvtPDL::getId( "h'_1" );
+
+    static const EvtId F1 = EvtPDL::getId( "f_1" );
+    static const EvtId F1PR = EvtPDL::getId( "f'_1" );
+    static const EvtId F0 = EvtPDL::getId( "f_0" );
+    static const EvtId F0PR = EvtPDL::getId( "f'_0" );
+    static const EvtId F2 = EvtPDL::getId( "f_2" );
+    static const EvtId F2PR = EvtPDL::getId( "f'_2" );
+
+    static const EvtId ETA = EvtPDL::getId( "eta" );
+    static const EvtId ETAPR = EvtPDL::getId( "eta'" );
+    static const EvtId OMEG = EvtPDL::getId( "omega" );
+
+    static const EvtId KP = EvtPDL::getId( "K+" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId K0 = EvtPDL::getId( "K0" );
+    static const EvtId KB = EvtPDL::getId( "anti-K0" );
+    static const EvtId K0S = EvtPDL::getId( "K_S0" );
+    static const EvtId K0L = EvtPDL::getId( "K_L0" );
+
+    static const EvtId KSTP = EvtPDL::getId( "K*+" );
+    static const EvtId KSTM = EvtPDL::getId( "K*-" );
+    static const EvtId KST0 = EvtPDL::getId( "K*0" );
+    static const EvtId KSTB = EvtPDL::getId( "anti-K*0" );
+
+    static const EvtId K1P = EvtPDL::getId( "K_1+" );
+    static const EvtId K1M = EvtPDL::getId( "K_1-" );
+    static const EvtId K10 = EvtPDL::getId( "K_10" );
+    static const EvtId K1B = EvtPDL::getId( "anti-K_10" );
+
+    static const EvtId K1STP = EvtPDL::getId( "K'_1+" );
+    static const EvtId K1STM = EvtPDL::getId( "K'_1-" );
+    static const EvtId K1ST0 = EvtPDL::getId( "K'_10" );
+    static const EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
+
+    static const EvtId K2STP = EvtPDL::getId( "K_2*+" );
+    static const EvtId K2STM = EvtPDL::getId( "K_2*-" );
+    static const EvtId K2ST0 = EvtPDL::getId( "K_2*0" );
+    static const EvtId K2STB = EvtPDL::getId( "anti-K_2*0" );
+
+    static const EvtId PHI = EvtPDL::getId( "phi" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
+
+    static const EvtId DSSTP = EvtPDL::getId( "D_s*+" );
+    static const EvtId DSSTM = EvtPDL::getId( "D_s*-" );
+    static const EvtId DS1P = EvtPDL::getId( "D_s1+" );
+    static const EvtId DS1M = EvtPDL::getId( "D_s1-" );
+    static const EvtId DS0STP = EvtPDL::getId( "D_s0*+" );
+    static const EvtId DS0STM = EvtPDL::getId( "D_s0*-" );
+    static const EvtId DPS1P = EvtPDL::getId( "D'_s1+" );
+    static const EvtId DPS1M = EvtPDL::getId( "D'_s1-" );
+    static const EvtId DS2STP = EvtPDL::getId( "D_s2*+" );
+    static const EvtId DS2STM = EvtPDL::getId( "D_s2*-" );
 
     EvtId parnum, mesnum, lnum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
 
     if ( parnum == BP || parnum == BM || parnum == B0 || parnum == B0B ||
          parnum == BS0 || parnum == BSB ) {
         if ( mesnum == DST0 || mesnum == DSTP || mesnum == DSTB ||
              mesnum == DSTM || mesnum == DSSTP || mesnum == DSSTM ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 10000.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 7000.0 );
                 return;
             }
         }
 
         if ( mesnum == D0 || mesnum == DP || mesnum == D0B || mesnum == DM ||
              mesnum == DSP || mesnum == DSM ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 4000.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 3500.0 );
                 return;
             }
         }
 
         if ( mesnum == D1P1P || mesnum == D1P1N || mesnum == D1P10 ||
              mesnum == D1P1B || mesnum == DS1P || mesnum == DS1M ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1300.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 480.0 );
                 return;
             }
         }
 
         if ( mesnum == D3P1P || mesnum == D3P1N || mesnum == D3P10 ||
              mesnum == D3P1B || mesnum == DS0STP || mesnum == DS0STM ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 450.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 73.0 );    //???
                 return;
             }
         }
 
         if ( mesnum == D3P0P || mesnum == D3P0N || mesnum == D3P00 ||
              mesnum == D3P0B || mesnum == DPS1P || mesnum == DPS1M ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 200.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 90.0 );
                 return;
             }
         }
         if ( mesnum == D3P2P || mesnum == D3P2N || mesnum == D3P20 ||
              mesnum == D3P2B || mesnum == DS2STP || mesnum == DS2STM ) {
             if ( mesnum == DS2STP || mesnum == DS2STM ) {
                 setProbMax( 550.0 );
                 return;
             }
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 400.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 220.0 );
                 return;
             }
         }
 
         if ( mesnum == D21S0P || mesnum == D21S0N || mesnum == D21S00 ||
              mesnum == D21S0B ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 16.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 3.0 );
                 return;
             }
         }
 
         if ( mesnum == D23S1P || mesnum == D23S1N || mesnum == D23S10 ||
              mesnum == D23S1B ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 500.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 250.0 );
                 return;
             }
         }
 
         if ( mesnum == RHOP || mesnum == RHOM || mesnum == RHO0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 6500.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 6000.0 );
                 return;
             }
         }
 
         if ( mesnum == OMEG ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 6800.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 6000.0 );
                 return;
             }
         }
 
         if ( mesnum == PIP || mesnum == PIM || mesnum == PI0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1200.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1150.0 );
                 return;
             }
         }
 
         if ( mesnum == ETA ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1800.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1900.0 );
                 return;
             }
         }
 
         if ( mesnum == ETAPR ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 3000.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 3000.0 );
                 return;
             }
         }
 
         if ( mesnum == B1P || mesnum == B1M || mesnum == B10 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 2500.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1700.0 );
                 return;
             }
         }
 
         if ( mesnum == A0P || mesnum == A0M || mesnum == A00 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 80.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 62.0 );
                 return;
             }
         }
 
         if ( mesnum == A1P || mesnum == A1M || mesnum == A10 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 4500.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 3500.0 );
                 return;
             }
         }
 
         if ( mesnum == A2P || mesnum == A2M || mesnum == A20 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1200.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1000.0 );
                 return;
             }
         }
 
         if ( mesnum == H1 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 2600.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 2900.0 );
                 return;
             }
         }
 
         if ( mesnum == H1PR ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1400.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1500.0 );
                 return;
             }
         }
 
         if ( mesnum == F2 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1100.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1100.0 );
                 return;
             }
         }
 
         if ( mesnum == F2PR ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 804.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 600.0 );
                 return;
             }
         }
 
         if ( mesnum == F1 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 2500.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 2000.0 );
                 return;
             }
         }
 
         if ( mesnum == F1PR ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 2400.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1700.0 );
                 return;
             }
         }
 
         if ( mesnum == F0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 80.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 63.0 );
                 return;
             }
         }
 
         if ( mesnum == F0PR ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 120.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 120.0 );
                 return;
             }
         }
 
         if ( mesnum == RHO2SP || mesnum == RHO2SM || mesnum == RHO2S0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 2400.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 2000.0 );
                 return;
             }
         }
 
         if ( mesnum == OMEG2S ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1600.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1400.0 );
                 return;
             }
         }
 
         if ( mesnum == PI2SP || mesnum == PI2SM || mesnum == PI2S0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 500.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 300.0 );
                 return;
             }
         }
 
         if ( mesnum == ETA2S ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 344.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 300.0 );
                 return;
             }
         }
 
         if ( mesnum == KP || mesnum == KM || mesnum == K1P || mesnum == K1M ||
              mesnum == K1STP || mesnum == K1STM ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 2000.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 1000.0 );
                 return;
             }
         }
 
         if ( mesnum == KSTP || mesnum == KSTM ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 10000.0 );
                 return;
             }
             if ( lnum == TAUP || lnum == TAUM ) {
                 setProbMax( 7000.0 );
                 return;
             }
         }
     }
 
     if ( parnum == D0 || parnum == DP || parnum == DM || parnum == D0B ) {
         if ( mesnum == RHOP || mesnum == RHOM || mesnum == RHO0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 110.0 );
                 return;
             }
         }
 
         if ( mesnum == OMEG ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 75.0 );
                 return;
             }
         }
 
         if ( mesnum == PIP || mesnum == PIM || mesnum == PI0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 40.0 );
                 return;
             }
         }
 
         if ( mesnum == ETA ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 65.0 );
                 return;
             }
         }
 
         if ( mesnum == ETAPR ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 60.0 );
                 return;
             }
         }
 
         if ( mesnum == KP || mesnum == KM || mesnum == K0 || mesnum == K0S ||
              mesnum == K0L || mesnum == KB ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 70.0 );
                 return;
             }
         }
 
         if ( mesnum == K1STP || mesnum == K1STM || mesnum == K1ST0 ||
              mesnum == K1STB ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 3.3 );
                 return;
             }
         }
 
         if ( mesnum == K1P || mesnum == K1M || mesnum == K10 || mesnum == K1B ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 100.0 );
                 return;
             }
         }
 
         if ( mesnum == KSTP || mesnum == KSTM || mesnum == KST0 ||
              mesnum == KSTB ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 135.0 );
                 return;
             }
         }
 
         if ( mesnum == K2STP || mesnum == K2STM || mesnum == K2ST0 ||
              mesnum == K2STB ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 //Lange - Oct 26,2001 - increasing from 0.75 to
                 //accomodate
                 setProbMax( 9.0 );
                 // setProbMax( 0.75);
                 return;
             }
         }
 
         if ( mesnum == F0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1.0 );
                 return;
             }
         }
     }
 
     if ( parnum == DSP || parnum == DSM ) {
         if ( mesnum == PHI ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 90.0 );
                 return;
             }
         }
 
         if ( mesnum == ETA ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 75.0 );
                 return;
             }
         }
 
         if ( mesnum == ETAPR ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 80.0 );
                 return;
             }
         }
 
         if ( mesnum == KST0 || mesnum == KSTB ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 100.0 );
                 return;
             }
         }
 
         if ( mesnum == K0 || mesnum == KB || mesnum == K0S || mesnum == K0L ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 45.0 );
                 return;
             }
         }
 
         if ( mesnum == F0 ) {
             if ( lnum == EP || lnum == EM || lnum == MUP || lnum == MUM ) {
                 setProbMax( 1.0 );
                 return;
             }
         }
     }
 
     if ( parnum == BCP || parnum == BCM ) {
         setProbMax( 1000.0 );
         return;
     }
 
     //This is a real cludge.. (ryd)
     setProbMax( 0.0 );
 }
 
 void EvtISGW2::init()
 {
     checkNArg( 0 );
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     m_isgw2ffmodel = std::make_unique<EvtISGW2FF>();
 
     switch ( mesontype ) {
         case EvtSpinType::SCALAR:
             m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
             break;
         case EvtSpinType::VECTOR:
             m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
             break;
         case EvtSpinType::TENSOR:
             m_calcamp = std::make_unique<EvtSemiLeptonicTensorAmp>();
             ;
             break;
         default:;
     }
 }
diff --git a/src/EvtGenModels/EvtISGW2FF.cpp b/src/EvtGenModels/EvtISGW2FF.cpp
index 5ced2a9..da0db1f 100644
--- a/src/EvtGenModels/EvtISGW2FF.cpp
+++ b/src/EvtGenModels/EvtISGW2FF.cpp
@@ -1,1795 +1,1795 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtISGW2FF.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <math.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
 void EvtISGW2FF::getscalarff( EvtId parent, EvtId daught, double t, double mass,
                               double* fpf, double* f0f )
 {
     //added by Lange Jan4,2000
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
-    static EvtId D3P0P = EvtPDL::getId( "D_0*+" );
-    static EvtId D3P0N = EvtPDL::getId( "D_0*-" );
-    static EvtId D3P00 = EvtPDL::getId( "D_0*0" );
-    static EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
+    static const EvtId D3P0P = EvtPDL::getId( "D_0*+" );
+    static const EvtId D3P0N = EvtPDL::getId( "D_0*-" );
+    static const EvtId D3P00 = EvtPDL::getId( "D_0*0" );
+    static const EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
 
-    static EvtId D21S0P = EvtPDL::getId( "D(2S)+" );
-    static EvtId D21S0N = EvtPDL::getId( "D(2S)-" );
-    static EvtId D21S00 = EvtPDL::getId( "D(2S)0" );
-    static EvtId D21S0B = EvtPDL::getId( "anti-D(2S)0" );
+    static const EvtId D21S0P = EvtPDL::getId( "D(2S)+" );
+    static const EvtId D21S0N = EvtPDL::getId( "D(2S)-" );
+    static const EvtId D21S00 = EvtPDL::getId( "D(2S)0" );
+    static const EvtId D21S0B = EvtPDL::getId( "anti-D(2S)0" );
 
-    static EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
+    static const EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
 
-    static EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
-    static EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
-    static EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
+    static const EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
+    static const EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
+    static const EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
 
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
 
-    static EvtId A0P = EvtPDL::getId( "a_0+" );
-    static EvtId A0M = EvtPDL::getId( "a_0-" );
-    static EvtId A00 = EvtPDL::getId( "a_00" );
+    static const EvtId A0P = EvtPDL::getId( "a_0+" );
+    static const EvtId A0M = EvtPDL::getId( "a_0-" );
+    static const EvtId A00 = EvtPDL::getId( "a_00" );
 
-    static EvtId F0 = EvtPDL::getId( "f_0" );
-    static EvtId F0PR = EvtPDL::getId( "f'_0" );
+    static const EvtId F0 = EvtPDL::getId( "f_0" );
+    static const EvtId F0PR = EvtPDL::getId( "f'_0" );
 
-    static EvtId ETA = EvtPDL::getId( "eta" );
-    static EvtId ETAPR = EvtPDL::getId( "eta'" );
+    static const EvtId ETA = EvtPDL::getId( "eta" );
+    static const EvtId ETAPR = EvtPDL::getId( "eta'" );
 
-    static EvtId KP = EvtPDL::getId( "K+" );
-    static EvtId KM = EvtPDL::getId( "K-" );
-    static EvtId K0 = EvtPDL::getId( "K0" );
-    static EvtId KB = EvtPDL::getId( "anti-K0" );
-    static EvtId K0S = EvtPDL::getId( "K_S0" );
-    static EvtId K0L = EvtPDL::getId( "K_L0" );
+    static const EvtId KP = EvtPDL::getId( "K+" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId K0 = EvtPDL::getId( "K0" );
+    static const EvtId KB = EvtPDL::getId( "anti-K0" );
+    static const EvtId K0S = EvtPDL::getId( "K_S0" );
+    static const EvtId K0L = EvtPDL::getId( "K_L0" );
 
-    static EvtId K0STP = EvtPDL::getId( "K_0*+" );
-    static EvtId K0STM = EvtPDL::getId( "K_0*-" );
-    static EvtId K0ST0 = EvtPDL::getId( "K_0*0" );
-    static EvtId K0STB = EvtPDL::getId( "anti-K_0*0" );
+    static const EvtId K0STP = EvtPDL::getId( "K_0*+" );
+    static const EvtId K0STM = EvtPDL::getId( "K_0*-" );
+    static const EvtId K0ST0 = EvtPDL::getId( "K_0*0" );
+    static const EvtId K0STB = EvtPDL::getId( "anti-K_0*0" );
 
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
 
-    static EvtId D3P0SP = EvtPDL::getId( "D_s0*+" );
-    static EvtId D3P0SN = EvtPDL::getId( "D_s0*-" );
+    static const EvtId D3P0SP = EvtPDL::getId( "D_s0*+" );
+    static const EvtId D3P0SN = EvtPDL::getId( "D_s0*-" );
 
     double fmf;
     double mb = EvtPDL::getMeanMass( parent );
 
     if ( daught == PI0 || daught == PIP || daught == PIM || daught == ETA ||
          daught == ETAPR || daught == D0 || daught == D0B || daught == DP ||
          daught == DM || daught == KP || daught == KM || daught == K0 ||
          daught == K0S || daught == K0L || daught == KB || daught == DSP ||
          daught == DSM ) {
         EvtISGW2FF1S0( parent, daught, t, mass, fpf, &fmf );
     }
 
     if ( daught == PI2S0 || daught == PI2SP || daught == PI2SM ||
          daught == ETA2S || daught == D21S0P || daught == D21S0B ||
          daught == D21S0N || daught == D21S00 ) {
         EvtISGW2FF21S0( parent, daught, t, mass, fpf, &fmf );
     }
 
     if ( daught == A00 || daught == A0P || daught == A0M || daught == F0 ||
          daught == F0PR || daught == D3P0P || daught == D3P00 ||
          daught == D3P0B || daught == D3P0N || daught == K0STM ||
          daught == K0STB || daught == K0STP || daught == D3P0SP ||
          daught == D3P0SN || daught == K0ST0 ) {
         EvtISGW2FF3P0( parent, daught, t, mass, fpf, &fmf );
     }
 
     *f0f = ( fmf / ( ( mb * mb - mass * mass ) / t ) ) + ( *fpf );
 
     return;
 }
 
 void EvtISGW2FF::gettensorff( EvtId parent, EvtId daught, double t, double mass,
                               double* hf, double* kf, double* bpf, double* bmf )
 {
     //added by Lange Jan4,2000
     EvtISGW2FF3P2( parent, daught, t, mass, hf, kf, bpf, bmf );
 
     return;
 }
 
 void EvtISGW2FF::getvectorff( EvtId parent, EvtId daught, double t, double mass,
                               double* a1f, double* a2f, double* vf, double* a0f )
 {
     double ff, gf, apf, amf;
 
     //added by Lange Jan4,2000
 
-    static EvtId DST0 = EvtPDL::getId( "D*0" );
-    static EvtId DSTB = EvtPDL::getId( "anti-D*0" );
-    static EvtId DSTP = EvtPDL::getId( "D*+" );
-    static EvtId DSTM = EvtPDL::getId( "D*-" );
+    static const EvtId DST0 = EvtPDL::getId( "D*0" );
+    static const EvtId DSTB = EvtPDL::getId( "anti-D*0" );
+    static const EvtId DSTP = EvtPDL::getId( "D*+" );
+    static const EvtId DSTM = EvtPDL::getId( "D*-" );
 
-    static EvtId D1P1P = EvtPDL::getId( "D_1+" );
-    static EvtId D1P1N = EvtPDL::getId( "D_1-" );
-    static EvtId D1P10 = EvtPDL::getId( "D_10" );
-    static EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
+    static const EvtId D1P1P = EvtPDL::getId( "D_1+" );
+    static const EvtId D1P1N = EvtPDL::getId( "D_1-" );
+    static const EvtId D1P10 = EvtPDL::getId( "D_10" );
+    static const EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
 
-    static EvtId D3P1P = EvtPDL::getId( "D'_1+" );
-    static EvtId D3P1N = EvtPDL::getId( "D'_1-" );
-    static EvtId D3P10 = EvtPDL::getId( "D'_10" );
-    static EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
+    static const EvtId D3P1P = EvtPDL::getId( "D'_1+" );
+    static const EvtId D3P1N = EvtPDL::getId( "D'_1-" );
+    static const EvtId D3P10 = EvtPDL::getId( "D'_10" );
+    static const EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
 
-    static EvtId D23S1P = EvtPDL::getId( "D*(2S)+" );
-    static EvtId D23S1N = EvtPDL::getId( "D*(2S)-" );
-    static EvtId D23S10 = EvtPDL::getId( "D*(2S)0" );
-    static EvtId D23S1B = EvtPDL::getId( "anti-D*(2S)0" );
+    static const EvtId D23S1P = EvtPDL::getId( "D*(2S)+" );
+    static const EvtId D23S1N = EvtPDL::getId( "D*(2S)-" );
+    static const EvtId D23S10 = EvtPDL::getId( "D*(2S)0" );
+    static const EvtId D23S1B = EvtPDL::getId( "anti-D*(2S)0" );
 
-    static EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
-    static EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
-    static EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
-    static EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
+    static const EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
+    static const EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
+    static const EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
+    static const EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
 
-    static EvtId RHOP = EvtPDL::getId( "rho+" );
-    static EvtId RHOM = EvtPDL::getId( "rho-" );
-    static EvtId RHO0 = EvtPDL::getId( "rho0" );
+    static const EvtId RHOP = EvtPDL::getId( "rho+" );
+    static const EvtId RHOM = EvtPDL::getId( "rho-" );
+    static const EvtId RHO0 = EvtPDL::getId( "rho0" );
 
-    static EvtId A1P = EvtPDL::getId( "a_1+" );
-    static EvtId A1M = EvtPDL::getId( "a_1-" );
-    static EvtId A10 = EvtPDL::getId( "a_10" );
+    static const EvtId A1P = EvtPDL::getId( "a_1+" );
+    static const EvtId A1M = EvtPDL::getId( "a_1-" );
+    static const EvtId A10 = EvtPDL::getId( "a_10" );
 
-    static EvtId B1P = EvtPDL::getId( "b_1+" );
-    static EvtId B1M = EvtPDL::getId( "b_1-" );
-    static EvtId B10 = EvtPDL::getId( "b_10" );
+    static const EvtId B1P = EvtPDL::getId( "b_1+" );
+    static const EvtId B1M = EvtPDL::getId( "b_1-" );
+    static const EvtId B10 = EvtPDL::getId( "b_10" );
 
-    static EvtId H1 = EvtPDL::getId( "h_1" );
-    static EvtId H1PR = EvtPDL::getId( "h'_1" );
+    static const EvtId H1 = EvtPDL::getId( "h_1" );
+    static const EvtId H1PR = EvtPDL::getId( "h'_1" );
 
-    static EvtId F1 = EvtPDL::getId( "f_1" );
-    static EvtId F1PR = EvtPDL::getId( "f'_1" );
+    static const EvtId F1 = EvtPDL::getId( "f_1" );
+    static const EvtId F1PR = EvtPDL::getId( "f'_1" );
 
-    static EvtId OMEG = EvtPDL::getId( "omega" );
-    static EvtId KSTP = EvtPDL::getId( "K*+" );
-    static EvtId KSTM = EvtPDL::getId( "K*-" );
-    static EvtId KST0 = EvtPDL::getId( "K*0" );
-    static EvtId KSTB = EvtPDL::getId( "anti-K*0" );
+    static const EvtId OMEG = EvtPDL::getId( "omega" );
+    static const EvtId KSTP = EvtPDL::getId( "K*+" );
+    static const EvtId KSTM = EvtPDL::getId( "K*-" );
+    static const EvtId KST0 = EvtPDL::getId( "K*0" );
+    static const EvtId KSTB = EvtPDL::getId( "anti-K*0" );
 
-    static EvtId K1P = EvtPDL::getId( "K_1+" );
-    static EvtId K1M = EvtPDL::getId( "K_1-" );
-    static EvtId K10 = EvtPDL::getId( "K_10" );
-    static EvtId K1B = EvtPDL::getId( "anti-K_10" );
+    static const EvtId K1P = EvtPDL::getId( "K_1+" );
+    static const EvtId K1M = EvtPDL::getId( "K_1-" );
+    static const EvtId K10 = EvtPDL::getId( "K_10" );
+    static const EvtId K1B = EvtPDL::getId( "anti-K_10" );
 
-    static EvtId K1STP = EvtPDL::getId( "K'_1+" );
-    static EvtId K1STM = EvtPDL::getId( "K'_1-" );
-    static EvtId K1ST0 = EvtPDL::getId( "K'_10" );
-    static EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
+    static const EvtId K1STP = EvtPDL::getId( "K'_1+" );
+    static const EvtId K1STM = EvtPDL::getId( "K'_1-" );
+    static const EvtId K1ST0 = EvtPDL::getId( "K'_10" );
+    static const EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
 
-    static EvtId PHI = EvtPDL::getId( "phi" );
+    static const EvtId PHI = EvtPDL::getId( "phi" );
 
-    static EvtId D1P1SP = EvtPDL::getId( "D_s1+" );
-    static EvtId D1P1SN = EvtPDL::getId( "D_s1-" );
+    static const EvtId D1P1SP = EvtPDL::getId( "D_s1+" );
+    static const EvtId D1P1SN = EvtPDL::getId( "D_s1-" );
 
-    static EvtId D3P1SP = EvtPDL::getId( "D'_s1+" );
-    static EvtId D3P1SN = EvtPDL::getId( "D'_s1-" );
+    static const EvtId D3P1SP = EvtPDL::getId( "D'_s1+" );
+    static const EvtId D3P1SN = EvtPDL::getId( "D'_s1-" );
 
-    static EvtId DSSTP = EvtPDL::getId( "D_s*+" );
-    static EvtId DSSTM = EvtPDL::getId( "D_s*-" );
+    static const EvtId DSSTP = EvtPDL::getId( "D_s*+" );
+    static const EvtId DSSTM = EvtPDL::getId( "D_s*-" );
 
     if ( daught == DST0 || daught == DSTP || daught == DSTM || daught == DSTB ||
          daught == OMEG || daught == RHO0 || daught == RHOM || daught == RHOP ||
          daught == KSTP || daught == KSTM || daught == KST0 || daught == KSTB ||
          daught == PHI || daught == DSSTP || daught == DSSTM ) {
         EvtISGW2FF3S1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
     }
     if ( daught == B10 || daught == B1P || daught == B1M || daught == H1 ||
          daught == H1PR || daught == D1P1P || daught == D1P10 || daught == D1P1B ||
          daught == D1P1SP || daught == D1P1SN || daught == D1P1N ||
          daught == K10 || daught == K1B || daught == K1P || daught == K1M ) {
         EvtISGW2FF1P1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
     }
     if ( daught == RHO2S0 || daught == RHO2SP || daught == RHO2SM ||
          daught == OMEG2S || daught == D23S1P || daught == D23S1B ||
          daught == D23S1N || daught == D23S10 ) {
         EvtISGW2FF23S1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
     }
     if ( daught == A10 || daught == A1P || daught == A1M || daught == F1 ||
          daught == F1PR || daught == D3P1P || daught == D3P10 ||
          daught == D3P1B || daught == D3P1N || daught == K1STM ||
          daught == K1STB || daught == K1STP || daught == D3P1SP ||
          daught == D3P1SN || daught == K1ST0 ) {
         EvtISGW2FF3P1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
     }
 
     // Need to stuff in some factors to make these the ffs that
     // is used elsewhere...
 
     double mb = EvtPDL::getMeanMass( parent );
 
     *vf = ( gf ) * ( mb + mass );
     *a1f = ( ff ) / ( mb + mass );
     *a2f = -1.0 * ( apf ) * ( mb + mass );
 
     double a3f = ( ( mb + mass ) / ( 2.0 * mass ) ) * ( *a1f ) -
                  ( ( mb - mass ) / ( 2.0 * mass ) ) * ( *a2f );
 
     *a0f = a3f + ( ( t * amf ) / ( 2.0 * mass ) );
 
     return;
 }
 
 void EvtISGW2FF::EvtISGW2FF1S0( EvtId parent, EvtId daugt, double t,
                                 double mass, double* fpf, double* fmf )
 {
     double mtb, mbb( 0.0 );
     double msd( 0.0 ), mx, mb, nf( 0.0 ), nfp( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
     double zji, cji, gammaji, chiji, betaji_fppfm;
     double rfppfm, rfpmfm, f3fppfm, f3fpmfm, fppfm, fpmfm, ai, f3;
     double mqm, msb( 0.0 ), bb2( 0.0 ), mup, bbx2, tm, r2, betaji_fpmfm;
 
     EvtId prnt = parent;
     EvtId dgt = daugt;
 
     //added by Lange Jan4,2000
-    static EvtIdSet theB{ "B+", "B-", "B0", "anti-B0" };
+    static const EvtIdSet theB{ "B+", "B-", "B0", "anti-B0" };
 
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
 
-    static EvtId ETA = EvtPDL::getId( "eta" );
-    static EvtId ETAPR = EvtPDL::getId( "eta'" );
+    static const EvtId ETA = EvtPDL::getId( "eta" );
+    static const EvtId ETAPR = EvtPDL::getId( "eta'" );
 
-    static EvtId KP = EvtPDL::getId( "K+" );
-    static EvtId KM = EvtPDL::getId( "K-" );
-    static EvtId K0 = EvtPDL::getId( "K0" );
-    static EvtId KB = EvtPDL::getId( "anti-K0" );
-    static EvtId K0S = EvtPDL::getId( "K_S0" );
-    static EvtId K0L = EvtPDL::getId( "K_L0" );
+    static const EvtId KP = EvtPDL::getId( "K+" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId K0 = EvtPDL::getId( "K0" );
+    static const EvtId KB = EvtPDL::getId( "anti-K0" );
+    static const EvtId K0S = EvtPDL::getId( "K_S0" );
+    static const EvtId K0L = EvtPDL::getId( "K_L0" );
 
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
 
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
 
     if ( theB.contains( prnt ) ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.431 * 0.431;
         mbb = 5.31;
         nf = 4.0;
 
         if ( dgt == PI0 || dgt == PIP || dgt == PIM || dgt == ETA ||
              dgt == ETAPR ) {
             msq = 0.33;
             bx2 = 0.406 * 0.406;
             mbx = 0.75 * 0.770 + 0.25 * 0.14;
             nfp = 0.0;
         } else {
             if ( dgt == D0 || dgt == D0B || dgt == DP || dgt == DM ) {
                 msq = 1.82;
                 bx2 = 0.45 * 0.45;
                 mbx = 0.75 * 2.01 + 0.25 * 1.87;
                 nfp = 3.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt:" << daugt.getId()
                     << " in get_isgw_ff_1S0.\n";
             }
         }
     } else {
         if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
             msb = 1.82;
             msd = 0.33;
             bb2 = 0.45 * 0.45;
             mbb = 1.963;
             nf = 3.0;
 
             if ( dgt == PIP || dgt == PIM || dgt == PI0 || dgt == ETA ||
                  dgt == ETAPR ) {
                 msq = 0.33;
                 bx2 = 0.406 * 0.406;
                 mbx = 0.75 * 0.770 + 0.25 * 0.14;
                 nfp = 0.0;
             } else {
                 if ( dgt == K0 || dgt == K0S || dgt == K0L || dgt == KB ||
                      dgt == KP || dgt == KM ) {
                     msq = 0.55;
                     bx2 = 0.44 * 0.44;
                     mbx = 0.75 * 0.892 + 0.25 * 0.49767;
                     nfp = 2.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt:" << daugt.getId()
                         << " in get_isgw_ff_1S0.\n";
                 }
             }
         } else {
             if ( prnt == DSP || prnt == DSM ) {
                 msb = 1.82;
                 msd = 0.55;
                 bb2 = 0.56 * 0.56;
                 mbb = 1.968;
                 nf = 3.0;
 
                 if ( dgt == K0 || dgt == K0S || dgt == K0L || dgt == KB ) {
                     msq = 0.33;
                     bx2 = 0.44 * 0.44;
                     mbx = 0.75 * 0.770 + 0.25 * 0.14;
                     nfp = 0.0;
                 } else {
                     if ( dgt == PI0 || dgt == ETA || dgt == ETAPR ) {
                         msq = 0.33;
                         bx2 = 0.53 * 0.53;
                         mbx = 0.75 * 0.892 + 0.25 * 0.49767;
                         nfp = 0.0;
                     } else {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Not implemented daugt:" << daugt.getId()
                             << " in get_isgw_ff_1S0.\n";
                     }
                 }
             } else {
                 //BS -> cs constants added by djl on Jan. 21,1998
                 if ( prnt == BS0 || prnt == BSB ) {
                     msb = 5.2;
                     msd = 0.55;
                     bb2 = 0.54 * 0.54;
                     mbb = 5.38;
                     nf = 4.0;
 
                     if ( dgt == DSP || dgt == DSM ) {
                         msq = 1.82;
                         bx2 = 0.56 * 0.56;
                         mbx = 0.75 * 2.11 + 0.25 * 1.97;
                         nfp = 3.0;
                     } else if ( dgt == KP || dgt == KM ) {
                         msq = 0.55;
                         bx2 = 0.44 * 0.44;
                         mbx = 0.75 * 0.892 + 0.25 * 0.49767;
                         nfp = 2.0;
                     } else {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Not implemented daugt:" << daugt.getId()
                             << " in get_isgw_ff_1S0.\n";
                     }
                 }
 
                 else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented parent in get_isgw_ff_1S0.\n";
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Parent:" << parent.getId() << endl;
                 }
             }
         }
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     mqm = 0.1;
     r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
          ( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
              log( EvtGetas( mqm, mqm ) / EvtGetas( msq, msq ) );
 
     f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 1.5 ) /
          ( ( 1.0 + r2 * ( tm - t ) / 12.0 ) * ( 1.0 + r2 * ( tm - t ) / 12.0 ) );
 
     //  for w use wt def with physical masses.
     //  EvtGenReport(EVTGEN_ERROR,"EvtGen") << "before w\n";
 
     ai = -1.0 * ( 6.0 / ( 33.0 - 2.0 * nf ) );
     cji = pow( ( EvtGetas( msb, msb ) / EvtGetas( msq, msq ) ), ai );
 
     zji = msq / msb;
 
     gammaji = EvtGetGammaji( zji );
     chiji = -1.0 - ( gammaji / ( 1 - zji ) );
     betaji_fppfm = gammaji - ( 2.0 / 3.0 ) * chiji;
     betaji_fpmfm = gammaji + ( 2.0 / 3.0 ) * chiji;
     rfppfm = cji * ( 1.0 + betaji_fppfm * EvtGetas( msq, sqrt( msb * msq ) ) /
                                EvtConst::pi );
     rfpmfm = cji * ( 1.0 + betaji_fpmfm * EvtGetas( msq, sqrt( msb * msq ) ) /
                                EvtConst::pi );
     f3fppfm = f3 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), 0.5 );
     f3fpmfm = f3 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), -0.5 );
     fppfm = f3fppfm * rfppfm *
             ( 2.0 - ( ( mtx / msq ) * ( 1 - ( ( msd * msq * bb2 ) /
                                               ( 2.0 * mup * mtx * bbx2 ) ) ) ) );
     fpmfm = f3fpmfm * rfpmfm * ( mtb / msq ) *
             ( 1 - ( ( msd * msq * bb2 ) / ( 2.0 * mup * mtx * bbx2 ) ) );
 
     *fpf = ( fppfm + fpmfm ) / 2.0;
     *fmf = ( fppfm - fpmfm ) / 2.0;
 
     return;
 }    //get_ff_isgw_1s0
 
 void EvtISGW2FF::EvtISGW2FF3S1( EvtId parent, EvtId daugt, double t, double mass,
                                 double* f, double* g, double* ap, double* am )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
-
-    static EvtId DST0 = EvtPDL::getId( "D*0" );
-    static EvtId DSTB = EvtPDL::getId( "anti-D*0" );
-    static EvtId DSTP = EvtPDL::getId( "D*+" );
-    static EvtId DSTM = EvtPDL::getId( "D*-" );
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
-
-    static EvtId RHOP = EvtPDL::getId( "rho+" );
-    static EvtId RHOM = EvtPDL::getId( "rho-" );
-    static EvtId RHO0 = EvtPDL::getId( "rho0" );
-    static EvtId OMEG = EvtPDL::getId( "omega" );
-
-    static EvtId KSTP = EvtPDL::getId( "K*+" );
-    static EvtId KSTM = EvtPDL::getId( "K*-" );
-    static EvtId KST0 = EvtPDL::getId( "K*0" );
-    static EvtId KSTB = EvtPDL::getId( "anti-K*0" );
-
-    static EvtId PHI = EvtPDL::getId( "phi" );
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
-
-    static EvtId DSSTP = EvtPDL::getId( "D_s*+" );
-    static EvtId DSSTM = EvtPDL::getId( "D_s*-" );
-
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+
+    static const EvtId DST0 = EvtPDL::getId( "D*0" );
+    static const EvtId DSTB = EvtPDL::getId( "anti-D*0" );
+    static const EvtId DSTP = EvtPDL::getId( "D*+" );
+    static const EvtId DSTM = EvtPDL::getId( "D*-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
+
+    static const EvtId RHOP = EvtPDL::getId( "rho+" );
+    static const EvtId RHOM = EvtPDL::getId( "rho-" );
+    static const EvtId RHO0 = EvtPDL::getId( "rho0" );
+    static const EvtId OMEG = EvtPDL::getId( "omega" );
+
+    static const EvtId KSTP = EvtPDL::getId( "K*+" );
+    static const EvtId KSTM = EvtPDL::getId( "K*-" );
+    static const EvtId KST0 = EvtPDL::getId( "K*0" );
+    static const EvtId KSTB = EvtPDL::getId( "anti-K*0" );
+
+    static const EvtId PHI = EvtPDL::getId( "phi" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
+
+    static const EvtId DSSTP = EvtPDL::getId( "D_s*+" );
+    static const EvtId DSSTM = EvtPDL::getId( "D_s*-" );
+
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
 
     double cf( 0.0 ), mtb, wt, msd( 0.0 ), mup, f3f, msq( 0.0 ), bb2( 0.0 ),
         mum, mtx, bbx2, f3g;
     double cji, bx2( 0.0 ), f3appam, msb( 0.0 ), tm, mbb( 0.0 ), mbx( 0.0 );
     double f3apmam, appam, apmam, mb, mx, f3;
     double r_f, r_g, r_apmam, betaji_f, betaji_g;
     double betaji_appam, betaji_apmam;
     double mqm, r2, chiji, zji, ai, nf( 0.0 ), nfp( 0.0 ), gammaji;
 
     EvtId prnt = parent;
     EvtId dgt = daugt;
 
     if ( parent == B0 || parent == B0B || parent == BP || parent == BM ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.431 * 0.431;
         mbb = 5.31;
         nf = 4.0;
 
         if ( dgt == DST0 || dgt == DSTP || dgt == DSTM || dgt == DSTB ) {
             cf = 0.989;
             msq = 1.82;
             bx2 = 0.38 * 0.38;
             mbx = 0.75 * 2.01 + 0.25 * 1.87;
             nfp = 3.0;
         } else {
             if ( dgt == OMEG || dgt == RHO0 || dgt == RHOM || dgt == RHOP ) {
                 cf = 0.905;
                 msq = 0.33;
                 bx2 = 0.299 * 0.299;
                 mbx = 0.75 * 0.770 + 0.25 * 0.14;
                 nfp = 0.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt:" << daugt.getId()
                     << " in get_isgw_ff_3S1.\n";
             }
         }
     } else {
         if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
             msb = 1.82;
             msd = 0.33;
             bb2 = 0.45 * 0.45;
             mbb = 1.963;
             nf = 3.0;
 
             if ( dgt == KSTP || dgt == KSTM || dgt == KST0 || dgt == KSTB ) {
                 cf = 0.928;
                 msq = 0.55;
                 bx2 = 0.33 * 0.33;
                 mbx = 0.75 * 0.892 + 0.25 * 0.494;
                 nfp = 2.0;
             } else {
                 if ( dgt == RHO0 || dgt == OMEG || dgt == RHOM || dgt == RHOP ) {
                     cf = 0.889;
                     msq = 0.33;
                     bx2 = 0.299 * 0.299;
                     mbx = 0.75 * 0.770 + 0.25 * 0.14;
                     nfp = 0.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt:" << daugt.getId()
                         << " in get_isgw_ff_3S1.\n";
                 }
             }
         } else {
             if ( prnt == DSP || prnt == DSM ) {
                 msb = 1.82;
                 msd = 0.55;
                 bb2 = 0.56 * 0.56;
                 mbb = 1.968;
                 nf = 3.0;
 
                 if ( dgt == KSTB || dgt == KST0 ) {
                     cf = 0.8731;
                     msq = 0.55;
                     bx2 = 0.33 * 0.33;
                     mbx = 0.87;
                     nfp = 2.0;
                 } else {
                     if ( dgt == PHI ) {
                         cf = 0.911;
                         msq = 0.55;
                         bx2 = 0.37 * 0.37;
                         mbx = 0.97;
                         nfp = 2.0;
                     } else {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Not implemented daugt:" << daugt.getId()
                             << " in get_isgw_ff_3S1.\n";
                     }
                 }
             } else {
                 //BS -> cs constants added by djl on Jan. 21,1998
                 if ( prnt == BS0 || prnt == BSB ) {
                     msb = 5.2;
                     msd = 0.55;
                     bb2 = 0.54 * 0.54;
                     mbb = 5.38;
                     nf = 4.0;
 
                     if ( dgt == DSSTP || dgt == DSSTM ) {
                         cf = 0.984;
                         msq = 1.82;
                         bx2 = 0.49 * 0.49;
                         mbx = 0.75 * 2.11 + 0.25 * 1.97;
                         nfp = 3.0;
                     } else if ( dgt == KSTP || dgt == KSTM || dgt == KST0 ||
                                 dgt == KSTB ) {
                         cf = 0.928;
                         msq = 0.55;
                         bx2 = 0.33 * 0.33;
                         mbx = 0.75 * 0.892 + 0.25 * 0.494;
                         nfp = 2.0;
                     } else {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Not implemented daugt:" << daugt.getId()
                             << " in get_isgw_ff_1S0.\n";
                     }
                 }
 
                 else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented parent in get_isgw2_ff_3S1.\n";
                 }
             }
         }
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
     mqm = 0.1;
 
     r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
          ( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
              log( EvtGetas( mqm, mqm ) / EvtGetas( msq, msq ) );
 
     ai = -1.0 * ( 6.0 / ( 33.0 - 2.0 * nf ) );
 
     cji = pow( ( EvtGetas( msb, msb ) / EvtGetas( msq, msq ) ), ai );
     zji = msq / msb;
 
     gammaji = EvtGetGammaji( zji );
 
     chiji = -1.0 - ( gammaji / ( 1 - zji ) );
 
     betaji_g = ( 2.0 / 3.0 ) + gammaji;
     betaji_f = ( -2.0 / 3.0 ) + gammaji;
     betaji_appam = -1.0 - chiji + ( 4.0 / ( 3.0 * ( 1.0 - zji ) ) ) +
                    ( 2.0 * ( 1 + zji ) * gammaji /
                      ( 3.0 * ( 1.0 - zji ) * ( 1.0 - zji ) ) );
 
     betaji_apmam = ( 1.0 / 3.0 ) - chiji - ( 4.0 / ( 3.0 * ( 1.0 - zji ) ) ) -
                    ( 2.0 * ( 1 + zji ) * gammaji /
                      ( 3.0 * ( 1.0 - zji ) * ( 1.0 - zji ) ) ) +
                    gammaji;
 
     r_g = cji * ( 1 + ( betaji_g * EvtGetas( msq, sqrt( mb * msq ) ) /
                         ( EvtConst::pi ) ) );
     r_f = cji * ( 1 + ( betaji_f * EvtGetas( msq, sqrt( mb * msq ) ) /
                         ( EvtConst::pi ) ) );
     r_apmam = cji * ( 1 + ( betaji_apmam * EvtGetas( msq, sqrt( mb * msq ) ) /
                             ( EvtConst::pi ) ) );
 
     f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 1.5 ) /
          ( ( 1.0 + r2 * ( tm - t ) / 12.0 ) * ( 1.0 + r2 * ( tm - t ) / 12.0 ) );
 
     f3f = sqrt( mbx * mbb / ( mtx * mtb ) ) * f3;
     f3g = sqrt( mtx * mtb / ( mbx * mbb ) ) * f3;
     f3appam = sqrt( mtb * mtb * mtb * mbx / ( mbb * mbb * mbb * mtx ) ) * f3;
     f3apmam = sqrt( mtx * mtb / ( mbx * mbb ) ) * f3;
     *f = cf * mtb * ( 1 + wt + msd * ( wt - 1 ) / ( 2 * mup ) ) * f3f * r_f;
     *g = 0.5 * ( 1 / msq - msd * bb2 / ( 2 * mum * mtx * bbx2 ) ) * f3g * r_g;
 
     appam = cji *
             ( msd * bx2 * ( 1 - msd * bx2 / ( 2 * mtb * bbx2 ) ) /
                   ( ( 1 + wt ) * msq * msb * bbx2 ) -
               betaji_appam * EvtGetas( msq, sqrt( msq * mb ) ) /
                   ( mtb * EvtConst::pi ) ) *
             f3appam;
 
     apmam = -1.0 *
             ( mtb / msb - msd * bx2 / ( 2 * mup * bbx2 ) +
               wt * msd * mtb * bx2 * ( 1 - msd * bx2 / ( 2 * mtb * bbx2 ) ) /
                   ( ( wt + 1 ) * msq * msb * bbx2 ) ) *
             f3apmam * r_apmam / mtx;
 
     *ap = 0.5 * ( appam + apmam );
     *am = 0.5 * ( appam - apmam );
     return;
 }
 
 void EvtISGW2FF::EvtISGW2FF21S0( EvtId parent, EvtId daugt, double t,
                                  double mass, double* fppf, double* fpmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
-    static EvtId D21S0P = EvtPDL::getId( "D(2S)+" );
-    static EvtId D21S0N = EvtPDL::getId( "D(2S)-" );
-    static EvtId D21S00 = EvtPDL::getId( "D(2S)0" );
-    static EvtId D21S0B = EvtPDL::getId( "anti-D(2S)0" );
+    static const EvtId D21S0P = EvtPDL::getId( "D(2S)+" );
+    static const EvtId D21S0N = EvtPDL::getId( "D(2S)-" );
+    static const EvtId D21S00 = EvtPDL::getId( "D(2S)0" );
+    static const EvtId D21S0B = EvtPDL::getId( "anti-D(2S)0" );
 
-    static EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
+    static const EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
 
-    static EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
-    static EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
-    static EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
+    static const EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
+    static const EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
+    static const EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
 
     double mtb, mbb( 0.0 );
     double msd( 0.0 ), mx, mb, nfp( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
     double f3fppfm, f3fpmfm, fppfm, fpmfm, f3;
     double mqm, msb( 0.0 );
     double r2, wt, tm, bb2( 0.0 ), bbx2;
     double tau, udef, vdef;
 
     EvtId prnt = parent;
     EvtId dgt = daugt;
 
     if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.431 * 0.431;
         mbb = 0.75 * 5.325 + 0.25 * 5.279;
 
         if ( dgt == PI2S0 || dgt == PI2SP || dgt == PI2SM || dgt == ETA2S ) {
             msq = 0.33;
             bx2 = 0.406 * 0.406;
             mbx = 0.75 * 1.45 + 0.25 * 1.300;
             nfp = 0.0;
         } else {
             if ( dgt == D21S0P || dgt == D21S0B || dgt == D21S0N ||
                  dgt == D21S00 ) {
                 msq = 1.82;
                 bx2 = 0.45 * 0.45;
                 mbx = 0.75 * 2.64 + 0.25 * 2.58;
                 nfp = 3.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_EvtISGW2_ff_21S0.\n";
             }
         }
     } else {
         if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
             msb = 1.82;
             msd = 0.33;
             bb2 = 0.45 * 0.45;
             mbb = 1.963;
             if ( dgt == PI2SP || dgt == PI2SM || dgt == PI2S0 || dgt == ETA2S ) {
                 msq = 0.33;
                 bx2 = 0.406 * 0.406;
                 mbx = 0.75 * 1.45 + 0.25 * 1.300;
                 nfp = 0.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_EvtISGW2_ff_21S0.\n";
             }
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Not implemented parent in get_EvtISGW2_ff_21S0.\n";
         }
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
     wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
 
     mqm = 0.1;
     r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
          ( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
              log( EvtGetas( mqm ) / EvtGetas( msq ) );
 
     f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 3.0 / 2.0 ) /
          ( pow( ( 1.0 + r2 * ( tm - t ) / 24.0 ), 4.0 ) );
 
     f3fppfm = f3 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), 0.5 );
     f3fpmfm = f3 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), -0.5 );
 
     tau = msd * msd * bx2 * ( wt - 1 ) / ( bb2 * bbx2 );
     udef = ( ( bb2 - bx2 ) / ( 2.0 * bbx2 ) ) +
            ( ( bb2 * tau ) / ( 3.0 * bbx2 ) );
     vdef = ( bb2 * ( 1.0 + ( msq / msb ) ) / ( 6.0 * bbx2 ) ) *
            ( 7.0 - ( ( bb2 / bbx2 ) * ( 5 + tau ) ) );
 
     fppfm = f3fppfm * sqrt( 1.5 ) *
             ( ( 1.0 - ( msd / msq ) ) * udef - ( msd * vdef / msq ) );
     fpmfm = f3fpmfm * sqrt( 1.5 ) * ( mtb / msq ) *
             ( udef + ( msd * vdef / mtx ) );
 
     *fppf = ( fppfm + fpmfm ) / 2.0;
     *fpmf = ( fppfm - fpmfm ) / 2.0;
     return;
 
 }    //get_ff_isgw_21s0
 
 void EvtISGW2FF::EvtISGW2FF23S1( EvtId parent, EvtId daugt, double t,
                                  double mass, double* fpf, double* gpf,
                                  double* appf, double* apmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
-
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
-
-    static EvtId D23S1P = EvtPDL::getId( "D*(2S)+" );
-    static EvtId D23S1N = EvtPDL::getId( "D*(2S)-" );
-    static EvtId D23S10 = EvtPDL::getId( "D*(2S)0" );
-    static EvtId D23S1B = EvtPDL::getId( "anti-D*(2S)0" );
-
-    static EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
-    static EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
-    static EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
-    static EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
+
+    static const EvtId D23S1P = EvtPDL::getId( "D*(2S)+" );
+    static const EvtId D23S1N = EvtPDL::getId( "D*(2S)-" );
+    static const EvtId D23S10 = EvtPDL::getId( "D*(2S)0" );
+    static const EvtId D23S1B = EvtPDL::getId( "anti-D*(2S)0" );
+
+    static const EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
+    static const EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
+    static const EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
+    static const EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
 
     double mtb, mbb( 0.0 );
     double msd( 0.0 ), mx, mb, nfp( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
     double f3appam, f3apmam, f3, appam, apmam, f3fp, f3gp;
     double udef, tau, mum, bb2( 0.0 ), bbx2, tm, wt, mqm, r2, msb( 0.0 );
     double cfp( 0.0 );
 
     EvtId prnt = parent;
     EvtId dgt = daugt;
 
     if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.431 * 0.431;
         mbb = 0.75 * 5.325 + 0.25 * 5.279;
 
         if ( dgt == RHO2S0 || dgt == RHO2SP || dgt == RHO2SM || dgt == OMEG2S ) {
             cfp = 0.776;
             msq = 0.33;
             bx2 = 0.299 * 0.299;
             mbx = 0.75 * 1.45 + 0.25 * 1.300;
             nfp = 0.0;
 
         } else {
             if ( dgt == D23S1N || dgt == D23S1P || dgt == D23S1B ||
                  dgt == D23S10 ) {
                 cfp = 0.929;
                 msq = 1.82;
                 bx2 = 0.38 * 0.38;
                 mbx = 0.75 * 2.64 + 0.25 * 2.58;
                 nfp = 3.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_23P1.\n";
             }
         }
     } else {
         if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
             msb = 1.82;
             msd = 0.33;
             bb2 = 0.45 * 0.45;
             mbb = 1.963;
 
             if ( dgt == RHO2S0 || dgt == RHO2SP || dgt == RHO2SM ||
                  dgt == OMEG2S ) {
                 cfp = 0.74;
                 msq = 0.33;
                 bx2 = 0.299 * 0.299;
                 mbx = 0.75 * 1.45 + 0.25 * 1.300;
                 nfp = 0.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_23P1.\n";
             }
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Not implemented parent in get_isgw_ff_23P1.\n";
         }
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
 
     if ( t > tm )
         t = 0.99 * tm;
     wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
 
     mqm = 0.1;
     r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
          ( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
              log( EvtGetas( mqm ) / EvtGetas( msq ) );
 
     f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 3.0 / 2.0 ) /
          ( pow( ( 1.0 + r2 * ( tm - t ) / 24.0 ), 4.0 ) );
 
     f3fp = f3 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), 0.5 );
     f3gp = f3 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
     f3appam = f3 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), 0.5 );
     f3apmam = f3 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
 
     tau = msd * msd * bx2 * ( wt - 1.0 ) / ( bb2 * bbx2 );
     udef = ( ( bb2 - bx2 ) / ( 2.0 * bbx2 ) );
     udef = udef + ( ( bb2 * tau ) / ( 3.0 * bbx2 ) );
 
     *fpf = cfp * sqrt( 1.5 ) * mtb * ( 1.0 + wt ) * udef * f3fp;
 
     *gpf = sqrt( 3.0 / 8.0 ) * f3gp *
            ( ( ( 1.0 / msq ) - ( ( msd * bb2 ) / ( 2.0 * mum * mtx * bbx2 ) ) ) *
                  udef +
              ( ( msd * bb2 * bx2 ) / ( 3.0 * mum * mtx * bbx2 * bbx2 ) ) );
 
     appam = f3appam * sqrt( 2.0 / 3.0 ) * ( bb2 / ( msq * msb * bbx2 ) ) *
             ( ( -7.0 * msd * msd * bx2 * bx2 * ( 1.0 + ( tau / 7.0 ) ) /
                 ( 8.0 * mtb * bbx2 * bbx2 ) ) +
               ( 5.0 * msd * bx2 * ( 1.0 + ( tau / 5.0 ) ) / ( 4.0 * bbx2 ) ) +
               ( 3.0 * msd * msd * bx2 * bx2 / ( 8.0 * mtb * bb2 * bbx2 ) ) -
               ( 3.0 * msd * bx2 / ( 4.0 * bb2 ) ) );
 
     apmam =
         f3apmam * sqrt( 3.0 / 2.0 ) * ( mtb / ( msb * mtx ) ) *
         ( 1.0 - ( bb2 * ( 1.0 + ( tau / 7.0 ) ) / bbx2 ) -
           ( msd * bx2 *
             ( 1.0 - ( 5.0 * bb2 * ( 1.0 + ( tau / 5.0 ) ) / ( 3.0 * bbx2 ) ) ) /
             ( 2.0 * mtb * bbx2 ) ) -
           ( 7.0 * msd * msd * bb2 * bx2 / ( 12.0 * msq * mtb * bbx2 * bbx2 ) ) *
               ( 1.0 - ( bx2 / bbx2 ) + ( bb2 * tau / ( 7.0 * bbx2 ) ) ) );
 
     *appf = ( appam + apmam ) / 2.0;
     *apmf = ( appam - apmam ) / 2.0;
     return;
 }    //get_ff_isgw_23s1
 
 void EvtISGW2FF::EvtISGW2FF1P1( EvtId parent, EvtId daugt, double t, double mass,
                                 double* rf, double* vf, double* spf, double* smf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
-    static EvtId D1P1P = EvtPDL::getId( "D_1+" );
-    static EvtId D1P1N = EvtPDL::getId( "D_1-" );
-    static EvtId D1P10 = EvtPDL::getId( "D_10" );
-    static EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
+    static const EvtId D1P1P = EvtPDL::getId( "D_1+" );
+    static const EvtId D1P1N = EvtPDL::getId( "D_1-" );
+    static const EvtId D1P10 = EvtPDL::getId( "D_10" );
+    static const EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
 
-    static EvtId B1P = EvtPDL::getId( "b_1+" );
-    static EvtId B1M = EvtPDL::getId( "b_1-" );
-    static EvtId B10 = EvtPDL::getId( "b_10" );
+    static const EvtId B1P = EvtPDL::getId( "b_1+" );
+    static const EvtId B1M = EvtPDL::getId( "b_1-" );
+    static const EvtId B10 = EvtPDL::getId( "b_10" );
 
-    static EvtId H1 = EvtPDL::getId( "h_1" );
-    static EvtId H1PR = EvtPDL::getId( "h'_1" );
+    static const EvtId H1 = EvtPDL::getId( "h_1" );
+    static const EvtId H1PR = EvtPDL::getId( "h'_1" );
 
-    static EvtId K1P = EvtPDL::getId( "K_1+" );
-    static EvtId K1M = EvtPDL::getId( "K_1-" );
-    static EvtId K10 = EvtPDL::getId( "K_10" );
-    static EvtId K1B = EvtPDL::getId( "anti-K_10" );
+    static const EvtId K1P = EvtPDL::getId( "K_1+" );
+    static const EvtId K1M = EvtPDL::getId( "K_1-" );
+    static const EvtId K10 = EvtPDL::getId( "K_10" );
+    static const EvtId K1B = EvtPDL::getId( "anti-K_10" );
 
-    static EvtId D1P1SP = EvtPDL::getId( "D_s1+" );
-    static EvtId D1P1SN = EvtPDL::getId( "D_s1-" );
+    static const EvtId D1P1SP = EvtPDL::getId( "D_s1+" );
+    static const EvtId D1P1SN = EvtPDL::getId( "D_s1-" );
 
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
 
     double mtb, mbb( 0.0 );
     double msd( 0.0 ), mx, mb, nfp( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx, f5;
     double f5sppsm, f5spmsm;
     double f5v, f5r, mup, mum, vv, rr, spmsm, sppsm;
     double mqm, msb( 0.0 ), bb2( 0.0 ), bbx2, tm, wt, r2;
     EvtId prnt = parent;
     EvtId dgt = daugt;
     if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.431 * 0.431;
         mbb = 5.31;
         if ( dgt == B10 || dgt == B1P || dgt == B1M || dgt == H1 || dgt == H1PR ) {
             msq = 0.33;
             bx2 = 0.275 * 0.275;
             mbx = ( 3.0 * 1.123 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
             nfp = 0.0;
         } else {
             if ( dgt == D1P1P || dgt == D1P10 || dgt == D1P1B || dgt == D1P1N ) {
                 msq = 1.82;
                 bx2 = 0.33 * 0.33;
                 mbx = ( 5.0 * 2.46 + 3.0 * 2.42 ) / 8.0;
                 nfp = 3.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_1P1.\n";
             }
         }
     } else {
         if ( prnt == DM || prnt == DP || prnt == D0B || prnt == D0 ) {
             msb = 1.82;
             msd = 0.33;
             bb2 = 0.45 * 0.45;
             mbb = 1.963;
             if ( dgt == B10 || dgt == B1P || dgt == B1M || dgt == H1 ||
                  dgt == H1PR ) {
                 msq = 0.33;
                 bx2 = 0.275 * 0.275;
                 mbx = ( 3.0 * 1.123 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
                 nfp = 0.0;
             } else {
                 if ( dgt == K10 || dgt == K1B || dgt == K1P || dgt == K1M ) {
                     msq = 0.55;
                     bx2 = 0.30 * 0.30;
                     mbx = ( 3.0 * 1.27 + 1.43 + 5.0 * 1.43 + 3.0 * 1.4 ) / 12.0;
                     nfp = 2.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt in get_isgw_ff_1P1.\n";
                 }
             }
         } else {
             //BS -> cs constants added by djl on Jan. 21,1998
             if ( prnt == BS0 || prnt == BSB ) {
                 msb = 5.2;
                 msd = 0.55;
                 bb2 = 0.54 * 0.54;
                 mbb = 5.38;
 
                 if ( dgt == D1P1SP || dgt == D1P1SN ) {
                     msq = 1.82;
                     bx2 = 0.41 * 0.41;
                     mbx = ( 5.0 * 2.61 + 3.0 * 2.54 ) / 8.0;
                     nfp = 3.0;
                 } else if ( dgt == K10 || dgt == K1B || dgt == K1P ||
                             dgt == K1M ) {
                     msq = 0.55;
                     bx2 = 0.30 * 0.30;
                     mbx = ( 3.0 * 1.27 + 1.43 + 5.0 * 1.43 + 3.0 * 1.4 ) / 12.0;
                     nfp = 2.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt:" << daugt.getId()
                         << " in get_isgw_ff_1S0.\n";
                 }
             }
 
             else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented parent in get_isgw_ff_1P1.\n";
             }
         }
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
     wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
 
     mqm = 0.1;
     r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
          ( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
              log( EvtGetas( mqm, mqm ) / EvtGetas( msq, msq ) );
 
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) /
          ( pow( ( 1.0 + r2 * ( tm - t ) / 18.0 ), 3.0 ) );
 
     f5v = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
     f5r = f5 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), 0.5 );
     f5sppsm = f5 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), 0.5 );
     f5spmsm = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
 
     if ( msq == msd ) {
         vv = f5v *
              ( ( ( mtb * sqrt( bb2 ) ) / ( 4.0 * sqrt( 2.0 ) * msb * msq * mtx ) ) +
                ( ( ( wt - 1 ) * msd ) / ( 6.0 * sqrt( 2.0 * bb2 ) * mtx ) ) );
 
         rr = f5r * mtb * sqrt( bb2 / 2 ) *
              ( ( 1.0 / mup ) + ( ( msd * mtx * ( wt - 1 ) * ( wt - 1 ) ) /
                                  ( 3.0 * msq * bb2 ) ) );
 
         sppsm = msd * f5sppsm / ( sqrt( 2.0 * bb2 ) * mtb ) *
                 ( 1.0 - ( msd / msq ) + ( ( msd * bb2 ) / ( 2.0 * mup * bbx2 ) ) );
 
         spmsm = msd * f5spmsm / ( sqrt( 2.0 * bb2 ) * msq ) *
                 ( ( ( 4 - wt ) / 3.0 ) -
                   ( ( msd * msq * bb2 ) / ( 2.0 * mtx * mup * bbx2 ) ) );
 
     } else {
         vv = -1.0 * msd * f5v / ( 2.0 * sqrt( 3.0 * bb2 ) * mtx ) *
              ( ( wt + 1 ) / 2.0 + bb2 * mtb / ( 2.0 * msd * msq * msb ) );
 
         rr = -2.0 * mtb * sqrt( bb2 / 3.0 ) * f5r *
              ( 1.0 / msq + mtx * msd * ( wt - 1 ) / ( 2.0 * bb2 ) *
                                ( ( wt + 1 ) / ( 2.0 * msq ) -
                                  msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) );
 
         sppsm = -1.0 * sqrt( 3.0 ) * msd * f5sppsm / ( 2.0 * sqrt( bb2 ) * mtb ) *
                 ( 1 - msd / ( 3.0 * msq ) -
                   msd * bb2 / ( 3.0 * bbx2 ) *
                       ( 1.0 / ( 2.0 * mum ) - 1.0 / mup ) );
 
         spmsm = -1.0 * msd * f5spmsm / ( 2.0 * sqrt( 3.0 * bb2 ) * mtx ) *
                 ( ( 2 - wt ) * mtx / msq +
                   msd * bb2 / bbx2 * ( 1.0 / ( 2.0 * mum ) - 1.0 / mup ) );
     }
 
     //smooth out the mass(meson) dependence a little
     double parMass = EvtPDL::getMeanMass( prnt );
     double q2max = parMass * parMass + mass * mass - 2.0 * parMass * mass;
     double massNom = EvtPDL::getMeanMass( dgt );
     double q2maxNom = parMass * parMass + massNom * massNom -
                       2.0 * parMass * massNom;
     double q2maxin = sqrt( q2maxNom / q2max );
     if ( q2maxin > 1000. )
         q2maxin = 1000.;
 
     vv *= q2maxin;
     rr *= q2maxin;
     sppsm *= q2maxin;
     spmsm *= q2maxin;
 
     *vf = vv;
     *rf = rr;
     *spf = ( sppsm + spmsm ) / 2.0;
     *smf = ( sppsm - spmsm ) / 2.0;
     return;
 }    //get_ff_isgw_1p1
 
 void EvtISGW2FF::EvtISGW2FF3P1( EvtId parent, EvtId daugt, double t, double mass,
                                 double* lf, double* qf, double* cpf, double* cmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
-    static EvtId D3P1P = EvtPDL::getId( "D'_1+" );
-    static EvtId D3P1N = EvtPDL::getId( "D'_1-" );
-    static EvtId D3P10 = EvtPDL::getId( "D'_10" );
-    static EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
+    static const EvtId D3P1P = EvtPDL::getId( "D'_1+" );
+    static const EvtId D3P1N = EvtPDL::getId( "D'_1-" );
+    static const EvtId D3P10 = EvtPDL::getId( "D'_10" );
+    static const EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
 
-    static EvtId A1P = EvtPDL::getId( "a_1+" );
-    static EvtId A1M = EvtPDL::getId( "a_1-" );
-    static EvtId A10 = EvtPDL::getId( "a_10" );
+    static const EvtId A1P = EvtPDL::getId( "a_1+" );
+    static const EvtId A1M = EvtPDL::getId( "a_1-" );
+    static const EvtId A10 = EvtPDL::getId( "a_10" );
 
-    static EvtId F1 = EvtPDL::getId( "f_1" );
-    static EvtId F1PR = EvtPDL::getId( "f'_1" );
+    static const EvtId F1 = EvtPDL::getId( "f_1" );
+    static const EvtId F1PR = EvtPDL::getId( "f'_1" );
 
-    static EvtId K1STP = EvtPDL::getId( "K'_1+" );
-    static EvtId K1STM = EvtPDL::getId( "K'_1-" );
-    static EvtId K1ST0 = EvtPDL::getId( "K'_10" );
-    static EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
+    static const EvtId K1STP = EvtPDL::getId( "K'_1+" );
+    static const EvtId K1STM = EvtPDL::getId( "K'_1-" );
+    static const EvtId K1ST0 = EvtPDL::getId( "K'_10" );
+    static const EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
 
-    static EvtId D3P1SP = EvtPDL::getId( "D'_s1+" );
-    static EvtId D3P1SN = EvtPDL::getId( "D'_s1-" );
+    static const EvtId D3P1SP = EvtPDL::getId( "D'_s1+" );
+    static const EvtId D3P1SN = EvtPDL::getId( "D'_s1-" );
 
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
 
     double mtb, mbb( 0.0 );
     double msd( 0.0 ), mx, mb, nfp( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
     double f5cppcm, f5cpmcm, f5, ql, ll, cppcm, cpmcm, f5q, f5l;
     double mqm, msb( 0.0 ), bb2( 0.0 ), mum, bbx2, tm, wt, r2;
     EvtId prnt = parent;
     EvtId dgt = daugt;
 
     if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.431 * 0.431;
         mbb = 5.31;
 
         if ( dgt == A10 || dgt == A1P || dgt == A1M || dgt == F1 || dgt == F1PR ) {
             msq = 0.33;
             bx2 = 0.275 * 0.275;
             mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
             nfp = 0.0;
         } else {
             if ( dgt == D3P1P || dgt == D3P1N || dgt == D3P10 || dgt == D3P1B ) {
                 msq = 1.82;
                 bx2 = 0.33 * 0.33;
                 mbx = ( 3.0 * 2.49 + 2.40 ) / 4.0;
                 nfp = 3.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt:" << daugt.getId()
                     << " in get_isgw_ff_3P1.\n";
             }
         }
     } else {
         if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
             msb = 1.82;
             msd = 0.33;
             bb2 = 0.45 * 0.45;
             mbb = 1.963;
 
             if ( dgt == F1 || dgt == F1PR || dgt == A10 || dgt == A1P ||
                  dgt == A1M ) {
                 msq = 0.33;
                 bx2 = 0.275 * 0.275;
                 mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
                 nfp = 0.0;
             } else {
                 if ( dgt == K1STM || dgt == K1STB || dgt == K1STP ||
                      dgt == K1ST0 ) {
                     msq = 0.55;
                     bx2 = 0.30 * 0.30;
                     mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
                     nfp = 2.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt:" << daugt.getId()
                         << " in get_isgw_ff_3P1.\n";
                 }
             }
         } else {
             //BS -> cs constants added by djl on Jan. 21,1998
             if ( prnt == BS0 || prnt == BSB ) {
                 msb = 5.2;
                 msd = 0.55;
                 bb2 = 0.54 * 0.54;
                 mbb = 5.38;
 
                 if ( dgt == D3P1SP || dgt == D3P1SN ) {
                     msq = 1.82;
                     bx2 = 0.41 * 0.41;
                     mbx = ( 3.0 * 2.54 + 2.46 ) / 4.0;
                     nfp = 3.0;
                 } else if ( dgt == K1STM || dgt == K1STB || dgt == K1STP ||
                             dgt == K1ST0 ) {
                     msq = 0.55;
                     bx2 = 0.30 * 0.30;
                     mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
                     nfp = 2.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt:" << daugt.getId()
                         << " in get_isgw_ff_1S0.\n";
                 }
             }
 
             else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented parent in get_isgw_ff_3P1.\n";
             }
         }
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
     wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
 
     mqm = 0.1;
     r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
          ( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
              log( EvtGetas( mqm ) / EvtGetas( msq ) );
 
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) /
          ( pow( ( 1.0 + r2 * ( tm - t ) / 18.0 ), 3.0 ) );
 
     f5q = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
     f5l = f5 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), 0.5 );
     f5cppcm = f5 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), 0.5 );
     f5cpmcm = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), -0.5 );
 
     if ( msq == msd ) {
         ql = -1.0 *
              ( msd * ( 5.0 + wt ) * f5q / ( 2.0 * mtx * sqrt( bb2 ) * 6.0 ) );
 
         ll = -1.0 * mtb * sqrt( bb2 ) * f5l *
              ( 1 / mum + ( ( msd * mtx * ( wt - 1 ) / bb2 ) *
                            ( ( 5.0 + wt ) / ( 6.0 * msq ) -
                              ( msd * bb2 ) / ( 2.0 * mum * mtx * bbx2 ) ) ) );
 
         cppcm = ( -1.0 *
                   ( msd * mtx * f5cppcm / ( 2.0 * msq * mtb * sqrt( bb2 ) ) ) *
                   ( 1 - ( msd * msq * bb2 ) / ( 2.0 * mtx * mum * bbx2 ) ) );
 
         cpmcm = 1.0 *
                 ( msd * mtx * f5cpmcm / ( 2.0 * msq * mtb * sqrt( bb2 ) ) ) *
                 ( ( ( wt + 2.0 ) / 3.0 ) -
                   ( msd * msq * bb2 ) / ( 2.0 * mtx * mum * bbx2 ) ) *
                 ( mtb / mtx );
     } else {
         ql = f5q * sqrt( 1.0 / 6.0 ) * msd / ( sqrt( bb2 ) * mtx ) *
              ( 1.0 - bb2 * mtb / ( 4.0 * msd * msq * msb ) );
         ll = f5l * sqrt( 2.0 / 3.0 ) * mtb * sqrt( bb2 ) *
              ( 1.0 / ( 2.0 * msq ) - 3.0 / ( 2.0 * msb ) +
                msd * mtx * ( wt - 1 ) / bb2 *
                    ( 1.0 / msq - msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) );
         cppcm = msd * msd * bx2 * f5cppcm /
                 ( sqrt( 6.0 ) * mtb * msq * sqrt( bb2 ) * bbx2 );
         cpmcm = -sqrt( 2.0 / 3.0 ) * msd * f5cpmcm / ( sqrt( bb2 ) * mtx ) *
                 ( 1 + msd * bx2 / ( 2.0 * msq * bbx2 ) );
     }
 
     //smooth out the mass(meson) dependence a little
     double parMass = EvtPDL::getMeanMass( prnt );
     double q2max = parMass * parMass + mass * mass - 2.0 * parMass * mass;
     double massNom = EvtPDL::getMeanMass( dgt );
     double q2maxNom = parMass * parMass + massNom * massNom -
                       2.0 * parMass * massNom;
     double q2maxin = sqrt( q2maxNom / q2max );
     if ( q2maxin > 1000. )
         q2maxin = 1000.;
     ql *= q2maxin;
     ll *= q2maxin;
     cppcm *= q2maxin;
     cpmcm *= q2maxin;
 
     *qf = ql;
     *lf = ll;
     *cpf = ( cppcm + cpmcm ) / 2.0;
     *cmf = ( cppcm - cpmcm ) / 2.0;
     return;
 }    //get_ff_isgw_3p1
 
 void EvtISGW2FF::EvtISGW2FF3P0( EvtId parent, EvtId daugt, double t,
                                 double mass, double* upf, double* umf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
-    static EvtId D3P0P = EvtPDL::getId( "D_0*+" );
-    static EvtId D3P0N = EvtPDL::getId( "D_0*-" );
-    static EvtId D3P00 = EvtPDL::getId( "D_0*0" );
-    static EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
+    static const EvtId D3P0P = EvtPDL::getId( "D_0*+" );
+    static const EvtId D3P0N = EvtPDL::getId( "D_0*-" );
+    static const EvtId D3P00 = EvtPDL::getId( "D_0*0" );
+    static const EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
 
-    static EvtId D3P0SP = EvtPDL::getId( "D_s0*+" );
-    static EvtId D3P0SN = EvtPDL::getId( "D_s0*-" );
+    static const EvtId D3P0SP = EvtPDL::getId( "D_s0*+" );
+    static const EvtId D3P0SN = EvtPDL::getId( "D_s0*-" );
 
-    static EvtId A0P = EvtPDL::getId( "a_0+" );
-    static EvtId A0M = EvtPDL::getId( "a_0-" );
-    static EvtId A00 = EvtPDL::getId( "a_00" );
+    static const EvtId A0P = EvtPDL::getId( "a_0+" );
+    static const EvtId A0M = EvtPDL::getId( "a_0-" );
+    static const EvtId A00 = EvtPDL::getId( "a_00" );
 
-    static EvtId F0 = EvtPDL::getId( "f_0" );
-    static EvtId F0PR = EvtPDL::getId( "f'_0" );
+    static const EvtId F0 = EvtPDL::getId( "f_0" );
+    static const EvtId F0PR = EvtPDL::getId( "f'_0" );
 
-    static EvtId K0STP = EvtPDL::getId( "K_0*+" );
-    static EvtId K0STM = EvtPDL::getId( "K_0*-" );
-    static EvtId K0ST0 = EvtPDL::getId( "K_0*0" );
-    static EvtId K0STB = EvtPDL::getId( "anti-K_0*0" );
+    static const EvtId K0STP = EvtPDL::getId( "K_0*+" );
+    static const EvtId K0STM = EvtPDL::getId( "K_0*-" );
+    static const EvtId K0ST0 = EvtPDL::getId( "K_0*0" );
+    static const EvtId K0STB = EvtPDL::getId( "anti-K_0*0" );
 
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
 
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
 
     double mtb, mbb( 0.0 );
     double msd( 0.0 ), mx, mb, nfp( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx;
     double f5uppum, f5upmum, uppum, upmum, f5;
     double mqm, r2, bb2( 0.0 ), bbx2, msb( 0.0 ), tm;
 
     EvtId prnt = parent;
     EvtId dgt = daugt;
 
     if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.431 * 0.431;
         mbb = 5.31;
         if ( dgt == A00 || dgt == A0P || dgt == A0M || dgt == F0 || dgt == F0PR ) {
             msq = 0.33;
             bx2 = 0.275 * 0.275;
             mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
             nfp = 0.0;
         } else {
             if ( dgt == D3P0P || dgt == D3P0N || dgt == D3P00 || dgt == D3P0B ) {
                 msq = 1.82;
                 bx2 = 0.33 * 0.33;
                 mbx = ( 3.0 * 2.49 + 2.40 ) / 4.0;
                 nfp = 3.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_EvtISGW2_ff_3P0.\n";
             }
         }
     } else {
         if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
             msb = 1.82;
             msd = 0.33;
             bb2 = 0.45 * 0.45;
             mbb = 1.963;
             if ( dgt == F0 || dgt == F0PR || dgt == A00 || dgt == A0P ||
                  dgt == A0M ) {
                 msq = 0.33;
                 bx2 = 0.275 * 0.275;
                 mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
                 nfp = 0.0;
             } else {
                 if ( dgt == K0STM || dgt == K0STB || dgt == K0STP ||
                      dgt == K0ST0 ) {
                     msq = 0.55;
                     bx2 = 0.30 * 0.30;
                     mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
                     nfp = 2.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt in get_EvtISGW2_ff_3P0.\n";
                 }
             }
         } else {
             if ( prnt == DSP || prnt == DSM ) {
                 msb = 1.82;
                 msd = 0.55;
                 bb2 = 0.56 * 0.56;
                 mbb = 1.968;
 
                 if ( dgt == F0 || dgt == F0PR || dgt == A00 || dgt == A0P ||
                      dgt == A0M ) {
                     msq = 0.55;
                     bx2 = 0.33 * 0.33;
                     mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
                     nfp = 2.0;
                 } else {
                     if ( dgt == K0STM || dgt == K0STB || dgt == K0STP ||
                          dgt == K0ST0 ) {
                         msq = 0.33;
                         bx2 = 0.30 * 0.30;
                         mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) /
                               12.0;
                         nfp = 0.0;
                     } else {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Not implemented daugt in get_EvtISGW2_ff_3P0.\n";
                     }
                 }
             } else {
                 //BS -> cs constants added by djl on Jan. 21,1998
                 if ( prnt == BS0 || prnt == BSB ) {
                     msb = 5.2;
                     msd = 0.55;
                     bb2 = 0.54 * 0.54;
                     mbb = 5.38;
 
                     if ( dgt == D3P0SP || dgt == D3P0SN ) {
                         msq = 1.82;
                         bx2 = 0.41 * 0.41;
                         mbx = ( 3.0 * 2.54 + 2.46 ) / 4.0;
                         nfp = 3.0;
                     } else if ( dgt == K0STM || dgt == K0STB || dgt == K0STP ||
                                 dgt == K0ST0 ) {
                         msq = 0.55;
                         bx2 = 0.30 * 0.30;
                         mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) /
                               12.0;
                         nfp = 2.0;
                     } else {
                         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                             << "Not implemented daugt:" << daugt.getId()
                             << " in get_isgw_ff_1S0.\n";
                     }
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented parent in get_EvtISGW2_ff_3P0.\n";
                 }
             }
         }
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     mqm = 0.1;
     r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
          ( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
              log( EvtGetas( mqm ) / EvtGetas( msq ) );
 
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) /
          ( pow( ( 1.0 + r2 * ( tm - t ) / 18.0 ), 3.0 ) );
 
     f5uppum = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), 0.5 );
     f5upmum = f5 * pow( ( mbb / mtb ), 0.5 ) * pow( ( mbx / mtx ), -0.5 );
 
     uppum = -1.0 * f5uppum * sqrt( 2.0 / ( 3.0 * bb2 ) ) * msd;
     upmum = 1.0 * f5upmum * sqrt( 2.0 / ( 3.0 * bb2 ) ) * msd * mtb / mtx;
 
     *upf = ( uppum + upmum ) / 2.0;
     *umf = ( uppum - upmum ) / 2.0;
 
     return;
 }
 
 void EvtISGW2FF::EvtISGW2FF3P2( EvtId parent, EvtId daugt, double t, double mass,
                                 double* hf, double* kf, double* bpf, double* bmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
-
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
-
-    static EvtId D3P2P = EvtPDL::getId( "D_2*+" );
-    static EvtId D3P2N = EvtPDL::getId( "D_2*-" );
-    static EvtId D3P20 = EvtPDL::getId( "D_2*0" );
-    static EvtId D3P2B = EvtPDL::getId( "anti-D_2*0" );
-
-    static EvtId A2P = EvtPDL::getId( "a_2+" );
-    static EvtId A2M = EvtPDL::getId( "a_2-" );
-    static EvtId A20 = EvtPDL::getId( "a_20" );
-
-    static EvtId F2 = EvtPDL::getId( "f_2" );
-    static EvtId F2PR = EvtPDL::getId( "f'_2" );
-
-    static EvtId K2STP = EvtPDL::getId( "K_2*+" );
-    static EvtId K2STM = EvtPDL::getId( "K_2*-" );
-    static EvtId K2ST0 = EvtPDL::getId( "K_2*0" );
-    static EvtId K2STB = EvtPDL::getId( "anti-K_2*0" );
-
-    static EvtId D3P2SP = EvtPDL::getId( "D_s2*+" );
-    static EvtId D3P2SN = EvtPDL::getId( "D_s2*-" );
-
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
+
+    static const EvtId D3P2P = EvtPDL::getId( "D_2*+" );
+    static const EvtId D3P2N = EvtPDL::getId( "D_2*-" );
+    static const EvtId D3P20 = EvtPDL::getId( "D_2*0" );
+    static const EvtId D3P2B = EvtPDL::getId( "anti-D_2*0" );
+
+    static const EvtId A2P = EvtPDL::getId( "a_2+" );
+    static const EvtId A2M = EvtPDL::getId( "a_2-" );
+    static const EvtId A20 = EvtPDL::getId( "a_20" );
+
+    static const EvtId F2 = EvtPDL::getId( "f_2" );
+    static const EvtId F2PR = EvtPDL::getId( "f'_2" );
+
+    static const EvtId K2STP = EvtPDL::getId( "K_2*+" );
+    static const EvtId K2STM = EvtPDL::getId( "K_2*-" );
+    static const EvtId K2ST0 = EvtPDL::getId( "K_2*0" );
+    static const EvtId K2STB = EvtPDL::getId( "anti-K_2*0" );
+
+    static const EvtId D3P2SP = EvtPDL::getId( "D_s2*+" );
+    static const EvtId D3P2SN = EvtPDL::getId( "D_s2*-" );
+
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
 
     double mtb, mbb( 0.0 );
     double msd( 0.0 ), mx, mb, nfp( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mbx( 0.0 ), mtx, f5;
     double f5h, f5k, f5bppbm, f5bpmbm, bppbm, bpmbm;
     double mqm, mum, mup, tm, wt, r2, bb2( 0.0 ), bbx2;
     double msb( 0.0 );
     EvtId prnt = parent;
     EvtId dgt = daugt;
 
     if ( prnt == B0 || prnt == B0B || prnt == BP || prnt == BM ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.431 * 0.431;
         mbb = 5.31;
 
         if ( dgt == A20 || dgt == A2P || dgt == A2M || dgt == F2 || dgt == F2PR ) {
             msq = 0.33;
             bx2 = 0.275 * 0.275;
             mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
             nfp = 0.0;
 
         }
 
         else {
             if ( dgt == D3P2P || dgt == D3P2N || dgt == D3P20 || dgt == D3P2B ) {
                 msq = 1.82;
                 bx2 = 0.33 * 0.33;
                 mbx = ( 5.0 * 2.46 + 3.0 * 2.42 ) / 8.0;
                 nfp = 3.0;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_3P2.\n";
             }
         }
     } else {
         if ( prnt == D0 || prnt == D0B || prnt == DP || prnt == DM ) {
             msb = 1.82;
             msd = 0.33;
             bb2 = 0.45 * 0.45;
             mbb = 1.963;
             if ( dgt == F2 || dgt == F2PR || dgt == A20 || dgt == A2P ||
                  dgt == A2M ) {
                 msq = 0.33;
                 bx2 = 0.275 * 0.275;
                 mbx = ( 3.0 * 1.23 + 0.98 + 5.0 * 1.32 + 3.0 * 1.26 ) / 12.0;
                 nfp = 0.0;
             } else {
                 if ( dgt == K2STM || dgt == K2STB || dgt == K2STP ||
                      dgt == K2ST0 ) {
                     msq = 0.55;
                     bx2 = 0.30 * 0.30;
                     mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
                     nfp = 2.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt in get_isgw_ff_3P2.\n";
                 }
             }
         } else {
             //BS -> cs constants added by djl on Jan. 21,1998
             if ( prnt == BS0 || prnt == BSB ) {
                 msb = 5.2;
                 msd = 0.55;
                 bb2 = 0.54 * 0.54;
                 mbb = 5.38;
 
                 if ( dgt == D3P2SP || dgt == D3P2SN ) {
                     msq = 1.82;
                     bx2 = 0.41 * 0.41;
                     mbx = ( 5.0 * 2.61 + 3.0 * 2.54 ) / 8.0;
                     nfp = 3.0;
                 } else if ( dgt == K2STM || dgt == K2STB || dgt == K2STP ||
                             dgt == K2ST0 ) {
                     msq = 0.55;
                     bx2 = 0.30 * 0.30;
                     mbx = ( 3.0 * 1.40 + 1.43 + 5.0 * 1.43 + 3.0 * 1.27 ) / 12.0;
                     nfp = 2.0;
                 } else {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "Not implemented daugt:" << daugt.getId()
                         << " in get_isgw_ff_1S0.\n";
                 }
             }
 
             else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented parent in get_isgw_ff_3P2.\n";
             }
         }
     }
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
     mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
     wt = 1.0 + ( tm - t ) / ( 2.0 * mbb * mbx );
 
     mqm = 0.1;
     r2 = 3.0 / ( 4.0 * msb * msq ) + 3 * msd * msd / ( 2 * mbb * mbx * bbx2 ) +
          ( 16.0 / ( mbb * mbx * ( 33.0 - 2.0 * nfp ) ) ) *
              log( EvtGetas( mqm ) / EvtGetas( msq ) );
 
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) /
          ( pow( ( 1.0 + r2 * ( tm - t ) / 18.0 ), 3.0 ) );
 
     f5h = f5 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), -0.5 );
     f5k = f5 * pow( ( mbb / mtb ), -0.5 ) * pow( ( mbx / mtx ), 0.5 );
     f5bppbm = f5 * pow( ( mbb / mtb ), -2.5 ) * pow( ( mbx / mtx ), 0.5 );
     f5bpmbm = f5 * pow( ( mbb / mtb ), -1.5 ) * pow( ( mbx / mtx ), -0.5 );
 
     *hf = f5h * ( msd / ( sqrt( 8.0 * bb2 ) * mtb ) ) *
           ( ( 1.0 / msq ) - ( msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) );
 
     *kf = f5k * ( msd / ( sqrt( 2.0 * bb2 ) ) ) * ( 1.0 + wt );
 
     bppbm = ( ( msd * msd * f5bppbm * bx2 ) /
               ( sqrt( 32.0 * bb2 ) * msq * msb * mtb * bbx2 ) ) *
             ( 1.0 - ( msd * bx2 / ( 2.0 * mtb * bbx2 ) ) );
 
     bpmbm = -1.0 * ( msd * f5bpmbm / ( sqrt( 2.0 * bb2 ) * msb * mtx ) ) *
             ( 1.0 - ( ( msd * msb * bx2 ) / ( 2.0 * mup * mtb * bbx2 ) ) +
               ( ( msd * bx2 * ( 1.0 - ( ( msd * bx2 ) / ( 2.0 * mtb * bbx2 ) ) ) ) /
                 ( 4.0 * msq * bbx2 ) ) );
 
     *bpf = ( bppbm + bpmbm ) / 2.0;
     *bmf = ( bppbm - bpmbm ) / 2.0;
     return;
 }    //get_ff_isgw_1p1
 
 double EvtISGW2FF::EvtGetGammaji( double z )
 
 {
     double temp;
 
     temp = 2 + ( ( 2.0 * z ) / ( 1 - z ) ) * log( z );
     temp = -1.0 * temp;
 
     return temp;
 
 }    //EvtGetGammaji
 
 double EvtISGW2FF::EvtGetas( double massq, double massx )
 {
     double lqcd2 = 0.04;
     double nflav = 4;
     double temp = 0.6;
 
     if ( massx > 0.6 ) {
         if ( massq < 1.85 ) {
             nflav = 3.0;
         }
 
         temp = 12.0 * EvtConst::pi / ( 33.0 - 2.0 * nflav ) /
                log( massx * massx / lqcd2 );
     }
     return temp;
 
 }    //EvtGetas
 
 double EvtISGW2FF::EvtGetas( double mass )
 
 {
     double lqcd2 = 0.04;
     double nflav = 4;
     double temp = 0.6;
 
     if ( mass > 0.6 ) {
         if ( mass < 1.85 ) {
             nflav = 3.0;
         }
 
         temp = 12.0 * EvtConst::pi / ( 33.0 - 2.0 * nflav ) /
                log( mass * mass / lqcd2 );
     }
     return temp;
 
 }    //EvtGetas
 
 void EvtISGW2FF::getbaryonff( EvtId, EvtId, double, double, double*, double*,
                               double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getbaryonff in EvtISGW2FF.\n";
 
     ::abort();
 }
 
 void EvtISGW2FF::getdiracff( EvtId, EvtId, double, double, double*, double*,
                              double*, double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getdiracff in EvtISGW2FF.\n";
     ::abort();
 }
 
 void EvtISGW2FF::getraritaff( EvtId, EvtId, double, double, double*, double*,
                               double*, double*, double*, double*, double*,
                               double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getraritaff in EvtISGW2FF.\n";
     ::abort();
 }
diff --git a/src/EvtGenModels/EvtISGWFF.cpp b/src/EvtGenModels/EvtISGWFF.cpp
index 8202c9f..74a559f 100644
--- a/src/EvtGenModels/EvtISGWFF.cpp
+++ b/src/EvtGenModels/EvtISGWFF.cpp
@@ -1,910 +1,910 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtISGWFF.hh"
 
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <math.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
 void EvtISGWFF::getscalarff( EvtId parent, EvtId daught, double t, double mass,
                              double* fpf, double* f0f )
 {
     //added by Lange Jan4,2000
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
-    static EvtId D3P0P = EvtPDL::getId( "D_0*+" );
-    static EvtId D3P0N = EvtPDL::getId( "D_0*-" );
-    static EvtId D3P00 = EvtPDL::getId( "D_0*0" );
-    static EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
+    static const EvtId D3P0P = EvtPDL::getId( "D_0*+" );
+    static const EvtId D3P0N = EvtPDL::getId( "D_0*-" );
+    static const EvtId D3P00 = EvtPDL::getId( "D_0*0" );
+    static const EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
 
-    static EvtId D21S0P = EvtPDL::getId( "hi" );
-    static EvtId D21S0N = EvtPDL::getId( "hi" );
-    static EvtId D21S00 = EvtPDL::getId( "hi" );
-    static EvtId D21S0B = EvtPDL::getId( "hi" );
+    static const EvtId D21S0P = EvtPDL::getId( "hi" );
+    static const EvtId D21S0N = EvtPDL::getId( "hi" );
+    static const EvtId D21S00 = EvtPDL::getId( "hi" );
+    static const EvtId D21S0B = EvtPDL::getId( "hi" );
 
-    static EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
+    static const EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
 
-    static EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
-    static EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
-    static EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
+    static const EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
+    static const EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
+    static const EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
 
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
 
-    static EvtId A0P = EvtPDL::getId( "a_0+" );
-    static EvtId A0M = EvtPDL::getId( "a_0-" );
-    static EvtId A00 = EvtPDL::getId( "a_00" );
+    static const EvtId A0P = EvtPDL::getId( "a_0+" );
+    static const EvtId A0M = EvtPDL::getId( "a_0-" );
+    static const EvtId A00 = EvtPDL::getId( "a_00" );
 
-    static EvtId F0 = EvtPDL::getId( "f_0" );
-    static EvtId F0PR = EvtPDL::getId( "f'_0" );
+    static const EvtId F0 = EvtPDL::getId( "f_0" );
+    static const EvtId F0PR = EvtPDL::getId( "f'_0" );
 
-    static EvtId ETA = EvtPDL::getId( "eta" );
-    static EvtId ETAPR = EvtPDL::getId( "eta'" );
+    static const EvtId ETA = EvtPDL::getId( "eta" );
+    static const EvtId ETAPR = EvtPDL::getId( "eta'" );
 
-    static EvtId KP = EvtPDL::getId( "K+" );
-    static EvtId KM = EvtPDL::getId( "K-" );
-    static EvtId K0 = EvtPDL::getId( "K0" );
-    static EvtId KB = EvtPDL::getId( "anti-K0" );
-    static EvtId K0S = EvtPDL::getId( "K_S0" );
-    static EvtId K0L = EvtPDL::getId( "K_L0" );
+    static const EvtId KP = EvtPDL::getId( "K+" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId K0 = EvtPDL::getId( "K0" );
+    static const EvtId KB = EvtPDL::getId( "anti-K0" );
+    static const EvtId K0S = EvtPDL::getId( "K_S0" );
+    static const EvtId K0L = EvtPDL::getId( "K_L0" );
 
-    static EvtId K0STP = EvtPDL::getId( "K_0*+" );
-    static EvtId K0STM = EvtPDL::getId( "K_0*-" );
-    static EvtId K0ST0 = EvtPDL::getId( "K_0*0" );
-    static EvtId K0STB = EvtPDL::getId( "anti-K_0*0" );
+    static const EvtId K0STP = EvtPDL::getId( "K_0*+" );
+    static const EvtId K0STM = EvtPDL::getId( "K_0*-" );
+    static const EvtId K0ST0 = EvtPDL::getId( "K_0*0" );
+    static const EvtId K0STB = EvtPDL::getId( "anti-K_0*0" );
 
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
 
-    static EvtId D3P0SP = EvtPDL::getId( "D_s0*+" );
-    static EvtId D3P0SN = EvtPDL::getId( "D_s0*-" );
+    static const EvtId D3P0SP = EvtPDL::getId( "D_s0*+" );
+    static const EvtId D3P0SN = EvtPDL::getId( "D_s0*-" );
 
     double fmf;
     double mb = EvtPDL::getMeanMass( parent );
 
     if ( daught == PI0 || daught == PIP || daught == PIM || daught == ETA ||
          daught == ETAPR || daught == D0 || daught == D0B || daught == DP ||
          daught == DM || daught == KP || daught == KM || daught == K0 ||
          daught == K0L || daught == KB || daught == DSP || daught == DSM ||
          daught == K0S ) {
         EvtISGW1FF1S0( parent, daught, t, mass, fpf, &fmf );
     }
 
     if ( daught == PI2S0 || daught == PI2SP || daught == PI2SM ||
          daught == ETA2S || daught == D21S0P || daught == D21S0B ||
          daught == D21S0N || daught == D21S00 ) {
         EvtISGW1FF21S0( parent, daught, t, mass, fpf, &fmf );
     }
 
     if ( daught == A00 || daught == A0P || daught == A0M || daught == F0 ||
          daught == F0PR || daught == D3P0P || daught == D3P00 ||
          daught == D3P0B || daught == D3P0N || daught == K0STM ||
          daught == K0STB || daught == K0STP || daught == D3P0SP ||
          daught == D3P0SN || daught == K0ST0 ) {
         EvtISGW1FF3P0( parent, daught, t, mass, fpf, &fmf );
     }
 
     *f0f = ( fmf / ( ( mb * mb - mass * mass ) / t ) ) + ( *fpf );
 
     return;
 }
 
 void EvtISGWFF::gettensorff( EvtId parent, EvtId daught, double t, double mass,
                              double* hf, double* kf, double* bpf, double* bmf )
 {
     //added by Lange Jan4,2000
     EvtISGW1FF3P2( parent, daught, t, mass, hf, kf, bpf, bmf );
 
     return;
 }
 
 void EvtISGWFF::getvectorff( EvtId parent, EvtId daught, double t, double mass,
                              double* a1f, double* a2f, double* vf, double* a0f )
 {
     //added by Lange Jan4,2000
-    static EvtId DST0 = EvtPDL::getId( "D*0" );
-    static EvtId DSTB = EvtPDL::getId( "anti-D*0" );
-    static EvtId DSTP = EvtPDL::getId( "D*+" );
-    static EvtId DSTM = EvtPDL::getId( "D*-" );
+    static const EvtId DST0 = EvtPDL::getId( "D*0" );
+    static const EvtId DSTB = EvtPDL::getId( "anti-D*0" );
+    static const EvtId DSTP = EvtPDL::getId( "D*+" );
+    static const EvtId DSTM = EvtPDL::getId( "D*-" );
 
-    static EvtId D1P1P = EvtPDL::getId( "D_1+" );
-    static EvtId D1P1N = EvtPDL::getId( "D_1-" );
-    static EvtId D1P10 = EvtPDL::getId( "D_10" );
-    static EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
+    static const EvtId D1P1P = EvtPDL::getId( "D_1+" );
+    static const EvtId D1P1N = EvtPDL::getId( "D_1-" );
+    static const EvtId D1P10 = EvtPDL::getId( "D_10" );
+    static const EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
 
-    static EvtId D3P1P = EvtPDL::getId( "D'_1+" );
-    static EvtId D3P1N = EvtPDL::getId( "D'_1-" );
-    static EvtId D3P10 = EvtPDL::getId( "D'_10" );
-    static EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
+    static const EvtId D3P1P = EvtPDL::getId( "D'_1+" );
+    static const EvtId D3P1N = EvtPDL::getId( "D'_1-" );
+    static const EvtId D3P10 = EvtPDL::getId( "D'_10" );
+    static const EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
 
-    static EvtId D23S1P = EvtPDL::getId( "hi" );
-    static EvtId D23S1N = EvtPDL::getId( "hi" );
-    static EvtId D23S10 = EvtPDL::getId( "hi" );
-    static EvtId D23S1B = EvtPDL::getId( "hi" );
+    static const EvtId D23S1P = EvtPDL::getId( "hi" );
+    static const EvtId D23S1N = EvtPDL::getId( "hi" );
+    static const EvtId D23S10 = EvtPDL::getId( "hi" );
+    static const EvtId D23S1B = EvtPDL::getId( "hi" );
 
-    static EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
-    static EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
-    static EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
-    static EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
+    static const EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
+    static const EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
+    static const EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
+    static const EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
 
-    static EvtId RHOP = EvtPDL::getId( "rho+" );
-    static EvtId RHOM = EvtPDL::getId( "rho-" );
-    static EvtId RHO0 = EvtPDL::getId( "rho0" );
+    static const EvtId RHOP = EvtPDL::getId( "rho+" );
+    static const EvtId RHOM = EvtPDL::getId( "rho-" );
+    static const EvtId RHO0 = EvtPDL::getId( "rho0" );
 
-    static EvtId A1P = EvtPDL::getId( "a_1+" );
-    static EvtId A1M = EvtPDL::getId( "a_1-" );
-    static EvtId A10 = EvtPDL::getId( "a_10" );
+    static const EvtId A1P = EvtPDL::getId( "a_1+" );
+    static const EvtId A1M = EvtPDL::getId( "a_1-" );
+    static const EvtId A10 = EvtPDL::getId( "a_10" );
 
-    static EvtId B1P = EvtPDL::getId( "b_1+" );
-    static EvtId B1M = EvtPDL::getId( "b_1-" );
-    static EvtId B10 = EvtPDL::getId( "b_10" );
+    static const EvtId B1P = EvtPDL::getId( "b_1+" );
+    static const EvtId B1M = EvtPDL::getId( "b_1-" );
+    static const EvtId B10 = EvtPDL::getId( "b_10" );
 
-    static EvtId H1 = EvtPDL::getId( "h_1" );
-    static EvtId H1PR = EvtPDL::getId( "h'_1" );
+    static const EvtId H1 = EvtPDL::getId( "h_1" );
+    static const EvtId H1PR = EvtPDL::getId( "h'_1" );
 
-    static EvtId F1 = EvtPDL::getId( "f_1" );
-    static EvtId F1PR = EvtPDL::getId( "f'_1" );
+    static const EvtId F1 = EvtPDL::getId( "f_1" );
+    static const EvtId F1PR = EvtPDL::getId( "f'_1" );
 
-    static EvtId OMEG = EvtPDL::getId( "omega" );
+    static const EvtId OMEG = EvtPDL::getId( "omega" );
 
-    static EvtId KSTP = EvtPDL::getId( "K*+" );
-    static EvtId KSTM = EvtPDL::getId( "K*-" );
-    static EvtId KST0 = EvtPDL::getId( "K*0" );
-    static EvtId KSTB = EvtPDL::getId( "anti-K*0" );
+    static const EvtId KSTP = EvtPDL::getId( "K*+" );
+    static const EvtId KSTM = EvtPDL::getId( "K*-" );
+    static const EvtId KST0 = EvtPDL::getId( "K*0" );
+    static const EvtId KSTB = EvtPDL::getId( "anti-K*0" );
 
-    static EvtId K1P = EvtPDL::getId( "K_1+" );
-    static EvtId K1M = EvtPDL::getId( "K_1-" );
-    static EvtId K10 = EvtPDL::getId( "K_10" );
-    static EvtId K1B = EvtPDL::getId( "anti-K_10" );
+    static const EvtId K1P = EvtPDL::getId( "K_1+" );
+    static const EvtId K1M = EvtPDL::getId( "K_1-" );
+    static const EvtId K10 = EvtPDL::getId( "K_10" );
+    static const EvtId K1B = EvtPDL::getId( "anti-K_10" );
 
-    static EvtId K1STP = EvtPDL::getId( "K'_1+" );
-    static EvtId K1STM = EvtPDL::getId( "K'_1-" );
-    static EvtId K1ST0 = EvtPDL::getId( "K'_10" );
-    static EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
+    static const EvtId K1STP = EvtPDL::getId( "K'_1+" );
+    static const EvtId K1STM = EvtPDL::getId( "K'_1-" );
+    static const EvtId K1ST0 = EvtPDL::getId( "K'_10" );
+    static const EvtId K1STB = EvtPDL::getId( "anti-K'_10" );
 
-    static EvtId PHI = EvtPDL::getId( "phi" );
+    static const EvtId PHI = EvtPDL::getId( "phi" );
 
-    static EvtId D1P1SP = EvtPDL::getId( "D_s1+" );
-    static EvtId D1P1SN = EvtPDL::getId( "D_s1-" );
+    static const EvtId D1P1SP = EvtPDL::getId( "D_s1+" );
+    static const EvtId D1P1SN = EvtPDL::getId( "D_s1-" );
 
-    static EvtId D3P1SP = EvtPDL::getId( "D'_s1*+" );
-    static EvtId D3P1SN = EvtPDL::getId( "D'_s1*-" );
+    static const EvtId D3P1SP = EvtPDL::getId( "D'_s1*+" );
+    static const EvtId D3P1SN = EvtPDL::getId( "D'_s1*-" );
 
-    static EvtId DSSTP = EvtPDL::getId( "D_s*+" );
-    static EvtId DSSTM = EvtPDL::getId( "D_s*-" );
+    static const EvtId DSSTP = EvtPDL::getId( "D_s*+" );
+    static const EvtId DSSTM = EvtPDL::getId( "D_s*-" );
 
     double ff, gf, apf, amf;
 
     if ( daught == DST0 || daught == DSTP || daught == DSTM || daught == DSTB ||
          daught == OMEG || daught == RHO0 || daught == RHOM || daught == RHOP ||
          daught == KSTP || daught == KSTM || daught == KST0 || daught == KSTB ||
          daught == PHI || daught == DSSTP || daught == DSSTM ) {
         EvtISGW1FF3S1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
     }
     if ( daught == B10 || daught == B1P || daught == B1M || daught == H1 ||
          daught == H1PR || daught == D1P1P || daught == D1P10 || daught == D1P1B ||
          daught == D1P1SP || daught == D1P1SN || daught == D1P1N ||
          daught == K10 || daught == K1B || daught == K1P || daught == K1M ) {
         EvtISGW1FF1P1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
     }
     if ( daught == RHO2S0 || daught == RHO2SP || daught == RHO2SM ||
          daught == OMEG2S || daught == D23S1P || daught == D23S1B ||
          daught == D23S1N || daught == D23S10 ) {
         EvtISGW1FF23S1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
     }
     if ( daught == A10 || daught == A1P || daught == A1M || daught == F1 ||
          daught == F1PR || daught == D3P1P || daught == D3P10 ||
          daught == D3P1B || daught == D3P1N || daught == K1STM ||
          daught == K1STB || daught == K1STP || daught == D3P1SP ||
          daught == D3P1SN || daught == K1ST0 ) {
         EvtISGW1FF3P1( parent, daught, t, mass, &ff, &gf, &apf, &amf );
     }
 
     // Need to stuff in some factors to make these the ffs that
     // is used elsewhere...
 
     double mb = EvtPDL::getMeanMass( parent );
 
     *vf = ( gf ) * ( mb + mass );
     *a1f = ( ff ) / ( mb + mass );
     *a2f = -1.0 * ( apf ) * ( mb + mass );
     double a3f = ( ( mb + mass ) / ( 2.0 * mass ) ) * ( *a1f ) -
                  ( ( mb - mass ) / ( 2.0 * mass ) ) * ( *a2f );
 
     *a0f = a3f - ( ( t * amf ) / ( 2.0 * mass ) );
 
     return;
 }
 
 void EvtISGWFF::EvtISGW1FF3P2( EvtId parent, EvtId daugt, double t, double mass,
                                double* hf, double* kf, double* bpf, double* bmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D3P2P = EvtPDL::getId( "D_2*+" );
-    static EvtId D3P2N = EvtPDL::getId( "D_2*-" );
-    static EvtId D3P20 = EvtPDL::getId( "D_2*0" );
-    static EvtId D3P2B = EvtPDL::getId( "anti-D_2*0" );
+    static const EvtId D3P2P = EvtPDL::getId( "D_2*+" );
+    static const EvtId D3P2N = EvtPDL::getId( "D_2*-" );
+    static const EvtId D3P20 = EvtPDL::getId( "D_2*0" );
+    static const EvtId D3P2B = EvtPDL::getId( "anti-D_2*0" );
 
-    static EvtId A2P = EvtPDL::getId( "a_2+" );
-    static EvtId A2M = EvtPDL::getId( "a_2-" );
-    static EvtId A20 = EvtPDL::getId( "a_20" );
+    static const EvtId A2P = EvtPDL::getId( "a_2+" );
+    static const EvtId A2M = EvtPDL::getId( "a_2-" );
+    static const EvtId A20 = EvtPDL::getId( "a_20" );
 
-    static EvtId F2 = EvtPDL::getId( "f_2" );
-    static EvtId F2PR = EvtPDL::getId( "f'_2" );
+    static const EvtId F2 = EvtPDL::getId( "f_2" );
+    static const EvtId F2PR = EvtPDL::getId( "f'_2" );
 
     double mtb;
     double msd( 0.0 ), mx( 0.0 ), mb( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mtx, f5;
     double mum, mup, tm, bb2( 0.0 ), bbx2;
     double msb( 0.0 ), kap;
 
     if ( parent == BM || parent == BP || parent == B0 || parent == B0B ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.41 * 0.41;
         if ( daugt == A20 || daugt == A2P || daugt == A2M || daugt == F2 ||
              daugt == F2PR ) {
             msq = 0.33;
             bx2 = 0.27 * 0.27;
         } else {
             if ( daugt == D3P2P || daugt == D3P2N || daugt == D3P2B ||
                  daugt == D3P20 ) {
                 msq = 1.82;
                 bx2 = 0.34 * 0.34;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_3P1.\n";
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Not implemented parent in get_isgw_ff_3P1.\n";
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
 
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
     kap = 0.7 * 0.7;
 
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     *hf = f5 * ( msd / ( sqrt( 8.0 * bb2 ) * mtb ) ) *
           ( ( 1.0 / msq ) - ( msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) );
 
     *kf = f5 * msd * sqrt( 2.0 / bb2 );
 
     *bpf = ( -1.0 * f5 * msd / ( sqrt( 8.0 * bb2 ) * msb * mtx ) ) *
            ( 1.0 - ( msd * msb * bx2 / ( 2.0 * mup * mtb * bbx2 ) ) +
              ( msd * msb * bx2 * ( 1.0 - ( msd * bx2 / ( 2.0 * mtb * bbx2 ) ) ) /
                ( 4.0 * mtb * mum * bbx2 ) ) );
     *bmf = 0.0;
     return;
 }    //get_ff_isgw_1p1
 
 void EvtISGWFF::EvtISGW1FF1S0( EvtId parent, EvtId daugt, double t, double mass,
                                double* fpf, double* fmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
 
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
 
-    static EvtId ETA = EvtPDL::getId( "eta" );
-    static EvtId ETAPR = EvtPDL::getId( "eta'" );
+    static const EvtId ETA = EvtPDL::getId( "eta" );
+    static const EvtId ETAPR = EvtPDL::getId( "eta'" );
 
     double mtb;
     double msd( 0.0 ), mx( 0.0 ), mb( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mtx;
     double f3, kap;
     double msb( 0.0 ), bb2( 0.0 ), mup, mum, bbx2, tm;
 
     if ( parent == BM || parent == BP || parent == B0 || parent == B0B ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.41 * 0.41;
         if ( daugt == PIP || daugt == PIM || daugt == PI0 || daugt == ETA ||
              daugt == ETAPR ) {
             msq = 0.33;
             bx2 = 0.31 * 0.31;
         } else {
             if ( daugt == D0 || daugt == DP || daugt == DM || daugt == D0B ) {
                 msq = 1.82;
                 bx2 = 0.39 * 0.39;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_1S0.\n";
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Not implemented parent in get_isgw_ff_1S0.\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Parent:" << parent.getId() << endl;
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
     mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     kap = 0.7 * 0.7;
     f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 3.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     *fpf = f3 * ( 1 + ( msb / ( 2.0 * mum ) ) -
                   ( msb * msq * msd * bb2 / ( 4.0 * mup * mum * mtx * bbx2 ) ) );
     *fmf = f3 * ( 1.0 - ( mtb + mtx ) *
                             ( 0.5 / msq -
                               ( msd * bb2 / ( 4.0 * mup * mtx * bbx2 ) ) ) );
 
     return;
 }    //get_ff_isgw_1s0
 
 void EvtISGWFF::EvtISGW1FF3S1( EvtId parent, EvtId daugt, double t, double mass,
                                double* f, double* g, double* ap, double* am )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId DST0 = EvtPDL::getId( "D*0" );
-    static EvtId DSTB = EvtPDL::getId( "anti-D*0" );
-    static EvtId DSTP = EvtPDL::getId( "D*+" );
-    static EvtId DSTM = EvtPDL::getId( "D*-" );
+    static const EvtId DST0 = EvtPDL::getId( "D*0" );
+    static const EvtId DSTB = EvtPDL::getId( "anti-D*0" );
+    static const EvtId DSTP = EvtPDL::getId( "D*+" );
+    static const EvtId DSTM = EvtPDL::getId( "D*-" );
 
-    static EvtId RHOP = EvtPDL::getId( "rho+" );
-    static EvtId RHOM = EvtPDL::getId( "rho-" );
-    static EvtId RHO0 = EvtPDL::getId( "rho0" );
+    static const EvtId RHOP = EvtPDL::getId( "rho+" );
+    static const EvtId RHOM = EvtPDL::getId( "rho-" );
+    static const EvtId RHO0 = EvtPDL::getId( "rho0" );
 
-    static EvtId OMEG = EvtPDL::getId( "omega" );
+    static const EvtId OMEG = EvtPDL::getId( "omega" );
 
     double msd( 0.0 ), msq( 0.0 ), bb2( 0.0 ), mum, mtx, bbx2;
     double bx2( 0.0 ), msb( 0.0 ), tm;
     double mb, mx, f3, kap;
 
     if ( parent == BM || parent == BP || parent == B0 || parent == B0B ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.41 * 0.41;
         if ( daugt == DSTP || daugt == DSTM || daugt == DSTB || daugt == DST0 ) {
             msq = 1.82;
             bx2 = 0.39 * 0.39;
         } else {
             if ( daugt == RHOP || daugt == RHOM || daugt == RHO0 ||
                  daugt == OMEG ) {
                 msq = 0.33;
                 bx2 = 0.31 * 0.31;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_3S1.\n";
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Not implemented parent in get_isgw_ff_3S1.\n";
     }
 
     double mtb;
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     kap = 0.7 * 0.7;
     f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 3.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     *f = 2.0 * mtb * f3;
     *g = 0.5 * f3 * ( ( 1 / msq ) - ( msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) );
     *ap = ( -1.0 * f3 / ( 2.0 * mtx ) ) *
           ( 1.0 + ( msd * ( bb2 - bx2 ) / ( msb * ( bb2 + bx2 ) ) ) -
             ( msd * msd * bx2 * bx2 / ( 4.0 * mum * mtb * bbx2 * bbx2 ) ) );
     *am = 0.0;
 }
 
 void EvtISGWFF::EvtISGW1FF23S1( EvtId parent, EvtId daugt, double t,
                                 double mass, double* fpf, double* gpf,
                                 double* appf, double* apmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D23S1P = EvtPDL::getId( "hi" );
-    static EvtId D23S1N = EvtPDL::getId( "hi" );
-    static EvtId D23S10 = EvtPDL::getId( "hi" );
-    static EvtId D23S1B = EvtPDL::getId( "hi" );
+    static const EvtId D23S1P = EvtPDL::getId( "hi" );
+    static const EvtId D23S1N = EvtPDL::getId( "hi" );
+    static const EvtId D23S10 = EvtPDL::getId( "hi" );
+    static const EvtId D23S1B = EvtPDL::getId( "hi" );
 
-    static EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
-    static EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
-    static EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
-    static EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
+    static const EvtId RHO2S0 = EvtPDL::getId( "rho(2S)0" );
+    static const EvtId RHO2SP = EvtPDL::getId( "rho(2S)+" );
+    static const EvtId RHO2SM = EvtPDL::getId( "rho(2S)-" );
+    static const EvtId OMEG2S = EvtPDL::getId( "omega(2S)" );
 
     double mtb;
     double msd( 0.0 ), mx( 0.0 ), mb( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mtx;
     double f3, f5, tt;
     double mum, bb2( 0.0 ), bbx2, tm, msb( 0.0 );
 
     if ( parent == BM || parent == BP || parent == B0 || parent == B0B ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.41 * 0.41;
         if ( daugt == RHO2SP || daugt == RHO2SM || daugt == RHO2S0 ||
              daugt == OMEG2S ) {
             msq = 0.33;
             bx2 = 0.31 * 0.31;
         } else {
             if ( daugt == D23S1N || daugt == D23S10 || daugt == D23S1P ||
                  daugt == D23S1B ) {
                 msq = 1.82;
                 bx2 = 0.39 * 0.39;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_23P1.\n";
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Not implemented parent in get_isgw_ff_23P1.\n";
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     double kap = 0.7 * 0.7;
     f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 3.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     *fpf = sqrt( 6.0 ) * f3 * mtb *
            ( ( ( bb2 - bx2 ) / ( bb2 + bx2 ) ) +
              ( ( msd * msd * bx2 * ( tm - t ) ) /
                ( 6.0 * mtx * mtb * bbx2 * kap * bbx2 ) ) );
 
     *gpf = sqrt( 3.0 / 8.0 ) * f3 *
            ( ( ( ( ( bb2 - bx2 ) / ( bb2 + bx2 ) ) +
                  ( ( msd * msd * bx2 * ( tm - t ) ) /
                    ( 6.0 * mtx * mtb * bbx2 * kap * bbx2 ) ) ) *
                ( ( 1.0 / msq ) - ( ( msd * bb2 ) / ( 2.0 * mum * mtx * bbx2 ) ) ) ) +
              ( ( msd * bb2 * bx2 ) / ( 3.0 * mum * mtx * bbx2 * bbx2 ) ) );
 
     tt = ( msd * msd * bx2 * ( tm - t ) ) / ( mtx * mtb * bb2 * kap * bbx2 );
 
     *appf = ( f5 / ( sqrt( 6.0 ) * mtx ) ) *
             ( ( ( 3.0 * mtb * bbx2 / ( 2.0 * msb * sqrt( bb2 * bx2 ) ) ) *
                 ( 1.0 - ( ( msd * msd * msb * bx2 * bx2 ) /
                           ( 4.0 * mtb * mtb * mum * bbx2 * bbx2 ) ) ) ) -
               ( ( 3.0 * msd * sqrt( bx2 / bb2 ) ) / ( 2.0 * msb ) ) +
               ( ( 5.0 * msd * sqrt( bx2 * bb2 ) * ( 1.0 + 0.1 * tt ) ) /
                 ( 2.0 * msb * bbx2 ) ) -
               ( ( 3.0 * mtb * sqrt( bb2 / bx2 ) * ( 1.0 + ( tt / 6.0 ) ) ) /
                 ( 2.0 * msb ) ) +
               ( ( 7.0 * msd * msd * sqrt( bb2 / bx2 ) * bx2 * bx2 *
                   ( 1.0 + ( tt / 14.0 ) ) ) /
                 ( 8.0 * mtb * mum * bbx2 * bbx2 ) ) );
 
     *apmf = 0.0;
     return;
 }    //get_ff_isgw_23s1
 
 void EvtISGWFF::EvtISGW1FF3P1( EvtId parent, EvtId daugt, double t, double mass,
                                double* lf, double* qf, double* cpf, double* cmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D3P1P = EvtPDL::getId( "D'_1+" );
-    static EvtId D3P1N = EvtPDL::getId( "D'_1-" );
-    static EvtId D3P10 = EvtPDL::getId( "D'_10" );
-    static EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
+    static const EvtId D3P1P = EvtPDL::getId( "D'_1+" );
+    static const EvtId D3P1N = EvtPDL::getId( "D'_1-" );
+    static const EvtId D3P10 = EvtPDL::getId( "D'_10" );
+    static const EvtId D3P1B = EvtPDL::getId( "anti-D'_10" );
 
-    static EvtId A1P = EvtPDL::getId( "a_1+" );
-    static EvtId A1M = EvtPDL::getId( "a_1-" );
-    static EvtId A10 = EvtPDL::getId( "a_10" );
+    static const EvtId A1P = EvtPDL::getId( "a_1+" );
+    static const EvtId A1M = EvtPDL::getId( "a_1-" );
+    static const EvtId A10 = EvtPDL::getId( "a_10" );
 
-    static EvtId F1 = EvtPDL::getId( "f_1" );
-    static EvtId F1PR = EvtPDL::getId( "f'_1" );
+    static const EvtId F1 = EvtPDL::getId( "f_1" );
+    static const EvtId F1PR = EvtPDL::getId( "f'_1" );
 
     double mtb;
     double msd( 0.0 ), mx( 0.0 ), mb( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mtx, f5;
     double msb( 0.0 ), bb2( 0.0 ), mum, bbx2, tm;
     double kap;
 
     if ( parent == BM || parent == BP || parent == B0 || parent == B0B ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.41 * 0.41;
         if ( daugt == A10 || daugt == A1P || daugt == A1M || daugt == F1 ||
              daugt == F1PR ) {
             msq = 0.33;
             bx2 = 0.27 * 0.27;
         } else {
             if ( daugt == D3P1P || daugt == D3P1N || daugt == D3P1B ||
                  daugt == D3P10 ) {
                 msq = 1.82;
                 bx2 = 0.34 * 0.34;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_3P1.\n";
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Not implemented parent in get_isgw_ff_3P1.\n";
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     kap = 0.7 * 0.7;
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     *qf = ( f5 * msd ) / ( 2.0 * mtx * sqrt( bb2 ) );
 
     *lf = -1.0 * mtb * sqrt( bb2 ) * f5 *
           ( 1 / mum + ( msd * ( tm - t ) / ( 2.0 * mtb * kap * bb2 ) ) *
                           ( ( 1.0 / msq ) -
                             ( 1.0 * msd * bb2 / ( 2.0 * mum * mtx * bbx2 ) ) ) );
 
     *cpf = ( f5 * msd * msb / ( 4.0 * mtb * sqrt( bb2 ) * mum ) ) *
            ( 1.0 - ( msd * msq * bb2 / ( 2.0 * mtx * mum * bbx2 ) ) );
     *cmf = 0.0;
     return;
 }    //get_ff_isgw_3p1
 
 void EvtISGWFF::EvtISGW1FF3P0( EvtId parent, EvtId daugt, double t, double mass,
                                double* upf, double* umf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D3P0P = EvtPDL::getId( "D_0*+" );
-    static EvtId D3P0N = EvtPDL::getId( "D_0*-" );
-    static EvtId D3P00 = EvtPDL::getId( "D_0*0" );
-    static EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
+    static const EvtId D3P0P = EvtPDL::getId( "D_0*+" );
+    static const EvtId D3P0N = EvtPDL::getId( "D_0*-" );
+    static const EvtId D3P00 = EvtPDL::getId( "D_0*0" );
+    static const EvtId D3P0B = EvtPDL::getId( "anti-D_0*0" );
 
-    static EvtId A0P = EvtPDL::getId( "a_0+" );
-    static EvtId A0M = EvtPDL::getId( "a_0-" );
-    static EvtId A00 = EvtPDL::getId( "a_00" );
+    static const EvtId A0P = EvtPDL::getId( "a_0+" );
+    static const EvtId A0M = EvtPDL::getId( "a_0-" );
+    static const EvtId A00 = EvtPDL::getId( "a_00" );
 
-    static EvtId F0 = EvtPDL::getId( "f_0" );
-    static EvtId F0PR = EvtPDL::getId( "f'_0" );
+    static const EvtId F0 = EvtPDL::getId( "f_0" );
+    static const EvtId F0PR = EvtPDL::getId( "f'_0" );
 
     double mtb;
     double msd( 0.0 ), mx( 0.0 ), mb( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mtx;
     double f5;
     double mum, bb2( 0.0 ), bbx2, msb( 0.0 ), tm;
 
     if ( parent == BM || parent == BP || parent == B0 || parent == B0B ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.41 * 0.41;
         if ( daugt == A00 || daugt == A0P || daugt == A0M || daugt == F0 ||
              daugt == F0PR ) {
             msq = 0.33;
             bx2 = 0.27 * 0.27;
         } else {
             if ( daugt == D3P0P || daugt == D3P0N || daugt == D3P0B ||
                  daugt == D3P00 ) {
                 msq = 1.82;
                 bx2 = 0.34 * 0.34;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_3P0.\n";
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Not implemented parent in get_isgw_ff_3P0.\n";
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     double kap = 0.7 * 0.7;
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     *upf = f5 * msd * msq * msb / ( sqrt( 6.0 * bb2 ) * mtx * mum );
     *umf = 0.0;
     return;
 }    //get_ff_isgw_3p0
 
 void EvtISGWFF::EvtISGW1FF1P1( EvtId parent, EvtId daugt, double t, double mass,
                                double* vf, double* rf, double* spf, double* smf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D1P1P = EvtPDL::getId( "D_1+" );
-    static EvtId D1P1N = EvtPDL::getId( "D_1-" );
-    static EvtId D1P10 = EvtPDL::getId( "D_10" );
-    static EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
+    static const EvtId D1P1P = EvtPDL::getId( "D_1+" );
+    static const EvtId D1P1N = EvtPDL::getId( "D_1-" );
+    static const EvtId D1P10 = EvtPDL::getId( "D_10" );
+    static const EvtId D1P1B = EvtPDL::getId( "anti-D_10" );
 
-    static EvtId B1P = EvtPDL::getId( "b_1+" );
-    static EvtId B1M = EvtPDL::getId( "b_1-" );
-    static EvtId B10 = EvtPDL::getId( "b_10" );
+    static const EvtId B1P = EvtPDL::getId( "b_1+" );
+    static const EvtId B1M = EvtPDL::getId( "b_1-" );
+    static const EvtId B10 = EvtPDL::getId( "b_10" );
 
-    static EvtId H1 = EvtPDL::getId( "h_1" );
-    static EvtId H1PR = EvtPDL::getId( "h'_1" );
+    static const EvtId H1 = EvtPDL::getId( "h_1" );
+    static const EvtId H1PR = EvtPDL::getId( "h'_1" );
 
     double mtb;
     double msd( 0.0 ), mx( 0.0 ), mb( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mtx, f5;
     double mup, mum, kap;
     double msb( 0.0 ), bb2( 0.0 ), bbx2, tm;
 
     if ( parent == BM || parent == BP || parent == B0 || parent == B0B ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.41 * 0.41;
         if ( daugt == H1 || daugt == H1PR || daugt == B10 || daugt == B1P ||
              daugt == B1M ) {
             msq = 0.33;
             bx2 = 0.27 * 0.27;
         } else {
             if ( daugt == D1P1P || daugt == D1P1N || daugt == D1P10 ||
                  daugt == D1P1B ) {
                 msq = 1.82;
                 bx2 = 0.34 * 0.34;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw_ff_3P1.\n";
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Not implemented parent in get_isgw_ff_3P1.\n";
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     kap = 0.7 * 0.7;
     f5 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 5.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     *vf = f5 *
           ( ( ( mtb * sqrt( bb2 ) ) / ( 4.0 * sqrt( 2.0 ) * msb * msq * mtx ) ) );
     *rf = f5 * mtb * sqrt( bb2 / 2 ) * ( ( 1.0 / mup ) );
 
     *spf = ( f5 * msd / ( sqrt( 2.0 * bb2 ) * mtb ) ) *
            ( 1.0 + ( msb / ( 2.0 * mum ) ) -
              ( msb * msq * msd * bb2 / ( 4.0 * mup * mum * mtx * bbx2 ) ) );
     *smf = 0.0;
 
     return;
     //get_ff_isgw_1p1
 }
 
 void EvtISGWFF::EvtISGW1FF21S0( EvtId parent, EvtId daugt, double t,
                                 double mass, double* fppf, double* fpmf )
 {
     //added by Lange Jan4,2000
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId D21S0P = EvtPDL::getId( "hi" );
-    static EvtId D21S0N = EvtPDL::getId( "hi" );
-    static EvtId D21S00 = EvtPDL::getId( "hi" );
-    static EvtId D21S0B = EvtPDL::getId( "hi" );
+    static const EvtId D21S0P = EvtPDL::getId( "hi" );
+    static const EvtId D21S0N = EvtPDL::getId( "hi" );
+    static const EvtId D21S00 = EvtPDL::getId( "hi" );
+    static const EvtId D21S0B = EvtPDL::getId( "hi" );
 
-    static EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
+    static const EvtId ETA2S = EvtPDL::getId( "eta(2S)" );
 
-    static EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
-    static EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
-    static EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
+    static const EvtId PI2S0 = EvtPDL::getId( "pi(2S)0" );
+    static const EvtId PI2SP = EvtPDL::getId( "pi(2S)+" );
+    static const EvtId PI2SM = EvtPDL::getId( "pi(2S)-" );
 
     double mtb;
     double msd( 0.0 ), mx( 0.0 ), mb( 0.0 );
     double msq( 0.0 ), bx2( 0.0 ), mtx;
     double f3;
     double msb( 0.0 );
     double mum, mup, tm, bb2( 0.0 ), bbx2;
 
     if ( parent == BM || parent == BP || parent == B0 || parent == B0B ) {
         msb = 5.2;
         msd = 0.33;
         bb2 = 0.41 * 0.41;
         if ( daugt == PI2S0 || daugt == PI2SP || daugt == PI2SM ||
              daugt == ETA2S ) {
             msq = 0.33;
             bx2 = 0.31 * 0.31;
         } else {
             if ( daugt == D21S00 || daugt == D21S0P || daugt == D21S0N ||
                  daugt == D21S0B ) {
                 msq = 1.82;
                 bx2 = 0.39 * 0.39;
             } else {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "Not implemented daugt in get_isgw1_ff_21S0.\n";
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Not implemented parent in get_isgw1_ff_21S0.\n";
     }
 
     mtb = msb + msd;
     mtx = msq + msd;
 
     mb = EvtPDL::getMeanMass( parent );
     mx = mass;
 
     mup = 1.0 / ( 1.0 / msq + 1.0 / msb );
     mum = 1.0 / ( 1.0 / msq - 1.0 / msb );
     bbx2 = 0.5 * ( bb2 + bx2 );
     tm = ( mb - mx ) * ( mb - mx );
     if ( t > tm )
         t = 0.99 * tm;
 
     double kap = 0.7 * 0.7;
     f3 = sqrt( mtx / mtb ) * pow( sqrt( bx2 * bb2 ) / bbx2, 3.0 / 2.0 ) *
          exp( -1.0 *
               ( ( msd * msd * ( tm - t ) / ( 4.0 * mtb * mtx * kap * bbx2 ) ) ) );
 
     *fppf = f3 * sqrt( 3.0 / 8.0 ) * ( msb / mup ) *
             ( ( ( bb2 - bx2 ) / ( bb2 + bx2 ) ) +
               ( ( ( msq * msd * bb2 ) / ( 3.0 * mum * mtx * bbx2 ) ) *
                 ( ( 7.0 * bx2 - 3.0 * bb2 ) / ( 4.0 * bbx2 ) ) ) +
               ( ( ( msd * msd * bx2 * ( tm - t ) ) /
                   ( 6.0 * mtx * mtb * bbx2 * kap * bbx2 ) ) *
                 ( 1.0 - ( ( msq * msd * bb2 ) / ( 2.0 * mum * mtx * bbx2 ) ) ) ) );
 
     *fpmf = 0.0;
     return;
 }    //get_ff_isgw_21s0
 
 void EvtISGWFF::getbaryonff( EvtId, EvtId, double, double, double*, double*,
                              double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getbaryonff in EvtISGWFF.\n";
     ::abort();
 }
 
 void EvtISGWFF::getdiracff( EvtId, EvtId, double, double, double*, double*,
                             double*, double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getdiracff in EvtISGWFF.\n";
     ::abort();
 }
 
 void EvtISGWFF::getraritaff( EvtId, EvtId, double, double, double*, double*,
                              double*, double*, double*, double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getraritaff in EvtISGWFF.\n";
     ::abort();
 }
diff --git a/src/EvtGenModels/EvtKKLambdaC.cpp b/src/EvtGenModels/EvtKKLambdaC.cpp
index a7ffff2..f118403 100644
--- a/src/EvtGenModels/EvtKKLambdaC.cpp
+++ b/src/EvtGenModels/EvtKKLambdaC.cpp
@@ -1,81 +1,81 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtKKLambdaC.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicBaryonAmp.hh"
 
 #include "EvtGenModels/EvtKKLambdaCFF.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtKKLambdaC::getName()
+std::string EvtKKLambdaC::getName() const
 {
     return "KK_LAMBDAC_SL";
 }
 
-EvtDecayBase* EvtKKLambdaC::clone()
+EvtDecayBase* EvtKKLambdaC::clone() const
 {
     return new EvtKKLambdaC;
 }
 
 void EvtKKLambdaC::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     m_calcamp->CalcAmp( p, m_amp2, m_ffmodel.get() );
 }
 
 void EvtKKLambdaC::initProbMax()
 {
     EvtId parnum, mesnum, lnum, nunum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
     nunum = getDaug( 2 );
 
     //double mymaxprob = m_calcamp->CalcMaxProb(parnum,mesnum,
     //                           lnum,nunum,m_ffmodel);
     double mymaxprob = 1e3;
     setProbMax( mymaxprob );
 }
 
 void EvtKKLambdaC::init()
 {
     checkNDaug( 3 );
 
     //We expect the parent to be a dirac
     //and the daughters to be dirac lepton neutrino
 
     checkSpinParent( EvtSpinType::DIRAC );
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     m_ffmodel = std::make_unique<EvtKKLambdaCFF>( getNArg(), getArgs() );
 
     m_calcamp = std::make_unique<EvtSemiLeptonicBaryonAmp>();
 }
diff --git a/src/EvtGenModels/EvtKstarnunu.cpp b/src/EvtGenModels/EvtKstarnunu.cpp
index 76847e9..0f9a787 100644
--- a/src/EvtGenModels/EvtKstarnunu.cpp
+++ b/src/EvtGenModels/EvtKstarnunu.cpp
@@ -1,138 +1,138 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtKstarnunu.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtKstarnunu::getName()
+std::string EvtKstarnunu::getName() const
 {
     return "KSTARNUNU";
 }
 
-EvtDecayBase* EvtKstarnunu::clone()
+EvtDecayBase* EvtKstarnunu::clone() const
 {
     return new EvtKstarnunu;
 }
 
 void EvtKstarnunu::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be K neutrino netrino
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::NEUTRINO );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 }
 
 void EvtKstarnunu::initProbMax()
 {
     setProbMax( 7000.0 );
 }
 
 void EvtKstarnunu::decay( EvtParticle* p )
 {
-    static EvtId NUE = EvtPDL::getId( "nu_e" );
-    static EvtId NUM = EvtPDL::getId( "nu_mu" );
-    static EvtId NUT = EvtPDL::getId( "nu_tau" );
-    static EvtId NUEB = EvtPDL::getId( "anti-nu_e" );
-    static EvtId NUMB = EvtPDL::getId( "anti-nu_mu" );
-    static EvtId NUTB = EvtPDL::getId( "anti-nu_tau" );
+    static const EvtId NUE = EvtPDL::getId( "nu_e" );
+    static const EvtId NUM = EvtPDL::getId( "nu_mu" );
+    static const EvtId NUT = EvtPDL::getId( "nu_tau" );
+    static const EvtId NUEB = EvtPDL::getId( "anti-nu_e" );
+    static const EvtId NUMB = EvtPDL::getId( "anti-nu_mu" );
+    static const EvtId NUTB = EvtPDL::getId( "anti-nu_tau" );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     double m_b = p->mass();
 
     EvtParticle *meson, *neutrino1, *neutrino2;
     meson = p->getDaug( 0 );
     neutrino1 = p->getDaug( 1 );
     neutrino2 = p->getDaug( 2 );
     EvtVector4R momnu1 = neutrino1->getP4();
     EvtVector4R momnu2 = neutrino2->getP4();
     EvtVector4R momkstar = meson->getP4();
 
     double v0_0, a1_0, a2_0;
     double m2v0, a1_b, a2_b;
     v0_0 = 0.47;
     a1_0 = 0.37;
     a2_0 = 0.40;
     m2v0 = 5. * 5.;
     a1_b = -0.023;
     a2_b = 0.034;
 
     EvtVector4R q = momnu1 + momnu2;
     double q2 = q.mass2();
 
     double v0, a1, a2;
     v0 = v0_0 / ( 1 - q2 / m2v0 );
     a1 = a1_0 * ( 1 + a1_b * q2 );
     a2 = a2_0 * ( 1 + a2_b * q2 );
 
     EvtVector4R p4b;
     p4b.set( m_b, 0., 0., 0. );    // Do calcs in mother rest frame
 
     double m_k = meson->mass();
 
     EvtTensor4C tds = ( -2 * v0 / ( m_b + m_k ) ) *
                           dual( EvtGenFunctions::directProd( p4b, momkstar ) ) -
                       EvtComplex( 0.0, 1.0 ) *
                           ( ( m_b + m_k ) * a1 * EvtTensor4C::g() -
                             ( a2 / ( m_b + m_k ) ) *
                                 EvtGenFunctions::directProd( p4b - momkstar,
                                                              p4b + momkstar ) );
 
     EvtVector4C l;
 
     if ( getDaug( 1 ) == NUE || getDaug( 1 ) == NUM || getDaug( 1 ) == NUT ) {
         l = EvtLeptonVACurrent( neutrino1->spParentNeutrino(),
                                 neutrino2->spParentNeutrino() );
     }
     if ( getDaug( 1 ) == NUEB || getDaug( 1 ) == NUMB || getDaug( 1 ) == NUTB ) {
         l = EvtLeptonVACurrent( neutrino2->spParentNeutrino(),
                                 neutrino1->spParentNeutrino() );
     }
 
     EvtVector4C et0, et1, et2;
     et0 = tds.cont1( meson->epsParent( 0 ).conj() );
     et1 = tds.cont1( meson->epsParent( 1 ).conj() );
     et2 = tds.cont1( meson->epsParent( 2 ).conj() );
 
     vertex( 0, l * et0 );
     vertex( 1, l * et1 );
     vertex( 2, l * et2 );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtLNuGamma.cpp b/src/EvtGenModels/EvtLNuGamma.cpp
index e136d86..68205f3 100644
--- a/src/EvtGenModels/EvtLNuGamma.cpp
+++ b/src/EvtGenModels/EvtLNuGamma.cpp
@@ -1,162 +1,162 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLNuGamma.hh"
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtLNuGamma::getName()
+std::string EvtLNuGamma::getName() const
 {
     return "LNUGAMMA";
 }
 
-EvtDecayBase* EvtLNuGamma::clone()
+EvtDecayBase* EvtLNuGamma::clone() const
 {
     return new EvtLNuGamma;
 }
 
 void EvtLNuGamma::init()
 {
     // check that there are 3 or 4 arguments
     checkNArg( 3, 4 );
     checkNDaug( 3 );
 
     if ( getNArg() == 4 ) {
         //      Argv[3] is a flag set to 0 if abs(f_a/f_v) is 1
         //       and not set to 0 if f_a/f_v is set to 0.
         if ( getArg( 3 ) > 0 ) {
             m_fafvzero = true;
         } else {
             m_fafvzero = false;
         }
     } else {
         m_fafvzero = false;
     }
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::NEUTRINO );
     checkSpinDaughter( 2, EvtSpinType::PHOTON );
 }
 
 void EvtLNuGamma::initProbMax()
 {
     setProbMax( 7000.0 );
 }
 
 void EvtLNuGamma::decay( EvtParticle* p )
 {
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex myI( 0, 1 );
 
     EvtParticle *lept, *neut, *phot;
     lept = p->getDaug( 0 );
     neut = p->getDaug( 1 );
     phot = p->getDaug( 2 );
 
     EvtVector4C lept1, lept2, photon1, photon2;
 
     if ( p->getId() == BM || p->getId() == DM ) {
         lept1 = EvtLeptonVACurrent( lept->spParent( 0 ),
                                     neut->spParentNeutrino() );
         lept2 = EvtLeptonVACurrent( lept->spParent( 1 ),
                                     neut->spParentNeutrino() );
     } else {
         lept1 = EvtLeptonVACurrent( neut->spParentNeutrino(),
                                     lept->spParent( 0 ) );
         lept2 = EvtLeptonVACurrent( neut->spParentNeutrino(),
                                     lept->spParent( 1 ) );
     }
 
     EvtVector4R photp = phot->getP4();    // Photon 4-momentum in parent rest frame
     double photE = photp.get( 0 );        // Photon energy in parent rest frame
 
     EvtVector4C photone1 = phot->epsParentPhoton( 0 ).conj();
     EvtVector4C photone2 = phot->epsParentPhoton( 1 ).conj();
 
     EvtVector4R parVelocity( 1, 0, 0, 0 );    // Parent velocity in parent rest-frame
 
     double fv, fa;
 
     fv = getFormFactor( photE );
     if ( m_fafvzero ) {
         fa = 0.0;
     } else if ( p->getId() == BM || p->getId() == DM ) {
         fa = -fv;
     } else {
         fa = fv;
     }
 
     EvtVector4C temp1a =
         dual( EvtGenFunctions::directProd( parVelocity, photp ) ).cont2( photone1 );
     EvtVector4C temp2a =
         dual( EvtGenFunctions::directProd( parVelocity, photp ) ).cont2( photone2 );
 
     EvtVector4C temp1b = ( photone1 ) * ( parVelocity * photp );
     EvtVector4C temp1c = ( photp ) * ( photone1 * parVelocity );
 
     EvtVector4C temp2b = ( photone2 ) * ( parVelocity * photp );
     EvtVector4C temp2c = ( photp ) * ( photone2 * parVelocity );
 
     photon1 = ( temp1a * fv ) + ( myI * fa * ( temp1b - temp1c ) );
     photon2 = ( temp2a * fv ) + ( myI * fa * ( temp2b - temp2c ) );
 
     vertex( 0, 0, lept1.cont( photon1 ) );
     vertex( 0, 1, lept1.cont( photon2 ) );
     vertex( 1, 0, lept2.cont( photon1 ) );
     vertex( 1, 1, lept2.cont( photon2 ) );
 
     return;
 }
 
 double EvtLNuGamma::getFormFactor( double photonEnergy )
 {
     // Arg[0] = photon mass cutoff (GeV)
     // Arg[1] = R (GeV^(-1))
     // Arg[2] = m_b (GeV)
     // Using Korchemsky et al. Phy Rev D 61 (2000) 114510
     // Up to a constant
 
     double formFactor = 0;
     double qu = 2. / 3.;
     double qb = -1. / 3.;
 
     if ( photonEnergy > getArg( 0 ) ) {
         formFactor = ( 1 / photonEnergy ) *
                      ( ( qu * getArg( 1 ) ) - ( qb / getArg( 2 ) ) );
     }
     return formFactor;
 }
diff --git a/src/EvtGenModels/EvtLambdaP_BarGamma.cpp b/src/EvtGenModels/EvtLambdaP_BarGamma.cpp
index e55fa10..936873d 100644
--- a/src/EvtGenModels/EvtLambdaP_BarGamma.cpp
+++ b/src/EvtGenModels/EvtLambdaP_BarGamma.cpp
@@ -1,156 +1,156 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLambdaP_BarGamma.hh"
 
 #include "EvtGenBase/EvtDiracParticle.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGammaMatrix.hh"
 #include "EvtGenBase/EvtPhotonParticle.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 
 #include <stdlib.h>
 using std::cout;
 using std::endl;
 
 EvtLambdaP_BarGamma::EvtLambdaP_BarGamma() :
     m_mLambdab( 5.624 ),       // Lambda_b mass
     m_mLambda0( 1.115684 ),    // Lambda0 mass
     m_c7Eff( -0.31 ),          // Wilson coefficient
     m_mb( 4.4 ),               // running b mass
     m_mV( 5.42 ),              // pole mass vector current
     m_mA( 5.86 ),              // pole mass axial current
     m_GF( 1.166E-5 ),          // Fermi constant
     m_gLambdab( 16 ),          // coupling constant Lambda_b -> B- p
     m_e0( 1 ),                 // electromagnetic coupling (+1)
     m_g1( 0.64 ),              // heavy-light form factors at q_mSqare
     m_g2( -0.10 ),
     m_f1( 0.64 ),
     m_f2( -0.31 ),
     m_VtbVtsStar( 0.038 )    // |V_tb V_ts^*|
 {
 }
 
-std::string EvtLambdaP_BarGamma::getName()
+std::string EvtLambdaP_BarGamma::getName() const
 {
     return "B_TO_LAMBDA_PBAR_GAMMA";
 }
 
-EvtDecayBase* EvtLambdaP_BarGamma::clone()
+EvtDecayBase* EvtLambdaP_BarGamma::clone() const
 {
     return new EvtLambdaP_BarGamma;
 }
 
 void EvtLambdaP_BarGamma::init()
 {
     // no arguments, daughter lambda p_bar gamma
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::PHOTON );
 }
 
 // initialize phasespace and calculate the amplitude
 void EvtLambdaP_BarGamma::decay( EvtParticle* p )
 {
     EvtComplex I( 0, 1 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtDiracParticle* theLambda = static_cast<EvtDiracParticle*>(
         p->getDaug( 0 ) );
     EvtVector4R lambdaMomentum = theLambda->getP4Lab();
 
     EvtDiracParticle* theAntiP = static_cast<EvtDiracParticle*>( p->getDaug( 1 ) );
 
     EvtPhotonParticle* thePhoton = static_cast<EvtPhotonParticle*>(
         p->getDaug( 2 ) );
     EvtVector4R photonMomentum =
         thePhoton->getP4Lab();    // get momentum in the same frame
 
     // loop over all possible spin states
     for ( int i = 0; i < 2; ++i ) {
         EvtDiracSpinor lambdaPol = theLambda->spParent( i );
         for ( int j = 0; j < 2; ++j ) {
             EvtDiracSpinor antiP_Pol = theAntiP->spParent( j );
             for ( int k = 0; k < 2; ++k ) {
                 EvtVector4C photonPol = thePhoton->epsParentPhoton(
                     k );    // one of two possible polarization states
                 EvtGammaMatrix photonGamma;    // sigma[mu][nu] * epsilon[mu] * k[nu] (watch lower indices)
                 for ( int mu = 0; mu < 4; ++mu )
                     for ( int nu = 0; nu < 4; ++nu )
                         photonGamma += EvtGammaMatrix::sigmaLower( mu, nu ) *
                                        photonPol.get( mu ) *
                                        photonMomentum.get( nu );
 
                 EvtComplex amp = -I * m_gLambdab * lambdaPol.adjoint() *
                                  ( ( constA() * EvtGammaMatrix::id() +
                                      constB() * EvtGammaMatrix::g5() ) *
                                    photonGamma *
                                    ( EvtGenFunctions::slash( lambdaMomentum ) +
                                      EvtGenFunctions::slash( photonMomentum ) +
                                      m_mLambdab * EvtGammaMatrix::id() ) /
                                    ( ( lambdaMomentum + photonMomentum ) *
                                          ( lambdaMomentum + photonMomentum ) -
                                      m_mLambdab * m_mLambdab ) *
                                    EvtGammaMatrix::g5() * antiP_Pol );
                 // use of parentheses so I do not have to define EvtDiracSpinor*EvtGammaMatrix, which shouldn't be defined to prevent errors in indexing
 
                 vertex( i, j, k, amp );
             }
         }
     }
 }
 
 void EvtLambdaP_BarGamma::initProbMax()
 {
     // setProbMax(1);
     setProbMax( 9.0000E-13 );    // found by trial and error
 }
 
 // form factors at 0
 double EvtLambdaP_BarGamma::f0( double fqm, int n ) const
 {
     return fqm *
            pow( 1 - pow( m_mLambdab - m_mLambda0, 2 ) / ( m_mV * m_mV ), n );
 }
 
 double EvtLambdaP_BarGamma::g0( double gqm, int n ) const
 {
     return gqm *
            pow( 1 - pow( m_mLambdab - m_mLambda0, 2 ) / ( m_mA * m_mA ), n );
 }
 
 double EvtLambdaP_BarGamma::constA() const
 {
     return m_GF / sqrt( 2. ) * m_e0 / ( 8 * EvtConst::pi * EvtConst::pi ) * 2 *
            m_c7Eff * m_mb * m_VtbVtsStar * ( f0( m_f1 ) - f0( m_f2 ) );
 }
 
 double EvtLambdaP_BarGamma::constB() const
 {
     return m_GF / sqrt( 2. ) * m_e0 / ( 8 * EvtConst::pi * EvtConst::pi ) * 2 *
            m_c7Eff * m_mb * m_VtbVtsStar *
            ( g0( m_g1 ) - ( m_mLambdab - m_mLambda0 ) /
                               ( m_mLambdab + m_mLambda0 ) * g0( m_g2 ) );
 }
diff --git a/src/EvtGenModels/EvtLambdacPHH.cpp b/src/EvtGenModels/EvtLambdacPHH.cpp
index b21bc57..c298b21 100644
--- a/src/EvtGenModels/EvtLambdacPHH.cpp
+++ b/src/EvtGenModels/EvtLambdacPHH.cpp
@@ -1,679 +1,679 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLambdacPHH.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtdFunction.hh"
 
 #include <algorithm>
 #include <cmath>
 #include <utility>
 
 EvtLambdacPHH::EvtLambdacPHH() :
     m_d1( 0 ),
     m_d2( 1 ),
     m_d3( 3 ),
     m_Nplusplus( 0.46 ),
     m_Nplusminus( 1.0 ),
     m_Nminusplus( 0.18 ),
     m_Nminusminus( 0.94 ),
     m_phiNplusplus( 3.48 ),
     m_phiNplusminus( 0.00 ),
     m_phiNminusplus( 0.75 ),
     m_phiNminusminus( 1.13 ),
     m_E1( 0.52 ),
     m_phiE1( -1.01 ),
     m_E2( 0.20 ),
     m_phiE2( 2.35 ),
     m_E3( 0.21 ),
     m_phiE3( 3.46 ),
     m_E4( 0.16 ),
     m_phiE4( 5.29 ),
     m_F1( 0.17 ),
     m_phiF1( 4.98 ),
     m_F2( 0.38 ),
     m_phiF2( 4.88 ),
     m_H1( 0.18 ),
     m_phiH1( 5.93 ),
     m_H2( 0.20 ),
     m_phiH2( -0.06 ),
     m_NRNorm( 1.0 ),
     m_KstarNorm( 1.0 ),
     m_DeltaNorm( 1.0 ),
     m_LambdaNorm( 1.0 ),
     m_KstarM( 0.890 ),
     m_KstarW( 0.0498 ),
     m_KstarR( 3.40 ),
     m_DeltaM( 1.232 ),
     m_DeltaW( 0.1120 ),
     m_DeltaR( 5.22 ),
     m_LambdaM( 1.520 ),
     m_LambdaW( 0.0156 ),
     m_LambdaR( 6.29 ),
     m_Lambda_cR( 5.07 ),
     m_zprime(),
     m_p4_Lambda_c(),
     m_zpMag( 0.0 ),
     m_p4_Lambdac_Mag( 0.0 )
 {
     // Fermilab E791 values from MINUIT fit arXiv:hep-ex/9912003v1
 }
 
-std::string EvtLambdacPHH::getName()
+std::string EvtLambdacPHH::getName() const
 {
     return "LAMBDAC_PHH";
 }
 
-EvtDecayBase* EvtLambdacPHH::clone()
+EvtDecayBase* EvtLambdacPHH::clone() const
 {
     return new EvtLambdacPHH;
 }
 
 bool compareId( const std::pair<EvtId, int>& left,
                 const std::pair<EvtId, int>& right )
 {
     // Compare id numbers to achieve the ordering K-, pi+ and p
     bool result( false );
 
     int leftPDGid = EvtPDL::getStdHep( left.first );
     int rightPDGid = EvtPDL::getStdHep( right.first );
 
     if ( leftPDGid < rightPDGid ) {
         result = true;
     }
 
     return result;
 }
 
 void EvtLambdacPHH::init()
 {
-    static EvtId KM = EvtPDL::getId( "K-" );
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId LAMBDAC = EvtPDL::getId( "Lambda_c+" );
-    static EvtId LAMBDACB = EvtPDL::getId( "anti-Lambda_c-" );
-    static EvtId PROTON = EvtPDL::getId( "p+" );
+    static const EvtId KM = EvtPDL::getId( "K-" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId LAMBDAC = EvtPDL::getId( "Lambda_c+" );
+    static const EvtId LAMBDACB = EvtPDL::getId( "anti-Lambda_c-" );
+    static const EvtId PROTON = EvtPDL::getId( "p+" );
 
     // check that there are 0 or 1 arguments and 3 daughters
     checkNArg( 0, 1 );
     checkNDaug( 3 );
 
     EvtId parnum = getParentId();
     checkSpinParent( EvtSpinType::DIRAC );
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 
     std::vector<std::pair<EvtId, int>> daughters;
     if ( parnum == LAMBDAC ) {
         for ( int i = 0; i < 3; ++i ) {
             daughters.push_back( std::make_pair( getDaug( i ), i ) );
         }
     } else {
         for ( int i = 0; i < 3; ++i ) {
             daughters.push_back(
                 std::make_pair( EvtPDL::chargeConj( getDaug( i ) ), i ) );
         }
     }
 
     // Sort daughters, they will end up in the order KM, PIP and PROTON
     std::sort( daughters.begin(), daughters.end(), compareId );
 
     if ( parnum == LAMBDAC || parnum == LAMBDACB ) {
         if ( daughters[0].first == KM && daughters[1].first == PIP &&
              daughters[2].first == PROTON ) {
             m_d1 = daughters[0].second;
             m_d2 = daughters[1].second;
             m_d3 = daughters[2].second;
         }
     }
 
     // Find resonance dynamics normalisations
     calcNormalisations();
 
     // Print out expected fit fractions
     getFitFractions();
 }
 
 void EvtLambdacPHH::calcNormalisations()
 {
     // Generate events uniform in the Lambda_c Dalitz plot and find the
     // normalisation integrals of the Breit-Wigner lineshapes
 
     // Lambda_c -> K- pi+ p
     int nDaug( 3 );
     EvtVector4R p4Daug[3];
 
     double mDaug[3] = { EvtPDL::getMeanMass( EvtPDL::getId( "K-" ) ),
                         EvtPDL::getMeanMass( EvtPDL::getId( "pi+" ) ),
                         EvtPDL::getMeanMass( EvtPDL::getId( "p+" ) ) };
 
     double norm[3] = { 0.0, 0.0, 0.0 };
 
     // sample size
     int N( 100000 );
     for ( int i = 0; i < N; i++ ) {
         double mParent = EvtPDL::getMass( EvtPDL::getId( "Lambda_c+" ) );
         EvtVector4R p0( mParent, 0.0, 0.0, 0.0 );
 
         // Generate uniform 4 momenta
         EvtGenKine::PhaseSpace( nDaug, mDaug, p4Daug, mParent );
 
         EvtResonance2 LambdacpKpi1( p0, p4Daug[0], p4Daug[1], 1.0, 0.0,
                                     m_KstarW, m_KstarM, 1, true, m_KstarR,
                                     m_Lambda_cR );    // K*0 -> K- and pi+; L = 1
         EvtResonance2 LambdacpKpi2( p0, p4Daug[2], p4Daug[1], 1.0, 0.0,
                                     m_DeltaW, m_DeltaM, 1, true, m_DeltaR,
                                     m_Lambda_cR );    // Delta++ -> p and pi+; L = 1
         EvtResonance2 LambdacpKpi3(
             p0, p4Daug[2], p4Daug[0], 1.0, 0.0, m_LambdaW, m_LambdaM, 2, true,
             m_LambdaR, m_Lambda_cR );    // Lambda(1520) -> K- and p; L = 2
 
         // Sum amplitude magnitude squared
         norm[0] += abs2( LambdacpKpi1.resAmpl() );
         norm[1] += abs2( LambdacpKpi2.resAmpl() );
         norm[2] += abs2( LambdacpKpi3.resAmpl() );
     }
 
     // Set normalisation lineshape multiplication factors
     double N0( N * 1.0 );
 
     // Scale NR to get sensible relative fit fractions
     m_NRNorm = 1.0 / 3.0;
     // Set this using a decay file parameter if required
     if ( getNArg() > 1 ) {
         m_NRNorm = getArg( 1 );
     }
 
     if ( norm[0] > 0.0 ) {
         m_KstarNorm = sqrt( N0 / norm[0] );
     }
     if ( norm[1] > 0.0 ) {
         m_DeltaNorm = sqrt( N0 / norm[1] );
     }
     if ( norm[2] > 0.0 ) {
         m_LambdaNorm = sqrt( N0 / norm[2] );
     }
 }
 
 void EvtLambdacPHH::getFitFractions()
 {
     // Generate events uniform in the Lambda_c Dalitz plot and find the
     // fit fractions for each resonance
 
     // Lambda_c -> K- pi+ p
     int nDaug( 3 );
     EvtVector4R p4Daug[3];
 
     double mDaug[3] = { EvtPDL::getMeanMass( EvtPDL::getId( "K-" ) ),
                         EvtPDL::getMeanMass( EvtPDL::getId( "pi+" ) ),
                         EvtPDL::getMeanMass( EvtPDL::getId( "p+" ) ) };
 
     double FitFracTop[4] = { 0.0, 0.0, 0.0, 0.0 };
     double FitFracDenom = 0.0;
 
     // sample size
     int N( 100000 );
     for ( int i = 0; i < N; i++ ) {
         double mParent = EvtPDL::getMass( EvtPDL::getId( "Lambda_c+" ) );
         EvtVector4R p0( mParent, 0.0, 0.0, 0.0 );
 
         // Generate uniform 4 momenta
         EvtGenKine::PhaseSpace( nDaug, mDaug, p4Daug, mParent );
 
         EvtResonance2 LambdacpKpi0( p0, p4Daug[0], p4Daug[1], 1.0, 0.0, 0.0, 0.0,
                                     0, true, 0.0, 0.0 );    // Non resonant (NR)
         EvtResonance2 LambdacpKpi1( p0, p4Daug[0], p4Daug[1], 1.0, 0.0,
                                     m_KstarW, m_KstarM, 1, true, m_KstarR,
                                     m_Lambda_cR );    // K*0 -> K- and pi+; L = 1
         EvtResonance2 LambdacpKpi2( p0, p4Daug[2], p4Daug[1], 1.0, 0.0,
                                     m_DeltaW, m_DeltaM, 1, true, m_DeltaR,
                                     m_Lambda_cR );    // Delta++ -> p and pi+; L = 1
         EvtResonance2 LambdacpKpi3(
             p0, p4Daug[2], p4Daug[0], 1.0, 0.0, m_LambdaW, m_LambdaM, 2, true,
             m_LambdaR, m_Lambda_cR );    // Lambda(1520) -> K- and p; L = 2
 
         std::vector<EvtComplex> ampNonRes =
             calcResAmpTerms( LcResLabel::NonReson, LambdacpKpi0, m_NRNorm );
         std::vector<EvtComplex> ampKstar =
             calcResAmpTerms( LcResLabel::Kstar, LambdacpKpi1, m_KstarNorm );
         std::vector<EvtComplex> ampDelta =
             calcResAmpTerms( LcResLabel::Delta, LambdacpKpi2, m_DeltaNorm );
         std::vector<EvtComplex> ampLambda =
             calcResAmpTerms( LcResLabel::Lambda, LambdacpKpi3, m_LambdaNorm );
 
         // Combine resonance amplitudes for a given spin configuration
         EvtComplex amp00 = ampNonRes[0] + ampKstar[0] + ampDelta[0] +
                            ampLambda[0];
         EvtComplex amp01 = ampNonRes[1] + ampKstar[1] + ampDelta[1] +
                            ampLambda[1];
         EvtComplex amp10 = ampNonRes[2] + ampKstar[2] + ampDelta[2] +
                            ampLambda[2];
         EvtComplex amp11 = ampNonRes[3] + ampKstar[3] + ampDelta[3] +
                            ampLambda[3];
 
         // Fit fraction numerator terms
         FitFracTop[0] += abs2( ampNonRes[0] ) + abs2( ampNonRes[1] ) +
                          abs2( ampNonRes[2] ) + abs2( ampNonRes[3] );
         FitFracTop[1] += abs2( ampKstar[0] ) + abs2( ampKstar[1] ) +
                          abs2( ampKstar[2] ) + abs2( ampKstar[3] );
         FitFracTop[2] += abs2( ampDelta[0] ) + abs2( ampDelta[1] ) +
                          abs2( ampDelta[2] ) + abs2( ampDelta[3] );
         FitFracTop[3] += abs2( ampLambda[0] ) + abs2( ampLambda[1] ) +
                          abs2( ampLambda[2] ) + abs2( ampLambda[3] );
 
         // Fit fraction common denominator
         FitFracDenom += abs2( amp00 ) + abs2( amp01 ) + abs2( amp10 ) +
                         abs2( amp11 );
     }
 
     EvtGenReport( EVTGEN_INFO, "EvtLambdacPHH" )
         << "FitFracs: NR = " << FitFracTop[0] / FitFracDenom
         << ", K* = " << FitFracTop[1] / FitFracDenom
         << ", Del = " << FitFracTop[2] / FitFracDenom
         << ", Lam = " << FitFracTop[3] / FitFracDenom << std::endl;
 }
 
 void EvtLambdacPHH::initProbMax()
 {
     // Default value
     setProbMax( 10.0 );
 
     // Set probability using decay file parameter
     if ( getNArg() > 0 ) {
         setProbMax( getArg( 0 ) );
     }
 }
 
 void EvtLambdacPHH::decay( EvtParticle* p )
 {
     // Daughter order: 1 = K-, 2 = pi+, 3 = p
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     // 4-momenta in the rest frame of the Lambda_c
     EvtVector4R p4_p( p->mass(), 0.0, 0.0, 0.0 );
     EvtVector4R moms1 = p->getDaug( m_d1 )->getP4();
     EvtVector4R moms2 = p->getDaug( m_d2 )->getP4();
     EvtVector4R moms3 = p->getDaug( m_d3 )->getP4();
 
     // Lambda_c decay mode resonances. Spin L values from strong decay parity conservation:
     // parity(resonance) = parity(daug1)*parity(daug2)*(-1)^L
     EvtResonance2 LambdacpKpi0( p4_p, moms1, moms2, 1.0, 0.0, 0.0, 0.0, 0, true,
                                 0.0, 0.0 );    // Non-resonant L = 0
     EvtResonance2 LambdacpKpi1( p4_p, moms1, moms2, 1.0, 0.0, m_KstarW,
                                 m_KstarM, 1, true, m_KstarR,
                                 m_Lambda_cR );    // K*0 -> K- and pi+; L = 1
     EvtResonance2 LambdacpKpi2( p4_p, moms3, moms2, 1.0, 0.0, m_DeltaW,
                                 m_DeltaM, 1, true, m_DeltaR,
                                 m_Lambda_cR );    // Delta++ -> p and pi+; L = 1
     EvtResonance2 LambdacpKpi3( p4_p, moms3, moms1, 1.0, 0.0, m_LambdaW,
                                 m_LambdaM, 2, true, m_LambdaR,
                                 m_Lambda_cR );    // Lambda(1520) -> K- and p; L = 2
 
     // Define the "beam" direction, used in Fig 1 of hep-ex/9912003v1
     EvtVector4R beam( 0.0, 0.0, 0.0, 1.0 );
     EvtParticle* parent = p->getParent();
     if ( parent ) {
         // If non prompt, the beam is along the direction of the mother
         EvtVector4R p4_Lambda_c_mother = parent->getP4Lab();
         p4_Lambda_c_mother.applyBoostTo( p->getP4Lab() );
         beam = p4_Lambda_c_mother;
     }
 
     m_p4_Lambda_c = p->getP4Lab();
     m_p4_Lambdac_Mag = m_p4_Lambda_c.d3mag();
 
     // Define the unit vector denoting the "z" axis in Fig 1
     m_zprime = -1.0 * m_p4_Lambda_c.cross( beam );
     m_zprime.applyBoostTo( m_p4_Lambda_c, true );    // From lab frame to Lambda_c
 
     m_zpMag = m_zprime.d3mag();
     // Check if zprime magnitude is non-zero
     if ( m_zpMag > 0.0 ) {
         // Normalise
         m_zprime /= m_zpMag;
     } else {
         // Set as the z direction
         m_zprime.set( 0.0, 0.0, 0.0, 1.0 );
     }
     // Update normalised |z'|
     m_zpMag = 1.0;
 
     // Get the amplitudes: non-resonant, K*, Delta and Lambda
     std::vector<EvtComplex> ampNonRes =
         calcResAmpTerms( LcResLabel::NonReson, LambdacpKpi0, m_NRNorm );
     std::vector<EvtComplex> ampKstar =
         calcResAmpTerms( LcResLabel::Kstar, LambdacpKpi1, m_KstarNorm );
     std::vector<EvtComplex> ampDelta =
         calcResAmpTerms( LcResLabel::Delta, LambdacpKpi2, m_DeltaNorm );
     std::vector<EvtComplex> ampLambda =
         calcResAmpTerms( LcResLabel::Lambda, LambdacpKpi3, m_LambdaNorm );
 
     // Combine resonance amplitudes for a given spin configuration
     EvtComplex amp00 = ampNonRes[0] + ampKstar[0] + ampDelta[0] + ampLambda[0];
     EvtComplex amp01 = ampNonRes[1] + ampKstar[1] + ampDelta[1] + ampLambda[1];
     EvtComplex amp10 = ampNonRes[2] + ampKstar[2] + ampDelta[2] + ampLambda[2];
     EvtComplex amp11 = ampNonRes[3] + ampKstar[3] + ampDelta[3] + ampLambda[3];
 
     // Set the amplitude components
     vertex( 0, 0, amp00 );
     vertex( 0, 1, amp01 );
     vertex( 1, 0, amp10 );
     vertex( 1, 1, amp11 );
 }
 
 std::vector<EvtComplex> EvtLambdacPHH::calcResAmpTerms(
     EvtLambdacPHH::LcResLabel resIndex, const EvtResonance2& res, double norm ) const
 {
     // Initialise the resonance and daughter theta and phi angles
     double thetaRes( 0.0 ), phiRes( 0.0 ), phiPrimeDaug( 0.0 ),
         thetaPrimeDaug( 0.0 );
     // Initialise beta rotation angle
     double beta_res( 0.0 );
 
     EvtVector4R res_atproton( 0.0, 0.0, 0.0, 0.0 ),
         Lc_atproton( 0.0, 0.0, 0.0, 0.0 );
 
     // Initialise Amplitude terms
     EvtComplex term1( 0.0 ), term2( 0.0 ), term3( 0.0 ), term4( 0.0 );
     // Normalised dynamical amplitude
     EvtComplex resAmp( norm, 0.0 );
 
     // Angles are not needed for the non-resonant amplitude
     if ( resIndex != LcResLabel::NonReson ) {
         resAmp = res.resAmpl() * norm;
         // Resonance and daughter 4 momenta
         EvtVector4R p4d1 = res.p4_d1();
         EvtVector4R p4d2 = res.p4_d2();
         EvtVector4R p4Res = p4d1 + p4d2;
         EvtVector4R p4_d3 = res.p4_p() - p4Res;
 
         double p4ResMag = p4Res.d3mag();
 
         // 4-momenta for theta' and phi' angles
         EvtVector4R yRes = -1.0 * p4_d3.cross( m_zprime );
 
         EvtVector4R res_d1 = p4d1;
         res_d1.applyBoostTo( p4Res, true );
         double res_d1_Mag = res_d1.d3mag();
 
         EvtVector4R res_d3 = -1.0 * p4_d3;
         double res_d3_Mag = res_d3.d3mag();
 
         thetaPrimeDaug = getACos( res_d1.dot( res_d3 ), res_d1_Mag * res_d3_Mag );
 
         res_atproton = p4Res;
         res_atproton.applyBoostTo( p4d1, true );
         double res_atproton_mag = res_atproton.d3mag();
 
         Lc_atproton = res.p4_p();
         Lc_atproton.applyBoostTo( p4d1, true );
         double Lc_atproton_mag = Lc_atproton.d3mag();
 
         // Check that the momentum of the Lambda_c is not zero, as well as a valid zprime vector
         if ( m_p4_Lambdac_Mag > 0.0 && m_zpMag > 0.0 ) {
             thetaRes = getACos( -1.0 * p4Res.dot( m_zprime ), p4ResMag );
             phiRes = getASin( -1.0 * p4Res.dot( m_p4_Lambda_c ),
                               sin( thetaRes ) * m_p4_Lambdac_Mag * p4ResMag );
             phiPrimeDaug = getASin( res_d1.dot( yRes ), sin( thetaPrimeDaug ) *
                                                             res_d1_Mag *
                                                             yRes.d3mag() );
 
         } else {
             // Use randomised angles with flat probability distributions
             thetaRes = EvtRandom::Flat( 0.0, EvtConst::pi );
             phiRes = EvtRandom::Flat( 0.0, EvtConst::twoPi );
             phiPrimeDaug = EvtRandom::Flat( 0.0, EvtConst::twoPi );
         }
 
         if ( res_atproton_mag > 0.0 && Lc_atproton_mag > 0.0 ) {
             // Extra rotation to go to the proton helicity frame for the two resonances Delta++ and Lambda.
             // No rotation is needed for K*. Use the momenta boosted to the proton restframe
 
             beta_res = getACos( res_atproton.dot( Lc_atproton ),
                                 res_atproton_mag * Lc_atproton_mag );
 
         } else {
             beta_res = EvtRandom::Flat( 0.0, EvtConst::pi );
         }
     }
 
     // Find the spin-dependent amplitudes
     if ( resIndex == LcResLabel::NonReson || resIndex == LcResLabel::Kstar ) {
         term1 = resAmp * DecayAmp3( resIndex, 1, 1, thetaRes, phiRes,
                                     thetaPrimeDaug, phiPrimeDaug );
         term2 = resAmp * DecayAmp3( resIndex, 1, -1, thetaRes, phiRes,
                                     thetaPrimeDaug, phiPrimeDaug );
         term3 = resAmp * DecayAmp3( resIndex, -1, 1, thetaRes, phiRes,
                                     thetaPrimeDaug, phiPrimeDaug );
         term4 = resAmp * DecayAmp3( resIndex, -1, -1, thetaRes, phiRes,
                                     thetaPrimeDaug, phiPrimeDaug );
 
     } else {
         double rotate_00 = EvtdFunction::d( 1, 1, 1, beta_res );
         double rotate_10 = EvtdFunction::d( 1, -1, 1, beta_res );
         double rotate_11 = EvtdFunction::d( 1, -1, -1, beta_res );
         double rotate_01 = EvtdFunction::d( 1, 1, -1, beta_res );
 
         // Delta and Lambda need to be rotated before summing over the proton helicity axis
         EvtComplex termA = resAmp * DecayAmp3( resIndex, 1, 1, thetaRes, phiRes,
                                                thetaPrimeDaug, phiPrimeDaug );
         EvtComplex termB = resAmp * DecayAmp3( resIndex, 1, -1, thetaRes, phiRes,
                                                thetaPrimeDaug, phiPrimeDaug );
         EvtComplex termC = resAmp * DecayAmp3( resIndex, -1, 1, thetaRes, phiRes,
                                                thetaPrimeDaug, phiPrimeDaug );
         EvtComplex termD = resAmp * DecayAmp3( resIndex, -1, -1, thetaRes, phiRes,
                                                thetaPrimeDaug, phiPrimeDaug );
 
         term1 = rotate_00 * termA + rotate_10 * termB;
         term2 = rotate_01 * termA + rotate_11 * termB;
         term3 = rotate_00 * termC + rotate_10 * termD;
         term4 = rotate_01 * termC + rotate_11 * termD;
     }
 
     // Return the spin amplitudes as a vector
     std::vector<EvtComplex> ampVect;
     ampVect.push_back( term1 );
     ampVect.push_back( term2 );
     ampVect.push_back( term3 );
     ampVect.push_back( term4 );
 
     return ampVect;
 }
 
 EvtComplex EvtLambdacPHH::DecayAmp3( EvtLambdacPHH::LcResLabel resonance, int m,
                                      int mprime, double theta_res, double phi_res,
                                      double theta_prime_daughter_res,
                                      double phi_prime_daughter_res ) const
 {
     // Find the amplitudes given in Tables 3 to 6 in the paper.
     // Wigner d-functions use 2*spin, e.g. d(1/2, 1/2, 1/2) -> d(1, 1, 1)
     EvtComplex term1( 0.0, 0.0 ), term2( 0.0, 0.0 );
 
     if ( resonance == LcResLabel::NonReson ) {
         // Non-resonant: table 6
         if ( m == 1 && mprime == 1 ) {
             term1 = m_Nplusplus *
                     EvtComplex( cos( m_phiNplusplus ), sin( m_phiNplusplus ) );
 
         } else if ( m == 1 && mprime == -1 ) {
             term1 = m_Nplusminus * EvtComplex( cos( m_phiNplusminus ),
                                                sin( m_phiNplusminus ) );
 
         } else if ( m == -1 && mprime == 1 ) {
             term1 = m_Nminusplus * EvtComplex( cos( m_phiNminusplus ),
                                                sin( m_phiNminusplus ) );
 
         } else if ( m == -1 && mprime == -1 ) {
             term1 = m_Nminusminus * EvtComplex( cos( m_phiNminusminus ),
                                                 sin( m_phiNminusminus ) );
         }
 
     } else if ( resonance == LcResLabel::Kstar ) {
         // K*0(1-) resonance: table 3
         if ( m == 1 && mprime == 1 ) {
             term1 = fampl3( m_E1, m_phiE1, 1, 1, 1, theta_res, 2, 2, 0,
                             theta_prime_daughter_res, phi_prime_daughter_res );
             term2 = fampl3( m_E2, m_phiE2, 1, 1, -1, theta_res, 2, 0, 0,
                             theta_prime_daughter_res, phi_res );
 
         } else if ( m == 1 && mprime == -1 ) {
             term1 = fampl3( m_E3, m_phiE3, 1, 1, 1, theta_res, 2, 0, 0,
                             theta_prime_daughter_res, 0.0 );
             term2 = fampl3( m_E4, m_phiE4, 1, 1, -1, theta_res, 2, -2, 0,
                             theta_prime_daughter_res,
                             phi_res - phi_prime_daughter_res );
 
         } else if ( m == -1 && mprime == 1 ) {
             term1 = fampl3( m_E1, m_phiE1, 1, -1, 1, theta_res, 2, 2, 0,
                             theta_prime_daughter_res,
                             -( phi_res - phi_prime_daughter_res ) );
             term2 = fampl3( m_E2, m_phiE2, 1, -1, -1, theta_res, 2, 0, 0,
                             theta_prime_daughter_res, 0.0 );
 
         } else if ( m == -1 && mprime == -1 ) {
             term1 = fampl3( m_E3, m_phiE3, 1, -1, 1, theta_res, 2, 0, 0,
                             theta_prime_daughter_res, -phi_res );
             term2 = fampl3( m_E4, m_phiE4, 1, -1, -1, theta_res, 2, -2, 0,
                             theta_prime_daughter_res, -phi_prime_daughter_res );
         }
 
     } else if ( resonance == LcResLabel::Delta ) {
         // Delta++(3/2+) resonance: table 4
         if ( m == 1 && mprime == 1 ) {
             term1 = fampl3( m_F1, m_phiF1, 1, 1, 1, theta_res, 3, 1, 1,
                             theta_prime_daughter_res, 0.0 );
             term2 = fampl3( m_F2, m_phiF2, 1, 1, -1, theta_res, 3, -1, 1,
                             theta_prime_daughter_res,
                             phi_res - phi_prime_daughter_res );
 
         } else if ( m == 1 && mprime == -1 ) {
             term1 = fampl3( m_F1, m_phiF1, 1, 1, 1, theta_res, 3, 1, -1,
                             theta_prime_daughter_res, phi_prime_daughter_res );
             term2 = fampl3( m_F2, m_phiF2, 1, 1, -1, theta_res, 3, -1, -1,
                             theta_prime_daughter_res, phi_res );
 
         } else if ( m == -1 && mprime == 1 ) {
             term1 = fampl3( m_F1, m_phiF1, 1, -1, 1, theta_res, 3, 1, 1,
                             theta_prime_daughter_res, -phi_res );
             term2 = fampl3( m_F2, m_phiF2, 1, -1, -1, theta_res, 3, -1, 1,
                             theta_prime_daughter_res, -phi_prime_daughter_res );
 
         } else if ( m == -1 && mprime == -1 ) {
             term1 = fampl3( m_F1, m_phiF1, 1, -1, 1, theta_res, 3, 1, -1,
                             theta_prime_daughter_res,
                             -( phi_res - phi_prime_daughter_res ) );
             term2 = fampl3( m_F2, m_phiF2, 1, -1, -1, theta_res, 3, -1, -1,
                             theta_prime_daughter_res, 0.0 );
         }
 
     } else if ( resonance == LcResLabel::Lambda ) {
         // Lambda(1520)(3/2-) resonance: table 5
         if ( m == 1 && mprime == 1 ) {
             term1 = fampl3( m_H1, m_phiH1, 1, 1, 1, theta_res, 3, 1, 1,
                             theta_prime_daughter_res, 0.0 );
             term2 = fampl3( m_H2, m_phiH2, 1, 1, -1, theta_res, 3, -1, 1,
                             theta_prime_daughter_res,
                             phi_res - phi_prime_daughter_res );
 
         } else if ( m == 1 && mprime == -1 ) {
             term1 = -1.0 * fampl3( m_H1, m_phiH1, 1, 1, 1, theta_res, 3, 1, -1,
                                    theta_prime_daughter_res,
                                    phi_prime_daughter_res );
             term2 = -1.0 * fampl3( m_H2, m_phiH2, 1, 1, -1, theta_res, 3, -1,
                                    -1, theta_prime_daughter_res, phi_res );
 
         } else if ( m == -1 && mprime == 1 ) {
             term1 = fampl3( m_H1, m_phiH1, 1, -1, 1, theta_res, 3, 1, 1,
                             theta_prime_daughter_res, -phi_res );
             term2 = fampl3( m_H2, m_phiH2, 1, -1, -1, theta_res, 3, -1, 1,
                             theta_prime_daughter_res, -phi_prime_daughter_res );
 
         } else if ( m == -1 && mprime == -1 ) {
             term1 = -1.0 * fampl3( m_H1, m_phiH1, 1, -1, 1, theta_res, 3, 1, -1,
                                    theta_prime_daughter_res,
                                    -( phi_res - phi_prime_daughter_res ) );
             term2 = -1.0 * fampl3( m_H2, m_phiH2, 1, -1, -1, theta_res, 3, -1,
                                    -1, theta_prime_daughter_res, 0.0 );
         }
     }
 
     EvtComplex Amplitude = term1 + term2;
     return Amplitude;
 }
 
 EvtComplex EvtLambdacPHH::fampl3( double amplitude_res, double phi_res,
                                   int spinMother, int m_spinMother,
                                   int m_prime_spinMother, double theta_res,
                                   float spin_res, float m_spin_res,
                                   float m_prime_spin_res,
                                   double theta_daughter_res,
                                   double phi_prime_daughter_res ) const
 {
     double dTerm1 = EvtdFunction::d( spinMother, m_spinMother,
                                      m_prime_spinMother, theta_res );
     double dTerm2 = EvtdFunction::d( spin_res, m_spin_res, m_prime_spin_res,
                                      theta_daughter_res );
 
     EvtComplex amp_phase1 = EvtComplex( cos( phi_res ), sin( phi_res ) );
     EvtComplex amp_phase2 = EvtComplex( cos( phi_prime_daughter_res ),
                                         sin( phi_prime_daughter_res ) );
 
     EvtComplex partial_amp = amplitude_res * amp_phase1 * dTerm1 * amp_phase2 *
                              dTerm2;
 
     return partial_amp;
 }
 
 double EvtLambdacPHH::getACos( double num, double denom ) const
 {
     // Find inverse cosine, checking ratio is within +- 1
     double angle( 0.0 ), ratio( 0.0 );
     if ( fabs( denom ) > 0.0 ) {
         ratio = num / denom;
     }
 
     if ( fabs( ratio ) <= 1.0 ) {
         angle = acos( ratio );
     }
 
     return angle;
 }
 
 double EvtLambdacPHH::getASin( double num, double denom ) const
 {
     // Find inverse sine, checking ratio is within +- 1
     double angle( 0.0 ), ratio( 0.0 );
     if ( fabs( denom ) > 0.0 ) {
         ratio = num / denom;
     }
 
     if ( fabs( ratio ) <= 1.0 ) {
         angle = asin( ratio );
     }
 
     return angle;
 }
diff --git a/src/EvtGenModels/EvtLb2Baryonlnu.cpp b/src/EvtGenModels/EvtLb2Baryonlnu.cpp
index 9692a04..3af13a7 100644
--- a/src/EvtGenModels/EvtLb2Baryonlnu.cpp
+++ b/src/EvtGenModels/EvtLb2Baryonlnu.cpp
@@ -1,224 +1,224 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLb2Baryonlnu.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtLb2BaryonlnuFF.hh"
 
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 #ifdef D0
 #undef D0
 #endif
 EvtLb2Baryonlnu::EvtLb2Baryonlnu() : m_ffmodel( nullptr ), m_calcamp( nullptr )
 {
 }
 
 EvtLb2Baryonlnu::~EvtLb2Baryonlnu()
 {
     delete m_ffmodel;
     m_ffmodel = nullptr;
     delete m_calcamp;
     m_calcamp = nullptr;
 }
 
-std::string EvtLb2Baryonlnu::getName()
+std::string EvtLb2Baryonlnu::getName() const
 {
     return "Lb2Baryonlnu";
 }
 
-EvtDecayBase* EvtLb2Baryonlnu::clone()
+EvtDecayBase* EvtLb2Baryonlnu::clone() const
 {
     return new EvtLb2Baryonlnu;
 }
 
 void EvtLb2Baryonlnu::decay( EvtParticle* p )
 {
     //This is a kludge to avoid warnings because the K_2* mass becomes to large.
-    static EvtIdSet regenerateMasses{ "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
-                                      "K_1+",  "K_1-",  "K_10",  "anti-K_10",
-                                      "D'_1+", "D'_1-", "D'_10", "anti-D'_10" };
+    static const EvtIdSet regenerateMasses{
+        "K_2*+", "K_2*-",     "K_2*0", "anti-K_2*0", "K_1+",  "K_1-",
+        "K_10",  "anti-K_10", "D'_1+", "D'_1-",      "D'_10", "anti-D'_10" };
 
     if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
         p->resetFirstOrNot();
     }
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex r00( getArg( 0 ), 0.0 );
     EvtComplex r01( getArg( 1 ), 0.0 );
     EvtComplex r10( getArg( 2 ), 0.0 );
     EvtComplex r11( getArg( 3 ), 0.0 );
 
     m_calcamp->CalcAmp( p, m_amp2, m_ffmodel, r00, r01, r10, r11 );
 }
 
 void EvtLb2Baryonlnu::initProbMax()
 {
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId PRO = EvtPDL::getId( "p+" );
-    static EvtId PROB = EvtPDL::getId( "anti-p-" );
-    static EvtId N1440 = EvtPDL::getId( "N(1440)+" );
-    static EvtId N1440B = EvtPDL::getId( "anti-N(1440)-" );
-    static EvtId N1535 = EvtPDL::getId( "N(1535)+" );
-    static EvtId N1535B = EvtPDL::getId( "anti-N(1535)-" );
-    static EvtId N1520 = EvtPDL::getId( "N(1520)+" );
-    static EvtId N1520B = EvtPDL::getId( "anti-N(1520)-" );
-    static EvtId N1720 = EvtPDL::getId( "N(1720)+" );
-    static EvtId N1720B = EvtPDL::getId( "anti-N(1720)-" );
-    static EvtId N1650 = EvtPDL::getId( "N(1650)+" );
-    static EvtId N1650B = EvtPDL::getId( "anti-N(1650)-" );
-    static EvtId N1700 = EvtPDL::getId( "N(1700)+" );
-    static EvtId N1700B = EvtPDL::getId( "anti-N(1700)-" );
-    static EvtId N1710 = EvtPDL::getId( "N(1710)+" );
-    static EvtId N1710B = EvtPDL::getId( "anti-N(1710)-" );
-    static EvtId N1875 = EvtPDL::getId( "N(1875)+" );
-    static EvtId N1875B = EvtPDL::getId( "anti-N(1875)-" );
-    static EvtId N1900 = EvtPDL::getId( "N(1900)+" );
-    static EvtId N1900B = EvtPDL::getId( "anti-N(1900)-" );
-    static EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
-    static EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
-    static EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
-    static EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
-    static EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
-    static EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId PRO = EvtPDL::getId( "p+" );
+    static const EvtId PROB = EvtPDL::getId( "anti-p-" );
+    static const EvtId N1440 = EvtPDL::getId( "N(1440)+" );
+    static const EvtId N1440B = EvtPDL::getId( "anti-N(1440)-" );
+    static const EvtId N1535 = EvtPDL::getId( "N(1535)+" );
+    static const EvtId N1535B = EvtPDL::getId( "anti-N(1535)-" );
+    static const EvtId N1520 = EvtPDL::getId( "N(1520)+" );
+    static const EvtId N1520B = EvtPDL::getId( "anti-N(1520)-" );
+    static const EvtId N1720 = EvtPDL::getId( "N(1720)+" );
+    static const EvtId N1720B = EvtPDL::getId( "anti-N(1720)-" );
+    static const EvtId N1650 = EvtPDL::getId( "N(1650)+" );
+    static const EvtId N1650B = EvtPDL::getId( "anti-N(1650)-" );
+    static const EvtId N1700 = EvtPDL::getId( "N(1700)+" );
+    static const EvtId N1700B = EvtPDL::getId( "anti-N(1700)-" );
+    static const EvtId N1710 = EvtPDL::getId( "N(1710)+" );
+    static const EvtId N1710B = EvtPDL::getId( "anti-N(1710)-" );
+    static const EvtId N1875 = EvtPDL::getId( "N(1875)+" );
+    static const EvtId N1875B = EvtPDL::getId( "anti-N(1875)-" );
+    static const EvtId N1900 = EvtPDL::getId( "N(1900)+" );
+    static const EvtId N1900B = EvtPDL::getId( "anti-N(1900)-" );
+    static const EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
+    static const EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
+    static const EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
+    static const EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
+    static const EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
+    static const EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
 
     EvtId parnum, barnum;
 
     parnum = getParentId();
     barnum = getDaug( 0 );
 
     if ( ( parnum == LAMB && barnum == PRO ) ||
          ( parnum == LAMBB && barnum == PROB ) ||
          ( parnum == LAMB && barnum == N1440 ) ||
          ( parnum == LAMBB && barnum == N1440B ) ||
          ( parnum == LAMB && barnum == N1520 ) ||
          ( parnum == LAMBB && barnum == N1520B ) ||
          ( parnum == LAMB && barnum == N1535 ) ||
          ( parnum == LAMBB && barnum == N1535B ) ||
          ( parnum == LAMB && barnum == N1720 ) ||
          ( parnum == LAMBB && barnum == N1720B ) ||
          ( parnum == LAMB && barnum == N1650 ) ||
          ( parnum == LAMBB && barnum == N1650B ) ||
          ( parnum == LAMB && barnum == N1700 ) ||
          ( parnum == LAMBB && barnum == N1700B ) ||
          ( parnum == LAMB && barnum == N1710 ) ||
          ( parnum == LAMBB && barnum == N1710B ) ||
          ( parnum == LAMB && barnum == N1875 ) ||
          ( parnum == LAMBB && barnum == N1875B ) ||
          ( parnum == LAMB && barnum == N1900 ) ||
          ( parnum == LAMBB && barnum == N1900B ) ||
          ( parnum == LAMB && barnum == LAMCP ) ||
          ( parnum == LAMBB && barnum == LAMCM ) ||
          ( parnum == LAMB && barnum == LAMC1P ) ||
          ( parnum == LAMBB && barnum == LAMC1M ) ||
          ( parnum == LAMB && barnum == LAMC2P ) ||
          ( parnum == LAMBB && barnum == LAMC2M ) ) {
         setProbMax( 22000.0 );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Decay does not have acceptable final state baryon for this model setting ProbMax = 0 "
             << endl;
         setProbMax( 0.0 );
     }
 }
 
 void EvtLb2Baryonlnu::init()
 {
     if ( getNArg() != 4 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2Baryonlnu generator expected "
             << " 4 arguments but found:" << getNArg() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     if ( getNDaug() != 3 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong number of daughters in EvtLb2plnu.cc "
             << " 3 daughters expected but found: " << getNDaug() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     //We expect the parent to be a dirac particle
     //and the daughters to be X lepton neutrino
 
     EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
     EvtSpinType::spintype baryontype = EvtPDL::getSpinType( getDaug( 0 ) );
     EvtSpinType::spintype leptontype = EvtPDL::getSpinType( getDaug( 1 ) );
     EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
 
     if ( parenttype != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2Baryonlnu generator expected "
             << " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     if ( leptontype != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2Baryonlnu generator expected "
             << " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     if ( neutrinotype != EvtSpinType::NEUTRINO ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2Baryonlnu generator expected "
             << " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     //set m_ffmodel
     m_ffmodel = new EvtLb2BaryonlnuFF;
 
     if ( baryontype == EvtSpinType::DIRAC ||
          baryontype == EvtSpinType::RARITASCHWINGER ) {
         m_calcamp = new EvtSLBaryonAmp;
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong baryon spin type in EvtLb2Baryonlnu.cc "
             << "Expected spin type " << EvtSpinType::DIRAC
             << ", found spin type " << baryontype << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
diff --git a/src/EvtGenModels/EvtLb2BaryonlnuFF.cpp b/src/EvtGenModels/EvtLb2BaryonlnuFF.cpp
index db55313..4f4f0d8 100644
--- a/src/EvtGenModels/EvtLb2BaryonlnuFF.cpp
+++ b/src/EvtGenModels/EvtLb2BaryonlnuFF.cpp
@@ -1,432 +1,432 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLb2BaryonlnuFF.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <math.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
 void EvtLb2BaryonlnuFF::getdiracff( EvtId parent, EvtId daught, double q2,
                                     double /* mass */, double* f1, double* f2,
                                     double* f3, double* g1, double* g2,
                                     double* g3 )
 {
     // Define Event IDs for Lb and p, N+ and Lc+ states
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId PRO = EvtPDL::getId( "p+" );
-    static EvtId PROB = EvtPDL::getId( "anti-p-" );
-    static EvtId N1440 = EvtPDL::getId( "N(1440)+" );
-    static EvtId N1440B = EvtPDL::getId( "anti-N(1440)-" );
-    static EvtId N1535 = EvtPDL::getId( "N(1535)+" );
-    static EvtId N1535B = EvtPDL::getId( "anti-N(1535)-" );
-    static EvtId N1650 = EvtPDL::getId( "N(1650)+" );
-    static EvtId N1650B = EvtPDL::getId( "anti-N(1650)-" );
-    static EvtId N1710 = EvtPDL::getId( "N(1710)+" );
-    static EvtId N1710B = EvtPDL::getId( "anti-N(1710)-" );
-    static EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
-    static EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
-    static EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
-    static EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId PRO = EvtPDL::getId( "p+" );
+    static const EvtId PROB = EvtPDL::getId( "anti-p-" );
+    static const EvtId N1440 = EvtPDL::getId( "N(1440)+" );
+    static const EvtId N1440B = EvtPDL::getId( "anti-N(1440)-" );
+    static const EvtId N1535 = EvtPDL::getId( "N(1535)+" );
+    static const EvtId N1535B = EvtPDL::getId( "anti-N(1535)-" );
+    static const EvtId N1650 = EvtPDL::getId( "N(1650)+" );
+    static const EvtId N1650B = EvtPDL::getId( "anti-N(1650)-" );
+    static const EvtId N1710 = EvtPDL::getId( "N(1710)+" );
+    static const EvtId N1710B = EvtPDL::getId( "anti-N(1710)-" );
+    static const EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
+    static const EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
+    static const EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
+    static const EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
 
     double F1, F2, F3, G1, G2, G3;
 
     if ( ( parent == LAMB && daught == PRO ) ||
          ( parent == LAMBB && daught == PROB ) ||
          ( parent == LAMB && daught == LAMCP ) ||
          ( parent == LAMBB && daught == LAMCM ) ) {
         //  Parameters needed in the calculation;
         double mQ = 5.28;
         double aL = 0.59;
         double md = 0.40;
         double MLamB = EvtPDL::getMass( parent );
         double MLamq = EvtPDL::getMass( daught );
         double mq = md;
         double aLp = 0.48;
 
         //set mq and aLp based on whether Lb->Lc* or Lb->N*
         if ( ( parent == LAMB && daught == LAMCP ) ||
              ( parent == LAMBB && daught == LAMCM ) ) {
             mq = 1.89;
             aLp = 0.55;
         }
 
         double aL2 = aL * aL;
         double aLp2 = aLp * aLp;
         double aLLp2 = 0.5 * ( aL2 + aLp2 );
 
         // relativistic correction factor
         double k2 = 1.0;
         double rho2 = 3. * md * md / ( 2. * k2 * aLLp2 );
 
         // w = scalar product of the 4 velocities of the Lb and Lc.
         double w = 0.5 * ( MLamB * MLamB + MLamq * MLamq - q2 ) / MLamB / MLamq;
 
         double I = pow( aL * aLp / aLLp2, 1.5 ) * exp( -rho2 * ( w * w - 1. ) );
 
         // Calculate the form factors
         F1 = I * ( 1.0 + ( md / aLLp2 ) * ( ( aLp2 / mq ) + ( aL2 / mQ ) ) );
         F2 = -I * ( ( md / mq ) * ( aLp2 / aLLp2 ) -
                     aL2 * aLp2 / ( 4. * aLLp2 * mq * mQ ) );
         F3 = -I * md * aL2 / ( mQ * aLLp2 );
 
         G1 = I * ( 1.0 - ( aL2 * aLp2 ) / ( 12. * aLLp2 * mq * mQ ) );
         G2 = -I * ( md * aLp2 / ( mq * aLLp2 ) +
                     ( aL2 * aLp2 ) / ( 12. * aLLp2 * mq * mQ ) *
                         ( 1. + 12. * md * md / aLLp2 ) );
         G3 = I * ( md * aL2 / ( mQ * aLLp2 ) +
                    md * md * aL2 * aLp2 / ( mq * mQ * aLLp2 * aLLp2 ) );
 
         // Set form factors to be passed to the amplitude calc.
         *f1 = F1;
         *f2 = F2;
         *f3 = F3;
         *g1 = G1;
         *g2 = G2;
         *g3 = G3;
     } else if ( ( parent == LAMB && daught == N1440 ) ||
                 ( parent == LAMBB && daught == N1440B ) ||
                 ( parent == LAMB && daught == N1710 ) ||
                 ( parent == LAMBB && daught == N1710B ) ) {
         //  Parameters needed in the calculation;
         double mQ = 5.28;
         double md = 0.40;
         double mq = md;
         double MLamB = EvtPDL::getMass( parent );
         double MLamq = EvtPDL::getMass( daught );
 
         double aL = 0.59;
         double aLp = 0.48;
 
         double aL2 = aL * aL;
         double aLp2 = aLp * aLp;
         double aLLp2 = 0.5 * ( aL2 + aLp2 );
 
         // relativistic correction factor
         double k2 = 1.0;
         double rho2 = 3. * md * md / ( 2. * k2 * aLLp2 );
 
         // w = scalar product of the 4 velocities of the Lb and Lc.
         double w = 0.5 * ( MLamB * MLamB + MLamq * MLamq - q2 ) / MLamB / MLamq;
 
         double I = sqrt( 1.5 ) * pow( aL * aLp / aLLp2, 1.5 ) *
                    exp( -rho2 * ( w * w - 1. ) );
 
         // Calculate the form factors
         F1 = ( I / ( 2. * aLLp2 ) ) *
              ( ( aL2 - aLp2 ) - ( md / ( 3. * aLLp2 ) ) *
                                     ( ( aLp2 / mq ) * ( 7. * aL2 - 3. * aLp2 ) +
                                       ( aL2 / mQ ) * ( 7. * aLp2 - 3. * aL2 ) ) );
 
         F2 = -I * ( aLp2 / ( 6. * mq * aLLp2 * aLLp2 ) ) *
              ( 7. * aL2 - 3. * aLp2 ) * ( md - ( aL2 / ( 4. * mQ ) ) );
 
         F3 = I * ( aL2 * md / ( 6. * mQ * aLLp2 * aLLp2 ) ) *
              ( 7. * aLp2 - 3. * aL2 );
 
         G1 = I * ( ( aL2 - aLp2 ) / ( 2 * aLLp2 ) -
                    ( aL2 * aLp2 * ( 7. * aL2 - 3. * aLp2 ) ) /
                        ( 72. * aLLp2 * aLLp2 * mq * mQ ) );
 
         G2 = -I * ( aLp2 / ( 6. * mq * aLLp2 * aLLp2 ) ) *
              ( ( 7. * aL2 - 3. * aLp2 ) * ( md + ( aL2 / ( 6. * mQ ) ) ) +
                ( 7. * md * md * aL2 * ( aL2 - aLp2 ) / ( mQ * aLLp2 ) ) );
 
         G3 = -I * ( aL2 * md / ( 6. * mQ * aLLp2 * aLLp2 ) ) *
              ( ( 7. * aLp2 - 3. * aL2 ) -
                ( 7 * md * aLp2 * ( aL2 - aLp2 ) / ( mq * aLLp2 ) ) );
 
         // Set form factors to be passed to the amplitude calc.
         *f1 = F1;
         *f2 = F2;
         *f3 = F3;
         *g1 = G1;
         *g2 = G2;
         *g3 = G3;
 
     } else if ( ( parent == LAMB && daught == N1535 ) ||
                 ( parent == LAMBB && daught == N1535B ) ||
                 ( parent == LAMB && daught == N1650 ) ||
                 ( parent == LAMBB && daught == N1650B ) ||
                 ( parent == LAMB && daught == LAMC1P ) ||
                 ( parent == LAMBB && daught == LAMC1M ) ) {
         double mQ = 5.28;
         double md = 0.40;
         double aL = 0.59;
         double MLamB = EvtPDL::getMass( parent );
         double MLamq = EvtPDL::getMass( daught );
         double mq = md;
         double aLp = 0.37;
 
         //set mq and aLp based on whether Lb->Lc* or Lb->N*
         if ( ( parent == LAMB && daught == LAMC1P ) ||
              ( parent == LAMBB && daught == LAMC1M ) ) {
             mq = 1.89;
             aLp = 0.47;
         }
 
         double aL2 = aL * aL;
         double aLp2 = aLp * aLp;
         double aLLp2 = 0.5 * ( aL2 + aLp2 );
 
         // relativistic correction factor
         double k2 = 1.0;
         double rho2 = 3. * md * md / ( 2. * k2 * aLLp2 );
 
         // w = scalar product of the 4 velocities of the Lb and Lc.
         double w = 0.5 * ( MLamB * MLamB + MLamq * MLamq - q2 ) / MLamB / MLamq;
 
         double I = pow( aL * aLp / aLLp2, 2.5 ) * exp( -rho2 * ( w * w - 1. ) );
 
         // Calculate the form factors
         F1 = I * aL / 6.0 * ( 3.0 / mq - 1.0 / mQ );
         F2 = -I * ( 2.0 * md / aL - aL / ( 2.0 * mq ) +
                     2. * md * md * aL / ( mQ * aLLp2 ) -
                     ( md * aL / ( 6. * mq * mQ * aLLp2 ) ) *
                         ( 3. * aL2 - 2. * aLp2 ) );
         F3 = I * 2. * md * md * aL / ( mQ * aLLp2 );
 
         G1 = I * ( 2.0 * md / aL - aL / ( 6. * mQ ) +
                    ( md * aL / ( 6. * mq * mQ * aLLp2 ) ) *
                        ( 3. * aL2 - 2. * aLp2 ) );
         G2 = I * ( -2. * md / aL + aL / ( 2. * mq ) + aL / ( 3. * mQ ) );
         G3 = I * aL / ( 3. * mQ ) *
              ( 1.0 - ( md / ( 2. * mq * aLLp2 ) ) * ( 3. * aL2 - 2. * aLp2 ) );
 
         // Set form factors to be passed to the amplitude calc.
         *f1 = F1;
         *f2 = F2;
         *f3 = F3;
         *g1 = G1;
         *g2 = G2;
         *g3 = G3;
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Only Lb -> N*+ transitions allowed in EvtLb2BaryonlnuFF.\n";
         ::abort();
     }
 
     return;
 }
 
 void EvtLb2BaryonlnuFF::getraritaff( EvtId parent, EvtId daught, double q2,
                                      double, double* f1, double* f2, double* f3,
                                      double* f4, double* g1, double* g2,
                                      double* g3, double* g4 )
 {
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId N1520 = EvtPDL::getId( "N(1520)+" );
-    static EvtId N1520B = EvtPDL::getId( "anti-N(1520)-" );
-    static EvtId N1720 = EvtPDL::getId( "N(1720)+" );
-    static EvtId N1720B = EvtPDL::getId( "anti-N(1720)-" );
-    static EvtId N1700 = EvtPDL::getId( "N(1700)+" );
-    static EvtId N1700B = EvtPDL::getId( "anti-N(1700)-" );
-    static EvtId N1900 = EvtPDL::getId( "N(1900)+" );
-    static EvtId N1900B = EvtPDL::getId( "anti-N(1900)-" );
-    static EvtId N1875 = EvtPDL::getId( "N(1875)+" );
-    static EvtId N1875B = EvtPDL::getId( "anti-N(1875)-" );
-    static EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
-    static EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId N1520 = EvtPDL::getId( "N(1520)+" );
+    static const EvtId N1520B = EvtPDL::getId( "anti-N(1520)-" );
+    static const EvtId N1720 = EvtPDL::getId( "N(1720)+" );
+    static const EvtId N1720B = EvtPDL::getId( "anti-N(1720)-" );
+    static const EvtId N1700 = EvtPDL::getId( "N(1700)+" );
+    static const EvtId N1700B = EvtPDL::getId( "anti-N(1700)-" );
+    static const EvtId N1900 = EvtPDL::getId( "N(1900)+" );
+    static const EvtId N1900B = EvtPDL::getId( "anti-N(1900)-" );
+    static const EvtId N1875 = EvtPDL::getId( "N(1875)+" );
+    static const EvtId N1875B = EvtPDL::getId( "anti-N(1875)-" );
+    static const EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
+    static const EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
 
     double F1, F2, F3, F4, G1, G2, G3, G4;
 
     // 3/2 - case
     if ( ( parent == LAMB && daught == N1520 ) ||
          ( parent == LAMBB && daught == N1520B ) ||
          ( parent == LAMB && daught == N1700 ) ||
          ( parent == LAMBB && daught == N1700B ) ||
          ( parent == LAMB && daught == N1875 ) ||
          ( parent == LAMBB && daught == N1875B ) ||
          ( parent == LAMB && daught == LAMC2P ) ||
          ( parent == LAMBB && daught == LAMC2M ) ) {
         double mQ = 5.28;
         double md = 0.40;
         double aL = 0.59;
         double MLamB = EvtPDL::getMass( parent );
         double MLamq = EvtPDL::getMass( daught );
         double mq = md;
         double aLp = 0.37;
 
         //set mq and aLp based on whether Lb->Lc* or Lb->N*
         if ( ( parent == LAMB && daught == LAMC2P ) ||
              ( parent == LAMBB && daught == LAMC2M ) ) {
             mq = 1.89;
             aLp = 0.47;
         }
 
         double aL2 = aL * aL;
         double aLp2 = aLp * aLp;
         double aLLp2 = 0.5 * ( aL2 + aLp2 );
 
         // relativistic correction factor
         double k2 = 1.0;
         double rho2 = 3. * md * md / ( 2. * k2 * aLLp2 );
 
         // w = scalar product of the 4 velocities of the Lb and Lc.
         double w = 0.5 * ( MLamB * MLamB + MLamq * MLamq - q2 ) / MLamB / MLamq;
 
         double I = -( 1. / sqrt( 3. ) ) * pow( aL * aLp / aLLp2, 2.5 ) *
                    exp( -rho2 * ( w * w - 1. ) );
 
         // Calculate the form factors
         F1 = I * 3.0 * md / aL *
              ( 1.0 + ( md / aLLp2 ) * ( ( aLp2 / mq ) + ( aL2 / mQ ) ) );
         F2 = -I * ( ( 3. * md * md / mq ) * ( aLp2 / ( aLLp2 * aL2 ) ) -
                     5. * aL * aLp2 * md / ( 4. * aLLp2 * mq * mQ ) );
         F3 = -I * ( 3. * md * md * aL / ( mQ * aLLp2 ) + aL / ( 2. * mQ ) );
         F4 = I * aL / mQ;
 
         G1 = I * ( 3.0 * md / aL -
                    ( aL / ( 2. * mQ ) ) *
                        ( 1. + 3. * md * aLp2 / ( 2. * aLLp2 * mq ) ) );
         G2 = -I * ( ( 3. * md * md / mq ) * ( aLp2 / ( aLLp2 * aL ) ) +
                     aL * aLp2 * md / ( 4. * aLLp2 * aLLp2 * mq * mQ ) *
                         ( aLLp2 + 12. * md * md ) );
         G3 = I * aL / ( mQ * aLLp2 ) *
              ( aLLp2 / 2. + 3. * md * md +
                aLp2 * md / ( mq * aLLp2 ) * ( aLLp2 + 6. * md * md ) );
         G4 = -I * ( aL / mQ + md / ( mq * mQ ) * aLp2 * aL / aLLp2 );
 
         // Set form factors to be passed to the amplitude calc.
         *f1 = F1;
         *f2 = F2;
         *f3 = F3;
         *f4 = F4;
         *g1 = G1;
         *g2 = G2;
         *g3 = G3;
         *g4 = G4;
     }
     // 3/2 + case
     else if ( ( parent == LAMB && daught == N1720 ) ||
               ( parent == LAMBB && daught == N1720B ) ||
               ( parent == LAMB && daught == N1900 ) ||
               ( parent == LAMBB && daught == N1900B )
 
     ) {
         double mQ = 5.28;
         double md = 0.40;
         double mq = md;
         double MLamB = EvtPDL::getMass( parent );
         double MLamq = EvtPDL::getMass( daught );
 
         double aL = 0.59;
         double aLp = 0.35;
 
         double aL2 = aL * aL;
         double aLp2 = aLp * aLp;
         double aLLp2 = 0.5 * ( aL2 + aLp2 );
 
         // relativistic correction factor
         double k2 = 1.0;
         double rho2 = 3. * md * md / ( 2. * k2 * aLLp2 );
 
         // w = scalar product of the 4 velocities of the Lb and Lc.
         double w = 0.5 * ( MLamB * MLamB + MLamq * MLamq - q2 ) / MLamB / MLamq;
 
         double I = ( 1. / sqrt( 5. ) ) * pow( aL * aLp / aLLp2, 3.5 ) *
                    exp( -rho2 * ( w * w - 1. ) );
 
         // Calculate the form factors
         F1 = -I * ( md / 2. ) * ( ( 5. / mq ) - ( 3. / mQ ) );
 
         F2 = I * ( md / aL ) *
              ( ( 6. * md / aL ) - ( 5 * aL / ( 2. * mq ) ) +
                ( 6. * md * md * aL ) / ( aLLp2 * mQ ) -
                ( md * aL * ( aL2 - 2. * aLp2 ) ) / ( 2 * aLLp2 * mq * mQ ) );
 
         F3 = -I * ( md / mQ ) * ( 1 + ( 6. * md * md ) / aLLp2 );
 
         F4 = I * ( 2. * md / mQ );
 
         G1 = -I *
              ( ( 6. * md * md / aL2 ) - md / ( 2. * mQ ) +
                md * md * ( 11. * aL2 - 6. * aLp2 ) / ( 6. * aLLp2 * mq * mQ ) );
 
         G2 = I * ( 6 * md * md / aL2 - 5 * md / ( 2.0 * mq ) - ( 2 * md ) / mQ +
                    5 * aL2 / ( 12.0 * mq * mQ ) -
                    ( 2 * md * md * aL2 ) / ( 3.0 * aLLp2 * mq * mQ ) );
 
         G3 = -I *
              ( ( md / ( 2. * mQ ) ) - 5 * aL2 / ( 24.0 * mq * mQ ) -
                md * md * ( 5 * aL2 - 2 * aLp2 ) / ( 4.0 * mq * mQ * aLLp2 ) );
 
         G4 = -I * 5. * aL2 / ( 6. * mq * mQ );
 
         // Set form factors to be passed to the amplitude calc.
         *f1 = F1;
         *f2 = F2;
         *f3 = F3;
         *f4 = F4;
         *g1 = G1;
         *g2 = G2;
         *g3 = G3;
         *g4 = G4;
     }
 
     else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Only Lb -> N*+ transitions allowed in EvtLb2BaryonlnuFF.\n";
         ::abort();
     }
 
     return;
 }
 
 void EvtLb2BaryonlnuFF::getscalarff( EvtId, EvtId, double, double, double*,
                                      double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getscalarff in EvtLb2BaryonlnuFF.\n";
     ::abort();
 }
 
 void EvtLb2BaryonlnuFF::getvectorff( EvtId, EvtId, double, double, double*,
                                      double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getvectorff in EvtLb2BaryonlnuFF.\n";
     ::abort();
 }
 
 void EvtLb2BaryonlnuFF::gettensorff( EvtId, EvtId, double, double, double*,
                                      double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :gettensorff in EvtLb2BaryonlnuFF.\n";
     ::abort();
 }
 
 void EvtLb2BaryonlnuFF::getbaryonff( EvtId, EvtId, double, double, double*,
                                      double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getbaryonff in EvtLb2BaryonlnuFF.\n";
     ::abort();
 }
diff --git a/src/EvtGenModels/EvtLb2plnuLCSR.cpp b/src/EvtGenModels/EvtLb2plnuLCSR.cpp
index 9cab104..2e88649 100644
--- a/src/EvtGenModels/EvtLb2plnuLCSR.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLCSR.cpp
@@ -1,174 +1,174 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLb2plnuLCSR.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtLb2plnuLCSRFF.hh"
 
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 #ifdef D0
 #undef D0
 #endif
 EvtLb2plnuLCSR::EvtLb2plnuLCSR() : m_ffmodel( nullptr ), m_calcamp( nullptr )
 {
 }
 
 EvtLb2plnuLCSR::~EvtLb2plnuLCSR()
 {
     delete m_ffmodel;
     m_ffmodel = nullptr;
     delete m_calcamp;
     m_calcamp = nullptr;
 }
 
-std::string EvtLb2plnuLCSR::getName()
+std::string EvtLb2plnuLCSR::getName() const
 {
     return "Lb2plnuLCSR";
 }
 
-EvtDecayBase* EvtLb2plnuLCSR::clone()
+EvtDecayBase* EvtLb2plnuLCSR::clone() const
 {
     return new EvtLb2plnuLCSR;
 }
 
 void EvtLb2plnuLCSR::decay( EvtParticle* p )
 {
     //This is a kludge to avoid warnings because the K_2* mass becomes to large.
-    static EvtIdSet regenerateMasses{ "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
-                                      "K_1+",  "K_1-",  "K_10",  "anti-K_10",
-                                      "D'_1+", "D'_1-", "D'_10", "anti-D'_10" };
+    static const EvtIdSet regenerateMasses{
+        "K_2*+", "K_2*-",     "K_2*0", "anti-K_2*0", "K_1+",  "K_1-",
+        "K_10",  "anti-K_10", "D'_1+", "D'_1-",      "D'_10", "anti-D'_10" };
 
     if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
         p->resetFirstOrNot();
     }
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex r00( getArg( 0 ), 0.0 );
     EvtComplex r01( getArg( 1 ), 0.0 );
     EvtComplex r10( getArg( 2 ), 0.0 );
     EvtComplex r11( getArg( 3 ), 0.0 );
 
     m_calcamp->CalcAmp( p, m_amp2, m_ffmodel, r00, r01, r10, r11 );
 }
 
 void EvtLb2plnuLCSR::initProbMax()
 {
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId PRO = EvtPDL::getId( "p+" );
-    static EvtId PROB = EvtPDL::getId( "anti-p-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId PRO = EvtPDL::getId( "p+" );
+    static const EvtId PROB = EvtPDL::getId( "anti-p-" );
 
     EvtId parnum, barnum;
 
     parnum = getParentId();
     barnum = getDaug( 0 );
 
     if ( ( parnum == LAMB && barnum == PRO ) ||
          ( parnum == LAMBB && barnum == PROB ) ) {
         setProbMax( 22000.0 );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Decay does not have Lb->p setting ProbMax = 0 " << endl;
         setProbMax( 0.0 );
     }
 }
 
 void EvtLb2plnuLCSR::init()
 {
     if ( getNArg() != 4 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2plnuLCSR generator expected "
             << " 4 arguments but found:" << getNArg() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     if ( getNDaug() != 3 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong number of daughters in EvtLb2plnu.cc "
             << " 3 daughters expected but found: " << getNDaug() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     //We expect the parent to be a dirac particle
     //and the daughters to be X lepton neutrino
 
     EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
     EvtSpinType::spintype baryontype = EvtPDL::getSpinType( getDaug( 0 ) );
     EvtSpinType::spintype leptontype = EvtPDL::getSpinType( getDaug( 1 ) );
     EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
 
     if ( parenttype != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2plnuLCSR generator expected "
             << " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     if ( leptontype != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2plnuLCSR generator expected "
             << " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     if ( neutrinotype != EvtSpinType::NEUTRINO ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2plnuLCSR generator expected "
             << " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     //set m_ffmodel
     m_ffmodel = new EvtLb2plnuLCSRFF;
 
     if ( baryontype == EvtSpinType::DIRAC ) {
         m_calcamp = new EvtSLBaryonAmp;
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong baryon spin type in EvtLb2plnuLCSR.cc "
             << "Expected spin type " << EvtSpinType::DIRAC
             << ", found spin type " << baryontype << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
diff --git a/src/EvtGenModels/EvtLb2plnuLCSRFF.cpp b/src/EvtGenModels/EvtLb2plnuLCSRFF.cpp
index c250d7d..cff713a 100644
--- a/src/EvtGenModels/EvtLb2plnuLCSRFF.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLCSRFF.cpp
@@ -1,135 +1,135 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLb2plnuLCSRFF.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <math.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
 void EvtLb2plnuLCSRFF::getdiracff( EvtId parent, EvtId daught, double q2,
                                    double /* mass */, double* f1, double* f2,
                                    double* f3, double* g1, double* g2, double* g3 )
 {
     // Define Event IDs for Lb and p
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId PRO = EvtPDL::getId( "p+" );
-    static EvtId PROB = EvtPDL::getId( "anti-p-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId PRO = EvtPDL::getId( "p+" );
+    static const EvtId PROB = EvtPDL::getId( "anti-p-" );
 
     if ( ( parent == LAMB && daught == PRO ) ||
          ( parent == LAMBB && daught == PROB ) ) {
         // Calculate Lb->p form factors based on LCSR predictions
         // Predictions taken from A. Khodjamirian, C. Klein, T. Mannel and Y.-M. Wang, arXiv.1108.2971 (2011)
 
         double MLamB = EvtPDL::getMass( parent );
         double MPro = EvtPDL::getMass( daught );
 
         double tplus = ( MLamB + MPro ) * ( MLamB + MPro );
         double tminus = ( MLamB - MPro ) * ( MLamB - MPro );
         double t0 = tplus - sqrt( tplus - tminus ) * sqrt( tplus + 6 );
         double z = ( sqrt( tplus - q2 ) - sqrt( tplus - t0 ) ) /
                    ( sqrt( tplus - q2 ) + sqrt( tplus - t0 ) );
         double z0 = ( sqrt( tplus ) - sqrt( tplus - t0 ) ) /
                     ( sqrt( tplus ) + sqrt( tplus - t0 ) );
 
         // FF parameters
         double f10 = 0.14;
         double bf1 = -1.49;
         double f20 = -0.054;
         double bf2 = -14.0;
         double g10 = 0.14;
         double bg1 = -4.05;
         double g20 = -0.028;
         double bg2 = -20.2;
 
         //FF paramterisation
         double F1 = ( f10 / ( 1.0 - q2 / ( 5.325 * 5.325 ) ) ) *
                     ( 1.0 + bf1 * ( z - z0 ) );
         double F2 = ( f20 / ( 1.0 - q2 / ( 5.325 * 5.325 ) ) ) *
                     ( 1.0 + bf2 * ( z - z0 ) );
         double G1 = ( g10 / ( 1.0 - q2 / ( 5.723 * 5.723 ) ) ) *
                     ( 1.0 + bg1 * ( z - z0 ) );
         double G2 = ( g20 / ( 1.0 - q2 / ( 5.723 * 5.723 ) ) ) *
                     ( 1.0 + bg2 * ( z - z0 ) );
 
         *f1 = F1 - ( MLamB + MPro ) * F2 / MLamB;
         *f2 = F2;
         *f3 = MPro * ( F2 ) / MLamB;
         *g1 = G1 - ( MLamB - MPro ) * G2 / MLamB;
         *g2 = -G2;
         *g3 = -MPro * G2 / MLamB;
 
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Only Lb -> p transitions allowed in EvtLb2plnuLCSRFF.\n";
         ::abort();
     }
 
     return;
 }
 
 void EvtLb2plnuLCSRFF::getraritaff( EvtId, EvtId, double, double, double*,
                                     double*, double*, double*, double*, double*,
                                     double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getraritaff in EvtLb2plnuLCSRFF.\n";
     ::abort();
 }
 
 void EvtLb2plnuLCSRFF::getscalarff( EvtId, EvtId, double, double, double*,
                                     double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getscalarff in EvtLb2plnuLCSRFF.\n";
     ::abort();
 }
 
 void EvtLb2plnuLCSRFF::getvectorff( EvtId, EvtId, double, double, double*,
                                     double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getvectorff in EvtLb2plnuLCSRFF.\n";
     ::abort();
 }
 
 void EvtLb2plnuLCSRFF::gettensorff( EvtId, EvtId, double, double, double*,
                                     double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :gettensorff in EvtLb2plnuLCSRFF.\n";
     ::abort();
 }
 
 void EvtLb2plnuLCSRFF::getbaryonff( EvtId, EvtId, double, double, double*,
                                     double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getbaryonff in EvtLb2plnuLCSRFF.\n";
     ::abort();
 }
diff --git a/src/EvtGenModels/EvtLb2plnuLQCD.cpp b/src/EvtGenModels/EvtLb2plnuLQCD.cpp
index 46c7c77..b60dd0f 100644
--- a/src/EvtGenModels/EvtLb2plnuLQCD.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLQCD.cpp
@@ -1,174 +1,174 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLb2plnuLQCD.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtLb2plnuLQCDFF.hh"
 
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 #ifdef D0
 #undef D0
 #endif
 EvtLb2plnuLQCD::EvtLb2plnuLQCD() : m_ffmodel( nullptr ), m_calcamp( nullptr )
 {
 }
 
 EvtLb2plnuLQCD::~EvtLb2plnuLQCD()
 {
     delete m_ffmodel;
     m_ffmodel = nullptr;
     delete m_calcamp;
     m_calcamp = nullptr;
 }
 
-std::string EvtLb2plnuLQCD::getName()
+std::string EvtLb2plnuLQCD::getName() const
 {
     return "Lb2plnuLQCD";
 }
 
-EvtDecayBase* EvtLb2plnuLQCD::clone()
+EvtDecayBase* EvtLb2plnuLQCD::clone() const
 {
     return new EvtLb2plnuLQCD;
 }
 
 void EvtLb2plnuLQCD::decay( EvtParticle* p )
 {
     //This is a kludge to avoid warnings because the K_2* mass becomes to large.
-    static EvtIdSet regenerateMasses{ "K_2*+", "K_2*-", "K_2*0", "anti-K_2*0",
-                                      "K_1+",  "K_1-",  "K_10",  "anti-K_10",
-                                      "D'_1+", "D'_1-", "D'_10", "anti-D'_10" };
+    static const EvtIdSet regenerateMasses{
+        "K_2*+", "K_2*-",     "K_2*0", "anti-K_2*0", "K_1+",  "K_1-",
+        "K_10",  "anti-K_10", "D'_1+", "D'_1-",      "D'_10", "anti-D'_10" };
 
     if ( regenerateMasses.contains( getDaug( 0 ) ) ) {
         p->resetFirstOrNot();
     }
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex r00( getArg( 0 ), 0.0 );
     EvtComplex r01( getArg( 1 ), 0.0 );
     EvtComplex r10( getArg( 2 ), 0.0 );
     EvtComplex r11( getArg( 3 ), 0.0 );
 
     m_calcamp->CalcAmp( p, m_amp2, m_ffmodel, r00, r01, r10, r11 );
 }
 
 void EvtLb2plnuLQCD::initProbMax()
 {
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId PRO = EvtPDL::getId( "p+" );
-    static EvtId PROB = EvtPDL::getId( "anti-p-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId PRO = EvtPDL::getId( "p+" );
+    static const EvtId PROB = EvtPDL::getId( "anti-p-" );
 
     EvtId parnum, barnum;
 
     parnum = getParentId();
     barnum = getDaug( 0 );
 
     if ( ( parnum == LAMB && barnum == PRO ) ||
          ( parnum == LAMBB && barnum == PROB ) ) {
         setProbMax( 22000.0 );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Decay does not have Lb->p setting ProbMax = 0 " << endl;
         setProbMax( 0.0 );
     }
 }
 
 void EvtLb2plnuLQCD::init()
 {
     if ( getNArg() != 4 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2plnuLQCD generator expected "
             << " 4 arguments but found:" << getNArg() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     if ( getNDaug() != 3 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong number of daughters in EvtLb2plnu.cc "
             << " 3 daughters expected but found: " << getNDaug() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     //We expect the parent to be a dirac particle
     //and the daughters to be X lepton neutrino
 
     EvtSpinType::spintype parenttype = EvtPDL::getSpinType( getParentId() );
     EvtSpinType::spintype baryontype = EvtPDL::getSpinType( getDaug( 0 ) );
     EvtSpinType::spintype leptontype = EvtPDL::getSpinType( getDaug( 1 ) );
     EvtSpinType::spintype neutrinotype = EvtPDL::getSpinType( getDaug( 2 ) );
 
     if ( parenttype != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2plnuLQCD generator expected "
             << " a DIRAC parent, found:" << EvtPDL::name( getParentId() )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     if ( leptontype != EvtSpinType::DIRAC ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2plnuLQCD generator expected "
             << " a DIRAC 2nd daughter, found:" << EvtPDL::name( getDaug( 1 ) )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     if ( neutrinotype != EvtSpinType::NEUTRINO ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtLb2plnuLQCD generator expected "
             << " a NEUTRINO 3rd daughter, found:" << EvtPDL::name( getDaug( 2 ) )
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     //set m_ffmodel
     m_ffmodel = new EvtLb2plnuLQCDFF;
 
     if ( baryontype == EvtSpinType::DIRAC ) {
         m_calcamp = new EvtSLBaryonAmp;
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Wrong baryon spin type in EvtLb2plnuLQCD.cc "
             << "Expected spin type " << EvtSpinType::DIRAC
             << ", found spin type " << baryontype << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
diff --git a/src/EvtGenModels/EvtLb2plnuLQCDFF.cpp b/src/EvtGenModels/EvtLb2plnuLQCDFF.cpp
index 98fb205..0d9ef8f 100644
--- a/src/EvtGenModels/EvtLb2plnuLQCDFF.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLQCDFF.cpp
@@ -1,119 +1,119 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtLb2plnuLQCDFF.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <math.h>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
 void EvtLb2plnuLQCDFF::getdiracff( EvtId parent, EvtId daught, double q2,
                                    double /* mass */, double* f1, double* f2,
                                    double* f3, double* g1, double* g2, double* g3 )
 {
     // Define Event IDs for Lb and p
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId PRO = EvtPDL::getId( "p+" );
-    static EvtId PROB = EvtPDL::getId( "anti-p-" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId PRO = EvtPDL::getId( "p+" );
+    static const EvtId PROB = EvtPDL::getId( "anti-p-" );
 
     if ( ( parent == LAMB && daught == PRO ) ||
          ( parent == LAMBB && daught == PROB ) ) {
         // Calculate Lb->p form factors based on LQCD predictions
         // Predictions taken from W. Detmold, C-J. Lin, S. Meinel and M.Wingate, arXiv:1306.0446 (2013)
 
         double MLamB = EvtPDL::getMass( parent );
         double MPro = EvtPDL::getMass( daught );
         double Y1 = 2.97;
         double X1 = 1.36;
         double Y2 = -0.28;
         double X2 = 0.81;
         double EnMn = ( MLamB * MLamB + MPro * MPro - q2 ) / ( 2.0 * MLamB ) -
                       MPro;
         double F1 = Y1 / ( ( X1 + EnMn ) * ( X1 + EnMn ) );
         double F2 = Y2 / ( ( X2 + EnMn ) * ( X2 + EnMn ) );
         double pi = atan( 1.0 ) * 4.0;
         double alphas = 0.214;
         double cv = 2.0 / 3.0 * alphas / pi;
         double cgam = 1.0 - ( alphas / pi ) * ( 4.0 / 3.0 );
 
         *f1 = cgam * ( F1 - F2 );
         *f2 = cv * F1 + ( 2.0 * cgam + cv ) * F2;
         *f3 = 0.0;
         *g1 = cgam * ( F1 + F2 );
         *g2 = -cv * F1 + ( 2.0 * cgam + cv ) * F2;
         *g3 = 0.0;
 
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Only Lb -> p transitions allowed in EvtLb2plnuLQCDFF.\n";
         ::abort();
     }
 
     return;
 }
 
 void EvtLb2plnuLQCDFF::getraritaff( EvtId, EvtId, double, double, double*,
                                     double*, double*, double*, double*, double*,
                                     double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getraritaff in EvtLb2plnuLQCDFF.\n";
     ::abort();
 }
 
 void EvtLb2plnuLQCDFF::getscalarff( EvtId, EvtId, double, double, double*,
                                     double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getscalarff in EvtLb2plnuLQCDFF.\n";
     ::abort();
 }
 
 void EvtLb2plnuLQCDFF::getvectorff( EvtId, EvtId, double, double, double*,
                                     double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getvectorff in EvtLb2plnuLQCDFF.\n";
     ::abort();
 }
 
 void EvtLb2plnuLQCDFF::gettensorff( EvtId, EvtId, double, double, double*,
                                     double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :gettensorff in EvtLb2plnuLQCDFF.\n";
     ::abort();
 }
 
 void EvtLb2plnuLQCDFF::getbaryonff( EvtId, EvtId, double, double, double*,
                                     double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getbaryonff in EvtLb2plnuLQCDFF.\n";
     ::abort();
 }
diff --git a/src/EvtGenModels/EvtMelikhov.cpp b/src/EvtGenModels/EvtMelikhov.cpp
index 0d939c4..c6b6690 100644
--- a/src/EvtGenModels/EvtMelikhov.cpp
+++ b/src/EvtGenModels/EvtMelikhov.cpp
@@ -1,71 +1,71 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtMelikhov.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtMelikhovFF.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtMelikhov::getName()
+std::string EvtMelikhov::getName() const
 {
     return "MELIKHOV";
 }
 
-EvtDecayBase* EvtMelikhov::clone()
+EvtDecayBase* EvtMelikhov::clone() const
 {
     return new EvtMelikhov;
 }
 
 void EvtMelikhov::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     m_calcamp->CalcAmp( p, m_amp2, m_Melikhovffmodel.get() );
 }
 
 void EvtMelikhov::init()
 {
     checkNArg( 1 );
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     m_Melikhovffmodel = std::make_unique<EvtMelikhovFF>( getArg( 0 ) );
     m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
 }
 
 void EvtMelikhov::initProbMax()
 {
     setProbMax( 10000.0 );
 }
diff --git a/src/EvtGenModels/EvtOmegaDalitz.cpp b/src/EvtGenModels/EvtOmegaDalitz.cpp
index 0ca44c9..28dbe9a 100644
--- a/src/EvtGenModels/EvtOmegaDalitz.cpp
+++ b/src/EvtGenModels/EvtOmegaDalitz.cpp
@@ -1,92 +1,92 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtOmegaDalitz.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector3R.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtOmegaDalitz::getName()
+std::string EvtOmegaDalitz::getName() const
 {
     return "OMEGA_DALITZ";
 }
 
-EvtDecayBase* EvtOmegaDalitz::clone()
+EvtDecayBase* EvtOmegaDalitz::clone() const
 {
     return new EvtOmegaDalitz;
 }
 
 void EvtOmegaDalitz::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::VECTOR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 }
 
 void EvtOmegaDalitz::initProbMax()
 {
     setProbMax( 1.0 );
 }
 
 void EvtOmegaDalitz::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtVector4C ep[3];
 
     ep[0] = p->eps( 0 );
     ep[1] = p->eps( 1 );
     ep[2] = p->eps( 2 );
 
     EvtVector4R mompi1 = p->getDaug( 0 )->getP4();
     EvtVector4R mompi2 = p->getDaug( 1 )->getP4();
 
     EvtVector3R p1( mompi1.get( 1 ), mompi1.get( 2 ), mompi1.get( 3 ) );
     EvtVector3R p2( mompi2.get( 1 ), mompi2.get( 2 ), mompi2.get( 3 ) );
     EvtVector3R q = cross( p2, p1 );
 
     EvtVector3C e1( ep[0].get( 1 ), ep[0].get( 2 ), ep[0].get( 3 ) );
     EvtVector3C e2( ep[1].get( 1 ), ep[1].get( 2 ), ep[1].get( 3 ) );
     EvtVector3C e3( ep[2].get( 1 ), ep[2].get( 2 ), ep[2].get( 3 ) );
 
     //This is an approximate formula of the maximum value that
     //|q| can have.
     double norm = 1.14 / ( p->mass() * p->mass() / 9.0 - mompi1.mass2() );
 
     vertex( 0, norm * e1 * q );
     vertex( 1, norm * e2 * q );
     vertex( 2, norm * e3 * q );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtPVVCPLH.cpp b/src/EvtGenModels/EvtPVVCPLH.cpp
index a957758..8d2184d 100644
--- a/src/EvtGenModels/EvtPVVCPLH.cpp
+++ b/src/EvtGenModels/EvtPVVCPLH.cpp
@@ -1,194 +1,196 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtPVVCPLH.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtSVVHelAmp.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtPVVCPLH::getName()
+std::string EvtPVVCPLH::getName() const
 {
     return "PVV_CPLH";
 }
 
-EvtDecayBase* EvtPVVCPLH::clone()
+EvtDecayBase* EvtPVVCPLH::clone() const
 {
     return new EvtPVVCPLH;
 }
 
 void EvtPVVCPLH::init()
 {
     // check that there are 8 arguments (deltaMs no argument anymore)
     checkNArg( 8 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::VECTOR );
 }
 
 void EvtPVVCPLH::initProbMax()
 {
     //This is probably not quite right, but it should do as a start...
     //Anders
 
     setProbMax( 2 * ( getArg( 2 ) * getArg( 2 ) + getArg( 4 ) * getArg( 4 ) +
                       getArg( 6 ) * getArg( 6 ) ) );
 }
 
 void EvtPVVCPLH::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
 
     //This is only to get tag-ID
     //Mixing is not relevant
     //Lifetime is made correctly later
     //Tristan
     EvtId other_b;
     double t;
 
     // To generate integrated CP asymmetry, EvtGen uses the "flipping".
     // CP-asymmetry in this channel very small, since:
     // deltaMs large ..and..
     // CPV-phase small
     EvtCPUtil::getInstance()->OtherB( p, t, other_b );
 
     //Here we're gonna generate and set the "envelope" lifetime
     //So we take the longest living component (for positive deltaGamma: tauH)
     //The double exponent will be taken care of later, by the amplitudes
     //Tristan
 
-    static double Gamma = EvtConst::c / ( EvtPDL::getctau( BS0 ) );
-    static double deltaGamma = EvtCPUtil::getInstance()->getDeltaGamma( BS0 );
-    static double ctauLong = EvtConst::c / ( Gamma - fabs( deltaGamma ) / 2 );
+    static const double Gamma = EvtConst::c / ( EvtPDL::getctau( BS0 ) );
+    static const double deltaGamma = EvtCPUtil::getInstance()->getDeltaGamma(
+        BS0 );
+    static const double ctauLong = EvtConst::c /
+                                   ( Gamma - fabs( deltaGamma ) / 2 );
     // if dG>0: tauLong=tauH(CP-odd) is then largest
 
     //This overrules the lifetimes made in OtherB
     t = -log( EvtRandom::Flat() ) *
         ( ctauLong );    //ctauLong has same dimensions as t
     if ( isBsMixed( p ) ) {
         p->getParent()->setLifetime( t );
     } else {
         p->setLifetime( t );
     }
 
     //These should be filled with the transversity amplitudes at t=0 //Tristan
     EvtComplex G0P, G1P, G1M;
     G1P = EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                       getArg( 2 ) * sin( getArg( 3 ) ) );
     G0P = EvtComplex( getArg( 4 ) * cos( getArg( 5 ) ),
                       getArg( 4 ) * sin( getArg( 5 ) ) );
     G1M = EvtComplex( getArg( 6 ) * cos( getArg( 7 ) ),
                       getArg( 6 ) * sin( getArg( 7 ) ) );
 
     EvtComplex lambda_km =
         EvtComplex( cos( 2 * getArg( 0 ) ),
                     sin( 2 * getArg( 0 ) ) );    //was een min in oude versie
 
     //deltaMs is no argument anymore
     //Tristan
 
-    static double deltaMs = EvtCPUtil::getInstance()->getDeltaM( BS0 );
+    static const double deltaMs = EvtCPUtil::getInstance()->getDeltaM( BS0 );
 
     EvtComplex cG0P, cG1P, cG1M;
 
     double mt = exp( -std::max( 0., deltaGamma ) * t / ( 2 * EvtConst::c ) );
     double pt = exp( +std::min( 0., deltaGamma ) * t / ( 2 * EvtConst::c ) );
 
     EvtComplex gplus =
         ( mt * EvtComplex( cos( deltaMs * t / ( 2 * EvtConst::c ) ),
                            sin( deltaMs * t / ( 2 * EvtConst::c ) ) ) +
           pt * EvtComplex( cos( deltaMs * t / ( 2 * EvtConst::c ) ),
                            sin( -deltaMs * t / ( 2 * EvtConst::c ) ) ) ) /
         2;
     EvtComplex gminus =
         ( mt * EvtComplex( cos( deltaMs * t / ( 2 * EvtConst::c ) ),
                            sin( deltaMs * t / ( 2 * EvtConst::c ) ) ) -
           pt * EvtComplex( cos( deltaMs * t / ( 2 * EvtConst::c ) ),
                            sin( -deltaMs * t / ( 2 * EvtConst::c ) ) ) ) /
         2;
     ;
 
     if ( other_b == BSB ) {
         //These are the right equations for the transversity formalism
         //cGOP is de 0-component, CP-even, so lives shorter: mainly lifetime tauL
         //cG1P is the //-component, also CP-even, also mainly smaller exponent
         //cG1M is the transverse component, CP-odd, so has mainly longer lifetime tauH
         //Tristan
         cG0P = G0P * ( gplus + lambda_km * gminus );
         cG1P = G1P * ( gplus + lambda_km * gminus );
         cG1M = G1M * ( gplus - lambda_km * gminus );
     } else if ( other_b == BS0 ) {
         //The equations for BsBar
         //Note the minus-sign difference
         //Tristan
         cG0P = G0P * ( gplus + ( 1.0 / lambda_km ) * gminus );
         cG1P = G1P * ( gplus + ( 1.0 / lambda_km ) * gminus );
         cG1M = -G1M * ( gplus - ( 1.0 / lambda_km ) * gminus );
 
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "other_b was not BSB or BS0!" << std::endl;
         ::abort();
     }
 
     EvtComplex A0, AP, AM;
     //Converting the transversity amplitudes
     //to helicity amplitudes
     //(to plug them into SVVHelAmp)
     A0 = cG0P;
     AP = ( cG1P + cG1M ) / sqrt( 2.0 );
     AM = ( cG1P - cG1M ) / sqrt( 2.0 );
 
     EvtSVVHelAmp::SVVHel( p, m_amp2, getDaug( 0 ), getDaug( 1 ), AP, A0, AM );
 
     return;
 }
 
 bool EvtPVVCPLH::isBsMixed( EvtParticle* p )
 {
     if ( !( p->getParent() ) )
         return false;
 
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
 
     if ( ( p->getId() != BS0 ) && ( p->getId() != BSB ) )
         return false;
 
     if ( ( p->getParent()->getId() == BS0 ) || ( p->getParent()->getId() == BSB ) )
         return true;
 
     return false;
 }
diff --git a/src/EvtGenModels/EvtPartWave.cpp b/src/EvtGenModels/EvtPartWave.cpp
index e4c2369..3fcb754 100644
--- a/src/EvtGenModels/EvtPartWave.cpp
+++ b/src/EvtGenModels/EvtPartWave.cpp
@@ -1,279 +1,279 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtPartWave.hh"
 
 #include "EvtGenBase/EvtCGCoefSingle.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <algorithm>
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtPartWave::getName()
+std::string EvtPartWave::getName() const
 {
     return "PARTWAVE";
 }
 
-EvtDecayBase* EvtPartWave::clone()
+EvtDecayBase* EvtPartWave::clone() const
 {
     return new EvtPartWave;
 }
 
 void EvtPartWave::init()
 {
     checkNDaug( 2 );
 
     //find out how many states each particle have
     int nA = EvtSpinType::getSpinStates( EvtPDL::getSpinType( getParentId() ) );
     int nB = EvtSpinType::getSpinStates( EvtPDL::getSpinType( getDaug( 0 ) ) );
     int nC = EvtSpinType::getSpinStates( EvtPDL::getSpinType( getDaug( 1 ) ) );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "nA,nB,nC:" << nA << "," << nB << "," << nC << endl;
     }
 
     //find out what 2 times the spin is
     int JA2 = EvtSpinType::getSpin2( EvtPDL::getSpinType( getParentId() ) );
     int JB2 = EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 0 ) ) );
     int JC2 = EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 1 ) ) );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "JA2,JB2,JC2:" << JA2 << "," << JB2 << "," << JC2 << endl;
     }
 
     //allocate memory
     int* lambdaA2 = new int[nA];
     int* lambdaB2 = new int[nB];
     int* lambdaC2 = new int[nC];
 
     EvtComplexPtr* HBC = new EvtComplexPtr[nB];
     for ( int ib = 0; ib < nB; ib++ ) {
         HBC[ib] = new EvtComplex[nC];
     }
 
     //find the allowed helicities (actually 2*times the helicity!)
 
     fillHelicity( lambdaA2, nA, JA2 );
     fillHelicity( lambdaB2, nB, JB2 );
     fillHelicity( lambdaC2, nC, JC2 );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Helicity states of particle A:" << endl;
         for ( int i = 0; i < nA; i++ ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" ) << lambdaA2[i] << endl;
         }
 
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Helicity states of particle B:" << endl;
         for ( int i = 0; i < nB; i++ ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" ) << lambdaB2[i] << endl;
         }
 
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Helicity states of particle C:" << endl;
         for ( int i = 0; i < nC; i++ ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" ) << lambdaC2[i] << endl;
         }
 
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Will now figure out the valid (M_LS) states:" << endl;
     }
 
     int Lmin = std::max( JA2 - JB2 - JC2,
                          std::max( JB2 - JA2 - JC2, JC2 - JA2 - JB2 ) );
     if ( Lmin < 0 )
         Lmin = 0;
     int Lmax = JA2 + JB2 + JC2;
 
     int nPartialWaveAmp = 0;
 
     int nL[50];
     int nS[50];
 
     for ( int L = Lmin; L <= Lmax; L += 2 ) {
         int Smin = abs( L - JA2 );
         if ( Smin < abs( JB2 - JC2 ) )
             Smin = abs( JB2 - JC2 );
         int Smax = L + JA2;
         if ( Smax > abs( JB2 + JC2 ) )
             Smax = abs( JB2 + JC2 );
         for ( int S = Smin; S <= Smax; S += 2 ) {
             nL[nPartialWaveAmp] = L;
             nS[nPartialWaveAmp] = S;
 
             nPartialWaveAmp++;
             if ( verbose() ) {
                 EvtGenReport( EVTGEN_INFO, "EvtGen" )
                     << "M[" << L << "][" << S << "]" << endl;
             }
         }
     }
 
     checkNArg( nPartialWaveAmp * 2 );
 
     int argcounter = 0;
 
     EvtComplex M[50];
 
     double partampsqtot = 0.0;
 
     for ( int i = 0; i < nPartialWaveAmp; i++ ) {
         M[i] = getArg( argcounter ) *
                exp( EvtComplex( 0.0, getArg( argcounter + 1 ) ) );
         argcounter += 2;
         partampsqtot += abs2( M[i] );
         if ( verbose() ) {
             EvtGenReport( EVTGEN_INFO, "EvtGen" )
                 << "M[" << nL[i] << "][" << nS[i] << "]=" << M[i] << endl;
         }
     }
 
     //Now calculate the helicity amplitudes
 
     double helampsqtot = 0.0;
 
     for ( int ib = 0; ib < nB; ib++ ) {
         for ( int ic = 0; ic < nC; ic++ ) {
             HBC[ib][ic] = 0.0;
             if ( abs( lambdaB2[ib] - lambdaC2[ic] ) <= JA2 ) {
                 for ( int i = 0; i < nPartialWaveAmp; i++ ) {
                     int L = nL[i];
                     int S = nS[i];
                     int lambda2 = lambdaB2[ib];
                     int lambda3 = lambdaC2[ic];
                     int s1 = JA2;
                     int s2 = JB2;
                     int s3 = JC2;
                     int m1 = lambda2 - lambda3;
                     EvtCGCoefSingle c1( s2, s3 );
                     EvtCGCoefSingle c2( L, S );
 
                     if ( verbose() ) {
                         EvtGenReport( EVTGEN_INFO, "EvtGen" )
                             << "s2,lambda2:" << s2 << " " << lambda2 << endl;
                     }
                     //fkw changes to satisfy KCC
                     double fkwTmp = ( L + 1.0 ) / ( s1 + 1.0 );
 
                     if ( S >= abs( m1 ) ) {
                         EvtComplex tmp = sqrt( fkwTmp ) *
                                          c1.coef( S, m1, s2, s3, lambda2,
                                                   -lambda3 ) *
                                          c2.coef( s1, m1, L, S, 0, m1 ) * M[i];
                         HBC[ib][ic] += tmp;
                     }
                 }
                 if ( verbose() ) {
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << "HBC[" << ib << "][" << ic << "]=" << HBC[ib][ic]
                         << endl;
                 }
             }
             helampsqtot += abs2( HBC[ib][ic] );
         }
     }
 
     if ( fabs( helampsqtot - partampsqtot ) / ( helampsqtot + partampsqtot ) >
          1e-6 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "In EvtPartWave for decay " << EvtPDL::name( getParentId() )
             << " -> " << EvtPDL::name( getDaug( 0 ) ) << " "
             << EvtPDL::name( getDaug( 1 ) ) << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "With arguments: " << std::endl;
         for ( int i = 0; i * 2 < getNArg(); i++ ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "M(" << nL[i] << "," << nS[i]
                 << ")="
                 //				 <<getArg(2*i)<<" "<<getArg(2*i+1)<<std::endl;
                 << M[i] << std::endl;
         }
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "The total probability in the partwave basis is: " << partampsqtot
             << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "The total probability in the helamp basis is: " << helampsqtot
             << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Most likely this is because the specified partwave amplitudes "
             << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "project onto unphysical helicities of photons or neutrinos. "
             << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Seriously consider if your specified amplitudes are correct. "
             << std::endl;
     }
 
     m_evalHelAmp = std::make_unique<EvtEvalHelAmp>( getParentId(), getDaug( 0 ),
                                                     getDaug( 1 ), HBC );
 }
 
 void EvtPartWave::initProbMax()
 {
     double maxprob = m_evalHelAmp->probMax();
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "Calculated probmax" << maxprob << endl;
     }
 
     setProbMax( maxprob );
 }
 
 void EvtPartWave::decay( EvtParticle* p )
 {
     //first generate simple phase space
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     m_evalHelAmp->evalAmp( p, m_amp2 );
 
     return;
 }
 
 void EvtPartWave::fillHelicity( int* lambda2, int n, int J2 )
 {
     //photon is special case!
     if ( n == 2 && J2 == 2 ) {
         lambda2[0] = 2;
         lambda2[1] = -2;
         return;
     }
 
     assert( n == J2 + 1 );
 
     for ( int i = 0; i < n; i++ ) {
         lambda2[i] = n - i * 2 - 1;
     }
 
     return;
 }
diff --git a/src/EvtGenModels/EvtPhiDalitz.cpp b/src/EvtGenModels/EvtPhiDalitz.cpp
index 17228f3..c3d7d6b 100644
--- a/src/EvtGenModels/EvtPhiDalitz.cpp
+++ b/src/EvtGenModels/EvtPhiDalitz.cpp
@@ -1,209 +1,209 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtPhiDalitz.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector3C.hh"
 #include "EvtGenBase/EvtVector3R.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <math.h>
 #include <stdlib.h>
 #include <string>
 
 // Implementation of KLOE measurement
 // PL B561: 55-60 (2003) + Erratum B609:449-450 (2005)
 // or hep-ex/0303016v2
 
-std::string EvtPhiDalitz::getName()
+std::string EvtPhiDalitz::getName() const
 {
     return "PHI_DALITZ";
 }
 
-EvtDecayBase* EvtPhiDalitz::clone()
+EvtDecayBase* EvtPhiDalitz::clone() const
 {
     return new EvtPhiDalitz;
 }
 
 void EvtPhiDalitz::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::VECTOR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
     checkSpinDaughter( 2, EvtSpinType::SCALAR );
 
     // results taken from KLOE results: arxiv.org/abs/hep-ex/0303016
     m_mRho = 0.7758;
     m_gRho = 0.1439;
     m_aD = 0.78;
     m_phiD = -2.47;
     m_aOmega = 0.0071;
     m_phiOmega = -0.22;
 
     m_locPip = -1;
     m_locPim = -1;
     m_locPi0 = -1;
 
     for ( int i = 0; i < 3; i++ ) {
         if ( getDaug( i ) == EvtPDL::getId( "pi+" ) )
             m_locPip = i;
         if ( getDaug( i ) == EvtPDL::getId( "pi-" ) )
             m_locPim = i;
         if ( getDaug( i ) == EvtPDL::getId( "pi0" ) )
             m_locPi0 = i;
     }
     if ( m_locPip == -1 || m_locPim == -1 || m_locPi0 == -1 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << getModelName()
             << "generator expects daughters to be pi+ pi- pi0\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Found " << EvtPDL::name( getDaug( 0 ) ) << " "
             << EvtPDL::name( getDaug( 1 ) ) << " "
             << EvtPDL::name( getDaug( 2 ) ) << std::endl;
     }
 }
 
 void EvtPhiDalitz::initProbMax()
 {
     setProbMax( 300.0 );
 }
 
 void EvtPhiDalitz::decay( EvtParticle* p )
 {
     const EvtId PIP = EvtPDL::getId( "pi+" );
     const EvtId PIM = EvtPDL::getId( "pi-" );
     const EvtId PIZ = EvtPDL::getId( "pi0" );
     const EvtId OMEGA = EvtPDL::getId( "omega" );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     const EvtVector4R Ppip = p->getDaug( m_locPip )->getP4();
     const EvtVector4R Ppim = p->getDaug( m_locPim )->getP4();
     const EvtVector4R Ppi0 = p->getDaug( m_locPi0 )->getP4();
     const EvtVector4R Qm = ( Ppim + Ppi0 );
     const EvtVector4R Qp = ( Ppip + Ppi0 );
     const EvtVector4R Q0 = ( Ppip + Ppim );
     const double m_pip = EvtPDL::getMeanMass( PIP );
     const double m_pim = EvtPDL::getMeanMass( PIM );
     const double m_pi0 = EvtPDL::getMeanMass( PIZ );
     const double Mrhop = m_mRho;
     const double Mrhom = m_mRho;
     const double Mrho0 = m_mRho;
     const double M2rhop = pow( Mrhop, 2 );
     const double M2rhom = pow( Mrhom, 2 );
     const double M2rho0 = pow( Mrho0, 2 );
     const double M2omega = pow( EvtPDL::getMeanMass( OMEGA ), 2 );
 
     const double Wrhop = m_gRho;
     const double Wrhom = m_gRho;
     const double Wrho0 = m_gRho;
     const double Womega = EvtPDL::getWidth( OMEGA );
 
     const double QmM = Qm.mass();
     const double QmM2 = Qm.mass2();
     const double QpM = Qp.mass();
     const double QpM2 = Qp.mass2();
     const double Q0M = Q0.mass();
     const double Q0M2 = Q0.mass2();
 
     //Rho- Resonance Amplitude
     const double qm = calc_q( QmM, m_pim, m_pi0 );
     const double qm_0 = calc_q( Mrhom, m_pim, m_pi0 );
     const double Gm = Wrhom * pow( qm / qm_0, 3 ) * ( M2rhom / QmM2 );
     const EvtComplex Drhom( ( QmM2 - M2rhom ), QmM * Gm );
     const EvtComplex A1( M2rhom / Drhom );
 
     //Rho+ Resonance Amplitude
     const double qp = calc_q( QpM, m_pip, m_pi0 );
     const double qp_0 = calc_q( Mrhop, m_pip, m_pi0 );
     const double Gp = Wrhop * pow( qp / qp_0, 3 ) * ( M2rhop / QpM2 );
     const EvtComplex Drhop( ( QpM2 - M2rhop ), QpM * Gp );
     const EvtComplex A2( M2rhop / Drhop );
 
     //Rho0 Resonance Amplitude
     const double q0 = calc_q( Q0M, m_pip, m_pim );
     const double q0_0 = calc_q( Mrho0, m_pip, m_pim );
     const double G0 = Wrho0 * pow( q0 / q0_0, 3 ) * ( M2rho0 / Q0M2 );
     const EvtComplex Drho0( ( Q0M2 - M2rho0 ), Q0M * G0 );
     const EvtComplex A3( M2rho0 / Drho0 );
 
     //Omega Resonance Amplitude
     const EvtComplex OmegaA( m_aOmega * cos( m_phiOmega ),
                              m_aOmega * sin( m_phiOmega ) );
     const EvtComplex DOmega( ( Q0M2 - M2omega ), Q0M * Womega );
     const EvtComplex A4( OmegaA * M2omega / DOmega );
 
     //Direct Decay Amplitude
     const EvtComplex A5( m_aD * cos( m_phiD ), m_aD * sin( m_phiD ) );
 
     const EvtComplex Atot = A1 + A2 + A3 + A4 + A5;
 
     // Polarization
 
     const EvtVector4C ep0 = p->eps( 0 );
     const EvtVector4C ep1 = p->eps( 1 );
     const EvtVector4C ep2 = p->eps( 2 );
 
     const EvtVector3R p1( Ppip.get( 1 ), Ppip.get( 2 ), Ppip.get( 3 ) );
     const EvtVector3R p2( Ppim.get( 1 ), Ppim.get( 2 ), Ppim.get( 3 ) );
     const EvtVector3R q = cross( p1, p2 );
 
     const EvtVector3C e1( ep0.get( 1 ), ep0.get( 2 ), ep0.get( 3 ) );
     const EvtVector3C e2( ep1.get( 1 ), ep1.get( 2 ), ep1.get( 3 ) );
     const EvtVector3C e3( ep2.get( 1 ), ep2.get( 2 ), ep2.get( 3 ) );
 
     //This is an approximate formula of the maximum value that
     //|q| can have.
     const double pM = p->mass();
     const double mSum = Ppip.mass() + Ppim.mass() + Ppi0.mass();
     const double norm = 10.26 / ( pM * pM - mSum * mSum );
 
     vertex( 0, norm * e1 * q * Atot );
     vertex( 1, norm * e2 * q * Atot );
     vertex( 2, norm * e3 * q * Atot );
 
     return;
 }
 
 double EvtPhiDalitz::calc_q( double M, double m1, double m2 ) const
 {
     const double m12Sum = m1 + m2;
 
     if ( M > m12Sum ) {
         const double MSq = M * M;
         const double m12Diff = m1 - m2;
 
         return sqrt( ( MSq - ( m12Sum ) * ( m12Sum ) ) *
                      ( MSq - ( m12Diff ) * ( m12Diff ) ) ) /
                ( 2.0 * M );
     } else {
         return 0.0;
     }
 }
diff --git a/src/EvtGenModels/EvtPhspDecaytimeCut.cpp b/src/EvtGenModels/EvtPhspDecaytimeCut.cpp
index 97cf6fc..fa4b751 100644
--- a/src/EvtGenModels/EvtPhspDecaytimeCut.cpp
+++ b/src/EvtGenModels/EvtPhspDecaytimeCut.cpp
@@ -1,65 +1,65 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtPhspDecaytimeCut.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtPhspDecaytimeCut::getName()
+std::string EvtPhspDecaytimeCut::getName() const
 {
     return "PHSPDECAYTIMECUT";
 }
 
-EvtDecayBase* EvtPhspDecaytimeCut::clone()
+EvtDecayBase* EvtPhspDecaytimeCut::clone() const
 {
     return new EvtPhspDecaytimeCut;
 }
 
 void EvtPhspDecaytimeCut::init()
 {
     // check that there are 1 arguments
     checkNArg( 1 );
     // This argument is minimum decay time in ps converted here to EvtGen
     // units in which c=1
     m_minDecayTime = getArg( 0 ) * EvtConst::c * 1.e-12;
 }
 
 void EvtPhspDecaytimeCut::initProbMax()
 {
     noProbMax();
 }
 
 void EvtPhspDecaytimeCut::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     // Shift generated decay time by minimum we require
     const double currentDecaytime = p->getLifetime();
     p->setLifetime( currentDecaytime + m_minDecayTime );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtPhspFlatLifetime.cpp b/src/EvtGenModels/EvtPhspFlatLifetime.cpp
index 8465789..a16960b 100644
--- a/src/EvtGenModels/EvtPhspFlatLifetime.cpp
+++ b/src/EvtGenModels/EvtPhspFlatLifetime.cpp
@@ -1,77 +1,77 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtPhspFlatLifetime.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
 //==============================================================================
 // Return the name of the model
 //==============================================================================
-std::string EvtPhspFlatLifetime::getName()
+std::string EvtPhspFlatLifetime::getName() const
 {
     return "PHSPFLATLIFETIME";
 }
 
 //==============================================================================
 // Copy the model
 //==============================================================================
-EvtDecayBase* EvtPhspFlatLifetime::clone()
+EvtDecayBase* EvtPhspFlatLifetime::clone() const
 {
     return new EvtPhspFlatLifetime;
 }
 
 //==============================================================================
 // Initialize the model
 //==============================================================================
 void EvtPhspFlatLifetime::init()
 {
     // check that there is 1 argument in the decay file
     checkNArg( 1 );
     // this argument is the lifetime upper edge (in ps)
     m_maxLifetime = getArg( 0 ) * EvtConst::c * 1.e-12;
 }
 
 //==============================================================================
 // Compute the maximum probability (max of the pdf)
 //==============================================================================
 void EvtPhspFlatLifetime::initProbMax()
 {
     noProbMax();
 }
 
 //==============================================================================
 // Decay the particle according to the model
 //==============================================================================
 void EvtPhspFlatLifetime::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     // generate the lifetime flat between 0 and max
     double l = EvtRandom::Flat( 0., m_maxLifetime );
     // modify the lifetime of the particle (in mm)
     p->setLifetime( l );
 }
diff --git a/src/EvtGenModels/EvtPi0Dalitz.cpp b/src/EvtGenModels/EvtPi0Dalitz.cpp
index 2ae1b52..bb59362 100644
--- a/src/EvtGenModels/EvtPi0Dalitz.cpp
+++ b/src/EvtGenModels/EvtPi0Dalitz.cpp
@@ -1,139 +1,139 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtPi0Dalitz.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <fstream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string>
 using std::fstream;
 
-std::string EvtPi0Dalitz::getName()
+std::string EvtPi0Dalitz::getName() const
 {
     return "PI0_DALITZ";
 }
 
-EvtDecayBase* EvtPi0Dalitz::clone()
+EvtDecayBase* EvtPi0Dalitz::clone() const
 {
     return new EvtPi0Dalitz;
 }
 
 void EvtPi0Dalitz::initProbMax()
 {
     // Search for maximum probability. In order to avoid setting up all
     // particles with spinors and four-momenta, we use result after all
     // contractions, which is:
     // 1/((m_R^2-q^2)^2+m_R^2 Gamma_R^2) 1/(2q^2) (M^2-q^2)^2 beta_l
     // (1+cos(theta)^2) where we set cos(theta)=1
     auto daughter1 = getDaug( 0 );
     auto daughter2 = getDaug( 1 );
     double q2Min = EvtPDL::getMass( daughter1 ) + EvtPDL::getMass( daughter2 );
     q2Min *= q2Min;
     double q2Max = EvtPDL::getMass( getParentId() );
     q2Max *= q2Max;
     const int steps = 20000;
     const double step = ( q2Max - q2Min ) / steps;
     double maxProb = 0;
     for ( int ii = 0; ii < steps; ++ii ) {
         double q2 = q2Min + ii * step;
         const double mSqDiff = m_m0Sq - q2;
         const double q2Sq = q2 * q2;
         double prob = ( q2Max - q2 ) * ( q2Max - q2 ) * ( q2 - q2Min ) / ( q2Sq );
         prob *= ( 1.0 / ( mSqDiff * mSqDiff + m_m0SqG0Sq ) );
         // When generating events, we do not start from phase-space, but
         // add some pole to it, weight of which is taken into account
         // elsewhere
         prob /= 1.0 + m_poleSize / ( q2Sq );
         if ( prob > maxProb ) {
             maxProb = prob;
         }
     }
     setProbMax( maxProb * 1.05 );
 }
 
 void EvtPi0Dalitz::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::PHOTON );
 
     // Rescale pole size to improve efficiency.  Not sure about exact
     // factor, but this seem to be best simple rescaling for
     // eta-->e+e-gamma.
     const double parentMass = EvtPDL::getMass( getParentId() );
     m_poleSize *= parentMass * parentMass / ( 0.135 * 0.135 );
 }
 
 void EvtPi0Dalitz::decay( EvtParticle* p )
 {
     EvtParticle *ep, *em, *gamma;
     setWeight( p->initializePhaseSpace( getNDaug(), getDaugs(), false,
                                         m_poleSize, 0, 1 ) );
     ep = p->getDaug( 0 );
     em = p->getDaug( 1 );
     gamma = p->getDaug( 2 );
 
     // the next four lines generates events with a weight such that
     // the efficiency for selecting them is good. The parameter below of
     // 0.1 is the size of the peak at low q^2 (in arbitrary units).
     // The value of 0.1 is appropriate for muons.
     // when you use this remember to remove the cut on q^2!
 
     //ep em invariant mass^2
     double m2 = ( ep->getP4() + em->getP4() ).mass2();
     EvtVector4R q = ep->getP4() + em->getP4();
     //Just use the prob summed over spins...
 
     EvtTensor4C w, v;
 
     v = 2.0 * ( gamma->getP4() * q ) *
             EvtGenFunctions::directProd( q, gamma->getP4() ) -
         ( gamma->getP4() * q ) * ( gamma->getP4() * q ) * EvtTensor4C::g() -
         m2 * EvtGenFunctions::directProd( gamma->getP4(), gamma->getP4() );
 
     w = 4.0 * ( EvtGenFunctions::directProd( ep->getP4(), em->getP4() ) +
                 EvtGenFunctions::directProd( em->getP4(), ep->getP4() ) -
                 EvtTensor4C::g() *
                     ( ep->getP4() * em->getP4() - ep->getP4().mass2() ) );
 
     double prob = ( real( cont( v, w ) ) ) / ( m2 * m2 );
     const double m2Diff = m_m0Sq - m2;
     prob *= ( 1.0 / ( m2Diff * m2Diff + m_m0SqG0Sq ) );
 
     //  EvtGenReport(EVTGEN_INFO,"EvtGen") << "prob is "<<prob<<endl;
     setProb( prob );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtPsi2JpsiPiPi.cpp b/src/EvtGenModels/EvtPsi2JpsiPiPi.cpp
index 4000294..493f124 100644
--- a/src/EvtGenModels/EvtPsi2JpsiPiPi.cpp
+++ b/src/EvtGenModels/EvtPsi2JpsiPiPi.cpp
@@ -1,174 +1,174 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtPsi2JpsiPiPi.hh"
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <cmath>
 
 EvtPsi2JpsiPiPi::EvtPsi2JpsiPiPi() :
     m_tree( false ),
     m_phi( 0.0 ),
     m_cosPhi( 1.0 ),
     m_cos2Phi( 1.0 ),
     m_sinPhi( 0.0 ),
     m_sin2Phi( 0.0 )
 {
     this->setNLOArrays();
 }
 
 void EvtPsi2JpsiPiPi::setNLOArrays()
 {
     // Parameters for NLO corrections obtained by fitting distributions
     // shown in Fig 2 of the article
     m_c0[0] = 1.21214;
     m_c0[1] = -2.517;
     m_c0[2] = 4.66947;
     m_c0[3] = 15.0853;
     m_c0[4] = -49.7381;
     m_c0[5] = 35.5604;
 
     m_c1[0] = -6.74237;
     m_c1[1] = 84.2391;
     m_c1[2] = -389.74;
     m_c1[3] = 823.902;
     m_c1[4] = -808.538;
     m_c1[5] = 299.1;
 
     m_c2[0] = -1.25073;
     m_c2[1] = 16.2666;
     m_c2[2] = -74.6453;
     m_c2[3] = 156.789;
     m_c2[4] = -154.185;
     m_c2[5] = 57.5711;
 
     m_s1[0] = -8.01579;
     m_s1[1] = 93.9513;
     m_s1[2] = -451.713;
     m_s1[3] = 1049.67;
     m_s1[4] = -1162.9;
     m_s1[5] = 492.364;
 
     m_s2[0] = 3.04459;
     m_s2[1] = -26.0901;
     m_s2[2] = 81.1557;
     m_s2[3] = -112.875;
     m_s2[4] = 66.0432;
     m_s2[5] = -10.0446;
 }
 
-std::string EvtPsi2JpsiPiPi::getName()
+std::string EvtPsi2JpsiPiPi::getName() const
 {
     return "PSI2JPSIPIPI";
 }
 
-EvtDecayBase* EvtPsi2JpsiPiPi::clone()
+EvtDecayBase* EvtPsi2JpsiPiPi::clone() const
 {
     return new EvtPsi2JpsiPiPi;
 }
 
 void EvtPsi2JpsiPiPi::initProbMax()
 {
     // Should be OK for all m_phi values
     setProbMax( 1.1 );
 }
 
 void EvtPsi2JpsiPiPi::init()
 {
     checkNArg( 0, 1 );
 
     if ( getNArg() == 0 ) {
         m_tree = true;
         m_phi = 0.0;
 
     } else {
         m_tree = false;
         m_phi = getArg( 0 );    // LO vs NLO mixing angle in radians
     }
 
     double twoPhi = 2.0 * m_phi;
     m_cosPhi = cos( m_phi );
     m_cos2Phi = cos( twoPhi );
     m_sinPhi = sin( m_phi );
     m_sin2Phi = sin( twoPhi );
 }
 
 void EvtPsi2JpsiPiPi::decay( EvtParticle* root )
 {
     root->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtVector4R p4 =
         root->getDaug( 0 )->getP4();    // J-psi momentum in psi2 rest frame
     EvtVector4R k1 = root->getDaug( 1 )->getP4();    // pi+ momentum in psi2 rest frame
     double mPiSq = k1.mass2();                       // squared pion mass
     EvtVector4R k2 = root->getDaug( 2 )->getP4();    // pi- momentum in psi2 rest frame
     EvtVector4R tq = k1 - k2;
     EvtVector4R p3 = k1 + k2;
     double p3Sq = p3.mass2();
     double mpipi = p3.mass();
     double corr( 1.0 );
 
     if ( !m_tree ) {
         // Calculate NLO corrections
         corr = 0.0;
         for ( int iq = 0; iq < m_nQ; ++iq ) {
             corr += ( m_c0[iq] + m_c1[iq] * m_cosPhi + m_c2[iq] * m_cos2Phi +
                       m_s1[iq] * m_sinPhi + m_s2[iq] * m_sin2Phi ) *
                     std::pow( mpipi, iq );
         }
     }
 
     double mSqTerm = 2.0 * mPiSq / p3Sq;
     EvtTensor4C p3Prod = EvtGenFunctions::directProd( p3, p3 );
 
     // Eq 14 from the article
     EvtTensor4C L = EvtGenFunctions::directProd( tq, tq ) +
                     ( ( 1.0 - 2.0 * mSqTerm ) / 3.0 ) *
                         ( p3Sq * EvtTensor4C::g() - p3Prod );
 
     EvtTensor4C T = ( 2.0 / 3.0 ) * ( 1.0 + mSqTerm ) * p3Prod - L;
 
     for ( int iPsi2 = 0; iPsi2 < 5; ++iPsi2 ) {
         EvtTensor4C epsX = root->epsTensor(
             iPsi2 );    // psi2 polarization tensor in psi2 rest frame
         EvtTensor4C epsXT = cont22( epsX, T );
 
         for ( int iPsi = 0; iPsi < 3; ++iPsi ) {
             EvtVector4C epsPsi = root->getDaug( 0 )->epsParent(
                 iPsi );    // Jpsi polarization vector in psi2 rest frame
             EvtTensor4C epeps = dual( EvtGenFunctions::directProd( epsPsi, p4 ) );
             EvtTensor4C ttt = cont22( epeps, epsXT );
 
             // Eq 13 from the article
             EvtComplex amp = ttt.trace();
 
             // NLO corrections
             amp *= corr;
 
             // Set vertex amplitude component
             vertex( iPsi2, iPsi, amp );
         }
     }
 }
diff --git a/src/EvtGenModels/EvtRareLbToLll.cpp b/src/EvtGenModels/EvtRareLbToLll.cpp
index 828d57e..2e64b62 100644
--- a/src/EvtGenModels/EvtRareLbToLll.cpp
+++ b/src/EvtGenModels/EvtRareLbToLll.cpp
@@ -1,506 +1,506 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtRareLbToLll.hh"
 
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDiracParticle.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtRaritaSchwinger.hh"
 #include "EvtGenBase/EvtSpinDensity.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtRareLbToLllFF.hh"
 #include "EvtGenModels/EvtRareLbToLllFFGutsche.hh"
 #include "EvtGenModels/EvtRareLbToLllFFlQCD.hh"
 
 #include <stdlib.h>
 
 // The module name specification
-std::string EvtRareLbToLll::getName()
+std::string EvtRareLbToLll::getName() const
 {
     return "RareLbToLll";
 }
 
-// The implementation of the clone() method
-EvtDecayBase* EvtRareLbToLll::clone()
+// The implementation of the clone() const method
+EvtDecayBase* EvtRareLbToLll::clone() const
 {
     return new EvtRareLbToLll;
 }
 
 void EvtRareLbToLll::init()
 {
     checkNArg( 0, 1 );
 
     // check that there are 3 daughters
     checkNDaug( 3 );
 
     // Parent should be spin 1/2 Lambda_b0
     const EvtSpinType::spintype spin = EvtPDL::getSpinType( getDaug( 0 ) );
 
     if ( !( spin == EvtSpinType::DIRAC || spin == EvtSpinType::RARITASCHWINGER ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " EvtRareLbToLll expects DIRAC or RARITASWINGER daughter "
             << std::endl;
     }
 
     // We expect that the second and third daughters
     // are the ell+ and ell-
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
 
     // Work out whether we have electron mode
     const EvtIdSet leptons{ "e-", "e+" };
     if ( leptons.contains( getDaug( 1 ) ) ) {
         m_electronMode = true;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " EvtRareLbToLll has dielectron final state" << std::endl;
     }
 
     std::string model{ "LQCD" };
     if ( getNArg() == 1 ) {
         model = getArgStr( 0 );
     }
     if ( model == "Gutsche" ) {
         m_ffmodel = std::make_unique<EvtRareLbToLllFFGutsche>();
     } else if ( model == "LQCD" ) {
         m_ffmodel = std::make_unique<EvtRareLbToLllFFlQCD>();
     } else if ( model == "MR" ) {
         m_ffmodel = std::make_unique<EvtRareLbToLllFF>();
     } else {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "  Unknown form-factor model, valid options are MR, LQCD, Gutsche."
             << "  Assuming LQCD form-factors... " << std::endl;
         m_ffmodel = std::make_unique<EvtRareLbToLllFFlQCD>();
     }
     m_wcmodel = std::make_unique<EvtRareLbToLllWC>();
 
     m_ffmodel->init();
 
     return;
 }
 
 void EvtRareLbToLll::initProbMax()
 {
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " EvtRareLbToLll is finding maximum probability ... " << std::endl;
 
     m_maxProbability = 0;
 
     if ( m_maxProbability == 0 ) {
         EvtDiracParticle parent{};
         parent.noLifeTime();
         parent.init( getParentId(),
                      EvtVector4R( EvtPDL::getMass( getParentId() ), 0, 0, 0 ) );
         parent.setDiagonalSpinDensity();
 
         EvtAmp amp;
         EvtId daughters[3] = { getDaug( 0 ), getDaug( 1 ), getDaug( 2 ) };
         amp.init( getParentId(), 3, daughters );
         parent.makeDaughters( 3, daughters );
         EvtParticle* lambda = parent.getDaug( 0 );
         EvtParticle* lep1 = parent.getDaug( 1 );
         EvtParticle* lep2 = parent.getDaug( 2 );
         lambda->noLifeTime();
         lep1->noLifeTime();
         lep2->noLifeTime();
 
         EvtSpinDensity rho;
         rho.setDiag( parent.getSpinStates() );
 
         const double M0 = EvtPDL::getMass( getParentId() );
         const double mL = EvtPDL::getMass( getDaug( 0 ) );
         const double m1 = EvtPDL::getMass( getDaug( 1 ) );
         const double m2 = EvtPDL::getMass( getDaug( 2 ) );
 
         const double q2min = ( m1 + m2 ) * ( m1 + m2 );
         const double q2max = ( M0 - mL ) * ( M0 - mL );
 
         EvtVector4R p4lambda, p4lep1, p4lep2, boost;
 
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << " EvtRareLbToLll is probing whole phase space ..." << std::endl;
 
         double prob = 0;
         const int nsteps = 5000;
         for ( int i = 0; i <= nsteps; i++ ) {
             const double q2 = q2min + i * ( q2max - q2min ) / nsteps;
             const double elambda = ( M0 * M0 + mL * mL - q2 ) / 2 / M0;
             double pstar{ 0 };
             if ( i != 0 ) {
                 pstar = sqrt( q2 - ( m1 + m2 ) * ( m1 + m2 ) ) *
                         sqrt( q2 - ( m1 - m2 ) * ( m1 - m2 ) ) / 2 / sqrt( q2 );
             }
             boost.set( M0 - elambda, 0, 0, +sqrt( elambda * elambda - mL * mL ) );
             if ( i != nsteps ) {
                 p4lambda.set( elambda, 0, 0,
                               -sqrt( elambda * elambda - mL * mL ) );
             } else {
                 p4lambda.set( mL, 0, 0, 0 );
             }
             for ( int j = 0; j <= 45; j++ ) {
                 const double theta = j * EvtConst::pi / 45;
                 p4lep1.set( sqrt( pstar * pstar + m1 * m1 ), 0,
                             +pstar * sin( theta ), +pstar * cos( theta ) );
                 p4lep2.set( sqrt( pstar * pstar + m2 * m2 ), 0,
                             -pstar * sin( theta ), -pstar * cos( theta ) );
 
                 if ( i != nsteps )    // At maximal q2 we are already in correct frame as Lambda and W/Zvirtual are at rest
                 {
                     p4lep1 = boostTo( p4lep1, boost );
                     p4lep2 = boostTo( p4lep2, boost );
                 }
                 lambda->init( getDaug( 0 ), p4lambda );
                 lep1->init( getDaug( 1 ), p4lep1 );
                 lep2->init( getDaug( 2 ), p4lep2 );
                 calcAmp( amp, parent );
                 prob = rho.normalizedProb( amp.getSpinDensity() );
                 // In case of electron mode add pole
                 if ( m_electronMode ) {
                     prob /= 1.0 + m_poleSize / ( q2 * q2 );
                 }
 
                 if ( prob > m_maxProbability ) {
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << "  - probability " << prob << " found at q2 = " << q2
                         << " (" << nsteps * ( q2 - q2min ) / ( q2max - q2min )
                         << " %) and theta = " << theta * 180 / EvtConst::pi
                         << std::endl;
                     m_maxProbability = prob;
                 }
             }
         }
 
         m_maxProbability *= 1.05;
     }
 
     setProbMax( m_maxProbability );
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " EvtRareLbToLll set up maximum probability to " << m_maxProbability
         << std::endl;
 }
 
 void EvtRareLbToLll::decay( EvtParticle* parent )
 {
     // Phase space initialization depends on what leptons are
     if ( m_electronMode ) {
         setWeight( parent->initializePhaseSpace( getNDaug(), getDaugs(), false,
                                                  m_poleSize, 1, 2 ) );
     } else {
         parent->initializePhaseSpace( getNDaug(), getDaugs() );
     }
     calcAmp( m_amp2, *parent );
 }
 
 bool EvtRareLbToLll::isParticle( const EvtParticle& parent ) const
 {
     const EvtIdSet partlist{ "Lambda_b0" };
 
     return partlist.contains( parent.getId() );
 }
 
 void EvtRareLbToLll::calcAmp( EvtAmp& amp, const EvtParticle& parent )
 {
     //parent->setDiagonalSpinDensity();
 
     const EvtParticle* lambda = parent.getDaug( 0 );
 
     const EvtIdSet leptons{ "e-", "mu-", "tau-" };
 
     const bool isparticle = isParticle( parent );
 
     const EvtParticle* lp = nullptr;
     const EvtParticle* lm = nullptr;
 
     if ( leptons.contains( parent.getDaug( 1 )->getId() ) ) {
         lp = parent.getDaug( 1 );
         lm = parent.getDaug( 2 );
     } else {
         lp = parent.getDaug( 2 );
         lm = parent.getDaug( 1 );
     }
 
     EvtVector4R P;
     P.set( parent.mass(), 0.0, 0.0, 0.0 );
 
     EvtVector4R q = lp->getP4() + lm->getP4();
     const double qsq = q.mass2();
 
     // Leptonic currents
     EvtVector4C LV[2][2];    // \bar{\ell} \gamma^{\mu} \ell
     EvtVector4C LA[2][2];    // \bar{\ell} \gamma^{\mu} \gamma^{5} \ell
 
     for ( int i = 0; i < 2; ++i ) {
         for ( int j = 0; j < 2; ++j ) {
             if ( isparticle ) {
                 LV[i][j] = EvtLeptonVCurrent( lp->spParent( i ),
                                               lm->spParent( j ) );
                 LA[i][j] = EvtLeptonACurrent( lp->spParent( i ),
                                               lm->spParent( j ) );
             } else {
                 LV[i][j] = EvtLeptonVCurrent( lp->spParent( 1 - i ),
                                               lm->spParent( 1 - j ) );
                 LA[i][j] = EvtLeptonACurrent( lp->spParent( 1 - i ),
                                               lm->spParent( 1 - j ) );
             }
         }
     }
 
     EvtRareLbToLllFF::FormFactors FF;
     //F, G, FT and GT
     m_ffmodel->getFF( parent, *lambda, FF );
 
     EvtComplex C7eff = m_wcmodel->GetC7Eff( qsq );
     EvtComplex C9eff = m_wcmodel->GetC9Eff( qsq );
     EvtComplex C10eff = m_wcmodel->GetC10Eff( qsq );
 
     EvtComplex AC[4];
     EvtComplex BC[4];
     EvtComplex DC[4];
     EvtComplex EC[4];
 
     // check to see if particle is same or opposite parity to Lb
     const int parity = m_ffmodel->isNatural( *lambda ) ? 1 : -1;
 
     // Lambda spin type
     const EvtSpinType::spintype spin = EvtPDL::getSpinType( lambda->getId() );
 
     const double mb = 5.209;
 
     // Eq. 48 + 49
     for ( unsigned int i = 0; i < 4; ++i ) {
         if ( parity > 0 ) {
             AC[i] = -2. * mb * C7eff * FF.m_FT[i] / qsq + C9eff * FF.m_F[i];
             BC[i] = -2. * mb * C7eff * FF.m_GT[i] / qsq - C9eff * FF.m_G[i];
             DC[i] = C10eff * FF.m_F[i];
             EC[i] = -C10eff * FF.m_G[i];
         } else {
             AC[i] = -2. * mb * C7eff * FF.m_GT[i] / qsq - C9eff * FF.m_G[i];
             BC[i] = -2. * mb * C7eff * FF.m_FT[i] / qsq + C9eff * FF.m_F[i];
             DC[i] = -C10eff * FF.m_G[i];
             EC[i] = C10eff * FF.m_F[i];
         }
     }
 
     // handle particle -> antiparticle in Hadronic currents
     const double cv = ( isparticle > 0 ) ? 1.0 : -1.0 * parity;
     const double ca = ( isparticle > 0 ) ? 1.0 : +1.0 * parity;
     const double cs = ( isparticle > 0 ) ? 1.0 : +1.0 * parity;
     const double cp = ( isparticle > 0 ) ? 1.0 : -1.0 * parity;
 
     if ( EvtSpinType::DIRAC == spin ) {
         EvtVector4C H1[2][2];    // vector current
         EvtVector4C H2[2][2];    // axial-vector
 
         EvtVector4C T[6];
         // Hadronic currents
         for ( int i = 0; i < 2; ++i ) {
             for ( int j = 0; j < 2; ++j ) {
                 HadronicAmp( parent, *lambda, T, i, j );
 
                 H1[i][j] = ( cv * AC[0] * T[0] + ca * BC[0] * T[1] +
                              cs * AC[1] * T[2] + cp * BC[1] * T[3] +
                              cs * AC[2] * T[4] + cp * BC[2] * T[5] );
 
                 H2[i][j] = ( cv * DC[0] * T[0] + ca * EC[0] * T[1] +
                              cs * DC[1] * T[2] + cp * EC[1] * T[3] +
                              cs * DC[2] * T[4] + cp * EC[2] * T[5] );
             }
         }
 
         // Spin sums
         int spins[4];
 
         for ( int i = 0; i < 2; ++i ) {
             for ( int ip = 0; ip < 2; ++ip ) {
                 for ( int j = 0; j < 2; ++j ) {
                     for ( int jp = 0; jp < 2; ++jp ) {
                         spins[0] = i;
                         spins[1] = ip;
                         spins[2] = j;
                         spins[3] = jp;
 
                         EvtComplex M = H1[i][ip] * LV[j][jp] +
                                        H2[i][ip] * LA[j][jp];
 
                         amp.vertex( spins, M );
                     }
                 }
             }
         }
     } else if ( EvtSpinType::RARITASCHWINGER == spin ) {
         EvtVector4C T[8];
 
         EvtVector4C H1[2][4];    // vector current // swaped
         EvtVector4C H2[2][4];    // axial-vector
 
         // Build hadronic amplitude
         for ( int i = 0; i < 2; ++i ) {
             for ( int j = 0; j < 4; ++j ) {
                 HadronicAmpRS( parent, *lambda, T, i, j );
                 H1[i][j] = ( cv * AC[0] * T[0] + ca * BC[0] * T[1] +
                              cs * AC[1] * T[2] + cp * BC[1] * T[3] +
                              cs * AC[2] * T[4] + cp * BC[2] * T[5] +
                              cs * AC[3] * T[6] + cp * BC[3] * T[7] );
                 H2[i][j] = ( cv * DC[0] * T[0] + ca * EC[0] * T[1] +
                              cs * DC[1] * T[2] + cp * EC[1] * T[3] +
                              cs * DC[2] * T[4] + cp * EC[2] * T[5] +
                              cs * DC[3] * T[6] + cp * EC[3] * T[7] );
             }
         }
 
         // Spin sums
         int spins[4];
 
         for ( int i = 0; i < 2; ++i ) {
             for ( int ip = 0; ip < 4; ++ip ) {
                 for ( int j = 0; j < 2; ++j ) {
                     for ( int jp = 0; jp < 2; ++jp ) {
                         spins[0] = i;
                         spins[1] = ip;
                         spins[2] = j;
                         spins[3] = jp;
 
                         EvtComplex M = H1[i][ip] * LV[j][jp] +
                                        H2[i][ip] * LA[j][jp];
 
                         amp.vertex( spins, M );
                     }
                 }
             }
         }
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " EvtRareLbToLll expects DIRAC or RARITASWINGER daughter "
             << std::endl;
     }
 
     return;
 }
 
 // spin 1/2 daughters
 
 void EvtRareLbToLll::HadronicAmp( const EvtParticle& parent,
                                   const EvtParticle& lambda, EvtVector4C* T,
                                   const int i, const int j )
 {
     const EvtDiracSpinor Sfinal = lambda.spParent( j );
     const EvtDiracSpinor Sinit = parent.sp( i );
 
     const EvtVector4R L = lambda.getP4();
 
     EvtVector4R P;
     P.set( parent.mass(), 0.0, 0.0, 0.0 );
 
     const double Pm = parent.mass();
     const double Lm = lambda.mass();
 
     // \bar{u} \gamma^{\mu} u
     T[0] = EvtLeptonVCurrent( Sfinal, Sinit );
 
     // \bar{u} \gamma^{\mu}\gamma^{5} u
     T[1] = EvtLeptonACurrent( Sfinal, Sinit );
 
     // \bar{u} v^{\mu} u
     T[2] = EvtLeptonSCurrent( Sfinal, Sinit ) * ( P / Pm );
 
     // \bar{u} v^{\mu} \gamma^{5} u
     T[3] = EvtLeptonPCurrent( Sfinal, Sinit ) * ( P / Pm );
 
     // \bar{u} v^{\prime\mu} u
     T[4] = EvtLeptonSCurrent( Sfinal, Sinit ) * ( L / Lm );
 
     // \bar{u} v^{\prime\mu} \gamma^{5}
     T[5] = EvtLeptonPCurrent( Sfinal, Sinit ) * ( L / Lm );
 
     // Where:
     // v = p_{\Lambda_b}/m_{\Lambda_b}
     // v^{\prime} =  p_{\Lambda}/m_{\Lambda}
 
     return;
 }
 
 // spin 3/2 daughters
 
 void EvtRareLbToLll::HadronicAmpRS( const EvtParticle& parent,
                                     const EvtParticle& lambda, EvtVector4C* T,
                                     const int i, const int j )
 {
     const EvtRaritaSchwinger Sfinal = lambda.spRSParent( j );
     const EvtDiracSpinor Sinit = parent.sp( i );
 
     EvtVector4R P;
     P.set( parent.mass(), 0.0, 0.0, 0.0 );
 
     const EvtVector4R L = lambda.getP4();
 
     EvtTensor4C ID;
     ID.setdiag( 1.0, 1.0, 1.0, 1.0 );
 
     EvtDiracSpinor Sprime;
 
     for ( int ii = 0; ii < 4; ii++ ) {
         Sprime.set_spinor( ii, Sfinal.getVector( ii ) * P );
     }
 
     const double Pmsq = P.mass2();
     const double Pm = parent.mass();
     const double PmLm = Pm * lambda.mass();
 
     EvtVector4C V1, V2;
 
     for ( int ii = 0; ii < 4; ii++ ) {
         V1.set( ii, EvtLeptonSCurrent( Sfinal.getSpinor( ii ), Sinit ) );
         V2.set( ii, EvtLeptonPCurrent( Sfinal.getSpinor( ii ), Sinit ) );
     }
 
     // \bar{u}_{alpha} v^{\alpha} \gamma^{\mu} u
     T[0] = EvtLeptonVCurrent( Sprime, Sinit ) * ( 1 / Pm );
 
     // \bar{u}_{alpha}  v^{\alpha} \gamma^{\mu} \gamma^{5} u
     T[1] = EvtLeptonACurrent( Sprime, Sinit ) * ( 1 / Pm );
 
     // \bar{u}_{\alpha} v^{\alpha} v^{\mu} u
     T[2] = EvtLeptonSCurrent( Sprime, Sinit ) * ( P / Pmsq );
 
     // \bar{u}_{\alpha} v^{\alpha} v^{\mu} \gamma^{5} u
     T[3] = EvtLeptonPCurrent( Sprime, Sinit ) * ( P / Pmsq );
 
     // \bar{u}_{\alpha} v^{\alpha} v^{\prime \mu} u
     T[4] = EvtLeptonSCurrent( Sprime, Sinit ) * ( L / PmLm );
 
     // \bar{u}_{\alpha} v^{\alpha} v^{\prime \mu} \gamma^{5} u
     T[5] = EvtLeptonPCurrent( Sprime, Sinit ) * ( L / PmLm );
 
     // \bar{u}_{\alpha} g^{\alpha\mu} u
     T[6] = ID.cont2( V1 );
 
     // \bar{u}_{\alpha} g^{\alpha\mu} \gamma^{5} u
     T[7] = ID.cont2( V2 );
 
     // Where:
     //  v = p_{\Lambda_b}/m_{\Lambda_b}
     //  v^{\prime} =  p_{\Lambda}/m_{\Lambda}
 
     return;
 }
diff --git a/src/EvtGenModels/EvtRareLbToLllWC.cpp b/src/EvtGenModels/EvtRareLbToLllWC.cpp
index dcb3a67..62fb944 100644
--- a/src/EvtGenModels/EvtRareLbToLllWC.cpp
+++ b/src/EvtGenModels/EvtRareLbToLllWC.cpp
@@ -1,299 +1,299 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtRareLbToLllWC.hh"
 
 //-----------------------------------------------------------------------------
 // Implementation file for class : EvtRareLbToLllWC
 //
 // 2013-11-27 : Thomas Blake
 //-----------------------------------------------------------------------------
 
 EvtComplex EvtRareLbToLllWC::GetC7Eff( const double q2 ) const
 {
-    static double mbeff = 4.8;
+    static const double mbeff = 4.8;
     double shat = q2 / mbeff / mbeff;
     double logshat;
     logshat = log( shat );
 
     double muscale;
     muscale = 2.5;
     double alphas;
     alphas = 0.267;
     double A7;
     A7 = -0.353 + 0.023;
     double A8;
     A8 = -0.164;
     double C1;
     C1 = -0.697;
     double C2;
     C2 = 1.046;
 
     double Lmu;
     Lmu = log( muscale / mbeff );
 
     EvtComplex uniti( 0.0, 1.0 );
 
     EvtComplex c7eff;
     if ( shat > 0.25 ) {
         c7eff = A7;
         return c7eff;
     }
 
     // change energy scale to 5.0 for full NNLO calculation below shat = 0.25
     muscale = 5.0;
     alphas = 0.215;
     A7 = -0.312 + 0.008;
     A8 = -0.148;
     C1 = -0.487;
     C2 = 1.024;
     Lmu = log( muscale / mbeff );
 
     EvtComplex F71;
     EvtComplex f71;
     EvtComplex k7100( -0.68192, -0.074998 );
     EvtComplex k7101( 0.0, 0.0 );
     EvtComplex k7110( -0.23935, -0.12289 );
     EvtComplex k7111( 0.0027424, 0.019676 );
     EvtComplex k7120( -0.0018555, -0.175 );
     EvtComplex k7121( 0.022864, 0.011456 );
     EvtComplex k7130( 0.28248, -0.12783 );
     EvtComplex k7131( 0.029027, -0.0082265 );
     f71 = k7100 + k7101 * logshat + shat * ( k7110 + k7111 * logshat ) +
           shat * shat * ( k7120 + k7121 * logshat ) +
           shat * shat * shat * ( k7130 + k7131 * logshat );
     F71 = ( -208.0 / 243.0 ) * Lmu + f71;
 
     EvtComplex F72;
     EvtComplex f72;
     EvtComplex k7200( 4.0915, 0.44999 );
     EvtComplex k7201( 0.0, 0.0 );
     EvtComplex k7210( 1.4361, 0.73732 );
     EvtComplex k7211( -0.016454, -0.11806 );
     EvtComplex k7220( 0.011133, 1.05 );
     EvtComplex k7221( -0.13718, -0.068733 );
     EvtComplex k7230( -1.6949, 0.76698 );
     EvtComplex k7231( -0.17416, 0.049359 );
     f72 = k7200 + k7201 * logshat + shat * ( k7210 + k7211 * logshat ) +
           shat * shat * ( k7220 + k7221 * logshat ) +
           shat * shat * shat * ( k7230 + k7231 * logshat );
     F72 = ( 416.0 / 81.0 ) * Lmu + f72;
 
     EvtComplex F78;
     F78 = ( -32.0 / 9.0 ) * Lmu + 8.0 * EvtConst::pi * EvtConst::pi / 27.0 +
           ( -44.0 / 9.0 ) + ( -8.0 * EvtConst::pi / 9.0 ) * uniti +
           ( 4.0 / 3.0 * EvtConst::pi * EvtConst::pi - 40.0 / 3.0 ) * shat +
           ( 32.0 * EvtConst::pi * EvtConst::pi / 9.0 - 316.0 / 9.0 ) * shat *
               shat +
           ( 200.0 * EvtConst::pi * EvtConst::pi / 27.0 - 658.0 / 9.0 ) * shat *
               shat * shat +
           ( -8.0 * logshat / 9.0 ) * ( shat + shat * shat + shat * shat * shat );
 
     c7eff = A7 - alphas / ( 4.0 * EvtConst::pi ) *
                      ( C1 * F71 + C2 * F72 + A8 * F78 );
 
     return c7eff;
 }
 
 EvtComplex EvtRareLbToLllWC::GetC9Eff( const double q2, const bool btod ) const
 {
-    static double mbeff = 4.8;
+    static const double mbeff = 4.8;
     double shat = q2 / mbeff / mbeff;
     double logshat;
     logshat = log( shat );
     double mchat = 0.29;
 
     double muscale;
     muscale = 2.5;
     double alphas;
     alphas = 0.267;
     double A8;
     A8 = -0.164;
     double A9;
     A9 = 4.287 + ( -0.218 );
     double C1;
     C1 = -0.697;
     double C2;
     C2 = 1.046;
     double T9;
     T9 = 0.114 + 0.280;
     double U9;
     U9 = 0.045 + 0.023;
     double W9;
     W9 = 0.044 + 0.016;
 
     double Lmu;
     Lmu = log( muscale / mbeff );
 
     EvtComplex uniti( 0.0, 1.0 );
 
     EvtComplex hc;
     double xarg;
     xarg = 4.0 * mchat / shat;
     hc = -4.0 / 9.0 * log( mchat * mchat ) + 8.0 / 27.0 + 4.0 * xarg / 9.0;
 
     if ( xarg < 1.0 ) {
         hc = hc - 2.0 / 9.0 * ( 2.0 + xarg ) * sqrt( fabs( 1.0 - xarg ) ) *
                       ( log( fabs( ( sqrt( 1.0 - xarg ) + 1.0 ) /
                                    ( sqrt( 1.0 - xarg ) - 1.0 ) ) ) -
                         uniti * EvtConst::pi );
     } else {
         hc = hc - 2.0 / 9.0 * ( 2.0 + xarg ) * sqrt( fabs( 1.0 - xarg ) ) *
                       2.0 * atan( 1.0 / sqrt( xarg - 1.0 ) );
     }
 
     EvtComplex h1;
     xarg = 4.0 / shat;
     h1 = 8.0 / 27.0 + 4.0 * xarg / 9.0;
     if ( xarg < 1.0 ) {
         h1 = h1 - 2.0 / 9.0 * ( 2.0 + xarg ) * sqrt( fabs( 1.0 - xarg ) ) *
                       ( log( fabs( ( sqrt( 1.0 - xarg ) + 1.0 ) /
                                    ( sqrt( 1.0 - xarg ) - 1.0 ) ) ) -
                         uniti * EvtConst::pi );
     } else {
         h1 = h1 - 2.0 / 9.0 * ( 2.0 + xarg ) * sqrt( fabs( 1.0 - xarg ) ) *
                       2.0 * atan( 1.0 / sqrt( xarg - 1.0 ) );
     }
 
     EvtComplex h0;
     h0 = 8.0 / 27.0 - 4.0 * log( 2.0 ) / 9.0 + 4.0 * uniti * EvtConst::pi / 9.0;
 
     // X=V_{ud}^* V_ub / V_{td}^* V_tb * (4/3 C_1 +C_2) * (h(\hat m_c^2, hat s)-
     // h(\hat m_u^2, hat s))
     EvtComplex Vudstar( 1.0 - 0.2279 * 0.2279 / 2.0, 0.0 );
     EvtComplex Vub( ( 0.118 + 0.273 ) / 2.0, -1.0 * ( 0.305 + 0.393 ) / 2.0 );
     EvtComplex Vtdstar( 1.0 - ( 0.118 + 0.273 ) / 2.0, ( 0.305 + 0.393 ) / 2.0 );
     EvtComplex Vtb( 1.0, 0.0 );
 
     EvtComplex Xd;
     Xd = ( Vudstar * Vub / Vtdstar * Vtb ) * ( 4.0 / 3.0 * C1 + C2 ) *
          ( hc - h0 );
 
     EvtComplex c9eff = 4.344;
     if ( shat > 0.25 ) {
         c9eff = A9 + T9 * hc + U9 * h1 + W9 * h0;
         if ( btod ) {
             c9eff += Xd;
         }
 
         return c9eff;
     }
 
     // change energy scale to 5.0 for full NNLO calculation below shat = 0.25
     muscale = 5.0;
     alphas = 0.215;
     A9 = 4.174 + ( -0.035 );
     C1 = -0.487;
     C2 = 1.024;
     A8 = -0.148;
     T9 = 0.374 + 0.252;
     U9 = 0.033 + 0.015;
     W9 = 0.032 + 0.012;
     Lmu = log( muscale / mbeff );
 
     EvtComplex F91;
     EvtComplex f91;
     EvtComplex k9100( -11.973, 0.16371 );
     EvtComplex k9101( -0.081271, -0.059691 );
     EvtComplex k9110( -28.432, -0.25044 );
     EvtComplex k9111( -0.040243, 0.016442 );
     EvtComplex k9120( -57.114, -0.86486 );
     EvtComplex k9121( -0.035191, 0.027909 );
     EvtComplex k9130( -128.8, -2.5243 );
     EvtComplex k9131( -0.017587, 0.050639 );
     f91 = k9100 + k9101 * logshat + shat * ( k9110 + k9111 * logshat ) +
           shat * shat * ( k9120 + k9121 * logshat ) +
           shat * shat * shat * ( k9130 + k9131 * logshat );
     F91 = ( -1424.0 / 729.0 + 16.0 * uniti * EvtConst::pi / 243.0 +
             64.0 / 27.0 * log( mchat ) ) *
               Lmu -
           16.0 * Lmu * logshat / 243.0 +
           ( 16.0 / 1215.0 - 32.0 / 135.0 / mchat / mchat ) * Lmu * shat +
           ( 4.0 / 2835.0 - 8.0 / 315.0 / mchat / mchat / mchat / mchat ) * Lmu *
               shat * shat +
           ( 16.0 / 76545.0 -
             32.0 / 8505.0 / mchat / mchat / mchat / mchat / mchat / mchat ) *
               Lmu * shat * shat * shat -
           256.0 * Lmu * Lmu / 243.0 + f91;
 
     EvtComplex F92;
     EvtComplex f92;
     EvtComplex k9200( 6.6338, -0.98225 );
     EvtComplex k9201( 0.48763, 0.35815 );
     EvtComplex k9210( 3.3585, 1.5026 );
     EvtComplex k9211( 0.24146, -0.098649 );
     EvtComplex k9220( -1.1906, 5.1892 );
     EvtComplex k9221( 0.21115, -0.16745 );
     EvtComplex k9230( -17.12, 15.146 );
     EvtComplex k9231( 0.10552, -0.30383 );
     f92 = k9200 + k9201 * logshat + shat * ( k9210 + k9211 * logshat ) +
           shat * shat * ( k9220 + k9221 * logshat ) +
           shat * shat * shat * ( k9230 + k9231 * logshat );
     F92 = ( 256.0 / 243.0 - 32.0 * uniti * EvtConst::pi / 81.0 -
             128.0 / 9.0 * log( mchat ) ) *
               Lmu +
           32.0 * Lmu * logshat / 81.0 +
           ( -32.0 / 405.0 + 64.0 / 45.0 / mchat / mchat ) * Lmu * shat +
           ( -8.0 / 945.0 + 16.0 / 105.0 / mchat / mchat / mchat / mchat ) *
               Lmu * shat * shat +
           ( -32.0 / 25515.0 +
             64.0 / 2835.0 / mchat / mchat / mchat / mchat / mchat / mchat ) *
               Lmu * shat * shat * shat +
           512.0 * Lmu * Lmu / 81.0 + f92;
 
     EvtComplex F98;
     F98 = 104.0 / 9.0 - 32.0 * EvtConst::pi * EvtConst::pi / 27.0 +
           ( 1184.0 / 27.0 - 40.0 * EvtConst::pi * EvtConst::pi / 9.0 ) * shat +
           ( 14212.0 / 135.0 - 32.0 * EvtConst::pi * EvtConst::pi / 3.0 ) *
               shat * shat +
           ( 193444.0 / 945.0 - 560.0 * EvtConst::pi * EvtConst::pi / 27.0 ) *
               shat * shat * shat +
           16.0 * logshat / 9.0 *
               ( 1.0 + shat + shat * shat + shat * shat * shat );
 
     Xd = ( Vudstar * Vub / Vtdstar * Vtb ) * ( 4.0 / 3.0 * C1 + C2 ) *
          ( hc - h0 );
 
     c9eff = A9 + T9 * hc + U9 * h1 + W9 * h0 -
             alphas / ( 4.0 * EvtConst::pi ) * ( C1 * F91 + C2 * F92 + A8 * F98 );
     if ( btod ) {
         c9eff += Xd;
     }
 
     return c9eff;
 }
 
 /*
  Calculate C10 coefficient
 
  C10 is scale (and q^2) independent
 */
 EvtComplex EvtRareLbToLllWC::GetC10Eff( double /*q2*/ ) const
 {
     double A10;
     A10 = -4.592 + 0.379;
 
     EvtComplex c10eff;
     c10eff = A10;
 
     return c10eff;
 }
 
 //=============================================================================
diff --git a/src/EvtGenModels/EvtSLBKPole.cpp b/src/EvtGenModels/EvtSLBKPole.cpp
index 274aac4..14d4654 100644
--- a/src/EvtGenModels/EvtSLBKPole.cpp
+++ b/src/EvtGenModels/EvtSLBKPole.cpp
@@ -1,100 +1,100 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSLBKPole.hh"    //modified
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicTensorAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtSLBKPoleFF.hh"    //modified
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSLBKPole::getName()
+std::string EvtSLBKPole::getName() const
 {
     return "SLBKPOLE";    //modified
 }
 
-EvtDecayBase* EvtSLBKPole::clone()
+EvtDecayBase* EvtSLBKPole::clone() const
 {    //modified
 
     return new EvtSLBKPole;
 }
 
 void EvtSLBKPole::decay( EvtParticle* p )
 {    //modified
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     m_calcamp->CalcAmp( p, m_amp2, m_SLBKPoleffmodel.get() );    //modified
     return;
 }
 
 void EvtSLBKPole::initProbMax()
 {
     EvtId parnum, mesnum, lnum, nunum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
     nunum = getDaug( 2 );
 
     double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, lnum, nunum,
                                                m_SLBKPoleffmodel.get() );    //modified
 
     setProbMax( mymaxprob );
 }
 
 void EvtSLBKPole::init()
 {    //modified
 
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     m_SLBKPoleffmodel = std::make_unique<EvtSLBKPoleFF>( getNArg(),
                                                          getArgs() );    //modified
 
     switch ( mesontype ) {
         case EvtSpinType::SCALAR:
             m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
             break;
         case EvtSpinType::VECTOR:
             m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
             break;
         case EvtSpinType::TENSOR:
             m_calcamp = std::make_unique<EvtSemiLeptonicTensorAmp>();
             break;
         default:;
     }
 }
diff --git a/src/EvtGenModels/EvtSLBKPoleFF.cpp b/src/EvtGenModels/EvtSLBKPoleFF.cpp
index af333ae..aeeaa1f 100644
--- a/src/EvtGenModels/EvtSLBKPoleFF.cpp
+++ b/src/EvtGenModels/EvtSLBKPoleFF.cpp
@@ -1,260 +1,260 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSLBKPoleFF.hh"    //modified
 
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <math.h>
 #include <stdlib.h>
 #include <string>
 
 EvtSLBKPoleFF::EvtSLBKPoleFF( int numarg, double* arglist )
 {                                  //modified
     m_numSLBKPoleargs = numarg;    //modified
     for ( int i = 0; i < numarg; i++ ) {
         m_SLBKPoleargs[i] = arglist[i];
     }    //modified
 
     return;
 }
 
 void EvtSLBKPoleFF::getscalarff( EvtId parent, EvtId daught, double t,
                                  double /*mass*/, double* fpf, double* f0f )
 {
     // Form factors have a general form, with parameters passed in
     // from the arguments.
 
     if ( m_numSLBKPoleargs != 4 ) {    //modified
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Problem in EvtSLBKPoleFF::getscalarff\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "wrong number of arguments!\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "number args:" << m_numSLBKPoleargs << " (expected 4)\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Parent:" << EvtPDL::name( parent ) << "\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Daughter:" << EvtPDL::name( daught ) << "\n";
     }
 
     double f0 = m_SLBKPoleargs[0];    //f0
     double af = m_SLBKPoleargs[1];    //alpha
 
     double mass_star2 = m_SLBKPoleargs[3] * m_SLBKPoleargs[3];
     double powf = 1.0;
     *fpf = f0 / ( pow( 1.0 - ( 1.0 + af ) * ( t / mass_star2 ) +
                            ( af * ( ( t / mass_star2 ) * ( t / mass_star2 ) ) ),
                        powf ) );    //modified
 
     f0 = m_SLBKPoleargs[0];    //f0
     af = m_SLBKPoleargs[2];    //beta
 
     powf = 1.0;
 
     *f0f = f0 / ( pow( 1.0 - ( t / mass_star2 / af ), powf ) );    //modified
 
     return;
 }
 
 void EvtSLBKPoleFF::getvectorff( EvtId parent, EvtId /*daught*/, double t,
                                  double /*mass*/, double* a1f, double* a2f,
                                  double* vf, double* a0f )
 {
     if ( m_numSLBKPoleargs != 8 ) {    //modified
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Problem in EvtSLBKPoleFF::getvectorff\n";    //modified
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "wrong number of arguements!!!\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << m_numSLBKPoleargs << "\n";    //modified
     }
 
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "Check the implementation of EvtSLBKPoleFF::getvectorff()!\n";
 
     double mb = EvtPDL::getMeanMass( parent );
     double mb2 = mb * mb;
 
     //modified-begin
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
-    static EvtId BP = EvtPDL::getId( "B+" );
-    static EvtId BM = EvtPDL::getId( "B-" );
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
-
-    static EvtId B0S = EvtPDL::getId( "B*0" );
-    static EvtId BPMS = EvtPDL::getId( "B*+" );
-    static EvtId BS0S = EvtPDL::getId( "B_s*0" );
-
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
-
-    static EvtId D0S = EvtPDL::getId( "D*0" );
-    static EvtId DPMS = EvtPDL::getId( "D*+" );
-    static EvtId DSPMS = EvtPDL::getId( "D_s*+" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId BP = EvtPDL::getId( "B+" );
+    static const EvtId BM = EvtPDL::getId( "B-" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+
+    static const EvtId B0S = EvtPDL::getId( "B*0" );
+    static const EvtId BPMS = EvtPDL::getId( "B*+" );
+    static const EvtId BS0S = EvtPDL::getId( "B_s*0" );
+
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
+
+    static const EvtId D0S = EvtPDL::getId( "D*0" );
+    static const EvtId DPMS = EvtPDL::getId( "D*+" );
+    static const EvtId DSPMS = EvtPDL::getId( "D_s*+" );
 
     double mass_star = 0.0;
     double mass_star2 = 0.0;
     if ( parent == B0 || parent == B0B ) {
         mass_star = EvtPDL::getMeanMass( B0S );
         mass_star2 = mass_star * mass_star;
     }
     if ( parent == BP || parent == BM ) {
         mass_star = EvtPDL::getMeanMass( BPMS );
         mass_star2 = mass_star * mass_star;
     }
     if ( parent == BS0 ) {
         mass_star = EvtPDL::getMeanMass( BS0S );
         mass_star2 = mass_star * mass_star;
     }
 
     if ( parent == D0 || parent == D0B ) {
         mass_star = EvtPDL::getMeanMass( D0S );
         mass_star2 = mass_star * mass_star;
     }
     if ( parent == DP || parent == DM ) {
         mass_star = EvtPDL::getMeanMass( DPMS );
         mass_star2 = mass_star * mass_star;
     }
     if ( parent == DSP || parent == DSM ) {
         mass_star = EvtPDL::getMeanMass( DSPMS );
         mass_star2 = mass_star * mass_star;
     }
     //modified-end
 
     double f0 = m_SLBKPoleargs[2];                             //A1
     double af = m_SLBKPoleargs[6];                             //b'
     double bf = 0;                                             //0
     double powf = 1.0;                                         //1.0
     *a1f = f0 / ( pow( 1.0 - af * t / mass_star2, powf ) );    //modified
 
     f0 = m_SLBKPoleargs[3];    //A2
     af = m_SLBKPoleargs[6];    //b'
     bf = m_SLBKPoleargs[7];    //b''==0
     powf = 1.0;                //1.0
 
     *a2f = f0 /
            ( pow( 1.0 - ( af + bf ) * ( t / mass_star2 ) +
                       ( af * bf ) * ( ( t / mass_star2 ) * ( t / mass_star2 ) ),
                   powf ) );    //modified
 
     f0 = m_SLBKPoleargs[0];    //V0
     af = m_SLBKPoleargs[4];    //a
     bf = 0;                    //0
     powf = 1.0;                //1.0
 
     *vf = f0 / ( pow( 1.0 - ( 1.0 + af ) * ( t / mass_star2 ) +
                           af * ( t / mass_star2 ) * ( t / mass_star2 ),
                       powf ) );    //modified
 
     f0 = m_SLBKPoleargs[1];    //A0
     af = m_SLBKPoleargs[5];    //a'
     bf = 0;                    //0
     powf = 1.0;                //1.0
 
     *a0f = f0 / ( pow( 1.0 - ( 1.0 + af ) * ( t / mb2 ) +
                            af * ( ( t / mb2 ) * ( t / mb2 ) ),
                        powf ) );    //modified
     return;
 }
 
 void EvtSLBKPoleFF::gettensorff( EvtId parent, EvtId /*daught*/, double t,
                                  double /*mass*/, double* hf, double* kf,
                                  double* bpf, double* bmf )
 {
     if ( m_numSLBKPoleargs != 16 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Problem in EvtSLBKPoleFF::gettensorff\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "wrong number of arguements!!!\n";
     }
 
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "Check the implementation of EvtSLBKPoleFF::gettensorff()!\n";
 
     double mb = EvtPDL::getMeanMass( parent );
     double mb2 = mb * mb;
 
     double f0 = m_SLBKPoleargs[0];
     double af = m_SLBKPoleargs[1];
     double bf = m_SLBKPoleargs[2];
     double powf = m_SLBKPoleargs[3];
     *hf = f0 /
           ( pow( 1.0 + ( af * t / mb2 ) + ( bf * ( ( t / mb2 ) * ( t / mb2 ) ) ),
                  powf ) );
 
     f0 = m_SLBKPoleargs[4];
     af = m_SLBKPoleargs[5];
     bf = m_SLBKPoleargs[6];
     powf = m_SLBKPoleargs[7];
 
     *kf = f0 /
           ( pow( 1.0 + ( af * t / mb2 ) + ( bf * ( ( t / mb2 ) * ( t / mb2 ) ) ),
                  powf ) );
 
     f0 = m_SLBKPoleargs[8];
     af = m_SLBKPoleargs[9];
     bf = m_SLBKPoleargs[10];
     powf = m_SLBKPoleargs[11];
 
     *bpf = f0 /
            ( pow( 1.0 + ( af * t / mb2 ) + ( bf * ( ( t / mb2 ) * ( t / mb2 ) ) ),
                   powf ) );
 
     f0 = m_SLBKPoleargs[12];
     af = m_SLBKPoleargs[13];
     bf = m_SLBKPoleargs[14];
     powf = m_SLBKPoleargs[15];
 
     *bmf = f0 /
            ( pow( 1.0 + ( af * t / mb2 ) + ( bf * ( ( t / mb2 ) * ( t / mb2 ) ) ),
                   powf ) );
     return;
 }
 
 void EvtSLBKPoleFF::getbaryonff( EvtId, EvtId, double, double, double*, double*,
                                  double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getbaryonff in EvtSLBKPoleFF.\n";
     ::abort();
 }
 
 void EvtSLBKPoleFF::getdiracff( EvtId, EvtId, double, double, double*, double*,
                                 double*, double*, double*, double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getdiracff in EvtSLBKPoleFF.\n";
     ::abort();
 }
 
 void EvtSLBKPoleFF::getraritaff( EvtId, EvtId, double, double, double*, double*,
                                  double*, double*, double*, double*, double*,
                                  double* )
 {
     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
         << "Not implemented :getraritaff in EvtSLBKPoleFF.\n";
     ::abort();
 }
diff --git a/src/EvtGenModels/EvtSLBaryonAmp.cpp b/src/EvtGenModels/EvtSLBaryonAmp.cpp
index ae80a8a..6c8a0f0 100644
--- a/src/EvtGenModels/EvtSLBaryonAmp.cpp
+++ b/src/EvtGenModels/EvtSLBaryonAmp.cpp
@@ -1,846 +1,846 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSLBaryonAmp.hh"
 
 #include "EvtGenBase/EvtAmp.hh"
 #include "EvtGenBase/EvtDiracParticle.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGammaMatrix.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRaritaSchwinger.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicFF.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 
 using std::endl;
 
 EvtSLBaryonAmp::~EvtSLBaryonAmp()
 {
 }
 
 void EvtSLBaryonAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
                               EvtSemiLeptonicFF* FormFactors )
 {
-    static EvtId EM = EvtPDL::getId( "e-" );
-    static EvtId MUM = EvtPDL::getId( "mu-" );
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
-    static EvtId EP = EvtPDL::getId( "e+" );
-    static EvtId MUP = EvtPDL::getId( "mu+" );
-    static EvtId TAUP = EvtPDL::getId( "tau+" );
+    static const EvtId EM = EvtPDL::getId( "e-" );
+    static const EvtId MUM = EvtPDL::getId( "mu-" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId EP = EvtPDL::getId( "e+" );
+    static const EvtId MUP = EvtPDL::getId( "mu+" );
+    static const EvtId TAUP = EvtPDL::getId( "tau+" );
 
     //Add the lepton and neutrino 4 momenta to find q2
 
     EvtVector4R q = parent->getDaug( 1 )->getP4() + parent->getDaug( 2 )->getP4();
     double q2 = ( q.mass2() );
 
     double f1v, f1a, f2v, f2a;
     double m_meson = parent->getDaug( 0 )->mass();
 
     FormFactors->getbaryonff( parent->getId(), parent->getDaug( 0 )->getId(),
                               q2, m_meson, &f1v, &f1a, &f2v, &f2a );
 
     EvtVector4R p4b;
     p4b.set( parent->mass(), 0.0, 0.0, 0.0 );
 
     EvtVector4C temp_00_term1;
     EvtVector4C temp_00_term2;
 
     EvtVector4C temp_01_term1;
     EvtVector4C temp_01_term2;
 
     EvtVector4C temp_10_term1;
     EvtVector4C temp_10_term2;
 
     EvtVector4C temp_11_term1;
     EvtVector4C temp_11_term2;
 
     EvtDiracSpinor p0 = parent->sp( 0 );
     EvtDiracSpinor p1 = parent->sp( 1 );
 
     EvtDiracSpinor d0 = parent->getDaug( 0 )->spParent( 0 );
     EvtDiracSpinor d1 = parent->getDaug( 0 )->spParent( 1 );
 
     temp_00_term1.set( 0, f1v * ( d0 * ( EvtGammaMatrix::g0() * p0 ) ) );
     temp_00_term2.set(
         0,
         f1a * ( d0 * ( ( EvtGammaMatrix::g0() * EvtGammaMatrix::g5() ) * p0 ) ) );
     temp_01_term1.set( 0, f1v * ( d0 * ( EvtGammaMatrix::g0() * p1 ) ) );
     temp_01_term2.set(
         0,
         f1a * ( d0 * ( ( EvtGammaMatrix::g0() * EvtGammaMatrix::g5() ) * p1 ) ) );
     temp_10_term1.set( 0, f1v * ( d1 * ( EvtGammaMatrix::g0() * p0 ) ) );
     temp_10_term2.set(
         0,
         f1a * ( d1 * ( ( EvtGammaMatrix::g0() * EvtGammaMatrix::g5() ) * p0 ) ) );
     temp_11_term1.set( 0, f1v * ( d1 * ( EvtGammaMatrix::g0() * p1 ) ) );
     temp_11_term2.set(
         0,
         f1a * ( d1 * ( ( EvtGammaMatrix::g0() * EvtGammaMatrix::g5() ) * p1 ) ) );
 
     temp_00_term1.set( 1, f1v * ( d0 * ( EvtGammaMatrix::g1() * p0 ) ) );
     temp_00_term2.set(
         1,
         f1a * ( d0 * ( ( EvtGammaMatrix::g1() * EvtGammaMatrix::g5() ) * p0 ) ) );
     temp_01_term1.set( 1, f1v * ( d0 * ( EvtGammaMatrix::g1() * p1 ) ) );
     temp_01_term2.set(
         1,
         f1a * ( d0 * ( ( EvtGammaMatrix::g1() * EvtGammaMatrix::g5() ) * p1 ) ) );
     temp_10_term1.set( 1, f1v * ( d1 * ( EvtGammaMatrix::g1() * p0 ) ) );
     temp_10_term2.set(
         1,
         f1a * ( d1 * ( ( EvtGammaMatrix::g1() * EvtGammaMatrix::g5() ) * p0 ) ) );
     temp_11_term1.set( 1, f1v * ( d1 * ( EvtGammaMatrix::g1() * p1 ) ) );
     temp_11_term2.set(
         1,
         f1a * ( d1 * ( ( EvtGammaMatrix::g1() * EvtGammaMatrix::g5() ) * p1 ) ) );
 
     temp_00_term1.set( 2, f1v * ( d0 * ( EvtGammaMatrix::g2() * p0 ) ) );
     temp_00_term2.set(
         2,
         f1a * ( d0 * ( ( EvtGammaMatrix::g2() * EvtGammaMatrix::g5() ) * p0 ) ) );
     temp_01_term1.set( 2, f1v * ( d0 * ( EvtGammaMatrix::g2() * p1 ) ) );
     temp_01_term2.set(
         2,
         f1a * ( d0 * ( ( EvtGammaMatrix::g2() * EvtGammaMatrix::g5() ) * p1 ) ) );
     temp_10_term1.set( 2, f1v * ( d1 * ( EvtGammaMatrix::g2() * p0 ) ) );
     temp_10_term2.set(
         2,
         f1a * ( d1 * ( ( EvtGammaMatrix::g2() * EvtGammaMatrix::g5() ) * p0 ) ) );
     temp_11_term1.set( 2, f1v * ( d1 * ( EvtGammaMatrix::g2() * p1 ) ) );
     temp_11_term2.set(
         2,
         f1a * ( d1 * ( ( EvtGammaMatrix::g2() * EvtGammaMatrix::g5() ) * p1 ) ) );
 
     temp_00_term1.set( 3, f1v * ( d0 * ( EvtGammaMatrix::g3() * p0 ) ) );
     temp_00_term2.set(
         3,
         f1a * ( d0 * ( ( EvtGammaMatrix::g3() * EvtGammaMatrix::g5() ) * p0 ) ) );
     temp_01_term1.set( 3, f1v * ( d0 * ( EvtGammaMatrix::g3() * p1 ) ) );
     temp_01_term2.set(
         3,
         f1a * ( d0 * ( ( EvtGammaMatrix::g3() * EvtGammaMatrix::g5() ) * p1 ) ) );
     temp_10_term1.set( 3, f1v * ( d1 * ( EvtGammaMatrix::g3() * p0 ) ) );
     temp_10_term2.set(
         3,
         f1a * ( d1 * ( ( EvtGammaMatrix::g3() * EvtGammaMatrix::g5() ) * p0 ) ) );
     temp_11_term1.set( 3, f1v * ( d1 * ( EvtGammaMatrix::g3() * p1 ) ) );
     temp_11_term2.set(
         3,
         f1a * ( d1 * ( ( EvtGammaMatrix::g3() * EvtGammaMatrix::g5() ) * p1 ) ) );
 
     EvtVector4C l1, l2;
 
     EvtId l_num = parent->getDaug( 1 )->getId();
     if ( l_num == EM || l_num == MUM || l_num == TAUM ) {
         l1 = EvtLeptonVACurrent( parent->getDaug( 1 )->spParent( 0 ),
                                  parent->getDaug( 2 )->spParentNeutrino() );
         l2 = EvtLeptonVACurrent( parent->getDaug( 1 )->spParent( 1 ),
                                  parent->getDaug( 2 )->spParentNeutrino() );
     } else {
         if ( l_num == EP || l_num == MUP || l_num == TAUP ) {
             l1 = EvtLeptonVACurrent( parent->getDaug( 2 )->spParentNeutrino(),
                                      parent->getDaug( 1 )->spParent( 0 ) );
             l2 = EvtLeptonVACurrent( parent->getDaug( 2 )->spParentNeutrino(),
                                      parent->getDaug( 1 )->spParent( 1 ) );
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Wrong lepton number" << endl;
         }
     }
 
     amp.vertex( 0, 0, 0, l1.cont( temp_00_term1 + temp_00_term2 ) );
     amp.vertex( 0, 0, 1, l2.cont( temp_00_term1 + temp_00_term2 ) );
 
     amp.vertex( 0, 1, 0, l1.cont( temp_01_term1 + temp_01_term2 ) );
     amp.vertex( 0, 1, 1, l2.cont( temp_01_term1 + temp_01_term2 ) );
 
     amp.vertex( 1, 0, 0, l1.cont( temp_10_term1 + temp_10_term2 ) );
     amp.vertex( 1, 0, 1, l2.cont( temp_10_term1 + temp_10_term2 ) );
 
     amp.vertex( 1, 1, 0, l1.cont( temp_11_term1 + temp_11_term2 ) );
     amp.vertex( 1, 1, 1, l2.cont( temp_11_term1 + temp_11_term2 ) );
 
     return;
 }
 
 double EvtSLBaryonAmp::CalcMaxProb( EvtId parent, EvtId baryon, EvtId lepton,
                                     EvtId nudaug, EvtSemiLeptonicFF* FormFactors,
                                     EvtComplex r00, EvtComplex r01,
                                     EvtComplex r10, EvtComplex r11 )
 {
     //This routine takes the arguements parent, baryon, and lepton
     //number, and a form factor model, and returns a maximum
     //probability for this semileptonic form factor model.  A
     //brute force method is used.  The 2D cos theta lepton and
     //q2 phase space is probed.
 
     //Start by declaring a particle at rest.
 
     //It only makes sense to have a scalar parent.  For now.
     //This should be generalized later.
 
     //  EvtScalarParticle *scalar_part;
     //  scalar_part=new EvtScalarParticle;
 
     EvtDiracParticle* dirac_part;
     EvtParticle* root_part;
     dirac_part = new EvtDiracParticle;
 
     //cludge to avoid generating random numbers!
     //  scalar_part->noLifeTime();
     dirac_part->noLifeTime();
 
     EvtVector4R p_init;
 
     p_init.set( EvtPDL::getMass( parent ), 0.0, 0.0, 0.0 );
     //  scalar_part->init(parent,p_init);
     //  root_part=(EvtParticle *)scalar_part;
     //  root_part->set_type(EvtSpinType::SCALAR);
 
     dirac_part->init( parent, p_init );
     root_part = (EvtParticle*)dirac_part;
     root_part->setDiagonalSpinDensity();
 
     EvtParticle *daughter, *lep, *trino;
 
     EvtAmp amp;
 
     EvtId listdaug[3];
     listdaug[0] = baryon;
     listdaug[1] = lepton;
     listdaug[2] = nudaug;
 
     amp.init( parent, 3, listdaug );
 
     root_part->makeDaughters( 3, listdaug );
     daughter = root_part->getDaug( 0 );
     lep = root_part->getDaug( 1 );
     trino = root_part->getDaug( 2 );
 
     //cludge to avoid generating random numbers!
     daughter->noLifeTime();
     lep->noLifeTime();
     trino->noLifeTime();
 
     //Initial particle is unpolarized, well it is a scalar so it is
     //trivial
     EvtSpinDensity rho;
     rho.setDiag( root_part->getSpinStates() );
 
     double mass[3];
 
     double m = root_part->mass();
 
     EvtVector4R p4baryon, p4lepton, p4nu, p4w;
     double q2max;
 
     double q2, elepton, plepton;
     int i, j;
     double erho, prho, costl;
 
     double maxfoundprob = 0.0;
     double prob = -10.0;
     int massiter;
 
     for ( massiter = 0; massiter < 3; massiter++ ) {
         mass[0] = EvtPDL::getMass( baryon );
         mass[1] = EvtPDL::getMass( lepton );
         mass[2] = EvtPDL::getMass( nudaug );
         if ( massiter == 1 ) {
             mass[0] = EvtPDL::getMinMass( baryon );
         }
         if ( massiter == 2 ) {
             mass[0] = EvtPDL::getMaxMass( baryon );
         }
 
         q2max = ( m - mass[0] ) * ( m - mass[0] );
 
         //loop over q2
 
         for ( i = 0; i < 25; i++ ) {
             q2 = ( ( i + 0.5 ) * q2max ) / 25.0;
 
             erho = ( m * m + mass[0] * mass[0] - q2 ) / ( 2.0 * m );
 
             prho = sqrt( erho * erho - mass[0] * mass[0] );
 
             p4baryon.set( erho, 0.0, 0.0, -1.0 * prho );
             p4w.set( m - erho, 0.0, 0.0, prho );
 
             //This is in the W rest frame
             elepton = ( q2 + mass[1] * mass[1] ) / ( 2.0 * sqrt( q2 ) );
             plepton = sqrt( elepton * elepton - mass[1] * mass[1] );
 
             double probctl[3];
 
             for ( j = 0; j < 3; j++ ) {
                 costl = 0.99 * ( j - 1.0 );
 
                 //These are in the W rest frame. Need to boost out into
                 //the B frame.
                 p4lepton.set( elepton, 0.0, plepton * sqrt( 1.0 - costl * costl ),
                               plepton * costl );
                 p4nu.set( plepton, 0.0,
                           -1.0 * plepton * sqrt( 1.0 - costl * costl ),
                           -1.0 * plepton * costl );
 
                 EvtVector4R boost( ( m - erho ), 0.0, 0.0, 1.0 * prho );
                 p4lepton = boostTo( p4lepton, boost );
                 p4nu = boostTo( p4nu, boost );
 
                 //Now initialize the daughters...
 
                 daughter->init( baryon, p4baryon );
                 lep->init( lepton, p4lepton );
                 trino->init( nudaug, p4nu );
 
                 CalcAmp( root_part, amp, FormFactors, r00, r01, r10, r11 );
 
                 //Now find the probability at this q2 and cos theta lepton point
                 //and compare to maxfoundprob.
 
                 //Do a little magic to get the probability!!
                 prob = rho.normalizedProb( amp.getSpinDensity() );
 
                 probctl[j] = prob;
             }
 
             //probclt contains prob at ctl=-1,0,1.
             //prob=a+b*ctl+c*ctl^2
 
             double a = probctl[1];
             double b = 0.5 * ( probctl[2] - probctl[0] );
             double c = 0.5 * ( probctl[2] + probctl[0] ) - probctl[1];
 
             prob = probctl[0];
             if ( probctl[1] > prob )
                 prob = probctl[1];
             if ( probctl[2] > prob )
                 prob = probctl[2];
 
             if ( fabs( c ) > 1e-20 ) {
                 double ctlx = -0.5 * b / c;
                 if ( fabs( ctlx ) < 1.0 ) {
                     double probtmp = a + b * ctlx + c * ctlx * ctlx;
                     if ( probtmp > prob )
                         prob = probtmp;
                 }
             }
 
             //EvtGenReport(EVTGEN_DEBUG,"EvtGen") << "prob,probctl:"<<prob<<" "
             //			            << probctl[0]<<" "
             //			            << probctl[1]<<" "
             //			            << probctl[2]<<std::endl;
 
             if ( prob > maxfoundprob ) {
                 maxfoundprob = prob;
             }
         }
         if ( EvtPDL::getWidth( baryon ) <= 0.0 ) {
             //if the particle is narrow dont bother with changing the mass.
             massiter = 4;
         }
     }
     root_part->deleteTree();
 
     maxfoundprob *= 1.1;
     return maxfoundprob;
 }
 void EvtSLBaryonAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
                               EvtSemiLeptonicFF* FormFactors, EvtComplex r00,
                               EvtComplex r01, EvtComplex r10, EvtComplex r11 )
 {
     //  Leptons
-    static EvtId EM = EvtPDL::getId( "e-" );
-    static EvtId MUM = EvtPDL::getId( "mu-" );
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId EM = EvtPDL::getId( "e-" );
+    static const EvtId MUM = EvtPDL::getId( "mu-" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
     //  Anti-Leptons
-    static EvtId EP = EvtPDL::getId( "e+" );
-    static EvtId MUP = EvtPDL::getId( "mu+" );
-    static EvtId TAUP = EvtPDL::getId( "tau+" );
+    static const EvtId EP = EvtPDL::getId( "e+" );
+    static const EvtId MUP = EvtPDL::getId( "mu+" );
+    static const EvtId TAUP = EvtPDL::getId( "tau+" );
 
     //  Baryons
-    static EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
-    static EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
-    static EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
-    static EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
-    static EvtId PRO = EvtPDL::getId( "p+" );
-    static EvtId N1440 = EvtPDL::getId( "N(1440)+" );
-    static EvtId N1520 = EvtPDL::getId( "N(1520)+" );
-    static EvtId N1535 = EvtPDL::getId( "N(1535)+" );
-    static EvtId N1720 = EvtPDL::getId( "N(1720)+" );
-    static EvtId N1650 = EvtPDL::getId( "N(1650)+" );
-    static EvtId N1700 = EvtPDL::getId( "N(1700)+" );
-    static EvtId N1710 = EvtPDL::getId( "N(1710)+" );
-    static EvtId N1875 = EvtPDL::getId( "N(1875)+" );
-    static EvtId N1900 = EvtPDL::getId( "N(1900)+" );
+    static const EvtId LAMCP = EvtPDL::getId( "Lambda_c+" );
+    static const EvtId LAMC1P = EvtPDL::getId( "Lambda_c(2593)+" );
+    static const EvtId LAMC2P = EvtPDL::getId( "Lambda_c(2625)+" );
+    static const EvtId LAMB = EvtPDL::getId( "Lambda_b0" );
+    static const EvtId PRO = EvtPDL::getId( "p+" );
+    static const EvtId N1440 = EvtPDL::getId( "N(1440)+" );
+    static const EvtId N1520 = EvtPDL::getId( "N(1520)+" );
+    static const EvtId N1535 = EvtPDL::getId( "N(1535)+" );
+    static const EvtId N1720 = EvtPDL::getId( "N(1720)+" );
+    static const EvtId N1650 = EvtPDL::getId( "N(1650)+" );
+    static const EvtId N1700 = EvtPDL::getId( "N(1700)+" );
+    static const EvtId N1710 = EvtPDL::getId( "N(1710)+" );
+    static const EvtId N1875 = EvtPDL::getId( "N(1875)+" );
+    static const EvtId N1900 = EvtPDL::getId( "N(1900)+" );
 
     // Anti-Baryons
-    static EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
-    static EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
-    static EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
-    static EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
-    static EvtId PROB = EvtPDL::getId( "anti-p-" );
-    static EvtId N1440B = EvtPDL::getId( "anti-N(1440)-" );
-    static EvtId N1520B = EvtPDL::getId( "anti-N(1520)-" );
-    static EvtId N1535B = EvtPDL::getId( "anti-N(1535)-" );
-    static EvtId N1720B = EvtPDL::getId( "anti-N(1720)-" );
-    static EvtId N1650B = EvtPDL::getId( "anti-N(1650)-" );
-    static EvtId N1700B = EvtPDL::getId( "anti-N(1700)-" );
-    static EvtId N1710B = EvtPDL::getId( "anti-N(1710)-" );
-    static EvtId N1875B = EvtPDL::getId( "anti-N(1875)-" );
-    static EvtId N1900B = EvtPDL::getId( "anti-N(1900)-" );
+    static const EvtId LAMCM = EvtPDL::getId( "anti-Lambda_c-" );
+    static const EvtId LAMC1M = EvtPDL::getId( "anti-Lambda_c(2593)-" );
+    static const EvtId LAMC2M = EvtPDL::getId( "anti-Lambda_c(2625)-" );
+    static const EvtId LAMBB = EvtPDL::getId( "anti-Lambda_b0" );
+    static const EvtId PROB = EvtPDL::getId( "anti-p-" );
+    static const EvtId N1440B = EvtPDL::getId( "anti-N(1440)-" );
+    static const EvtId N1520B = EvtPDL::getId( "anti-N(1520)-" );
+    static const EvtId N1535B = EvtPDL::getId( "anti-N(1535)-" );
+    static const EvtId N1720B = EvtPDL::getId( "anti-N(1720)-" );
+    static const EvtId N1650B = EvtPDL::getId( "anti-N(1650)-" );
+    static const EvtId N1700B = EvtPDL::getId( "anti-N(1700)-" );
+    static const EvtId N1710B = EvtPDL::getId( "anti-N(1710)-" );
+    static const EvtId N1875B = EvtPDL::getId( "anti-N(1875)-" );
+    static const EvtId N1900B = EvtPDL::getId( "anti-N(1900)-" );
 
     // Set the spin density matrix of the parent baryon
     EvtSpinDensity rho;
     rho.setDim( 2 );
     rho.set( 0, 0, r00 );
     rho.set( 0, 1, r01 );
 
     rho.set( 1, 0, r10 );
     rho.set( 1, 1, r11 );
 
     EvtVector4R vector4P = parent->getP4Lab();
     double pmag = vector4P.d3mag();
     double cosTheta = pmag > 0.0 ? vector4P.get( 3 ) / pmag : 1.0;
 
     double theta = acos( cosTheta );
     double phi = atan2( vector4P.get( 2 ), vector4P.get( 1 ) );
 
     parent->setSpinDensityForwardHelicityBasis( rho, phi, theta, 0.0 );
     //parent->setSpinDensityForward(rho);
 
     // Set the four momentum of the parent baryon in it's rest frame
     EvtVector4R p4b;
     p4b.set( parent->mass(), 0.0, 0.0, 0.0 );
 
     // Get the four momentum of the daughter baryon in the parent's rest frame
     EvtVector4R p4daught = parent->getDaug( 0 )->getP4();
 
     // Add the lepton and neutrino 4 momenta to find q (q^2)
     EvtVector4R q = parent->getDaug( 1 )->getP4() + parent->getDaug( 2 )->getP4();
 
     double q2 = q.mass2();
 
     EvtId l_num = parent->getDaug( 1 )->getId();
     EvtId bar_num = parent->getDaug( 0 )->getId();
     EvtId par_num = parent->getId();
 
     double baryonmass = parent->getDaug( 0 )->mass();
 
     // Handle spin-1/2 daughter baryon Dirac spinor cases
     if ( EvtPDL::getSpinType( parent->getDaug( 0 )->getId() ) ==
          EvtSpinType::DIRAC ) {
         // Set the form factors
         double f1, f2, f3, g1, g2, g3;
         FormFactors->getdiracff( par_num, bar_num, q2, baryonmass, &f1, &f2,
                                  &f3, &g1, &g2, &g3 );
 
         const double form_fact[6] = { f1, f2, f3, g1, g2, g3 };
 
         EvtVector4C b11, b12, b21, b22, l1, l2;
 
         //  Lepton Current
         if ( l_num == EM || l_num == MUM || l_num == TAUM ) {
             l1 = EvtLeptonVACurrent( parent->getDaug( 1 )->spParent( 0 ),
                                      parent->getDaug( 2 )->spParentNeutrino() );
             l2 = EvtLeptonVACurrent( parent->getDaug( 1 )->spParent( 1 ),
                                      parent->getDaug( 2 )->spParentNeutrino() );
 
         } else if ( l_num == EP || l_num == MUP || l_num == TAUP ) {
             l1 = EvtLeptonVACurrent( parent->getDaug( 2 )->spParentNeutrino(),
                                      parent->getDaug( 1 )->spParent( 0 ) );
             l2 = EvtLeptonVACurrent( parent->getDaug( 2 )->spParentNeutrino(),
                                      parent->getDaug( 1 )->spParent( 1 ) );
 
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Wrong lepton number \n";
             ::abort();
         }
 
         // Baryon current
 
         // Flag for particle/anti-particle parent, daughter with same/opp. parity
         // pflag = 0 => particle, same parity parent, daughter
         // pflag = 1 => particle, opp. parity parent, daughter
         // pflag = 2 => anti-particle, same parity parent, daughter
         // pflag = 3 => anti-particle, opp. parity parent, daughter
 
         int pflag = 0;
 
         // Handle 1/2+ -> 1/2+ first
         if ( ( par_num == LAMB && bar_num == LAMCP ) ||
              ( par_num == LAMBB && bar_num == LAMCM ) ||
              ( par_num == LAMB && bar_num == PRO ) ||
              ( par_num == LAMBB && bar_num == PROB ) ||
              ( par_num == LAMB && bar_num == N1440 ) ||
              ( par_num == LAMBB && bar_num == N1440B ) ||
              ( par_num == LAMB && bar_num == N1710 ) ||
              ( par_num == LAMBB && bar_num == N1710B )
 
         ) {
             // Set particle/anti-particle flag
             if ( bar_num == LAMCP || bar_num == PRO || bar_num == N1440 ||
                  bar_num == N1710 )
                 pflag = 0;
             else if ( bar_num == LAMCM || bar_num == PROB ||
                       bar_num == N1440B || bar_num == N1710B )
                 pflag = 2;
 
             b11 = EvtBaryonVACurrent( parent->getDaug( 0 )->spParent( 0 ),
                                       parent->sp( 0 ), p4b, p4daught, form_fact,
                                       pflag );
             b21 = EvtBaryonVACurrent( parent->getDaug( 0 )->spParent( 0 ),
                                       parent->sp( 1 ), p4b, p4daught, form_fact,
                                       pflag );
             b12 = EvtBaryonVACurrent( parent->getDaug( 0 )->spParent( 1 ),
                                       parent->sp( 0 ), p4b, p4daught, form_fact,
                                       pflag );
             b22 = EvtBaryonVACurrent( parent->getDaug( 0 )->spParent( 1 ),
                                       parent->sp( 1 ), p4b, p4daught, form_fact,
                                       pflag );
         }
 
         // Handle 1/2+ -> 1/2- second
         else if ( ( par_num == LAMB && bar_num == LAMC1P ) ||
                   ( par_num == LAMBB && bar_num == LAMC1M ) ||
                   ( par_num == LAMB && bar_num == N1535 ) ||
                   ( par_num == LAMBB && bar_num == N1535B ) ||
                   ( par_num == LAMB && bar_num == N1650 ) ||
                   ( par_num == LAMBB && bar_num == N1650B ) ) {
             // Set particle/anti-particle flag
             if ( bar_num == LAMC1P || bar_num == N1535 || bar_num == N1650 )
                 pflag = 1;
             else if ( bar_num == LAMC1M || bar_num == N1535B || bar_num == N1650B )
                 pflag = 3;
 
             b11 = EvtBaryonVACurrent( ( parent->getDaug( 0 )->spParent( 0 ) ),
                                       ( EvtGammaMatrix::g5() * parent->sp( 0 ) ),
                                       p4b, p4daught, form_fact, pflag );
             b21 = EvtBaryonVACurrent( ( parent->getDaug( 0 )->spParent( 0 ) ),
                                       ( EvtGammaMatrix::g5() * parent->sp( 1 ) ),
                                       p4b, p4daught, form_fact, pflag );
             b12 = EvtBaryonVACurrent( ( parent->getDaug( 0 )->spParent( 1 ) ),
                                       ( EvtGammaMatrix::g5() * parent->sp( 0 ) ),
                                       p4b, p4daught, form_fact, pflag );
             b22 = EvtBaryonVACurrent( ( parent->getDaug( 0 )->spParent( 1 ) ),
                                       ( EvtGammaMatrix::g5() * parent->sp( 1 ) ),
                                       p4b, p4daught, form_fact, pflag );
 
         }
 
         else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Dirac semilep. baryon current "
                 << "not implemented for this decay sequence." << std::endl;
             ::abort();
         }
 
         amp.vertex( 0, 0, 0, l1 * b11 );
         amp.vertex( 0, 0, 1, l2 * b11 );
 
         amp.vertex( 1, 0, 0, l1 * b21 );
         amp.vertex( 1, 0, 1, l2 * b21 );
 
         amp.vertex( 0, 1, 0, l1 * b12 );
         amp.vertex( 0, 1, 1, l2 * b12 );
 
         amp.vertex( 1, 1, 0, l1 * b22 );
         amp.vertex( 1, 1, 1, l2 * b22 );
 
     }
 
     // Need special handling for the spin-3/2 daughter baryon
     // Rarita-Schwinger spinor cases
     else if ( EvtPDL::getSpinType( parent->getDaug( 0 )->getId() ) ==
               EvtSpinType::RARITASCHWINGER ) {
         // Set the form factors
         double f1, f2, f3, f4, g1, g2, g3, g4;
         FormFactors->getraritaff( par_num, bar_num, q2, baryonmass, &f1, &f2,
                                   &f3, &f4, &g1, &g2, &g3, &g4 );
 
         const double form_fact[8] = { f1, f2, f3, f4, g1, g2, g3, g4 };
 
         EvtVector4C b11, b12, b21, b22, b13, b23, b14, b24, l1, l2;
 
         //  Lepton Current
         if ( l_num == EM || l_num == MUM || l_num == TAUM ) {
             //  Lepton Current
             l1 = EvtLeptonVACurrent( parent->getDaug( 1 )->spParent( 0 ),
                                      parent->getDaug( 2 )->spParentNeutrino() );
             l2 = EvtLeptonVACurrent( parent->getDaug( 1 )->spParent( 1 ),
                                      parent->getDaug( 2 )->spParentNeutrino() );
         } else if ( l_num == EP || l_num == MUP || l_num == TAUP ) {
             l1 = EvtLeptonVACurrent( parent->getDaug( 2 )->spParentNeutrino(),
                                      parent->getDaug( 1 )->spParent( 0 ) );
             l2 = EvtLeptonVACurrent( parent->getDaug( 2 )->spParentNeutrino(),
                                      parent->getDaug( 1 )->spParent( 1 ) );
 
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Wrong lepton number \n";
         }
 
         //  Baryon Current
         // Declare particle, anti-particle flag, same/opp. parity
         // pflag = 0 => particle
         // pflag = 1 => anti-particle
         int pflag = 0;
 
         // Handle cases of 1/2+ -> 3/2- or 3/2+
         if ( ( par_num == LAMB && bar_num == LAMC2P ) ||
              ( par_num == LAMB && bar_num == N1720 ) ||
              ( par_num == LAMB && bar_num == N1520 ) ||
              ( par_num == LAMB && bar_num == N1700 ) ||
              ( par_num == LAMB && bar_num == N1875 ) ||
              ( par_num == LAMB && bar_num == N1900 ) ) {
             // Set flag for particle case
             pflag = 0;
         } else if ( ( par_num == LAMBB && bar_num == LAMC2M ) ||
                     ( par_num == LAMBB && bar_num == N1520B ) ||
                     ( par_num == LAMBB && bar_num == N1700B ) ||
                     ( par_num == LAMBB && bar_num == N1875B ) ) {
             // Set flag for anti-particle opposite parity case
             pflag = 1;
         }
         // Handle anti-particle case for 1/2+ -> 3/2+
         else if ( ( par_num == LAMBB && bar_num == N1720B ) ||
                   ( par_num == LAMBB && bar_num == N1900B ) ) {
             pflag = 2;
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Rarita-Schwinger semilep. baryon current "
                 << "not implemented for this decay sequence." << std::endl;
             ::abort();
         }
 
         // Baryon current
         b11 = EvtBaryonVARaritaCurrent( parent->getDaug( 0 )->spRSParent( 0 ),
                                         parent->sp( 0 ), p4b, p4daught,
                                         form_fact, pflag );
         b21 = EvtBaryonVARaritaCurrent( parent->getDaug( 0 )->spRSParent( 0 ),
                                         parent->sp( 1 ), p4b, p4daught,
                                         form_fact, pflag );
 
         b12 = EvtBaryonVARaritaCurrent( parent->getDaug( 0 )->spRSParent( 1 ),
                                         parent->sp( 0 ), p4b, p4daught,
                                         form_fact, pflag );
         b22 = EvtBaryonVARaritaCurrent( parent->getDaug( 0 )->spRSParent( 1 ),
                                         parent->sp( 1 ), p4b, p4daught,
                                         form_fact, pflag );
 
         b13 = EvtBaryonVARaritaCurrent( parent->getDaug( 0 )->spRSParent( 2 ),
                                         parent->sp( 0 ), p4b, p4daught,
                                         form_fact, pflag );
         b23 = EvtBaryonVARaritaCurrent( parent->getDaug( 0 )->spRSParent( 2 ),
                                         parent->sp( 1 ), p4b, p4daught,
                                         form_fact, pflag );
 
         b14 = EvtBaryonVARaritaCurrent( parent->getDaug( 0 )->spRSParent( 3 ),
                                         parent->sp( 0 ), p4b, p4daught,
                                         form_fact, pflag );
         b24 = EvtBaryonVARaritaCurrent( parent->getDaug( 0 )->spRSParent( 3 ),
                                         parent->sp( 1 ), p4b, p4daught,
                                         form_fact, pflag );
 
         amp.vertex( 0, 0, 0, l1 * b11 );
         amp.vertex( 0, 0, 1, l2 * b11 );
 
         amp.vertex( 1, 0, 0, l1 * b21 );
         amp.vertex( 1, 0, 1, l2 * b21 );
 
         amp.vertex( 0, 1, 0, l1 * b12 );
         amp.vertex( 0, 1, 1, l2 * b12 );
 
         amp.vertex( 1, 1, 0, l1 * b22 );
         amp.vertex( 1, 1, 1, l2 * b22 );
 
         amp.vertex( 0, 2, 0, l1 * b13 );
         amp.vertex( 0, 2, 1, l2 * b13 );
 
         amp.vertex( 1, 2, 0, l1 * b23 );
         amp.vertex( 1, 2, 1, l2 * b23 );
 
         amp.vertex( 0, 3, 0, l1 * b14 );
         amp.vertex( 0, 3, 1, l2 * b14 );
 
         amp.vertex( 1, 3, 0, l1 * b24 );
         amp.vertex( 1, 3, 1, l2 * b24 );
     }
 }
 
 EvtVector4C EvtSLBaryonAmp::EvtBaryonVACurrent( const EvtDiracSpinor& Bf,
                                                 const EvtDiracSpinor& Bi,
                                                 EvtVector4R parent,
                                                 EvtVector4R daught,
                                                 const double* ff, int pflag )
 {
     // flag == 0 => particle
     // flag == 1 => particle, opposite parity
     // flag == 2 => anti-particle, same parity
     // flag == 3 => anti-particle, opposite parity
 
     // particle
     EvtComplex cv = EvtComplex( 1.0, 0. );
     EvtComplex ca = EvtComplex( 1.0, 0. );
 
     EvtComplex cg0 = EvtComplex( 1.0, 0. );
     EvtComplex cg5 = EvtComplex( 1.0, 0. );
 
     // antiparticle- same parity parent & daughter
     if ( pflag == 2 ) {
         cv = EvtComplex( -1.0, 0. );
         ca = EvtComplex( 1.0, 0. );
 
         cg0 = EvtComplex( 1.0, 0.0 );
         // Changed cg5 from -i to -1 as appears to fix particle - anti-particle discrepency
         cg5 = EvtComplex( -1.0, 0.0 );
     }
     // antiparticle- opposite parity parent & daughter
     else if ( pflag == 3 ) {
         cv = EvtComplex( 1.0, 0. );
         ca = EvtComplex( -1.0, 0. );
 
         // Changed cg0 from -i to -1 as appears to fix particle - anti-particle discrepency
         cg0 = EvtComplex( -1.0, 0.0 );
         cg5 = EvtComplex( 1.0, 0.0 );
     }
 
     EvtVector4C t[6];
 
     // Term 1 = \bar{u}(p',s')*(F_1(q^2)*\gamma_{mu})*u(p,s)
     t[0] = cv * EvtLeptonVCurrent( Bf, Bi );
 
     // Term 2 = \bar{u}(p',s')*(F_2(q^2)*(p_{mu}/m_{\Lambda_Q}))*u(p,s)
     t[1] = cg0 * EvtLeptonSCurrent( Bf, Bi ) * ( parent / parent.mass() );
 
     // Term 3 = \bar{u}(p',s')*(F_3(q^2)*(p'_{mu}/m_{\Lambda_q}))*u(p,s)
     t[2] = cg0 * EvtLeptonSCurrent( Bf, Bi ) * ( daught / daught.mass() );
 
     // Term 4 = \bar{u}(p',s')*(G_1(q^2)*\gamma_{mu}*\gamma_5)*u(p,s)
     t[3] = ca * EvtLeptonACurrent( Bf, Bi );
 
     // Term 5 =  \bar{u}(p',s')*(G_2(q^2)*(p_{mu}/m_{\Lambda_Q})*\gamma_5)*u(p,s)
     t[4] = cg5 * EvtLeptonPCurrent( Bf, Bi ) * ( parent / parent.mass() );
 
     // Term 6 = \bar{u}(p',s')*(G_3(q^2)*(p'_{mu}/m_{\Lambda_q})*\gamma_5)*u(p,s)
     t[5] = cg5 * EvtLeptonPCurrent( Bf, Bi ) * ( daught / daught.mass() );
 
     // Sum the individual terms
     EvtVector4C current = ( ff[0] * t[0] + ff[1] * t[1] + ff[2] * t[2] -
                             ff[3] * t[3] - ff[4] * t[4] - ff[5] * t[5] );
 
     return current;
 }
 
 EvtVector4C EvtSLBaryonAmp::EvtBaryonVARaritaCurrent(
     const EvtRaritaSchwinger& Bf, const EvtDiracSpinor& Bi, EvtVector4R parent,
     EvtVector4R daught, const double* ff, int pflag )
 {
     // flag == 0 => particle
     // flag == 1 => anti-particle
 
     // particle
     EvtComplex cv = EvtComplex( 1.0, 0. );
     EvtComplex ca = EvtComplex( 1.0, 0. );
 
     EvtComplex cg0 = EvtComplex( 1.0, 0. );
     EvtComplex cg5 = EvtComplex( 1.0, 0. );
 
     // antiparticle opposite parity
     if ( pflag == 1 ) {
         cv = EvtComplex( -1.0, 0. );
         ca = EvtComplex( 1.0, 0. );
 
         cg0 = EvtComplex( 1.0, 0.0 );
         cg5 = EvtComplex( -1.0, 0.0 );
     }
     // antiparticle same parity
     else if ( pflag == 2 ) {
         cv = EvtComplex( 1.0, 0. );
         ca = EvtComplex( -1.0, 0. );
 
         cg0 = EvtComplex( -1.0, 0.0 );
         cg5 = EvtComplex( 1.0, 0.0 );
     }
 
     EvtVector4C t[8];
     EvtTensor4C id;
     id.setdiag( 1.0, 1.0, 1.0, 1.0 );
 
     EvtDiracSpinor tmp;
     for ( int i = 0; i < 4; i++ ) {
         tmp.set_spinor( i, Bf.getVector( i ) * parent );
     }
 
     EvtVector4C v1, v2;
     for ( int i = 0; i < 4; i++ ) {
         v1.set( i, EvtLeptonSCurrent( Bf.getSpinor( i ), Bi ) );
         v2.set( i, EvtLeptonPCurrent( Bf.getSpinor( i ), Bi ) );
     }
 
     // Term 1 = \bar{u}^{\alpha}(p',s')*(p_{\alpha}/m_{\Lambda_Q})*(F_1(q^2)*\gamma_{mu})*u(p,s)
     t[0] = ( cv / parent.mass() ) * EvtLeptonVCurrent( tmp, Bi );
 
     // Term 2
     // = \bar{u}^{\alpha}(p',s')*(p_{\alpha}/m_{\Lambda_Q})*(F_2(q^2)*(p_{mu}/m_{\Lambda_Q}))*u(p,s)
     t[1] = ( ( cg0 / parent.mass() ) * EvtLeptonSCurrent( tmp, Bi ) ) *
            ( parent / parent.mass() );
 
     // Term 3
     // = \bar{u}^{\alpha}(p',s')*(p_{\alpha}/m_{\Lambda_Q})*(F_3(q^2)*(p'_{mu}/m_{\Lambda_q}))*u(p,s)
     t[2] = ( ( cg0 / parent.mass() ) * EvtLeptonSCurrent( tmp, Bi ) ) *
            ( daught / daught.mass() );
 
     // Term 4 = \bar{u}^{\alpha}(p',s')*(F_4(q^2)*g_{\alpha,\mu})*u(p,s)
     t[3] = cg0 * ( id.cont2( v1 ) );
 
     // Term 5
     // = \bar{u}^{\alpha}(p',s')*(p_{\alpha}/m_{\Lambda_Q})*(G_1(q^2)*\gamma_{mu}*\gamma_5)*u(p,s)
     t[4] = ( ca / parent.mass() ) * EvtLeptonACurrent( tmp, Bi );
 
     // Term 6
     // = \bar{u}^{\alpha}(p',s')*(p_{\alpha}/m_{\Lambda_Q})
     //      *(G_2(q^2)*(p_{mu}/m_{\Lambda_Q})*\gamma_5)*u(p,s)
     t[5] = ( ( cg5 / parent.mass() ) * EvtLeptonPCurrent( tmp, Bi ) ) *
            ( parent / parent.mass() );
 
     // Term 7
     // = \bar{u}^{\alpha}(p',s')*(p_{\alpha}/m_{\Lambda_Q})
     //      *(G_3(q^2)*(p'_{mu}/m_{\Lambda_q})*\gamma_5)*u(p,s)
     t[6] = ( ( cg5 / parent.mass() ) * EvtLeptonPCurrent( tmp, Bi ) ) *
            ( daught / daught.mass() );
 
     // Term 8 = \bar{u}^{\alpha}(p',s')*(G_4(q^2)*g_{\alpha,\mu}*\gamma_5))*u(p,s)
     t[7] = cg5 * ( id.cont2( v2 ) );
 
     // Sum the individual terms
     EvtVector4C current = ( ff[0] * t[0] + ff[1] * t[1] + ff[2] * t[2] +
                             ff[3] * t[3] - ff[4] * t[4] - ff[5] * t[5] -
                             ff[6] * t[6] - ff[7] * t[7] );
 
     return current;
 }
diff --git a/src/EvtGenModels/EvtSLDiBaryonAmp.cpp b/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
index 9affe67..ba3d020 100644
--- a/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
+++ b/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
@@ -1,441 +1,441 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSLDiBaryonAmp.hh"
 
 #include "EvtGenBase/EvtGammaMatrix.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRaritaSchwinger.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 
 EvtSLDiBaryonAmp::EvtSLDiBaryonAmp( const EvtBToDiBaryonlnupQCDFF& formFactors ) :
     m_ffModel( formFactors )
 {
 }
 
 void EvtSLDiBaryonAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp ) const
 {
-    static EvtId EM = EvtPDL::getId( "e-" );
-    static EvtId MUM = EvtPDL::getId( "mu-" );
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
-    static EvtId EP = EvtPDL::getId( "e+" );
-    static EvtId MUP = EvtPDL::getId( "mu+" );
-    static EvtId TAUP = EvtPDL::getId( "tau+" );
+    static const EvtId EM = EvtPDL::getId( "e-" );
+    static const EvtId MUM = EvtPDL::getId( "mu-" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId EP = EvtPDL::getId( "e+" );
+    static const EvtId MUP = EvtPDL::getId( "mu+" );
+    static const EvtId TAUP = EvtPDL::getId( "tau+" );
 
     // The amplitude assumes B- -> p+ p- l- nubar ordering
     // i.e. the B- decay is the "particle" mode
 
     // B charge (x3) to check for antiparticle mode and baryon daughter ordering
     EvtId BId = parent->getId();
     int qB3 = EvtPDL::chg3( BId );
 
     bool particleMode( true );
     // Check if we have B+ instead (antiparticle mode)
     if ( qB3 > 0 ) {
         particleMode = false;
     }
 
     // The baryon, charged lepton and neutrino daughters
 
     // Make sure the first baryon has a charge opposite to the B, since the
     // amplitude expressions assume this order
     EvtParticle* baryon1 = parent->getDaug( 0 );
     EvtParticle* baryon2 = parent->getDaug( 1 );
 
     // Check if we need to reverse the baryon ordering
     if ( EvtPDL::chg3( baryon1->getId() ) == qB3 ) {
         baryon1 = parent->getDaug( 1 );
         baryon2 = parent->getDaug( 0 );
     }
 
     EvtParticle* lepton = parent->getDaug( 2 );
     EvtParticle* neutrino = parent->getDaug( 3 );
 
     // 4-momenta in B rest frame
     EvtVector4R p0( parent->mass(), 0.0, 0.0, 0.0 );
     EvtVector4R p1 = baryon1->getP4();
     EvtVector4R p2 = baryon2->getP4();
 
     EvtVector4R pSum = p1 + p2;
     EvtVector4R p = p0 - pSum;
     EvtVector4R pDiff = p2 - p1;
 
     // Particle id's: retrieve 1st baryon again in case order has changed
     EvtId Id1 = baryon1->getId();
     EvtId Id2 = baryon2->getId();
     EvtId l_num = lepton->getId();
 
     EvtSpinType::spintype type1 = EvtPDL::getSpinType( Id1 );
     EvtSpinType::spintype type2 = EvtPDL::getSpinType( Id2 );
 
     // Parity of B+- = -1. Check if the parity of the dibaryon state is the same.
     // If so, set the sameParity integer to 1. Otherwise set it to -1,
     // i.e. the dibaryon system has opposite parity to the B meson
     int J1 = EvtSpinType::getSpin2( type1 );
     int J2 = EvtSpinType::getSpin2( type2 );
     int sameParity = this->checkDibaryonParity( Id1, Id2, J1, J2 );
 
     // Number of chiral components of the baryon spinors
     int N1 = EvtSpinType::getSpinStates( type1 );
     int N2 = EvtSpinType::getSpinStates( type2 );
 
     // Invariant mass of the two baryon particle system
     double m_dibaryon = sqrt( pSum.mass2() );
 
     // Complex number i
     EvtComplex I( 0, 1 );
 
     // Lepton currents, same for all baryon options
     EvtVector4C l1, l2;
 
     if ( l_num == EM || l_num == MUM || l_num == TAUM ) {
         // B-
         l1 = EvtLeptonVACurrent( lepton->spParent( 0 ),
                                  neutrino->spParentNeutrino() );
 
         l2 = EvtLeptonVACurrent( lepton->spParent( 1 ),
                                  neutrino->spParentNeutrino() );
 
     } else if ( l_num == EP || l_num == MUP || l_num == TAUP ) {
         // B+
         l1 = EvtLeptonVACurrent( neutrino->spParentNeutrino(),
                                  lepton->spParent( 0 ) );
 
         l2 = EvtLeptonVACurrent( neutrino->spParentNeutrino(),
                                  lepton->spParent( 1 ) );
 
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtSLDiBaryonAmp" )
             << "Wrong lepton number" << std::endl;
     }
 
     // Parity multiplication factors for the antiparticle mode hadronic currents
     double sign1 = ( particleMode == true ) ? 1.0 : 1.0 * sameParity;
     double sign2 = ( particleMode == true ) ? 1.0 : 1.0 * sameParity;
     double sign3 = ( particleMode == true ) ? 1.0 : -1.0 * sameParity;
     double sign4 = ( particleMode == true ) ? 1.0 : -1.0 * sameParity;
     double sign5 = ( particleMode == true ) ? 1.0 : -1.0 * sameParity;
     double sign6 = ( particleMode == true ) ? 1.0 : 1.0 * sameParity;
 
     // Define form factor coeff variables
     double f1( 0.0 ), f2( 0.0 ), f3( 0.0 ), f4( 0.0 ), f5( 0.0 );
     double g1( 0.0 ), g2( 0.0 ), g3( 0.0 ), g4( 0.0 ), g5( 0.0 );
 
     // Handle case of two Dirac-type daughters, e.g. p pbar, p N(1440)
     if ( type1 == EvtSpinType::DIRAC && type2 == EvtSpinType::DIRAC ) {
         // Form factor parameters
         EvtBToDiBaryonlnupQCDFF::FormFactors FF;
         m_ffModel.getDiracFF( parent, m_dibaryon, FF );
 
         if ( sameParity == 1 ) {
             f1 = FF.m_F1;
             f2 = FF.m_F2;
             f3 = FF.m_F3;
             f4 = FF.m_F4;
             f5 = FF.m_F5;
             g1 = FF.m_G1;
             g2 = FF.m_G2;
             g3 = FF.m_G3;
             g4 = FF.m_G4;
             g5 = FF.m_G5;
         } else {
             // Swap coeffs: f_i <--> g_i
             f1 = FF.m_G1;
             f2 = FF.m_G2;
             f3 = FF.m_G3;
             f4 = FF.m_G4;
             f5 = FF.m_G5;
             g1 = FF.m_F1;
             g2 = FF.m_F2;
             g3 = FF.m_F3;
             g4 = FF.m_F4;
             g5 = FF.m_F5;
         }
 
         EvtVector4R gMtmTerms = g3 * p + g4 * pSum + g5 * pDiff;
         EvtVector4R fMtmTerms = f3 * p + f4 * pSum + f5 * pDiff;
 
         // First baryon
         for ( int i = 0; i < N1; i++ ) {
             // Get the baryon spinor in the B rest frame. Also just use u and not i*u,
             // since the imaginary constant factor is not needed for the probability
             EvtDiracSpinor u = baryon1->spParent( i );
 
             // Second baryon
             for ( int j = 0; j < N2; j++ ) {
                 EvtDiracSpinor v = baryon2->spParent( j );
 
                 // Hadronic currents
                 std::vector<EvtVector4C> hadCurrents =
                     this->getHadronicCurrents( u, v, p, gMtmTerms, fMtmTerms );
 
                 // First amplitude terms: 3rd current already has the form factor coeffs applied (gMtmTerms)
                 EvtVector4C amp1 = g1 * sign1 * hadCurrents[0] +
                                    g2 * sign2 * hadCurrents[1] +
                                    sign3 * hadCurrents[2];
 
                 // Second amplitude terms: 6th current already has the form factor coeffs applied (fMtmTerms)
                 EvtVector4C amp2 = f1 * sign4 * hadCurrents[3] +
                                    f2 * sign5 * hadCurrents[4] +
                                    sign6 * hadCurrents[5];
 
                 EvtVector4C hadAmp;
                 if ( sameParity == 1 ) {
                     hadAmp = amp1 - amp2;
                 } else {
                     hadAmp = amp2 - amp1;
                 }
 
                 amp.vertex( i, j, 0, l1 * hadAmp );
                 amp.vertex( i, j, 1, l2 * hadAmp );
 
             }    // j
 
         }    // i
 
     } else if ( ( type1 == EvtSpinType::DIRAC &&
                   type2 == EvtSpinType::RARITASCHWINGER ) ||
                 ( type1 == EvtSpinType::RARITASCHWINGER &&
                   type2 == EvtSpinType::DIRAC ) ) {
         // Handle the case of one Dirac-type daughter (not including the leptons), e.g. one proton, and one
         // Rarita-Schwinger-type (spin 3/2) daughter e.g. B -> p N(1520) l nu
 
         // Form factor parameters
         EvtBToDiBaryonlnupQCDFF::FormFactors FF;
         m_ffModel.getRaritaFF( parent, m_dibaryon, FF );
 
         if ( sameParity == 1 ) {
             f1 = FF.m_F1;
             f2 = FF.m_F2;
             f3 = FF.m_F3;
             f4 = FF.m_F4;
             f5 = FF.m_F5;
             g1 = FF.m_G1;
             g2 = FF.m_G2;
             g3 = FF.m_G3;
             g4 = FF.m_G4;
             g5 = FF.m_G5;
         } else {
             // Swap coeffs: f_i <--> g_i
             f1 = FF.m_G1;
             f2 = FF.m_G2;
             f3 = FF.m_G3;
             f4 = FF.m_G4;
             f5 = FF.m_G5;
             g1 = FF.m_F1;
             g2 = FF.m_F2;
             g3 = FF.m_F3;
             g4 = FF.m_F4;
             g5 = FF.m_F5;
         }
 
         EvtVector4R gMtmTerms = g3 * p + g4 * pSum + g5 * pDiff;
         EvtVector4R fMtmTerms = f3 * p + f4 * pSum + f5 * pDiff;
 
         if ( type1 == EvtSpinType::DIRAC ) {
             // First baryon is Dirac
             for ( int i = 0; i < N1; i++ ) {
                 // Get the baryon spinor in the B rest frame. Also just use u and not i*u,
                 // since the imaginary constant factor is not needed for the probability
                 EvtDiracSpinor u = baryon1->spParent( i );
 
                 // Second baryon is RS-type
                 for ( int j = 0; j < N2; j++ ) {
                     EvtRaritaSchwinger vRS = baryon2->spRSParent( j );
 
                     EvtDiracSpinor v;
                     for ( int k = 0; k < 4; k++ ) {
                         v.set_spinor( k, vRS.getVector( k ) * p0 );
                     }
 
                     // Hadronic currents
                     std::vector<EvtVector4C> hadCurrents =
                         this->getHadronicCurrents( u, v, p, gMtmTerms, fMtmTerms );
 
                     // First amplitude terms: 3rd current already has the form factor coeffs applied (gMtmTerms)
                     EvtVector4C amp1 = g1 * sign1 * hadCurrents[0] +
                                        g2 * sign2 * hadCurrents[1] +
                                        sign3 * hadCurrents[2];
 
                     // Second amplitude terms: 6th current already has the form factor coeffs applied (fMtmTerms)
                     EvtVector4C amp2 = f1 * sign4 * hadCurrents[3] +
                                        f2 * sign5 * hadCurrents[4] +
                                        sign6 * hadCurrents[5];
 
                     EvtVector4C hadAmp;
                     if ( sameParity == 1 ) {
                         hadAmp = amp1 - amp2;
                     } else {
                         hadAmp = amp2 - amp1;
                     }
 
                     amp.vertex( i, j, 0, l1 * hadAmp );
                     amp.vertex( i, j, 1, l2 * hadAmp );
 
                 }    // j
 
             }    // i
 
         } else if ( type2 == EvtSpinType::DIRAC ) {
             // Same as before, but where the first daughter is RS-type, e.g. B -> N(1520) p l nu
 
             // First baryon is RS
             for ( int i = 0; i < N1; i++ ) {
                 // Get the baryon spinor in the B rest frame
                 EvtRaritaSchwinger uRS = baryon1->spRSParent( i );
 
                 EvtDiracSpinor u;
                 for ( int k = 0; k < 4; k++ ) {
                     u.set_spinor( k, uRS.getVector( k ) * p0 );
                 }
 
                 // Second baryon is Dirac
                 for ( int j = 0; j < N2; j++ ) {
                     EvtDiracSpinor v = baryon2->spParent( j );
 
                     // Hadronic currents
                     std::vector<EvtVector4C> hadCurrents =
                         this->getHadronicCurrents( u, v, p, gMtmTerms, fMtmTerms );
 
                     // First amplitude terms: 3rd current already has the form factor coeffs applied (gMtmTerms)
                     EvtVector4C amp1 = g1 * sign1 * hadCurrents[0] +
                                        g2 * sign2 * hadCurrents[1] +
                                        sign3 * hadCurrents[2];
 
                     // Second amplitude terms: 6th current already has the form factor coeffs applied (fMtmTerms)
                     EvtVector4C amp2 = f1 * sign4 * hadCurrents[3] +
                                        f2 * sign5 * hadCurrents[4] +
                                        sign6 * hadCurrents[5];
 
                     EvtVector4C hadAmp;
                     if ( sameParity == 1 ) {
                         hadAmp = amp1 - amp2;
                     } else {
                         hadAmp = amp2 - amp1;
                     }
 
                     amp.vertex( i, j, 0, l1 * hadAmp );
                     amp.vertex( i, j, 1, l2 * hadAmp );
 
                 }    // j
 
             }    // i
 
         }    // RS daughter check
 
     }    // Have Dirac and RS baryons
 }
 
 std::vector<EvtVector4C> EvtSLDiBaryonAmp::getHadronicCurrents(
     const EvtDiracSpinor& u, const EvtDiracSpinor& v, const EvtVector4R& p,
     const EvtVector4R& gMtmTerms, const EvtVector4R& fMtmTerms ) const
 {
     // Store the currents used in Eq 6 (in order of appearance)
     std::vector<EvtVector4C> currents;
     currents.reserve( 6 );
 
     EvtDiracSpinor g5v = EvtGammaMatrix::g5() * v;
 
     // ubar*gamma*gamma5*v
     EvtVector4C current1 = EvtLeptonACurrent( u, v );
     currents.push_back( current1 );
 
     // ubar*sigma*p*gamma5*v -> [ubar*sigma*(gamma5*v)]*p
     EvtTensor4C TC1 = EvtLeptonTCurrent( u, g5v );
     // Contract tensor with 4-momentum
     EvtVector4C current2 = TC1.cont2( p );
     currents.push_back( current2 );
 
     // ubar*p*gamma5*v; "p" = p, pSum and pDiff
     EvtComplex PC1 = EvtLeptonPCurrent( u, v );
     EvtVector4C current3 = PC1 * gMtmTerms;
     currents.push_back( current3 );
 
     // ubar*gamma*v
     EvtVector4C current4 = EvtLeptonVCurrent( u, v );
     currents.push_back( current4 );
 
     // ubar*sigma*p*v -> [ubar*sigma*v]*p
     EvtTensor4C TC2 = EvtLeptonTCurrent( u, v );
     // Contract tensor with 4-momentum
     EvtVector4C current5 = TC2.cont2( p );
     currents.push_back( current5 );
 
     // ubar*p*v; "p" = p, pSum and pDiff
     EvtComplex S1 = EvtLeptonSCurrent( u, v );
     EvtVector4C current6 = S1 * fMtmTerms;
     currents.push_back( current6 );
 
     return currents;
 }
 
 int EvtSLDiBaryonAmp::checkDibaryonParity( const EvtId& id1, const EvtId& id2,
                                            const int J1, const int J2 ) const
 {
     // Get intrisic parities of the two baryons, then multiply by (-1)^|J1 - J2|.
     // Note here that the J1 and J2 function arguments = 2*spin
     int par1 = this->getBaryonParity( id1 );
     int par2 = this->getBaryonParity( id2 );
 
     // mult should be either 0 or 1 for allowed Dirac/RS baryon pairs
     int mult = static_cast<int>( pow( -1.0, 0.5 * fabs( J1 - J2 ) ) );
 
     int dbParity = par1 * par2 * mult;
 
     // Initialise result to 1, i.e. dibaryon parity = B parity = -1
     int result( 1 );
 
     // Dibaryon parity is opposite to the negative B parity
     if ( dbParity > 0 ) {
         result = -1;
     }
 
     return result;
 }
 
 int EvtSLDiBaryonAmp::getBaryonParity( const EvtId& id ) const
 {
     // Initialise parity to +1
     int parity( 1 );
 
     // List of baryons with parity = +1
-    static EvtIdSet posParity{ "p+",
-                               "Delta+",
-                               "Lambda_c+",
-                               "anti-Lambda_c(2593)-",
-                               "anti-Lambda_c(2625)-",
-                               "N(1440)+",
-                               "anti-N(1520)-",
-                               "anti-N(1535)-",
-                               "anti-N(1650)-",
-                               "anti-N(1700)-",
-                               "N(1710)+",
-                               "N(1720)+" };
+    static const EvtIdSet posParity{ "p+",
+                                     "Delta+",
+                                     "Lambda_c+",
+                                     "anti-Lambda_c(2593)-",
+                                     "anti-Lambda_c(2625)-",
+                                     "N(1440)+",
+                                     "anti-N(1520)-",
+                                     "anti-N(1535)-",
+                                     "anti-N(1650)-",
+                                     "anti-N(1700)-",
+                                     "N(1710)+",
+                                     "N(1720)+" };
 
     // If the baryon id is not in the list, set the parity to -1
     if ( !posParity.contains( id ) ) {
         parity = -1;
     }
 
     return parity;
 }
diff --git a/src/EvtGenModels/EvtSLN.cpp b/src/EvtGenModels/EvtSLN.cpp
index b4b02d5..0d9e984 100644
--- a/src/EvtGenModels/EvtSLN.cpp
+++ b/src/EvtGenModels/EvtSLN.cpp
@@ -1,95 +1,95 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSLN.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSLN::getName()
+std::string EvtSLN::getName() const
 {
     return "SLN";
 }
 
-EvtDecayBase* EvtSLN::clone()
+EvtDecayBase* EvtSLN::clone() const
 {
     return new EvtSLN;
 }
 
 void EvtSLN::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::NEUTRINO );
 }
 
 void EvtSLN::initProbMax()
 {
     double M = EvtPDL::getMeanMass( getParentId() );
     double m = EvtPDL::getMeanMass( getDaug( 0 ) );
 
     double probMax = 8.0 * ( M * M - m * m ) * m * m;
 
     setProbMax( probMax );
 }
 
 void EvtSLN::decay( EvtParticle* p )
 {
-    static EvtId EM = EvtPDL::getId( "e-" );
-    static EvtId MUM = EvtPDL::getId( "mu-" );
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId EM = EvtPDL::getId( "e-" );
+    static const EvtId MUM = EvtPDL::getId( "mu-" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle *l, *nul;
     l = p->getDaug( 0 );
     nul = p->getDaug( 1 );
 
     EvtVector4R p4_p;
     p4_p.set( p->mass(), 0.0, 0.0, 0.0 );
 
     EvtVector4C l1, l2;
 
     if ( getDaug( 0 ) == TAUM || getDaug( 0 ) == MUM || getDaug( 0 ) == EM ) {
         l1 = EvtLeptonVACurrent( l->spParent( 0 ), nul->spParentNeutrino() );
         l2 = EvtLeptonVACurrent( l->spParent( 1 ), nul->spParentNeutrino() );
     } else {
         l1 = EvtLeptonVACurrent( nul->spParentNeutrino(), l->spParent( 0 ) );
         l2 = EvtLeptonVACurrent( nul->spParentNeutrino(), l->spParent( 1 ) );
     }
 
     vertex( 0, p4_p * l1 );
     vertex( 1, p4_p * l2 );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSLPole.cpp b/src/EvtGenModels/EvtSLPole.cpp
index 8c24d2e..eebb306 100644
--- a/src/EvtGenModels/EvtSLPole.cpp
+++ b/src/EvtGenModels/EvtSLPole.cpp
@@ -1,98 +1,98 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSLPole.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicTensorAmp.hh"
 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
 
 #include "EvtGenModels/EvtSLPoleFF.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSLPole::getName()
+std::string EvtSLPole::getName() const
 {
     return "SLPOLE";
 }
 
-EvtDecayBase* EvtSLPole::clone()
+EvtDecayBase* EvtSLPole::clone() const
 {
     return new EvtSLPole;
 }
 
 void EvtSLPole::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs(), m_resetDaughterTree );
     m_calcamp->CalcAmp( p, m_amp2, m_SLPoleffmodel.get() );
 }
 
 void EvtSLPole::initProbMax()
 {
     EvtId parnum, mesnum, lnum, nunum;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     lnum = getDaug( 1 );
     nunum = getDaug( 2 );
 
     double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, lnum, nunum,
                                                m_SLPoleffmodel.get() );
 
     setProbMax( mymaxprob );
 }
 
 void EvtSLPole::init()
 {
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton neutrino
 
     checkSpinParent( EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 
     EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     m_SLPoleffmodel = std::make_unique<EvtSLPoleFF>( getNArg(), getArgs() );
 
     switch ( mesontype ) {
         case EvtSpinType::SCALAR:
             m_calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
             break;
         case EvtSpinType::VECTOR:
             m_calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
             break;
         case EvtSpinType::TENSOR:
             m_calcamp = std::make_unique<EvtSemiLeptonicTensorAmp>();
             break;
         default:;
     }
 
     m_resetDaughterTree = false;
     if ( getArgStr( getNArg() - 1 ) == "true" )
         m_resetDaughterTree = true;
 }
diff --git a/src/EvtGenModels/EvtSSDCP.cpp b/src/EvtGenModels/EvtSSDCP.cpp
index f60fadd..726bf73 100644
--- a/src/EvtGenModels/EvtSSDCP.cpp
+++ b/src/EvtGenModels/EvtSSDCP.cpp
@@ -1,365 +1,365 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSSDCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIncoherentMixing.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtSSDCP::getName()
+std::string EvtSSDCP::getName() const
 {
     return "SSD_CP";
 }
 
-EvtDecayBase* EvtSSDCP::clone()
+EvtDecayBase* EvtSSDCP::clone() const
 {
     return new EvtSSDCP;
 }
 
 void EvtSSDCP::init()
 {
     // check that there are 8 or 12 or 14 arguments
 
     checkNArg( 14, 12, 8 );
     checkNDaug( 2 );
 
     EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
     EvtSpinType::spintype d2type = EvtPDL::getSpinType( getDaug( 1 ) );
 
     // Check it is a B0 or B0s
     if ( ( getParentId() != EvtPDL::getId( "B0" ) ) &&
          ( getParentId() != EvtPDL::getId( "anti-B0" ) ) &&
          ( getParentId() != EvtPDL::getId( "B_s0" ) ) &&
          ( getParentId() != EvtPDL::getId( "anti-B_s0" ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtSSDCP only decays B0 and B0s" << std::endl;
         ::abort();
     }
 
     if ( ( !( d1type == EvtSpinType::SCALAR || d2type == EvtSpinType::SCALAR ) ) ||
          ( !( ( d2type == EvtSpinType::SCALAR ) ||
               ( d2type == EvtSpinType::VECTOR ) ||
               ( d2type == EvtSpinType::TENSOR ) ) ) ||
          ( !( ( d1type == EvtSpinType::SCALAR ) ||
               ( d1type == EvtSpinType::VECTOR ) ||
               ( d1type == EvtSpinType::TENSOR ) ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtSSDCP generator expected "
             << "one of the daugters to be a scalar, the other either scalar, vector, or tensor, found:"
             << EvtPDL::name( getDaug( 0 ) ).c_str() << " and "
             << EvtPDL::name( getDaug( 1 ) ).c_str() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     m_dm = getArg( 0 ) / EvtConst::c;    //units of 1/mm
 
     m_dgog = getArg( 1 );
 
     m_qoverp = getArg( 2 ) * EvtComplex( cos( getArg( 3 ) ), sin( getArg( 3 ) ) );
     m_poverq = 1.0 / m_qoverp;
 
     m_A_f = getArg( 4 ) * EvtComplex( cos( getArg( 5 ) ), sin( getArg( 5 ) ) );
 
     m_Abar_f = getArg( 6 ) * EvtComplex( cos( getArg( 7 ) ), sin( getArg( 7 ) ) );
 
     if ( getNArg() >= 12 ) {
         m_eigenstate = false;
         m_A_fbar = getArg( 8 ) *
                    EvtComplex( cos( getArg( 9 ) ), sin( getArg( 9 ) ) );
         m_Abar_fbar = getArg( 10 ) *
                       EvtComplex( cos( getArg( 11 ) ), sin( getArg( 11 ) ) );
     } else {
         //I'm somewhat confused about this. For a CP eigenstate set the
         //amplitudes to the same. For a non CP eigenstate CPT invariance
         //is enforced. (ryd)
         if ( ( getDaug( 0 ) == EvtPDL::chargeConj( getDaug( 0 ) ) &&
                getDaug( 1 ) == EvtPDL::chargeConj( getDaug( 1 ) ) ) ||
              ( getDaug( 0 ) == EvtPDL::chargeConj( getDaug( 1 ) ) &&
                getDaug( 1 ) == EvtPDL::chargeConj( getDaug( 0 ) ) ) ) {
             m_eigenstate = true;
         } else {
             m_eigenstate = false;
             m_A_fbar = conj( m_Abar_f );
             m_Abar_fbar = conj( m_A_f );
         }
     }
 
     //FS: new check for z
     if ( getNArg() == 14 ) {    //FS Set m_z parameter if provided else set it 0
         m_z = EvtComplex( getArg( 12 ), getArg( 13 ) );
     } else {
         m_z = EvtComplex( 0.0, 0.0 );
     }
 
     // FS substituted next 2 lines...
 
     //
     //  m_gamma=EvtPDL::getctau(EvtPDL::getId("B0"));  //units of 1/mm
     //m_dgamma=m_gamma*0.5*m_dgog;
     //
     // ...with:
 
     if ( ( getParentId() == EvtPDL::getId( "B0" ) ) ||
          ( getParentId() == EvtPDL::getId( "anti-B0" ) ) ) {
         m_gamma = 1. / EvtPDL::getctau( EvtPDL::getId( "B0" ) );    //gamma/c (1/mm)
     } else {
         m_gamma = 1. / EvtPDL::getctau( EvtPDL::getId( "B_s0" ) );
     }
 
     m_dgamma = m_gamma * m_dgog;    //dgamma/c (1/mm)
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "SSD_CP will generate CP/CPT violation:" << endl
             << endl
             << "    " << EvtPDL::name( getParentId() ).c_str() << " --> "
             << EvtPDL::name( getDaug( 0 ) ).c_str() << " + "
             << EvtPDL::name( getDaug( 1 ) ).c_str() << endl
             << endl
             << "using parameters:" << endl
             << endl
             << "  delta(m)  = " << m_dm << " hbar/ps" << endl
             << "dGamma      = " << m_dgamma << " ps-1" << endl
             << "       q/p  = " << m_qoverp << endl
             << "        z  = " << m_z << endl
             << "       tau  = " << 1. / m_gamma << " ps" << endl;
     }
 }
 
 void EvtSSDCP::initProbMax()
 {
     double theProbMax = abs( m_A_f ) * abs( m_A_f ) +
                         abs( m_Abar_f ) * abs( m_Abar_f ) +
                         abs( m_A_fbar ) * abs( m_A_fbar ) +
                         abs( m_Abar_fbar ) * abs( m_Abar_fbar );
 
     if ( m_eigenstate )
         theProbMax *= 2;
 
     EvtSpinType::spintype d2type = EvtPDL::getSpinType( getDaug( 1 ) );
     EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
     if ( d1type == EvtSpinType::TENSOR || d2type == EvtSpinType::TENSOR )
         theProbMax *= 10;
 
     setProbMax( theProbMax );
 }
 
 void EvtSSDCP::decay( EvtParticle* p )
 {
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
-    static EvtId B0s = EvtPDL::getId( "B_s0" );
-    static EvtId B0Bs = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId B0s = EvtPDL::getId( "B_s0" );
+    static const EvtId B0Bs = EvtPDL::getId( "anti-B_s0" );
 
     double t;
     EvtId other_b;
     EvtId daugs[2];
 
     int flip = 0;
     if ( !m_eigenstate ) {
         if ( EvtRandom::Flat( 0.0, 1.0 ) < 0.5 )
             flip = 1;
     }
 
     if ( !flip ) {
         daugs[0] = getDaug( 0 );
         daugs[1] = getDaug( 1 );
     } else {
         daugs[0] = EvtPDL::chargeConj( getDaug( 0 ) );
         daugs[1] = EvtPDL::chargeConj( getDaug( 1 ) );
     }
 
     EvtParticle* d;
     p->initializePhaseSpace( 2, daugs );
 
     EvtComplex amp;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );    // t is c*Dt (mm)
     //  EvtIncoherentMixing::OtherB( p , t , other_b , 0.5 ) ;
 
     //if (flip) t=-t;
 
     //FS We assume DGamma=GammaLow-GammaHeavy and Dm=mHeavy-mLow
     EvtComplex expH = exp( -EvtComplex( -0.25 * m_dgamma * t, 0.5 * m_dm * t ) );
     EvtComplex expL = exp( EvtComplex( -0.25 * m_dgamma * t, 0.5 * m_dm * t ) );
     //FS Definition of gp and gm
     EvtComplex gp = 0.5 * ( expL + expH );
     EvtComplex gm = 0.5 * ( expL - expH );
     //FS Calculation os sqrt(1-z^2)
     EvtComplex sqz = sqrt( abs( 1 - m_z * m_z ) ) *
                      exp( EvtComplex( 0, arg( 1 - m_z * m_z ) / 2 ) );
 
     //EvtComplex BB=0.5*(expL+expH);                  // <B0|B0(t)>
     //EvtComplex barBB=m_qoverp*0.5*(expL-expH);       // <B0bar|B0(t)>
     //EvtComplex BbarB=m_poverq*0.5*(expL-expH);       // <B0|B0bar(t)>
     //EvtComplex barBbarB=BB;                         // <B0bar|B0bar(t)>
     //  FS redefinition of these guys... (See BAD #188 eq.35 for ref.)
     //  q/p is taken as in the BaBar Phys. Book (opposite sign wrt ref.)
     EvtComplex BB = gp + m_z * gm;             // <B0|B0(t)>
     EvtComplex barBB = sqz * m_qoverp * gm;    // <B0bar|B0(t)>
     EvtComplex BbarB = sqz * m_poverq * gm;    // <B0|B0bar(t)>
     EvtComplex barBbarB = gp - m_z * gm;       // <B0bar|B0bar(t)>
 
     if ( !flip ) {
         if ( other_b == B0B || other_b == B0Bs ) {
             //at t=0 we have a B0
             //EvtGenReport(EVTGEN_INFO,"EvtGen") << "B0B"<<endl;
             amp = BB * m_A_f + barBB * m_Abar_f;
             //std::cout << "noflip B0B tag:"<<amp<<std::endl;
             //amp=0.0;
         }
         if ( other_b == B0 || other_b == B0s ) {
             //EvtGenReport(EVTGEN_INFO,"EvtGen") << "B0"<<endl;
             amp = BbarB * m_A_f + barBbarB * m_Abar_f;
         }
     } else {
         if ( other_b == B0 || other_b == B0s ) {
             amp = BbarB * m_A_fbar + barBbarB * m_Abar_fbar;
             //std::cout << "flip B0 tag:"<<amp<<std::endl;
             //amp=0.0;
         }
         if ( other_b == B0B || other_b == B0Bs ) {
             amp = BB * m_A_fbar + barBB * m_Abar_fbar;
         }
     }
 
     EvtVector4R p4_parent = p->getP4Restframe();
 
     EvtSpinType::spintype d2type = EvtPDL::getSpinType( getDaug( 1 ) );
 
     EvtVector4R momv;
     EvtVector4R moms;
 
     if ( d2type == EvtSpinType::SCALAR ) {
         d2type = EvtPDL::getSpinType( getDaug( 0 ) );
         d = p->getDaug( 0 );
         momv = d->getP4();
         moms = p->getDaug( 1 )->getP4();
     } else {
         d = p->getDaug( 1 );
         momv = d->getP4();
         moms = p->getDaug( 0 )->getP4();
     }
 
     if ( d2type == EvtSpinType::SCALAR ) {
         vertex( amp );
     }
 
     if ( d2type == EvtSpinType::VECTOR ) {
         double norm = momv.mass() / ( momv.d3mag() * p->mass() );
 
         //std::cout << amp << " " << norm << " " << p4_parent << d->getP4()<< std::endl;
         //    std::cout << EvtPDL::name(d->getId()) << " " << EvtPDL::name(p->getDaug(0)->getId()) <<
         //  " 1and2 " << EvtPDL::name(p->getDaug(1)->getId()) << std::endl;
         //std::cout << d->eps(0) << std::endl;
         //std::cout << d->epsParent(0) << std::endl;
         vertex( 0, amp * norm * p4_parent * ( d->epsParent( 0 ) ) );
         vertex( 1, amp * norm * p4_parent * ( d->epsParent( 1 ) ) );
         vertex( 2, amp * norm * p4_parent * ( d->epsParent( 2 ) ) );
     }
 
     if ( d2type == EvtSpinType::TENSOR ) {
         double norm = d->mass() * d->mass() /
                       ( p4_parent.mass() * d->getP4().d3mag() *
                         d->getP4().d3mag() );
 
         vertex( 0, amp * norm * d->epsTensorParent( 0 ).cont1( p4_parent ) *
                        p4_parent );
         vertex( 1, amp * norm * d->epsTensorParent( 1 ).cont1( p4_parent ) *
                        p4_parent );
         vertex( 2, amp * norm * d->epsTensorParent( 2 ).cont1( p4_parent ) *
                        p4_parent );
         vertex( 3, amp * norm * d->epsTensorParent( 3 ).cont1( p4_parent ) *
                        p4_parent );
         vertex( 4, amp * norm * d->epsTensorParent( 4 ).cont1( p4_parent ) *
                        p4_parent );
     }
 
     return;
 }
 
 std::string EvtSSDCP::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "deltaM";
         case 1:
             return "deltaGammaOverGamma";
         case 2:
             return "qOverP";
         case 3:
             return "qOverPPhase";
         case 4:
             return "Af";
         case 5:
             return "AfPhase";
         case 6:
             return "Abarf";
         case 7:
             return "AbarfPhase";
         case 8:
             return "Afbar";
         case 9:
             return "AfbarPhase";
         case 10:
             return "Abarfbar";
         case 11:
             return "AbarfbarPhase";
         case 12:
             return "Z";
         case 13:
             return "ZPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSSDCP::getParamDefault( int i )
 {
     switch ( i ) {
         case 3:
             return "0.0";
         case 4:
             return "1.0";
         case 5:
             return "0.0";
         case 6:
             return "1.0";
         case 7:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSSD_DirectCP.cpp b/src/EvtGenModels/EvtSSD_DirectCP.cpp
index b4a0fb8..e224d51 100644
--- a/src/EvtGenModels/EvtSSD_DirectCP.cpp
+++ b/src/EvtGenModels/EvtSSD_DirectCP.cpp
@@ -1,292 +1,292 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSSD_DirectCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtScalarParticle.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSSD_DirectCP::getName()
+std::string EvtSSD_DirectCP::getName() const
 {
     return "SSD_DirectCP";
 }
 
-EvtDecayBase* EvtSSD_DirectCP::clone()
+EvtDecayBase* EvtSSD_DirectCP::clone() const
 {
     return new EvtSSD_DirectCP;
 }
 
 void EvtSSD_DirectCP::init()
 {
     // check that there is 1 argument and 2-body decay
 
     checkNArg( 1 );
     checkNDaug( 2 );
 
     const EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
     const EvtSpinType::spintype d2type = EvtPDL::getSpinType( getDaug( 1 ) );
 
     if ( ( !( d1type == EvtSpinType::SCALAR || d2type == EvtSpinType::SCALAR ) ) ||
          ( !( ( d2type == EvtSpinType::SCALAR ) ||
               ( d2type == EvtSpinType::VECTOR ) ||
               ( d2type == EvtSpinType::TENSOR ) ) ) ||
          ( !( ( d1type == EvtSpinType::SCALAR ) ||
               ( d1type == EvtSpinType::VECTOR ) ||
               ( d1type == EvtSpinType::TENSOR ) ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtSSD_DirectCP generator expected "
             << "one of the daugters to be a scalar, "
             << "the other either scalar, vector, or tensor, "
             << "found:" << EvtPDL::name( getDaug( 0 ) ).c_str() << " and "
             << EvtPDL::name( getDaug( 1 ) ).c_str() << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     m_acp = getArg( 0 );    // A_CP defined as A_CP = (BR(fbar)-BR(f))/(BR(fbar)+BR(f))
 }
 
 void EvtSSD_DirectCP::initProbMax()
 {
     double theProbMax = 1.;
 
     const EvtSpinType::spintype d2type = EvtPDL::getSpinType( getDaug( 1 ) );
     const EvtSpinType::spintype d1type = EvtPDL::getSpinType( getDaug( 0 ) );
 
     if ( d1type != EvtSpinType::SCALAR || d2type != EvtSpinType::SCALAR ) {
         // Create a scalar parent at rest and initialize it
         // Use noLifeTime() cludge to avoid generating random numbers
 
         EvtScalarParticle parent{};
         parent.noLifeTime();
         parent.init( getParentId(),
                      EvtVector4R( EvtPDL::getMass( getParentId() ), 0, 0, 0 ) );
         parent.setDiagonalSpinDensity();
 
         // Create daughters and initialize amplitude
         EvtAmp amp;
         EvtId daughters[2] = { getDaug( 0 ), getDaug( 1 ) };
         amp.init( getParentId(), 2, daughters );
         parent.makeDaughters( 2, daughters );
 
         const int scalarDaughterIndex = d1type == EvtSpinType::SCALAR ? 0 : 1;
         const int nonScalarDaughterIndex = d1type == EvtSpinType::SCALAR ? 1 : 0;
 
         EvtParticle* scalarDaughter = parent.getDaug( scalarDaughterIndex );
         EvtParticle* nonScalarDaughter = parent.getDaug( nonScalarDaughterIndex );
 
         scalarDaughter->noLifeTime();
         nonScalarDaughter->noLifeTime();
 
         EvtSpinDensity rho;
         rho.setDiag( parent.getSpinStates() );
 
         // Momentum of daughters in parent's frame
         const double parentMass = EvtPDL::getMass( getParentId() );
         const double sdMass = EvtPDL::getMass( getDaug( scalarDaughterIndex ) );
         const double ndMass = EvtPDL::getMass( getDaug( nonScalarDaughterIndex ) );
         const double pstar =
             sqrt( pow( parentMass, 2 ) - pow( ( sdMass + ndMass ), 2 ) ) *
             sqrt( pow( parentMass, 2 ) - pow( ( ndMass - sdMass ), 2 ) ) /
             ( 2 * parentMass );
 
         EvtVector4R p4_sd, p4_nd;
 
         const int nsteps = 16;
 
         double prob_max = 0;
         double theta_max = 0;
 
         for ( int i = 0; i <= nsteps; i++ ) {
             const double theta = i * EvtConst::pi / nsteps;
 
             p4_sd.set( sqrt( pow( pstar, 2 ) + pow( sdMass, 2 ) ), 0,
                        +pstar * sin( theta ), +pstar * cos( theta ) );
 
             p4_nd.set( sqrt( pow( pstar, 2 ) + pow( ndMass, 2 ) ), 0,
                        -pstar * sin( theta ), -pstar * cos( theta ) );
 
             scalarDaughter->init( getDaug( scalarDaughterIndex ), p4_sd );
             nonScalarDaughter->init( getDaug( nonScalarDaughterIndex ), p4_nd );
 
             calcAmp( parent, amp );
 
             const double i_prob = rho.normalizedProb( amp.getSpinDensity() );
 
             if ( i_prob > prob_max ) {
                 prob_max = i_prob;
                 theta_max = theta;
             }
         }
 
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "  - probability " << prob_max
             << " found at theta = " << theta_max << std::endl;
         theProbMax *= 1.01 * prob_max;
     }
 
     setProbMax( theProbMax );
 
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " EvtSSD_DirectCP - set up maximum probability to " << theProbMax
         << std::endl;
 }
 
 void EvtSSD_DirectCP::decay( EvtParticle* parent )
 {
     bool flip = false;
     EvtId daugs[2];
 
     // decide it is B or Bbar:
     if ( EvtRandom::Flat( 0., 1. ) < ( ( 1. - m_acp ) / 2. ) ) {
         // it is a B
         if ( EvtPDL::getStdHep( getParentId() ) < 0 )
             flip = true;
     } else {
         // it is a Bbar
         if ( EvtPDL::getStdHep( getParentId() ) > 0 )
             flip = true;
     }
 
     if ( flip ) {
         if ( ( isB0Mixed( *parent ) ) || ( isBsMixed( *parent ) ) ) {
             parent->getParent()->setId(
                 EvtPDL::chargeConj( parent->getParent()->getId() ) );
             parent->setId( EvtPDL::chargeConj( parent->getId() ) );
         } else {
             parent->setId( EvtPDL::chargeConj( parent->getId() ) );
         }
         daugs[0] = EvtPDL::chargeConj( getDaug( 0 ) );
         daugs[1] = EvtPDL::chargeConj( getDaug( 1 ) );
     } else {
         daugs[0] = getDaug( 0 );
         daugs[1] = getDaug( 1 );
     }
 
     parent->initializePhaseSpace( 2, daugs );
 
     calcAmp( *parent, m_amp2 );
 }
 
 bool EvtSSD_DirectCP::isB0Mixed( const EvtParticle& p )
 {
     if ( !( p.getParent() ) )
         return false;
 
     static const EvtId B0 = EvtPDL::getId( "B0" );
     static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     if ( ( p.getId() != B0 ) && ( p.getId() != B0B ) )
         return false;
 
     if ( ( p.getParent()->getId() == B0 ) || ( p.getParent()->getId() == B0B ) )
         return true;
 
     return false;
 }
 
 bool EvtSSD_DirectCP::isBsMixed( const EvtParticle& p )
 {
     if ( !( p.getParent() ) )
         return false;
 
     static const EvtId BS0 = EvtPDL::getId( "B_s0" );
     static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
 
     if ( ( p.getId() != BS0 ) && ( p.getId() != BSB ) )
         return false;
 
     if ( ( p.getParent()->getId() == BS0 ) || ( p.getParent()->getId() == BSB ) )
         return true;
 
     return false;
 }
 
 std::string EvtSSD_DirectCP::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "ACP";
         default:
             return "";
     }
 }
 
 void EvtSSD_DirectCP::calcAmp( const EvtParticle& parent, EvtAmp& amp ) const
 {
     const EvtSpinType::spintype d1type = EvtPDL::getSpinType(
         parent.getDaug( 0 )->getId() );
     const EvtSpinType::spintype d2type = EvtPDL::getSpinType(
         parent.getDaug( 1 )->getId() );
 
     if ( d1type == EvtSpinType::SCALAR && d2type == EvtSpinType::SCALAR ) {
         amp.vertex( 1. );
         return;
     }
 
     const EvtVector4R p4_parent = parent.getP4Restframe();
 
     const int nonScalarDaughterIndex = d1type == EvtSpinType::SCALAR ? 1 : 0;
 
     const EvtParticle& daughter = *parent.getDaug( nonScalarDaughterIndex );
 
     const EvtSpinType::spintype nonScalarType = EvtPDL::getSpinType(
         daughter.getId() );
 
     if ( nonScalarType == EvtSpinType::VECTOR ) {
         const EvtVector4R momv = daughter.getP4();
         const double norm = momv.mass() / ( momv.d3mag() * parent.mass() );
 
         amp.vertex( 0, norm * p4_parent * ( daughter.epsParent( 0 ) ) );
         amp.vertex( 1, norm * p4_parent * ( daughter.epsParent( 1 ) ) );
         amp.vertex( 2, norm * p4_parent * ( daughter.epsParent( 2 ) ) );
 
     }
 
     // This is for the EvtSpinType::TENSOR case.
     else {
         const double norm = daughter.mass() * daughter.mass() /
                             ( p4_parent.mass() * daughter.getP4().d3mag() *
                               daughter.getP4().d3mag() );
 
         amp.vertex( 0, norm * daughter.epsTensorParent( 0 ).cont1( p4_parent ) *
                            p4_parent );
         amp.vertex( 1, norm * daughter.epsTensorParent( 1 ).cont1( p4_parent ) *
                            p4_parent );
         amp.vertex( 2, norm * daughter.epsTensorParent( 2 ).cont1( p4_parent ) *
                            p4_parent );
         amp.vertex( 3, norm * daughter.epsTensorParent( 3 ).cont1( p4_parent ) *
                            p4_parent );
         amp.vertex( 4, norm * daughter.epsTensorParent( 4 ).cont1( p4_parent ) *
                            p4_parent );
     }
 }
diff --git a/src/EvtGenModels/EvtSSSCP.cpp b/src/EvtGenModels/EvtSSSCP.cpp
index d614155..6c620bc 100644
--- a/src/EvtGenModels/EvtSSSCP.cpp
+++ b/src/EvtGenModels/EvtSSSCP.cpp
@@ -1,138 +1,138 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSSSCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSSSCP::getName()
+std::string EvtSSSCP::getName() const
 {
     return "SSS_CP";
 }
 
-EvtDecayBase* EvtSSSCP::clone()
+EvtDecayBase* EvtSSSCP::clone() const
 {
     return new EvtSSSCP;
 }
 
 void EvtSSSCP::init()
 {
     // check that there are 7 arguments
     checkNArg( 7 );
     checkNDaug( 2 );
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtSSSCP::initProbMax()
 {
     //This is probably not quite right, but it should do as a start...
     //Anders
 
     setProbMax( 2 * ( getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 ) ) );
 }
 
 void EvtSSSCP::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex amp;
 
     EvtComplex A, Abar;
 
     A = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
                     getArg( 3 ) * sin( getArg( 4 ) ) );
     Abar = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
                        getArg( 5 ) * sin( getArg( 6 ) ) );
 
     if ( other_b == B0B ) {
         amp = A * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               EvtComplex( cos( -2.0 * getArg( 0 ) ), sin( -2.0 * getArg( 0 ) ) ) *
                   getArg( 2 ) * EvtComplex( 0.0, 1.0 ) * Abar *
                   sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     }
     if ( other_b == B0 ) {
         amp = A * EvtComplex( cos( 2.0 * getArg( 0 ) ), sin( 2.0 * getArg( 0 ) ) ) *
                   EvtComplex( 0.0, 1.0 ) *
                   sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               getArg( 2 ) * Abar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     }
 
     vertex( amp );
 
     return;
 }
 
 std::string EvtSSSCP::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "weakPhase";
         case 1:
             return "deltaM";
         case 2:
             return "finalStateCP";
         case 3:
             return "Af";
         case 4:
             return "AfPhase";
         case 5:
             return "Abarf";
         case 6:
             return "AbarfPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSSSCP::getParamDefault( int i )
 {
     switch ( i ) {
         case 3:
             return "1.0";
         case 4:
             return "0.0";
         case 5:
             return "1.0";
         case 6:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSSSCPT.cpp b/src/EvtGenModels/EvtSSSCPT.cpp
index 3ea8fa6..734c992 100644
--- a/src/EvtGenModels/EvtSSSCPT.cpp
+++ b/src/EvtGenModels/EvtSSSCPT.cpp
@@ -1,103 +1,103 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSSSCPT.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSSSCPT::getName()
+std::string EvtSSSCPT::getName() const
 {
     return "SSS_CPT";
 }
 
-EvtDecayBase* EvtSSSCPT::clone()
+EvtDecayBase* EvtSSSCPT::clone() const
 {
     return new EvtSSSCPT;
 }
 
 void EvtSSSCPT::init()
 {
     // check that there are 8 arguments
     checkNArg( 8 );
     checkNDaug( 2 );
 
     // Set amplitude coeffs
     setAmpCoeffs();
 }
 
 void EvtSSSCPT::setAmpCoeffs()
 {
     m_P = EvtComplex( cos( -getArg( 0 ) ), sin( -getArg( 0 ) ) );
     m_Q = EvtComplex( cos( getArg( 0 ) ), sin( getArg( 0 ) ) );
     m_D = EvtComplex( getArg( 6 ) * cos( getArg( 7 ) ),
                       getArg( 6 ) * sin( getArg( 7 ) ) );
     m_Im = EvtComplex( 0.0, 1.0 );
 
     m_A = EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                       getArg( 2 ) * sin( getArg( 3 ) ) );
     m_Abar = EvtComplex( getArg( 4 ) * cos( getArg( 5 ) ),
                          getArg( 4 ) * sin( getArg( 5 ) ) );
 }
 
 void EvtSSSCPT::initProbMax()
 {
     const double maxProb = 2.0 * abs2( m_A ) + 4.0 * abs2( m_Abar ) * abs2( m_D );
     setProbMax( maxProb );
 }
 
 void EvtSSSCPT::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex amp;
 
     if ( other_b == B0B ) {
         amp = m_A * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               m_Im * sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) *
                   ( m_Q / m_P * m_A + 2.0 * m_D * m_Abar );
     }
     if ( other_b == B0 ) {
         amp = m_Abar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               m_Im * sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) *
                   ( m_P / m_Q * m_A - 2.0 * m_D * m_Abar );
     }
 
     vertex( amp );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSSSCPpng.cpp b/src/EvtGenModels/EvtSSSCPpng.cpp
index a425180..c2c266b 100644
--- a/src/EvtGenModels/EvtSSSCPpng.cpp
+++ b/src/EvtGenModels/EvtSSSCPpng.cpp
@@ -1,166 +1,166 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSSSCPpng.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSSSCPpng::getName()
+std::string EvtSSSCPpng::getName() const
 {
     return "SSS_CP_PNG";
 }
 
-EvtDecayBase* EvtSSSCPpng::clone()
+EvtDecayBase* EvtSSSCPpng::clone() const
 {
     return new EvtSSSCPpng;
 }
 
 void EvtSSSCPpng::init()
 {
     // check that there are 7 arguments
     checkNArg( 7 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtSSSCPpng::initProbMax()
 {
     const double ASq = getArg( 5 ) * getArg( 5 ) + getArg( 6 ) * getArg( 6 );
     const double max = ASq * ( 1.0 + getArg( 4 ) * getArg( 4 ) );
     setProbMax( max );
 }
 
 void EvtSSSCPpng::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex amp;
 
     EvtComplex A, Abar;
     //EvtComplex ACC, AbarCC;
 
     // assume single (top) quark dominance for the penguin.
 
     // old: a0=alpha, a1=dm, a2=1, a3=1, a4=0, a5=1, a6=0
     // new: a0=beta, a1=gamma, a2=delta, a3=dm, a4=1, a5=1=A_{T}, a6=A_{P}/A_{T}
 
     // e.g., for B -> pi pi
     // A_{T} = |V_{ub} V_{ud}| T
     // A_{P} = |V_{tb} V_{td}| P
     // P and T are purely hadronic matrix elements
     // P/T = 0.055, A_{P}/A_{T} = 0.2 (see Marrocchesi and Paver, hep-ph/9702353)
 
     // A = A_{T}( exp(i(beta+gamma)) + (A_{P}/A_{T}) exp(i(delta))
     // A_bar = same, except for the sign of the weak phases
     // here, delta = delta_{p}-delta_{t} (rel. strong phase)
 
     A = getArg( 5 ) *
         ( EvtComplex( cos( -getArg( 0 ) - getArg( 1 ) ),
                       sin( -getArg( 0 ) - getArg( 1 ) ) ) +
           getArg( 6 ) * EvtComplex( cos( getArg( 2 ) ), sin( getArg( 2 ) ) ) );
 
     Abar = getArg( 5 ) * ( EvtComplex( cos( getArg( 0 ) + getArg( 1 ) ),
                                        sin( getArg( 0 ) + getArg( 1 ) ) ) +
                            getArg( 6 ) * EvtComplex( cos( getArg( 2 ) ),
                                                      sin( getArg( 2 ) ) ) );
 
     // get fraction of B0 tags with these amplitudes
 
     //double xd = 0.65;
     const double ratio = 1 / ( 1 + 0.65 * 0.65 );
 
     EvtComplex rf, rbarf;
 
     rf = EvtComplex( cos( 2.0 * getArg( 0 ) ), sin( 2.0 * getArg( 0 ) ) ) *
          Abar / A;
     rbarf = EvtComplex( 1.0 ) / rf;
 
     const double A2 = real( A ) * real( A ) + imag( A ) * imag( A );
     const double Abar2 = real( Abar ) * real( Abar ) +
                          imag( Abar ) * imag( Abar );
 
     const double rf2 = real( rf ) * real( rf ) + imag( rf ) * imag( rf );
     const double rbarf2 = real( rbarf ) * real( rbarf ) +
                           imag( rbarf ) * imag( rbarf );
 
     //fraction of B0 _tags_
     const double fract = ( Abar2 * ( 1 + rbarf2 + ( 1 - rbarf2 ) * ratio ) ) /
                          ( Abar2 * ( 1 + rbarf2 + ( 1 - rbarf2 ) * ratio ) +
                            A2 * ( 1 + rf2 + ( 1 - rf2 ) * ratio ) );
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, fract );
 
     //this method works just as well -- NK
     //randomly generate the tag (B0 or B0B)
 
     //  double tag = EvtRandom::Flat(0.0,1.0);
     //  if (tag < 0.5) {
     //
     //   EvtCPUtil::OtherB(p,t,other_b,1.0);
     //   other_b = B0;
     //  }
     //  else {
     //
     //   EvtCPUtil::OtherB(p,t,other_b,0.0);
     //   other_b = B0B;
     //  }
 
     //mixing angle = -beta
 
     if ( other_b == B0B ) {
         amp = A * cos( getArg( 3 ) * t / ( 2 * EvtConst::c ) ) +
               EvtComplex( cos( 2.0 * getArg( 0 ) ), sin( 2.0 * getArg( 0 ) ) ) *
                   getArg( 4 ) * EvtComplex( 0.0, 1.0 ) * Abar *
                   sin( getArg( 3 ) * t / ( 2 * EvtConst::c ) );
     }
     if ( other_b == B0 ) {
         amp = A *
                   EvtComplex( cos( -2.0 * getArg( 0 ) ),
                               sin( -2.0 * getArg( 0 ) ) ) *
                   EvtComplex( 0.0, 1.0 ) *
                   sin( getArg( 3 ) * t / ( 2 * EvtConst::c ) ) +
               getArg( 4 ) * Abar * cos( getArg( 3 ) * t / ( 2 * EvtConst::c ) );
     }
 
     vertex( amp );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSTS.cpp b/src/EvtGenModels/EvtSTS.cpp
index 4594005..2f6eb1f 100644
--- a/src/EvtGenModels/EvtSTS.cpp
+++ b/src/EvtGenModels/EvtSTS.cpp
@@ -1,83 +1,83 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSTS.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSTS::getName()
+std::string EvtSTS::getName() const
 {
     return "STS";
 }
 
-EvtDecayBase* EvtSTS::clone()
+EvtDecayBase* EvtSTS::clone() const
 {
     return new EvtSTS;
 }
 
 void EvtSTS::initProbMax()
 {
     setProbMax( 20.0 );
 }
 
 void EvtSTS::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::TENSOR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtSTS::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle* t1 = p->getDaug( 0 );
 
     EvtVector4R momt = t1->getP4();
     EvtVector4R moms = p->getDaug( 1 )->getP4();
     double masst = t1->mass();
 
     EvtVector4R p4_parent = momt + moms;
 
     double norm = masst * masst /
                   ( p4_parent.mass() * momt.d3mag() * momt.d3mag() );
 
     vertex( 0, norm * t1->epsTensorParent( 0 ).cont1( p4_parent ) * p4_parent );
     vertex( 1, norm * t1->epsTensorParent( 1 ).cont1( p4_parent ) * p4_parent );
     vertex( 2, norm * t1->epsTensorParent( 2 ).cont1( p4_parent ) * p4_parent );
     vertex( 3, norm * t1->epsTensorParent( 3 ).cont1( p4_parent ) * p4_parent );
     vertex( 4, norm * t1->epsTensorParent( 4 ).cont1( p4_parent ) * p4_parent );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSTSCP.cpp b/src/EvtGenModels/EvtSTSCP.cpp
index 08ef025..d24131b 100644
--- a/src/EvtGenModels/EvtSTSCP.cpp
+++ b/src/EvtGenModels/EvtSTSCP.cpp
@@ -1,162 +1,162 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSTSCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSTSCP::getName()
+std::string EvtSTSCP::getName() const
 {
     return "STS_CP";
 }
 
 void EvtSTSCP::initProbMax()
 {
     //This is probably not quite right, but it should do as a start...
     //Anders
 
     setProbMax( 20 * ( getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 ) ) );
 }
 
-EvtDecayBase* EvtSTSCP::clone()
+EvtDecayBase* EvtSTSCP::clone() const
 {
     return new EvtSTSCP;
 }
 
 void EvtSTSCP::init()
 {
     // check that there are 7 arguments
     checkNArg( 7 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::TENSOR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtSTSCP::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtParticle* t1;
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     t1 = p->getDaug( 0 );
     EvtVector4R momt = t1->getP4();
     EvtVector4R moms = p->getDaug( 1 )->getP4();
     double masst = t1->mass();
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     EvtComplex amp;
 
     EvtComplex A, Abar;
 
     A = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
                     getArg( 3 ) * sin( getArg( 4 ) ) );
     Abar = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
                        getArg( 5 ) * sin( getArg( 6 ) ) );
 
     if ( other_b == B0B ) {
         amp = A * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               EvtComplex( cos( -2.0 * getArg( 0 ) ), sin( -2.0 * getArg( 0 ) ) ) *
                   getArg( 2 ) * EvtComplex( 0.0, 1.0 ) * Abar *
                   sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     }
     if ( other_b == B0 ) {
         amp = A * EvtComplex( cos( 2.0 * getArg( 0 ) ), sin( 2.0 * getArg( 0 ) ) ) *
                   EvtComplex( 0.0, 1.0 ) *
                   sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               getArg( 2 ) * Abar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     }
 
     EvtVector4R p4_parent;
 
     p4_parent = momt + moms;
 
     double norm = masst * masst / ( p->mass() * momt.d3mag() * momt.d3mag() );
 
     vertex( 0, amp * norm * t1->epsTensorParent( 0 ).cont1( p4_parent ) *
                    p4_parent );
     vertex( 1, amp * norm * t1->epsTensorParent( 1 ).cont1( p4_parent ) *
                    p4_parent );
     vertex( 2, amp * norm * t1->epsTensorParent( 2 ).cont1( p4_parent ) *
                    p4_parent );
     vertex( 3, amp * norm * t1->epsTensorParent( 3 ).cont1( p4_parent ) *
                    p4_parent );
     vertex( 4, amp * norm * t1->epsTensorParent( 4 ).cont1( p4_parent ) *
                    p4_parent );
 
     return;
 }
 
 std::string EvtSTSCP::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "weakPhase";
         case 1:
             return "deltaM";
         case 2:
             return "finalStateCP";
         case 3:
             return "Af";
         case 4:
             return "AfPhase";
         case 5:
             return "Abarf";
         case 6:
             return "AbarfPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSTSCP::getParamDefault( int i )
 {
     switch ( i ) {
         case 3:
             return "1.0";
         case 4:
             return "0.0";
         case 5:
             return "1.0";
         case 6:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSVP.cpp b/src/EvtGenModels/EvtSVP.cpp
index d5088ef..b7d06e8 100644
--- a/src/EvtGenModels/EvtSVP.cpp
+++ b/src/EvtGenModels/EvtSVP.cpp
@@ -1,186 +1,186 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVP.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <cmath>
 
-std::string EvtSVP::getName()
+std::string EvtSVP::getName() const
 {
     return "SVP";
 }
 
-EvtDecayBase* EvtSVP::clone()
+EvtDecayBase* EvtSVP::clone() const
 {
     return new EvtSVP;
 }
 
 void EvtSVP::decay_2body( EvtParticle* root )
 {
     root->initializePhaseSpace( getNDaug(), getDaugs() );
     // Photon is the first particle and psi is the second
     // to ensure decay file backwards compatibility
     EvtParticle* photon = root->getDaug( 0 );
     EvtParticle* psi = root->getDaug( 1 );
 
     EvtVector4R p = psi->getP4(),    // psi momentum
         k = photon->getP4();         // Photon momentum
 
     bool validAmp( true );
 
     double kp = k * p;
     if ( fabs( kp ) < 1e-10 ) {
         validAmp = false;
     }
 
     for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
         EvtVector4C epsPsi = psi->epsParent( iPsi ).conj();
         for ( int iGamma = 0; iGamma < 2; iGamma++ ) {
             EvtVector4C epsGamma = photon->epsParentPhoton( iGamma ).conj();
             EvtComplex amp( 0.0, 0.0 );
             if ( validAmp ) {
                 amp = ( epsPsi * epsGamma ) -
                       ( epsPsi * k ) * ( epsGamma * p ) / kp;
             }
             vertex( iGamma, iPsi, amp );
         }
     }
 }
 
 void EvtSVP::decay_3body( EvtParticle* root )
 {
     root->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtParticle* psi = root->getDaug( 0 );
     EvtParticle* mup = root->getDaug( 1 );
     EvtParticle* mum = root->getDaug( 2 );
 
     EvtVector4R p = psi->getP4(),    // psi momentum
         k1 = mup->getP4(),           // mu+ momentum
         k2 = mum->getP4(),           // mu- momentum
         k = k1 + k2;                 // photon momentum
 
     double kSq = k * k;
 
     // The decay amplitude needs four-vector products. Make sure we have
     // valid values for these, otherwise set the amplitude to zero.
     // We need to set _amp2 (EvtDecayAmp) via the vertex() function call
     // even when the amplitude is zero, otherwise the amplitude from the
     // previous accepted event will be used, potentially leading to biases
 
     // Selection on k^2 to avoid inefficient generation for the electron modes
     bool validAmp( true );
     if ( kSq < 1e-3 ) {
         validAmp = false;
     }
 
     // Extra checks to make sure we are not dividing by zero
     double kp = k * p;
     if ( fabs( kp ) < 1e-10 ) {
         validAmp = false;
     }
 
     double dSq = m_delta * m_delta;
     double dSqDenom = dSq - kSq;
     if ( fabs( dSqDenom ) < 1e-10 ) {
         validAmp = false;
     }
 
     double factor( 1.0 );
     if ( validAmp ) {
         factor = dSq / ( dSqDenom * kSq );
     }
 
     // Calculate the amplitude terms, looping over the psi and lepton states
     for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
         EvtVector4C epsPsi = psi->epsParent( iPsi ).conj();
 
         for ( int iMplus = 0; iMplus < 2; iMplus++ ) {
             EvtDiracSpinor spMplus = mup->spParent( iMplus );
 
             for ( int iMminus = 0; iMminus < 2; iMminus++ ) {
                 EvtDiracSpinor spMminus = mum->spParent( iMminus );
                 EvtVector4C epsGamma = EvtLeptonVCurrent( spMplus, spMminus );
                 EvtComplex amp( 0.0, 0.0 );
                 if ( validAmp ) {
                     amp = ( epsPsi * epsGamma ) -
                           ( epsPsi * k ) * ( epsGamma * p ) / kp;
                 }
                 amp *= factor;
 
                 // Set the amplitude matrix element using the vertex function
                 vertex( iPsi, iMplus, iMminus, amp );
             }
         }
     }
 }
 
 void EvtSVP::decay( EvtParticle* root )
 {
     if ( getNDaug() == 2 ) {
         decay_2body( root );
     } else if ( getNDaug() == 3 ) {
         decay_3body( root );
     }
 }
 
 void EvtSVP::init()
 {
     checkSpinParent( EvtSpinType::SCALAR );
 
     if ( getNDaug() == 2 ) {    // chi -> gamma psi radiative mode
         checkNArg( 0 );
         checkNDaug( 2 );
         checkSpinDaughter( 0, EvtSpinType::PHOTON );
         checkSpinDaughter( 1, EvtSpinType::VECTOR );
 
     } else if ( getNDaug() == 3 ) {    // chi -> psi lepton lepton
         checkSpinParent( EvtSpinType::SCALAR );
         checkSpinDaughter( 0, EvtSpinType::VECTOR );
         checkSpinDaughter( 1, EvtSpinType::DIRAC );
         checkSpinDaughter( 2, EvtSpinType::DIRAC );
         checkNArg( 1 );
         m_delta = getArg( 0 );
     }
 }
 
 void EvtSVP::initProbMax()
 {
     if ( getNDaug() == 2 ) {
         setProbMax( 2.2 );
 
     } else if ( getNDaug() == 3 ) {
         const EvtId daugId = getDaug( 1 );
 
         if ( daugId == EvtPDL::getId( "mu+" ) ||
              daugId == EvtPDL::getId( "mu-" ) ) {
             setProbMax( 130.0 );
         } else if ( daugId == EvtPDL::getId( "e+" ) ||
                     daugId == EvtPDL::getId( "e-" ) ) {
             setProbMax( 4100.0 );
         }
     }
 }
diff --git a/src/EvtGenModels/EvtSVPCP.cpp b/src/EvtGenModels/EvtSVPCP.cpp
index 6a45d9f..f00ad78 100644
--- a/src/EvtGenModels/EvtSVPCP.cpp
+++ b/src/EvtGenModels/EvtSVPCP.cpp
@@ -1,204 +1,204 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVPCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor3C.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVPCP::getName()
+std::string EvtSVPCP::getName() const
 {
     return "SVP_CP";
 }
 
-EvtDecayBase* EvtSVPCP::clone()
+EvtDecayBase* EvtSVPCP::clone() const
 {
     return new EvtSVPCP;
 }
 
 void EvtSVPCP::initProbMax()
 {
     setProbMax( 2 * ( getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 ) ) );
 }
 
 void EvtSVPCP::init()
 {
     // check that there are 7 arguments
     checkNArg( 7 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::PHOTON );
 }
 
 void EvtSVPCP::decay( EvtParticle* p )
 {
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     EvtComplex G1P, G1M, G1_T_even, G1_T_odd;
 
     double norm = getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 );
 
     G1P = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ) / norm,
                       getArg( 3 ) * sin( getArg( 4 ) ) / norm );
     G1M = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ) / norm,
                       getArg( 5 ) * sin( getArg( 6 ) ) / norm );
 
     G1_T_even = ( G1P + G1M ) / sqrt( 2.0 );
     G1_T_odd = ( G1P - G1M ) / sqrt( 2.0 );
 
     EvtComplex lambda_km = EvtComplex( cos( -2 * getArg( 0 ) ),
                                        sin( -2 * getArg( 0 ) ) );
 
     double cdmt = cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     double sdmt = sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
 
     EvtComplex cG1_T_even, cG1_T_odd;
 
     if ( other_b == B0B ) {
         cG1_T_even = G1_T_even *
                      ( cdmt + lambda_km * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1_T_odd = G1_T_odd *
                     ( cdmt - lambda_km * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
     }
     if ( other_b == B0 ) {
         cG1_T_even = G1_T_even *
                      ( cdmt + ( 1.0 / lambda_km ) *
                                   EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1_T_odd = -G1_T_odd *
                     ( cdmt - ( 1.0 / lambda_km ) *
                                  EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
     }
 
     EvtComplex hp, hm, h0;
 
     // This part is adopted from EvtSVVHel and since there is
     // a photon that can not have helicity 0 this is put in by
     // setting the h0 amplitude to 0.
     hm = ( cG1_T_even - cG1_T_odd ) / sqrt( 2.0 );
     hp = ( cG1_T_even + cG1_T_odd ) / sqrt( 2.0 );
     h0 = EvtComplex( 0.0, 0.0 );
 
     EvtParticle *v1, *ph;
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     v1 = p->getDaug( 0 );
     ph = p->getDaug( 1 );
     EvtVector4R momv1 = v1->getP4();
     EvtVector4R momph = ph->getP4();
 
     EvtTensor4C d, g;
 
     g.setdiag( 1.0, -1.0, -1.0, -1.0 );
 
     EvtVector4R v, vp;
 
     v = momv1 / momv1.d3mag();
     vp = ( momv1 + momph ) / ( momv1 + momph ).mass();
 
     d = ( ( 1.0 / sqrt( 3.0 ) ) * ( h0 - ( hp + hm ) ) * ( -1.0 / sqrt( 3.0 ) ) ) *
             g +
         ( ( 1.0 / sqrt( 2.0 ) ) * ( hp - hm ) * EvtComplex( 0.0, 1.0 ) *
           ( sqrt( 1.0 / 2.0 ) ) ) *
             dual( EvtGenFunctions::directProd( v, vp ) ) +
         ( sqrt( 2.0 / 3.0 ) * ( h0 + 0.5 * ( hp + hm ) ) * sqrt( 3.0 / 2.0 ) ) *
             ( EvtGenFunctions::directProd( v, v ) + ( 1.0 / 3.0 ) * g );
 
     EvtVector4C ep0, ep1, ep2;
 
     ep0 = d.cont1( v1->eps( 0 ).conj() );
     ep1 = d.cont1( v1->eps( 1 ).conj() );
     ep2 = d.cont1( v1->eps( 2 ).conj() );
 
     EvtVector4C ep20, ep21, ep22;
 
     ep20 = ph->epsParentPhoton( 0 ).conj();
     ep21 = ph->epsParentPhoton( 1 ).conj();
 
     vertex( 0, 0, ep0 * ep20 );
     vertex( 0, 1, ep0 * ep21 );
 
     vertex( 1, 0, ep1 * ep20 );
     vertex( 1, 1, ep1 * ep21 );
 
     vertex( 2, 0, ep2 * ep20 );
     vertex( 2, 1, ep2 * ep21 );
 
     return;
 }
 
 std::string EvtSVPCP::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "weakPhase";
         case 1:
             return "deltaM";
         case 2:
             return "finalStateCP";
         case 3:
             return "Af";
         case 4:
             return "AfPhase";
         case 5:
             return "Abarf";
         case 6:
             return "AbarfPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSVPCP::getParamDefault( int i )
 {
     switch ( i ) {
         case 3:
             return "1.0";
         case 4:
             return "0.0";
         case 5:
             return "1.0";
         case 6:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSVPHelAmp.cpp b/src/EvtGenModels/EvtSVPHelAmp.cpp
index ce8223e..86b47e6 100644
--- a/src/EvtGenModels/EvtSVPHelAmp.cpp
+++ b/src/EvtGenModels/EvtSVPHelAmp.cpp
@@ -1,129 +1,129 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVPHelAmp.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor3C.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector3C.hh"
 #include "EvtGenBase/EvtVector3R.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVPHelAmp::getName()
+std::string EvtSVPHelAmp::getName() const
 {
     return "SVP_HELAMP";
 }
 
-EvtDecayBase* EvtSVPHelAmp::clone()
+EvtDecayBase* EvtSVPHelAmp::clone() const
 {
     return new EvtSVPHelAmp;
 }
 
 void EvtSVPHelAmp::initProbMax()
 {
     setProbMax( 2.0 * ( getArg( 0 ) * getArg( 0 ) + getArg( 2 ) * getArg( 2 ) ) );
 }
 
 void EvtSVPHelAmp::init()
 {
     // check that there are 4 arguments
     checkNArg( 4 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::PHOTON );
 }
 
 void EvtSVPHelAmp::decay( EvtParticle* p )
 {
     SVPHel( p, m_amp2, getDaug( 0 ), getDaug( 1 ),
             EvtComplex( getArg( 0 ) * cos( getArg( 1 ) ),
                         getArg( 0 ) * sin( getArg( 1 ) ) ),
             EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                         getArg( 2 ) * sin( getArg( 3 ) ) ) );
 
     return;
 }
 
 void EvtSVPHelAmp::SVPHel( EvtParticle* parent, EvtAmp& amp, EvtId n_v1,
                            EvtId n_v2, const EvtComplex& hp, const EvtComplex& hm )
 {
     //  Routine to decay a vector into a vector and scalar.  Started
     //  by ryd on Oct 17, 1996.
 
     // This routine is adopted from EvtSVVHel and since there is
     // a photon that can not have helicity 0 this is put in by
     // setting the h0 amplitude to 0.
     EvtComplex h0 = EvtComplex( 0.0, 0.0 );
 
     int tndaug = 2;
     EvtId tdaug[2];
     tdaug[0] = n_v1;
     tdaug[1] = n_v2;
 
     parent->initializePhaseSpace( tndaug, tdaug );
 
     EvtParticle *v1, *v2;
     v1 = parent->getDaug( 0 );
     v2 = parent->getDaug( 1 );
 
     EvtVector4R momv1 = v1->getP4();
 
     EvtVector3R v1dir( momv1.get( 1 ), momv1.get( 2 ), momv1.get( 3 ) );
     v1dir = v1dir / v1dir.d3mag();
 
     EvtComplex a = -0.5 * ( hp + hm );
     EvtComplex b = EvtComplex( 0.0, 0.5 ) * ( hp - hm );
     EvtComplex c = h0 + 0.5 * ( hp + hm );
 
     EvtTensor3C M = a * EvtTensor3C::id() + b * EvtGenFunctions::eps( v1dir ) +
                     c * EvtGenFunctions::directProd( v1dir, v1dir );
 
     EvtVector3C t0 = M.cont1( v1->eps( 0 ).vec().conj() );
     EvtVector3C t1 = M.cont1( v1->eps( 1 ).vec().conj() );
     EvtVector3C t2 = M.cont1( v1->eps( 2 ).vec().conj() );
 
     EvtVector3C eps0 = v2->epsParentPhoton( 0 ).vec().conj();
     EvtVector3C eps1 = v2->epsParentPhoton( 1 ).vec().conj();
 
     amp.vertex( 0, 0, t0 * eps0 );
     amp.vertex( 0, 1, t0 * eps1 );
     //amp.vertex(0,2,t1*eps0*0.);
 
     amp.vertex( 1, 0, t1 * eps0 );
     amp.vertex( 1, 1, t1 * eps1 );
     //amp.vertex(1,2,t1*eps0*0.);
 
     amp.vertex( 2, 0, t2 * eps0 );
     amp.vertex( 2, 1, t2 * eps1 );
     //amp.vertex(2,2,t1*eps0*0.);
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSVPHelCPMix.cpp b/src/EvtGenModels/EvtSVPHelCPMix.cpp
index 7da5cfb..7607031 100644
--- a/src/EvtGenModels/EvtSVPHelCPMix.cpp
+++ b/src/EvtGenModels/EvtSVPHelCPMix.cpp
@@ -1,152 +1,153 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVPHelCPMix.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtSVPHelAmp.hh"
 
 #include <iostream>
 #include <stdlib.h>
 
-std::string EvtSVPHelCPMix::getName()
+std::string EvtSVPHelCPMix::getName() const
 {
     return "SVPHELCPMIX";
 }
 
-EvtDecayBase* EvtSVPHelCPMix::clone()
+EvtDecayBase* EvtSVPHelCPMix::clone() const
 {
     return new EvtSVPHelCPMix;
 }
 
 void EvtSVPHelCPMix::init()
 {
     // check that there are 5 arguments
     checkNArg( 5 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::PHOTON );
 }
 
 void EvtSVPHelCPMix::initProbMax()
 {
     setProbMax( 2.0 * ( getArg( 0 ) * getArg( 0 ) + getArg( 2 ) * getArg( 2 ) ) );
 }
 
 void EvtSVPHelCPMix::decay( EvtParticle* p )
 {
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
-    //static EvtId BSB = EvtPDL::getId("anti-B_s0");
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+    //static const EvtId BSB = EvtPDL::getId("anti-B_s0");
 
     //Flavour tagging of the initial state. Note that flavour mixing has already been applied out of this model
     //Initial_state == 0 (Bs at the initial state) and Initial_state == 1 (Anti-Bs in the initial state)
     int Initial_state( -1 );
     if ( EvtCPUtil::getInstance()->isBsMixed(
              p ) ) {    //The decaying particle has suffered flavour mixing, thus the initial state is its antiparticle
         if ( p->getId() == BS0 ) {
             Initial_state = 1;
         } else {
             Initial_state = 0;
         }
     } else {    //The decaying particle has NOT suffered flavour mixing, thus the initial state is itself
         if ( p->getId() == BS0 ) {
             Initial_state = 0;
         } else {
             Initial_state = 1;
         }
     }
 
-    static EvtId BSH = EvtPDL::getId( "B_s0H" );
-    static double ctauH = EvtPDL::getctau( BSH );
-    static double gammaH = 1.0 / ctauH;
+    static const EvtId BSH = EvtPDL::getId( "B_s0H" );
+    static const double ctauH = EvtPDL::getctau( BSH );
+    static const double gammaH = 1.0 / ctauH;
 
-    static double deltaGamma = EvtCPUtil::getInstance()->getDeltaGamma( BS0 );
+    static const double deltaGamma = EvtCPUtil::getInstance()->getDeltaGamma(
+        BS0 );
 
     //Here we're gonna generate and set the "envelope" lifetime, so we take the longest living component (for positive deltaGamma: tauH)
     //t is initialized following a e^(gammaH*t) lifetime distribution. When computing the amplitudes a factor e^(gammaH*t/2) should be substracted.
     double t = -log( EvtRandom::Flat() ) *
                ( 1.0 / gammaH );    //This overrules the lifetimes made by the program performing the mixing (CPUtil)
     if ( EvtCPUtil::getInstance()->isBsMixed( p ) ) {
         p->getParent()->setLifetime( t );
     } else {
         p->setLifetime( t );
     }
 
-    static double deltaMs = EvtCPUtil::getInstance()->getDeltaM( BS0 );
+    static const double deltaMs = EvtCPUtil::getInstance()->getDeltaM( BS0 );
     double mt = exp( -std::max( 0.0, deltaGamma ) * t / ( 2.0 * EvtConst::c ) );
     double pt = exp( +std::min( 0.0, deltaGamma ) * t / ( 2.0 * EvtConst::c ) );
 
     //Using the same sign convention as in J.P. Silva, hep-ph/0410351 (2004)
     EvtComplex qp = EvtComplex( cos( -2.0 * getArg( 4 ) ),
                                 sin( -2.0 * getArg( 4 ) ) );    // q/p=e^(-2*beta_s)
     EvtComplex gplus =
         ( mt * EvtComplex( cos( deltaMs * t / ( 2.0 * EvtConst::c ) ),
                            sin( deltaMs * t / ( 2.0 * EvtConst::c ) ) ) +
           pt * EvtComplex( cos( deltaMs * t / ( 2.0 * EvtConst::c ) ),
                            sin( -deltaMs * t / ( 2.0 * EvtConst::c ) ) ) ) /
         2.0;
     EvtComplex gminus =
         ( +mt * EvtComplex( cos( deltaMs * t / ( 2.0 * EvtConst::c ) ),
                             sin( deltaMs * t / ( 2.0 * EvtConst::c ) ) ) -
           pt * EvtComplex( cos( deltaMs * t / ( 2.0 * EvtConst::c ) ),
                            sin( -deltaMs * t / ( 2.0 * EvtConst::c ) ) ) ) /
         2.0;
 
     //These should be filled with the helicity amplitudes at t=0
     EvtComplex arg_hm, arg_hp;
     arg_hp = EvtComplex( getArg( 0 ) * cos( getArg( 1 ) ),
                          getArg( 0 ) * sin( getArg( 1 ) ) );
     arg_hm = EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                          getArg( 2 ) * sin( getArg( 3 ) ) );
 
     //Time-dependent amplitudes H+(t) and H-(t) are computed for a Bs and Anti-Bs in the initial state
     EvtComplex hp, hm;
     if ( Initial_state == 0 ) {    //These are the equations for Bs
 
         hp = arg_hp * gplus + qp * conj( arg_hm ) * gminus;
         hm = arg_hm * gplus + qp * conj( arg_hp ) * gminus;
 
     } else if ( Initial_state == 1 ) {    //The equations for Anti-Bs
 
         hp = conj( arg_hm ) * gplus + ( 1.0 / qp ) * arg_hp * gminus;
         hm = conj( arg_hp ) * gplus + ( 1.0 / qp ) * arg_hm * gminus;
 
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Initial state was not BSB or BS0!" << std::endl;
         ::abort();
     }
 
     //Compute the decay amplitudes from the time-dependent helicity amplitudes
     EvtSVPHelAmp::SVPHel( p, m_amp2, getDaug( 0 ), getDaug( 1 ), hp, hm );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSVSCP.cpp b/src/EvtGenModels/EvtSVSCP.cpp
index cb00b6d..26aedb0 100644
--- a/src/EvtGenModels/EvtSVSCP.cpp
+++ b/src/EvtGenModels/EvtSVSCP.cpp
@@ -1,152 +1,152 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVSCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVSCP::getName()
+std::string EvtSVSCP::getName() const
 {
     return "SVS_CP";
 }
 
-EvtDecayBase* EvtSVSCP::clone()
+EvtDecayBase* EvtSVSCP::clone() const
 {
     return new EvtSVSCP;
 }
 
 void EvtSVSCP::init()
 {
     // check that there are 7 arguments
     checkNArg( 7 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtSVSCP::initProbMax()
 {
     //This is probably not quite right, but it should do as a start...
     //Anders
 
     setProbMax( 2 * ( getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 ) ) );
 }
 
 void EvtSVSCP::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     EvtParticle* v;
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     v = p->getDaug( 0 );
     EvtVector4R momv = v->getP4();
     EvtVector4R moms = p->getDaug( 1 )->getP4();
     double massv = v->mass();
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     EvtComplex amp;
 
     EvtComplex A, Abar;
 
     A = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
                     getArg( 3 ) * sin( getArg( 4 ) ) );
     Abar = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
                        getArg( 5 ) * sin( getArg( 6 ) ) );
 
     if ( other_b == B0B ) {
         amp = A * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               EvtComplex( cos( -2.0 * getArg( 0 ) ), sin( -2.0 * getArg( 0 ) ) ) *
                   getArg( 2 ) * EvtComplex( 0.0, 1.0 ) * Abar *
                   sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     }
     if ( other_b == B0 ) {
         amp = A * EvtComplex( cos( 2.0 * getArg( 0 ) ), sin( 2.0 * getArg( 0 ) ) ) *
                   EvtComplex( 0.0, 1.0 ) *
                   sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
               getArg( 2 ) * Abar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     }
 
     EvtVector4R p4_parent;
 
     p4_parent = momv + moms;
 
     double norm = massv / ( momv.d3mag() * p4_parent.mass() );
 
     vertex( 0, amp * norm * p4_parent * ( v->epsParent( 0 ) ) );
     vertex( 1, amp * norm * p4_parent * ( v->epsParent( 1 ) ) );
     vertex( 2, amp * norm * p4_parent * ( v->epsParent( 2 ) ) );
 
     return;
 }
 
 std::string EvtSVSCP::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "weakPhase";
         case 1:
             return "deltaM";
         case 2:
             return "finalStateCP";
         case 3:
             return "Af";
         case 4:
             return "AfPhase";
         case 5:
             return "Abarf";
         case 6:
             return "AbarfPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSVSCP::getParamDefault( int i )
 {
     switch ( i ) {
         case 3:
             return "1.0";
         case 4:
             return "0.0";
         case 5:
             return "1.0";
         case 6:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSVSCPLH.cpp b/src/EvtGenModels/EvtSVSCPLH.cpp
index 24e0858..5a22f81 100644
--- a/src/EvtGenModels/EvtSVSCPLH.cpp
+++ b/src/EvtGenModels/EvtSVSCPLH.cpp
@@ -1,142 +1,142 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVSCPLH.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtSVSCPLH::getName()
+std::string EvtSVSCPLH::getName() const
 {
     return "SVS_CPLH";
 }
 
-EvtDecayBase* EvtSVSCPLH::clone()
+EvtDecayBase* EvtSVSCPLH::clone() const
 {
     return new EvtSVSCPLH;
 }
 
 void EvtSVSCPLH::init()
 {
     // check that there are 8 arguments
     checkNArg( 8 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 
-    static double ctau = EvtPDL::getctau( EvtPDL::getId( "B0" ) );
+    static const double ctau = EvtPDL::getctau( EvtPDL::getId( "B0" ) );
 
     // hbar/s
     m_dm = getArg( 0 );
     m_dgamma = EvtConst::c * getArg( 1 ) / ctau;
 
     m_qop = getArg( 2 ) * exp( EvtComplex( 0.0, getArg( 3 ) ) );
 
     m_poq = 1.0 / m_qop;
 
     m_Af = getArg( 4 ) * exp( EvtComplex( 0.0, getArg( 5 ) ) );
     m_Abarf = getArg( 6 ) * exp( EvtComplex( 0.0, getArg( 7 ) ) );
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << ":EvtSVSCPLH:dm=" << m_dm << endl;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << ":EvtSVSCPLH:dGamma=" << m_dgamma << endl;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << ":EvtSVSCPLH:q/p=" << m_qop << endl;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << ":EvtSVSCPLH:Af=" << m_Af << endl;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << ":EvtSVSCPLH:Abarf=" << m_Abarf << endl;
     }
 }
 
 void EvtSVSCPLH::initProbMax()
 {
     //This is probably not quite right, but it should do as a start...
     //Anders
 
     setProbMax( 4.0 * ( getArg( 4 ) * getArg( 4 ) + getArg( 6 ) * getArg( 6 ) ) );
 }
 
 void EvtSVSCPLH::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     //convert time from mm to seconds
     t /= EvtConst::c;
 
     //sign convention is dm=Mheavy-Mlight
     //                   dGamma=Gammalight-Gammaheavy
     //such that in the standard model both of these are positive.
     EvtComplex gp =
         0.5 * ( exp( EvtComplex( 0.25 * t * m_dgamma, -0.5 * t * m_dm ) ) +
                 exp( EvtComplex( -0.25 * t * m_dgamma, 0.5 * t * m_dm ) ) );
     EvtComplex gm =
         0.5 * ( exp( EvtComplex( 0.25 * t * m_dgamma, -0.5 * t * m_dm ) ) -
                 exp( EvtComplex( -0.25 * t * m_dgamma, 0.5 * t * m_dm ) ) );
 
     EvtComplex amp;
 
     if ( other_b == B0B ) {
         amp = gp * m_Af + m_qop * gm * m_Abarf;
     } else if ( other_b == B0 ) {
         amp = gp * m_Abarf + m_poq * gm * m_Af;
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "other_b was not B0 or B0B!" << endl;
         ::abort();
     }
 
     EvtVector4R p4_parent = p->getP4Restframe();
     ;
 
     double norm = p->getDaug( 0 )->mass() /
                   ( p->getDaug( 0 )->getP4().d3mag() * p4_parent.mass() );
 
     EvtParticle* v = p->getDaug( 0 );
 
     vertex( 0, amp * norm * ( p4_parent * ( v->epsParent( 0 ) ) ) );
     vertex( 1, amp * norm * ( p4_parent * ( v->epsParent( 1 ) ) ) );
     vertex( 2, amp * norm * ( p4_parent * ( v->epsParent( 2 ) ) ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSVSCPiso.cpp b/src/EvtGenModels/EvtSVSCPiso.cpp
index 8164fbf..913a4c2 100644
--- a/src/EvtGenModels/EvtSVSCPiso.cpp
+++ b/src/EvtGenModels/EvtSVSCPiso.cpp
@@ -1,273 +1,273 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVSCPiso.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVSCPiso::getName()
+std::string EvtSVSCPiso::getName() const
 {
     return "SVS_CP_ISO";
 }
 
-EvtDecayBase* EvtSVSCPiso::clone()
+EvtDecayBase* EvtSVSCPiso::clone() const
 {
     return new EvtSVSCPiso;
 }
 
 void EvtSVSCPiso::init()
 {
     // check that there are 27 arguments
     checkNArg( 27 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 
     // Set amplitude coefficients
     setAmpCoeffs();
     // Calculate amplitude terms
     calcAmpTerms();
 }
 
 void EvtSVSCPiso::setAmpCoeffs()
 {
     m_Tp0 = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
                         getArg( 3 ) * sin( getArg( 4 ) ) );
     m_Tp0_bar = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
                             getArg( 5 ) * sin( getArg( 6 ) ) );
     m_T0p = EvtComplex( getArg( 7 ) * cos( getArg( 8 ) ),
                         getArg( 7 ) * sin( getArg( 8 ) ) );
     m_T0p_bar = EvtComplex( getArg( 9 ) * cos( getArg( 10 ) ),
                             getArg( 9 ) * sin( getArg( 10 ) ) );
     m_Tpm = EvtComplex( getArg( 11 ) * cos( getArg( 12 ) ),
                         getArg( 11 ) * sin( getArg( 12 ) ) );
     m_Tpm_bar = EvtComplex( getArg( 13 ) * cos( getArg( 14 ) ),
                             getArg( 13 ) * sin( getArg( 14 ) ) );
     m_Tmp = EvtComplex( getArg( 15 ) * cos( getArg( 16 ) ),
                         getArg( 15 ) * sin( getArg( 16 ) ) );
     m_Tmp_bar = EvtComplex( getArg( 17 ) * cos( getArg( 18 ) ),
                             getArg( 17 ) * sin( getArg( 18 ) ) );
     m_P0 = EvtComplex( getArg( 19 ) * cos( getArg( 20 ) ),
                        getArg( 19 ) * sin( getArg( 20 ) ) );
     m_P0_bar = EvtComplex( getArg( 21 ) * cos( getArg( 22 ) ),
                            getArg( 21 ) * sin( getArg( 22 ) ) );
     m_P1 = EvtComplex( getArg( 23 ) * cos( getArg( 24 ) ),
                        getArg( 23 ) * sin( getArg( 24 ) ) );
     m_P1_bar = EvtComplex( getArg( 25 ) * cos( getArg( 26 ) ),
                            getArg( 25 ) * sin( getArg( 26 ) ) );
 }
 
 void EvtSVSCPiso::initProbMax()
 {
     const double max1 = abs2( m_A_f ) + abs2( m_Abar_f );
     const double max2 = abs2( m_A_fbar ) + abs2( m_Abar_fbar );
     // Amplitude has momentum normalisation that roughly scales with (parent mass)/2
     // so probability will scale with 0.25 * parenMassSq. Use 0.3 * parMassSq
     // in case we get larger normalisation values
     const double parMass = EvtPDL::getMeanMass( getParentId() );
     const double max = 0.3 * parMass * parMass * ( max1 + max2 );
     setProbMax( max );
 }
 
 void EvtSVSCPiso::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     int first_time = 0;
     int flip = 0;
     EvtId ds[2];
 
     // Randomly generate the tag (B0 or B0B)
     const double tag = EvtRandom::Flat( 0.0, 1.0 );
     if ( tag < 0.5 ) {
         EvtCPUtil::getInstance()->OtherB( p, t, other_b, 1.0 );
         other_b = B0;
     } else {
         EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.0 );
         other_b = B0B;
     }
 
     if ( p->getNDaug() == 0 )
         first_time = 1;
 
     if ( first_time ) {
         if ( EvtRandom::Flat( 0.0, 1.0 ) < getArg( 2 ) )
             flip = 1;
     } else {
         if ( getDaug( 0 ) != p->getDaug( 0 )->getId() )
             flip = 1;
     }
 
     if ( !flip ) {
         ds[0] = getDaug( 0 );
         ds[1] = getDaug( 1 );
     } else {
         ds[0] = EvtPDL::chargeConj( getDaug( 0 ) );
         ds[1] = EvtPDL::chargeConj( getDaug( 1 ) );
     }
 
     p->initializePhaseSpace( getNDaug(), ds );
 
     EvtParticle *v, *s;
     v = p->getDaug( 0 );
     s = p->getDaug( 1 );
 
     EvtComplex amp;
 
     if ( m_charged == 0 ) {
         if ( !flip ) {
             if ( other_b == B0B ) {
                 amp = m_A_f * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
                       EvtComplex( cos( -2.0 * getArg( 0 ) ),
                                   sin( -2.0 * getArg( 0 ) ) ) *
                           EvtComplex( 0.0, 1.0 ) * m_Abar_f *
                           sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
             }
             if ( other_b == B0 ) {
                 amp = m_A_f *
                           EvtComplex( cos( 2.0 * getArg( 0 ) ),
                                       sin( 2.0 * getArg( 0 ) ) ) *
                           EvtComplex( 0.0, 1.0 ) *
                           sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
                       m_Abar_f * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
             }
         } else {
             if ( other_b == B0B ) {
                 amp = m_A_fbar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
                       EvtComplex( cos( -2.0 * getArg( 0 ) ),
                                   sin( -2.0 * getArg( 0 ) ) ) *
                           EvtComplex( 0.0, 1.0 ) * m_Abar_fbar *
                           sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
             }
             if ( other_b == B0 ) {
                 amp = m_A_fbar *
                           EvtComplex( cos( 2.0 * getArg( 0 ) ),
                                       sin( 2.0 * getArg( 0 ) ) ) *
                           EvtComplex( 0.0, 1.0 ) *
                           sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
                       m_Abar_fbar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
             }
         }
 
     } else {
         amp = m_A_f;
     }
 
     const EvtVector4R p4_parent = v->getP4() + s->getP4();
     const double norm = 1.0 / v->getP4().d3mag();
 
     vertex( 0, amp * norm * p4_parent * ( v->epsParent( 0 ) ) );
     vertex( 1, amp * norm * p4_parent * ( v->epsParent( 1 ) ) );
     vertex( 2, amp * norm * p4_parent * ( v->epsParent( 2 ) ) );
 
     return;
 }
 
 void EvtSVSCPiso::calcAmpTerms()
 {
     const int Q1 = EvtPDL::chg3( getDaug( 0 ) );
     const int Q2 = EvtPDL::chg3( getDaug( 1 ) );
 
     //***********************charged modes****************************
 
     if ( Q1 > 0 && Q2 == 0 ) {
         //V+ S0, so T+0 + 2 P1
 
         m_charged = 1;
         m_A_f = m_Tp0 + 2.0 * m_P1;
     }
 
     if ( Q1 < 0 && Q2 == 0 ) {
         //V- S0, so T+0_bar + 2P1_bar
 
         m_charged = 1;
         m_A_f = m_Tp0_bar + 2.0 * m_P1_bar;
     }
 
     if ( Q1 == 0 && Q2 > 0 ) {
         //V0 S+, so T0+ - 2 P1
 
         m_charged = 1;
         m_A_f = m_T0p - 2.0 * m_P1;
     }
 
     if ( Q1 == 0 && Q2 < 0 ) {
         //V0 S-, so T0+_bar - 2 P1_bar
 
         m_charged = 1;
         m_A_f = m_T0p_bar - 2.0 * m_P1_bar;
     }
 
     //***********************neutral modes***************************
 
     //V+ S-, so Af = T+- + P1 + P0
     m_Apm = m_Tpm + m_P1 + m_P0;
     m_Apm_bar = m_Tpm_bar + m_P1_bar + m_P0_bar;
 
     //V- S+, so Af = T-+ - P1 + P0
     m_Amp = m_Tmp - m_P1 + m_P0;
     m_Amp_bar = m_Tmp_bar - m_P1_bar + m_P0;
 
     if ( Q1 > 0 && Q2 < 0 ) {
         //V+ S-
         m_charged = 0;
         m_A_f = m_Apm;
         m_Abar_f = m_Apm_bar;
         m_A_fbar = m_Amp;
         m_Abar_fbar = m_Amp_bar;
     }
 
     if ( Q1 < 0 && Q2 > 0 ) {
         //V- S+
         m_charged = 0;
         m_A_f = m_Amp;
         m_Abar_f = m_Amp_bar;
         m_A_fbar = m_Apm;
         m_Abar_fbar = m_Apm_bar;
     }
 
     if ( Q1 == 0 && Q2 == 0 ) {
         //V0 S0
         m_charged = 0;
         m_A_f = m_T0p + m_Tp0 - m_Tpm - m_Tmp - 2.0 * m_P0;
         m_Abar_f = m_T0p_bar + m_Tp0_bar - m_Tpm_bar - m_Tmp_bar - 2.0 * m_P0_bar;
         m_A_fbar = m_A_f;
         m_Abar_fbar = m_Abar_f;
     }
 }
diff --git a/src/EvtGenModels/EvtSVSNONCPEIGEN.cpp b/src/EvtGenModels/EvtSVSNONCPEIGEN.cpp
index 61400c9..c33587f 100644
--- a/src/EvtGenModels/EvtSVSNONCPEIGEN.cpp
+++ b/src/EvtGenModels/EvtSVSNONCPEIGEN.cpp
@@ -1,147 +1,147 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVSNONCPEIGEN.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVSNONCPEIGEN::getName()
+std::string EvtSVSNONCPEIGEN::getName() const
 {
     return "SVS_NONCPEIGEN";
 }
 
-EvtDecayBase* EvtSVSNONCPEIGEN::clone()
+EvtDecayBase* EvtSVSNONCPEIGEN::clone() const
 {
     return new EvtSVSNONCPEIGEN;
 }
 
 void EvtSVSNONCPEIGEN::init()
 {
     // check that there are 11 arguments
     checkNArg( 11, 7 );
     checkNDaug( 2 );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 
     m_dm = getArg( 1 );
     m_phickm = 2 * getArg( 0 ) + getArg( 2 );
 
     m_A_f = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
                         getArg( 3 ) * sin( getArg( 4 ) ) );
     m_Abar_f = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
                            getArg( 5 ) * sin( getArg( 6 ) ) );
 
     m_A_fbar = m_Abar_f;
     m_Abar_fbar = m_A_f;
 
     if ( getNArg() == 11 ) {
         m_A_fbar = EvtComplex( getArg( 7 ) * cos( getArg( 8 ) ),
                                getArg( 7 ) * sin( getArg( 8 ) ) );
         m_Abar_fbar = EvtComplex( getArg( 9 ) * cos( getArg( 10 ) ),
                                   getArg( 9 ) * sin( getArg( 10 ) ) );
     }
 }
 
 void EvtSVSNONCPEIGEN::initProbMax()
 {
     double theProbMax = abs( m_A_f ) * abs( m_A_f ) +
                         abs( m_Abar_f ) * abs( m_Abar_f ) +
                         abs( m_A_fbar ) * abs( m_A_fbar ) +
                         abs( m_Abar_fbar ) * abs( m_Abar_fbar );
 
     setProbMax( theProbMax );
 }
 
 void EvtSVSNONCPEIGEN::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
     EvtId daugs[2];
 
     // MB: flip selects the final of the decay
     int flip = ( ( p->getId() == B0 ) ? 0 : 1 );
     daugs[0] = getDaug( 0 );
     daugs[1] = getDaug( 1 );
     p->initializePhaseSpace( 2, daugs );
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     EvtComplex amp;
     double dmt2 = ( m_dm * t ) / ( 2 * EvtConst::c );
     EvtComplex ePlusIPhi( cos( m_phickm ), sin( m_phickm ) );
     EvtComplex eMinusIPhi( cos( -m_phickm ), -sin( m_phickm ) );
 
     // flip == 0 : D-rho+
     // flip == 1 : D+rho-
 
     if ( !flip ) {
         if ( other_b == B0B ) {
             // At t=0 we have a B0
             amp = cos( dmt2 ) * m_A_f +
                   eMinusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) * m_Abar_f;
         }
         if ( other_b == B0 ) {
             // At t=0 we have a B0bar
             amp = ePlusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) * m_A_f +
                   cos( dmt2 ) * m_Abar_f;
         }
     } else {
         if ( other_b == B0B ) {
             // At t=0 we have a B0
             amp = cos( dmt2 ) * m_A_fbar +
                   eMinusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) * m_Abar_fbar;
         }
         if ( other_b == B0 ) {
             // At t=0 we have a B0bar
             amp = ePlusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) * m_A_fbar +
                   cos( dmt2 ) * m_Abar_fbar;
         }
     }
 
     EvtParticle* v;
     v = p->getDaug( 0 );
 
     EvtVector4R momv = p->getDaug( 0 )->getP4();
     EvtVector4R moms = p->getDaug( 1 )->getP4();
     EvtVector4R p4_parent = momv + moms;
 
     double norm = momv.mass() / ( momv.d3mag() * p->mass() );
 
     vertex( 0, amp * norm * p4_parent * ( v->epsParent( 0 ) ) );
     vertex( 1, amp * norm * p4_parent * ( v->epsParent( 1 ) ) );
     vertex( 2, amp * norm * p4_parent * ( v->epsParent( 2 ) ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSVVCP.cpp b/src/EvtGenModels/EvtSVVCP.cpp
index 0148f59..599069a 100644
--- a/src/EvtGenModels/EvtSVVCP.cpp
+++ b/src/EvtGenModels/EvtSVVCP.cpp
@@ -1,164 +1,164 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVVCP.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtSVVHelAmp.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVVCP::getName()
+std::string EvtSVVCP::getName() const
 {
     return "SVV_CP";
 }
 
-EvtDecayBase* EvtSVVCP::clone()
+EvtDecayBase* EvtSVVCP::clone() const
 {
     return new EvtSVVCP;
 }
 
 void EvtSVVCP::init()
 {
     // check that there are 9 arguments
     checkNArg( 9 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::VECTOR );
 }
 
 void EvtSVVCP::initProbMax()
 {
     //This is probably not quite right, but it should do as a start...
     //Anders
 
     setProbMax( 2 * ( getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 ) +
                       getArg( 7 ) * getArg( 7 ) ) );
 }
 
 void EvtSVVCP::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     EvtComplex G0P, G1P, G1M;
 
     G1P = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
                       getArg( 3 ) * sin( getArg( 4 ) ) );
     G0P = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
                       getArg( 5 ) * sin( getArg( 6 ) ) );
     G1M = EvtComplex( getArg( 7 ) * cos( getArg( 8 ) ),
                       getArg( 7 ) * sin( getArg( 8 ) ) );
 
     EvtComplex lambda_km = EvtComplex( cos( -2 * getArg( 0 ) ),
                                        sin( -2 * getArg( 0 ) ) );
 
     double cdmt = cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     double sdmt = sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
 
     EvtComplex cG0P, cG1P, cG1M;
 
     if ( other_b == B0B ) {
         cG0P = G0P * ( cdmt + lambda_km * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1P = G1P * ( cdmt + lambda_km * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1M = G1M * ( cdmt - lambda_km * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
     }
     if ( other_b == B0 ) {
         cG0P = G0P * ( cdmt + ( 1.0 / lambda_km ) *
                                   EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1P = G1P * ( cdmt + ( 1.0 / lambda_km ) *
                                   EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1M = -G1M * ( cdmt - ( 1.0 / lambda_km ) *
                                    EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
     }
 
     EvtComplex A0, AP, AM;
 
     A0 = cG0P / sqrt( 2.0 );
     AP = ( cG1P + cG1M ) / sqrt( 2.0 );
     AM = ( cG1P - cG1M ) / sqrt( 2.0 );
 
     EvtSVVHelAmp::SVVHel( p, m_amp2, getDaug( 0 ), getDaug( 1 ), AP, A0, AM );
 
     return;
 }
 
 std::string EvtSVVCP::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "weakPhase";
         case 1:
             return "deltaM";
         case 2:
             return "eta";
         case 3:
             return "G1Plus";
         case 4:
             return "G1PlusPhase";
         case 5:
             return "G0Plus";
         case 6:
             return "G0PlusPhase";
         case 7:
             return "G1Minus";
         case 8:
             return "G1MinusPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSVVCP::getParamDefault( int i )
 {
     switch ( i ) {
         case 3:
             return "1.0";
         case 4:
             return "0.0";
         case 5:
             return "1.0";
         case 6:
             return "0.0";
         case 7:
             return "1.0";
         case 8:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSVVCPLH.cpp b/src/EvtGenModels/EvtSVVCPLH.cpp
index 7a57f6c..c2aef8d 100644
--- a/src/EvtGenModels/EvtSVVCPLH.cpp
+++ b/src/EvtGenModels/EvtSVVCPLH.cpp
@@ -1,136 +1,136 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVVCPLH.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtSVVHelAmp.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtSVVCPLH::getName()
+std::string EvtSVVCPLH::getName() const
 {
     return "SVV_CPLH";
 }
 
-EvtDecayBase* EvtSVVCPLH::clone()
+EvtDecayBase* EvtSVVCPLH::clone() const
 {
     return new EvtSVVCPLH;
 }
 
 void EvtSVVCPLH::init()
 {
     // check that there are 9 arguments
     checkNArg( 9 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::VECTOR );
 }
 
 void EvtSVVCPLH::initProbMax()
 {
     //This is probably not quite right, but it should do as a start...
     //Anders
 
     setProbMax( 2 * ( getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 ) +
                       getArg( 7 ) * getArg( 7 ) ) );
 }
 
 void EvtSVVCPLH::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId BS0 = EvtPDL::getId( "B_s0" );
-    static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+    static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+    static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
 
     double t;
     EvtId other_b;
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b );
 
     EvtComplex G0P, G1P, G1M;
 
     G1P = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
                       getArg( 3 ) * sin( getArg( 4 ) ) );
     G0P = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
                       getArg( 5 ) * sin( getArg( 6 ) ) );
     G1M = EvtComplex( getArg( 7 ) * cos( getArg( 8 ) ),
                       getArg( 7 ) * sin( getArg( 8 ) ) );
 
     EvtComplex lambda_km = EvtComplex( cos( 2 * getArg( 0 ) ),
                                        sin( 2 * getArg( 0 ) ) );
 
     double cdmt = cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
     double sdmt = sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
 
     EvtComplex cG0P, cG1P, cG1M;
 
-    static double ctauL = EvtPDL::getctau( EvtPDL::getId( "B_s0L" ) );
-    static double ctauH = EvtPDL::getctau( EvtPDL::getId( "B_s0H" ) );
+    static const double ctauL = EvtPDL::getctau( EvtPDL::getId( "B_s0L" ) );
+    static const double ctauH = EvtPDL::getctau( EvtPDL::getId( "B_s0H" ) );
 
     //I'm not sure if the fabs() is right when t can be
     //negative as in the case of Bs produced coherently.
     double pt = 1;
     double mt = exp( -fabs( t * ( ctauL - ctauH ) / ( ctauL * ctauH ) ) );
 
     if ( other_b == BSB ) {
         cG0P = pt * G0P *
                ( cdmt + lambda_km * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1P = pt * G1P *
                ( cdmt + lambda_km * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1M = mt * G1M *
                ( cdmt - lambda_km * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
     } else if ( other_b == BS0 ) {
         cG0P = pt * G0P *
                ( cdmt +
                  ( 1.0 / lambda_km ) * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1P = pt * G1P *
                ( cdmt +
                  ( 1.0 / lambda_km ) * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
         cG1M = -mt * G1M *
                ( cdmt -
                  ( 1.0 / lambda_km ) * EvtComplex( 0.0, getArg( 2 ) * sdmt ) );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "other_b was not BSB or BS0!" << endl;
         ::abort();
     }
 
     EvtComplex A0, AP, AM;
 
     A0 = cG0P / sqrt( 2.0 );
     AP = ( cG1P + cG1M ) / sqrt( 2.0 );
     AM = ( cG1P - cG1M ) / sqrt( 2.0 );
 
     EvtSVVHelAmp::SVVHel( p, m_amp2, getDaug( 0 ), getDaug( 1 ), AP, A0, AM );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSVVHelAmp.cpp b/src/EvtGenModels/EvtSVVHelAmp.cpp
index 64c763a..0e83654 100644
--- a/src/EvtGenModels/EvtSVVHelAmp.cpp
+++ b/src/EvtGenModels/EvtSVVHelAmp.cpp
@@ -1,170 +1,170 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVVHelAmp.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor3C.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector3C.hh"
 #include "EvtGenBase/EvtVector3R.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVVHelAmp::getName()
+std::string EvtSVVHelAmp::getName() const
 {
     return "SVV_HELAMP";
 }
 
-EvtDecayBase* EvtSVVHelAmp::clone()
+EvtDecayBase* EvtSVVHelAmp::clone() const
 {
     return new EvtSVVHelAmp;
 }
 
 void EvtSVVHelAmp::init()
 {
     // check that there are 6 arguments
     checkNArg( 6 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::VECTOR );
 }
 
 void EvtSVVHelAmp::initProbMax()
 {
     setProbMax( getArg( 0 ) * getArg( 0 ) + getArg( 2 ) * getArg( 2 ) +
                 getArg( 4 ) * getArg( 4 ) );
 }
 
 void EvtSVVHelAmp::decay( EvtParticle* p )
 {
     SVVHel( p, m_amp2, getDaug( 0 ), getDaug( 1 ),
             EvtComplex( getArg( 0 ) * cos( getArg( 1 ) ),
                         getArg( 0 ) * sin( getArg( 1 ) ) ),
             EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                         getArg( 2 ) * sin( getArg( 3 ) ) ),
             EvtComplex( getArg( 4 ) * cos( getArg( 5 ) ),
                         getArg( 4 ) * sin( getArg( 5 ) ) ) );
 
     return;
 }
 
 void EvtSVVHelAmp::SVVHel( EvtParticle* parent, EvtAmp& amp, EvtId n_v1,
                            EvtId n_v2, const EvtComplex& hp,
                            const EvtComplex& h0, const EvtComplex& hm )
 {
     //  Routine to decay a vector into a vector and scalar.  Started
     //  by ryd on Oct 17, 1996.
 
     int tndaug = 2;
     EvtId tdaug[2];
     tdaug[0] = n_v1;
     tdaug[1] = n_v2;
 
     parent->initializePhaseSpace( tndaug, tdaug );
 
     EvtParticle *v1, *v2;
     v1 = parent->getDaug( 0 );
     v2 = parent->getDaug( 1 );
 
     EvtVector4R momv1 = v1->getP4();
     //EvtVector4R momv2 = v2->getP4();
 
     EvtVector3R v1dir( momv1.get( 1 ), momv1.get( 2 ), momv1.get( 3 ) );
     v1dir = v1dir / v1dir.d3mag();
 
     EvtComplex a = -0.5 * ( hp + hm );
     EvtComplex b = EvtComplex( 0.0, 0.5 ) * ( hp - hm );
     EvtComplex c = h0 + 0.5 * ( hp + hm );
 
     EvtTensor3C M = a * EvtTensor3C::id() + b * EvtGenFunctions::eps( v1dir ) +
                     c * EvtGenFunctions::directProd( v1dir, v1dir );
 
     EvtVector3C t0 = M.cont1( v1->eps( 0 ).vec().conj() );
     EvtVector3C t1 = M.cont1( v1->eps( 1 ).vec().conj() );
     EvtVector3C t2 = M.cont1( v1->eps( 2 ).vec().conj() );
 
     EvtVector3C eps0 = v2->eps( 0 ).vec().conj();
     EvtVector3C eps1 = v2->eps( 1 ).vec().conj();
     EvtVector3C eps2 = v2->eps( 2 ).vec().conj();
 
     amp.vertex( 0, 0, t0 * eps0 );
     amp.vertex( 0, 1, t0 * eps1 );
     amp.vertex( 0, 2, t0 * eps2 );
 
     amp.vertex( 1, 0, t1 * eps0 );
     amp.vertex( 1, 1, t1 * eps1 );
     amp.vertex( 1, 2, t1 * eps2 );
 
     amp.vertex( 2, 0, t2 * eps0 );
     amp.vertex( 2, 1, t2 * eps1 );
     amp.vertex( 2, 2, t2 * eps2 );
 
     return;
 }
 
 std::string EvtSVVHelAmp::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "plusHelAmp";
         case 1:
             return "plusHelAmpPhase";
         case 2:
             return "zeroHelAmp";
         case 3:
             return "zeroHelAmpPhase";
         case 4:
             return "minusHelAmp";
         case 5:
             return "minusHelAmpPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSVVHelAmp::getParamDefault( int i )
 {
     switch ( i ) {
         case 0:
             return "1.0";
         case 1:
             return "0.0";
         case 2:
             return "1.0";
         case 3:
             return "0.0";
         case 4:
             return "1.0";
         case 5:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSVVHelCPMix.cpp b/src/EvtGenModels/EvtSVVHelCPMix.cpp
index 8a134b0..66c0f38 100644
--- a/src/EvtGenModels/EvtSVVHelCPMix.cpp
+++ b/src/EvtGenModels/EvtSVVHelCPMix.cpp
@@ -1,294 +1,294 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVVHelCPMix.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor3C.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector3C.hh"
 #include "EvtGenBase/EvtVector3R.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <ctype.h>
 #include <fstream>
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVVHelCPMix::getName()
+std::string EvtSVVHelCPMix::getName() const
 {
     return "SVVHELCPMIX";
 }
 
-EvtDecayBase* EvtSVVHelCPMix::clone()
+EvtDecayBase* EvtSVVHelCPMix::clone() const
 {
     return new EvtSVVHelCPMix;
 }
 
 void EvtSVVHelCPMix::init()
 {
     // check that there are 12 arguments
     checkNArg( 12 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::VECTOR );
 
     m_hp = EvtComplex( getArg( 0 ) * cos( getArg( 1 ) ),
                        getArg( 0 ) * sin( getArg( 1 ) ) );
     m_h0 = EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
                        getArg( 2 ) * sin( getArg( 3 ) ) );
     m_hm = EvtComplex( getArg( 4 ) * cos( getArg( 5 ) ),
                        getArg( 4 ) * sin( getArg( 5 ) ) );
     m_averageM = getArg( 6 );
     m_deltaM = getArg( 7 );
     m_gamma = getArg( 8 );
     m_deltagamma = getArg( 9 );
     m_weakmixingphase = EvtComplex( cos( getArg( 10 ) ), sin( getArg( 10 ) ) );
     m_weakdirectphase = EvtComplex( cos( getArg( 11 ) ), sin( getArg( 11 ) ) );
 }
 
 void EvtSVVHelCPMix::initProbMax()
 {
     setProbMax( getArg( 0 ) * getArg( 0 ) + getArg( 2 ) * getArg( 2 ) +
                 getArg( 4 ) * getArg( 4 ) );
 }
 
 void EvtSVVHelCPMix::decay( EvtParticle* p )
 {
     EvtParticle* parent = p;
     EvtAmp& amp = m_amp2;
     EvtId n_v1 = getDaug( 0 );
     EvtId n_v2 = getDaug( 1 );
 
     //  Routine to decay a vector into a vector and scalar.  Started
     //  by ryd on Oct 17, 1996.
     // Modified by J.Catmore to take account of CP-violation and mixing
 
     int tndaug = 2;
     EvtId tdaug[2];
     EvtId Bs = EvtPDL::getId( "B_s0" );
     EvtId antiBs = EvtPDL::getId( "anti-B_s0" );
     tdaug[0] = n_v1;
     tdaug[1] = n_v2;
 
     // Phase space and kinematics
 
     parent->initializePhaseSpace( tndaug, tdaug );
 
     EvtParticle *v1, *v2;
     v1 = parent->getDaug( 0 );
     v2 = parent->getDaug( 1 );
 
     EvtVector4R momv1 = v1->getP4();
 
     EvtVector3R v1dir( momv1.get( 1 ), momv1.get( 2 ), momv1.get( 3 ) );
     v1dir = v1dir / v1dir.d3mag();
 
     // Definition of quantities used in construction of complex amplitudes:
 
     EvtTensor3C M;    // Tensor as defined in EvtGen manual, equ 117
     EvtComplex a, b,
         c;    // Helicity amplitudes; EvtGen manual eqns 126-128, also see Phys Lett B 369 p144-150 eqn 15
     //EvtComplex deltamu = EvtComplex(m_deltaM, -0.5*m_deltagamma); // See Phys Rev D 34 p1404
 
     // conversion from times in mm/c to natural units [GeV]^-1
     double t = ( ( parent->getLifetime() ) / 2.998e11 ) * 6.58e-25;
 
     // The following two quantities defined in Phys Rev D 34 p1404
     EvtComplex fplus =
         EvtComplex( cos( m_averageM * t ), -1. * sin( m_averageM * t ) ) *
         exp( -( m_gamma / 2.0 ) * t ) *
         ( cos( 0.5 * m_deltaM * t ) * cosh( 0.25 * m_deltagamma * t ) +
           EvtComplex( 0.0, sin( 0.5 * m_deltaM * t ) *
                                sinh( 0.25 * m_deltagamma * t ) ) );
     EvtComplex fminus =
         EvtComplex( cos( m_averageM * t ), -1. * sin( m_averageM * t ) ) *
         exp( -( m_gamma / 2.0 ) * t ) * EvtComplex( 0.0, 1.0 ) *
         ( sin( 0.5 * m_deltaM * t ) * cosh( 0.25 * m_deltagamma * t ) -
           EvtComplex( 0.0, 1.0 ) * sinh( 0.25 * m_deltagamma * t ) *
               cos( 0.5 * m_deltaM * t ) );
 
     // See EvtGen manual pp 106-107
 
     a = -0.5 * ( m_hp + m_hm );
     b = EvtComplex( 0.0, 0.5 ) * ( m_hp - m_hm );
     c = ( m_h0 + 0.5 * ( m_hp + m_hm ) );
 
     M = a * EvtTensor3C::id() + b * EvtGenFunctions::eps( v1dir ) +
         c * EvtGenFunctions::directProd( v1dir, v1dir );
 
     EvtVector3C t0 = M.cont1( v1->eps( 0 ).vec().conj() );
     EvtVector3C t1 = M.cont1( v1->eps( 1 ).vec().conj() );
     EvtVector3C t2 = M.cont1( v1->eps( 2 ).vec().conj() );
 
     EvtVector3C eps0 = v2->eps( 0 ).vec().conj();
     EvtVector3C eps1 = v2->eps( 1 ).vec().conj();
     EvtVector3C eps2 = v2->eps( 2 ).vec().conj();
 
     // We need two sets of equations, one for mesons which were in the Bs state at t=0, and another
     // for those which were in the antiBs state. Each equation consists of a sum of amplitudes - mod-squaring gives the interference terms.
 
     EvtComplex amplSum00, amplSum01, amplSum02;
     EvtComplex amplSum10, amplSum11, amplSum12;
     EvtComplex amplSum20, amplSum21, amplSum22;
 
     // First the Bs state:
 
     if ( parent->getId() == Bs ) {
         amplSum00 = ( fplus * m_weakdirectphase * t0 * eps0 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t0 * eps0 );
         amplSum01 = ( fplus * m_weakdirectphase * t0 * eps1 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t0 * eps1 );
         amplSum02 = ( fplus * m_weakdirectphase * t0 * eps2 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t0 * eps2 );
 
         amplSum10 = ( fplus * m_weakdirectphase * t1 * eps0 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t1 * eps0 );
         amplSum11 = ( fplus * m_weakdirectphase * t1 * eps1 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t1 * eps1 );
         amplSum12 = ( fplus * m_weakdirectphase * t1 * eps2 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t1 * eps2 );
 
         amplSum20 = ( fplus * m_weakdirectphase * t2 * eps0 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t2 * eps0 );
         amplSum21 = ( fplus * m_weakdirectphase * t2 * eps1 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t2 * eps1 );
         amplSum22 = ( fplus * m_weakdirectphase * t2 * eps2 ) +
                     ( fminus * ( 1.0 / m_weakdirectphase ) * m_weakmixingphase *
                       t2 * eps2 );
     }
 
     // Now the anti-Bs state:
 
     if ( parent->getId() == antiBs ) {
         amplSum00 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t0 * eps0 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t0 * eps0 );
         amplSum01 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t0 * eps1 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t0 * eps1 );
         amplSum02 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t0 * eps2 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t0 * eps2 );
 
         amplSum10 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t1 * eps0 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t1 * eps0 );
         amplSum11 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t1 * eps1 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t1 * eps1 );
         amplSum12 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t1 * eps2 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t1 * eps2 );
 
         amplSum20 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t2 * eps0 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t2 * eps0 );
         amplSum21 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t2 * eps1 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t2 * eps1 );
         amplSum22 = ( fminus * m_weakdirectphase * ( 1.0 / m_weakmixingphase ) *
                       t2 * eps2 ) +
                     ( fplus * ( 1.0 / m_weakdirectphase ) * t2 * eps2 );
     }
 
     // Now set the amplitudes
     amp.vertex( 0, 0, amplSum00 );
     amp.vertex( 0, 1, amplSum01 );
     amp.vertex( 0, 2, amplSum02 );
 
     amp.vertex( 1, 0, amplSum10 );
     amp.vertex( 1, 1, amplSum11 );
     amp.vertex( 1, 2, amplSum12 );
 
     amp.vertex( 2, 0, amplSum20 );
     amp.vertex( 2, 1, amplSum21 );
     amp.vertex( 2, 2, amplSum22 );
 
     return;
 }
 
 std::string EvtSVVHelCPMix::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "plusHelAmp";
         case 1:
             return "plusHelAmpPhase";
         case 2:
             return "zeroHelAmp";
         case 3:
             return "zeroHelAmpPhase";
         case 4:
             return "minusHelAmp";
         case 5:
             return "minusHelAmpPhase";
         case 6:
             return "averageM";
         case 7:
             return "deltaM";
         case 8:
             return "gamma";
         case 9:
             return "deltaGamma";
         case 10:
             return "weakMixPhase";
         case 11:
             return "weakDirectPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSVVHelCPMix::getParamDefault( int i )
 {
     switch ( i ) {
         case 0:
             return "1.0";
         case 1:
             return "0.0";
         case 2:
             return "1.0";
         case 3:
             return "0.0";
         case 4:
             return "1.0";
         case 5:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSVVNONCPEIGEN.cpp b/src/EvtGenModels/EvtSVVNONCPEIGEN.cpp
index a594dfa..7a6c1d9 100644
--- a/src/EvtGenModels/EvtSVVNONCPEIGEN.cpp
+++ b/src/EvtGenModels/EvtSVVNONCPEIGEN.cpp
@@ -1,260 +1,260 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSVVNONCPEIGEN.hh"
 
 #include "EvtGenBase/EvtCPUtil.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include "EvtGenModels/EvtSVVHelAmp.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSVVNONCPEIGEN::getName()
+std::string EvtSVVNONCPEIGEN::getName() const
 {
     return "SVV_NONCPEIGEN";
 }
 
-EvtDecayBase* EvtSVVNONCPEIGEN::clone()
+EvtDecayBase* EvtSVVNONCPEIGEN::clone() const
 {
     return new EvtSVVNONCPEIGEN;
 }
 
 void EvtSVVNONCPEIGEN::init()
 {
     // check that there are 27 arguments
     checkNArg( 27, 15 );
     checkNDaug( 2 );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::VECTOR );
 
     //  The ordering of A_f is :
     //  A_f[0-2] = A_f
     //  A_f[3-5] = Abar_f
     //  A_f[6-8] = A_fbar
     //  A_f[9-11] = Abar_fbar
     //
     //  Each of the 4 amplitudes include the 3 different helicity states in
     //  the order +, 0, -. See more about helicity amplitude ordering in ::decay
 
     int i = 0;
     int j = ( getNArg() - 3 ) / 2;
 
     for ( i = 0; i < j; ++i ) {
         m_A_f[i] = getArg( ( 2 * i ) + 3 ) *
                    EvtComplex( cos( getArg( ( 2 * i ) + 4 ) ),
                                sin( getArg( ( 2 * i ) + 4 ) ) );
     }
 
     //  If only 6 amplitudes are specified, calculate the last 6 from the first 6:
     if ( 6 == j ) {
         for ( i = 0; i < 3; ++i ) {
             m_A_f[6 + i] = m_A_f[3 + i];
             m_A_f[9 + i] = m_A_f[i];
         }
     }
 }
 
 void EvtSVVNONCPEIGEN::initProbMax()
 {
     double probMax = 0;
     for ( int i = 0; i < 12; ++i ) {
         double amp = abs( m_A_f[i] );
         probMax += amp * amp;
     }
 
     setProbMax( probMax );
 }
 
 void EvtSVVNONCPEIGEN::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     double t;
     EvtId other_b;
     EvtId daugs[2];
 
     // MB: flip selects the final of the decay
     int flip = ( ( p->getId() == B0 ) ? 0 : 1 );
     daugs[0] = getDaug( 0 );
     daugs[1] = getDaug( 1 );
     p->initializePhaseSpace( 2, daugs );
 
     EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
 
     EvtComplex amp[3];
 
     double dmt2 = getArg( 0 ) * t / ( 2 * EvtConst::c );
     double phiCKM = ( 2.0 * getArg( 1 ) + getArg( 2 ) );    // 2b+g
     EvtComplex ePlusIPhi( cos( phiCKM ), sin( phiCKM ) );
     EvtComplex eMinusIPhi( cos( -phiCKM ), sin( -phiCKM ) );
 
     // flip == 0 : D*-rho+
     // flip == 1 : D*+rho-
 
     if ( !flip ) {
         if ( other_b == B0B ) {
             // At t=0 we have a B0
             for ( int i = 0; i < 3; ++i ) {
                 amp[i] = m_A_f[i] * cos( dmt2 ) +
                          eMinusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) *
                              m_A_f[i + 3];
             }
         }
         if ( other_b == B0 ) {
             // At t=0 we have a B0bar
             for ( int i = 0; i < 3; ++i ) {
                 amp[i] = m_A_f[i] * ePlusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) +
                          m_A_f[i + 3] * cos( dmt2 );
             }
         }
     } else {
         if ( other_b == B0B ) {
             // At t=0 we have a B0
 
             // M.Baak 01/16/2004
             // Note: \bar{H}+- = H-+
             // If one wants to use the correct helicities for B0 and B0bar decays but the same formula-notation (as done in EvtSVV_HelAmp),
             // count the B0bar helicities backwards. (Equivalently, one could flip the chi angle.)
 
             for ( int i = 0; i < 3; ++i ) {
                 amp[i] = m_A_f[8 - i] * cos( dmt2 ) +
                          eMinusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) *
                              m_A_f[11 - i];
             }
         }
         if ( other_b == B0 ) {
             // At t=0 we have a B0bar
             for ( int i = 0; i < 3; ++i ) {
                 amp[i] = m_A_f[8 - i] * ePlusIPhi *
                              EvtComplex( 0.0, sin( dmt2 ) ) +
                          m_A_f[11 - i] * cos( dmt2 );
             }
         }
     }
 
     EvtSVVHelAmp::SVVHel( p, m_amp2, daugs[0], daugs[1], amp[0], amp[1], amp[2] );
 
     return;
 }
 
 std::string EvtSVVNONCPEIGEN::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "deltaM";
         case 1:
             return "weakPhase1";
         case 2:
             return "weakPhase2";
         case 3:
             return "AfPlusHelAmp";
         case 4:
             return "AfPlusHelAmpPhase";
         case 5:
             return "AfZeroHelAmp";
         case 6:
             return "AfZeroHelAmpPhase";
         case 7:
             return "AfMinusHelAmp";
         case 8:
             return "AfMinusHelAmpPhase";
         case 9:
             return "AbarfPlusHelAmp";
         case 10:
             return "AbarfPlusHelAmpPhase";
         case 11:
             return "AbarfZeroHelAmp";
         case 12:
             return "AbarfZeroHelAmpPhase";
         case 13:
             return "AbarfMinusHelAmp";
         case 14:
             return "AbarfMinusHelAmpPhase";
         case 15:
             return "AfbarPlusHelAmp";
         case 16:
             return "AfbarPlusHelAmpPhase";
         case 17:
             return "AfbarZeroHelAmp";
         case 18:
             return "AfbarZeroHelAmpPhase";
         case 19:
             return "AfbarMinusHelAmp";
         case 20:
             return "AfbarMinusHelAmpPhase";
         case 21:
             return "AbarfbarPlusHelAmp";
         case 22:
             return "AbarfbarPlusHelAmpPhase";
         case 23:
             return "AbarfbarZeroHelAmp";
         case 24:
             return "AbarfbarZeroHelAmpPhase";
         case 25:
             return "AbarfbarMinusHelAmp";
         case 26:
             return "AbarfbarMinusHelAmpPhase";
         default:
             return "";
     }
 }
 
 std::string EvtSVVNONCPEIGEN::getParamDefault( int i )
 {
     switch ( i ) {
         case 3:
             return "1.0";
         case 4:
             return "0.0";
         case 5:
             return "1.0";
         case 6:
             return "0.0";
         case 7:
             return "1.0";
         case 8:
             return "0.0";
         case 9:
             return "1.0";
         case 10:
             return "0.0";
         case 11:
             return "1.0";
         case 12:
             return "0.0";
         case 13:
             return "1.0";
         case 14:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtSingleParticle.cpp b/src/EvtGenModels/EvtSingleParticle.cpp
index 47218a0..168d6d3 100644
--- a/src/EvtGenModels/EvtSingleParticle.cpp
+++ b/src/EvtGenModels/EvtSingleParticle.cpp
@@ -1,146 +1,146 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSingleParticle.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtSingleParticle::getName()
+std::string EvtSingleParticle::getName() const
 {
     return "SINGLE";
 }
 
-EvtDecayBase* EvtSingleParticle::clone()
+EvtDecayBase* EvtSingleParticle::clone() const
 {
     return new EvtSingleParticle();
 }
 
 void EvtSingleParticle::initProbMax()
 {
     noProbMax();
 }
 
 void EvtSingleParticle::init()
 {
     //turn off checks for charge conservation
     disableCheckQ();
 
     if ( ( getNArg() == 6 ) || ( getNArg() == 4 ) || ( getNArg() == 2 ) ) {
         if ( getNArg() == 6 ) {
             //copy the arguments into eaiser to remember names!
 
             m_pmin = getArg( 0 );
             m_pmax = getArg( 1 );
 
             m_cthetamin = getArg( 2 );
             m_cthetamax = getArg( 3 );
 
             m_phimin = getArg( 4 );
             m_phimax = getArg( 5 );
         }
 
         if ( getNArg() == 4 ) {
             //copy the arguments into eaiser to remember names!
 
             m_pmin = getArg( 0 );
             m_pmax = getArg( 1 );
 
             m_cthetamin = getArg( 2 );
             m_cthetamax = getArg( 3 );
 
             m_phimin = 0.0;
             m_phimax = EvtConst::twoPi;
         }
 
         if ( getNArg() == 2 ) {
             //copy the arguments into eaiser to remember names!
 
             m_pmin = getArg( 0 );
             m_pmax = getArg( 1 );
 
             m_cthetamin = -1.0;
             m_cthetamax = 1.0;
 
             m_phimin = 0.0;
             m_phimax = EvtConst::twoPi;
         }
 
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtSingleParticle generator expected "
             << " 6, 4, or 2 arguments but found:" << getNArg() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << "The single particle generator has been configured:" << endl;
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << m_pmax << " > p > " << m_pmin << endl;
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << m_cthetamax << " > costheta > " << m_cthetamin << endl;
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << m_phimax << " > phi > " << m_phimin << endl;
 }
 
 void EvtSingleParticle::decay( EvtParticle* p )
 {
     EvtParticle* d;
     EvtVector4R p4;
 
     double mass = EvtPDL::getMass( getDaug( 0 ) );
 
     p->makeDaughters( getNDaug(), getDaugs() );
     d = p->getDaug( 0 );
 
     //generate flat distribution in p
     //we are now in the parents restframe! This means the
     //restframe of the e+e- collison.
     double pcm = EvtRandom::Flat( m_pmin, m_pmax );
     //generate flat distribution in phi.
     double phi = EvtRandom::Flat( m_phimin, m_phimax );
 
     double cthetalab;
 
     do {
         //generate flat distribution in costheta
         double ctheta = EvtRandom::Flat( m_cthetamin, m_cthetamax );
         double stheta = sqrt( 1.0 - ctheta * ctheta );
         p4.set( sqrt( mass * mass + pcm * pcm ), pcm * cos( phi ) * stheta,
                 pcm * sin( phi ) * stheta, pcm * ctheta );
 
         d->init( getDaug( 0 ), p4 );
 
         //get 4 vector in the lab frame!
         EvtVector4R p4lab = d->getP4Lab();
         cthetalab = p4lab.get( 3 ) / p4lab.d3mag();
     } while ( cthetalab > m_cthetamax || cthetalab < m_cthetamin );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtSll.cpp b/src/EvtGenModels/EvtSll.cpp
index 634686e..3cf1adf 100644
--- a/src/EvtGenModels/EvtSll.cpp
+++ b/src/EvtGenModels/EvtSll.cpp
@@ -1,114 +1,114 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtSll.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtSll::getName()
+std::string EvtSll::getName() const
 {
     return "SLL";
 }
 
-EvtDecayBase* EvtSll::clone()
+EvtDecayBase* EvtSll::clone() const
 {
     return new EvtSll;
 }
 
 void EvtSll::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
 }
 
 void EvtSll::initProbMax()
 {
     const int eID = abs( EvtPDL::getStdHep( EvtPDL::getId( "e-" ) ) );
     const int muID = abs( EvtPDL::getStdHep( EvtPDL::getId( "mu-" ) ) );
     const int tauID = abs( EvtPDL::getStdHep( EvtPDL::getId( "tau-" ) ) );
 
     const int lep1 = abs( EvtPDL::getStdHep( getDaug( 0 ) ) );
     const int lep2 = abs( EvtPDL::getStdHep( getDaug( 1 ) ) );
 
     // tau tau mode
     double maxProb{ 1000.0 };
 
     // Modify probability based on lepton pair (including lepton violation modes)
     if ( ( lep1 == tauID && lep2 == muID ) || ( lep1 == muID && lep2 == tauID ) ) {
         // tau mu or mu tau
         maxProb = 400.0;
     } else if ( ( lep1 == tauID && lep2 == eID ) ||
                 ( lep1 == eID && lep2 == tauID ) ) {
         // tau e or e tau
         maxProb = 400.0;
     } else if ( lep1 == muID && lep2 == muID ) {
         // mu mu
         maxProb = 4.0;
     } else if ( ( lep1 == muID && lep2 == eID ) ||
                 ( lep1 == eID && lep2 == muID ) ) {
         // mu e or e mu
         maxProb = 2.0;
     } else if ( lep1 == eID && lep2 == eID ) {
         // e e
         maxProb = 1e-4;
     }
 
     setProbMax( maxProb );
 }
 
 void EvtSll::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle *l1, *l2;
     l1 = p->getDaug( 0 );
     l2 = p->getDaug( 1 );
     EvtVector4R p4_p;
     p4_p.set( p->mass(), 0.0, 0.0, 0.0 );
 
     EvtVector4C l11, l12, l21, l22;
 
     l11 = EvtLeptonVACurrent( l1->spParent( 0 ), l2->spParent( 0 ) );
     l12 = EvtLeptonVACurrent( l1->spParent( 0 ), l2->spParent( 1 ) );
     l21 = EvtLeptonVACurrent( l1->spParent( 1 ), l2->spParent( 0 ) );
     l22 = EvtLeptonVACurrent( l1->spParent( 1 ), l2->spParent( 1 ) );
 
     vertex( 0, 0, p4_p * l11 );
     vertex( 0, 1, p4_p * l12 );
     vertex( 1, 0, p4_p * l21 );
     vertex( 1, 1, p4_p * l22 );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtTSS.cpp b/src/EvtGenModels/EvtTSS.cpp
index d545fce..05b13b3 100644
--- a/src/EvtGenModels/EvtTSS.cpp
+++ b/src/EvtGenModels/EvtTSS.cpp
@@ -1,81 +1,81 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtTSS.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtTSS::getName()
+std::string EvtTSS::getName() const
 {
     return "TSS";
 }
 
-EvtDecayBase* EvtTSS::clone()
+EvtDecayBase* EvtTSS::clone() const
 {
     return new EvtTSS;
 }
 
 void EvtTSS::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
 
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::TENSOR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtTSS::initProbMax()
 {
     setProbMax( 1.0 );
 }
 
 void EvtTSS::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtVector4R moms1 = p->getDaug( 0 )->getP4();
 
     double norm = 1.0 / ( moms1.d3mag() * moms1.d3mag() );
 
     vertex( 0, norm * ( p->epsTensor( 0 ).cont1( EvtVector4C( moms1 ) ) *
                         ( moms1 ) ) );
     vertex( 1, norm * ( p->epsTensor( 1 ).cont1( EvtVector4C( moms1 ) ) *
                         ( moms1 ) ) );
     vertex( 2, norm * ( p->epsTensor( 2 ).cont1( EvtVector4C( moms1 ) ) *
                         ( moms1 ) ) );
     vertex( 3, norm * ( p->epsTensor( 3 ).cont1( EvtVector4C( moms1 ) ) *
                         ( moms1 ) ) );
     vertex( 4, norm * ( p->epsTensor( 4 ).cont1( EvtVector4C( moms1 ) ) *
                         ( moms1 ) ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtTVP.cpp b/src/EvtGenModels/EvtTVP.cpp
index e94d9bf..70a8720 100644
--- a/src/EvtGenModels/EvtTVP.cpp
+++ b/src/EvtGenModels/EvtTVP.cpp
@@ -1,215 +1,215 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtTVP.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <cmath>
 
-std::string EvtTVP::getName()
+std::string EvtTVP::getName() const
 {
     return "TVP";
 }
 
-EvtDecayBase* EvtTVP::clone()
+EvtDecayBase* EvtTVP::clone() const
 {
     return new EvtTVP;
 }
 
 void EvtTVP::decay( EvtParticle* root )
 {
     if ( getNDaug() == 2 ) {
         decay_2body( root );
     } else if ( getNDaug() == 3 ) {
         decay_3body( root );
     }
 }
 
 void EvtTVP::init()
 {
     checkSpinParent( EvtSpinType::TENSOR );
 
     if ( getNDaug() == 2 ) {    // chi -> gamma psi radiative mode
         checkNArg( 0 );
         checkSpinDaughter( 0, EvtSpinType::PHOTON );
         checkSpinDaughter( 1, EvtSpinType::VECTOR );
     } else if ( getNDaug() == 3 ) {    // chi -> psi lepton lepton
         checkNDaug( 3 );
         checkSpinDaughter( 0, EvtSpinType::VECTOR );
         checkSpinDaughter( 1, EvtSpinType::DIRAC );
         checkSpinDaughter( 2, EvtSpinType::DIRAC );
         checkNArg( 1 );
         m_delta = getArg( 0 );
     }
 }
 
 void EvtTVP::initProbMax()
 {
     if ( getNDaug() == 2 ) {
         const EvtId parId = getParentId();
         if ( parId == EvtPDL::getId( "chi_b2" ) ) {
             setProbMax( 15.0 );
         } else {
             setProbMax( 2.5 );
         }
 
     } else if ( getNDaug() == 3 ) {
         double dSq = m_delta * m_delta;
         double denom = dSq - 0.2;
         double ratio( 1.0 );
         if ( fabs( denom ) > 1e-10 ) {
             ratio = dSq / denom;
         }
         double ffCor = ratio * ratio;
 
         const EvtId daugId = getDaug( 1 );
         const EvtId parId = getParentId();
 
         if ( daugId == EvtPDL::getId( "mu+" ) ||
              daugId == EvtPDL::getId( "mu-" ) ) {
             if ( parId == EvtPDL::getId( "chi_c2" ) ) {
                 setProbMax( ffCor * 85.0 );    // tested on 1e6 events
             } else if ( parId == EvtPDL::getId( "chi_b2" ) ) {
                 setProbMax( ffCor * 750.0 );    // tested on 1e6 events
             }
 
         } else if ( daugId == EvtPDL::getId( "e+" ) ||
                     daugId == EvtPDL::getId( "e-" ) ) {
             if ( parId == EvtPDL::getId( "chi_c2" ) ) {
                 setProbMax( ffCor * 3.5e3 );    // tested on 1e5 events
             } else if ( parId == EvtPDL::getId( "chi_b2" ) ) {
                 setProbMax( ffCor * 2.6e4 );
             }
         }
     }
 }
 
 void EvtTVP::decay_2body( EvtParticle* root )
 {
     root->initializePhaseSpace( getNDaug(), getDaugs() );
 
     // Photon is the first particle and psi is the second
     // to ensure decay file backwards compatibility
     EvtParticle* photon = root->getDaug( 0 );
     EvtParticle* psi = root->getDaug( 1 );
 
     EvtVector4R p = psi->getP4(),    // psi momentum
         k = photon->getP4();         // Photon momentum
 
     for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
         EvtVector4C epsPsi = psi->epsParent( iPsi ).conj();
 
         for ( int iGamma = 0; iGamma < 2; iGamma++ ) {
             EvtVector4C epsGamma = photon->epsParentPhoton( iGamma ).conj();
 
             for ( int iChi = 0; iChi < 5; iChi++ ) {
                 EvtTensor4C epsChi = root->epsTensor( iChi );
 
                 // Baranov PRD 85,014034 (2012), Eq 11
                 // amp = p^mu epsPsi^a epsChi_{a b} [k_mu epsGamma_b  - k_b epsGamma_mu]
                 EvtVector4C eee = epsChi.cont1( epsPsi );
                 EvtVector4C vvv = ( p * k ) * eee - ( k * eee ) * p;
                 EvtComplex amp = vvv * epsGamma;
                 vertex( iChi, iGamma, iPsi, amp );
             }
         }
     }
 }
 
 void EvtTVP::decay_3body( EvtParticle* root )
 {
     root->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtParticle* psi = root->getDaug( 0 );
     EvtParticle* mup = root->getDaug( 1 );
     EvtParticle* mum = root->getDaug( 2 );
 
     EvtVector4R p = psi->getP4(),    // psi momentum
         k1 = mup->getP4(),           // mu+ momentum
         k2 = mum->getP4(),           // mu- momentum
         k = k1 + k2;                 // photon momentum
 
     double kSq = k * k;
 
     // The decay amplitude needs four-vector products. Make sure we have
     // valid values for these, otherwise set the amplitude to zero.
     // We need to set _amp2 (EvtDecayAmp) via the vertex() function call
     // even when the amplitude is zero, otherwise the amplitude from the
     // previous accepted event will be used, potentially leading to biases
 
     // Selection on k^2 to avoid inefficient generation for the electron modes
     bool validAmp( true );
     if ( kSq < 1e-3 ) {
         validAmp = false;
     }
 
     double dSq = m_delta * m_delta;
     double dSqDenom = dSq - kSq;
     if ( fabs( dSqDenom ) < 1e-10 ) {
         validAmp = false;
     }
 
     double factor( 1.0 );
     if ( validAmp ) {
         factor = dSq / ( dSqDenom * kSq );
     }
 
     // Calculate the amplitude terms, looping over the psi and lepton states
     int iPols[4] = { 0, 0, 0, 0 };
 
     for ( int iChi = 0; iChi < 5; iChi++ ) {
         iPols[0] = iChi;
         EvtTensor4C epsChi = root->epsTensor( iChi );
 
         for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
             iPols[1] = iPsi;
             EvtVector4C epsPsi = psi->epsParent( iPsi ).conj();
 
             for ( int iMplus = 0; iMplus < 2; iMplus++ ) {
                 iPols[2] = iMplus;
                 EvtDiracSpinor spMplus = mup->spParent( iMplus );
 
                 for ( int iMminus = 0; iMminus < 2; iMminus++ ) {
                     iPols[3] = iMminus;
                     EvtDiracSpinor spMminus = mum->spParent( iMminus );
                     EvtVector4C epsGamma = EvtLeptonVCurrent( spMplus, spMminus );
 
                     // Based on Baranov PRD 85,014034 (2012), Eq 11
                     // amp = p^mu epsPsi^a epsChi_{a b} [k_mu epsGamma_b  - k_b epsGamma_mu]/k^2
                     EvtVector4C eee = epsChi.cont1( epsPsi );
                     EvtVector4C vvv = ( p * k ) * eee - ( k * eee ) * p;
                     EvtComplex amp( 0.0, 0.0 );
                     if ( validAmp ) {
                         amp = vvv * epsGamma;
                     }
                     amp *= factor;
 
                     // Set the amplitude matrix element using the vertex function
                     vertex( iPols, amp );
                 }
             }
         }
     }
 }
diff --git a/src/EvtGenModels/EvtTVSPwave.cpp b/src/EvtGenModels/EvtTVSPwave.cpp
index 667aacb..7a2c67d 100644
--- a/src/EvtGenModels/EvtTVSPwave.cpp
+++ b/src/EvtGenModels/EvtTVSPwave.cpp
@@ -1,169 +1,169 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtTVSPwave.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtTVSPwave::getName()
+std::string EvtTVSPwave::getName() const
 {
     return "TVS_PWAVE";
 }
 
-EvtDecayBase* EvtTVSPwave::clone()
+EvtDecayBase* EvtTVSPwave::clone() const
 {
     return new EvtTVSPwave;
 }
 
 void EvtTVSPwave::init()
 {
     // check that there are 6 arguments
     checkNArg( 6 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::TENSOR );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtTVSPwave::initProbMax()
 {
     setProbMax( 0.5 );
 }
 
 void EvtTVSPwave::decay( EvtParticle* p )
 {
     EvtComplex ap( getArg( 0 ) * cos( getArg( 1 ) ),
                    getArg( 0 ) * sin( getArg( 1 ) ) );
     EvtComplex ad( getArg( 2 ) * cos( getArg( 3 ) ),
                    getArg( 2 ) * sin( getArg( 3 ) ) );
     EvtComplex af( getArg( 4 ) * cos( getArg( 5 ) ),
                    getArg( 4 ) * sin( getArg( 5 ) ) );
 
     if ( ap != EvtComplex( 0.0, 0.0 ) || af != EvtComplex( 0.0, 0.0 ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "dfslkh8945wqh:In EvtTensorToVectorScalar.c\n";
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "P or F wave not yet implemented!! (ryd) \n";
     }
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle* v;
     v = p->getDaug( 0 );
     EvtVector4R momv = v->getP4();
     double massv = v->mass();
 
     EvtComplex temp;
     temp = ad;
     double parentMass = p->mass();
 
     EvtVector4R p_parent;
 
     p_parent.set( parentMass, 0.0, 0.0, 0.0 );
 
     EvtVector4C pep0, pep1, pep2, pep3, pep4;
     EvtTensor4C pdual;
 
     EvtVector4C epsdual0, epsdual1, epsdual2;
 
     double norm = massv /
                   ( parentMass * momv.get( 0 ) * momv.d3mag() * momv.d3mag() );
     pdual = dual( EvtGenFunctions::directProd( norm * p_parent, momv ) );
 
     epsdual0 = pdual.cont1( v->epsParent( 0 ).conj() );
     epsdual1 = pdual.cont1( v->epsParent( 1 ).conj() );
     epsdual2 = pdual.cont1( v->epsParent( 2 ).conj() );
 
     pep0 = p->epsTensor( 0 ).cont1( momv );
     pep1 = p->epsTensor( 1 ).cont1( momv );
     pep2 = p->epsTensor( 2 ).cont1( momv );
     pep3 = p->epsTensor( 3 ).cont1( momv );
     pep4 = p->epsTensor( 4 ).cont1( momv );
 
     vertex( 0, 0, pep0 * epsdual0 );
     vertex( 1, 0, pep1 * epsdual0 );
     vertex( 2, 0, pep2 * epsdual0 );
     vertex( 3, 0, pep3 * epsdual0 );
     vertex( 4, 0, pep4 * epsdual0 );
 
     vertex( 0, 1, pep0 * epsdual1 );
     vertex( 1, 1, pep1 * epsdual1 );
     vertex( 2, 1, pep2 * epsdual1 );
     vertex( 3, 1, pep3 * epsdual1 );
     vertex( 4, 1, pep4 * epsdual1 );
 
     vertex( 0, 2, pep0 * epsdual2 );
     vertex( 1, 2, pep1 * epsdual2 );
     vertex( 2, 2, pep2 * epsdual2 );
     vertex( 3, 2, pep3 * epsdual2 );
     vertex( 4, 2, pep4 * epsdual2 );
 
     return;
 }
 
 std::string EvtTVSPwave::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "PWave";
         case 1:
             return "PWavePhase";
         case 2:
             return "DWave";
         case 3:
             return "DWavePhase";
         case 4:
             return "FWave";
         case 5:
             return "FWavePhase";
         default:
             return "";
     }
 }
 
 std::string EvtTVSPwave::getParamDefault( int i )
 {
     switch ( i ) {
         case 0:
             return "0.0";
         case 1:
             return "0.0";
         case 2:
             return "1.0";
         case 3:
             return "0.0";
         case 4:
             return "0.0";
         case 5:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtTauHadnu.cpp b/src/EvtGenModels/EvtTauHadnu.cpp
index 64fb6be..a95ac4f 100644
--- a/src/EvtGenModels/EvtTauHadnu.cpp
+++ b/src/EvtGenModels/EvtTauHadnu.cpp
@@ -1,266 +1,266 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtTauHadnu.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 
-std::string EvtTauHadnu::getName()
+std::string EvtTauHadnu::getName() const
 {
     return "TAUHADNU";
 }
 
-EvtDecayBase* EvtTauHadnu::clone()
+EvtDecayBase* EvtTauHadnu::clone() const
 {
     return new EvtTauHadnu;
 }
 
 void EvtTauHadnu::init()
 {
     // check that there are 0 arguments
 
     checkSpinParent( EvtSpinType::DIRAC );
 
     //the last daughter should be a neutrino
     checkSpinDaughter( getNDaug() - 1, EvtSpinType::NEUTRINO );
 
     int i;
     for ( i = 0; i < ( getNDaug() - 1 ); i++ ) {
         checkSpinDaughter( i, EvtSpinType::SCALAR );
     }
 
     bool validndaug = false;
 
     if ( getNDaug() == 4 ) {
         //pipinu
         validndaug = true;
         checkNArg( 7 );
         m_beta = getArg( 0 );
         m_mRho = getArg( 1 );
         m_gammaRho = getArg( 2 );
         m_mRhopr = getArg( 3 );
         m_gammaRhopr = getArg( 4 );
         m_mA1 = getArg( 5 );
         m_gammaA1 = getArg( 6 );
     }
     if ( getNDaug() == 3 ) {
         //pipinu
         validndaug = true;
         checkNArg( 5 );
         m_beta = getArg( 0 );
         m_mRho = getArg( 1 );
         m_gammaRho = getArg( 2 );
         m_mRhopr = getArg( 3 );
         m_gammaRhopr = getArg( 4 );
     }
     if ( getNDaug() == 2 ) {
         //pipinu
         validndaug = true;
         checkNArg( 0 );
     }
 
     if ( !validndaug ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Have not yet implemented this final state in TAUHADNUKS model"
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
         int id;
         for ( id = 0; id < ( getNDaug() - 1 ); id++ )
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
                 << endl;
     }
 }
 
 void EvtTauHadnu::initProbMax()
 {
     if ( getNDaug() == 2 )
         setProbMax( 90.0 );
     if ( getNDaug() == 3 )
         setProbMax( 2500.0 );
     if ( getNDaug() == 4 )
         setProbMax( 30000.0 );
 }
 
 void EvtTauHadnu::decay( EvtParticle* p )
 {
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
 
     EvtIdSet thePis{ "pi+", "pi-", "pi0" };
     EvtIdSet theKs{ "K+", "K-" };
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle* nut;
     nut = p->getDaug( getNDaug() - 1 );
     p->getDaug( 0 )->getP4();
 
     //get the leptonic current
     EvtVector4C tau1, tau2;
 
     if ( p->getId() == TAUM ) {
         tau1 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 0 ) );
         tau2 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 1 ) );
     } else {
         tau1 = EvtLeptonVACurrent( p->sp( 0 ), nut->spParentNeutrino() );
         tau2 = EvtLeptonVACurrent( p->sp( 1 ), nut->spParentNeutrino() );
     }
 
     EvtVector4C hadCurr;
     bool foundHadCurr = false;
     if ( getNDaug() == 2 ) {
         hadCurr = p->getDaug( 0 )->getP4();
         foundHadCurr = true;
     }
     if ( getNDaug() == 3 ) {
         //pi pi0 nu with rho and rhopr resonance
         if ( thePis.contains( getDaug( 0 ) ) && thePis.contains( getDaug( 1 ) ) ) {
             EvtVector4R q1 = p->getDaug( 0 )->getP4();
             EvtVector4R q2 = p->getDaug( 1 )->getP4();
             double m1 = q1.mass();
             double m2 = q2.mass();
 
             hadCurr = Fpi( ( q1 + q2 ).mass2(), m1, m2 ) * ( q1 - q2 );
 
             foundHadCurr = true;
         }
     }
     if ( getNDaug() == 4 ) {
         if ( thePis.contains( getDaug( 0 ) ) && thePis.contains( getDaug( 1 ) ) &&
              thePis.contains( getDaug( 2 ) ) ) {
             //figure out which is the different charged pi
             //want it to be q3
 
             int diffPi( 0 ), samePi1( 0 ), samePi2( 0 );
             if ( getDaug( 0 ) == getDaug( 1 ) ) {
                 diffPi = 2;
                 samePi1 = 0;
                 samePi2 = 1;
             }
             if ( getDaug( 0 ) == getDaug( 2 ) ) {
                 diffPi = 1;
                 samePi1 = 0;
                 samePi2 = 2;
             }
             if ( getDaug( 1 ) == getDaug( 2 ) ) {
                 diffPi = 0;
                 samePi1 = 1;
                 samePi2 = 2;
             }
 
             EvtVector4R q1 = p->getDaug( samePi1 )->getP4();
             EvtVector4R q2 = p->getDaug( samePi2 )->getP4();
             EvtVector4R q3 = p->getDaug( diffPi )->getP4();
 
             double m1 = q1.mass();
             double m2 = q2.mass();
             double m3 = q3.mass();
 
             EvtVector4R Q = q1 + q2 + q3;
             double Q2 = Q.mass2();
             double mA12 = m_mA1 * m_mA1;
 
             double gammaA1X = m_gammaA1 * gFunc( Q2, samePi1 ) /
                               gFunc( mA12, samePi1 );
 
             EvtComplex denBW_A1( mA12 - Q2, -1. * m_mA1 * gammaA1X );
             EvtComplex BW_A1 = mA12 / denBW_A1;
 
             hadCurr = BW_A1 *
                       ( ( ( q1 - q3 ) - ( Q * ( Q * ( q1 - q3 ) ) / Q2 ) ) *
                             Fpi( ( q1 + q3 ).mass2(), m1, m3 ) +
                         ( ( q2 - q3 ) - ( Q * ( Q * ( q2 - q3 ) ) / Q2 ) ) *
                             Fpi( ( q2 + q3 ).mass2(), m2, m3 ) );
 
             foundHadCurr = true;
         }
     }
 
     if ( !foundHadCurr ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Have not yet implemented this final state in TAUHADNUKS model"
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Ndaug=" << getNDaug() << endl;
         int id;
         for ( id = 0; id < ( getNDaug() - 1 ); id++ )
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Daug " << id << " " << EvtPDL::name( getDaug( id ) ).c_str()
                 << endl;
     }
 
     vertex( 0, tau1 * hadCurr );
     vertex( 1, tau2 * hadCurr );
 
     return;
 }
 
 double EvtTauHadnu::gFunc( double Q2, int dupD )
 {
     double mpi = EvtPDL::getMeanMass( getDaug( dupD ) );
     double mpi2 = pow( mpi, 2. );
     if ( Q2 < pow( m_mRho + mpi, 2. ) ) {
         double arg = Q2 - 9. * mpi2;
         return 4.1 * pow( arg, 3. ) * ( 1. - 3.3 * arg + 5.8 * pow( arg, 2. ) );
     } else
         return Q2 * ( 1.623 + 10.38 / Q2 - 9.32 / pow( Q2, 2. ) +
                       0.65 / pow( Q2, 3. ) );
 }
 
 EvtComplex EvtTauHadnu::Fpi( double s, double xm1, double xm2 )
 {
     EvtComplex BW_rho = BW( s, m_mRho, m_gammaRho, xm1, xm2 );
     EvtComplex BW_rhopr = BW( s, m_mRhopr, m_gammaRhopr, xm1, xm2 );
 
     return ( BW_rho + m_beta * BW_rhopr ) / ( 1. + m_beta );
 }
 
 EvtComplex EvtTauHadnu::BW( double s, double m, double gamma, double xm1,
                             double xm2 )
 {
     double m2 = pow( m, 2. );
 
     if ( s > pow( xm1 + xm2, 2. ) ) {
         double qs = sqrt( fabs( ( s - pow( xm1 + xm2, 2. ) ) *
                                 ( s - pow( xm1 - xm2, 2. ) ) ) ) /
                     sqrt( s );
         double qm = sqrt( fabs( ( m2 - pow( xm1 + xm2, 2. ) ) *
                                 ( m2 - pow( xm1 - xm2, 2. ) ) ) ) /
                     m;
 
         gamma *= m2 / s * pow( qs / qm, 3. );
     } else
         gamma = 0.;
 
     EvtComplex denBW( m2 - s, -1. * sqrt( s ) * gamma );
 
     return m2 / denBW;
 }
diff --git a/src/EvtGenModels/EvtTauScalarnu.cpp b/src/EvtGenModels/EvtTauScalarnu.cpp
index 717cc5d..553947b 100644
--- a/src/EvtGenModels/EvtTauScalarnu.cpp
+++ b/src/EvtGenModels/EvtTauScalarnu.cpp
@@ -1,84 +1,84 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtTauScalarnu.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtTauScalarnu::getName()
+std::string EvtTauScalarnu::getName() const
 {
     return "TAUSCALARNU";
 }
 
-EvtDecayBase* EvtTauScalarnu::clone()
+EvtDecayBase* EvtTauScalarnu::clone() const
 {
     return new EvtTauScalarnu;
 }
 
 void EvtTauScalarnu::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::DIRAC );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::NEUTRINO );
 }
 
 void EvtTauScalarnu::initProbMax()
 {
     setProbMax( 90.0 );
 }
 
 void EvtTauScalarnu::decay( EvtParticle* p )
 {
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle* nut;
     nut = p->getDaug( 1 );
     EvtVector4R momscalar = p->getDaug( 0 )->getP4();
 
     EvtVector4C tau1, tau2;
 
     if ( p->getId() == TAUM ) {
         tau1 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 0 ) );
         tau2 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 1 ) );
     } else {
         tau1 = EvtLeptonVACurrent( p->sp( 0 ), nut->spParentNeutrino() );
         tau2 = EvtLeptonVACurrent( p->sp( 1 ), nut->spParentNeutrino() );
     }
 
     vertex( 0, tau1 * momscalar );
     vertex( 1, tau2 * momscalar );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtTauVectornu.cpp b/src/EvtGenModels/EvtTauVectornu.cpp
index f82f7ef..fd0fc68 100644
--- a/src/EvtGenModels/EvtTauVectornu.cpp
+++ b/src/EvtGenModels/EvtTauVectornu.cpp
@@ -1,90 +1,90 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtTauVectornu.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtTauVectornu::getName()
+std::string EvtTauVectornu::getName() const
 {
     return "TAUVECTORNU";
 }
 
-EvtDecayBase* EvtTauVectornu::clone()
+EvtDecayBase* EvtTauVectornu::clone() const
 {
     return new EvtTauVectornu;
 }
 
 void EvtTauVectornu::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::DIRAC );
 
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::NEUTRINO );
 }
 
 void EvtTauVectornu::initProbMax()
 {
     setProbMax( 55.0 );
 }
 
 void EvtTauVectornu::decay( EvtParticle* p )
 {
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle *v, *nut;
     v = p->getDaug( 0 );
     nut = p->getDaug( 1 );
     double mvec = v->mass();
     EvtVector4C tau1, tau2;
 
     if ( p->getId() == TAUM ) {
         tau1 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 0 ) );
         tau2 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 1 ) );
     } else {
         tau1 = EvtLeptonVACurrent( p->sp( 0 ), nut->spParentNeutrino() );
         tau2 = EvtLeptonVACurrent( p->sp( 1 ), nut->spParentNeutrino() );
     }
 
     double norm = mvec * sqrt( mvec );
 
     vertex( 0, 0, norm * tau1 * ( v->epsParent( 0 ).conj() ) );
     vertex( 0, 1, norm * tau1 * ( v->epsParent( 1 ).conj() ) );
     vertex( 0, 2, norm * tau1 * ( v->epsParent( 2 ).conj() ) );
     vertex( 1, 0, norm * tau2 * ( v->epsParent( 0 ).conj() ) );
     vertex( 1, 1, norm * tau2 * ( v->epsParent( 1 ).conj() ) );
     vertex( 1, 2, norm * tau2 * ( v->epsParent( 2 ).conj() ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtTaulnunu.cpp b/src/EvtGenModels/EvtTaulnunu.cpp
index 5e1380b..e645d4b 100644
--- a/src/EvtGenModels/EvtTaulnunu.cpp
+++ b/src/EvtGenModels/EvtTaulnunu.cpp
@@ -1,95 +1,95 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtTaulnunu.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtTaulnunu::getName()
+std::string EvtTaulnunu::getName() const
 {
     return "TAULNUNU";
 }
 
-EvtDecayBase* EvtTaulnunu::clone()
+EvtDecayBase* EvtTaulnunu::clone() const
 {
     return new EvtTaulnunu;
 }
 
 void EvtTaulnunu::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::DIRAC );
 
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::NEUTRINO );
     checkSpinDaughter( 2, EvtSpinType::NEUTRINO );
 }
 
 void EvtTaulnunu::initProbMax()
 {
     setProbMax( 650.0 );
 }
 
 void EvtTaulnunu::decay( EvtParticle* p )
 {
-    static EvtId TAUM = EvtPDL::getId( "tau-" );
+    static const EvtId TAUM = EvtPDL::getId( "tau-" );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle *l, *nul, *nut;
 
     l = p->getDaug( 0 );
     nul = p->getDaug( 1 );
     nut = p->getDaug( 2 );
 
     EvtVector4C l1, l2, tau1, tau2;
 
     if ( p->getId() == TAUM ) {
         tau1 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 0 ) );
         tau2 = EvtLeptonVACurrent( nut->spParentNeutrino(), p->sp( 1 ) );
         l1 = EvtLeptonVACurrent( l->spParent( 0 ), nul->spParentNeutrino() );
         l2 = EvtLeptonVACurrent( l->spParent( 1 ), nul->spParentNeutrino() );
 
     } else {
         tau1 = EvtLeptonVACurrent( p->sp( 0 ), nut->spParentNeutrino() );
         tau2 = EvtLeptonVACurrent( p->sp( 1 ), nut->spParentNeutrino() );
         l1 = EvtLeptonVACurrent( nul->spParentNeutrino(), l->spParent( 0 ) );
         l2 = EvtLeptonVACurrent( nul->spParentNeutrino(), l->spParent( 1 ) );
     }
 
     vertex( 0, 0, tau1 * l1 );
     vertex( 0, 1, tau1 * l2 );
     vertex( 1, 0, tau2 * l1 );
     vertex( 1, 1, tau2 * l2 );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtThreeBodyPhsp.cpp b/src/EvtGenModels/EvtThreeBodyPhsp.cpp
index f7660ca..775361e 100644
--- a/src/EvtGenModels/EvtThreeBodyPhsp.cpp
+++ b/src/EvtGenModels/EvtThreeBodyPhsp.cpp
@@ -1,122 +1,122 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtThreeBodyPhsp.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include <algorithm>
 #include <cmath>
 #include <iostream>
 
-std::string EvtThreeBodyPhsp::getName()
+std::string EvtThreeBodyPhsp::getName() const
 {
     return "THREEBODYPHSP";
 }
 
-EvtDecayBase* EvtThreeBodyPhsp::clone()
+EvtDecayBase* EvtThreeBodyPhsp::clone() const
 {
     return new EvtThreeBodyPhsp;
 }
 
 void EvtThreeBodyPhsp::init()
 {
     // check correct number of arguments
     checkNArg( 2, 4 );
     // check number of daughters
     checkNDaug( 3 );
     // Get box size
     m_m12SqMin = getArg( 0 );
     m_m12SqMax = getArg( 1 );
     if ( getNArg() > 2 ) {
         m_m23SqMin = getArg( 2 );
         m_m23SqMax = getArg( 3 );
     } else {
         m_m23SqMin = 0;
         m_m23SqMax = 1e10;
     }
 }
 
 void EvtThreeBodyPhsp::initProbMax()
 {
     noProbMax();
 }
 
 void EvtThreeBodyPhsp::decay( EvtParticle* p )
 {
     p->makeDaughters( getNDaug(), getDaugs() );
     p->generateMassTree();
     const double mParent = p->mass();
     EvtParticle* daug1 = p->getDaug( 0 );
     EvtParticle* daug2 = p->getDaug( 1 );
     EvtParticle* daug3 = p->getDaug( 2 );
     const double mDaug1 = daug1->mass();
     const double mDaug2 = daug2->mass();
     const double mDaug3 = daug3->mass();
 
     const double m12borderMin = mDaug1 + mDaug2;
     const double m12borderMax = mParent - mDaug3;
     const double m12Min = std::max( m_m12SqMin, m12borderMin * m12borderMin );
     const double m12Max = std::min( m_m12SqMax, m12borderMax * m12borderMax );
 
     const double m23borderMin = mDaug2 + mDaug3;
     const double m23borderMax = mParent - mDaug1;
     const double m23Min = std::max( m_m23SqMin, m23borderMin * m23borderMin );
     const double m23Max = std::min( m_m23SqMax, m23borderMax * m23borderMax );
 
     const int nMaxTrials = 1000;
     int iTrial = 0;
     bool goodEvent = false;
     double m12Sq, m23Sq, m23LowLimit, m23HighLimit;
     do {
         m12Sq = EvtRandom::Flat( m12Min, m12Max );
         m23Sq = EvtRandom::Flat( m23Min, m23Max );
         // By definition, m12Sq is always within Dalitz plot, but need to check
         // that also m23Sq is in
         double E2st = 0.5 * ( m12Sq - mDaug1 * mDaug1 + mDaug2 * mDaug2 ) /
                       std::sqrt( m12Sq );
         double E3st = 0.5 * ( mParent * mParent - m12Sq - mDaug3 * mDaug3 ) /
                       std::sqrt( m12Sq );
         double p2st = std::sqrt( E2st * E2st - mDaug2 * mDaug2 );
         double p3st = std::sqrt( E3st * E3st - mDaug3 * mDaug3 );
         m23HighLimit = ( E2st + E3st ) * ( E2st + E3st ) -
                        ( p2st - p3st ) * ( p2st - p3st );
         m23LowLimit = ( E2st + E3st ) * ( E2st + E3st ) -
                       ( p2st + p3st ) * ( p2st + p3st );
         if ( m23Sq > m23LowLimit && m23Sq < m23HighLimit ) {
             goodEvent = true;
         }
         ++iTrial;
     } while ( goodEvent == false && iTrial < nMaxTrials );
     if ( !goodEvent ) {
         EvtGenReport( EVTGEN_WARNING, "EvtThreeBodyPhsp" )
             << "Failed to generate m12Sq and m23Sq. Taking last m12Sq and midpoint of allowed m23Sq.\n";
         m23Sq = 0.5 * ( m23LowLimit + m23HighLimit );
     }
 
     // At this moment we have valid invariant masses squared
     EvtGenKine::ThreeBodyKine( m12Sq, m23Sq, p );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVPHOtoVISRHi.cpp b/src/EvtGenModels/EvtVPHOtoVISRHi.cpp
index a863b76..a4afcdd 100644
--- a/src/EvtGenModels/EvtVPHOtoVISRHi.cpp
+++ b/src/EvtGenModels/EvtVPHOtoVISRHi.cpp
@@ -1,316 +1,316 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVPHOtoVISRHi.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include <stdlib.h>
 #include <string>
 
 using std::endl;
 
-std::string EvtVPHOtoVISRHi::getName()
+std::string EvtVPHOtoVISRHi::getName() const
 {
     return "VPHOTOVISRHI";
 }
 
-EvtDecayBase* EvtVPHOtoVISRHi::clone()
+EvtDecayBase* EvtVPHOtoVISRHi::clone() const
 {
     return new EvtVPHOtoVISRHi;
 }
 
 void EvtVPHOtoVISRHi::init()
 {
     // check that there are 0 or 1 arguments
     checkNArg( 0, 1 );
 
     // check that there are 2 daughters
     checkNDaug( 2 );
 
     // check the parent and daughter spins
     checkSpinParent( EvtSpinType::VECTOR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::PHOTON );
 }
 
 void EvtVPHOtoVISRHi::initProbMax()
 {
     setProbMax( 20.0 );
 }
 
 void EvtVPHOtoVISRHi::decay( EvtParticle* p )
 {
     //take photon along z-axis, either forward or backward.
     //Implement this as generating the photon momentum along
     //the z-axis uniformly
     double power = 1;
     if ( getNArg() == 1 )
         power = getArg( 0 );
     // define particle names
-    static EvtId D0 = EvtPDL::getId( "D0" );
-    static EvtId D0B = EvtPDL::getId( "anti-D0" );
-    static EvtId DP = EvtPDL::getId( "D+" );
-    static EvtId DM = EvtPDL::getId( "D-" );
-    static EvtId DSM = EvtPDL::getId( "D_s-" );
-    static EvtId DSP = EvtPDL::getId( "D_s+" );
-    static EvtId DSMS = EvtPDL::getId( "D_s*-" );
-    static EvtId DSPS = EvtPDL::getId( "D_s*+" );
-    static EvtId D0S = EvtPDL::getId( "D*0" );
-    static EvtId D0BS = EvtPDL::getId( "anti-D*0" );
-    static EvtId DPS = EvtPDL::getId( "D*+" );
-    static EvtId DMS = EvtPDL::getId( "D*-" );
+    static const EvtId D0 = EvtPDL::getId( "D0" );
+    static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+    static const EvtId DP = EvtPDL::getId( "D+" );
+    static const EvtId DM = EvtPDL::getId( "D-" );
+    static const EvtId DSM = EvtPDL::getId( "D_s-" );
+    static const EvtId DSP = EvtPDL::getId( "D_s+" );
+    static const EvtId DSMS = EvtPDL::getId( "D_s*-" );
+    static const EvtId DSPS = EvtPDL::getId( "D_s*+" );
+    static const EvtId D0S = EvtPDL::getId( "D*0" );
+    static const EvtId D0BS = EvtPDL::getId( "anti-D*0" );
+    static const EvtId DPS = EvtPDL::getId( "D*+" );
+    static const EvtId DMS = EvtPDL::getId( "D*-" );
     // setup some parameters
     double w = p->mass();
     double s = w * w;
     double L = 2.0 * log( w / 0.000511 );
     double alpha = 1 / 137.0;
     double beta = ( L - 1 ) * 2.0 * alpha / EvtConst::pi;
     // make sure only 2 or 3 body are present
     assert( p->getDaug( 0 )->getNDaug() == 2 || p->getDaug( 0 )->getNDaug() == 3 );
 
     // determine minimum rest mass of parent
     double md1 = EvtPDL::getMeanMass( p->getDaug( 0 )->getDaug( 0 )->getId() );
     double md2 = EvtPDL::getMeanMass( p->getDaug( 0 )->getDaug( 1 )->getId() );
     double minResMass = md1 + md2;
     if ( p->getDaug( 0 )->getNDaug() == 3 ) {
         double md3 = EvtPDL::getMeanMass( p->getDaug( 0 )->getDaug( 2 )->getId() );
         minResMass = minResMass + md3;
     }
 
     // calculate the maximum energy of the ISR photon
     double pgmax = ( s - minResMass * minResMass ) / ( 2.0 * w );
     double pgz = 0.99 * pgmax *
                  exp( log( EvtRandom::Flat( 1.0 ) ) / ( beta * power ) );
     if ( EvtRandom::Flat( 1.0 ) < 0.5 )
         pgz = -pgz;
 
     double k = fabs( pgz );
     // print of ISR energy
     // std::cout << "Energy ISR :"<< k <<std::endl;
     EvtVector4R p4g( k, 0.0, 0.0, pgz );
 
     EvtVector4R p4res = p->getP4Restframe() - p4g;
 
     double mres = p4res.mass();
 
     // set masses
     p->getDaug( 0 )->init( getDaug( 0 ), p4res );
     p->getDaug( 1 )->init( getDaug( 1 ), p4g );
 
     // determine XS - langbw
     // very crude way of determining XS just a simple straight line Approx.
     // this was determined by eye.
     // lots of cout statements to make plots to check that things are working as expected
     double sigma = 9.0;
     if ( mres <= 3.9 )
         sigma = 0.00001;
 
     bool sigmacomputed( false );
 
     // DETERMINE XS FOR D*D*
     if ( p->getDaug( 0 )->getNDaug() == 2 &&
          ( ( p->getDaug( 0 )->getDaug( 0 )->getId() == D0S &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == D0BS ) ||
            ( p->getDaug( 0 )->getDaug( 0 )->getId() == DPS &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == DMS ) ) ) {
         if ( mres > 4.18 ) {
             sigma *= 5. / 9. *
                      ( 1. - 1. * sqrt( ( 4.18 - mres ) * ( 4.18 - mres ) ) /
                                 ( 4.3 - 4.18 ) );
         } else if ( mres > 4.07 && mres <= 4.18 ) {
             sigma *= 5. / 9.;
         } else if ( mres <= 4.07 && mres > 4.03 ) {
             sigma *= ( 5. / 9. - 1.5 / 9. *
                                      sqrt( ( 4.07 - mres ) * ( 4.07 - mres ) ) /
                                      ( 4.07 - 4.03 ) );
         } else if ( mres <= 4.03 && mres >= 4.013 ) {
             sigma *= ( 3.5 / 9. - 3.5 / 9. *
                                       sqrt( ( 4.03 - mres ) * ( 4.03 - mres ) ) /
                                       ( 4.03 - 4.013 ) );
         } else {
             sigma = 0.00001;
         }
         sigmacomputed = true;
         //     std::cout << "DSDSXS "<<sigma<< " " <<  mres<<std::endl;
     }
 
     // DETERMINE XS FOR D*D
     if ( p->getDaug( 0 )->getNDaug() == 2 &&
          ( ( p->getDaug( 0 )->getDaug( 0 )->getId() == D0S &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == D0B ) ||
            ( p->getDaug( 0 )->getDaug( 0 )->getId() == DPS &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == DM ) ||
            ( p->getDaug( 0 )->getDaug( 0 )->getId() == D0BS &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == D0 ) ||
            ( p->getDaug( 0 )->getDaug( 0 )->getId() == DMS &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == DP ) ) ) {
         if ( mres >= 4.2 ) {
             sigma *= 1.5 / 9.;
         } else if ( mres > 4.06 && mres < 4.2 ) {
             sigma *= ( ( 1.5 / 9. + 2.5 / 9. *
                                         sqrt( ( 4.2 - mres ) * ( 4.2 - mres ) ) /
                                         ( 4.2 - 4.06 ) ) );
         } else if ( mres >= 4.015 && mres < 4.06 ) {
             sigma *= ( ( 4. / 9. +
                          3. / 9. * sqrt( ( 4.06 - mres ) * ( 4.06 - mres ) ) /
                              ( 4.06 - 4.015 ) ) );
         } else if ( mres < 4.015 && mres >= 3.9 ) {
             sigma *= ( ( 7. / 9. -
                          7 / 9. * sqrt( ( 4.015 - mres ) * ( 4.015 - mres ) ) /
                              ( 4.015 - 3.9 ) ) );
         } else {
             sigma = 0.00001;
         }
         sigmacomputed = true;
         //     std::cout << "DSDXS "<<sigma<< " " <<  mres<<std::endl;
     }
 
     // DETERMINE XS FOR Ds*Ds*
     if ( ( ( p->getDaug( 0 )->getDaug( 0 )->getId() == DSPS &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == DSMS ) ) ) {
         if ( mres > ( 2.112 + 2.112 ) ) {
             sigma = 0.4;
         } else {
             //      sigma=0.4;
             //      sigma = 0 surely below Ds*Ds* threshold? - ponyisi
             sigma = 0.00001;
         }
         sigmacomputed = true;
         //     std::cout << "DsSDsSXS "<<sigma<< " " <<  mres<<std::endl;
     }
 
     // DETERMINE XS FOR Ds*Ds
     if ( p->getDaug( 0 )->getNDaug() == 2 &&
          ( ( p->getDaug( 0 )->getDaug( 0 )->getId() == DSPS &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == DSM ) ||
            ( p->getDaug( 0 )->getDaug( 0 )->getId() == DSMS &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == DSP ) ) ) {
         if ( mres > 4.26 ) {
             sigma = 0.05;
         } else if ( mres > 4.18 && mres <= 4.26 ) {
             sigma *= 1. / 9. *
                      ( 0.05 + 0.95 * sqrt( ( 4.26 - mres ) * ( 4.26 - mres ) ) /
                                   ( 4.26 - 4.18 ) );
         } else if ( mres > 4.16 && mres <= 4.18 ) {
             sigma *= 1 / 9.;
         } else if ( mres <= 4.16 && mres > 4.08 ) {
             sigma *= 1 / 9. *
                      ( 1 - sqrt( ( 4.16 - mres ) * ( 4.16 - mres ) ) /
                                ( 4.16 - 4.08 ) );
         } else if ( mres <= ( 4.08 ) ) {
             sigma = 0.00001;
         }
         sigmacomputed = true;
         //     std::cout << "DsSDsXS "<<sigma<< " " <<  mres<<std::endl;
     }
 
     // DETERMINE XS FOR DD
     if ( p->getDaug( 0 )->getNDaug() == 2 &&
          ( ( p->getDaug( 0 )->getDaug( 0 )->getId() == D0 &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == D0B ) ||
            ( p->getDaug( 0 )->getDaug( 0 )->getId() == DP &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == DM ) ) ) {
         sigma *= 0.4 / 9.;
         sigmacomputed = true;
         //     std::cout << "DDXS "<<sigma<< " " <<  mres<<std::endl;
     }
 
     // DETERMINE XS FOR DsDs
     if ( p->getDaug( 0 )->getNDaug() == 2 &&
          ( ( p->getDaug( 0 )->getDaug( 0 )->getId() == DSP &&
              p->getDaug( 0 )->getDaug( 1 )->getId() == DSM ) ) ) {
         sigma *= 0.2 / 9.;
         sigmacomputed = true;
         //     std::cout << "DsDsXS "<<sigma<< " " <<  mres<<std::endl;
     }
 
     // DETERMINE XS FOR MULTIBODY
     if ( p->getDaug( 0 )->getNDaug() == 3 ) {
         if ( mres > 4.03 ) {
             sigma *= 0.5 / 9.;
         } else {
             sigma = 0.00001;
         }
         sigmacomputed = true;
         //     std::cout << "DSDpiXS "<<sigma<< " " <<  mres<<std::endl;
     }
 
     if ( !sigmacomputed ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "VPHOTOVISRHI: This model requires daughters to be listed in a particular order."
             << endl
             << "The following are acceptable:" << endl
             << "D0 anti-D0" << endl
             << "D+ D-" << endl
             << "D*0 anti-D0" << endl
             << "anti-D*0 D0" << endl
             << "D*+ D-" << endl
             << "D*- D+" << endl
             << "D*0 anti-D*0" << endl
             << "D*+ D*-" << endl
             << "D_s+ D_s-" << endl
             << "D_s*+ D_s-" << endl
             << "D_s*- D_s+" << endl
             << "D_s*+ D_s*-" << endl
             << "(D* D pi can be in any order)" << endl
             << "Aborting..." << endl;
         assert( 0 );
     }
 
     if ( sigma < 0 )
         sigma = 0.0;
 
     double norm = sqrt( sigma );
 
     //  EvtParticle* d=p->getDaug(0);
 
     vertex( 0, 0, 0, norm * p->eps( 0 ) * p->epsParent( 0 ).conj() );
     vertex( 1, 0, 0, norm * p->eps( 1 ) * p->epsParent( 0 ).conj() );
     vertex( 2, 0, 0, norm * p->eps( 2 ) * p->epsParent( 0 ).conj() );
 
     vertex( 0, 1, 0, norm * p->eps( 0 ) * p->epsParent( 1 ).conj() );
     vertex( 1, 1, 0, norm * p->eps( 1 ) * p->epsParent( 1 ).conj() );
     vertex( 2, 1, 0, norm * p->eps( 2 ) * p->epsParent( 1 ).conj() );
 
     vertex( 0, 2, 0, norm * p->eps( 0 ) * p->epsParent( 2 ).conj() );
     vertex( 1, 2, 0, norm * p->eps( 1 ) * p->epsParent( 2 ).conj() );
     vertex( 2, 2, 0, norm * p->eps( 2 ) * p->epsParent( 2 ).conj() );
 
     vertex( 0, 0, 1, norm * p->eps( 0 ) * p->epsParent( 0 ).conj() );
     vertex( 1, 0, 1, norm * p->eps( 1 ) * p->epsParent( 0 ).conj() );
     vertex( 2, 0, 1, norm * p->eps( 2 ) * p->epsParent( 0 ).conj() );
 
     vertex( 0, 1, 1, norm * p->eps( 0 ) * p->epsParent( 1 ).conj() );
     vertex( 1, 1, 1, norm * p->eps( 1 ) * p->epsParent( 1 ).conj() );
     vertex( 2, 1, 1, norm * p->eps( 2 ) * p->epsParent( 1 ).conj() );
 
     vertex( 0, 2, 1, norm * p->eps( 0 ) * p->epsParent( 2 ).conj() );
     vertex( 1, 2, 1, norm * p->eps( 1 ) * p->epsParent( 2 ).conj() );
     vertex( 2, 2, 1, norm * p->eps( 2 ) * p->epsParent( 2 ).conj() );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVSPPwave.cpp b/src/EvtGenModels/EvtVSPPwave.cpp
index f066af4..517bd1c 100644
--- a/src/EvtGenModels/EvtVSPPwave.cpp
+++ b/src/EvtGenModels/EvtVSPPwave.cpp
@@ -1,104 +1,104 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVSPPwave.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtVSPPwave::getName()
+std::string EvtVSPPwave::getName() const
 {
     return "VSP_PWAVE";
 }
 
-EvtDecayBase* EvtVSPPwave::clone()
+EvtDecayBase* EvtVSPPwave::clone() const
 {
     return new EvtVSPPwave;
 }
 
 void EvtVSPPwave::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::VECTOR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::PHOTON );
 }
 
 void EvtVSPPwave::initProbMax()
 {
     setProbMax( 1 );
 }
 
 void EvtVSPPwave::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle* gamma;
     gamma = p->getDaug( 1 );
 
     double m_p = p->mass();
     EvtVector4R momgamma = gamma->getP4();
 
     //work in the parent ,p,  rest frame.
     EvtVector4R p4_p;
     p4_p.set( m_p, 0.0, 0.0, 0.0 );
 
     //  Put phase space results into the daughters.
 
     EvtTensor4C tds;
 
     double norm = 1 / ( m_p * momgamma.d3mag() );
 
     tds = dual( EvtGenFunctions::directProd( norm * p4_p, momgamma ) );
 
     vertex(
         0, 0,
         ( tds.cont1( p->eps( 0 ) ) ).cont( gamma->epsParentPhoton( 0 ).conj() ) );
     vertex(
         0, 1,
         ( tds.cont1( p->eps( 0 ) ) ).cont( gamma->epsParentPhoton( 1 ).conj() ) );
 
     vertex(
         1, 0,
         ( tds.cont1( p->eps( 1 ) ) ).cont( gamma->epsParentPhoton( 0 ).conj() ) );
     vertex(
         1, 1,
         ( tds.cont1( p->eps( 1 ) ) ).cont( gamma->epsParentPhoton( 1 ).conj() ) );
 
     vertex(
         2, 0,
         ( tds.cont1( p->eps( 2 ) ) ).cont( gamma->epsParentPhoton( 0 ).conj() ) );
     vertex(
         2, 1,
         ( tds.cont1( p->eps( 2 ) ) ).cont( gamma->epsParentPhoton( 1 ).conj() ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVSSBMixCPT.cpp b/src/EvtGenModels/EvtVSSBMixCPT.cpp
index 13abfb6..e404b05 100644
--- a/src/EvtGenModels/EvtVSSBMixCPT.cpp
+++ b/src/EvtGenModels/EvtVSSBMixCPT.cpp
@@ -1,388 +1,388 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVSSBMixCPT.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtVSSBMixCPT::getName()
+std::string EvtVSSBMixCPT::getName() const
 {
     return "VSS_BMIX";
 }
 
-EvtDecayBase* EvtVSSBMixCPT::clone()
+EvtDecayBase* EvtVSSBMixCPT::clone() const
 {
     return new EvtVSSBMixCPT;
 }
 
 void EvtVSSBMixCPT::init()
 {
     if ( getNArg() > 4 )
         checkNArg( 14, 12, 8 );
 
     if ( getNArg() < 1 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVSSBMix generator expected "
             << " at least 1 argument (deltam) but found:" << getNArg() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     // check that we are asked to produced exactly 2 daughters
     //4 are allowed if they are aliased..
     checkNDaug( 2, 4 );
 
     if ( getNDaug() == 4 ) {
         if ( getDaug( 0 ) != getDaug( 2 ) || getDaug( 1 ) != getDaug( 3 ) ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "EvtVSSBMixCPT generator allows "
                 << " 4 daughters only if 1=3 and 2=4"
                 << " (but 3 and 4 are aliased " << endl;
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Will terminate execution!" << endl;
             ::abort();
         }
     }
     // check that we are asked to decay a vector particle into a pair
     // of scalar particles
 
     checkSpinParent( EvtSpinType::VECTOR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 
     // check that our daughter particles are charge conjugates of each other
     if ( !( EvtPDL::chargeConj( getDaug( 0 ) ) == getDaug( 1 ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVSSBMixCPT generator expected daughters "
             << "to be charge conjugate." << endl
             << "  Found " << EvtPDL::name( getDaug( 0 ) ).c_str() << " and "
             << EvtPDL::name( getDaug( 1 ) ).c_str() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     // check that both daughter particles have the same lifetime
     if ( EvtPDL::getctau( getDaug( 0 ) ) != EvtPDL::getctau( getDaug( 1 ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVSSBMixCPT generator expected daughters "
             << "to have the same lifetime." << endl
             << "  Found ctau = " << EvtPDL::getctau( getDaug( 0 ) )
             << " mm and " << EvtPDL::getctau( getDaug( 1 ) ) << " mm" << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     // precompute quantities that will be used to generate events
     // and print out a summary of parameters for this decay
 
     // mixing frequency in hbar/mm
     m_freq = getArg( 0 ) / EvtConst::c;
 
     // deltaG
     double gamma = 1 / EvtPDL::getctau( getDaug( 0 ) );    // gamma/c (1/mm)
     m_dGamma = 0.0;
     double dgog = 0.0;
     if ( getNArg() > 1 ) {
         dgog = getArg( 1 );
         m_dGamma = dgog * gamma;
     }
     // q/p
     m_qoverp = EvtComplex( 1.0, 0.0 );
     if ( getNArg() > 2 ) {
         m_qoverp = EvtComplex( getArg( 2 ), 0.0 );
     }
     if ( getNArg() > 3 ) {
         m_qoverp = getArg( 2 ) *
                    EvtComplex( cos( getArg( 3 ) ), sin( getArg( 3 ) ) );
     }
     m_poverq = 1.0 / m_qoverp;
 
     // decay amplitudes
     m_A_f = EvtComplex( 1.0, 0.0 );
     m_Abar_f = EvtComplex( 0.0, 0.0 );
     m_A_fbar = m_Abar_f;    // CPT conservation
     m_Abar_fbar = m_A_f;    // CPT conservation
     if ( getNArg() > 4 ) {
         m_A_f = getArg( 4 ) *
                 EvtComplex( cos( getArg( 5 ) ),
                             sin( getArg( 5 ) ) );    // this allows for DCSD
         m_Abar_f = getArg( 6 ) *
                    EvtComplex( cos( getArg( 7 ) ),
                                sin( getArg( 7 ) ) );    // this allows for DCSD
         if ( getNArg() > 8 ) {
             // CPT violation in decay
             m_A_fbar = getArg( 8 ) *
                        EvtComplex( cos( getArg( 9 ) ), sin( getArg( 9 ) ) );
             m_Abar_fbar = getArg( 10 ) * EvtComplex( cos( getArg( 11 ) ),
                                                      sin( getArg( 11 ) ) );
         } else {
             // CPT conservation in decay
             m_A_fbar = m_Abar_f;
             m_Abar_fbar = m_A_f;
         }
     }
 
     // CPT violation in mixing
     m_z = EvtComplex( 0.0, 0.0 );
     if ( getNArg() > 12 ) {
         m_z = EvtComplex( getArg( 12 ), getArg( 13 ) );
     }
 
     // some printout
     double tau = 1e12 * EvtPDL::getctau( getDaug( 0 ) ) / EvtConst::c;    // in ps
     double dm = 1e-12 * getArg( 0 );    // B0/anti-B0 mass difference in hbar/ps
     double x = dm * tau;
     double y = dgog * 0.5;    //y=dgamma/(2*gamma)
     double qop2 = abs( m_qoverp * m_qoverp );
     m_chib0_b0bar = qop2 * ( x * x + y * y ) /
                     ( qop2 * ( x * x + y * y ) + 2 + x * x -
                       y * y );    // does not include CPT in mixing
     m_chib0bar_b0 = ( 1 / qop2 ) * ( x * x + y * y ) /
                     ( ( 1 / qop2 ) * ( x * x + y * y ) + 2 + x * x -
                       y * y );    // does not include CPT in mixing
 
     if ( verbose() ) {
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << "VSS_BMIXCPT will generate mixing and CPT/CP effects in mixing:"
             << endl
             << endl
             << "    " << EvtPDL::name( getParentId() ).c_str() << " --> "
             << EvtPDL::name( getDaug( 0 ) ).c_str() << " + "
             << EvtPDL::name( getDaug( 1 ) ).c_str() << endl
             << endl
             << "using parameters:" << endl
             << endl
             << "  delta(m)  = " << dm << " hbar/ps" << endl
             << "  freq      = " << m_freq << " hbar/mm" << endl
             << "  dgog      = " << dgog << endl
             << "  dGamma    = " << m_dGamma << " hbar/mm" << endl
             << "  q/p       = " << m_qoverp << endl
             << "  z         = " << m_z << endl
             << "  tau       = " << tau << " ps" << endl
             << "  x         = " << x << endl
             << " chi(B0->B0bar) = " << m_chib0_b0bar << endl
             << " chi(B0bar->B0) = " << m_chib0bar_b0 << endl
             << " Af         = " << m_A_f << endl
             << " Abarf      = " << m_Abar_f << endl
             << " Afbar      = " << m_A_fbar << endl
             << " Abarfbar   = " << m_Abar_fbar << endl
             << endl;
     }
 }
 
 void EvtVSSBMixCPT::initProbMax()
 {
     // this value is ok for reasonable values of all the parameters
     setProbMax( 4.0 );
 }
 
 void EvtVSSBMixCPT::decay( EvtParticle* p )
 {
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     // generate a final state according to phase space
 
     double rndm = EvtRandom::random();
 
     if ( getNDaug() == 4 ) {
         EvtId tempDaug[2];
 
         if ( rndm < 0.5 ) {
             tempDaug[0] = getDaug( 0 );
             tempDaug[1] = getDaug( 3 );
         } else {
             tempDaug[0] = getDaug( 2 );
             tempDaug[1] = getDaug( 1 );
         }
 
         p->initializePhaseSpace( 2, tempDaug );
     } else {    //nominal case.
         p->initializePhaseSpace( 2, getDaugs() );
     }
 
     EvtParticle *s1, *s2;
 
     s1 = p->getDaug( 0 );
     s2 = p->getDaug( 1 );
     //delete any daughters - if there are daughters, they
     //are from the initialization and will be redone later
     if ( s1->getNDaug() > 0 ) {
         s1->deleteDaughters();
     }
     if ( s2->getNDaug() > 0 ) {
         s2->deleteDaughters();
     }
 
     EvtVector4R p1 = s1->getP4();
     EvtVector4R p2 = s2->getP4();
 
     // throw a random number to decide if this final state should be mixed
     rndm = EvtRandom::random();
     int mixed = ( rndm < 0.5 ) ? 1 : 0;
 
     // if this decay is mixed, choose one of the 2 possible final states
     // with equal probability (re-using the same random number)
     if ( mixed == 1 ) {
         EvtId mixedId = ( rndm < 0.25 ) ? getDaug( 0 ) : getDaug( 1 );
         EvtId mixedId2 = mixedId;
         if ( getNDaug() == 4 && rndm < 0.25 )
             mixedId2 = getDaug( 2 );
         if ( getNDaug() == 4 && rndm > 0.25 )
             mixedId2 = getDaug( 3 );
         s1->init( mixedId, p1 );
         s2->init( mixedId2, p2 );
     }
 
     // if this decay is unmixed, choose one of the 2 possible final states
     // with equal probability (re-using the same random number)
     if ( mixed == 0 ) {
         EvtId unmixedId = ( rndm < 0.75 ) ? getDaug( 0 ) : getDaug( 1 );
         EvtId unmixedId2 = ( rndm < 0.75 ) ? getDaug( 1 ) : getDaug( 0 );
         if ( getNDaug() == 4 && rndm < 0.75 )
             unmixedId2 = getDaug( 3 );
         if ( getNDaug() == 4 && rndm > 0.75 )
             unmixedId2 = getDaug( 2 );
         s1->init( unmixedId, p1 );
         s2->init( unmixedId2, p2 );
     }
 
     // choose a decay time for each final state particle using the
     // lifetime (which must be the same for both particles) in pdt.table
     // and calculate the lifetime difference for this event
     s1->setLifetime();
     s2->setLifetime();
     double dct = s1->getLifetime() - s2->getLifetime();    // in mm
 
     // Convention: m_dGamma=GammaLight-GammaHeavy
     EvtComplex exp1( -0.25 * m_dGamma * dct, 0.5 * m_freq * dct );
 
     /*
   //Find the flavor of the B that decayed first.
   EvtId firstDec = (dct > 0 ) ? s2->getId() : s1->getId();
 
   //This tags the flavor of the other particle at that time.
   EvtId stateAtDeltaTeq0 = ( firstDec==B0 ) ? B0B : B0;
   */
     EvtId stateAtDeltaTeq0 = ( s2->getId() == B0 ) ? B0B : B0;
 
     // calculate the oscillation amplitude, based on wether this event is mixed or not
     EvtComplex osc_amp;
 
     //define some useful functions: (see BAD #188 eq. 39 for ref.)
     EvtComplex gp = 0.5 * ( exp( -1.0 * exp1 ) + exp( exp1 ) );
     EvtComplex gm = 0.5 * ( exp( -1.0 * exp1 ) - exp( exp1 ) );
     EvtComplex sqz = sqrt( abs( 1 - m_z * m_z ) ) *
                      exp( EvtComplex( 0, arg( 1 - m_z * m_z ) / 2 ) );
 
     EvtComplex BB = gp + m_z * gm;              // <B0|B0(t)>
     EvtComplex barBB = -sqz * m_qoverp * gm;    // <B0bar|B0(t)>
     EvtComplex BbarB = -sqz * m_poverq * gm;    // <B0|B0bar(t)>
     EvtComplex barBbarB = gp - m_z * gm;        // <B0bar|B0bar(t)>
 
     //
     if ( !mixed && stateAtDeltaTeq0 == B0 ) {
         osc_amp = BB * m_A_f + barBB * m_Abar_f;
     }
     if ( !mixed && stateAtDeltaTeq0 == B0B ) {
         osc_amp = barBbarB * m_Abar_fbar + BbarB * m_A_fbar;
     }
 
     if ( mixed && stateAtDeltaTeq0 == B0 ) {
         osc_amp = barBB * m_Abar_fbar + BB * m_A_fbar;
     }
     if ( mixed && stateAtDeltaTeq0 == B0B ) {
         osc_amp = BbarB * m_A_f + barBbarB * m_Abar_f;
     }
 
     // store the amplitudes for each parent spin basis state
     double norm = 1.0 / p1.d3mag();
     vertex( 0, norm * osc_amp * p1 * ( p->eps( 0 ) ) );
     vertex( 1, norm * osc_amp * p1 * ( p->eps( 1 ) ) );
     vertex( 2, norm * osc_amp * p1 * ( p->eps( 2 ) ) );
 
     return;
 }
 
 std::string EvtVSSBMixCPT::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "deltaM";
         case 1:
             return "deltaGammaOverGamma";
         case 2:
             return "qOverP";
         case 3:
             return "qOverPPhase";
         case 4:
             return "Af";
         case 5:
             return "AfPhase";
         case 6:
             return "Abarf";
         case 7:
             return "AbarfPhase";
         case 8:
             return "Afbar";
         case 9:
             return "AfbarPhase";
         case 10:
             return "Abarfbar";
         case 11:
             return "AbarfbarPhase";
         case 12:
             return "Z";
         case 13:
             return "ZPhase";
         default:
             return "";
     }
 }
 
 std::string EvtVSSBMixCPT::getParamDefault( int i )
 {
     switch ( i ) {
         case 3:
             return "0.0";
         case 4:
             return "1.0";
         case 5:
             return "0.0";
         case 6:
             return "1.0";
         case 7:
             return "0.0";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtVSSMix.cpp b/src/EvtGenModels/EvtVSSMix.cpp
index 3e402c9..4e8fc5e 100644
--- a/src/EvtGenModels/EvtVSSMix.cpp
+++ b/src/EvtGenModels/EvtVSSMix.cpp
@@ -1,117 +1,117 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVSSMix.hh"
 
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 
-std::string EvtVSSMix::getName()
+std::string EvtVSSMix::getName() const
 {
     return "VSS_MIX";
 }
 
-EvtDecayBase* EvtVSSMix::clone()
+EvtDecayBase* EvtVSSMix::clone() const
 {
     return new EvtVSSMix;
 }
 
 void EvtVSSMix::init()
 {
     // check that there are 1 arguments
     checkNArg( 1 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::VECTOR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtVSSMix::initProbMax()
 {
     setProbMax( 0.5 );
 }
 
 void EvtVSSMix::decay( EvtParticle* p )
 {
     //added by Lange Jan4,2000
-    static EvtId B0 = EvtPDL::getId( "B0" );
-    static EvtId B0B = EvtPDL::getId( "anti-B0" );
+    static const EvtId B0 = EvtPDL::getId( "B0" );
+    static const EvtId B0B = EvtPDL::getId( "anti-B0" );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtParticle *s1, *s2;
     s1 = p->getDaug( 0 );
     s2 = p->getDaug( 1 );
     EvtVector4R s1mom = s1->getP4();
 
     double t1, t2, dm;
 
     s1->setLifetime();
     s2->setLifetime();
 
     t1 = s1->getLifetime();
     t2 = s2->getLifetime();
 
     //dm should probably be a parameter to this model.
 
     dm = getArg( 0 ) / EvtConst::c;
 
     EvtId d1, d2;
 
     d1 = s1->getId();
     d2 = s2->getId();
 
     double mix_amp = 0.;
     if ( d1 == B0 && d2 == B0B )
         mix_amp = cos( 0.5 * dm * ( t1 - t2 ) );
     if ( d1 == B0B && d2 == B0 )
         mix_amp = cos( 0.5 * dm * ( t1 - t2 ) );
     if ( d1 == B0 && d2 == B0 )
         mix_amp = sin( 0.5 * dm * ( t1 - t2 ) );
     if ( d1 == B0B && d2 == B0B )
         mix_amp = sin( 0.5 * dm * ( t1 - t2 ) );
 
     double norm = 1.0 / s1mom.d3mag();
 
     vertex( 0, norm * mix_amp * s1mom * ( p->eps( 0 ) ) );
     vertex( 1, norm * mix_amp * s1mom * ( p->eps( 1 ) ) );
     vertex( 2, norm * mix_amp * s1mom * ( p->eps( 2 ) ) );
 
     return;
 }
 
 std::string EvtVSSMix::getParamName( int i )
 {
     switch ( i ) {
         case 0:
             return "deltaM";
         default:
             return "";
     }
 }
diff --git a/src/EvtGenModels/EvtVVP.cpp b/src/EvtGenModels/EvtVVP.cpp
index 8e8c711..dd91326 100644
--- a/src/EvtGenModels/EvtVVP.cpp
+++ b/src/EvtGenModels/EvtVVP.cpp
@@ -1,195 +1,195 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVVP.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtSpinType.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <cmath>
 
-std::string EvtVVP::getName()
+std::string EvtVVP::getName() const
 {
     return "VVP";
 }
 
-EvtDecayBase* EvtVVP::clone()
+EvtDecayBase* EvtVVP::clone() const
 {
     return new EvtVVP;
 }
 
 void EvtVVP::init()
 {
     checkSpinParent( EvtSpinType::VECTOR );
 
     if ( getNDaug() == 2 ) {    // chi -> gamma psi radiative mode
         // This model needs 0 parameters, but previously was defined as requiring 8!
         // Check for 0 or 8 parameters in the decay file for backwards compatibility
         checkNArg( 0, 8 );
         checkNDaug( 2 );
         checkSpinDaughter( 0, EvtSpinType::VECTOR );
         checkSpinDaughter( 1, EvtSpinType::PHOTON );
 
     } else if ( getNDaug() == 3 ) {    // chi -> psi lepton lepton
         checkSpinDaughter( 0, EvtSpinType::VECTOR );
         checkSpinDaughter( 1, EvtSpinType::DIRAC );
         checkSpinDaughter( 2, EvtSpinType::DIRAC );
         checkNArg( 1 );
         m_delta = getArg( 0 );
     }
 }
 
 void EvtVVP::initProbMax()
 {
     if ( getNDaug() == 2 ) {
         setProbMax( 2.0 );
 
     } else if ( getNDaug() == 3 ) {
         const EvtId daugId = getDaug( 1 );
 
         if ( daugId == EvtPDL::getId( "mu+" ) ||
              daugId == EvtPDL::getId( "mu-" ) ) {
             setProbMax( 15.0 );
         } else if ( daugId == EvtPDL::getId( "e+" ) ||
                     daugId == EvtPDL::getId( "e-" ) ) {
             setProbMax( 600.0 );
         }
     }
 }
 
 void EvtVVP::decay( EvtParticle* root )
 {
     if ( getNDaug() == 2 ) {
         decay_2body( root );
     } else if ( getNDaug() == 3 ) {
         decay_3body( root );
     }
 }
 
 void EvtVVP::decay_2body( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     // Vector is first particle, photon is the second
     EvtParticle *v, *ph;
     v = p->getDaug( 0 );
     ph = p->getDaug( 1 );
     EvtVector3C epsp[3];
     EvtVector3C epsv[3];
     EvtVector3C epsph[2];
     epsp[0] = p->eps( 0 ).vec();
     epsp[1] = p->eps( 1 ).vec();
     epsp[2] = p->eps( 2 ).vec();
 
     epsv[0] = v->eps( 0 ).vec().conj();
     epsv[1] = v->eps( 1 ).vec().conj();
     epsv[2] = v->eps( 2 ).vec().conj();
 
     epsph[0] = ph->epsParentPhoton( 0 ).vec().conj();
     epsph[1] = ph->epsParentPhoton( 1 ).vec().conj();
 
     int i, j, k;
     for ( i = 0; i < 3; i++ ) {
         for ( j = 0; j < 3; j++ ) {
             for ( k = 0; k < 2; k++ ) {
                 vertex( i, j, k, epsp[i].cross( epsv[j] ) * epsph[k] );
             }
         }
     }
 }
 
 void EvtVVP::decay_3body( EvtParticle* root )
 {
     root->initializePhaseSpace( getNDaug(), getDaugs() );
     EvtParticle* psi = root->getDaug( 0 );
     EvtParticle* mup = root->getDaug( 1 );
     EvtParticle* mum = root->getDaug( 2 );
 
     EvtVector4R k1 = mup->getP4(),    // mu+ momentum
         k2 = mum->getP4(),            // mu- momentum
         k = k1 + k2;                  // photon momentum
 
     double kSq = k * k;
 
     // The decay amplitude needs four-vector products. Make sure we have
     // valid values for these, otherwise set the amplitude to zero.
     // We need to set _amp2 (EvtDecayAmp) via the vertex() function call
     // even when the amplitude is zero, otherwise the amplitude from the
     // previous accepted event will be used, potentially leading to biases
 
     // Selection on k^2 to avoid inefficient generation for the electron modes
     bool validAmp( true );
     if ( kSq < 1e-3 ) {
         validAmp = false;
     }
 
     // Extra checks to make sure we are not dividing by zero
     double dSq = m_delta * m_delta;
     double dSqDenom = dSq - kSq;
     if ( fabs( dSqDenom ) < 1e-10 ) {
         validAmp = false;
     }
 
     double factor( 1.0 );
     if ( validAmp ) {
         factor = dSq / ( dSqDenom * kSq );
     }
 
     int iPols[4] = { 0, 0, 0, 0 };
 
     // Calculate the amplitude terms, looping over the chi, psi and lepton states
     for ( int iChi = 0; iChi < 3; iChi++ ) {
         iPols[0] = iChi;
         EvtVector4C epsChi = root->epsParent( iChi );
 
         for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
             iPols[1] = iPsi;
             EvtVector4C epsPsi = psi->epsParent( iPsi ).conj();
 
             for ( int iMplus = 0; iMplus < 2; iMplus++ ) {
                 iPols[2] = iMplus;
                 EvtDiracSpinor spMplus = mup->spParent( iMplus );
 
                 for ( int iMminus = 0; iMminus < 2; iMminus++ ) {
                     iPols[3] = iMminus;
                     EvtDiracSpinor spMminus = mum->spParent( iMminus );
                     EvtVector4C epsGamma =
                         EvtLeptonVCurrent( spMplus, spMminus ).conj();
 
                     // Based on Baranov PRD 85,014034 (2012), Eq 10
                     // amp = e_{mu nu alpha beta} epsChi^mu epsPsi^nu epsGamma^alpha k^beta/k^2
                     EvtComplex amp( 0.0, 0.0 );
                     if ( validAmp ) {
                         amp = k * dual( EvtGenFunctions::directProd( epsChi,
                                                                      epsPsi ) )
                                       .cont1( epsGamma );
                     }
                     amp *= factor;
 
                     // Set the amplitude matrix element using the vertex function
                     vertex( iPols, amp );
                 }
             }
         }
     }
 }
diff --git a/src/EvtGenModels/EvtVVPIPI_WEIGHTED.cpp b/src/EvtGenModels/EvtVVPIPI_WEIGHTED.cpp
index d249777..a62ce18 100644
--- a/src/EvtGenModels/EvtVVPIPI_WEIGHTED.cpp
+++ b/src/EvtGenModels/EvtVVPIPI_WEIGHTED.cpp
@@ -1,125 +1,125 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVVPIPI_WEIGHTED.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtVVPIPI_WEIGHTED::getName()
+std::string EvtVVPIPI_WEIGHTED::getName() const
 {
     return "VVPIPI_WEIGHTED";
 }
 
-EvtDecayBase* EvtVVPIPI_WEIGHTED::clone()
+EvtDecayBase* EvtVVPIPI_WEIGHTED::clone() const
 {
     return new EvtVVPIPI_WEIGHTED;
 }
 
 void EvtVVPIPI_WEIGHTED::init()
 {
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
 
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::VECTOR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
 
     if ( ( !( getDaug( 1 ) == PIP && getDaug( 2 ) == PIM ) ) &&
          ( !( getDaug( 1 ) == PI0 && getDaug( 2 ) == PI0 ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVVPIPI_WEIGHTED generator expected "
             << " pi+ and pi- (or pi0 and pi0) "
             << "as 2nd and 3rd daughter. " << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 void EvtVVPIPI_WEIGHTED::initProbMax()
 {
     //Hard coded... should not be hard to calculate...
     setProbMax( 0.08 * 1.13 );
 }
 
 double reweight_event( double pipi_mass )
 {
     pipi_mass *= 1000.0;
     return sqrt( -3.6911336508223251 + 0.019119831948029617 * pipi_mass +
                  -1.8962883732377376e-05 * pipi_mass * pipi_mass );
 }
 
 void EvtVVPIPI_WEIGHTED::decay( EvtParticle* psi_prime )
 {
     psi_prime->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle *jpsi, *pi1, *pi2;
 
     jpsi = psi_prime->getDaug( 0 );
     pi1 = psi_prime->getDaug( 1 );
     pi2 = psi_prime->getDaug( 2 );
 
     //  Put phase space results into the daughters.
 
     EvtVector4C ep0, ep1, ep2;
 
     ep0 = psi_prime->eps( 0 );
     ep1 = psi_prime->eps( 1 );
     ep2 = psi_prime->eps( 2 );
 
     EvtVector4C e0, e1, e2;
 
     e0 = jpsi->epsParent( 0 );
     e1 = jpsi->epsParent( 1 );
     e2 = jpsi->epsParent( 2 );
 
     double mass2 = ( pi1->getP4() + pi2->getP4() ).mass2();
 
     double fac = mass2 - 4 * pi1->mass() * pi2->mass();
 
     fac *= reweight_event( sqrt( mass2 ) );
 
     vertex( 0, 0, fac * ( ep0 * e0.conj() ) );
     vertex( 0, 1, fac * ( ep0 * e1.conj() ) );
     vertex( 0, 2, fac * ( ep0 * e2.conj() ) );
 
     vertex( 1, 0, fac * ( ep1 * e0.conj() ) );
     vertex( 1, 1, fac * ( ep1 * e1.conj() ) );
     vertex( 1, 2, fac * ( ep1 * e2.conj() ) );
 
     vertex( 2, 0, fac * ( ep2 * e0.conj() ) );
     vertex( 2, 1, fac * ( ep2 * e1.conj() ) );
     vertex( 2, 2, fac * ( ep2 * e2.conj() ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVVSPwave.cpp b/src/EvtGenModels/EvtVVSPwave.cpp
index d535444..ed010d0 100644
--- a/src/EvtGenModels/EvtVVSPwave.cpp
+++ b/src/EvtGenModels/EvtVVSPwave.cpp
@@ -1,112 +1,112 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVVSPwave.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtVVSPwave::getName()
+std::string EvtVVSPwave::getName() const
 {
     return "VVS_PWAVE";
 }
 
-EvtDecayBase* EvtVVSPwave::clone()
+EvtDecayBase* EvtVVSPwave::clone() const
 {
     return new EvtVVSPwave;
 }
 
 void EvtVVSPwave::init()
 {
     // check that there are 6 arguments
     checkNArg( 6 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::VECTOR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::SCALAR );
 }
 
 void EvtVVSPwave::initProbMax()
 {
     //probmax is 1.0 for all possible decays I think!
 
     setProbMax( 1.0 );
 }
 
 void EvtVVSPwave::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtComplex as( getArg( 0 ) * cos( getArg( 1 ) ),
                    getArg( 0 ) * sin( getArg( 1 ) ) );
     EvtComplex ap( getArg( 2 ) * cos( getArg( 3 ) ),
                    getArg( 2 ) * sin( getArg( 3 ) ) );
     EvtComplex ad( getArg( 4 ) * cos( getArg( 5 ) ),
                    getArg( 4 ) * sin( getArg( 5 ) ) );
 
     if ( ap != EvtComplex( 0.0, 0.0 ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "In EvtVectorToVectorScalar.cc" << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "P wave not yet implemented!!" << endl;
         ::abort();
     }
 
     EvtParticle* v;
     v = p->getDaug( 0 );
 
     EvtTensor4C d, g;
 
     g.setdiag( 1.0, -1.0, -1.0, -1.0 );
 
     d = ad * ( ( 1.0 / ( v->getP4().d3mag() * v->getP4().d3mag() ) ) *
                    EvtGenFunctions::directProd( v->getP4(), v->getP4() ) +
                ( 1 / 3.0 ) * g ) +
         as * g;
 
     EvtVector4C ep0, ep1, ep2;
 
     ep0 = d.cont1( p->eps( 0 ) );
     ep1 = d.cont1( p->eps( 1 ) );
     ep2 = d.cont1( p->eps( 2 ) );
 
     vertex( 0, 0, ep0.cont( v->eps( 0 ).conj() ) );
     vertex( 0, 1, ep0.cont( v->eps( 1 ).conj() ) );
     vertex( 0, 2, ep0.cont( v->eps( 2 ).conj() ) );
 
     vertex( 1, 0, ep1.cont( v->eps( 0 ).conj() ) );
     vertex( 1, 1, ep1.cont( v->eps( 1 ).conj() ) );
     vertex( 1, 2, ep1.cont( v->eps( 2 ).conj() ) );
 
     vertex( 2, 0, ep2.cont( v->eps( 0 ).conj() ) );
     vertex( 2, 1, ep2.cont( v->eps( 1 ).conj() ) );
     vertex( 2, 2, ep2.cont( v->eps( 2 ).conj() ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVVpipi.cpp b/src/EvtGenModels/EvtVVpipi.cpp
index ca547c4..d43395e 100644
--- a/src/EvtGenModels/EvtVVpipi.cpp
+++ b/src/EvtGenModels/EvtVVpipi.cpp
@@ -1,109 +1,109 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVVpipi.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtVVpipi::getName()
+std::string EvtVVpipi::getName() const
 {
     return "VVPIPI";
 }
 
-EvtDecayBase* EvtVVpipi::clone()
+EvtDecayBase* EvtVVpipi::clone() const
 {
     return new EvtVVpipi;
 }
 
 void EvtVVpipi::init()
 {
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
 
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::VECTOR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
 
     if ( ( !( getDaug( 1 ) == PIP && getDaug( 2 ) == PIM ) ) &&
          ( !( getDaug( 1 ) == PI0 && getDaug( 2 ) == PI0 ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVVpipi generator expected "
             << " pi+ and pi- (or pi0 and pi0) "
             << "as 2nd and 3rd daughter. " << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 void EvtVVpipi::initProbMax()
 {
     //Hard coded... should not be hard to calculate...
     setProbMax( 0.08 );
 }
 
 void EvtVVpipi::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle *v, *s1, *s2;
 
     v = p->getDaug( 0 );
     s1 = p->getDaug( 1 );
     s2 = p->getDaug( 2 );
 
     //  Put phase space results into the daughters.
 
     EvtVector4C ep0, ep1, ep2;
 
     ep0 = p->eps( 0 );
     ep1 = p->eps( 1 );
     ep2 = p->eps( 2 );
 
     double fac = ( s1->getP4() + s2->getP4() ).mass2() -
                  4 * s1->mass() * s2->mass();
 
     vertex( 0, 0, fac * ( ep0 * v->epsParent( 0 ).conj() ) );
     vertex( 0, 1, fac * ( ep0 * v->epsParent( 1 ).conj() ) );
     vertex( 0, 2, fac * ( ep0 * v->epsParent( 2 ).conj() ) );
 
     vertex( 1, 0, fac * ( ep1 * v->epsParent( 0 ).conj() ) );
     vertex( 1, 1, fac * ( ep1 * v->epsParent( 1 ).conj() ) );
     vertex( 1, 2, fac * ( ep1 * v->epsParent( 2 ).conj() ) );
 
     vertex( 2, 0, fac * ( ep2 * v->epsParent( 0 ).conj() ) );
     vertex( 2, 1, fac * ( ep2 * v->epsParent( 1 ).conj() ) );
     vertex( 2, 2, fac * ( ep2 * v->epsParent( 2 ).conj() ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVectorIsr.cpp b/src/EvtGenModels/EvtVectorIsr.cpp
index 52b77e4..1c7d584 100644
--- a/src/EvtGenModels/EvtVectorIsr.cpp
+++ b/src/EvtGenModels/EvtVectorIsr.cpp
@@ -1,428 +1,428 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVectorIsr.hh"
 
 #include "EvtGenBase/EvtAbsLineShape.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtPhotonParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iomanip>
 #include <iostream>
 #include <math.h>
 #include <sstream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtVectorIsr::getName()
+std::string EvtVectorIsr::getName() const
 {
     return "VECTORISR";
 }
 
-EvtDecayBase* EvtVectorIsr::clone()
+EvtDecayBase* EvtVectorIsr::clone() const
 {
     return new EvtVectorIsr;
 }
 
 void EvtVectorIsr::init()
 {
     // check that there are 2 arguments
 
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::VECTOR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
     checkSpinDaughter( 1, EvtSpinType::PHOTON );
 
     int narg = getNArg();
     if ( narg > 4 )
         checkNArg( 4 );
 
     m_csfrmn = 1.;
     m_csbkmn = 1.;
     m_fmax = 1.2;
     m_firstorder = false;
 
     if ( narg > 0 )
         m_csfrmn = getArg( 0 );
     if ( narg > 1 )
         m_csbkmn = getArg( 1 );
     if ( narg > 2 )
         m_fmax = getArg( 2 );
     if ( narg > 3 )
         m_firstorder = true;
 }
 
 void EvtVectorIsr::initProbMax()
 {
     noProbMax();
 }
 
 void EvtVectorIsr::decay( EvtParticle* p )
 {
     //the elctron mass
     double electMass = EvtPDL::getMeanMass( EvtPDL::getId( "e-" ) );
 
-    static EvtId gammaId = EvtPDL::getId( "gamma" );
+    static const EvtId gammaId = EvtPDL::getId( "gamma" );
 
     EvtParticle* phi;
     EvtParticle* gamma;
 
     //4-mom of the two colinear photons to the decay of the vphoton
     EvtVector4R p4softg1( 0., 0., 0., 0. );
     EvtVector4R p4softg2( 0., 0., 0., 0. );
 
     //get pointers to the daughters set
     //get masses/initial phase space - will overwrite the
     //p4s below to get the kinematic distributions correct
     p->initializePhaseSpace( getNDaug(), getDaugs() );
     phi = p->getDaug( 0 );
     gamma = p->getDaug( 1 );
 
     //Generate soft colinear photons and the electron and positron energies after emission.
     //based on method of AfkQed and notes of Vladimir Druzhinin.
     //
     //function ckhrad(eb,q2m,r1,r2,e01,e02,f_col)
     //eb:      energy of incoming electrons in CM frame
     //q2m:     minimum invariant mass of the virtual photon after soft colinear photon emission
     //returned arguments
     //e01,e02: energies of e+ and e- after soft colinear photon emission
     //fcol:    weighting factor for Born cross section for use in an accept/reject test.
 
     double wcm = p->mass();
     double eb = 0.5 * wcm;
 
     //TO guarantee the collinear photons are softer than the ISR photon, require q2m > m*wcm
     double q2m = phi->mass() * wcm;
     double f_col( 0. );
     double e01( 0. );
     double e02( 0. );
     double ebeam = eb;
     double wcm_new = wcm;
     double s_new = wcm * wcm;
 
     double fran = 1.;
     double f = 0;
     int m = 0;
     double largest_f =
         0;    //only used when determining max weight for this vector particle mass
 
     if ( !m_firstorder ) {
         while ( fran > f ) {
             m++;
 
             int n = 0;
             while ( f_col == 0. ) {
                 n++;
                 ckhrad( eb, q2m, e01, e02, f_col );
                 if ( n > 10000 ) {
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << "EvtVectorIsr is having problems. Called ckhrad 10000 times.\n";
                     assert( 0 );
                 }
             }
 
             //Effective beam energy after soft photon emission (neglecting electron mass)
             ebeam = sqrt( e01 * e02 );
             wcm_new = 2 * ebeam;
             s_new = wcm_new * wcm_new;
 
             //The Vector mass should never be greater than wcm_new
             if ( phi->mass() > wcm_new ) {
                 EvtGenReport( EVTGEN_INFO, "EvtGen" )
                     << "EvtVectorIsr finds Vector mass=" << phi->mass()
                     << " > Weff=" << wcm_new << ".  Should not happen\n";
                 assert( 0 );
             }
 
             //Determine Born cross section @ wcm_new for e+e- -> gamma V.  We aren't interested in the absolute normalization
             //Just the functional dependence. Assuming a narrow resonance when determining cs_Born
             double cs_Born = 1.;
             if ( EvtPDL::getMaxRange( phi->getId() ) > 0. ) {
                 double x0 = 1 - EvtPDL::getMeanMass( phi->getId() ) *
                                     EvtPDL::getMeanMass( phi->getId() ) / s_new;
 
                 //L = log(s/(electMass*electMass)
                 double L = 2. * log( wcm_new / electMass );
 
                 // W(x0) is actually 2*alpha/pi times the following
                 double W = ( L - 1. ) * ( 1. - x0 + 0.5 * x0 * x0 );
 
                 //Born cross section is actually 12*pi*pi*Gammaee/EvtPDL::getMeanMass(phi->getId()) times the following
                 //(we'd need the full W(x0) as well)
                 cs_Born = W / s_new;
             }
 
             f = cs_Born * f_col;
 
             //if m_fmax was set properly, f should NEVER be larger than m_fmax
             if ( f > m_fmax && m_fmax > 0. ) {
                 EvtGenReport( EVTGEN_INFO, "EvtGen" )
                     << "EvtVectorIsr finds a problem with fmax, the maximum weight setting\n"
                     << "fmax is the third decay argument in the .dec file. VectorIsr attempts to set it reasonably if it wasn't provided\n"
                     << "To determine a more appropriate value, build GeneratorQAApp, and set the third argument for this decay <0.\n"
                     << "If you haven't been providing the first 2 arguments, set them to be 1. 1.). The program will report\n"
                     << "the largest weight it finds.  You should set fmax to be slightly larger.\n"
                     << "Alternatively try the following values for various vector particles: "
                     << "phi->1.15   J/psi-psi(4415)->0.105\n"
                     << "The current value of f and fmax for "
                     << EvtPDL::name( phi->getId() ) << " are " << f << "  "
                     << m_fmax << "\n"
                     << "Will now assert\n";
                 assert( 0 );
             }
 
             if ( m_fmax > 0. ) {
                 fran = m_fmax * EvtRandom::Flat( 0.0, 1.0 );
             }
 
             else {
                 //determine max weight for this vector particle mass
                 if ( f > largest_f ) {
                     largest_f = f;
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << m << " " << EvtPDL::name( phi->getId() ) << " "
                         << "vector_mass "
                         << " " << EvtPDL::getMeanMass( phi->getId() )
                         << "  fmax should be at least " << largest_f
                         << ".        f_col cs_B = " << f_col << " " << cs_Born
                         << std::endl;
                 }
                 if ( m % 10000 == 0 ) {
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << m << " " << EvtPDL::name( phi->getId() ) << " "
                         << "vector_mass "
                         << " " << EvtPDL::getMeanMass( phi->getId() )
                         << "  fmax should be at least " << largest_f
                         << ".        f_col cs_B = " << f_col << " " << cs_Born
                         << std::endl;
                 }
 
                 f_col = 0.;
                 f = 0.;
                 //determine max weight for this vector particle mass
             }
 
             if ( m > 100000 ) {
                 if ( m_fmax > 0. )
                     EvtGenReport( EVTGEN_INFO, "EvtGen" )
                         << "EvtVectorIsr is having problems. Check the fmax value - the 3rd argument in the .dec file\n"
                         << "Recommended values for various vector particles: "
                         << "phi->1.15   J/psi-psi(4415)->0.105   "
                         << "Upsilon(1S,2S,3S)->0.14\n";
                 assert( 0 );
             }
         }    //while (fran > f)
 
     }    //if (m_firstorder)
 
     //Compute parameters for boost to/from the system after colinear radiation
 
     double bet_l;
     double gam_l;
     double betgam_l;
 
     double csfrmn_new;
     double csbkmn_new;
 
     if ( m_firstorder ) {
         bet_l = 0.;
         gam_l = 1.;
         betgam_l = 0.;
         csfrmn_new = m_csfrmn;
         csbkmn_new = m_csbkmn;
     } else {
         double xx = e02 / e01;
         double sq_xx = sqrt( xx );
         bet_l = ( 1. - xx ) / ( 1. + xx );
         gam_l = ( 1. + xx ) / ( 2. * sq_xx );
         betgam_l = ( 1. - xx ) / ( 2. * sq_xx );
 
         //Boost photon cos_theta limits in lab to limits in the system after colinear rad
         csfrmn_new = ( m_csfrmn - bet_l ) / ( 1. - bet_l * m_csfrmn );
         csbkmn_new = ( m_csbkmn - bet_l ) / ( 1. - bet_l * m_csbkmn );
     }
 
     //    //generate kinematics according to Bonneau-Martin article
     //    //Nucl. Phys. B27 (1971) 381-397
 
     // For backward compatibility with .dec files before SP5, the backward cos limit for
     //the ISR photon is actually given as *minus* the actual limit. Sorry, this wouldn't be
     //my choice.  -Joe
 
     //gamma momentum in the vpho restframe *after* soft colinear radiation
     double pg = ( s_new - phi->mass() * phi->mass() ) / ( 2. * wcm_new );
 
     //calculate the beta of incoming electrons after  colinear rad in the frame where e= and e- have equal momentum
     double beta = electMass / ebeam;    //electMass/Ebeam = 1/gamma
     beta = sqrt( 1. - beta * beta );    //sqrt (1 - (1/gamma)**2)
 
     double ymax = log( ( 1. + beta * csfrmn_new ) / ( 1. - beta * csfrmn_new ) );
     double ymin = log( ( 1. - beta * csbkmn_new ) / ( 1. + beta * csbkmn_new ) );
 
     // photon theta distributed as  2*beta/(1-beta**2*cos(theta)**2)
     double y = ( ymax - ymin ) * EvtRandom::Flat( 0.0, 1.0 ) + ymin;
     double cs = exp( y );
     cs = ( cs - 1. ) / ( cs + 1. ) / beta;
     double sn = sqrt( 1 - cs * cs );
 
     double fi = EvtRandom::Flat( EvtConst::twoPi );
 
     //four-vector for the phi
     double phi_p0 = sqrt( phi->mass() * phi->mass() + pg * pg );
     double phi_p3 = -pg * cs;
 
     //boost back to frame before colinear radiation.
     EvtVector4R p4phi( gam_l * phi_p0 + betgam_l * phi_p3, -pg * sn * cos( fi ),
                        -pg * sn * sin( fi ), betgam_l * phi_p0 + gam_l * phi_p3 );
 
     double isr_p0 = pg;
     double isr_p3 = -phi_p3;
     EvtVector4R p4gamma( gam_l * isr_p0 + betgam_l * isr_p3, -p4phi.get( 1 ),
                          -p4phi.get( 2 ), betgam_l * isr_p0 + gam_l * isr_p3 );
 
     //four-vectors of the collinear photons
     if ( !m_firstorder ) {
         p4softg1.set( 0, eb - e02 );
         p4softg1.set( 3, e02 - eb );
         p4softg2.set( 0, eb - e01 );
         p4softg2.set( 3, eb - e01 );
     }
 
     //save momenta for particles
     phi->init( getDaug( 0 ), p4phi );
     gamma->init( getDaug( 1 ), p4gamma );
 
     //add the two colinear photons as vphoton daughters
     EvtPhotonParticle* softg1 = new EvtPhotonParticle;
     ;
     EvtPhotonParticle* softg2 = new EvtPhotonParticle;
     ;
     softg1->init( gammaId, p4softg1 );
     softg2->init( gammaId, p4softg2 );
     softg1->addDaug( p );
     softg2->addDaug( p );
 
     //try setting the spin density matrix of the phi
     //get polarization vector for phi in its parents restframe.
     EvtVector4C phi0 = phi->epsParent( 0 );
     EvtVector4C phi1 = phi->epsParent( 1 );
     EvtVector4C phi2 = phi->epsParent( 2 );
 
     //get polarization vector for a photon in its parents restframe.
     EvtVector4C gamma0 = gamma->epsParentPhoton( 0 );
     EvtVector4C gamma1 = gamma->epsParentPhoton( 1 );
 
     EvtComplex r1p = phi0 * gamma0;
     EvtComplex r2p = phi1 * gamma0;
     EvtComplex r3p = phi2 * gamma0;
 
     EvtComplex r1m = phi0 * gamma1;
     EvtComplex r2m = phi1 * gamma1;
     EvtComplex r3m = phi2 * gamma1;
 
     EvtComplex rho33 = r3p * conj( r3p ) + r3m * conj( r3m );
     EvtComplex rho22 = r2p * conj( r2p ) + r2m * conj( r2m );
     EvtComplex rho11 = r1p * conj( r1p ) + r1m * conj( r1m );
 
     EvtComplex rho13 = r3p * conj( r1p ) + r3m * conj( r1m );
     EvtComplex rho12 = r2p * conj( r1p ) + r2m * conj( r1m );
     EvtComplex rho23 = r3p * conj( r2p ) + r3m * conj( r2m );
 
     EvtComplex rho31 = conj( rho13 );
     EvtComplex rho32 = conj( rho23 );
     EvtComplex rho21 = conj( rho12 );
 
     EvtSpinDensity rho;
     rho.setDim( 3 );
 
     rho.set( 0, 0, rho11 );
     rho.set( 0, 1, rho12 );
     rho.set( 0, 2, rho13 );
     rho.set( 1, 0, rho21 );
     rho.set( 1, 1, rho22 );
     rho.set( 1, 2, rho23 );
     rho.set( 2, 0, rho31 );
     rho.set( 2, 1, rho32 );
     rho.set( 2, 2, rho33 );
 
     setDaughterSpinDensity( 0 );
     phi->setSpinDensityForward( rho );
 
     return;
 }
 
 double EvtVectorIsr::ckhrad1( double xx, double a, double b )
 {
     //port of AfkQed/ckhrad.F function ckhrad1
     double yy = xx * xx;
     double zz = 1. - 2 * xx + yy;
     return 0.5 * ( 1. + yy + zz / ( a - 1. ) +
                    0.25 * b * ( -0.5 * ( 1. + 3 * yy ) * log( xx ) ) - zz );
 }
 
 void EvtVectorIsr::ckhrad( const double& e_beam, const double& q2_min,
                            double& e01, double& e02, double& f )
 {
     //port of AfkQed/ckhrad.F subroutine ckhrad
     const double adp = 1. / 137.0359895 / EvtConst::pi;
     const double pi2 = EvtConst::pi * EvtConst::pi;
     //  const double dme   = 0.00051099906;
     const double dme = EvtPDL::getMeanMass( EvtPDL::getId( "e-" ) );
 
     double r1 = EvtRandom::Flat();    //Generates Flat from 0 - 1
     double r2 = EvtRandom::Flat();
 
     double sss = 4. * e_beam * e_beam;
     double biglog = log( sss / ( dme * dme ) );
     double beta = 2. * adp * ( biglog - 1. );
     double betae_lab = beta;
     double p3 = adp * ( pi2 / 3. - 0.5 );
     double p12 = adp * adp * ( 11. / 8. - 2. * pi2 / 3. );
     double coefener = 1. + 0.75 * betae_lab + p3;
     double coef1 = coefener + 0.125 * pi2 * beta * beta;
     double coef2 = p12 * biglog * biglog;
     double facts = coef1 + coef2;
 
     double y1_min = 0;
     double e1min = 0.25 * q2_min / e_beam;
     double y1_max = pow( 1. - e1min / e_beam, 0.5 * beta );
     double y1 = y1_min + r1 * ( y1_max - y1_min );
     e01 = e_beam * ( 1. - pow( y1, 2. / beta ) );
 
     double y2_min = 0.;
     double e2min = 0.25 * q2_min / e01;
     double y2_max = pow( 1. - e2min / e_beam, 0.5 * beta );
     double y2 = y2_min + r2 * ( y2_max - y2_min );
     e02 = e_beam * ( 1. - pow( y2, 2. / beta ) );
 
     double xx1 = e01 / e_beam;
     double xx2 = e02 / e_beam;
 
     f = y1_max * y2_max * ckhrad1( xx1, biglog, betae_lab ) *
         ckhrad1( xx2, biglog, betae_lab ) * facts;
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVll.cpp b/src/EvtGenModels/EvtVll.cpp
index 7a3748d..6da5122 100644
--- a/src/EvtGenModels/EvtVll.cpp
+++ b/src/EvtGenModels/EvtVll.cpp
@@ -1,102 +1,102 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVll.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtVll::getName()
+std::string EvtVll::getName() const
 {
     return "VLL";
 }
 
-EvtDecayBase* EvtVll::clone()
+EvtDecayBase* EvtVll::clone() const
 {
     return new EvtVll;
 }
 
 void EvtVll::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::VECTOR );
 
     checkSpinDaughter( 0, EvtSpinType::DIRAC );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
 }
 
 void EvtVll::initProbMax()
 {
     setProbMax( 1.0 );
 }
 
 void EvtVll::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle *l1, *l2;
     l1 = p->getDaug( 0 );
     l2 = p->getDaug( 1 );
 
     EvtVector4C l11, l12, l21, l22;
     l11 = EvtLeptonVCurrent( l1->spParent( 0 ), l2->spParent( 0 ) );
     l12 = EvtLeptonVCurrent( l1->spParent( 0 ), l2->spParent( 1 ) );
     l21 = EvtLeptonVCurrent( l1->spParent( 1 ), l2->spParent( 0 ) );
     l22 = EvtLeptonVCurrent( l1->spParent( 1 ), l2->spParent( 1 ) );
 
     EvtVector4C eps0 = p->eps( 0 );
     EvtVector4C eps1 = p->eps( 1 );
     EvtVector4C eps2 = p->eps( 2 );
 
     double M2 = p->mass();
     M2 *= M2;
     double m2 = l1->mass();
     m2 *= m2;
 
     double norm = 1.0 / sqrt( 2 * M2 + 4 * m2 - 4 * m2 * m2 / M2 );
 
     vertex( 0, 0, 0, norm * ( eps0 * l11 ) );
     vertex( 0, 0, 1, norm * ( eps0 * l12 ) );
     vertex( 0, 1, 0, norm * ( eps0 * l21 ) );
     vertex( 0, 1, 1, norm * ( eps0 * l22 ) );
 
     vertex( 1, 0, 0, norm * ( eps1 * l11 ) );
     vertex( 1, 0, 1, norm * ( eps1 * l12 ) );
     vertex( 1, 1, 0, norm * ( eps1 * l21 ) );
     vertex( 1, 1, 1, norm * ( eps1 * l22 ) );
 
     vertex( 2, 0, 0, norm * ( eps2 * l11 ) );
     vertex( 2, 0, 1, norm * ( eps2 * l12 ) );
     vertex( 2, 1, 0, norm * ( eps2 * l21 ) );
     vertex( 2, 1, 1, norm * ( eps2 * l22 ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVtoSll.cpp b/src/EvtGenModels/EvtVtoSll.cpp
index 83c78bd..87b8cc2 100644
--- a/src/EvtGenModels/EvtVtoSll.cpp
+++ b/src/EvtGenModels/EvtVtoSll.cpp
@@ -1,239 +1,239 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVtoSll.hh"
 
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVectorParticle.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
-std::string EvtVtoSll::getName()
+std::string EvtVtoSll::getName() const
 {
     return "VTOSLL";
 }
 
-EvtDecayBase* EvtVtoSll::clone()
+EvtDecayBase* EvtVtoSll::clone() const
 {
     return new EvtVtoSll;
 }
 
 void EvtVtoSll::init()
 {
     // check that there are 0 arguments
     checkNArg( 0 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::VECTOR );
 
     checkSpinDaughter( 0, EvtSpinType::SCALAR );
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
 
     // Work out whether we have electron mode
     const EvtIdSet leptons{ "e-", "e+" };
     if ( leptons.contains( getDaug( 1 ) ) || leptons.contains( getDaug( 2 ) ) ) {
         m_electronMode = true;
         EvtGenReport( EVTGEN_INFO, "EvtGen" )
             << " EvtVtoSll has dielectron final state" << std::endl;
     }
 }
 
 void EvtVtoSll::initProbMax()
 {
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " EvtVtoSll is finding maximum probability ... " << std::endl;
 
     double theProbMax = 0;
     double theProbMax_q2 = 0;
     double theProbMax_theta = 0;
 
     EvtVectorParticle parent{};
     parent.noLifeTime();
     parent.init( getParentId(),
                  EvtVector4R( EvtPDL::getMass( getParentId() ), 0, 0, 0 ) );
     parent.setDiagonalSpinDensity();
 
     EvtAmp amp;
     EvtId daughters[3] = { getDaug( 0 ), getDaug( 1 ), getDaug( 2 ) };
     amp.init( getParentId(), 3, daughters );
     parent.makeDaughters( 3, daughters );
     EvtParticle* scalar = parent.getDaug( 0 );
     EvtParticle* lep1 = parent.getDaug( 1 );
     EvtParticle* lep2 = parent.getDaug( 2 );
     scalar->noLifeTime();
     lep1->noLifeTime();
     lep2->noLifeTime();
 
     EvtSpinDensity rho;
     rho.setDiag( parent.getSpinStates() );
 
     const double M0 = EvtPDL::getMass( getParentId() );
     const double mL = EvtPDL::getMass( getDaug( 0 ) );
     const double m1 = EvtPDL::getMass( getDaug( 1 ) );
     const double m2 = EvtPDL::getMass( getDaug( 2 ) );
 
     const double m12Sum = m1 + m2;
     const double m12Del = m1 - m2;
 
     const double q2min = ( m1 + m2 ) * ( m1 + m2 );
     const double q2max = ( M0 - mL ) * ( M0 - mL );
     const double mSqSum = M0 * M0 + mL * mL;
 
     EvtVector4R p4scalar, p4lep1, p4lep2, boost;
 
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " EvtVtoSll is probing whole phase space ..." << std::endl;
 
     double prob = 0;
     const int nsteps = 5000;
     for ( int i = 0; i <= nsteps; i++ ) {
         const double q2 = q2min + i * ( q2max - q2min ) / nsteps;
         const double eScalar = ( mSqSum - q2 ) / ( 2 * M0 );
         const double pstar = i == 0 ? 0
                                     : sqrt( q2 - m12Sum * m12Sum ) *
                                           sqrt( q2 - m12Del * m12Del ) /
                                           ( 2 * sqrt( q2 ) );
 
         boost.set( M0 - eScalar, 0, 0, +sqrt( eScalar * eScalar - mL * mL ) );
         if ( i != nsteps ) {
             p4scalar.set( eScalar, 0, 0, -sqrt( eScalar * eScalar - mL * mL ) );
         } else {
             p4scalar.set( mL, 0, 0, 0 );
         }
 
         const double pstarSq = pstar * pstar;
         const double E1star = sqrt( pstarSq + m1 * m1 );
         const double E2star = sqrt( pstarSq + m2 * m2 );
 
         for ( int j = 0; j <= 45; j++ ) {
             const double theta = j * EvtConst::pi / 45;
 
             const double pstarT = pstar * sin( theta );
             const double pstarZ = pstar * cos( theta );
 
             p4lep1.set( E1star, 0, pstarT, pstarZ );
             p4lep2.set( E2star, 0, -pstarT, -pstarZ );
 
             if ( i != nsteps )    // At maximal q2 we are already in correct frame as scalar child and W/Zvirtual are at rest
             {
                 p4lep1 = boostTo( p4lep1, boost );
                 p4lep2 = boostTo( p4lep2, boost );
             }
             scalar->init( getDaug( 0 ), p4scalar );
             lep1->init( getDaug( 1 ), p4lep1 );
             lep2->init( getDaug( 2 ), p4lep2 );
             calcAmp( parent, amp );
             prob = rho.normalizedProb( amp.getSpinDensity() );
             // In case of electron mode add pole
             if ( m_electronMode ) {
                 prob /= 1.0 + m_poleSize / ( q2 * q2 );
             }
 
             if ( prob > theProbMax ) {
                 theProbMax = prob;
                 theProbMax_q2 = q2;
                 theProbMax_theta = theta;
             }
         }
     }
 
     theProbMax *= 1.01;
 
     setProbMax( theProbMax );
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " EvtVtoSll set up maximum probability to " << theProbMax
         << " found at q2 = " << theProbMax_q2 << " ("
         << nsteps * ( theProbMax_q2 - q2min ) / ( q2max - q2min )
         << " %) and theta = " << theProbMax_theta * 180 / EvtConst::pi
         << std::endl;
 }
 
 void EvtVtoSll::decay( EvtParticle* parent )
 {
     // Phase space initialization depends on what leptons are
     if ( m_electronMode ) {
         setWeight( parent->initializePhaseSpace( getNDaug(), getDaugs(), false,
                                                  m_poleSize, 1, 2 ) );
     } else {
         parent->initializePhaseSpace( getNDaug(), getDaugs() );
     }
 
     calcAmp( *parent, m_amp2 );
 }
 
 void EvtVtoSll::calcAmp( const EvtParticle& parent, EvtAmp& amp ) const
 {
     const EvtParticle& l1 = *parent.getDaug( 1 );
     const EvtParticle& l2 = *parent.getDaug( 2 );
 
     const EvtVector4C l11 = EvtLeptonVCurrent( l1.spParent( 0 ),
                                                l2.spParent( 0 ) );
     const EvtVector4C l12 = EvtLeptonVCurrent( l1.spParent( 0 ),
                                                l2.spParent( 1 ) );
     const EvtVector4C l21 = EvtLeptonVCurrent( l1.spParent( 1 ),
                                                l2.spParent( 0 ) );
     const EvtVector4C l22 = EvtLeptonVCurrent( l1.spParent( 1 ),
                                                l2.spParent( 1 ) );
 
     const EvtVector4C eps0 = parent.eps( 0 );
     const EvtVector4C eps1 = parent.eps( 1 );
     const EvtVector4C eps2 = parent.eps( 2 );
 
     const EvtVector4R P = parent.getP4Restframe();
     const EvtVector4R k = l1.getP4() + l2.getP4();
     const double k2 = k * k;
 
     const EvtTensor4C T(
         dual( EvtGenFunctions::directProd( P, ( 1.0 / k2 ) * k ) ) );
 
     double M2 = parent.mass();
     M2 *= M2;
     double m2 = l1.mass();
     m2 *= m2;
 
     const double norm = 1.0 / sqrt( 2 * M2 + 4 * m2 - 4 * m2 * m2 / M2 );
 
     amp.vertex( 0, 0, 0, norm * ( eps0 * T.cont2( l11 ) ) );
     amp.vertex( 0, 0, 1, norm * ( eps0 * T.cont2( l12 ) ) );
     amp.vertex( 0, 1, 0, norm * ( eps0 * T.cont2( l21 ) ) );
     amp.vertex( 0, 1, 1, norm * ( eps0 * T.cont2( l22 ) ) );
 
     amp.vertex( 1, 0, 0, norm * ( eps1 * T.cont2( l11 ) ) );
     amp.vertex( 1, 0, 1, norm * ( eps1 * T.cont2( l12 ) ) );
     amp.vertex( 1, 1, 0, norm * ( eps1 * T.cont2( l21 ) ) );
     amp.vertex( 1, 1, 1, norm * ( eps1 * T.cont2( l22 ) ) );
 
     amp.vertex( 2, 0, 0, norm * ( eps2 * T.cont2( l11 ) ) );
     amp.vertex( 2, 0, 1, norm * ( eps2 * T.cont2( l12 ) ) );
     amp.vertex( 2, 1, 0, norm * ( eps2 * T.cont2( l21 ) ) );
     amp.vertex( 2, 1, 1, norm * ( eps2 * T.cont2( l22 ) ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtVub.cpp b/src/EvtGenModels/EvtVub.cpp
index f5b56a5..a380855 100644
--- a/src/EvtGenModels/EvtVub.cpp
+++ b/src/EvtGenModels/EvtVub.cpp
@@ -1,406 +1,403 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVub.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtPFermi.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtVub::getName()
+std::string EvtVub::getName() const
 {
     return "VUB";
 }
 
-EvtDecayBase* EvtVub::clone()
+EvtDecayBase* EvtVub::clone() const
 {
     return new EvtVub;
 }
 
 void EvtVub::init()
 {
     // check that there are at least 6 arguments
 
     if ( getNArg() < 6 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVub generator expected "
             << " at least 6 arguments (mb,a,alpha_s,Nbins,m1,w1,...) but found: "
             << getNArg() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     m_mb = getArg( 0 );
     m_a = getArg( 1 );
     m_alphas = getArg( 2 );
     m_nbins = abs( (int)getArg( 3 ) );
     m_storeQplus = ( getArg( 3 ) < 0 ? 1 : 0 );
     m_masses = std::vector<double>( m_nbins );
     m_weights = std::vector<double>( m_nbins );
 
     if ( getNArg() - 4 != 2 * m_nbins ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVub generator expected " << m_nbins
             << " masses and weights but found: " << ( getNArg() - 4 ) / 2
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     int i, j = 4;
     double maxw = 0.;
     for ( i = 0; i < m_nbins; i++ ) {
         m_masses[i] = getArg( j++ );
         if ( i > 0 && m_masses[i] <= m_masses[i - 1] ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "EvtVub generator expected "
                 << " mass bins in ascending order!"
                 << "Will terminate execution!" << endl;
             ::abort();
         }
         m_weights[i] = getArg( j++ );
         if ( m_weights[i] < 0 ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "EvtVub generator expected "
                 << " weights >= 0, but found: " << m_weights[i] << endl;
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Will terminate execution!" << endl;
             ::abort();
         }
         if ( m_weights[i] > maxw )
             maxw = m_weights[i];
     }
     if ( maxw == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVub generator expected at least one "
             << " weight > 0, but found none! "
             << "Will terminate execution!" << endl;
         ::abort();
     }
     for ( i = 0; i < m_nbins; i++ )
         m_weights[i] /= maxw;
 
     // the maximum dGamma*p2 value depends on alpha_s only:
 
     const double dGMax0 = 3.;
     m_dGMax = 0.21344 + 8.905 * m_alphas;
     if ( m_dGMax < dGMax0 )
         m_dGMax = dGMax0;
 
     // for the Fermi Motion we need a B-Meson mass - but it's not critical
     // to get an exact value; in order to stay in the phase space for
     // B+- and B0 use the smaller mass
 
     EvtId BP = EvtPDL::getId( "B+" );
     EvtId B0 = EvtPDL::getId( "B0" );
 
     double mB0 = EvtPDL::getMaxMass( B0 );
     double mBP = EvtPDL::getMaxMass( BP );
 
     double mB = ( mB0 < mBP ? mB0 : mBP );
 
     const double xlow = -m_mb;
     const double xhigh = mB - m_mb;
     const int aSize = 10000;
 
     EvtPFermi pFermi( m_a, mB, m_mb );
     // pf is the cumulative distribution
     // normalized to 1.
     m_pf.resize( aSize );
     for ( i = 0; i < aSize; i++ ) {
         double kplus = xlow + (double)( i + 0.5 ) / ( (double)aSize ) *
                                   ( xhigh - xlow );
         if ( i == 0 )
             m_pf[i] = pFermi.getFPFermi( kplus );
         else
             m_pf[i] = m_pf[i - 1] + pFermi.getFPFermi( kplus );
     }
     for ( size_t index = 0; index < m_pf.size(); index++ ) {
         m_pf[index] /= m_pf[m_pf.size() - 1];
     }
 
-    //  static EvtHepRandomEngine myEngine;
-
-    //  _pFermi = new RandGeneral(myEngine,pf,aSize,0);
     m_dGamma = std::make_unique<EvtVubdGamma>( m_alphas );
 
     // check that there are 3 daughters
     checkNDaug( 3 );
 }
 
 void EvtVub::initProbMax()
 {
     noProbMax();
 }
 
 void EvtVub::decay( EvtParticle* p )
 {
     int j;
     // B+ -> u-bar specflav l+ nu
 
     EvtParticle *xuhad( nullptr ), *lepton( nullptr ), *neutrino( nullptr );
     EvtVector4R p4;
     // R. Faccini 21/02/03
     // move the reweighting up , before also shooting the fermi distribution
     double x, z, p2;
     double sh = 0.0;
     double mB, ml, xlow, xhigh, qplus;
     double El = 0.0;
     double Eh = 0.0;
     double kplus;
     const double lp2epsilon = -10;
     bool rew( true );
     while ( rew ) {
         p->initializePhaseSpace( getNDaug(), getDaugs() );
 
         xuhad = p->getDaug( 0 );
         lepton = p->getDaug( 1 );
         neutrino = p->getDaug( 2 );
 
         mB = p->mass();
         ml = lepton->mass();
 
         xlow = -m_mb;
         xhigh = mB - m_mb;
 
         // Fermi motion does not need to be computed inside the
         // tryit loop as m_b in Gamma0 does not need to be replaced by (m_b+kplus).
         // The difference however should be of the Order (lambda/m_b)^2 which is
         // beyond the considered orders in the paper anyway ...
 
         // for alpha_S = 0 and a mass cut on X_u not all values of kplus are
         // possible. The maximum value is mB/2-m_mb + sqrt(mB^2/4-m_masses[0]^2)
         kplus = 2 * xhigh;
 
         while ( kplus >= xhigh || kplus <= xlow ||
                 ( m_alphas == 0 &&
                   kplus >= mB / 2 - m_mb +
                                sqrt( mB * mB / 4 - m_masses[0] * m_masses[0] ) ) ) {
             kplus = findPFermi();    //_pFermi->shoot();
             kplus = xlow + kplus * ( xhigh - xlow );
         }
         qplus = mB - m_mb - kplus;
         if ( ( mB - qplus ) / 2. <= ml )
             continue;
 
         int tryit = 1;
         while ( tryit ) {
             x = EvtRandom::Flat();
             z = EvtRandom::Flat( 0, 2 );
             p2 = EvtRandom::Flat();
             p2 = pow( 10.0, lp2epsilon * p2 );
 
             El = x * ( mB - qplus ) / 2;
             if ( El > ml && El < mB / 2 ) {
                 Eh = z * ( mB - qplus ) / 2 + qplus;
                 if ( Eh > 0 && Eh < mB ) {
                     sh = p2 * pow( mB - qplus, 2 ) +
                          2 * qplus * ( Eh - qplus ) + qplus * qplus;
                     if ( sh > m_masses[0] * m_masses[0] &&
                          mB * mB + sh - 2 * mB * Eh > ml * ml ) {
                         double xran = EvtRandom::Flat();
 
                         double y = m_dGamma->getdGdxdzdp( x, z, p2 ) / m_dGMax *
                                    p2;
 
                         if ( y > 1 )
                             EvtGenReport( EVTGEN_WARNING, "EvtGen" )
                                 << "EvtVub decay probability > 1 found: " << y
                                 << endl;
                         if ( y >= xran )
                             tryit = 0;
                     }
                 }
             }
         }
         // reweight the Mx distribution
         if ( m_nbins > 0 ) {
             double xran1 = EvtRandom::Flat();
             double m = sqrt( sh );
             j = 0;
             while ( j < m_nbins && m > m_masses[j] )
                 j++;
             double w = m_weights[j - 1];
             if ( w >= xran1 )
                 rew = false;
         } else {
             rew = false;
         }
     }
 
     // o.k. we have the three kineamtic variables
     // now calculate a flat cos Theta_H [-1,1] distribution of the
     // hadron flight direction w.r.t the B flight direction
     // because the B is a scalar and should decay isotropic.
     // Then chose a flat Phi_H [0,2Pi] w.r.t the B flight direction
     // and and a flat Phi_L [0,2Pi] in the W restframe w.r.t the
     // W flight direction.
 
     double ctH = EvtRandom::Flat( -1, 1 );
     double phH = EvtRandom::Flat( 0, 2 * EvtConst::pi );
     double phL = EvtRandom::Flat( 0, 2 * EvtConst::pi );
 
     // now compute the four vectors in the B Meson restframe
 
     double ptmp, sttmp;
     // calculate the hadron 4 vector in the B Meson restframe
 
     sttmp = sqrt( 1 - ctH * ctH );
     ptmp = sqrt( Eh * Eh - sh );
     double pHB[4] = { Eh, ptmp * sttmp * cos( phH ), ptmp * sttmp * sin( phH ),
                       ptmp * ctH };
     p4.set( pHB[0], pHB[1], pHB[2], pHB[3] );
     xuhad->init( getDaug( 0 ), p4 );
 
     if ( m_storeQplus ) {
         // cludge to store the hidden parameter q+ with the decay;
         // the lifetime of the Xu is abused for this purpose.
         // tau = 1 ps corresponds to ctau = 0.3 mm -> in order to
         // stay well below BaBars sensitivity we take q+/(10000 GeV) which
         // goes up to 0.0005 in the most extreme cases as ctau in mm.
         // To extract q+ back from the StdHepTrk its necessary to get
         // delta_ctau = Xu->anyDaughter->getVertexTime()-Xu->getVertexTime()
         // where these pseudo calls refere to the StdHep time stored at
         // the production vertex in the lab for each particle. The boost
         // has to be reversed and the result is:
         //
         // q+ = delta_ctau * 10000 GeV/mm * Mass_Xu/Energy_Xu
         //
         xuhad->setLifetime( qplus / 10000. );
     }
 
     // calculate the W 4 vector in the B Meson restrframe
 
     double apWB = ptmp;
     double pWB[4] = { mB - Eh, -pHB[1], -pHB[2], -pHB[3] };
 
     // first go in the W restframe and calculate the lepton and
     // the neutrino in the W frame
 
     double mW2 = mB * mB + sh - 2 * mB * Eh;
     double beta = ptmp / pWB[0];
     double gamma = pWB[0] / sqrt( mW2 );
 
     double pLW[4];
 
     ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
     pLW[0] = sqrt( ml * ml + ptmp * ptmp );
 
     double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
     if ( ctL < -1 )
         ctL = -1;
     if ( ctL > 1 )
         ctL = 1;
     sttmp = sqrt( 1 - ctL * ctL );
 
     // eX' = eZ x eW
     double xW[3] = { -pWB[2], pWB[1], 0 };
     // eZ' = eW
     double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
 
     double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
     for ( j = 0; j < 2; j++ )
         xW[j] /= lx;
 
     // eY' = eZ' x eX'
     double yW[3] = { -pWB[1] * pWB[3], -pWB[2] * pWB[3],
                      pWB[1] * pWB[1] + pWB[2] * pWB[2] };
     double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
     for ( j = 0; j < 3; j++ )
         yW[j] /= ly;
 
     // p_lep = |p_lep| * (  sin(Theta) * cos(Phi) * eX'
     //                    + sin(Theta) * sin(Phi) * eY'
     //                    + cos(Theta) *            eZ')
     for ( j = 0; j < 3; j++ )
         pLW[j + 1] = sttmp * cos( phL ) * ptmp * xW[j] +
                      sttmp * sin( phL ) * ptmp * yW[j] + ctL * ptmp * zW[j];
 
     double apLW = ptmp;
 
     // boost them back in the B Meson restframe
     double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
 
     ptmp = sqrt( El * El - ml * ml );
     double ctLL = appLB / ptmp;
 
     if ( ctLL > 1 )
         ctLL = 1;
     if ( ctLL < -1 )
         ctLL = -1;
 
     double pLB[4] = { El, 0, 0, 0 };
     double pNB[4] = { pWB[0] - El, 0, 0, 0 };
 
     for ( j = 1; j < 4; j++ ) {
         pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
         pNB[j] = pWB[j] - pLB[j];
     }
 
     p4.set( pLB[0], pLB[1], pLB[2], pLB[3] );
     lepton->init( getDaug( 1 ), p4 );
 
     p4.set( pNB[0], pNB[1], pNB[2], pNB[3] );
     neutrino->init( getDaug( 2 ), p4 );
 
     return;
 }
 
 double EvtVub::findPFermi()
 {
     double ranNum = EvtRandom::Flat();
     double oOverBins = 1.0 / ( float( m_pf.size() ) );
     int nBinsBelow = 0;    // largest k such that I[k] is known to be <= rand
     int nBinsAbove = m_pf.size();    // largest k such that I[k] is known to be >  rand
     int middle;
 
     while ( nBinsAbove > nBinsBelow + 1 ) {
         middle = ( nBinsAbove + nBinsBelow + 1 ) >> 1;
         if ( ranNum >= m_pf[middle] ) {
             nBinsBelow = middle;
         } else {
             nBinsAbove = middle;
         }
     }
 
     double bSize = m_pf[nBinsAbove] - m_pf[nBinsBelow];
     // binMeasure is always aProbFunc[nBinsBelow],
 
     if ( bSize == 0 ) {
         // rand lies right in a bin of measure 0.  Simply return the center
         // of the range of that bin.  (Any value between k/N and (k+1)/N is
         // equally good, in this rare case.)
         return ( nBinsBelow + .5 ) * oOverBins;
     }
 
     double bFract = ( ranNum - m_pf[nBinsBelow] ) / bSize;
 
     return ( nBinsBelow + bFract ) * oOverBins;
 }
diff --git a/src/EvtGenModels/EvtVubBLNP.cpp b/src/EvtGenModels/EvtVubBLNP.cpp
index ae3fda2..a97c1b5 100644
--- a/src/EvtGenModels/EvtVubBLNP.cpp
+++ b/src/EvtGenModels/EvtVubBLNP.cpp
@@ -1,1058 +1,1058 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVubBLNP.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtItgPtrFunction.hh"
 #include "EvtGenModels/EvtItgSimpsonIntegrator.hh"
 #include "EvtGenModels/EvtPFermi.hh"
 
 #include <stdlib.h>
 #include <string>
 
 // For incomplete gamma function
 #include "math.h"
 #include "signal.h"
 #define ITMAX 100
 #define EPS 3.0e-7
 #define FPMIN 1.0e-30
 
 using std::cout;
 using std::endl;
 
-std::string EvtVubBLNP::getName()
+std::string EvtVubBLNP::getName() const
 {
     return "VUB_BLNP";
 }
 
-EvtDecayBase* EvtVubBLNP::clone()
+EvtDecayBase* EvtVubBLNP::clone() const
 {
     return new EvtVubBLNP;
 }
 
 void EvtVubBLNP::init()
 {
     // get parameters (declared in the header file)
 
     // Input parameters
     m_mBB = 5.2792;
     m_lambda2 = 0.12;
 
     // Shape function parameters
     m_b = getArg( 0 );
     m_Lambda = getArg( 1 );
     m_Ecut = 1.8;
     m_wzero = m_mBB - 2 * m_Ecut;
 
     // SF and SSF modes
     m_itype = (int)getArg( 5 );
     m_dtype = getArg( 5 );
     m_isubl = (int)getArg( 6 );
 
     // flags
     m_flag1 = (int)getArg( 7 );
     m_flag2 = (int)getArg( 8 );
     m_flag3 = (int)getArg( 9 );
 
     // Quark mass
     m_mb = 4.61;
 
     // hidden parameter what and SF stuff
     const double xlow = 0;
     const double xhigh = m_mBB;
     const int aSize = 10000;
     EvtPFermi pFermi( m_Lambda, m_b );
     // pf is the cumulative distribution normalized to 1.
     m_pf.resize( aSize );
     for ( int i = 0; i < aSize; i++ ) {
         double what = xlow + (double)( i + 0.5 ) / ( (double)aSize ) *
                                  ( xhigh - xlow );
         if ( i == 0 )
             m_pf[i] = pFermi.getSFBLNP( what );
         else
             m_pf[i] = m_pf[i - 1] + pFermi.getSFBLNP( what );
     }
     for ( size_t i = 0; i < m_pf.size(); i++ ) {
         m_pf[i] /= m_pf[m_pf.size() - 1];
     }
 
     // Matching scales
     m_muh = m_mBB * getArg( 2 );    // 0.5
     m_mui = getArg( 3 );            // 1.5
     m_mubar = getArg( 4 );          // 1.5
 
     // Perturbative quantities
     m_CF = 4.0 / 3.0;
     m_CA = 3.0;
     double nf = 4.0;
 
     m_beta0 = 11.0 / 3.0 * m_CA - 2.0 / 3.0 * nf;
     m_beta1 = 34.0 / 3.0 * m_CA * m_CA - 10.0 / 3.0 * m_CA * nf - 2.0 * m_CF * nf;
     m_beta2 = 2857.0 / 54.0 * m_CA * m_CA * m_CA +
               ( m_CF * m_CF - 205.0 / 18.0 * m_CF * m_CA -
                 1415.0 / 54.0 * m_CA * m_CA ) *
                   nf +
               ( 11.0 / 9.0 * m_CF + 79.0 / 54.0 * m_CA ) * nf * nf;
 
     m_zeta3 = 1.0 + 1 / 8.0 + 1 / 27.0 + 1 / 64.0;
 
     m_Gamma0 = 4 * m_CF;
     m_Gamma1 = m_CF * ( ( 268.0 / 9.0 - 4.0 * M_PI * M_PI / 3.0 ) * m_CA -
                         40.0 / 9.0 * nf );
     m_Gamma2 = 16 * m_CF *
                ( ( 245.0 / 24.0 - 67.0 / 54.0 * M_PI * M_PI +
                    +11.0 / 180.0 * pow( M_PI, 4 ) + 11.0 / 6.0 * m_zeta3 ) *
                      m_CA * m_CA *
                      +( -209.0 / 108.0 + 5.0 / 27.0 * M_PI * M_PI -
                         7.0 / 3.0 * m_zeta3 ) *
                      m_CA * nf +
                  ( -55.0 / 24.0 + 2 * m_zeta3 ) * m_CF * nf - nf * nf / 27.0 );
 
     m_gp0 = -5.0 * m_CF;
     m_gp1 = -8.0 * m_CF *
             ( ( 3.0 / 16.0 - M_PI * M_PI / 4.0 + 3 * m_zeta3 ) * m_CF +
               ( 1549.0 / 432.0 + 7.0 / 48.0 * M_PI * M_PI - 11.0 / 4.0 * m_zeta3 ) *
                   m_CA -
               ( 125.0 / 216.0 + M_PI * M_PI / 24.0 ) * nf );
 
     // Lbar and m_mupisq
 
     m_Lbar = m_Lambda;    // all models
     m_mupisq = 3 * m_Lambda * m_Lambda / m_b;
     if ( m_itype == 1 )
         m_mupisq = 3 * m_Lambda * m_Lambda / m_b;
     if ( m_itype == 2 )
         m_mupisq = 3 * m_Lambda * m_Lambda *
                    ( Gamma( 1 + 0.5 * m_b ) * Gamma( 0.5 * m_b ) /
                          pow( Gamma( 0.5 + 0.5 * m_b ), 2 ) -
                      1 );
 
     // m_moment2 for SSFs
     m_moment2 = pow( 0.3, 3 );
 
     // inputs for total rate (T for Total); use BLNP notebook defaults
     m_flagpower = 1;
     m_flag2loop = 1;
 
     // stuff for the integrator
     m_maxLoop = 20;
     //m_precision = 1.0e-3;
     m_precision = 2.0e-2;
 
     // vector of global variables, to pass to static functions (which can't access globals);
     m_gvars.push_back( 0.0 );         // 0
     m_gvars.push_back( 0.0 );         // 1
     m_gvars.push_back( m_mui );       // 2
     m_gvars.push_back( m_b );         // 3
     m_gvars.push_back( m_Lambda );    // 4
     m_gvars.push_back( m_mBB );       // 5
     m_gvars.push_back( m_mb );        // 6
     m_gvars.push_back( m_wzero );     // 7
     m_gvars.push_back( m_beta0 );     // 8
     m_gvars.push_back( m_beta1 );     // 9
     m_gvars.push_back( m_beta2 );     // 10
     m_gvars.push_back( m_dtype );     // 11
 
     // check that there are 3 daughters and 10 arguments
     checkNDaug( 3 );
     checkNArg( 10 );
 }
 
 void EvtVubBLNP::initProbMax()
 {
     noProbMax();
 }
 
 void EvtVubBLNP::decay( EvtParticle* Bmeson )
 {
     int j;
 
     EvtParticle *xuhad( nullptr ), *lepton( nullptr ), *neutrino( nullptr );
     EvtVector4R p4;
     double Pp, Pm, Pl, pdf, EX, sh, ml, mpi, ratemax;
     double El( 0. );
 
     double xhigh, xlow, what;
 
     Bmeson->initializePhaseSpace( getNDaug(), getDaugs() );
 
     xuhad = Bmeson->getDaug( 0 );
     lepton = Bmeson->getDaug( 1 );
     neutrino = Bmeson->getDaug( 2 );
 
     m_mBB = Bmeson->mass();
     ml = lepton->mass();
 
     //  get SF value
     xlow = 0;
     xhigh = m_mBB;
     // the case for alphas = 0 is not considered
     what = 2 * xhigh;
     while ( what > xhigh || what < xlow ) {
         what = findBLNPWhat();
         what = xlow + what * ( xhigh - xlow );
     }
 
     bool tryit = true;
 
     while ( tryit ) {
         // generate pp between 0 and
         // Flat(min, max) gives R(max - min) + min, where R = random btwn 0 and 1
 
         Pp = EvtRandom::Flat( 0, m_mBB );    // P+ = EX - |PX|
         Pl = EvtRandom::Flat( 0, m_mBB );    // mBB - 2El
         Pm = EvtRandom::Flat( 0, m_mBB );    // P- = EX + |PX|
 
         sh = Pm * Pp;
         EX = 0.5 * ( Pm + Pp );
         El = 0.5 * ( m_mBB - Pl );
 
         // Need maximum rate.  Waiting for Mr. Paz to give it to me.
         // Meanwhile, use this.
         ratemax = 3.0;    // From trial and error - most events below 3.0
 
         // kinematic bounds (Eq. 2)
         mpi = 0.14;
         if ( ( Pp > 0 ) && ( Pp <= Pl ) && ( Pl <= Pm ) && ( Pm < m_mBB ) &&
              ( El > ml ) && ( sh > 4 * mpi * mpi ) ) {
             // Probability of pass proportional to PDF
             pdf = rate3( Pp, Pl, Pm );
             double testRan = EvtRandom::Flat( 0., ratemax );
             if ( pdf >= testRan )
                 tryit = false;
         }
     }
     // o.k. we have the three kineamtic variables
     // now calculate a flat cos Theta_H [-1,1] distribution of the
     // hadron flight direction w.r.t the B flight direction
     // because the B is a scalar and should decay isotropic.
     // Then chose a flat Phi_H [0,2Pi] w.r.t the B flight direction
     // and and a flat Phi_L [0,2Pi] in the W restframe w.r.t the
     // W flight direction.
 
     double ctH = EvtRandom::Flat( -1, 1 );
     double phH = EvtRandom::Flat( 0, 2 * M_PI );
     double phL = EvtRandom::Flat( 0, 2 * M_PI );
 
     // now compute the four vectors in the B Meson restframe
 
     double ptmp, sttmp;
     // calculate the hadron 4 vector in the B Meson restframe
 
     sttmp = sqrt( 1 - ctH * ctH );
     ptmp = sqrt( EX * EX - sh );
     double pHB[4] = { EX, ptmp * sttmp * cos( phH ), ptmp * sttmp * sin( phH ),
                       ptmp * ctH };
     p4.set( pHB[0], pHB[1], pHB[2], pHB[3] );
     xuhad->init( getDaug( 0 ), p4 );
 
     bool _storeWhat( true );
 
     if ( _storeWhat ) {
         // cludge to store the hidden parameter what with the decay;
         // the lifetime of the Xu is abused for this purpose.
         // tau = 1 ps corresponds to ctau = 0.3 mm -> in order to
         // stay well below BaBars sensitivity we take what/(10000 GeV).
         // To extract what back from the StdHepTrk its necessary to get
         // delta_ctau = Xu->decayVtx()->point().distanceTo(XuDaughter->decayVtx()->point());
         //
         // what = delta_ctau * 100000 * Mass_Xu/Momentum_Xu
         //
         xuhad->setLifetime( what / 10000. );
     }
 
     // calculate the W 4 vector in the B Meson restrframe
 
     double apWB = ptmp;
     double pWB[4] = { m_mBB - EX, -pHB[1], -pHB[2], -pHB[3] };
 
     // first go in the W restframe and calculate the lepton and
     // the neutrino in the W frame
 
     double mW2 = m_mBB * m_mBB + sh - 2 * m_mBB * EX;
     double beta = ptmp / pWB[0];
     double gamma = pWB[0] / sqrt( mW2 );
 
     double pLW[4];
 
     ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
     pLW[0] = sqrt( ml * ml + ptmp * ptmp );
 
     double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
     if ( ctL < -1 )
         ctL = -1;
     if ( ctL > 1 )
         ctL = 1;
     sttmp = sqrt( 1 - ctL * ctL );
 
     // eX' = eZ x eW
     double xW[3] = { -pWB[2], pWB[1], 0 };
     // eZ' = eW
     double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
 
     double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
     for ( j = 0; j < 2; j++ )
         xW[j] /= lx;
 
     // eY' = eZ' x eX'
     double yW[3] = { -pWB[1] * pWB[3], -pWB[2] * pWB[3],
                      pWB[1] * pWB[1] + pWB[2] * pWB[2] };
     double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
     for ( j = 0; j < 3; j++ )
         yW[j] /= ly;
 
     // p_lep = |p_lep| * (  sin(Theta) * cos(Phi) * eX'
     //                    + sin(Theta) * sin(Phi) * eY'
     //                    + cos(Theta) *            eZ')
     for ( j = 0; j < 3; j++ )
         pLW[j + 1] = sttmp * cos( phL ) * ptmp * xW[j] +
                      sttmp * sin( phL ) * ptmp * yW[j] + ctL * ptmp * zW[j];
 
     double apLW = ptmp;
 
     // boost them back in the B Meson restframe
 
     double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
 
     ptmp = sqrt( El * El - ml * ml );
     double ctLL = appLB / ptmp;
 
     if ( ctLL > 1 )
         ctLL = 1;
     if ( ctLL < -1 )
         ctLL = -1;
 
     double pLB[4] = { El, 0, 0, 0 };
     double pNB[4] = { pWB[0] - El, 0, 0, 0 };
 
     for ( j = 1; j < 4; j++ ) {
         pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
         pNB[j] = pWB[j] - pLB[j];
     }
 
     p4.set( pLB[0], pLB[1], pLB[2], pLB[3] );
     lepton->init( getDaug( 1 ), p4 );
 
     p4.set( pNB[0], pNB[1], pNB[2], pNB[3] );
     neutrino->init( getDaug( 2 ), p4 );
 
     return;
 }
 
 double EvtVubBLNP::rate3( double Pp, double Pl, double Pm )
 {
     // rate3 in units of GF^2*Vub^2/pi^3
 
     double factor = 1.0 / 16 * ( m_mBB - Pp ) * U1lo( m_muh, m_mui ) *
                     pow( ( Pm - Pp ) / ( m_mBB - Pp ), alo( m_muh, m_mui ) );
 
     double doneJS = DoneJS( Pp, Pm, m_mui );
     double done1 = Done1( Pp, Pm, m_mui );
     double done2 = Done2( Pp, Pm, m_mui );
     double done3 = Done3( Pp, Pm, m_mui );
 
     // The EvtSimpsonIntegrator returns zero for bad integrals.
     // So if any of the integrals are zero (ie bad), return zero.
     // This will cause pdf = 0, so the event will not pass.
     // I hope this will not introduce a bias.
     if ( doneJS * done1 * done2 * done3 == 0.0 ) {
         //cout << "Integral failed: (Pp, Pm, Pl) = (" << Pp << ", " << Pm << ", " << Pl << ")" << endl;
         return 0.0;
     }
     //  if (doneJS*done1*done2*done3 != 0.0) {
     //    cout << "Integral OK: (Pp, Pm, Pl) = (" << Pp << ", " << Pm << ", " << Pl << ")" << endl;
     //}
 
     double f1 = F1( Pp, Pm, m_muh, m_mui, m_mubar, doneJS, done1 );
     double f2 = F2( Pp, Pm, m_muh, m_mui, m_mubar, done3 );
     double f3 = F3( Pp, Pm, m_muh, m_mui, m_mubar, done2 );
     double answer = factor * ( ( m_mBB + Pl - Pp - Pm ) * ( Pm - Pl ) * f1 +
                                2 * ( Pl - Pp ) * ( Pm - Pl ) * f2 +
                                ( m_mBB - Pm ) * ( Pm - Pp ) * f3 );
     return answer;
 }
 
 double EvtVubBLNP::F1( double Pp, double Pm, double muh, double mui,
                        double mubar, double doneJS, double done1 )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double y = ( Pm - Pp ) / ( m_mBB - Pp );
     double ah = m_CF * alphas( muh, vars ) / 4 / M_PI;
     double ai = m_CF * alphas( mui, vars ) / 4 / M_PI;
     double abar = m_CF * alphas( mubar, vars ) / 4 / M_PI;
     double lambda1 = -m_mupisq;
 
     double t1 = -4 * ai / ( Pp - m_Lbar ) *
                 ( 2 * log( ( Pp - m_Lbar ) / mui ) + 1 );
     double t2 = 1 + dU1nlo( muh, mui ) + anlo( muh, mui ) * log( y );
     double t3 = -4.0 * pow( log( y * m_mb / muh ), 2 ) +
                 10.0 * log( y * m_mb / muh ) - 4.0 * log( y ) -
                 2.0 * log( y ) / ( 1 - y ) - 4.0 * PolyLog( 2, 1 - y ) -
                 M_PI * M_PI / 6.0 - 12.0;
     double t4 = 2 * pow( log( y * m_mb * Pp / ( mui * mui ) ), 2 ) -
                 3 * log( y * m_mb * Pp / ( mui * mui ) ) + 7 - M_PI * M_PI;
 
     double t5 = -wS( Pp ) + 2 * t( Pp ) +
                 ( 1.0 / y - 1.0 ) * ( u( Pp ) - v( Pp ) );
     double t6 = -( lambda1 + 3.0 * m_lambda2 ) / 3.0 +
                 1.0 / pow( y, 2 ) * ( 4.0 / 3.0 * lambda1 - 2.0 * m_lambda2 );
 
     double shapePp = Shat( Pp, vars );
 
     double answer = ( t2 + ah * t3 + ai * t4 ) * shapePp + ai * doneJS +
                     1 / ( m_mBB - Pp ) *
                         ( m_flag2 * abar * done1 + m_flag1 * t5 ) +
                     1 / pow( m_mBB - Pp, 2 ) * m_flag3 * shapePp * t6;
     if ( Pp > m_Lbar + mui / exp( 0.5 ) )
         answer = answer + t1;
     return answer;
 }
 
 double EvtVubBLNP::F2( double Pp, double Pm, double muh, double /*mui*/,
                        double mubar, double done3 )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double y = ( Pm - Pp ) / ( m_mBB - Pp );
     double lambda1 = -m_mupisq;
     double ah = m_CF * alphas( muh, vars ) / 4 / M_PI;
     double abar = m_CF * alphas( mubar, vars ) / 4 / M_PI;
 
     double t6 = -wS( Pp ) - 2 * t( Pp ) + 1.0 / y * ( t( Pp ) + v( Pp ) );
     double t7 = 1 / pow( y, 2 ) * ( 2.0 / 3.0 * lambda1 + 4.0 * m_lambda2 ) -
                 1 / y * ( 2.0 / 3.0 * lambda1 + 3.0 / 2.0 * m_lambda2 );
 
     double shapePp = Shat( Pp, vars );
 
     double answer = ah * log( y ) / ( 1 - y ) * shapePp +
                     1 / ( m_mBB - Pp ) *
                         ( m_flag2 * abar * 0.5 * done3 + m_flag1 / y * t6 ) +
                     1.0 / pow( m_mBB - Pp, 2 ) * m_flag3 * shapePp * t7;
     return answer;
 }
 
 double EvtVubBLNP::F3( double Pp, double Pm, double /*muh*/, double /*mui*/,
                        double mubar, double done2 )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double y = ( Pm - Pp ) / ( m_mBB - Pp );
     double lambda1 = -m_mupisq;
     double abar = m_CF * alphas( mubar, vars ) / 4 / M_PI;
 
     double t7 = 1.0 / pow( y, 2 ) * ( -2.0 / 3.0 * lambda1 + m_lambda2 );
 
     double shapePp = Shat( Pp, vars );
 
     double answer = 1.0 / ( Pm - Pp ) * m_flag2 * 0.5 * y * abar * done2 +
                     1.0 / pow( m_mBB - Pp, 2 ) * m_flag3 * shapePp * t7;
     return answer;
 }
 
 double EvtVubBLNP::DoneJS( double Pp, double Pm, double /*mui*/ )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double lowerlim = 0.001 * Pp;
     double upperlim = ( 1.0 - 0.001 ) * Pp;
 
     auto func = EvtItgPtrFunction{ &IntJS, lowerlim, upperlim, vars };
     auto integ = EvtItgSimpsonIntegrator{ func, m_precision, m_maxLoop };
     return integ.evaluate( lowerlim, upperlim );
 }
 
 double EvtVubBLNP::Done1( double Pp, double Pm, double /*mui*/ )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double lowerlim = 0.001 * Pp;
     double upperlim = ( 1.0 - 0.001 ) * Pp;
 
     auto func = EvtItgPtrFunction{ &Int1, lowerlim, upperlim, vars };
     auto integ = EvtItgSimpsonIntegrator{ func, m_precision, m_maxLoop };
     return integ.evaluate( lowerlim, upperlim );
 }
 
 double EvtVubBLNP::Done2( double Pp, double Pm, double /*mui*/ )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double lowerlim = 0.001 * Pp;
     double upperlim = ( 1.0 - 0.001 ) * Pp;
 
     auto func = EvtItgPtrFunction{ &Int2, lowerlim, upperlim, vars };
     auto integ = EvtItgSimpsonIntegrator{ func, m_precision, m_maxLoop };
     return integ.evaluate( lowerlim, upperlim );
 }
 
 double EvtVubBLNP::Done3( double Pp, double Pm, double /*mui*/ )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double lowerlim = 0.001 * Pp;
     double upperlim = ( 1.0 - 0.001 ) * Pp;
 
     auto func = EvtItgPtrFunction{ &Int3, lowerlim, upperlim, vars };
     auto integ = EvtItgSimpsonIntegrator{ func, m_precision, m_maxLoop };
     return integ.evaluate( lowerlim, upperlim );
 }
 
 double EvtVubBLNP::Int1( double what, const std::vector<double>& vars )
 {
     return Shat( what, vars ) * g1( what, vars );
 }
 
 double EvtVubBLNP::Int2( double what, const std::vector<double>& vars )
 {
     return Shat( what, vars ) * g2( what, vars );
 }
 
 double EvtVubBLNP::Int3( double what, const std::vector<double>& vars )
 {
     return Shat( what, vars ) * g3( what, vars );
 }
 
 double EvtVubBLNP::IntJS( double what, const std::vector<double>& vars )
 {
     double Pp = vars[0];
     double Pm = vars[1];
     double mui = vars[2];
     double mBB = vars[5];
     double mb = vars[6];
     double y = ( Pm - Pp ) / ( mBB - Pp );
 
     return 1 / ( Pp - what ) * ( Shat( what, vars ) - Shat( Pp, vars ) ) *
            ( 4 * log( y * mb * ( Pp - what ) / ( mui * mui ) ) - 3 );
 }
 
 double EvtVubBLNP::g1( double w, const std::vector<double>& vars )
 {
     double Pp = vars[0];
     double Pm = vars[1];
     double mBB = vars[5];
     double y = ( Pm - Pp ) / ( mBB - Pp );
     double x = ( Pp - w ) / ( mBB - Pp );
 
     double q1 = ( 1 + x ) * ( 1 + x ) * y * ( x + y );
     double q2 = y * ( -9 + 10 * y ) + x * x * ( -12.0 + 13.0 * y ) +
                 2 * x * ( -8.0 + 6 * y + 3 * y * y );
     double q3 = 4 / x * log( y + y / x );
     double q4 = 3.0 * pow( x, 4 ) * ( -2.0 + y ) - 2 * pow( y, 3 ) -
                 4 * pow( x, 3 ) * ( 2.0 + y ) - 2 * x * y * y * ( 4 + y ) -
                 x * x * y * ( 12 + 4 * y + y * y );
     double q5 = log( 1 + y / x );
 
     double answer = q2 / q1 - q3 - 2 * q4 * q5 / ( q1 * y * x );
     return answer;
 }
 
 double EvtVubBLNP::g2( double w, const std::vector<double>& vars )
 {
     double Pp = vars[0];
     double Pm = vars[1];
     double mBB = vars[5];
     double y = ( Pm - Pp ) / ( mBB - Pp );
     double x = ( Pp - w ) / ( mBB - Pp );
 
     double q1 = ( 1 + x ) * ( 1 + x ) * pow( y, 3 ) * ( x + y );
     double q2 = 10.0 * pow( x, 4 ) + y * y +
                 3.0 * pow( x, 2 ) * y * ( 10.0 + y ) +
                 pow( x, 3 ) * ( 12.0 + 19.0 * y ) +
                 x * y * ( 8.0 + 4.0 * y + y * y );
     double q3 = 5 * pow( x, 4 ) + 2.0 * y * y +
                 6.0 * pow( x, 3 ) * ( 1.0 + 2.0 * y ) +
                 4.0 * x * y * ( 1 + 2.0 * y ) + x * x * y * ( 18.0 + 5.0 * y );
     double q4 = log( 1 + y / x );
 
     double answer = 2.0 / q1 * ( y * q2 - 2 * x * q3 * q4 );
     return answer;
 }
 
 double EvtVubBLNP::g3( double w, const std::vector<double>& vars )
 {
     double Pp = vars[0];
     double Pm = vars[1];
     double mBB = vars[5];
     double y = ( Pm - Pp ) / ( mBB - Pp );
     double x = ( Pp - w ) / ( mBB - Pp );
 
     double q1 = ( 1 + x ) * ( 1 + x ) * pow( y, 3 ) * ( x + y );
     double q2 = 2.0 * pow( y, 3 ) * ( -11.0 + 2.0 * y ) -
                 10.0 * pow( x, 4 ) * ( 6 - 6 * y + y * y ) +
                 x * y * y * ( -94.0 + 29.0 * y + 2.0 * y * y ) +
                 2.0 * x * x * y * ( -72.0 + 18.0 * y + 13.0 * y * y ) -
                 x * x * x * ( 72.0 + 42.0 * y - 70.0 * y * y + 3.0 * y * y * y );
     double q3 = -6.0 * x * ( -5.0 + y ) * pow( y, 3 ) + 4 * pow( y, 4 ) +
                 5 * pow( x, 5 ) * ( 6 - 6 * y + y * y ) -
                 4 * x * x * y * y * ( -20.0 + 6 * y + y * y ) +
                 pow( x, 3 ) * y * ( 90.0 - 10.0 * y - 28.0 * y * y + y * y * y ) +
                 pow( x, 4 ) * ( 36.0 + 36.0 * y - 50.0 * y * y + 4 * y * y * y );
     double q4 = log( 1 + y / x );
 
     double answer = q2 / q1 + 2 / q1 / y * q3 * q4;
     return answer;
 }
 
 double EvtVubBLNP::Shat( double w, const std::vector<double>& vars )
 {
     double mui = vars[2];
     double b = vars[3];
     double Lambda = vars[4];
     double wzero = vars[7];
     int itype = (int)vars[11];
 
     double norm = 0.0;
     double shape = 0.0;
 
     if ( itype == 1 ) {
         double Lambar = ( Lambda / b ) *
                         ( Gamma( 1 + b ) - Gamma( 1 + b, b * wzero / Lambda ) ) /
                         ( Gamma( b ) - Gamma( b, b * wzero / Lambda ) );
         double muf = wzero - Lambar;
         double mupisq = 3 * pow( Lambda, 2 ) / pow( b, 2 ) *
                             ( Gamma( 2 + b ) -
                               Gamma( 2 + b, b * wzero / Lambda ) ) /
                             ( Gamma( b ) - Gamma( b, b * wzero / Lambda ) ) -
                         3 * Lambar * Lambar;
         norm = Mzero( muf, mui, mupisq, vars ) * Gamma( b ) /
                ( Gamma( b ) - Gamma( b, b * wzero / Lambda ) );
         shape = pow( b, b ) / Lambda / Gamma( b ) * pow( w / Lambda, b - 1 ) *
                 exp( -b * w / Lambda );
     }
 
     if ( itype == 2 ) {
         double dcoef = pow( Gamma( 0.5 * ( 1 + b ) ) / Gamma( 0.5 * b ), 2 );
         double t1 = wzero * wzero * dcoef / ( Lambda * Lambda );
         double Lambar =
             Lambda * ( Gamma( 0.5 * ( 1 + b ) ) - Gamma( 0.5 * ( 1 + b ), t1 ) ) /
             pow( dcoef, 0.5 ) / ( Gamma( 0.5 * b ) - Gamma( 0.5 * b, t1 ) );
         double muf = wzero - Lambar;
         double mupisq = 3 * Lambda * Lambda *
                             ( Gamma( 1 + 0.5 * b ) - Gamma( 1 + 0.5 * b, t1 ) ) /
                             dcoef / ( Gamma( 0.5 * b ) - Gamma( 0.5 * b, t1 ) ) -
                         3 * Lambar * Lambar;
         norm = Mzero( muf, mui, mupisq, vars ) * Gamma( 0.5 * b ) /
                ( Gamma( 0.5 * b ) -
                  Gamma( 0.5 * b, wzero * wzero * dcoef / ( Lambda * Lambda ) ) );
         shape = 2 * pow( dcoef, 0.5 * b ) / Lambda / Gamma( 0.5 * b ) *
                 pow( w / Lambda, b - 1 ) *
                 exp( -dcoef * w * w / ( Lambda * Lambda ) );
     }
 
     double answer = norm * shape;
     return answer;
 }
 
 double EvtVubBLNP::Mzero( double muf, double mu, double mupisq,
                           const std::vector<double>& vars )
 {
     double CF = 4.0 / 3.0;
     double amu = CF * alphas( mu, vars ) / M_PI;
     double answer = 1 -
                     amu * ( pow( log( muf / mu ), 2 ) + log( muf / mu ) +
                             M_PI * M_PI / 24.0 ) +
                     amu * ( log( muf / mu ) - 0.5 ) * mupisq / ( 3 * muf * muf );
     return answer;
 }
 
 double EvtVubBLNP::wS( double w )
 {
     double answer = ( m_Lbar - w ) * Shat( w, m_gvars );
     return answer;
 }
 
 double EvtVubBLNP::t( double w )
 {
     double t1 = -3 * m_lambda2 / m_mupisq * ( m_Lbar - w ) * Shat( w, m_gvars );
     double myf = myfunction( w, m_Lbar, m_moment2 );
     double myBIK = myfunctionBIK( w, m_Lbar, m_moment2 );
     double answer = t1;
 
     if ( m_isubl == 1 )
         answer = t1;
     if ( m_isubl == 3 )
         answer = t1 - myf;
     if ( m_isubl == 4 )
         answer = t1 + myf;
     if ( m_isubl == 5 )
         answer = t1 - myBIK;
     if ( m_isubl == 6 )
         answer = t1 + myBIK;
 
     return answer;
 }
 
 double EvtVubBLNP::u( double w )
 {
     double u1 = -2 * ( m_Lbar - w ) * Shat( w, m_gvars );
     double myf = myfunction( w, m_Lbar, m_moment2 );
     double myBIK = myfunctionBIK( w, m_Lbar, m_moment2 );
     double answer = u1;
 
     if ( m_isubl == 1 )
         answer = u1;
     if ( m_isubl == 3 )
         answer = u1 + myf;
     if ( m_isubl == 4 )
         answer = u1 - myf;
     if ( m_isubl == 5 )
         answer = u1 + myBIK;
     if ( m_isubl == 6 )
         answer = u1 - myBIK;
 
     return answer;
 }
 
 double EvtVubBLNP::v( double w )
 {
     double v1 = 3 * m_lambda2 / m_mupisq * ( m_Lbar - w ) * Shat( w, m_gvars );
     double myf = myfunction( w, m_Lbar, m_moment2 );
     double myBIK = myfunctionBIK( w, m_Lbar, m_moment2 );
     double answer = v1;
 
     if ( m_isubl == 1 )
         answer = v1;
     if ( m_isubl == 3 )
         answer = v1 - myf;
     if ( m_isubl == 4 )
         answer = v1 + myf;
     if ( m_isubl == 5 )
         answer = v1 - myBIK;
     if ( m_isubl == 6 )
         answer = v1 + myBIK;
 
     return answer;
 }
 
 double EvtVubBLNP::myfunction( double w, double Lbar, double mom2 )
 {
     double bval = 5.0;
     double x = w / Lbar;
     double factor = 0.5 * mom2 * pow( bval / Lbar, 3 );
     double answer = factor * exp( -bval * x ) *
                     ( 1 - 2 * bval * x + 0.5 * bval * bval * x * x );
     return answer;
 }
 
 double EvtVubBLNP::myfunctionBIK( double w, double Lbar, double /*mom2*/ )
 {
     double aval = 10.0;
     double normBIK = ( 4 - M_PI ) * M_PI * M_PI / 8 / ( 2 - M_PI ) / aval + 1;
     double z = 3 * M_PI * w / 8 / Lbar;
     double q = M_PI * M_PI * 2 * pow( M_PI * aval, 0.5 ) * exp( -aval * z * z ) /
                    ( 4 * M_PI - 8 ) * ( 1 - 2 * pow( aval / M_PI, 0.5 ) * z ) +
                8 / pow( 1 + z * z, 4 ) *
                    ( z * log( z ) + 0.5 * z * ( 1 + z * z ) -
                      M_PI / 4 * ( 1 - z * z ) );
     double answer = q / normBIK;
     return answer;
 }
 
 double EvtVubBLNP::dU1nlo( double muh, double mui )
 {
     double ai = alphas( mui, m_gvars );
     double ah = alphas( muh, m_gvars );
 
     double q1 = ( ah - ai ) / ( 4 * M_PI * m_beta0 );
     double q2 = log( m_mb / muh ) * m_Gamma1 + m_gp1;
     double q3 = 4 * m_beta1 * ( log( m_mb / muh ) * m_Gamma0 + m_gp0 ) +
                 m_Gamma2 * ( 1 - ai / ah );
     double q4 = m_beta1 * m_beta1 * m_Gamma0 * ( -1.0 + ai / ah ) /
                 ( 4 * pow( m_beta0, 3 ) );
     double q5 = -m_beta2 * m_Gamma0 * ( 1.0 + ai / ah ) +
                 m_beta1 * m_Gamma1 * ( 3 - ai / ah );
     double q6 = m_beta1 * m_beta1 * m_Gamma0 * ( ah - ai ) / m_beta0 -
                 m_beta2 * m_Gamma0 * ah + m_beta1 * m_Gamma1 * ai;
 
     double answer =
         q1 * ( q2 - q3 / 4 / m_beta0 + q4 + q5 / ( 4 * m_beta0 * m_beta0 ) ) +
         1 / ( 8 * M_PI * m_beta0 * m_beta0 * m_beta0 ) * log( ai / ah ) * q6;
     return answer;
 }
 
 double EvtVubBLNP::U1lo( double muh, double mui )
 {
     double epsilon = 0.0;
     double answer = pow( m_mb / muh, -2 * aGamma( muh, mui, epsilon ) ) *
                     exp( 2 * Sfun( muh, mui, epsilon ) -
                          2 * agp( muh, mui, epsilon ) );
     return answer;
 }
 
 double EvtVubBLNP::Sfun( double mu1, double mu2, double epsilon )
 {
     double a1 = alphas( mu1, m_gvars ) / 4 / M_PI;
     double a2 = alphas( mu2, m_gvars ) / alphas( mu1, m_gvars );
 
     double answer = S0( a1, a2 ) + S1( a1, a2 ) + epsilon * S2( a1, a2 );
     return answer;
 }
 
 double EvtVubBLNP::S0( double a1, double r )
 {
     double answer = -m_Gamma0 / ( 4.0 * m_beta0 * m_beta0 * a1 ) *
                     ( -1.0 + 1.0 / r + log( r ) );
     return answer;
 }
 
 double EvtVubBLNP::S1( double /*a1*/, double r )
 {
     double answer = m_Gamma0 / ( 4 * m_beta0 * m_beta0 ) *
                     ( 0.5 * log( r ) * log( r ) * m_beta1 / m_beta0 +
                       ( m_Gamma1 / m_Gamma0 - m_beta1 / m_beta0 ) *
                           ( 1 - r + log( r ) ) );
     return answer;
 }
 
 double EvtVubBLNP::S2( double a1, double r )
 {
     double w1 = pow( m_beta1, 2 ) / pow( m_beta0, 2 ) - m_beta2 / m_beta0 -
                 m_beta1 * m_Gamma1 / ( m_beta0 * m_Gamma0 ) + m_Gamma2 / m_Gamma0;
     double w2 = pow( m_beta1, 2 ) / pow( m_beta0, 2 ) - m_beta2 / m_beta0;
     double w3 = m_beta1 * m_Gamma1 / ( m_beta0 * m_Gamma0 ) - m_beta2 / m_beta0;
     double w4 = a1 * m_Gamma0 / ( 4 * m_beta0 * m_beta0 );
 
     double answer = w4 *
                     ( -0.5 * pow( 1 - r, 2 ) * w1 + w2 * ( 1 - r ) * log( r ) +
                       w3 * ( 1 - r + r * log( r ) ) );
     return answer;
 }
 
 double EvtVubBLNP::aGamma( double mu1, double mu2, double epsilon )
 {
     double a1 = alphas( mu1, m_gvars );
     double a2 = alphas( mu2, m_gvars );
     double answer = m_Gamma0 / ( 2 * m_beta0 ) * log( a2 / a1 ) +
                     epsilon * ( a2 - a1 ) / ( 8.0 * M_PI ) *
                         ( m_Gamma1 / m_beta0 -
                           m_beta1 * m_Gamma0 / ( m_beta0 * m_beta0 ) );
     return answer;
 }
 
 double EvtVubBLNP::agp( double mu1, double mu2, double epsilon )
 {
     double a1 = alphas( mu1, m_gvars );
     double a2 = alphas( mu2, m_gvars );
     double answer = m_gp0 / ( 2 * m_beta0 ) * log( a2 / a1 ) +
                     epsilon * ( a2 - a1 ) / ( 8.0 * M_PI ) *
                         ( m_gp1 / m_beta0 -
                           m_beta1 * m_gp0 / ( m_beta0 * m_beta0 ) );
     return answer;
 }
 
 double EvtVubBLNP::alo( double muh, double mui )
 {
     return -2.0 * aGamma( muh, mui, 0 );
 }
 
 double EvtVubBLNP::anlo( double muh, double mui )
 {    // d/depsilon of aGamma
 
     double ah = alphas( muh, m_gvars );
     double ai = alphas( mui, m_gvars );
     double answer = ( ah - ai ) / ( 8.0 * M_PI ) *
                     ( m_Gamma1 / m_beta0 -
                       m_beta1 * m_Gamma0 / ( m_beta0 * m_beta0 ) );
     return answer;
 }
 
 double EvtVubBLNP::alphas( double mu, const std::vector<double>& vars )
 {
     // Note: Lambda4 and Lambda5 depend on mbMS = 4.25
     // So if you change mbMS, then you will have to recalculate them.
 
     double beta0 = vars[8];
     double beta1 = vars[9];
     double beta2 = vars[10];
 
     double Lambda4 = 0.298791;
     double lg = 2 * log( mu / Lambda4 );
     double answer = 4 * M_PI / ( beta0 * lg ) *
                     ( 1 - beta1 * log( lg ) / ( beta0 * beta0 * lg ) +
                       beta1 * beta1 / ( beta0 * beta0 * beta0 * beta0 * lg * lg ) *
                           ( ( log( lg ) - 0.5 ) * ( log( lg ) - 0.5 ) -
                             5.0 / 4.0 + beta2 * beta0 / ( beta1 * beta1 ) ) );
     return answer;
 }
 
 double EvtVubBLNP::PolyLog( double v, double z )
 {
     if ( z >= 1 )
         cout << "Error in EvtVubBLNP: 2nd argument to PolyLog is >= 1." << endl;
 
     double sum = 0.0;
     for ( int k = 1; k < 101; k++ ) {
         sum = sum + pow( z, k ) / pow( k, v );
     }
     return sum;
 }
 
 double EvtVubBLNP::Gamma( double z )
 {
     if ( z <= 0 )
         return 0;
 
     double v = lgamma( z );
     return exp( v );
 }
 
 double EvtVubBLNP::Gamma( double a, double x )
 {
     double LogGamma;
     /*    if (x<0.0 || a<= 0.0) raise(SIGFPE);*/
     if ( x < 0.0 )
         x = 0.0;
     if ( a <= 0.0 )
         a = 1.e-50;
     LogGamma = lgamma( a );
     if ( x < ( a + 1.0 ) )
         return gamser( a, x, LogGamma );
     else
         return 1.0 - gammcf( a, x, LogGamma );
 }
 
 /* ------------------Incomplete gamma function-----------------*/
 /* ------------------via its series representation-------------*/
 
 double EvtVubBLNP::gamser( double a, double x, double LogGamma )
 {
     double n;
     double ap, del, sum;
 
     ap = a;
     del = sum = 1.0 / a;
     for ( n = 1; n < ITMAX; n++ ) {
         ++ap;
         del *= x / ap;
         sum += del;
         if ( fabs( del ) < fabs( sum ) * EPS )
             return sum * exp( -x + a * log( x ) - LogGamma );
     }
     raise( SIGFPE );
 
     return 0.0;
 }
 
 /* ------------------Incomplete gamma function complement------*/
 /* ------------------via its continued fraction representation-*/
 
 double EvtVubBLNP::gammcf( double a, double x, double LogGamma )
 {
     double an, b, c, d, del, h;
     int i;
 
     b = x + 1.0 - a;
     c = 1.0 / FPMIN;
     d = 1.0 / b;
     h = d;
     for ( i = 1; i < ITMAX; i++ ) {
         an = -i * ( i - a );
         b += 2.0;
         d = an * d + b;
         if ( fabs( d ) < FPMIN )
             d = FPMIN;
         c = b + an / c;
         if ( fabs( c ) < FPMIN )
             c = FPMIN;
         d = 1.0 / d;
         del = d * c;
         h *= del;
         if ( fabs( del - 1.0 ) < EPS )
             return exp( -x + a * log( x ) - LogGamma ) * h;
     }
     raise( SIGFPE );
 
     return 0.0;
 }
 
 double EvtVubBLNP::findBLNPWhat()
 {
     double ranNum = EvtRandom::Flat();
     double oOverBins = 1.0 / ( float( m_pf.size() ) );
     int nBinsBelow = 0;    // largest k such that I[k] is known to be <= rand
     int nBinsAbove = m_pf.size();    // largest k such that I[k] is known to be >  rand
     int middle;
 
     while ( nBinsAbove > nBinsBelow + 1 ) {
         middle = ( nBinsAbove + nBinsBelow + 1 ) >> 1;
         if ( ranNum >= m_pf[middle] ) {
             nBinsBelow = middle;
         } else {
             nBinsAbove = middle;
         }
     }
 
     double bSize = m_pf[nBinsAbove] - m_pf[nBinsBelow];
     // binMeasure is always aProbFunc[nBinsBelow],
 
     if ( bSize == 0 ) {
         // rand lies right in a bin of measure 0.  Simply return the center
         // of the range of that bin.  (Any value between k/N and (k+1)/N is
         // equally good, in this rare case.)
         return ( nBinsBelow + .5 ) * oOverBins;
     }
 
     double bFract = ( ranNum - m_pf[nBinsBelow] ) / bSize;
 
     return ( nBinsBelow + bFract ) * oOverBins;
 }
diff --git a/src/EvtGenModels/EvtVubBLNPHybrid.cpp b/src/EvtGenModels/EvtVubBLNPHybrid.cpp
index e9b84e4..e657052 100644
--- a/src/EvtGenModels/EvtVubBLNPHybrid.cpp
+++ b/src/EvtGenModels/EvtVubBLNPHybrid.cpp
@@ -1,1189 +1,1189 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVubBLNPHybrid.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtItgPtrFunction.hh"
 #include "EvtGenModels/EvtItgSimpsonIntegrator.hh"
 #include "EvtGenModels/EvtPFermi.hh"
 
 #include <stdlib.h>
 #include <string>
 
 // For incomplete gamma function
 #include "math.h"
 #include "signal.h"
 #define ITMAX 100
 #define EPS 3.0e-7
 #define FPMIN 1.0e-30
 
 using std::cout;
 using std::endl;
 
-std::string EvtVubBLNPHybrid::getName()
+std::string EvtVubBLNPHybrid::getName() const
 {
     return "VUB_BLNPHYBRID";
 }
 
-EvtDecayBase* EvtVubBLNPHybrid::clone()
+EvtDecayBase* EvtVubBLNPHybrid::clone() const
 {
     return new EvtVubBLNPHybrid;
 }
 
 void EvtVubBLNPHybrid::init()
 {
     // check number of arguments
     if ( getNArg() < EvtVubBLNPHybrid::nParameters ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubBLNPHybrid" )
             << "EvtVubBLNPHybrid generator expected "
             << "at least " << EvtVubBLNPHybrid::nParameters
             << " arguments but found: " << getNArg()
             << "\nWill terminate execution!" << endl;
         ::abort();
     } else if ( getNArg() == EvtVubBLNPHybrid::nParameters ) {
         EvtGenReport( EVTGEN_WARNING, "EvtVubBLNPHybrid" )
             << "EvtVubBLNPHybrid: generate B -> Xu l nu events "
             << "without using the hybrid reweighting." << endl;
         m_noHybrid = true;
     } else if ( getNArg() <
                 EvtVubBLNPHybrid::nParameters + EvtVubBLNPHybrid::nVariables ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubBLNPHybrid" )
             << "EvtVubBLNPHybrid could not read number of bins for "
             << "all variables used in the reweighting\n"
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     // get parameters (declared in the header file)
 
     // Input parameters
     m_mBB = 5.2792;
     m_lambda2 = 0.12;
 
     // Shape function parameters
     m_b = getArg( 0 );
     m_Lambda = getArg( 1 );
     m_Ecut = 1.8;
     m_wzero = m_mBB - 2 * m_Ecut;
 
     // SF and SSF modes
     m_itype = (int)getArg( 5 );
     m_dtype = getArg( 5 );
     m_isubl = (int)getArg( 6 );
 
     // flags
     m_flag1 = (int)getArg( 7 );
     m_flag2 = (int)getArg( 8 );
     m_flag3 = (int)getArg( 9 );
 
     // Quark mass
     m_mb = 4.61;
 
     // hidden parameter what and SF stuff
     const double xlow = 0;
     const double xhigh = m_mBB;
     const int aSize = 10000;
     EvtPFermi pFermi( m_Lambda, m_b );
     // pf is the cumulative distribution normalized to 1.
     m_pf.resize( aSize );
     for ( int i = 0; i < aSize; i++ ) {
         double what = xlow + (double)( i + 0.5 ) / ( (double)aSize ) *
                                  ( xhigh - xlow );
         if ( i == 0 )
             m_pf[i] = pFermi.getSFBLNP( what );
         else
             m_pf[i] = m_pf[i - 1] + pFermi.getSFBLNP( what );
     }
     for ( size_t i = 0; i < m_pf.size(); i++ ) {
         m_pf[i] /= m_pf[m_pf.size() - 1];
     }
 
     // Matching scales
     m_muh = m_mBB * getArg( 2 );    // 0.5
     m_mui = getArg( 3 );            // 1.5
     m_mubar = getArg( 4 );          // 1.5
 
     // Perturbative quantities
     m_CF = 4.0 / 3.0;
     m_CA = 3.0;
     double nf = 4.0;
 
     m_beta0 = 11.0 / 3.0 * m_CA - 2.0 / 3.0 * nf;
     m_beta1 = 34.0 / 3.0 * m_CA * m_CA - 10.0 / 3.0 * m_CA * nf - 2.0 * m_CF * nf;
     m_beta2 = 2857.0 / 54.0 * m_CA * m_CA * m_CA +
               ( m_CF * m_CF - 205.0 / 18.0 * m_CF * m_CA -
                 1415.0 / 54.0 * m_CA * m_CA ) *
                   nf +
               ( 11.0 / 9.0 * m_CF + 79.0 / 54.0 * m_CA ) * nf * nf;
 
     m_zeta3 = 1.0 + 1 / 8.0 + 1 / 27.0 + 1 / 64.0;
 
     m_Gamma0 = 4 * m_CF;
     m_Gamma1 = m_CF * ( ( 268.0 / 9.0 - 4.0 * M_PI * M_PI / 3.0 ) * m_CA -
                         40.0 / 9.0 * nf );
     m_Gamma2 = 16 * m_CF *
                ( ( 245.0 / 24.0 - 67.0 / 54.0 * M_PI * M_PI +
                    +11.0 / 180.0 * pow( M_PI, 4 ) + 11.0 / 6.0 * m_zeta3 ) *
                      m_CA * m_CA *
                      +( -209.0 / 108.0 + 5.0 / 27.0 * M_PI * M_PI -
                         7.0 / 3.0 * m_zeta3 ) *
                      m_CA * nf +
                  ( -55.0 / 24.0 + 2 * m_zeta3 ) * m_CF * nf - nf * nf / 27.0 );
 
     m_gp0 = -5.0 * m_CF;
     m_gp1 = -8.0 * m_CF *
             ( ( 3.0 / 16.0 - M_PI * M_PI / 4.0 + 3 * m_zeta3 ) * m_CF +
               ( 1549.0 / 432.0 + 7.0 / 48.0 * M_PI * M_PI - 11.0 / 4.0 * m_zeta3 ) *
                   m_CA -
               ( 125.0 / 216.0 + M_PI * M_PI / 24.0 ) * nf );
 
     // Lbar and m_mupisq
 
     m_Lbar = m_Lambda;    // all models
     m_mupisq = 3 * m_Lambda * m_Lambda / m_b;
     if ( m_itype == 1 )
         m_mupisq = 3 * m_Lambda * m_Lambda / m_b;
     if ( m_itype == 2 )
         m_mupisq = 3 * m_Lambda * m_Lambda *
                    ( Gamma( 1 + 0.5 * m_b ) * Gamma( 0.5 * m_b ) /
                          pow( Gamma( 0.5 + 0.5 * m_b ), 2 ) -
                      1 );
 
     // m_moment2 for SSFs
     m_moment2 = pow( 0.3, 3 );
 
     // inputs for total rate (T for Total); use BLNP notebook defaults
     m_flagpower = 1;
     m_flag2loop = 1;
 
     // stuff for the integrator
     m_maxLoop = 20;
     //m_precision = 1.0e-3;
     m_precision = 2.0e-2;
 
     // vector of global variables, to pass to static functions (which can't access globals);
     m_gvars.push_back( 0.0 );         // 0
     m_gvars.push_back( 0.0 );         // 1
     m_gvars.push_back( m_mui );       // 2
     m_gvars.push_back( m_b );         // 3
     m_gvars.push_back( m_Lambda );    // 4
     m_gvars.push_back( m_mBB );       // 5
     m_gvars.push_back( m_mb );        // 6
     m_gvars.push_back( m_wzero );     // 7
     m_gvars.push_back( m_beta0 );     // 8
     m_gvars.push_back( m_beta1 );     // 9
     m_gvars.push_back( m_beta2 );     // 10
     m_gvars.push_back( m_dtype );     // 11
 
     // check that there are 3 daughters and 10 arguments
     checkNDaug( 3 );
     // A. Volk: check for number of arguments is not necessary
     //checkNArg(10);
 
     if ( m_noHybrid )
         return;    // Without hybrid weighting, nothing else to do
 
     m_bins_mX = std::vector<double>( abs( (int)getArg( 10 ) ) );
     m_bins_q2 = std::vector<double>( abs( (int)getArg( 11 ) ) );
     m_bins_El = std::vector<double>( abs( (int)getArg( 12 ) ) );
 
     int nextArg = EvtVubBLNPHybrid::nParameters + EvtVubBLNPHybrid::nVariables;
 
     m_nbins = m_bins_mX.size() * m_bins_q2.size() *
               m_bins_El.size();    // Binning of weight table
 
     int expectArgs = nextArg + m_bins_mX.size() + m_bins_q2.size() +
                      m_bins_El.size() + m_nbins;
 
     if ( getNArg() < expectArgs ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubBLNPHybrid" )
             << " finds " << getNArg() << " arguments, expected " << expectArgs
             << ".  Something is wrong with the tables of weights or thresholds."
             << "\nWill terminate execution!" << endl;
         ::abort();
     }
 
     // read bin boundaries from decay.dec
     for ( auto& b : m_bins_mX )
         b = getArg( nextArg++ );
     m_masscut = m_bins_mX[0];
     for ( auto& b : m_bins_q2 )
         b = getArg( nextArg++ );
     for ( auto& b : m_bins_El )
         b = getArg( nextArg++ );
 
     // read in weights (and rescale to range 0..1)
     readWeights( nextArg );
 }
 
 void EvtVubBLNPHybrid::initProbMax()
 {
     noProbMax();
 }
 
 void EvtVubBLNPHybrid::decay( EvtParticle* Bmeson )
 {
     int j;
 
     EvtParticle *xuhad( nullptr ), *lepton( nullptr ), *neutrino( nullptr );
     EvtVector4R p4;
     double EX( 0. ), sh( 0. ), El( 0. ), ml( 0. );
     double Pp, Pm, Pl, pdf, qsq, mpi, ratemax;
 
     double xhigh, xlow, what;
     double mX;
 
     bool rew( true );
     while ( rew ) {
         Bmeson->initializePhaseSpace( getNDaug(), getDaugs() );
 
         xuhad = Bmeson->getDaug( 0 );
         lepton = Bmeson->getDaug( 1 );
         neutrino = Bmeson->getDaug( 2 );
 
         m_mBB = Bmeson->mass();
         ml = lepton->mass();
 
         //  get SF value
         xlow = 0;
         xhigh = m_mBB;
         // the case for alphas = 0 is not considered
         what = 2 * xhigh;
         while ( what > xhigh || what < xlow ) {
             what = findBLNPWhat();
             what = xlow + what * ( xhigh - xlow );
         }
 
         bool tryit = true;
 
         while ( tryit ) {
             // generate pp between 0 and
             // Flat(min, max) gives R(max - min) + min, where R = random btwn 0 and 1
 
             Pp = EvtRandom::Flat( 0, m_mBB );    // P+ = EX - |PX|
             Pl = EvtRandom::Flat( 0, m_mBB );    // mBB - 2El
             Pm = EvtRandom::Flat( 0, m_mBB );    // P- = EX + |PX|
 
             sh = Pm * Pp;
             EX = 0.5 * ( Pm + Pp );
             qsq = ( m_mBB - Pp ) * ( m_mBB - Pm );
             El = 0.5 * ( m_mBB - Pl );
 
             // Need maximum rate.  Waiting for Mr. Paz to give it to me.
             // Meanwhile, use this.
             ratemax = 3.0;    // From trial and error - most events below 3.0
 
             // kinematic bounds (Eq. 2)
             mpi = 0.14;
             if ( ( Pp > 0 ) && ( Pp <= Pl ) && ( Pl <= Pm ) && ( Pm < m_mBB ) &&
                  ( El > ml ) && ( sh > 4 * mpi * mpi ) ) {
                 // Probability of pass proportional to PDF
                 pdf = rate3( Pp, Pl, Pm );
                 double testRan = EvtRandom::Flat( 0., ratemax );
                 if ( pdf >= testRan )
                     tryit = false;
             }
         }
 
         // compute all kinematic variables needed for reweighting
         mX = sqrt( sh );
 
         // Reweighting in bins of mX, q2, El
         if ( m_nbins > 0 ) {
             double xran1 = EvtRandom::Flat();
             double w = 1.0;
             if ( !m_noHybrid )
                 w = getWeight( mX, qsq, El );
             if ( w >= xran1 )
                 rew = false;
         } else {
             rew = false;
         }
     }
     // o.k. we have the three kineamtic variables
     // now calculate a flat cos Theta_H [-1,1] distribution of the
     // hadron flight direction w.r.t the B flight direction
     // because the B is a scalar and should decay isotropic.
     // Then chose a flat Phi_H [0,2Pi] w.r.t the B flight direction
     // and and a flat Phi_L [0,2Pi] in the W restframe w.r.t the
     // W flight direction.
 
     double ctH = EvtRandom::Flat( -1, 1 );
     double phH = EvtRandom::Flat( 0, 2 * M_PI );
     double phL = EvtRandom::Flat( 0, 2 * M_PI );
 
     // now compute the four vectors in the B Meson restframe
 
     double ptmp, sttmp;
     // calculate the hadron 4 vector in the B Meson restframe
 
     sttmp = sqrt( 1 - ctH * ctH );
     ptmp = sqrt( EX * EX - sh );
     double pHB[4] = { EX, ptmp * sttmp * cos( phH ), ptmp * sttmp * sin( phH ),
                       ptmp * ctH };
     p4.set( pHB[0], pHB[1], pHB[2], pHB[3] );
     xuhad->init( getDaug( 0 ), p4 );
 
     if ( m_storeWhat ) {
         // cludge to store the hidden parameter what with the decay;
         // the lifetime of the Xu is abused for this purpose.
         // tau = 1 ps corresponds to ctau = 0.3 mm -> in order to
         // stay well below BaBars sensitivity we take what/(10000 GeV).
         // To extract what back from the StdHepTrk its necessary to get
         // delta_ctau = Xu->decayVtx()->point().distanceTo(XuDaughter->decayVtx()->point());
         //
         // what = delta_ctau * 100000 * Mass_Xu/Momentum_Xu
         //
         xuhad->setLifetime( what / 10000. );
     }
 
     // calculate the W 4 vector in the B Meson restrframe
 
     double apWB = ptmp;
     double pWB[4] = { m_mBB - EX, -pHB[1], -pHB[2], -pHB[3] };
 
     // first go in the W restframe and calculate the lepton and
     // the neutrino in the W frame
 
     double mW2 = m_mBB * m_mBB + sh - 2 * m_mBB * EX;
     double beta = ptmp / pWB[0];
     double gamma = pWB[0] / sqrt( mW2 );
 
     double pLW[4];
 
     ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
     pLW[0] = sqrt( ml * ml + ptmp * ptmp );
 
     double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
     if ( ctL < -1 )
         ctL = -1;
     if ( ctL > 1 )
         ctL = 1;
     sttmp = sqrt( 1 - ctL * ctL );
 
     // eX' = eZ x eW
     double xW[3] = { -pWB[2], pWB[1], 0 };
     // eZ' = eW
     double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
 
     double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
     for ( j = 0; j < 2; j++ )
         xW[j] /= lx;
 
     // eY' = eZ' x eX'
     double yW[3] = { -pWB[1] * pWB[3], -pWB[2] * pWB[3],
                      pWB[1] * pWB[1] + pWB[2] * pWB[2] };
     double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
     for ( j = 0; j < 3; j++ )
         yW[j] /= ly;
 
     // p_lep = |p_lep| * (  sin(Theta) * cos(Phi) * eX'
     //                    + sin(Theta) * sin(Phi) * eY'
     //                    + cos(Theta) *            eZ')
     for ( j = 0; j < 3; j++ )
         pLW[j + 1] = sttmp * cos( phL ) * ptmp * xW[j] +
                      sttmp * sin( phL ) * ptmp * yW[j] + ctL * ptmp * zW[j];
 
     double apLW = ptmp;
 
     // boost them back in the B Meson restframe
 
     double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
 
     ptmp = sqrt( El * El - ml * ml );
     double ctLL = appLB / ptmp;
 
     if ( ctLL > 1 )
         ctLL = 1;
     if ( ctLL < -1 )
         ctLL = -1;
 
     double pLB[4] = { El, 0, 0, 0 };
     double pNB[4] = { pWB[0] - El, 0, 0, 0 };
 
     for ( j = 1; j < 4; j++ ) {
         pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
         pNB[j] = pWB[j] - pLB[j];
     }
 
     p4.set( pLB[0], pLB[1], pLB[2], pLB[3] );
     lepton->init( getDaug( 1 ), p4 );
 
     p4.set( pNB[0], pNB[1], pNB[2], pNB[3] );
     neutrino->init( getDaug( 2 ), p4 );
 }
 
 double EvtVubBLNPHybrid::rate3( double Pp, double Pl, double Pm )
 {
     // rate3 in units of GF^2*Vub^2/pi^3
 
     double factor = 1.0 / 16 * ( m_mBB - Pp ) * U1lo( m_muh, m_mui ) *
                     pow( ( Pm - Pp ) / ( m_mBB - Pp ), alo( m_muh, m_mui ) );
 
     double doneJS = DoneJS( Pp, Pm, m_mui );
     double done1 = Done1( Pp, Pm, m_mui );
     double done2 = Done2( Pp, Pm, m_mui );
     double done3 = Done3( Pp, Pm, m_mui );
 
     // The EvtSimpsonIntegrator returns zero for bad integrals.
     // So if any of the integrals are zero (ie bad), return zero.
     // This will cause pdf = 0, so the event will not pass.
     // I hope this will not introduce a bias.
     if ( doneJS * done1 * done2 * done3 == 0.0 ) {
         //cout << "Integral failed: (Pp, Pm, Pl) = (" << Pp << ", " << Pm << ", " << Pl << ")" << endl;
         return 0.0;
     }
     //  if (doneJS*done1*done2*done3 != 0.0) {
     //    cout << "Integral OK: (Pp, Pm, Pl) = (" << Pp << ", " << Pm << ", " << Pl << ")" << endl;
     //}
 
     double f1 = F1( Pp, Pm, m_muh, m_mui, m_mubar, doneJS, done1 );
     double f2 = F2( Pp, Pm, m_muh, m_mui, m_mubar, done3 );
     double f3 = F3( Pp, Pm, m_muh, m_mui, m_mubar, done2 );
     double answer = factor * ( ( m_mBB + Pl - Pp - Pm ) * ( Pm - Pl ) * f1 +
                                2 * ( Pl - Pp ) * ( Pm - Pl ) * f2 +
                                ( m_mBB - Pm ) * ( Pm - Pp ) * f3 );
     return answer;
 }
 
 double EvtVubBLNPHybrid::F1( double Pp, double Pm, double muh, double mui,
                              double mubar, double doneJS, double done1 )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double y = ( Pm - Pp ) / ( m_mBB - Pp );
     double ah = m_CF * alphas( muh, vars ) / 4 / M_PI;
     double ai = m_CF * alphas( mui, vars ) / 4 / M_PI;
     double abar = m_CF * alphas( mubar, vars ) / 4 / M_PI;
     double lambda1 = -m_mupisq;
 
     double t1 = -4 * ai / ( Pp - m_Lbar ) *
                 ( 2 * log( ( Pp - m_Lbar ) / mui ) + 1 );
     double t2 = 1 + dU1nlo( muh, mui ) + anlo( muh, mui ) * log( y );
     double t3 = -4.0 * pow( log( y * m_mb / muh ), 2 ) +
                 10.0 * log( y * m_mb / muh ) - 4.0 * log( y ) -
                 2.0 * log( y ) / ( 1 - y ) - 4.0 * PolyLog( 2, 1 - y ) -
                 M_PI * M_PI / 6.0 - 12.0;
     double t4 = 2 * pow( log( y * m_mb * Pp / ( mui * mui ) ), 2 ) -
                 3 * log( y * m_mb * Pp / ( mui * mui ) ) + 7 - M_PI * M_PI;
 
     double t5 = -wS( Pp ) + 2 * t( Pp ) +
                 ( 1.0 / y - 1.0 ) * ( u( Pp ) - v( Pp ) );
     double t6 = -( lambda1 + 3.0 * m_lambda2 ) / 3.0 +
                 1.0 / pow( y, 2 ) * ( 4.0 / 3.0 * lambda1 - 2.0 * m_lambda2 );
 
     double shapePp = Shat( Pp, vars );
 
     double answer = ( t2 + ah * t3 + ai * t4 ) * shapePp + ai * doneJS +
                     1 / ( m_mBB - Pp ) *
                         ( m_flag2 * abar * done1 + m_flag1 * t5 ) +
                     1 / pow( m_mBB - Pp, 2 ) * m_flag3 * shapePp * t6;
     if ( Pp > m_Lbar + mui / exp( 0.5 ) )
         answer = answer + t1;
     return answer;
 }
 
 double EvtVubBLNPHybrid::F2( double Pp, double Pm, double muh, double /* mui */,
                              double mubar, double done3 )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double y = ( Pm - Pp ) / ( m_mBB - Pp );
     double lambda1 = -m_mupisq;
     double ah = m_CF * alphas( muh, vars ) / 4 / M_PI;
     double abar = m_CF * alphas( mubar, vars ) / 4 / M_PI;
 
     double t6 = -wS( Pp ) - 2 * t( Pp ) + 1.0 / y * ( t( Pp ) + v( Pp ) );
     double t7 = 1 / pow( y, 2 ) * ( 2.0 / 3.0 * lambda1 + 4.0 * m_lambda2 ) -
                 1 / y * ( 2.0 / 3.0 * lambda1 + 3.0 / 2.0 * m_lambda2 );
 
     double shapePp = Shat( Pp, vars );
 
     double answer = ah * log( y ) / ( 1 - y ) * shapePp +
                     1 / ( m_mBB - Pp ) *
                         ( m_flag2 * abar * 0.5 * done3 + m_flag1 / y * t6 ) +
                     1.0 / pow( m_mBB - Pp, 2 ) * m_flag3 * shapePp * t7;
     return answer;
 }
 
 double EvtVubBLNPHybrid::F3( double Pp, double Pm, double /*muh*/,
                              double /* mui */, double mubar, double done2 )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double y = ( Pm - Pp ) / ( m_mBB - Pp );
     double lambda1 = -m_mupisq;
     double abar = m_CF * alphas( mubar, vars ) / 4 / M_PI;
 
     double t7 = 1.0 / pow( y, 2 ) * ( -2.0 / 3.0 * lambda1 + m_lambda2 );
 
     double shapePp = Shat( Pp, vars );
 
     double answer = 1.0 / ( Pm - Pp ) * m_flag2 * 0.5 * y * abar * done2 +
                     1.0 / pow( m_mBB - Pp, 2 ) * m_flag3 * shapePp * t7;
     return answer;
 }
 
 double EvtVubBLNPHybrid::DoneJS( double Pp, double Pm, double /* mui */ )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double lowerlim = 0.001 * Pp;
     double upperlim = ( 1.0 - 0.001 ) * Pp;
 
     auto func = EvtItgPtrFunction{ &IntJS, lowerlim, upperlim, vars };
     auto integ = EvtItgSimpsonIntegrator{ func, m_precision, m_maxLoop };
     return integ.evaluate( lowerlim, upperlim );
 }
 
 double EvtVubBLNPHybrid::Done1( double Pp, double Pm, double /* mui */ )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double lowerlim = 0.001 * Pp;
     double upperlim = ( 1.0 - 0.001 ) * Pp;
 
     auto func = EvtItgPtrFunction{ &Int1, lowerlim, upperlim, vars };
     auto integ = EvtItgSimpsonIntegrator{ func, m_precision, m_maxLoop };
     return integ.evaluate( lowerlim, upperlim );
 }
 
 double EvtVubBLNPHybrid::Done2( double Pp, double Pm, double /* mui */ )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double lowerlim = 0.001 * Pp;
     double upperlim = ( 1.0 - 0.001 ) * Pp;
 
     auto func = EvtItgPtrFunction{ &Int2, lowerlim, upperlim, vars };
     auto integ = EvtItgSimpsonIntegrator{ func, m_precision, m_maxLoop };
     return integ.evaluate( lowerlim, upperlim );
 }
 
 double EvtVubBLNPHybrid::Done3( double Pp, double Pm, double /* mui */ )
 {
     std::vector<double> vars( 12 );
     vars[0] = Pp;
     vars[1] = Pm;
     for ( int j = 2; j < 12; j++ ) {
         vars[j] = m_gvars[j];
     }
 
     double lowerlim = 0.001 * Pp;
     double upperlim = ( 1.0 - 0.001 ) * Pp;
 
     auto func = EvtItgPtrFunction{ &Int3, lowerlim, upperlim, vars };
     auto integ = EvtItgSimpsonIntegrator{ func, m_precision, m_maxLoop };
     return integ.evaluate( lowerlim, upperlim );
 }
 
 double EvtVubBLNPHybrid::Int1( double what, const std::vector<double>& vars )
 {
     return Shat( what, vars ) * g1( what, vars );
 }
 
 double EvtVubBLNPHybrid::Int2( double what, const std::vector<double>& vars )
 {
     return Shat( what, vars ) * g2( what, vars );
 }
 
 double EvtVubBLNPHybrid::Int3( double what, const std::vector<double>& vars )
 {
     return Shat( what, vars ) * g3( what, vars );
 }
 
 double EvtVubBLNPHybrid::IntJS( double what, const std::vector<double>& vars )
 {
     double Pp = vars[0];
     double Pm = vars[1];
     double mui = vars[2];
     double mBB = vars[5];
     double mb = vars[6];
     double y = ( Pm - Pp ) / ( mBB - Pp );
 
     return 1 / ( Pp - what ) * ( Shat( what, vars ) - Shat( Pp, vars ) ) *
            ( 4 * log( y * mb * ( Pp - what ) / ( mui * mui ) ) - 3 );
 }
 
 double EvtVubBLNPHybrid::g1( double w, const std::vector<double>& vars )
 {
     double Pp = vars[0];
     double Pm = vars[1];
     double mBB = vars[5];
     double y = ( Pm - Pp ) / ( mBB - Pp );
     double x = ( Pp - w ) / ( mBB - Pp );
 
     double q1 = ( 1 + x ) * ( 1 + x ) * y * ( x + y );
     double q2 = y * ( -9 + 10 * y ) + x * x * ( -12.0 + 13.0 * y ) +
                 2 * x * ( -8.0 + 6 * y + 3 * y * y );
     double q3 = 4 / x * log( y + y / x );
     double q4 = 3.0 * pow( x, 4 ) * ( -2.0 + y ) - 2 * pow( y, 3 ) -
                 4 * pow( x, 3 ) * ( 2.0 + y ) - 2 * x * y * y * ( 4 + y ) -
                 x * x * y * ( 12 + 4 * y + y * y );
     double q5 = log( 1 + y / x );
 
     double answer = q2 / q1 - q3 - 2 * q4 * q5 / ( q1 * y * x );
     return answer;
 }
 
 double EvtVubBLNPHybrid::g2( double w, const std::vector<double>& vars )
 {
     double Pp = vars[0];
     double Pm = vars[1];
     double mBB = vars[5];
     double y = ( Pm - Pp ) / ( mBB - Pp );
     double x = ( Pp - w ) / ( mBB - Pp );
 
     double q1 = ( 1 + x ) * ( 1 + x ) * pow( y, 3 ) * ( x + y );
     double q2 = 10.0 * pow( x, 4 ) + y * y +
                 3.0 * pow( x, 2 ) * y * ( 10.0 + y ) +
                 pow( x, 3 ) * ( 12.0 + 19.0 * y ) +
                 x * y * ( 8.0 + 4.0 * y + y * y );
     double q3 = 5 * pow( x, 4 ) + 2.0 * y * y +
                 6.0 * pow( x, 3 ) * ( 1.0 + 2.0 * y ) +
                 4.0 * x * y * ( 1 + 2.0 * y ) + x * x * y * ( 18.0 + 5.0 * y );
     double q4 = log( 1 + y / x );
 
     double answer = 2.0 / q1 * ( y * q2 - 2 * x * q3 * q4 );
     return answer;
 }
 
 double EvtVubBLNPHybrid::g3( double w, const std::vector<double>& vars )
 {
     double Pp = vars[0];
     double Pm = vars[1];
     double mBB = vars[5];
     double y = ( Pm - Pp ) / ( mBB - Pp );
     double x = ( Pp - w ) / ( mBB - Pp );
 
     double q1 = ( 1 + x ) * ( 1 + x ) * pow( y, 3 ) * ( x + y );
     double q2 = 2.0 * pow( y, 3 ) * ( -11.0 + 2.0 * y ) -
                 10.0 * pow( x, 4 ) * ( 6 - 6 * y + y * y ) +
                 x * y * y * ( -94.0 + 29.0 * y + 2.0 * y * y ) +
                 2.0 * x * x * y * ( -72.0 + 18.0 * y + 13.0 * y * y ) -
                 x * x * x * ( 72.0 + 42.0 * y - 70.0 * y * y + 3.0 * y * y * y );
     double q3 = -6.0 * x * ( -5.0 + y ) * pow( y, 3 ) + 4 * pow( y, 4 ) +
                 5 * pow( x, 5 ) * ( 6 - 6 * y + y * y ) -
                 4 * x * x * y * y * ( -20.0 + 6 * y + y * y ) +
                 pow( x, 3 ) * y * ( 90.0 - 10.0 * y - 28.0 * y * y + y * y * y ) +
                 pow( x, 4 ) * ( 36.0 + 36.0 * y - 50.0 * y * y + 4 * y * y * y );
     double q4 = log( 1 + y / x );
 
     double answer = q2 / q1 + 2 / q1 / y * q3 * q4;
     return answer;
 }
 
 double EvtVubBLNPHybrid::Shat( double w, const std::vector<double>& vars )
 {
     double mui = vars[2];
     double b = vars[3];
     double Lambda = vars[4];
     double wzero = vars[7];
     int itype = (int)vars[11];
 
     double norm = 0.0;
     double shape = 0.0;
 
     if ( itype == 1 ) {
         double Lambar = ( Lambda / b ) *
                         ( Gamma( 1 + b ) - Gamma( 1 + b, b * wzero / Lambda ) ) /
                         ( Gamma( b ) - Gamma( b, b * wzero / Lambda ) );
         double muf = wzero - Lambar;
         double mupisq = 3 * pow( Lambda, 2 ) / pow( b, 2 ) *
                             ( Gamma( 2 + b ) -
                               Gamma( 2 + b, b * wzero / Lambda ) ) /
                             ( Gamma( b ) - Gamma( b, b * wzero / Lambda ) ) -
                         3 * Lambar * Lambar;
         norm = Mzero( muf, mui, mupisq, vars ) * Gamma( b ) /
                ( Gamma( b ) - Gamma( b, b * wzero / Lambda ) );
         shape = pow( b, b ) / Lambda / Gamma( b ) * pow( w / Lambda, b - 1 ) *
                 exp( -b * w / Lambda );
     }
 
     if ( itype == 2 ) {
         double dcoef = pow( Gamma( 0.5 * ( 1 + b ) ) / Gamma( 0.5 * b ), 2 );
         double t1 = wzero * wzero * dcoef / ( Lambda * Lambda );
         double Lambar =
             Lambda * ( Gamma( 0.5 * ( 1 + b ) ) - Gamma( 0.5 * ( 1 + b ), t1 ) ) /
             pow( dcoef, 0.5 ) / ( Gamma( 0.5 * b ) - Gamma( 0.5 * b, t1 ) );
         double muf = wzero - Lambar;
         double mupisq = 3 * Lambda * Lambda *
                             ( Gamma( 1 + 0.5 * b ) - Gamma( 1 + 0.5 * b, t1 ) ) /
                             dcoef / ( Gamma( 0.5 * b ) - Gamma( 0.5 * b, t1 ) ) -
                         3 * Lambar * Lambar;
         norm = Mzero( muf, mui, mupisq, vars ) * Gamma( 0.5 * b ) /
                ( Gamma( 0.5 * b ) -
                  Gamma( 0.5 * b, wzero * wzero * dcoef / ( Lambda * Lambda ) ) );
         shape = 2 * pow( dcoef, 0.5 * b ) / Lambda / Gamma( 0.5 * b ) *
                 pow( w / Lambda, b - 1 ) *
                 exp( -dcoef * w * w / ( Lambda * Lambda ) );
     }
 
     double answer = norm * shape;
     return answer;
 }
 
 double EvtVubBLNPHybrid::Mzero( double muf, double mu, double mupisq,
                                 const std::vector<double>& vars )
 {
     double CF = 4.0 / 3.0;
     double amu = CF * alphas( mu, vars ) / M_PI;
     double answer = 1 -
                     amu * ( pow( log( muf / mu ), 2 ) + log( muf / mu ) +
                             M_PI * M_PI / 24.0 ) +
                     amu * ( log( muf / mu ) - 0.5 ) * mupisq / ( 3 * muf * muf );
     return answer;
 }
 
 double EvtVubBLNPHybrid::wS( double w )
 {
     double answer = ( m_Lbar - w ) * Shat( w, m_gvars );
     return answer;
 }
 
 double EvtVubBLNPHybrid::t( double w )
 {
     double t1 = -3 * m_lambda2 / m_mupisq * ( m_Lbar - w ) * Shat( w, m_gvars );
     double myf = myfunction( w, m_Lbar, m_moment2 );
     double myBIK = myfunctionBIK( w, m_Lbar, m_moment2 );
     double answer = t1;
 
     if ( m_isubl == 1 )
         answer = t1;
     if ( m_isubl == 3 )
         answer = t1 - myf;
     if ( m_isubl == 4 )
         answer = t1 + myf;
     if ( m_isubl == 5 )
         answer = t1 - myBIK;
     if ( m_isubl == 6 )
         answer = t1 + myBIK;
 
     return answer;
 }
 
 double EvtVubBLNPHybrid::u( double w )
 {
     double u1 = -2 * ( m_Lbar - w ) * Shat( w, m_gvars );
     double myf = myfunction( w, m_Lbar, m_moment2 );
     double myBIK = myfunctionBIK( w, m_Lbar, m_moment2 );
     double answer = u1;
 
     if ( m_isubl == 1 )
         answer = u1;
     if ( m_isubl == 3 )
         answer = u1 + myf;
     if ( m_isubl == 4 )
         answer = u1 - myf;
     if ( m_isubl == 5 )
         answer = u1 + myBIK;
     if ( m_isubl == 6 )
         answer = u1 - myBIK;
 
     return answer;
 }
 
 double EvtVubBLNPHybrid::v( double w )
 {
     double v1 = 3 * m_lambda2 / m_mupisq * ( m_Lbar - w ) * Shat( w, m_gvars );
     double myf = myfunction( w, m_Lbar, m_moment2 );
     double myBIK = myfunctionBIK( w, m_Lbar, m_moment2 );
     double answer = v1;
 
     if ( m_isubl == 1 )
         answer = v1;
     if ( m_isubl == 3 )
         answer = v1 - myf;
     if ( m_isubl == 4 )
         answer = v1 + myf;
     if ( m_isubl == 5 )
         answer = v1 - myBIK;
     if ( m_isubl == 6 )
         answer = v1 + myBIK;
 
     return answer;
 }
 
 double EvtVubBLNPHybrid::myfunction( double w, double Lbar, double mom2 )
 {
     double bval = 5.0;
     double x = w / Lbar;
     double factor = 0.5 * mom2 * pow( bval / Lbar, 3 );
     double answer = factor * exp( -bval * x ) *
                     ( 1 - 2 * bval * x + 0.5 * bval * bval * x * x );
     return answer;
 }
 
 double EvtVubBLNPHybrid::myfunctionBIK( double w, double Lbar, double /* mom2 */ )
 {
     double aval = 10.0;
     double normBIK = ( 4 - M_PI ) * M_PI * M_PI / 8 / ( 2 - M_PI ) / aval + 1;
     double z = 3 * M_PI * w / 8 / Lbar;
     double q = M_PI * M_PI * 2 * pow( M_PI * aval, 0.5 ) * exp( -aval * z * z ) /
                    ( 4 * M_PI - 8 ) * ( 1 - 2 * pow( aval / M_PI, 0.5 ) * z ) +
                8 / pow( 1 + z * z, 4 ) *
                    ( z * log( z ) + 0.5 * z * ( 1 + z * z ) -
                      M_PI / 4 * ( 1 - z * z ) );
     double answer = q / normBIK;
     return answer;
 }
 
 double EvtVubBLNPHybrid::dU1nlo( double muh, double mui )
 {
     double ai = alphas( mui, m_gvars );
     double ah = alphas( muh, m_gvars );
 
     double q1 = ( ah - ai ) / ( 4 * M_PI * m_beta0 );
     double q2 = log( m_mb / muh ) * m_Gamma1 + m_gp1;
     double q3 = 4 * m_beta1 * ( log( m_mb / muh ) * m_Gamma0 + m_gp0 ) +
                 m_Gamma2 * ( 1 - ai / ah );
     double q4 = m_beta1 * m_beta1 * m_Gamma0 * ( -1.0 + ai / ah ) /
                 ( 4 * pow( m_beta0, 3 ) );
     double q5 = -m_beta2 * m_Gamma0 * ( 1.0 + ai / ah ) +
                 m_beta1 * m_Gamma1 * ( 3 - ai / ah );
     double q6 = m_beta1 * m_beta1 * m_Gamma0 * ( ah - ai ) / m_beta0 -
                 m_beta2 * m_Gamma0 * ah + m_beta1 * m_Gamma1 * ai;
 
     double answer =
         q1 * ( q2 - q3 / 4 / m_beta0 + q4 + q5 / ( 4 * m_beta0 * m_beta0 ) ) +
         1 / ( 8 * M_PI * m_beta0 * m_beta0 * m_beta0 ) * log( ai / ah ) * q6;
     return answer;
 }
 
 double EvtVubBLNPHybrid::U1lo( double muh, double mui )
 {
     double epsilon = 0.0;
     double answer = pow( m_mb / muh, -2 * aGamma( muh, mui, epsilon ) ) *
                     exp( 2 * Sfun( muh, mui, epsilon ) -
                          2 * agp( muh, mui, epsilon ) );
     return answer;
 }
 
 double EvtVubBLNPHybrid::Sfun( double mu1, double mu2, double epsilon )
 {
     double a1 = alphas( mu1, m_gvars ) / 4 / M_PI;
     double a2 = alphas( mu2, m_gvars ) / alphas( mu1, m_gvars );
 
     double answer = S0( a1, a2 ) + S1( a1, a2 ) + epsilon * S2( a1, a2 );
     return answer;
 }
 
 double EvtVubBLNPHybrid::S0( double a1, double r )
 {
     double answer = -m_Gamma0 / ( 4.0 * m_beta0 * m_beta0 * a1 ) *
                     ( -1.0 + 1.0 / r + log( r ) );
     return answer;
 }
 
 double EvtVubBLNPHybrid::S1( double /* a1 */, double r )
 {
     double answer = m_Gamma0 / ( 4 * m_beta0 * m_beta0 ) *
                     ( 0.5 * log( r ) * log( r ) * m_beta1 / m_beta0 +
                       ( m_Gamma1 / m_Gamma0 - m_beta1 / m_beta0 ) *
                           ( 1 - r + log( r ) ) );
     return answer;
 }
 
 double EvtVubBLNPHybrid::S2( double a1, double r )
 {
     double w1 = pow( m_beta1, 2 ) / pow( m_beta0, 2 ) - m_beta2 / m_beta0 -
                 m_beta1 * m_Gamma1 / ( m_beta0 * m_Gamma0 ) + m_Gamma2 / m_Gamma0;
     double w2 = pow( m_beta1, 2 ) / pow( m_beta0, 2 ) - m_beta2 / m_beta0;
     double w3 = m_beta1 * m_Gamma1 / ( m_beta0 * m_Gamma0 ) - m_beta2 / m_beta0;
     double w4 = a1 * m_Gamma0 / ( 4 * m_beta0 * m_beta0 );
 
     double answer = w4 *
                     ( -0.5 * pow( 1 - r, 2 ) * w1 + w2 * ( 1 - r ) * log( r ) +
                       w3 * ( 1 - r + r * log( r ) ) );
     return answer;
 }
 
 double EvtVubBLNPHybrid::aGamma( double mu1, double mu2, double epsilon )
 {
     double a1 = alphas( mu1, m_gvars );
     double a2 = alphas( mu2, m_gvars );
     double answer = m_Gamma0 / ( 2 * m_beta0 ) * log( a2 / a1 ) +
                     epsilon * ( a2 - a1 ) / ( 8.0 * M_PI ) *
                         ( m_Gamma1 / m_beta0 -
                           m_beta1 * m_Gamma0 / ( m_beta0 * m_beta0 ) );
     return answer;
 }
 
 double EvtVubBLNPHybrid::agp( double mu1, double mu2, double epsilon )
 {
     double a1 = alphas( mu1, m_gvars );
     double a2 = alphas( mu2, m_gvars );
     double answer = m_gp0 / ( 2 * m_beta0 ) * log( a2 / a1 ) +
                     epsilon * ( a2 - a1 ) / ( 8.0 * M_PI ) *
                         ( m_gp1 / m_beta0 -
                           m_beta1 * m_gp0 / ( m_beta0 * m_beta0 ) );
     return answer;
 }
 
 double EvtVubBLNPHybrid::alo( double muh, double mui )
 {
     return -2.0 * aGamma( muh, mui, 0 );
 }
 
 double EvtVubBLNPHybrid::anlo( double muh, double mui )
 {    // d/depsilon of aGamma
 
     double ah = alphas( muh, m_gvars );
     double ai = alphas( mui, m_gvars );
     double answer = ( ah - ai ) / ( 8.0 * M_PI ) *
                     ( m_Gamma1 / m_beta0 -
                       m_beta1 * m_Gamma0 / ( m_beta0 * m_beta0 ) );
     return answer;
 }
 
 double EvtVubBLNPHybrid::alphas( double mu, const std::vector<double>& vars )
 {
     // Note: Lambda4 and Lambda5 depend on mbMS = 4.25
     // So if you change mbMS, then you will have to recalculate them.
 
     double beta0 = vars[8];
     double beta1 = vars[9];
     double beta2 = vars[10];
 
     double Lambda4 = 0.298791;
     double lg = 2 * log( mu / Lambda4 );
     double answer = 4 * M_PI / ( beta0 * lg ) *
                     ( 1 - beta1 * log( lg ) / ( beta0 * beta0 * lg ) +
                       beta1 * beta1 / ( beta0 * beta0 * beta0 * beta0 * lg * lg ) *
                           ( ( log( lg ) - 0.5 ) * ( log( lg ) - 0.5 ) -
                             5.0 / 4.0 + beta2 * beta0 / ( beta1 * beta1 ) ) );
     return answer;
 }
 
 double EvtVubBLNPHybrid::PolyLog( double v, double z )
 {
     if ( z >= 1 )
         cout << "Error in EvtVubBLNPHybrid: 2nd argument to PolyLog is >= 1."
              << endl;
 
     double sum = 0.0;
     for ( int k = 1; k < 101; k++ ) {
         sum = sum + pow( z, k ) / pow( k, v );
     }
     return sum;
 }
 
 double EvtVubBLNPHybrid::Gamma( double z )
 {
     if ( z <= 0 )
         return 0;
 
     double v = lgamma( z );
     return exp( v );
 }
 
 double EvtVubBLNPHybrid::Gamma( double a, double x )
 {
     double LogGamma;
     /*    if (x<0.0 || a<= 0.0) raise(SIGFPE);*/
     if ( x < 0.0 )
         x = 0.0;
     if ( a <= 0.0 )
         a = 1.e-50;
     LogGamma = lgamma( a );
     if ( x < ( a + 1.0 ) )
         return gamser( a, x, LogGamma );
     else
         return 1.0 - gammcf( a, x, LogGamma );
 }
 
 /* ------------------Incomplete gamma function-----------------*/
 /* ------------------via its series representation-------------*/
 
 double EvtVubBLNPHybrid::gamser( double a, double x, double LogGamma )
 {
     double n;
     double ap, del, sum;
 
     ap = a;
     del = sum = 1.0 / a;
     for ( n = 1; n < ITMAX; n++ ) {
         ++ap;
         del *= x / ap;
         sum += del;
         if ( fabs( del ) < fabs( sum ) * EPS )
             return sum * exp( -x + a * log( x ) - LogGamma );
     }
     raise( SIGFPE );
 
     return 0.0;
 }
 
 /* ------------------Incomplete gamma function complement------*/
 /* ------------------via its continued fraction representation-*/
 
 double EvtVubBLNPHybrid::gammcf( double a, double x, double LogGamma )
 {
     double an, b, c, d, del, h;
     int i;
 
     b = x + 1.0 - a;
     c = 1.0 / FPMIN;
     d = 1.0 / b;
     h = d;
     for ( i = 1; i < ITMAX; i++ ) {
         an = -i * ( i - a );
         b += 2.0;
         d = an * d + b;
         if ( fabs( d ) < FPMIN )
             d = FPMIN;
         c = b + an / c;
         if ( fabs( c ) < FPMIN )
             c = FPMIN;
         d = 1.0 / d;
         del = d * c;
         h *= del;
         if ( fabs( del - 1.0 ) < EPS )
             return exp( -x + a * log( x ) - LogGamma ) * h;
     }
     raise( SIGFPE );
 
     return 0.0;
 }
 
 double EvtVubBLNPHybrid::findBLNPWhat()
 {
     double ranNum = EvtRandom::Flat();
     double oOverBins = 1.0 / ( float( m_pf.size() ) );
     int nBinsBelow = 0;    // largest k such that I[k] is known to be <= rand
     int nBinsAbove = m_pf.size();    // largest k such that I[k] is known to be >  rand
     int middle;
 
     while ( nBinsAbove > nBinsBelow + 1 ) {
         middle = ( nBinsAbove + nBinsBelow + 1 ) >> 1;
         if ( ranNum >= m_pf[middle] ) {
             nBinsBelow = middle;
         } else {
             nBinsAbove = middle;
         }
     }
 
     double bSize = m_pf[nBinsAbove] - m_pf[nBinsBelow];
     // binMeasure is always aProbFunc[nBinsBelow],
 
     if ( bSize == 0 ) {
         // rand lies right in a bin of measure 0.  Simply return the center
         // of the range of that bin.  (Any value between k/N and (k+1)/N is
         // equally good, in this rare case.)
         return ( nBinsBelow + .5 ) * oOverBins;
     }
 
     double bFract = ( ranNum - m_pf[nBinsBelow] ) / bSize;
 
     return ( nBinsBelow + bFract ) * oOverBins;
 }
 
 double EvtVubBLNPHybrid::getWeight( double mX, double q2, double El )
 {
     int ibin_mX = -1;
     int ibin_q2 = -1;
     int ibin_El = -1;
 
     for ( unsigned i = 0; i < m_bins_mX.size(); i++ ) {
         if ( mX >= m_bins_mX[i] )
             ibin_mX = i;
     }
     for ( unsigned i = 0; i < m_bins_q2.size(); i++ ) {
         if ( q2 >= m_bins_q2[i] )
             ibin_q2 = i;
     }
     for ( unsigned i = 0; i < m_bins_El.size(); i++ ) {
         if ( El >= m_bins_El[i] )
             ibin_El = i;
     }
     int ibin = ibin_mX + ibin_q2 * m_bins_mX.size() +
                ibin_El * m_bins_mX.size() * m_bins_q2.size();
 
     if ( ( ibin_mX < 0 ) || ( ibin_q2 < 0 ) || ( ibin_El < 0 ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubHybrid" )
             << "Cannot determine hybrid weight "
             << "for this event "
             << "-> assign weight = 0" << endl;
         return 0.0;
     }
 
     return m_weights[ibin];
 }
 
 void EvtVubBLNPHybrid::readWeights( int startArg )
 {
     m_weights.resize( m_nbins );
 
     double maxw = 0.0;
     for ( auto& w : m_weights ) {
         w = getArg( startArg++ );
         if ( w > maxw )
             maxw = w;
     }
 
     if ( maxw == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubBLNPHybrid" )
             << "EvtVub generator expected at least one "
             << " weight > 0, but found none! "
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     // rescale weights (to be in range 0..1)
     for ( auto& w : m_weights )
         w /= maxw;
 }
diff --git a/src/EvtGenModels/EvtVubHybrid.cpp b/src/EvtGenModels/EvtVubHybrid.cpp
index 8935046..3118097 100644
--- a/src/EvtGenModels/EvtVubHybrid.cpp
+++ b/src/EvtGenModels/EvtVubHybrid.cpp
@@ -1,465 +1,465 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVubHybrid.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtPFermi.hh"
 #include "EvtGenModels/EvtVubdGamma.hh"
 
 #include <fstream>
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 using std::cout;
 using std::endl;
 using std::ifstream;
 
-std::string EvtVubHybrid::getName()
+std::string EvtVubHybrid::getName() const
 {
     return "VUBHYBRID";
 }
 
-EvtDecayBase* EvtVubHybrid::clone()
+EvtDecayBase* EvtVubHybrid::clone() const
 {
     return new EvtVubHybrid;
 }
 
 void EvtVubHybrid::init()
 {
     // check that there are at least 3 arguments
     if ( getNArg() < EvtVubHybrid::nParameters ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubHybrid" )
             << "EvtVub generator expected "
             << "at least " << EvtVubHybrid::nParameters
             << " arguments but found: " << getNArg()
             << "\nWill terminate execution!" << endl;
         ::abort();
     } else if ( getNArg() == EvtVubHybrid::nParameters ) {
         EvtGenReport( EVTGEN_WARNING, "EvtVubHybrid" )
             << "EvtVub: generate B -> Xu l nu events "
             << "without using the hybrid reweighting." << endl;
         m_noHybrid = true;
     } else if ( getNArg() < EvtVubHybrid::nParameters + EvtVubHybrid::nVariables ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubHybrid" )
             << "EvtVub could not read number of bins for "
             << "all variables used in the reweighting\n"
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     // check that there are 3 daughters
     checkNDaug( 3 );
 
     // read minimum required parameters from decay.dec
     m_mb = getArg( 0 );
     m_a = getArg( 1 );
     m_alphas = getArg( 2 );
 
     // the maximum dGamma*p2 value depends on alpha_s only:
     const double dGMax0 = 3.;
     m_dGMax = 0.21344 + 8.905 * m_alphas;
     if ( m_dGMax < dGMax0 )
         m_dGMax = dGMax0;
 
     // for the Fermi Motion we need a B-Meson mass - but it's not critical
     // to get an exact value; in order to stay in the phase space for
     // B+- and B0 use the smaller mass
 
-    static double mB0 = EvtPDL::getMaxMass( EvtPDL::getId( "B0" ) );
-    static double mBP = EvtPDL::getMaxMass( EvtPDL::getId( "B+" ) );
-    static double mB = ( mB0 < mBP ? mB0 : mBP );
+    static const double mB0 = EvtPDL::getMaxMass( EvtPDL::getId( "B0" ) );
+    static const double mBP = EvtPDL::getMaxMass( EvtPDL::getId( "B+" ) );
+    static const double mB = ( mB0 < mBP ? mB0 : mBP );
 
     const double xlow = -m_mb;
     const double xhigh = mB - m_mb;
     const int aSize = 10000;
 
     EvtPFermi pFermi( m_a, mB, m_mb );
     // pf is the cumulative distribution normalized to 1.
     m_pf.resize( aSize );
     for ( int i = 0; i < aSize; i++ ) {
         double kplus = xlow + (double)( i + 0.5 ) / ( (double)aSize ) *
                                   ( xhigh - xlow );
         if ( i == 0 )
             m_pf[i] = pFermi.getFPFermi( kplus );
         else
             m_pf[i] = m_pf[i - 1] + pFermi.getFPFermi( kplus );
     }
     for ( size_t index = 0; index < m_pf.size(); index++ ) {
         m_pf[index] /= m_pf[m_pf.size() - 1];
     }
 
     m_dGamma = std::make_unique<EvtVubdGamma>( m_alphas );
 
     if ( m_noHybrid )
         return;    // Without hybrid weighting, nothing else to do
 
     m_bins_mX.resize( abs( (int)getArg( 3 ) ) );
     m_bins_q2.resize( abs( (int)getArg( 4 ) ) );
     m_bins_El.resize( abs( (int)getArg( 5 ) ) );
 
     int nextArg = EvtVubHybrid::nParameters + EvtVubHybrid::nVariables;
 
     m_nbins = m_bins_mX.size() * m_bins_q2.size() *
               m_bins_El.size();    // Binning of weight table
 
     int expectArgs = nextArg + m_bins_mX.size() + m_bins_q2.size() +
                      m_bins_El.size() + m_nbins;
 
     if ( getNArg() < expectArgs ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubHybrid" )
             << " finds " << getNArg() << " arguments, expected " << expectArgs
             << ".  Something is wrong with the tables of weights or thresholds."
             << "\nWill terminate execution!" << endl;
         ::abort();
     }
 
     // read bin boundaries from decay.dec
     for ( auto& b : m_bins_mX )
         b = getArg( nextArg++ );
     m_masscut = m_bins_mX[0];
 
     for ( auto& b : m_bins_q2 )
         b = getArg( nextArg++ );
     for ( auto& b : m_bins_El )
         b = getArg( nextArg++ );
 
     // read in weights (and rescale to range 0..1)
     readWeights( nextArg );
 }
 
 void EvtVubHybrid::initProbMax()
 {
     noProbMax();
 }
 
 void EvtVubHybrid::decay( EvtParticle* p )
 {
     int j;
     // B+ -> u-bar specflav l+ nu
 
     EvtParticle *xuhad( nullptr ), *lepton( nullptr ), *neutrino( nullptr );
     EvtVector4R p4;
     // R. Faccini 21/02/03
     // move the reweighting up , before also shooting the fermi distribution
     double x, z, p2;
     double sh = 0.0;
     double mB, ml, xlow, xhigh, qplus;
     double El = 0.0;
     double Eh = 0.0;
     double kplus;
     double q2, mX;
 
     const double lp2epsilon = -10;
     bool rew( true );
     while ( rew ) {
         p->initializePhaseSpace( getNDaug(), getDaugs() );
 
         xuhad = p->getDaug( 0 );
         lepton = p->getDaug( 1 );
         neutrino = p->getDaug( 2 );
 
         mB = p->mass();
         ml = lepton->mass();
 
         xlow = -m_mb;
         xhigh = mB - m_mb;
 
         // Fermi motion does not need to be computed inside the
         // tryit loop as m_b in Gamma0 does not need to be replaced by (m_b+kplus).
         // The difference however should be of the Order (lambda/m_b)^2 which is
         // beyond the considered orders in the paper anyway ...
 
         // for alpha_S = 0 and a mass cut on X_u not all values of kplus are
         // possible. The maximum value is mB/2-m_mb + sqrt(mB^2/4-m_masscut^2)
         kplus = 2 * xhigh;
 
         while ( kplus >= xhigh || kplus <= xlow ||
                 ( m_alphas == 0 &&
                   kplus >= mB / 2 - m_mb +
                                sqrt( mB * mB / 4 - m_masscut * m_masscut ) ) ) {
             kplus = findPFermi();    //_pFermi->shoot();
             kplus = xlow + kplus * ( xhigh - xlow );
         }
         qplus = mB - m_mb - kplus;
         if ( ( mB - qplus ) / 2. <= ml )
             continue;
 
         int tryit = 1;
         while ( tryit ) {
             x = EvtRandom::Flat();
             z = EvtRandom::Flat( 0, 2 );
             p2 = EvtRandom::Flat();
             p2 = pow( 10, lp2epsilon * p2 );
 
             El = x * ( mB - qplus ) / 2;
             if ( El > ml && El < mB / 2 ) {
                 Eh = z * ( mB - qplus ) / 2 + qplus;
                 if ( Eh > 0 && Eh < mB ) {
                     sh = p2 * pow( mB - qplus, 2 ) +
                          2 * qplus * ( Eh - qplus ) + qplus * qplus;
                     if ( sh > m_masscut * m_masscut &&
                          mB * mB + sh - 2 * mB * Eh > ml * ml ) {
                         double xran = EvtRandom::Flat();
 
                         double y = m_dGamma->getdGdxdzdp( x, z, p2 ) / m_dGMax *
                                    p2;
 
                         if ( y > 1 )
                             EvtGenReport( EVTGEN_WARNING, "EvtVubHybrid" )
                                 << "EvtVubHybrid decay probability > 1 found: "
                                 << y << endl;
                         if ( y >= xran )
                             tryit = 0;
                     }
                 }
             }
         }
 
         // compute all kinematic variables needed for reweighting (J. Dingfelder)
         mX = sqrt( sh );
         q2 = mB * mB + sh - 2 * mB * Eh;
 
         // Reweighting in bins of mX, q2, El (J. Dingfelder)
         if ( !m_weights.empty() ) {
             double xran1 = EvtRandom::Flat();
             double w = 1.0;
             if ( !m_noHybrid )
                 w = getWeight( mX, q2, El );
             if ( w >= xran1 )
                 rew = false;
         } else {
             rew = false;
         }
     }
 
     // o.k. we have the three kineamtic variables
     // now calculate a flat cos Theta_H [-1,1] distribution of the
     // hadron flight direction w.r.t the B flight direction
     // because the B is a scalar and should decay isotropic.
     // Then chose a flat Phi_H [0,2Pi] w.r.t the B flight direction
     // and and a flat Phi_L [0,2Pi] in the W restframe w.r.t the
     // W flight direction.
 
     double ctH = EvtRandom::Flat( -1, 1 );
     double phH = EvtRandom::Flat( 0, 2 * M_PI );
     double phL = EvtRandom::Flat( 0, 2 * M_PI );
 
     // now compute the four vectors in the B Meson restframe
 
     double ptmp, sttmp;
     // calculate the hadron 4 vector in the B Meson restframe
 
     sttmp = sqrt( 1 - ctH * ctH );
     ptmp = sqrt( Eh * Eh - sh );
     double pHB[4] = { Eh, ptmp * sttmp * cos( phH ), ptmp * sttmp * sin( phH ),
                       ptmp * ctH };
     p4.set( pHB[0], pHB[1], pHB[2], pHB[3] );
     xuhad->init( getDaug( 0 ), p4 );
 
     if ( m_storeQplus ) {
         // cludge to store the hidden parameter q+ with the decay;
         // the lifetime of the Xu is abused for this purpose.
         // tau = 1 ps corresponds to ctau = 0.3 mm -> in order to
         // stay well below BaBars sensitivity we take q+/(10000 GeV) which
         // goes up to 0.0005 in the most extreme cases as ctau in mm.
         // To extract q+ back from the StdHepTrk its necessary to get
         // delta_ctau = Xu->anyDaughter->getVertexTime()-Xu->getVertexTime()
         // where these pseudo calls refere to the StdHep time stored at
         // the production vertex in the lab for each particle. The boost
         // has to be reversed and the result is:
         //
         // q+ = delta_ctau * 10000 GeV/mm * Mass_Xu/Energy_Xu
         //
         xuhad->setLifetime( qplus / 10000. );
     }
 
     // calculate the W 4 vector in the B Meson restrframe
 
     double apWB = ptmp;
     double pWB[4] = { mB - Eh, -pHB[1], -pHB[2], -pHB[3] };
 
     // first go in the W restframe and calculate the lepton and
     // the neutrino in the W frame
 
     double mW2 = mB * mB + sh - 2 * mB * Eh;
     double beta = ptmp / pWB[0];
     double gamma = pWB[0] / sqrt( mW2 );
 
     double pLW[4];
 
     ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
     pLW[0] = sqrt( ml * ml + ptmp * ptmp );
 
     double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
     if ( ctL < -1 )
         ctL = -1;
     if ( ctL > 1 )
         ctL = 1;
     sttmp = sqrt( 1 - ctL * ctL );
 
     // eX' = eZ x eW
     double xW[3] = { -pWB[2], pWB[1], 0 };
     // eZ' = eW
     double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
 
     double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
     for ( j = 0; j < 2; j++ )
         xW[j] /= lx;
 
     // eY' = eZ' x eX'
     double yW[3] = { -pWB[1] * pWB[3], -pWB[2] * pWB[3],
                      pWB[1] * pWB[1] + pWB[2] * pWB[2] };
     double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
     for ( j = 0; j < 3; j++ )
         yW[j] /= ly;
 
     // p_lep = |p_lep| * (  sin(Theta) * cos(Phi) * eX'
     //                    + sin(Theta) * sin(Phi) * eY'
     //                    + cos(Theta) *            eZ')
     for ( j = 0; j < 3; j++ )
         pLW[j + 1] = sttmp * cos( phL ) * ptmp * xW[j] +
                      sttmp * sin( phL ) * ptmp * yW[j] + ctL * ptmp * zW[j];
 
     double apLW = ptmp;
     // calculate the neutrino 4 vector in the W restframe
     //double pNW[4] = {sqrt(mW2)-pLW[0],-pLW[1],-pLW[2],-pLW[3]};
 
     // boost them back in the B Meson restframe
 
     double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
 
     ptmp = sqrt( El * El - ml * ml );
     double ctLL = appLB / ptmp;
 
     if ( ctLL > 1 )
         ctLL = 1;
     if ( ctLL < -1 )
         ctLL = -1;
 
     double pLB[4] = { El, 0, 0, 0 };
     double pNB[4] = { pWB[0] - El, 0, 0, 0 };
 
     for ( j = 1; j < 4; j++ ) {
         pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
         pNB[j] = pWB[j] - pLB[j];
     }
 
     p4.set( pLB[0], pLB[1], pLB[2], pLB[3] );
     lepton->init( getDaug( 1 ), p4 );
 
     p4.set( pNB[0], pNB[1], pNB[2], pNB[3] );
     neutrino->init( getDaug( 2 ), p4 );
 
     return;
 }
 
 double EvtVubHybrid::findPFermi()
 {
     double ranNum = EvtRandom::Flat();
     double oOverBins = 1.0 / ( float( m_pf.size() ) );
     int nBinsBelow = 0;    // largest k such that I[k] is known to be <= rand
     int nBinsAbove = m_pf.size();    // largest k such that I[k] is known to be >  rand
     int middle;
 
     while ( nBinsAbove > nBinsBelow + 1 ) {
         middle = ( nBinsAbove + nBinsBelow + 1 ) >> 1;
         if ( ranNum >= m_pf[middle] ) {
             nBinsBelow = middle;
         } else {
             nBinsAbove = middle;
         }
     }
 
     double bSize = m_pf[nBinsAbove] - m_pf[nBinsBelow];
     // binMeasure is always aProbFunc[nBinsBelow],
 
     if ( bSize == 0 ) {
         // rand lies right in a bin of measure 0.  Simply return the center
         // of the range of that bin.  (Any value between k/N and (k+1)/N is
         // equally good, in this rare case.)
         return ( nBinsBelow + .5 ) * oOverBins;
     }
 
     double bFract = ( ranNum - m_pf[nBinsBelow] ) / bSize;
     return ( nBinsBelow + bFract ) * oOverBins;
 }
 
 double EvtVubHybrid::getWeight( double mX, double q2, double El )
 {
     int ibin_mX = -1;
     int ibin_q2 = -1;
     int ibin_El = -1;
 
     for ( unsigned i = 0; i < m_bins_mX.size(); i++ ) {
         if ( mX >= m_bins_mX[i] )
             ibin_mX = i;
     }
     for ( unsigned i = 0; i < m_bins_q2.size(); i++ ) {
         if ( q2 >= m_bins_q2[i] )
             ibin_q2 = i;
     }
     for ( unsigned i = 0; i < m_bins_El.size(); i++ ) {
         if ( El >= m_bins_El[i] )
             ibin_El = i;
     }
     int ibin = ibin_mX + ibin_q2 * m_bins_mX.size() +
                ibin_El * m_bins_mX.size() * m_bins_q2.size();
 
     if ( ( ibin_mX < 0 ) || ( ibin_q2 < 0 ) || ( ibin_El < 0 ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubHybrid" )
             << "Cannot determine hybrid weight "
             << "for this event "
             << "-> assign weight = 0" << endl;
         return 0.0;
     }
 
     return m_weights[ibin];
 }
 
 void EvtVubHybrid::readWeights( int startArg )
 {
     m_weights.resize( m_nbins );
 
     double maxw = 0.0;
     for ( auto& w : m_weights ) {
         w = getArg( startArg++ );
         if ( w > maxw )
             maxw = w;
     }
 
     if ( maxw == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtVubHybrid" )
             << "EvtVub generator expected at least one "
             << " weight > 0, but found none! "
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     // rescale weights (to be in range 0..1)
     for ( auto& w : m_weights )
         w /= maxw;
 }
diff --git a/src/EvtGenModels/EvtVubNLO.cpp b/src/EvtGenModels/EvtVubNLO.cpp
index 8ceda04..ba82eed 100644
--- a/src/EvtGenModels/EvtVubNLO.cpp
+++ b/src/EvtGenModels/EvtVubNLO.cpp
@@ -1,730 +1,730 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtVubNLO.hh"
 
 #include "EvtGenBase/EvtDiLog.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtVector4R.hh"
 
 #include "EvtGenModels/EvtBtoXsgammaFermiUtil.hh"
 #include "EvtGenModels/EvtItgPtrFunction.hh"
 #include "EvtGenModels/EvtItgSimpsonIntegrator.hh"
 #include "EvtGenModels/EvtPFermi.hh"
 
 #include <array>
 #include <stdlib.h>
 #include <string>
 
 using std::cout;
 using std::endl;
 
 EvtVubNLO::~EvtVubNLO()
 {
     cout << " max pdf : " << m_gmax << endl;
     cout << " efficiency : " << (float)m_ngood / (float)m_ntot << endl;
 }
 
-std::string EvtVubNLO::getName()
+std::string EvtVubNLO::getName() const
 {
     return "VUB_NLO";
 }
 
-EvtDecayBase* EvtVubNLO::clone()
+EvtDecayBase* EvtVubNLO::clone() const
 {
     return new EvtVubNLO;
 }
 
 void EvtVubNLO::init()
 {
     // max pdf
     m_gmax = 0;
     m_ntot = 0;
     m_ngood = 0;
     m_lbar = -1000;
     m_mupi2 = -1000;
 
     // check number of arguments
     int npar = 8;
     if ( getNArg() < npar ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVubNLO generator expected "
             << " at least npar arguments  but found: " << getNArg() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     // this is the shape function parameter
     m_mb = getArg( 0 );
     m_b = getArg( 1 );
     m_lambdaSF = getArg( 2 );    // shape function lambda is different from lambda
     m_mui = 1.5;                 // GeV (scale)
     m_kpar = getArg( 3 );        // 0
     m_idSF = abs( (int)getArg(
         4 ) );    // type of shape function 1: exponential (from Neubert)
     int nbins = abs( (int)getArg( 5 ) );
     m_masses.resize( nbins );
     m_weights.resize( nbins );
 
     // Shape function normalization
     m_mB = 5.28;    // temporary B meson mass for normalization
 
     std::vector<double> sCoeffs( 11 );
     sCoeffs[3] = m_b;
     sCoeffs[4] = m_mb;
     sCoeffs[5] = m_mB;
     sCoeffs[6] = m_idSF;
     sCoeffs[7] = lambda_SF();
     sCoeffs[8] = mu_h();
     sCoeffs[9] = mu_i();
     sCoeffs[10] = 1.;
     m_SFNorm = SFNorm( sCoeffs );    // SF normalization;
 
     cout << " pdf 0.66, 1.32 , 4.32 " << tripleDiff( 0.66, 1.32, 4.32 ) << endl;
     cout << " pdf 0.23,0.37,3.76 " << tripleDiff( 0.23, 0.37, 3.76 ) << endl;
     cout << " pdf 0.97,4.32,4.42 " << tripleDiff( 0.97, 4.32, 4.42 ) << endl;
     cout << " pdf 0.52,1.02,2.01 " << tripleDiff( 0.52, 1.02, 2.01 ) << endl;
     cout << " pdf 1.35,1.39,2.73 " << tripleDiff( 1.35, 1.39, 2.73 ) << endl;
 
     if ( getNArg() - npar + 2 != int( 2 * m_weights.size() ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVubNLO generator expected " << m_weights.size()
             << " masses and weights but found: " << ( getNArg() - npar ) / 2
             << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
     int j = npar - 2;
     double maxw = 0.;
     for ( unsigned i = 0; i < m_masses.size(); i++ ) {
         m_masses[i] = getArg( j++ );
         if ( i > 0 && m_masses[i] <= m_masses[i - 1] ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "EvtVubNLO generator expected "
                 << " mass bins in ascending order!"
                 << "Will terminate execution!" << endl;
             ::abort();
         }
         m_weights[i] = getArg( j++ );
         if ( m_weights[i] < 0 ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "EvtVubNLO generator expected "
                 << " weights >= 0, but found: " << m_weights[i] << endl;
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "Will terminate execution!" << endl;
             ::abort();
         }
         if ( m_weights[i] > maxw )
             maxw = m_weights[i];
     }
     if ( maxw == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVubNLO generator expected at least one "
             << " weight > 0, but found none! "
             << "Will terminate execution!" << endl;
         ::abort();
     }
     for ( auto& w : m_weights )
         w /= maxw;
 
     // the maximum dGamma*p2 value depends on alpha_s only:
 
     //  m_dGMax = 0.05;
     m_dGMax = 150.;
 
     // for the Fermi Motion we need a B-Meso\n mass - but it's not critical
     // to get an exact value; in order to stay in the phase space for
     // B+- and B0 use the smaller mass
 
     // check that there are 3 daughters
     checkNDaug( 3 );
 }
 
 void EvtVubNLO::initProbMax()
 {
     noProbMax();
 }
 
 void EvtVubNLO::decay( EvtParticle* p )
 {
     // B+ -> u-bar specflav l+ nu
 
     EvtParticle *xuhad, *lepton, *neutrino;
     EvtVector4R p4;
 
     double pp, pm, pl, ml, El( 0.0 ), Eh( 0.0 ), sh( 0.0 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     xuhad = p->getDaug( 0 );
     lepton = p->getDaug( 1 );
     neutrino = p->getDaug( 2 );
 
     m_mB = p->mass();
     ml = lepton->mass();
 
     bool tryit = true;
 
     while ( tryit ) {
         // pm=(E_H+P_H)
         pm = EvtRandom::Flat( 0., 1 );
         pm = pow( pm, 1. / 3. ) * m_mB;
         // pl=mB-2*El
         pl = EvtRandom::Flat( 0., 1 );
         pl = sqrt( pl ) * pm;
         // pp=(E_H-P_H)
         pp = EvtRandom::Flat( 0., pl );
 
         m_ntot++;
 
         El = ( m_mB - pl ) / 2.;
         Eh = ( pp + pm ) / 2;
         sh = pp * pm;
 
         double pdf( 0. );
         if ( pp < pl && El > ml && sh > m_masses[0] * m_masses[0] &&
              m_mB * m_mB + sh - 2 * m_mB * Eh > ml * ml ) {
             double xran = EvtRandom::Flat( 0, m_dGMax );
             pdf = tripleDiff( pp, pl, pm );    // triple differential distribution
             //      cout <<" P+,P-,Pl,Pdf= "<<pp <<" "<<pm<<" "<<pl<<" "<<pdf<<endl;
             if ( pdf > m_dGMax ) {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "EvtVubNLO pdf above maximum: " << pdf
                     << " P+,P-,Pl,Pdf= " << pp << " " << pm << " " << pl << " "
                     << pdf << endl;
                 //::abort();
             }
             if ( pdf >= xran )
                 tryit = false;
 
             if ( pdf > m_gmax )
                 m_gmax = pdf;
         } else {
             //      cout <<" EvtVubNLO incorrect kinematics  sh= "<<sh<<"EH "<<Eh<<endl;
         }
 
         // reweight the Mx distribution
         if ( !tryit && !m_weights.empty() ) {
             m_ngood++;
             double xran1 = EvtRandom::Flat();
             double m = sqrt( sh );
             unsigned j = 0;
             while ( j < m_masses.size() && m > m_masses[j] )
                 j++;
             double w = m_weights[j - 1];
             if ( w < xran1 )
                 tryit = true;    // through away this candidate
         }
     }
 
     //  cout <<" max prob "<<gmax<<" " << pp<<" "<<y<<" "<<x<<endl;
 
     // o.k. we have the three kineamtic variables
     // now calculate a flat cos Theta_H [-1,1] distribution of the
     // hadron flight direction w.r.t the B flight direction
     // because the B is a scalar and should decay isotropic.
     // Then chose a flat Phi_H [0,2Pi] w.r.t the B flight direction
     // and and a flat Phi_L [0,2Pi] in the W restframe w.r.t the
     // W flight direction.
 
     double ctH = EvtRandom::Flat( -1, 1 );
     double phH = EvtRandom::Flat( 0, 2 * M_PI );
     double phL = EvtRandom::Flat( 0, 2 * M_PI );
 
     // now compute the four vectors in the B Meson restframe
 
     double ptmp, sttmp;
     // calculate the hadron 4 vector in the B Meson restframe
 
     sttmp = sqrt( 1 - ctH * ctH );
     ptmp = sqrt( Eh * Eh - sh );
     double pHB[4] = { Eh, ptmp * sttmp * cos( phH ), ptmp * sttmp * sin( phH ),
                       ptmp * ctH };
     p4.set( pHB[0], pHB[1], pHB[2], pHB[3] );
     xuhad->init( getDaug( 0 ), p4 );
 
     // calculate the W 4 vector in the B Meson restrframe
 
     double apWB = ptmp;
     double pWB[4] = { m_mB - Eh, -pHB[1], -pHB[2], -pHB[3] };
 
     // first go in the W restframe and calculate the lepton and
     // the neutrino in the W frame
 
     double mW2 = m_mB * m_mB + sh - 2 * m_mB * Eh;
     //  if(mW2<0.1){
     //  cout <<" low Q2! "<<pp<<" "<<epp<<" "<<x<<" "<<y<<endl;
     //}
     double beta = ptmp / pWB[0];
     double gamma = pWB[0] / sqrt( mW2 );
 
     double pLW[4];
 
     ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
     pLW[0] = sqrt( ml * ml + ptmp * ptmp );
 
     double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
     if ( ctL < -1 )
         ctL = -1;
     if ( ctL > 1 )
         ctL = 1;
     sttmp = sqrt( 1 - ctL * ctL );
 
     // eX' = eZ x eW
     double xW[3] = { -pWB[2], pWB[1], 0 };
     // eZ' = eW
     double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
 
     double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
     for ( int j = 0; j < 2; j++ )
         xW[j] /= lx;
 
     // eY' = eZ' x eX'
     double yW[3] = { -pWB[1] * pWB[3], -pWB[2] * pWB[3],
                      pWB[1] * pWB[1] + pWB[2] * pWB[2] };
     double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
     for ( int j = 0; j < 3; j++ )
         yW[j] /= ly;
 
     // p_lep = |p_lep| * (  sin(Theta) * cos(Phi) * eX'
     //                    + sin(Theta) * sin(Phi) * eY'
     //                    + cos(Theta) *            eZ')
     for ( int j = 0; j < 3; j++ )
         pLW[j + 1] = sttmp * cos( phL ) * ptmp * xW[j] +
                      sttmp * sin( phL ) * ptmp * yW[j] + ctL * ptmp * zW[j];
 
     double apLW = ptmp;
 
     // boost them back in the B Meson restframe
 
     double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
 
     ptmp = sqrt( El * El - ml * ml );
     double ctLL = appLB / ptmp;
 
     if ( ctLL > 1 )
         ctLL = 1;
     if ( ctLL < -1 )
         ctLL = -1;
 
     double pLB[4] = { El, 0, 0, 0 };
     double pNB[8] = { pWB[0] - El, 0, 0, 0 };
 
     for ( int j = 1; j < 4; j++ ) {
         pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
         pNB[j] = pWB[j] - pLB[j];
     }
 
     p4.set( pLB[0], pLB[1], pLB[2], pLB[3] );
     lepton->init( getDaug( 1 ), p4 );
 
     p4.set( pNB[0], pNB[1], pNB[2], pNB[3] );
     neutrino->init( getDaug( 2 ), p4 );
 
     return;
 }
 
 double EvtVubNLO::tripleDiff( double pp, double pl, double pm )
 {
     std::vector<double> sCoeffs( 11 );
     sCoeffs[0] = pp;
     sCoeffs[1] = pl;
     sCoeffs[2] = pm;
     sCoeffs[3] = m_b;
     sCoeffs[4] = m_mb;
     sCoeffs[5] = m_mB;
     sCoeffs[6] = m_idSF;
     sCoeffs[7] = lambda_SF();
     sCoeffs[8] = mu_h();
     sCoeffs[9] = mu_i();
     sCoeffs[10] = m_SFNorm;    // SF normalization;
 
     double c1 = ( m_mB + pl - pp - pm ) * ( pm - pl );
     double c2 = 2 * ( pl - pp ) * ( pm - pl );
     double c3 = ( m_mB - pm ) * ( pm - pp );
     double aF1 = F10( sCoeffs );
     double aF2 = F20( sCoeffs );
     double aF3 = F30( sCoeffs );
     double td0 = c1 * aF1 + c2 * aF2 + c3 * aF3;
 
     auto func = EvtItgPtrFunction{ &integrand, 0., m_mB, sCoeffs };
     auto jetSF = EvtItgSimpsonIntegrator{ func, 0.01, 25 };
     double smallfrac =
         0.000001;    // stop a bit before the end to avoid problems with numerical integration
     double tdInt = jetSF.evaluate( 0, pp * ( 1 - smallfrac ) );
 
     double SU = U1lo( mu_h(), mu_i() ) *
                 pow( ( pm - pp ) / ( m_mB - pp ), alo( mu_h(), mu_i() ) );
     double TD = ( m_mB - pp ) * SU * ( td0 + tdInt );
 
     return TD;
 }
 
 double EvtVubNLO::integrand( double omega, const std::vector<double>& coeffs )
 {
     //double pp=coeffs[0];
     double c1 = ( coeffs[5] + coeffs[1] - coeffs[0] - coeffs[2] ) *
                 ( coeffs[2] - coeffs[1] );
     double c2 = 2 * ( coeffs[1] - coeffs[0] ) * ( coeffs[2] - coeffs[1] );
     double c3 = ( coeffs[5] - coeffs[2] ) * ( coeffs[2] - coeffs[0] );
 
     return c1 * F1Int( omega, coeffs ) + c2 * F2Int( omega, coeffs ) +
            c3 * F3Int( omega, coeffs );
 }
 
 double EvtVubNLO::F10( const std::vector<double>& coeffs )
 {
     double pp = coeffs[0];
     double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
     double mui = coeffs[9];
     double muh = coeffs[8];
     double z = 1 - y;
     double result = U1nlo( muh, mui ) / U1lo( muh, mui );
 
     result += anlo( muh, mui ) * log( y );
 
     result += C_F( muh ) *
               ( -4 * pow( log( y * coeffs[4] / muh ), 2 ) +
                 10 * log( y * coeffs[4] / muh ) - 4 * log( y ) -
                 2 * log( y ) / ( 1 - y ) - 4.0 * EvtDiLog::DiLog( z ) -
                 pow( EvtConst::pi, 2 ) / 6. - 12 );
 
     result += C_F( mui ) *
               ( 2 * pow( log( y * coeffs[4] * pp / pow( mui, 2 ) ), 2 ) -
                 3 * log( y * coeffs[4] * pp / pow( mui, 2 ) ) + 7 -
                 pow( EvtConst::pi, 2 ) );
     result *= shapeFunction( pp, coeffs );
     // changes due to SSF
     result += ( -subS( coeffs ) + 2 * subT( coeffs ) +
                 ( subU( coeffs ) - subV( coeffs ) ) * ( 1 / y - 1. ) ) /
               ( coeffs[5] - pp );
     result += shapeFunction( pp, coeffs ) / pow( ( coeffs[5] - coeffs[0] ), 2 ) *
               ( -5 * ( lambda1() + 3 * lambda2() ) / 6 +
                 2 * ( 2 * lambda1() / 3 - lambda2() ) / pow( y, 2 ) );
     //  result +=  (subS(coeffs)+subT(coeffs)+(subU(coeffs)-subV(coeffs))/y)/(coeffs[5]-pp);
     // this part has been added after Feb '05
 
     //result += shapeFunction(pp,coeffs)/pow((coeffs[5]-coeffs[0]),2)*((lambda1()+3*lambda2())/6+2*(2*lambda1()/3-lambda2())/pow(y,2));
     return result;
 }
 
 double EvtVubNLO::F1Int( double omega, const std::vector<double>& coeffs )
 {
     double pp = coeffs[0];
     double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
     // mubar == mui
     return C_F( coeffs[9] ) *
            ( ( shapeFunction( omega, coeffs ) - shapeFunction( pp, coeffs ) ) *
                  ( 4 * log( y * coeffs[4] * ( pp - omega ) / pow( coeffs[9], 2 ) ) -
                    3 ) /
                  ( pp - omega ) +
              ( g1( y, ( pp - omega ) / ( coeffs[5] - coeffs[0] ) ) /
                ( coeffs[5] - pp ) * shapeFunction( omega, coeffs ) ) );
 }
 
 double EvtVubNLO::F20( const std::vector<double>& coeffs )
 {
     double pp = coeffs[0];
     double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
     double result = C_F( coeffs[8] ) * log( y ) / ( 1 - y ) *
                         shapeFunction( pp, coeffs ) -
                     1 / y *
                         ( subS( coeffs ) + 2 * subT( coeffs ) -
                           ( subT( coeffs ) + subV( coeffs ) ) / y ) /
                         ( coeffs[5] - pp );
     // added after Feb '05
     result += shapeFunction( pp, coeffs ) /
               pow( ( coeffs[5] - coeffs[0] ) * y, 2 ) *
               ( 2 * lambda1() / 3 + 4 * lambda2() -
                 y * ( 7 / 6 * lambda1() + 3 * lambda2() ) );
     return result;
 }
 
 double EvtVubNLO::F2Int( double omega, const std::vector<double>& coeffs )
 {
     double pp = coeffs[0];
     double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
     return C_F( coeffs[9] ) *
            g3( y, ( pp - omega ) / ( coeffs[5] - coeffs[0] ) ) *
            shapeFunction( omega, coeffs ) / ( coeffs[5] - pp );
 }
 
 double EvtVubNLO::F30( const std::vector<double>& coeffs )
 {
     double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
     return shapeFunction( coeffs[0], coeffs ) /
            pow( ( coeffs[5] - coeffs[0] ) * y, 2 ) *
            ( -2 * lambda1() / 3 + lambda2() );
 }
 
 double EvtVubNLO::F3Int( double omega, const std::vector<double>& coeffs )
 {
     double pp = coeffs[0];
     double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
     return C_F( coeffs[9] ) *
            g3( y, ( pp - omega ) / ( coeffs[5] - coeffs[0] ) ) / 2 *
            shapeFunction( omega, coeffs ) / ( coeffs[2] - coeffs[0] );
 }
 
 double EvtVubNLO::g1( double y, double x )
 {
     double result = ( y * ( -9 + 10 * y ) + x * x * ( -12 + 13 * y ) +
                       2 * x * ( -8 + 6 * y + 3 * y * y ) ) /
                     y / pow( 1 + x, 2 ) / ( x + y );
     result -= 4 * log( ( 1 + 1 / x ) * y ) / x;
     result -= 2 * log( 1 + y / x ) *
               ( 3 * pow( x, 4 ) * ( -2 + y ) - 2 * pow( y, 3 ) -
                 4 * pow( x, 3 ) * ( 2 + y ) - 2 * x * y * y * ( 4 + y ) -
                 x * x * y * ( 12 + 4 * y + y * y ) ) /
               x / pow( ( 1 + x ) * y, 2 ) / ( x + y );
     return result;
 }
 
 double EvtVubNLO::g2( double y, double x )
 {
     double result = y * ( 10 * pow( x, 4 ) + y * y + 3 * x * x * y * ( 10 + y ) +
                           pow( x, 3 ) * ( 12 + 19 * y ) +
                           x * y * ( 8 + 4 * y + y * y ) );
     result -= 2 * x * log( 1 + y / x ) *
               ( 5 * pow( x, 4 ) + 2 * y * y + 6 * pow( x, 3 ) * ( 1 + 2 * y ) +
                 4 * y * x * ( 1 + 2 * y ) + x * x * y * ( 18 + 5 * y ) );
     result *= 2 / ( pow( y * ( 1 + x ), 2 ) * y * ( x + y ) );
     return result;
 }
 
 double EvtVubNLO::g3( double y, double x )
 {
     double result = ( 2 * pow( y, 3 ) * ( -11 + 2 * y ) -
                       10 * pow( x, 4 ) * ( 6 - 6 * y + y * y ) +
                       x * y * y * ( -94 + 29 * y + 2 * y * y ) +
                       2 * x * x * y * ( -72 + 18 * y + 13 * y * y ) -
                       pow( x, 3 ) *
                           ( 72 + 42 * y - 70 * y * y + 3 * pow( y, 3 ) ) ) /
                     ( pow( y * ( 1 + x ), 2 ) * y * ( x + y ) );
     result += 2 * log( 1 + y / x ) *
               ( -6 * x * pow( y, 3 ) * ( -5 + y ) + 4 * pow( y, 4 ) +
                 5 * pow( x, 5 ) * ( 6 - 6 * y + y * y ) -
                 4 * pow( x * y, 2 ) * ( -20 + 6 * y + y * y ) +
                 pow( x, 3 ) * y * ( 90 - 10 * y - 28 * y * y + pow( y, 3 ) ) +
                 pow( x, 4 ) * ( 36 + 36 * y - 50 * y * y + 4 * pow( y, 3 ) ) ) /
               ( pow( ( 1 + x ) * y * y, 2 ) * ( x + y ) );
     return result;
 }
 
 /* old version (before Feb 05 notebook from NNeubert
 
 double
 EvtVubNLO::F1Int(double omega,const std::vector<double> &coeffs){
   double pp=coeffs[0];
   double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
   // mubar == mui
   return C_F(coeffs[9])*(
 			 (shapeFunction(omega,coeffs)-shapeFunction(pp,coeffs))*(4*log(y*coeffs[4]*(pp-omega)/pow(coeffs[9],2))-3)/(pp-omega)-
 			 (1./y/(coeffs[5]-pp)*shapeFunction(omega,coeffs)*(5-6*y+4*(3-y)*log((pp-omega)/y/coeffs[4])))
 			 );
 }
 
 
 double
 EvtVubNLO::F2Int(double omega,const std::vector<double> &coeffs){
   double pp=coeffs[0];
   double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
   return C_F(coeffs[9])*shapeFunction(omega,coeffs)*(2-11/y-4/y*log((pp-omega)/y/coeffs[4]))/(coeffs[5]-pp);
 }
 
 double
 EvtVubNLO::F3(const std::vector<double> &coeffs){
   return C_F(coeffs[9])*shapeFunction(omega,coeffs)/(coeffs[2]-coeffs[0]);
 }
 */
 
 double EvtVubNLO::SFNorm( const std::vector<double>& /*coeffs*/ )
 {
     double omega0 = 1.68;    //normalization scale (mB-2*1.8)
     if ( m_idSF == 1 ) {     // exponential SF
         return M0( mu_i(), omega0 ) * pow( m_b, m_b ) / lambda_SF() /
                ( Gamma( m_b ) - Gamma( m_b, m_b * omega0 / lambda_SF() ) );
     } else if ( m_idSF == 2 ) {    // Gaussian SF
         double c = cGaus( m_b );
         return M0( mu_i(), omega0 ) * 2 / lambda_SF() /
                pow( c, -( 1 + m_b ) / 2. ) /
                ( Gamma( ( 1 + m_b ) / 2 ) -
                  Gamma( ( 1 + m_b ) / 2, pow( omega0 / lambda_SF(), 2 ) * c ) );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "unknown SF " << m_idSF << endl;
         return -1;
     }
 }
 
 double EvtVubNLO::shapeFunction( double omega, const std::vector<double>& sCoeffs )
 {
     if ( sCoeffs[6] == 1 ) {
         return sCoeffs[10] * expShapeFunction( omega, sCoeffs );
     } else if ( sCoeffs[6] == 2 ) {
         return sCoeffs[10] * gausShapeFunction( omega, sCoeffs );
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtVubNLO : unknown shape function # " << sCoeffs[6] << endl;
     }
     return -1.;
 }
 
 // SSF
 double EvtVubNLO::subS( const std::vector<double>& c )
 {
     return ( lambda_bar( 1.68 ) - c[0] ) * shapeFunction( c[0], c );
 }
 double EvtVubNLO::subT( const std::vector<double>& c )
 {
     return -3 * lambda2() * subS( c ) / mu_pi2( 1.68 );
 }
 double EvtVubNLO::subU( const std::vector<double>& c )
 {
     return -2 * subS( c );
 }
 double EvtVubNLO::subV( const std::vector<double>& c )
 {
     return -subT( c );
 }
 
 double EvtVubNLO::lambda_bar( double omega0 )
 {
     if ( m_lbar < 0 ) {
         if ( m_idSF == 1 ) {    // exponential SF
             double rat = omega0 * m_b / lambda_SF();
             m_lbar = lambda_SF() / m_b *
                      ( Gamma( 1 + m_b ) - Gamma( 1 + m_b, rat ) ) /
                      ( Gamma( m_b ) - Gamma( m_b, rat ) );
         } else if ( m_idSF == 2 ) {    // Gaussian SF
             double c = cGaus( m_b );
             m_lbar =
                 lambda_SF() *
                 ( Gamma( 1 + m_b / 2 ) -
                   Gamma( 1 + m_b / 2, pow( omega0 / lambda_SF(), 2 ) * c ) ) /
                 ( Gamma( ( 1 + m_b ) / 2 ) -
                   Gamma( ( 1 + m_b ) / 2, pow( omega0 / lambda_SF(), 2 ) * c ) ) /
                 sqrt( c );
         }
     }
     return m_lbar;
 }
 
 double EvtVubNLO::mu_pi2( double omega0 )
 {
     if ( m_mupi2 < 0 ) {
         if ( m_idSF == 1 ) {    // exponential SF
             double rat = omega0 * m_b / lambda_SF();
             m_mupi2 = 3 * ( pow( lambda_SF() / m_b, 2 ) *
                                 ( Gamma( 2 + m_b ) - Gamma( 2 + m_b, rat ) ) /
                                 ( Gamma( m_b ) - Gamma( m_b, rat ) ) -
                             pow( lambda_bar( omega0 ), 2 ) );
         } else if ( m_idSF == 2 ) {    // Gaussian SF
             double c = cGaus( m_b );
             double m1 = Gamma( ( 3 + m_b ) / 2 ) -
                         Gamma( ( 3 + m_b ) / 2,
                                pow( omega0 / lambda_SF(), 2 ) * c );
             double m2 = Gamma( 1 + m_b / 2 ) -
                         Gamma( 1 + m_b / 2, pow( omega0 / lambda_SF(), 2 ) * c );
             double m3 = Gamma( ( 1 + m_b ) / 2 ) -
                         Gamma( ( 1 + m_b ) / 2,
                                pow( omega0 / lambda_SF(), 2 ) * c );
             m_mupi2 = 3 * pow( lambda_SF(), 2 ) *
                       ( m1 / m3 - pow( m2 / m3, 2 ) ) / c;
         }
     }
     return m_mupi2;
 }
 
 double EvtVubNLO::M0( double mui, double omega0 )
 {
     double mf = omega0 - lambda_bar( omega0 );
     return 1 + 4 * C_F( mui ) *
                    ( -pow( log( mf / mui ), 2 ) - log( mf / mui ) -
                      pow( EvtConst::pi / 2, 2 ) / 6. +
                      mu_pi2( omega0 ) / 3 / pow( mf, 2 ) *
                          ( log( mf / mui ) - 0.5 ) );
 }
 
 double EvtVubNLO::alphas( double mu )
 {
     double Lambda4 = 0.302932;
     double lg = 2 * log( mu / Lambda4 );
     return 4 * EvtConst::pi / lg / beta0() *
            ( 1 - beta1() * log( lg ) / pow( beta0(), 2 ) / lg +
              pow( beta1() / lg, 2 ) / pow( beta0(), 4 ) *
                  ( pow( log( lg ) - 0.5, 2 ) - 1.25 +
                    beta2() * beta0() / pow( beta1(), 2 ) ) );
 }
 
 double EvtVubNLO::gausShapeFunction( double omega,
                                      const std::vector<double>& sCoeffs )
 {
     double b = sCoeffs[3];
     double l = sCoeffs[7];
     double wL = omega / l;
 
     return pow( wL, b ) * exp( -cGaus( b ) * wL * wL );
 }
 
 double EvtVubNLO::expShapeFunction( double omega,
                                     const std::vector<double>& sCoeffs )
 {
     double b = sCoeffs[3];
     double l = sCoeffs[7];
     double wL = omega / l;
 
     return pow( wL, b - 1 ) * exp( -b * wL );
 }
 
 double EvtVubNLO::Gamma( double z )
 {
     std::array<double, 6> gammaCoeffs{
         76.18009172947146,  -86.50532032941677,    24.01409824083091,
         -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5 };
 
     //Lifted from Numerical Recipies in C
     double y = z;
     double x = z;
 
     double tmp = x + 5.5;
     tmp = tmp - ( x + 0.5 ) * log( tmp );
     double ser = 1.000000000190015;
 
     for ( const auto& gammaCoeff : gammaCoeffs ) {
         y += 1.0;
         ser += gammaCoeff / y;
     }
 
     return exp( -tmp + log( 2.5066282746310005 * ser / x ) );
 }
 
 double EvtVubNLO::Gamma( double z, double tmin )
 {
     std::vector<double> c( 1 );
     c[0] = z;
     auto func = EvtItgPtrFunction{ &dgamma, tmin, 100., c };
     auto jetSF = EvtItgSimpsonIntegrator{ func, 0.001 };
     return jetSF.evaluate( tmin, 100. );
 }
diff --git a/src/EvtGenModels/EvtXPsiGamma.cpp b/src/EvtGenModels/EvtXPsiGamma.cpp
index 46a9291..3fd44ce 100644
--- a/src/EvtGenModels/EvtXPsiGamma.cpp
+++ b/src/EvtGenModels/EvtXPsiGamma.cpp
@@ -1,307 +1,307 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtXPsiGamma.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtTensorParticle.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <iostream>
 #include <stdlib.h>
 #include <string>
 
 using namespace std;
 
-std::string EvtXPsiGamma::getName()
+std::string EvtXPsiGamma::getName() const
 {
     return "X38722-+_PSI_GAMMA";
 }
 
-EvtDecayBase* EvtXPsiGamma::clone()
+EvtDecayBase* EvtXPsiGamma::clone() const
 {
     return new EvtXPsiGamma;
 }
 
 void EvtXPsiGamma::init()
 {
     checkNArg( 0, 6 );
 
     if ( getNArg() == 0 ) {
         // X -> omega psi, rho0 psi couplings from table II in F. Brazzi et al, arXiv:1103.3155
         m_gOmega = 1.58;
         m_gPOmega = -0.74;
         m_gRho = -0.29;
         m_gPRho = 0.28;
 
         // Decay constants used in F. Brazzi et al, arXiv:1103.3155, taken from J. Sakurai, Currents and Mesons (1969)
         m_fOmega = 0.036;
         m_fRho = 0.121;
 
     } else {
         m_gOmega = getArg( 0 );
         m_gPOmega = getArg( 1 );
         m_gRho = getArg( 2 );
         m_gPRho = getArg( 3 );
         m_fOmega = getArg( 4 );
         m_fRho = getArg( 5 );
     }
 
     checkNDaug( 2 );
 
     checkSpinParent( EvtSpinType::TENSOR );
 
     checkSpinDaughter( 1, EvtSpinType::VECTOR );
 
     m_ID0 = getDaug( 0 );
 
     if ( m_ID0 != EvtPDL::getId( "gamma" ) &&
          m_ID0 != EvtPDL::getId( "omega" ) && m_ID0 != EvtPDL::getId( "rho0" ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << " " << getName() << " - Decays with '" << getDaug( 0 ).getName()
             << "' as first daughter are not supported. Choose among: 'gamma', 'omega', or 'rho0'."
             << std::endl;
         ::abort();
     };
 }
 
 void EvtXPsiGamma::initProbMax()
 {
     double theProbMax = 1.;
 
     // Create a tensor parent at rest and initialize it
     // Use noLifeTime() cludge to avoid generating random numbers
 
     EvtTensorParticle parent{};
     parent.noLifeTime();
     parent.init( getParentId(),
                  EvtVector4R( EvtPDL::getMass( getParentId() ), 0, 0, 0 ) );
     parent.setDiagonalSpinDensity();
 
     // Create daughters and initialize amplitude
     EvtAmp amp;
     EvtId daughters[2] = { getDaug( 0 ), getDaug( 1 ) };
     amp.init( getParentId(), 2, daughters );
     parent.makeDaughters( 2, daughters );
 
     EvtParticle* child1 = parent.getDaug( 0 );
     EvtParticle* child2 = parent.getDaug( 1 );
 
     child1->noLifeTime();
     child2->noLifeTime();
 
     EvtSpinDensity rho;
     rho.setDiag( parent.getSpinStates() );
 
     // Momentum of daughters in parent's frame
     const double parentMass = EvtPDL::getMass( getParentId() );
 
     // The daughter CMS momentum pstar (and thus the phase space) is larger if the mass of the daughters is lower.
     // Thus the probability is maximal for the minimal resonance mass for rho0 and omega resonances.
     // For photons the minimal mass is always zero.
     const double d1Mass = EvtPDL::getMinMass( getDaug( 0 ) );
 
     const double d2Mass = EvtPDL::getMass( getDaug( 1 ) );
 
     const double pstar = calcPstar( parentMass, d1Mass, d2Mass );
 
     EvtVector4R p4_1, p4_2;
 
     const int nsteps = 180;
 
     double prob_max = 0;
     double theta_max = 0;
 
     for ( int i = 0; i <= nsteps; i++ ) {
         const double theta = i * EvtConst::pi / nsteps;
 
         p4_1.set( sqrt( pow( pstar, 2 ) + pow( d1Mass, 2 ) ), 0,
                   +pstar * sin( theta ), +pstar * cos( theta ) );
 
         p4_2.set( sqrt( pow( pstar, 2 ) + pow( d2Mass, 2 ) ), 0,
                   -pstar * sin( theta ), -pstar * cos( theta ) );
 
         child1->init( getDaug( 0 ), p4_1 );
         child2->init( getDaug( 1 ), p4_2 );
 
         calcAmp( parent, amp );
 
         const double i_prob = rho.normalizedProb( amp.getSpinDensity() );
 
         if ( i_prob > prob_max ) {
             prob_max = i_prob;
             theta_max = theta;
         }
     }
 
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " " << getName() << " - probability " << prob_max
         << " found for p* (child momenta in parent's frame) = " << pstar
         << ", at theta* = " << theta_max << std::endl;
 
     theProbMax *= 1.01 * prob_max;
 
     // For wide resonances we have to account for the phase space increasing with pstar
     if ( m_ID0 != EvtPDL::getId( "gamma" ) )
         theProbMax /= pstar;
 
     setProbMax( theProbMax );
 
     EvtGenReport( EVTGEN_INFO, "EvtGen" )
         << " " << getName() << " - set up maximum probability to " << theProbMax
         << std::endl;
 }
 
 void EvtXPsiGamma::decay( EvtParticle* parent )
 {
     parent->initializePhaseSpace( getNDaug(), getDaugs() );
 
     if ( m_ID0 != EvtPDL::getId( "gamma" ) ) {
         // This weight compensates for the phase space becoming small at resonance masses
         // close to kinematic boundary (only for omega and rho which have large widths)
         setWeight( calcPstar( parent->mass(), parent->getDaug( 0 )->mass(),
                               parent->getDaug( 1 )->mass() ) );
     }
 
     calcAmp( *parent, m_amp2 );
 }
 
 void EvtXPsiGamma::calcAmp( EvtParticle& parent, EvtAmp& amp )
 {
     static const double mOmega2 =
         pow( EvtPDL::getMeanMass( EvtPDL::getId( "omega" ) ), 2 );
     static const double mRho2 =
         pow( EvtPDL::getMeanMass( EvtPDL::getId( "rho0" ) ), 2 );
 
     if ( m_ID0 == EvtPDL::getId( "gamma" ) ) {
         for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
             for ( int iGamma = 0; iGamma < 2; iGamma++ ) {
                 for ( int iChi = 0; iChi < 4; iChi++ ) {
                     const EvtComplex T2 = fT2(
                         parent.getDaug( 1 )->getP4(),
                         parent.getDaug( 0 )->getP4(), parent.epsTensor( iChi ),
                         parent.getDaug( 1 )->epsParent( iPsi ).conj(),
                         parent.getDaug( 0 )->epsParentPhoton( iGamma ).conj() );
                     const EvtComplex T3 = fT3(
                         parent.getDaug( 1 )->getP4(),
                         parent.getDaug( 0 )->getP4(), parent.epsTensor( iChi ),
                         parent.getDaug( 1 )->epsParent( iPsi ).conj(),
                         parent.getDaug( 0 )->epsParentPhoton( iGamma ).conj() );
                     amp.vertex( iChi, iGamma, iPsi,
                                 ( m_fOmega / mOmega2 * m_gOmega +
                                   m_fRho / mRho2 * m_gRho ) *
                                         T2 +
                                     ( m_fOmega / mOmega2 * m_gPOmega +
                                       m_fRho / mRho2 * m_gPRho ) *
                                         T3 );
                 }
             }
         }
     } else if ( m_ID0 == EvtPDL::getId( "omega" ) ) {
         for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
             for ( int iVect = 0; iVect < 3; iVect++ ) {
                 for ( int iChi = 0; iChi < 4; iChi++ ) {
                     const EvtComplex T2 = fT2(
                         parent.getDaug( 1 )->getP4(),
                         parent.getDaug( 0 )->getP4(), parent.epsTensor( iChi ),
                         parent.getDaug( 1 )->epsParent( iPsi ).conj(),
                         parent.getDaug( 0 )->epsParent( iVect ).conj() );
                     const EvtComplex T3 = fT3(
                         parent.getDaug( 1 )->getP4(),
                         parent.getDaug( 0 )->getP4(), parent.epsTensor( iChi ),
                         parent.getDaug( 1 )->epsParent( iPsi ).conj(),
                         parent.getDaug( 0 )->epsParent( iVect ).conj() );
                     amp.vertex( iChi, iVect, iPsi,
                                 m_gOmega * T2 + m_gPOmega * T3 );
                 }
             }
         }
         // This is for the m_ID0 == EvtPDL::getId( "rho0" ) case
     } else {
         for ( int iPsi = 0; iPsi < 3; iPsi++ ) {
             for ( int iVect = 0; iVect < 3; iVect++ ) {
                 for ( int iChi = 0; iChi < 4; iChi++ ) {
                     const EvtComplex T2 = fT2(
                         parent.getDaug( 1 )->getP4(),
                         parent.getDaug( 0 )->getP4(), parent.epsTensor( iChi ),
                         parent.getDaug( 1 )->epsParent( iPsi ).conj(),
                         parent.getDaug( 0 )->epsParent( iVect ).conj() );
                     const EvtComplex T3 = fT3(
                         parent.getDaug( 1 )->getP4(),
                         parent.getDaug( 0 )->getP4(), parent.epsTensor( iChi ),
                         parent.getDaug( 1 )->epsParent( iPsi ).conj(),
                         parent.getDaug( 0 )->epsParent( iVect ).conj() );
                     amp.vertex( iChi, iVect, iPsi, m_gRho * T2 + m_gPRho * T3 );
                 }
             }
         }
     }
 }
 
 double EvtXPsiGamma::calcPstar( double parentMass, double d1Mass,
                                 double d2Mass ) const
 {
     const double pstar =
         sqrt( pow( parentMass, 2 ) - pow( ( d1Mass + d2Mass ), 2 ) ) *
         sqrt( pow( parentMass, 2 ) - pow( ( d2Mass - d1Mass ), 2 ) ) /
         ( 2 * parentMass );
 
     return pstar;
 }
 
 EvtComplex EvtXPsiGamma::fT2( EvtVector4R p, EvtVector4R q, EvtTensor4C epsPI,
                               EvtVector4C epsEps, EvtVector4C epsEta ) const
 {
     // T2 term from F. Brazzi et al, arXiv:1103.3155, eq. (10)
     const EvtTensor4C epsPQ = dual(
         EvtGenFunctions::directProd( q, p ) );    // e_{mu nu a b} p^a q^b;
 
     const EvtVector4C tmp1 = epsPI.cont1( epsEps );
     const EvtVector4C tmp2 = epsPQ.cont1( tmp1 );
     const EvtComplex T2temp =
         tmp2 * epsEta;    // eps^a pi_{a mu} e_{mu nu rho si} p_nu q_rho eta_si
 
     const EvtVector4C tmp3 = epsPI.cont1( epsEta );
     const EvtVector4C tmp4 = epsPQ.cont1( tmp3 );
     const EvtComplex T2 =
         T2temp +
         tmp4 * epsEps;    // T2 - eta^a pi_{a mu} e_{mu nu rho si} q_nu p_rho eps_si
 
     return T2;
 }
 
 EvtComplex EvtXPsiGamma::fT3( EvtVector4R p, EvtVector4R q, EvtTensor4C epsPI,
                               EvtVector4C epsEps, EvtVector4C epsEta ) const
 {
     // T3 term from F. Brazzi et al, arXiv:1103.3155, eq. (11)
     const EvtVector4R Q = p - q;
     const EvtVector4R P = p + q;
     const EvtVector4C tmp1 = epsPI.cont1( Q );    // Q_a pi_{a mu}
     const EvtTensor4C tmp3 = dual( EvtGenFunctions::directProd(
         P, epsEps ) );    // e_{mu nu rho si} P^rho eps^si
     const EvtVector4C tmp4 = tmp3.cont1( tmp1 );
     const EvtComplex T3 =
         tmp4 * epsEta;    // Q_a pi_{a mu} e_{mu nu rho si} P^rho eps_si eta_nu
     return T3;
 }
diff --git a/src/EvtGenModels/EvtY3SToY1SpipiMoxhay.cpp b/src/EvtGenModels/EvtY3SToY1SpipiMoxhay.cpp
index 55e9fe6..bc0b51b 100644
--- a/src/EvtGenModels/EvtY3SToY1SpipiMoxhay.cpp
+++ b/src/EvtGenModels/EvtY3SToY1SpipiMoxhay.cpp
@@ -1,129 +1,129 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtY3SToY1SpipiMoxhay.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtY3SToY1SpipiMoxhay::getName()
+std::string EvtY3SToY1SpipiMoxhay::getName() const
 {
     return "Y3STOY1SPIPIMOXHAY";
 }
 
-EvtDecayBase* EvtY3SToY1SpipiMoxhay::clone()
+EvtDecayBase* EvtY3SToY1SpipiMoxhay::clone() const
 {
     return new EvtY3SToY1SpipiMoxhay;
 }
 
 void EvtY3SToY1SpipiMoxhay::init()
 {
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
 
     // check that there are 2 arguments
     checkNArg( 2 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::VECTOR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
 
     if ( ( !( getDaug( 1 ) == PIP && getDaug( 2 ) == PIM ) ) &&
          ( !( getDaug( 1 ) == PI0 && getDaug( 2 ) == PI0 ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtY3SToY1SpipiMoxhay generator expected "
             << " pi+ and pi- (or pi0 and pi0) "
             << "as 2nd and 3rd daughter. " << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 void EvtY3SToY1SpipiMoxhay::initProbMax()
 {
     setProbMax( 0.2 );
 }
 
 void EvtY3SToY1SpipiMoxhay::decay( EvtParticle* p )
 {
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     EvtParticle *v, *s1, *s2;
 
     v = p->getDaug( 0 );
     s1 = p->getDaug( 1 );
     s2 = p->getDaug( 2 );
 
     // setup the parameters needed for this model
     double g_spp = 0.64;
     double lambda = -0.73;
     double m_sigma = 0.71;
     double f_pi = 0.094;
     double m_pi = s1->getP4().mass();
 
     double MV1 = p->getP4().mass();
     double MV2 = v->getP4().mass();
 
     double q = ( s1->getP4() + s2->getP4() ).mass();
 
     double EV2 = ( MV1 * MV1 - MV2 * MV2 - q * q ) / ( 2.0 * q );
 
     double ReB_over_A = getArg( 0 );
     double ImB_over_A = getArg( 1 );
 
     EvtComplex Xi;
 
     Xi = EvtComplex( 2.0 / EvtConst::pi *
                          ( 1.0 - sqrt( 1.0 - 4 * m_pi * m_pi / ( q * q ) ) *
                                      log( ( sqrt( q * q ) +
                                             sqrt( q * q - 4.0 * m_pi * m_pi ) ) /
                                           ( 2 * m_pi ) ) ),
                      sqrt( 1.0 - 4 * m_pi * m_pi / ( q * q ) ) );
 
     // The form factor
     EvtComplex F;
 
     F = ( g_spp * g_spp + lambda * ( m_sigma * m_sigma - q * q ) ) /
         ( ( ( m_sigma * m_sigma - q * q ) * ( 1.0 - lambda * Xi ) -
             ( g_spp * g_spp * Xi ) ) *
           1.0 / ( 8.0 * EvtConst::pi * f_pi * f_pi ) * q * q );
 
     EvtComplex B_over_A;
     B_over_A = EvtComplex( ReB_over_A, ImB_over_A );
 
     // The dGamma/d(M_pipi) spectrum
     EvtComplex dGdMpp;
 
     dGdMpp = abs2( ( q * q * F - B_over_A ) ) * q *
              sqrt( q * q - 4 * m_pi * m_pi ) * sqrt( EV2 * EV2 - MV2 * MV2 );
 
     setProb( real( dGdMpp ) );
     return;
 }
diff --git a/src/EvtGenModels/EvtYmSToYnSpipiCLEO.cpp b/src/EvtGenModels/EvtYmSToYnSpipiCLEO.cpp
index 59c054a..159ab14 100644
--- a/src/EvtGenModels/EvtYmSToYnSpipiCLEO.cpp
+++ b/src/EvtGenModels/EvtYmSToYnSpipiCLEO.cpp
@@ -1,249 +1,249 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtYmSToYnSpipiCLEO.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtRandom.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtYmSToYnSpipiCLEO::getName()
+std::string EvtYmSToYnSpipiCLEO::getName() const
 {
     return "YMSTOYNSPIPICLEO";
 }
 
-EvtDecayBase* EvtYmSToYnSpipiCLEO::clone()
+EvtDecayBase* EvtYmSToYnSpipiCLEO::clone() const
 {
     return new EvtYmSToYnSpipiCLEO;
 }
 
 void EvtYmSToYnSpipiCLEO::init()
 {
-    static EvtId PIP = EvtPDL::getId( "pi+" );
-    static EvtId PIM = EvtPDL::getId( "pi-" );
-    static EvtId PI0 = EvtPDL::getId( "pi0" );
+    static const EvtId PIP = EvtPDL::getId( "pi+" );
+    static const EvtId PIM = EvtPDL::getId( "pi-" );
+    static const EvtId PI0 = EvtPDL::getId( "pi0" );
 
     // check that there are 2 arguments
     checkNArg( 2 );
     checkNDaug( 3 );
 
     checkSpinParent( EvtSpinType::VECTOR );
     checkSpinDaughter( 0, EvtSpinType::VECTOR );
 
     if ( ( !( getDaug( 1 ) == PIP && getDaug( 2 ) == PIM ) ) &&
          ( !( getDaug( 1 ) == PI0 && getDaug( 2 ) == PI0 ) ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtYmSToYnSpipiCLEO generator expected "
             << " pi+ and pi- (or pi0 and pi0) "
             << "as 2nd and 3rd daughter. " << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 }
 
 void EvtYmSToYnSpipiCLEO::initProbMax()
 {
     setProbMax( 2.0 );
 }
 
 void EvtYmSToYnSpipiCLEO::decay( EvtParticle* p )
 {
     // We want to simulate the following process:
     //
     // Y(mS) -> Y(nS) X, X -> pi+ pi- (pi0 pi0)
     //
     // The CLEO analysis assumed such an intermediate process
     // were occurring, and wrote down the matrix element
     // and its components according to this assumption.
     //
     //
 
     double ReB_over_A = getArg( 0 );
     double ImB_over_A = getArg( 1 );
 
     p->makeDaughters( getNDaug(), getDaugs() );
     EvtParticle *v, *s1, *s2;
     v = p->getDaug( 0 );
     s1 = p->getDaug( 1 );
     s2 = p->getDaug( 2 );
 
     double m_pi = s1->getP4().mass();
     double M_mS = p->getP4().mass();
     double M_nS = v->getP4().mass();
 
     // //   EvtGenReport(EVTGEN_INFO,"EvtYmSToYnSpipiCLEO")  << "M_nS = " << v->getP4().mass() << endl;
 
     EvtVector4R P_nS;
     EvtVector4R P_pi1;
     EvtVector4R P_pi2;
 
     // Perform a simple accept/reject until we get a configuration of the
     // dipion system that passes
     bool acceptX = false;
 
     while ( false == acceptX ) {
         // Begin by generating a random X mass between the kinematic
         // boundaries, 2*m_pi and M(mS) - M(nS)
 
         double mX = EvtRandom::Flat( 2.0 * m_pi, M_mS - M_nS );
 
         //   EvtGenReport(EVTGEN_INFO,"EvtYmSToYnSpipiCLEO")  << "m_X = " << mX << endl;
 
         // Now create a two-body decay from the Y(mS) in its rest frame
         // of Y(mS) -> Y(nS) + X
 
         double masses[2];
         masses[0] = M_nS;
         masses[1] = mX;
 
         EvtVector4R p4[2];
 
         EvtGenKine::PhaseSpace( 2, masses, p4, M_mS );
 
         P_nS = p4[0];
         EvtVector4R P_X = p4[1];
 
         // Now create the four-vectors for the two pions in the X
         // rest frame, X -> pi pi
 
         masses[0] = s1->mass();
         masses[1] = s2->mass();
 
         EvtGenKine::PhaseSpace( 2, masses, p4, P_X.mass() );
 
         // compute cos(theta), the polar helicity angle between a pi+ and
         // the direction opposite the Y(mS) in the X rest frame. If the pions are pi0s, then
         // choose the one where cos(theta) = [0:1].
 
         EvtVector4R P_YmS_X = boostTo( p->getP4(), P_X );
         double costheta = -p4[0].dot( P_YmS_X ) /
                           ( p4[0].d3mag() * P_YmS_X.d3mag() );
         if ( EvtPDL::name( s1->getId() ) == "pi0" ) {
             if ( costheta < 0 ) {
                 costheta = -p4[1].dot( P_YmS_X ) /
                            ( p4[1].d3mag() * P_YmS_X.d3mag() );
             }
         }
         if ( EvtPDL::name( s1->getId() ) == "pi-" ) {
             costheta = -p4[1].dot( P_YmS_X ) /
                        ( p4[1].d3mag() * P_YmS_X.d3mag() );
         }
 
         // //   EvtGenReport(EVTGEN_INFO,"EvtYmSToYnSpipiCLEO")  << "cos(theta) = " << costheta << endl;
 
         // Now boost the pion four vectors into the Y(mS) rest frame
         P_pi1 = boostTo( p4[0], P_YmS_X );
         P_pi2 = boostTo( p4[1], P_YmS_X );
 
         // Use a simple accept-reject to test this dipion system
 
         // Now compute the components of the matrix-element squared
         //
         // M(x,y)^2 = Q(x,y)^2 + |B/A|^2 * E1E2(x,y)^2 + 2*Re(B/A)*Q(x,y)*E1E2(x,y)
         //
         // x=m_pipi^2 and y = cos(theta), and where
         //
         //   Q(x,y) = (x^2 + 2*m_pi^2)
         //
         //   E1E2(x,y) = (1/4) * ( (E1 + E2)^2 - (E2 - E1)^2_max * cos(theta)^2 )
         //
         // and E1 + E2 = M_mS - M_nS and (E2 - E1)_max is the maximal difference
         // in the energy of the two pions allowed for a given mX value.
         //
 
         double Q = ( mX * mX - 2.0 * m_pi * m_pi );
 
         double deltaEmax = -2.0 *
                            sqrt( P_nS.get( 0 ) * P_nS.get( 0 ) - M_nS * M_nS ) *
                            sqrt( 0.25 - pow( m_pi / mX, 2.0 ) );
 
         double sumE = ( M_mS * M_mS - M_nS * M_nS + mX * mX ) / ( 2.0 * M_mS );
 
         double E1E2 = 0.25 *
                       ( pow( sumE, 2.0 ) - pow( deltaEmax * costheta, 2.0 ) );
 
         double M2 = Q * Q +
                     ( pow( ReB_over_A, 2.0 ) + pow( ImB_over_A, 2.0 ) ) * E1E2 *
                         E1E2 +
                     2.0 * ReB_over_A * Q * E1E2;
 
         // phase space factor
         //
         // this is given as d(PS) = C * p(*)_X * p(X)_{pi+} * d(cosTheta) * d(m_X)
         //
         // where C is a normalization constant, p(*)_X is the X momentum magnitude in the
         // Y(mS) rest frame, and p(X)_{pi+} is the pi+/pi0 momentum in the X rest frame
         //
 
         double dPS = sqrt( ( M_mS * M_mS - pow( M_nS + mX, 2.0 ) ) *
                            ( M_mS * M_mS - pow( M_nS - mX, 2.0 ) ) ) *    // p(*)_X
                      sqrt( mX * mX - 4 * m_pi * m_pi );    // p(X)_{pi}
 
         // the double-differential decay rate dG/(dcostheta dmX)
         double dG = M2 * dPS;
 
         // Throw a uniform random number from 0 --> probMax and do accept/reject on this
 
         double rnd = EvtRandom::Flat( 0.0, getProbMax( 0.0 ) );
 
         if ( rnd < dG )
             acceptX = true;
     }
 
     // initialize the daughters
     v->init( getDaugs()[0], P_nS );
     s1->init( getDaugs()[1], P_pi1 );
     s2->init( getDaugs()[2], P_pi2 );
 
     //   EvtGenReport(EVTGEN_INFO,"EvtYmSToYnSpipiCLEO")  << "M_nS = " << v->getP4().mass() << endl;
     //   EvtGenReport(EVTGEN_INFO,"EvtYmSToYnSpipiCLEO")  << "m_pi = " << s1->getP4().mass() << endl;
     //   EvtGenReport(EVTGEN_INFO,"EvtYmSToYnSpipiCLEO")  << "m_pi = " << s2->getP4().mass() << endl;
     //   EvtGenReport(EVTGEN_INFO,"EvtYmSToYnSpipiCLEO")  << "M2 = "   << M2 << endl;
 
     // Pass the polarization of the parent Upsilon
     EvtVector4C ep0, ep1, ep2;
 
     ep0 = p->eps( 0 );
     ep1 = p->eps( 1 );
     ep2 = p->eps( 2 );
 
     vertex( 0, 0, ( ep0 * v->epsParent( 0 ).conj() ) );
     vertex( 0, 1, ( ep0 * v->epsParent( 1 ).conj() ) );
     vertex( 0, 2, ( ep0 * v->epsParent( 2 ).conj() ) );
 
     vertex( 1, 0, ( ep1 * v->epsParent( 0 ).conj() ) );
     vertex( 1, 1, ( ep1 * v->epsParent( 1 ).conj() ) );
     vertex( 1, 2, ( ep1 * v->epsParent( 2 ).conj() ) );
 
     vertex( 2, 0, ( ep2 * v->epsParent( 0 ).conj() ) );
     vertex( 2, 1, ( ep2 * v->epsParent( 1 ).conj() ) );
     vertex( 2, 2, ( ep2 * v->epsParent( 2 ).conj() ) );
 
     return;
 }
diff --git a/src/EvtGenModels/EvtbTosllAli.cpp b/src/EvtGenModels/EvtbTosllAli.cpp
index 3450884..b881035 100644
--- a/src/EvtGenModels/EvtbTosllAli.cpp
+++ b/src/EvtGenModels/EvtbTosllAli.cpp
@@ -1,104 +1,104 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtbTosllAli.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtbTosllAliFF.hh"
 #include "EvtGenModels/EvtbTosllAmp.hh"
 #include "EvtGenModels/EvtbTosllScalarAmp.hh"
 #include "EvtGenModels/EvtbTosllVectorAmp.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtbTosllAli::getName()
+std::string EvtbTosllAli::getName() const
 {
     return "BTOSLLALI";
 }
 
-EvtDecayBase* EvtbTosllAli::clone()
+EvtDecayBase* EvtbTosllAli::clone() const
 {
     return new EvtbTosllAli;
 }
 
 void EvtbTosllAli::decay( EvtParticle* p )
 {
     setWeight( p->initializePhaseSpace( getNDaug(), getDaugs(), false,
                                         m_poleSize, 1, 2 ) );
 
     m_calcamp->CalcAmp( p, m_amp2, m_aliffmodel.get() );
 }
 
 void EvtbTosllAli::initProbMax()
 {
     EvtId parnum, mesnum, l1num, l2num;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     l1num = getDaug( 1 );
     l2num = getDaug( 2 );
 
     //This routine sets the m_poleSize.
     double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, l1num, l2num,
                                                m_aliffmodel.get(), m_poleSize );
     mymaxprob *= 1.25;    // Increase to avoid maxprob errors
     setProbMax( mymaxprob );
 }
 
 void EvtbTosllAli::init()
 {
     checkNArg( 0 );
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton+ lepton-
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     if ( !( mesontype == EvtSpinType::VECTOR ||
             mesontype == EvtSpinType::SCALAR ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtbTosllAli generator expected "
             << " a SCALAR or VECTOR 1st daughter, found:"
             << EvtPDL::name( getDaug( 0 ) ).c_str() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
 
     m_aliffmodel = std::make_unique<EvtbTosllAliFF>();
     if ( mesontype == EvtSpinType::SCALAR ) {
         m_calcamp = std::make_unique<EvtbTosllScalarAmp>();
     }
     if ( mesontype == EvtSpinType::VECTOR ) {
         m_calcamp = std::make_unique<EvtbTosllVectorAmp>();
     }
 }
diff --git a/src/EvtGenModels/EvtbTosllBall.cpp b/src/EvtGenModels/EvtbTosllBall.cpp
index 2d51ffa..6f8460a 100644
--- a/src/EvtGenModels/EvtbTosllBall.cpp
+++ b/src/EvtGenModels/EvtbTosllBall.cpp
@@ -1,117 +1,117 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtbTosllBall.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtbTosllAmp.hh"
 #include "EvtGenModels/EvtbTosllBallFF.hh"
 #include "EvtGenModels/EvtbTosllScalarAmp.hh"
 #include "EvtGenModels/EvtbTosllVectorAmp.hh"
 
 #include <stdlib.h>
 #include <string>
 using std::endl;
 
-std::string EvtbTosllBall::getName()
+std::string EvtbTosllBall::getName() const
 {
     return "BTOSLLBALL";
 }
 
-EvtDecayBase* EvtbTosllBall::clone()
+EvtDecayBase* EvtbTosllBall::clone() const
 {
     return new EvtbTosllBall;
 }
 
 void EvtbTosllBall::decay( EvtParticle* p )
 {
     setWeight( p->initializePhaseSpace( getNDaug(), getDaugs(), false,
                                         m_poleSize, 1, 2 ) );
 
     m_calcamp->CalcAmp( p, m_amp2, m_ballffmodel.get() );
 }
 
 void EvtbTosllBall::initProbMax()
 {
     EvtId parnum, mesnum, l1num, l2num;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     l1num = getDaug( 1 );
     l2num = getDaug( 2 );
 
     //This routine sets the m_poleSize.
     double mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, l1num, l2num,
                                                m_ballffmodel.get(), m_poleSize );
 
     setProbMax( mymaxprob );
 }
 
 void EvtbTosllBall::init()
 {
     // First choose form factors from the .DEC file
     // 1 = Ali-Ball '01 LCSR
     // 2 = Ali-Ball '99 LCSR
     // 3 = Colangelo 3pt QCD
     // 4 = Melikhov Lattice/Quark dispersion
     // 5 = ???
     // 6 = Ball-Zwicky '05 LCSR (mb = 480)
     // 7 = Ball-Zwicky '05 LCSR (mb = 460 - pseudoscalar modes only)
 
     // The default is Ali '01
     int theFormFactorModel = 1;
 
     if ( getNArg() == 1 )
         theFormFactorModel = (int)getArg( 0 );
 
     checkNDaug( 3 );
 
     //We expect the parent to be a scalar
     //and the daughters to be X lepton+ lepton-
 
     checkSpinParent( EvtSpinType::SCALAR );
 
     EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     if ( !( mesontype == EvtSpinType::VECTOR ||
             mesontype == EvtSpinType::SCALAR ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtbTosllBall generator expected "
             << " a SCALAR or VECTOR 1st daughter, found:"
             << EvtPDL::name( getDaug( 0 ) ).c_str() << endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << endl;
         ::abort();
     }
 
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
 
     m_ballffmodel = std::make_unique<EvtbTosllBallFF>( theFormFactorModel );
     if ( mesontype == EvtSpinType::SCALAR ) {
         m_calcamp = std::make_unique<EvtbTosllScalarAmp>();
     } else if ( mesontype == EvtSpinType::VECTOR ) {
         m_calcamp = std::make_unique<EvtbTosllVectorAmp>();
     }
 }
diff --git a/src/EvtGenModels/EvtbTosllMS.cpp b/src/EvtGenModels/EvtbTosllMS.cpp
index bca6584..afb49ae 100644
--- a/src/EvtGenModels/EvtbTosllMS.cpp
+++ b/src/EvtGenModels/EvtbTosllMS.cpp
@@ -1,184 +1,184 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtbTosllMS.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtbTosllAmpNew.hh"
 #include "EvtGenModels/EvtbTosllMSFF.hh"
 #include "EvtGenModels/EvtbTosllScalarAmpNew.hh"
 #include "EvtGenModels/EvtbTosllVectorAmpNew.hh"
 #include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
 
 #include <stdlib.h>
 #include <string.h>
 
 EvtbTosllMS::~EvtbTosllMS()
 {
     //  if ( m_wilscoeff ) delete m_wilscoeff;
     //  if ( m_msffmodel ) delete m_msffmodel;
     //  if ( m_calcamp )   delete m_calcamp ;
     delete m_wilscoeff;
     delete m_msffmodel;
     delete m_calcamp;
 }
 
 // The module name specification
-std::string EvtbTosllMS::getName()
+std::string EvtbTosllMS::getName() const
 {
     return "BTOSLLMS";
 }
 
 // The implementation of the clone() method
-EvtDecayBase* EvtbTosllMS::clone()
+EvtDecayBase* EvtbTosllMS::clone() const
 {
     return new EvtbTosllMS;
 }
 
 // The inicialization of the decay model
 //
 // Tn the our model we have are following 4 arguments:
 //
 //           mu          - the scale parameter, GeV;
 //           Nf          - number of "effective" flavors (for b-quark Nf=5);
 //           res_swch    - resonant switching parametr:
 //                         = 0 the resonant contribution switched OFF,
 //                         = 1 the resonant contribution switched ON;
 //           ias         - switching parametr for \alpha_s(M_Z) value:
 //                         = 0 PDG 1sigma minimal alpha_s(M_Z),
 //                         = 1 PDG average value  alpha_s(M_Z),
 //                         = 2 PDG 1sigma maximal alpha_s(M_Z).
 //           Wolfenstein parameterization for CKM matrix
 //                         CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
 //
 void EvtbTosllMS::init()
 {
     // check that there are 8 arguments
     checkNArg( 8 );
     // check that there are 3 daughteres
     checkNDaug( 3 );
 
     // We expect that the parent to be a scalar (B-meson)
     // and the daughters to be K^*, l^+ and l^-
     checkSpinParent( EvtSpinType::SCALAR );
 
     // We expect that the first daughter is the K* == VECTOR
     EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     if ( !( mesontype == EvtSpinType::VECTOR ||
             mesontype == EvtSpinType::SCALAR ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtbTosllMS generator expected "
             << " a SCALAR or VECTOR 1st daughter, found:"
             << EvtPDL::name( getDaug( 0 ) ).c_str() << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     // We expect that the second and third daughters
     // are the ell+ and ell- == DIRAC
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
 
     m_msffmodel = new EvtbTosllMSFF();
     m_wilscoeff = new EvtbTosllWilsCoeffNLO();
     if ( mesontype == EvtSpinType::VECTOR ) {
         m_calcamp = new EvtbTosllVectorAmpNew();
     }
     if ( mesontype == EvtSpinType::SCALAR ) {
         m_calcamp = new EvtbTosllScalarAmpNew();
     }
 }
 
 // Set the maximum probability of the decay
 // differencial distribution d^2\Gamma/d\hat s d\cos\theta
 void EvtbTosllMS::initProbMax()
 {
     double mymaxprob = -10.0;    // maximum of the probability
 
     EvtId parnum, mesnum, l1num, l2num;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     l1num = getDaug( 1 );
     l2num = getDaug( 2 );
 
     // EvtSpinType::spintype mesontype=EvtPDL::getSpinType(getDaug(0));
 
     double mu = getArg( 0 );            // the scale parameter
     int Nf = (int)getArg( 1 );          // number of "effective" flavors
     int res_swch = (int)getArg( 2 );    // resonant switching parametr
     int ias = (int)getArg( 3 );         // switching parametr for \alpha_s(M_Z)
     double CKM_A = getArg( 4 );
     double CKM_lambda = getArg( 5 );
     double CKM_barrho = getArg( 6 );
     double CKM_bareta = getArg( 7 );
 
     mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, l1num, l2num,
                                         m_msffmodel, m_wilscoeff, mu, Nf,
                                         res_swch, ias, CKM_A, CKM_lambda,
                                         CKM_barrho, CKM_bareta );
 
     if ( mymaxprob <= 0.0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "The function void EvtbTosllMS::initProbMax()"
             << "\n Unexpected value of the probability maximum!"
             << "\n mymaxprob = " << mymaxprob << std::endl;
         ::abort();
     }
 
     setProbMax( mymaxprob );
 }
 
 void EvtbTosllMS::decay( EvtParticle* p )
 {
     double mu = getArg( 0 );            // the scale parameter
     int Nf = (int)getArg( 1 );          // number of "effective" flavors
     int res_swch = (int)getArg( 2 );    // resonant switching parametr
     int ias = (int)getArg( 3 );         // switching parametr for \alpha_s(M_Z)
     double CKM_A = getArg( 4 );
     double CKM_lambda = getArg( 5 );
     double CKM_barrho = getArg( 6 );
     double CKM_bareta = getArg( 7 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     // The class "EvtbTosllVectorAmpNew" is the derived class of the
     // class  "EvtbTosllAmpNew" (see the file "EvtbTosllVectorAmpNew.hh")
     // and
     // the class "EvtbTosllMSFF" is the derived class of the
     // class  "EvtbTosllFFNew" (see the file "EvtbTosllMSFF.hh")
     m_calcamp->CalcAmp( p, m_amp2, m_msffmodel, m_wilscoeff, mu, Nf, res_swch,
                         ias, CKM_A, CKM_lambda, CKM_barrho, CKM_bareta );
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n The function EvtbTosllMS::decay(...) passed with arguments:"
     //                        << "\n mu = " << mu << " Nf =" << Nf
     //                        << " res_swch = " << res_swch
     //                        << " ias = " << ias
     //                        << " CKM_A = " << CKM_A
     //                        << " CKM_lambda = " << CKM_lambda
     //                        << " CKM_barrho = " << CKM_barrho
     //                        << " CKM_bareta = " << CKM_bareta << std::endl;
 }
diff --git a/src/EvtGenModels/EvtbTosllMSExt.cpp b/src/EvtGenModels/EvtbTosllMSExt.cpp
index 44d56f7..ef1b415 100644
--- a/src/EvtGenModels/EvtbTosllMSExt.cpp
+++ b/src/EvtGenModels/EvtbTosllMSExt.cpp
@@ -1,197 +1,197 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtbTosllMSExt.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtbTosllAmpNewExt.hh"
 #include "EvtGenModels/EvtbTosllMSFF.hh"
 #include "EvtGenModels/EvtbTosllScalarAmpNewExt.hh"
 #include "EvtGenModels/EvtbTosllVectorAmpNewExt.hh"
 #include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
 
 #include <stdlib.h>
 #include <string.h>
 
 EvtbTosllMSExt::~EvtbTosllMSExt()
 {
     delete m_msffmodel;
     if ( m_calcamp )
         delete m_calcamp;
 }
 
 // The module name specification
-std::string EvtbTosllMSExt::getName()
+std::string EvtbTosllMSExt::getName() const
 {
     return "BTOSLLMSEXT";
 }
 
 // The implementation of the clone() method
-EvtDecayBase* EvtbTosllMSExt::clone()
+EvtDecayBase* EvtbTosllMSExt::clone() const
 {
     return new EvtbTosllMSExt;
 }
 
 // The inicialization of the decay model
 //
 // Tn the our model we have are following 4 arguments:
 //
 //           mu          - the scale parameter, GeV;
 //           Nf          - number of "effective" flavors (for b-quark Nf=5);
 //           res_swch    - resonant switching parametr:
 //                         = 0 the resonant contribution switched OFF,
 //                         = 1 the resonant contribution switched ON;
 //           ias         - switching parametr for \alpha_s(M_Z) value:
 //                         = 0 PDG 1sigma minimal alpha_s(M_Z),
 //                         = 1 PDG average value  alpha_s(M_Z),
 //                         = 2 PDG 1sigma maximal alpha_s(M_Z).
 //           Wolfenstein parameterization for CKM matrix
 //                         CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
 //           Complex multiplication coefficients
 //                         A7  = ReA7  + i*ImA7
 //                         A10 = ReA10 + i*ImA10
 //
 void EvtbTosllMSExt::init()
 {
     // check that there are 12 arguments
     checkNArg( 12 );
     // check that there are 3 daughteres
     checkNDaug( 3 );
 
     // We expect that the parent to be a scalar (B-meson)
     // and the daughters to be K^*, l^+ and l^-
     checkSpinParent( EvtSpinType::SCALAR );
 
     // We expect that the first daughter is the K* == VECTOR
     EvtSpinType::spintype mesontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     if ( !( mesontype == EvtSpinType::VECTOR ||
             mesontype == EvtSpinType::SCALAR ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "EvtbTosllMSExt generator expected "
             << " a SCALAR or VECTOR 1st daughter, found:"
             << EvtPDL::name( getDaug( 0 ) ).c_str() << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     // We expect that the second and third daughters
     // are the ell+ and ell- == DIRAC
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
 
     m_msffmodel = new EvtbTosllMSFF();
     m_wilscoeff = new EvtbTosllWilsCoeffNLO();
     if ( mesontype == EvtSpinType::VECTOR ) {
         m_calcamp = new EvtbTosllVectorAmpNewExt();
     }
     if ( mesontype == EvtSpinType::SCALAR ) {
         m_calcamp = new EvtbTosllScalarAmpNewExt();
     }
 }
 
 // Set the maximum probability of the decay
 // differencial distribution d^2\Gamma/d\hat s d\cos\theta
 void EvtbTosllMSExt::initProbMax()
 {
     double mymaxprob = -10.0;    // maximum of the probability
 
     EvtId parnum, mesnum, l1num, l2num;
 
     parnum = getParentId();
     mesnum = getDaug( 0 );
     l1num = getDaug( 1 );
     l2num = getDaug( 2 );
 
     // EvtSpinType::spintype mesontype=EvtPDL::getSpinType(getDaug(0));
 
     double mu = getArg( 0 );            // the scale parameter
     int Nf = (int)getArg( 1 );          // number of "effective" flavors
     int res_swch = (int)getArg( 2 );    // resonant switching parametr
     int ias = (int)getArg( 3 );         // switching parametr for \alpha_s(M_Z)
     double CKM_A = getArg( 4 );
     double CKM_lambda = getArg( 5 );
     double CKM_barrho = getArg( 6 );
     double CKM_bareta = getArg( 7 );
     double ReA7 = getArg( 8 );
     double ImA7 = getArg( 9 );
     double ReA10 = getArg( 10 );
     double ImA10 = getArg( 11 );
 
     mymaxprob = m_calcamp->CalcMaxProb( parnum, mesnum, l1num, l2num, m_msffmodel,
                                         m_wilscoeff, mu, Nf, res_swch, ias,
                                         CKM_A, CKM_lambda, CKM_barrho,
                                         CKM_bareta, ReA7, ImA7, ReA10, ImA10 );
 
     if ( mymaxprob <= 0.0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "The function void EvtbTosllMSExt::initProbMax()"
             << "\n Unexpected value of the probability maximum!"
             << "\n mymaxprob = " << mymaxprob << std::endl;
         ::abort();
     }
 
     setProbMax( mymaxprob );
 }
 
 void EvtbTosllMSExt::decay( EvtParticle* p )
 {
     double mu = getArg( 0 );            // the scale parameter
     int Nf = (int)getArg( 1 );          // number of "effective" flavors
     int res_swch = (int)getArg( 2 );    // resonant switching parametr
     int ias = (int)getArg( 3 );         // switching parametr for \alpha_s(M_Z)
     double CKM_A = getArg( 4 );
     double CKM_lambda = getArg( 5 );
     double CKM_barrho = getArg( 6 );
     double CKM_bareta = getArg( 7 );
     double ReA7 = getArg( 8 );
     double ImA7 = getArg( 9 );
     double ReA10 = getArg( 10 );
     double ImA10 = getArg( 11 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     // The class "EvtbTosllVectorAmpNewExt" is the derived class of the
     // class  "EvtbTosllAmpNewExt" (see the file "EvtbTosllVectorAmpNewExt.hh")
     // and
     // the class "EvtbTosllMSFF" is the derived class of the
     // class  "EvtbTosllFFNew" (see the file "EvtbTosllMSFF.hh")
     m_calcamp->CalcAmp( p, m_amp2, m_msffmodel, m_wilscoeff, mu, Nf, res_swch,
                         ias, CKM_A, CKM_lambda, CKM_barrho, CKM_bareta, ReA7,
                         ImA7, ReA10, ImA10 );
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n The function EvtbTosllMSExt::decay(...) passed with arguments:"
     //                        << "\n mu = " << mu << " Nf =" << Nf
     //                        << " res_swch = " << res_swch
     //                        << " ias = " << ias
     //                        << " CKM_A = " << CKM_A
     //                        << " CKM_lambda = " << CKM_lambda
     //                        << " CKM_barrho = " << CKM_barrho
     //                        << " CKM_bareta = " << CKM_bareta
     //                        << " ReA7 = " << ReA7
     //                        << " ImA7 = " << ImA7
     //                        << " ReA10 = " << ReA10
     //                        << " ImA10 = " << ImA10 << std::endl;
 }
diff --git a/src/EvtGenModels/EvtbTosllScalarAmp.cpp b/src/EvtGenModels/EvtbTosllScalarAmp.cpp
index 178b341..ef779b2 100644
--- a/src/EvtGenModels/EvtbTosllScalarAmp.cpp
+++ b/src/EvtGenModels/EvtbTosllScalarAmp.cpp
@@ -1,156 +1,156 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtbTosllScalarAmp.hh"
 
 #include "EvtGenBase/EvtAmp.hh"
 #include "EvtGenBase/EvtConst.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include "EvtGenModels/EvtbTosllAmp.hh"
 #include "EvtGenModels/EvtbTosllFF.hh"
 
 void EvtbTosllScalarAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
                                   EvtbTosllFF* formFactors )
 {
     //Add the lepton and neutrino 4 momenta to find q2
 
     EvtVector4R q = parent->getDaug( 1 )->getP4() + parent->getDaug( 2 )->getP4();
     double q2 = ( q.mass2() );
 
     double fp( 0. ), f0( 0. ), ft( 0. );
     double mesonmass = parent->getDaug( 0 )->mass();
     double parentmass = parent->mass();
 
     formFactors->getScalarFF( parent->getId(), parent->getDaug( 0 )->getId(),
                               q2, mesonmass, fp, f0, ft );
 
     EvtId daught = parent->getDaug( 0 )->getId();
     bool btod = false;
     bool nnlo = true;
     if ( daught == EvtPDL::getId( std::string( "pi+" ) ) ||
          daught == EvtPDL::getId( std::string( "pi-" ) ) ||
          daught == EvtPDL::getId( std::string( "pi0" ) ) ||
          daught == EvtPDL::getId( std::string( "eta" ) ) ||
          daught == EvtPDL::getId( std::string( "eta'" ) ) )
         btod = true;
 
     EvtVector4R p4b;
     p4b.set( parent->mass(), 0.0, 0.0, 0.0 );
 
     EvtVector4C l11, l12;
     EvtVector4C l21, l22;
 
     EvtVector4C a11, a12;
     EvtVector4C a21, a22;
 
     EvtId l_num = parent->getDaug( 1 )->getId();
 
     EvtVector4C T1, T2;
 
     EvtVector4R phat = p4b / parentmass;
     EvtVector4R qhat = q / parentmass;
 
     EvtComplex c7eff = EvtbTosllAmp::GetC7Eff( q2, nnlo );
     EvtComplex c9eff = EvtbTosllAmp::GetC9Eff( q2, nnlo, btod );
     EvtComplex c10eff = EvtbTosllAmp::GetC10Eff( q2, nnlo );
 
     //double mbhat=1;
     double mbhat = 4.4 / ( parentmass );
     //double mkhat = 0.15;
     double mkhat = mesonmass / ( parentmass );
     double shat = q2 / ( parentmass * parentmass );
 
     double fm = ( f0 - fp ) * ( 1 - mkhat * mkhat ) / shat;
 
     EvtComplex aprime;
     aprime = c9eff * fp + 2.0 * mbhat * c7eff * ft / ( 1 + mkhat );
     EvtComplex bprime;
     bprime = c9eff * fm - 2 * mbhat * c7eff * ft * ( 1 - mkhat ) / shat;
 
     EvtComplex cprime;
     cprime = c10eff * fp;
     EvtComplex dprime;
     dprime = c10eff * fm;
 
-    static EvtIdSet leptons{ "e-", "mu-", "tau-" };
-    static EvtIdSet antileptons{ "e+", "mu+", "tau+" };
+    static const EvtIdSet leptons{ "e-", "mu-", "tau-" };
+    static const EvtIdSet antileptons{ "e+", "mu+", "tau+" };
 
     if ( leptons.contains( l_num ) ) {
         T1 = aprime * phat + bprime * qhat;
         T2 = cprime * phat + dprime * qhat;
 
         l11 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 0 ),
                                  parent->getDaug( 2 )->spParent( 0 ) );
         l21 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 1 ),
                                  parent->getDaug( 2 )->spParent( 0 ) );
         l12 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 0 ),
                                  parent->getDaug( 2 )->spParent( 1 ) );
         l22 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 1 ),
                                  parent->getDaug( 2 )->spParent( 1 ) );
         a11 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 0 ),
                                  parent->getDaug( 2 )->spParent( 0 ) );
         a21 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 1 ),
                                  parent->getDaug( 2 )->spParent( 0 ) );
         a12 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 0 ),
                                  parent->getDaug( 2 )->spParent( 1 ) );
         a22 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 1 ),
                                  parent->getDaug( 2 )->spParent( 1 ) );
     } else {
         if ( antileptons.contains( l_num ) ) {
             T1 = aprime * phat + bprime * qhat;
             T2 = cprime * phat + dprime * qhat;
 
             l11 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 1 ),
                                      parent->getDaug( 2 )->spParent( 1 ) );
             l21 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 0 ),
                                      parent->getDaug( 2 )->spParent( 1 ) );
             l12 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 1 ),
                                      parent->getDaug( 2 )->spParent( 0 ) );
             l22 = EvtLeptonVCurrent( parent->getDaug( 1 )->spParent( 0 ),
                                      parent->getDaug( 2 )->spParent( 0 ) );
 
             a11 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 1 ),
                                      parent->getDaug( 2 )->spParent( 1 ) );
             a21 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 0 ),
                                      parent->getDaug( 2 )->spParent( 1 ) );
             a12 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 1 ),
                                      parent->getDaug( 2 )->spParent( 0 ) );
             a22 = EvtLeptonACurrent( parent->getDaug( 1 )->spParent( 0 ),
                                      parent->getDaug( 2 )->spParent( 0 ) );
 
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Wrong lepton number\n";
         }
     }
 
     amp.vertex( 0, 0, l11 * T1 + a11 * T2 );
     amp.vertex( 0, 1, l12 * T1 + a12 * T2 );
     amp.vertex( 1, 0, l21 * T1 + a21 * T2 );
     amp.vertex( 1, 1, l22 * T1 + a22 * T2 );
 }
diff --git a/src/EvtGenModels/EvtbTosllVectorAmp.cpp b/src/EvtGenModels/EvtbTosllVectorAmp.cpp
index f311dc3..dc9afdd 100644
--- a/src/EvtGenModels/EvtbTosllVectorAmp.cpp
+++ b/src/EvtGenModels/EvtbTosllVectorAmp.cpp
@@ -1,214 +1,214 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/EvtbTosllVectorAmp.hh"
 
 #include "EvtGenBase/EvtAmp.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 
 #include "EvtGenModels/EvtbTosllAmp.hh"
 #include "EvtGenModels/EvtbTosllFF.hh"
 
 void EvtbTosllVectorAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
                                   EvtbTosllFF* formFactors )
 {
     //Add the lepton and neutrino 4 momenta to find q2
 
     EvtVector4R q = parent->getDaug( 1 )->getP4() + parent->getDaug( 2 )->getP4();
     double q2 = ( q.mass2() );
 
     double a1, a2, a0, v, t1, t2, t3;
     double mesonmass = parent->getDaug( 0 )->mass();
     double parentmass = parent->mass();
 
     formFactors->getVectorFF( parent->getId(), parent->getDaug( 0 )->getId(),
                               q2, mesonmass, a1, a2, a0, v, t1, t2, t3 );
 
     EvtId daught = parent->getDaug( 0 )->getId();
     EvtId parentId = parent->getId();
     bool btod = false;
     bool nnlo = true;
     if ( ( parentId == EvtPDL::getId( "B0" ) ||
            parentId == EvtPDL::getId( "anti-B0" ) ||
            parentId == EvtPDL::getId( "B+" ) ||
            parentId == EvtPDL::getId( "B-" ) ) &&
          ( daught == EvtPDL::getId( std::string( "rho+" ) ) ||
            daught == EvtPDL::getId( std::string( "rho-" ) ) ||
            daught == EvtPDL::getId( std::string( "rho0" ) ) ||
            daught == EvtPDL::getId( std::string( "omega" ) ) ) ) {
         btod = true;
     }
     if ( ( parentId == EvtPDL::getId( "B_s0" ) ||
            parentId == EvtPDL::getId( "anti-B_s0" ) ) &&
          ( daught == EvtPDL::getId( std::string( "K*0" ) ) ||
            daught == EvtPDL::getId( std::string( "anti-K*0" ) ) ||
            daught == EvtPDL::getId( std::string( "K*+" ) ) ||
            daught == EvtPDL::getId( std::string( "K*-" ) ) ) ) {
         btod = true;
     }
 
     EvtVector4R p4b;
     p4b.set( parent->mass(), 0.0, 0.0, 0.0 );
     EvtVector4R p4meson = parent->getDaug( 0 )->getP4();
 
     EvtVector4C l11, l12;
     EvtVector4C l21, l22;
 
     EvtVector4C a11, a12;
     EvtVector4C a21, a22;
 
     EvtId parentID = parent->getId();
 
     //EvtId l_num = parent->getDaug(1)->getId();
 
     EvtVector4R pbhat = p4b / parentmass;
     EvtVector4R qhat = q / parentmass;
     EvtVector4R pkstarhat = p4meson / parentmass;
     EvtVector4R phat = pbhat + pkstarhat;
 
     EvtComplex c7eff = EvtbTosllAmp::GetC7Eff( q2, nnlo );
     EvtComplex c9eff = EvtbTosllAmp::GetC9Eff( q2, nnlo, btod );
     EvtComplex c10eff = EvtbTosllAmp::GetC10Eff( q2, nnlo );
     EvtComplex uniti( 0.0, 1.0 );
 
     double mhatb = 4.4 / ( parentmass );
     double mhatkstar = mesonmass / ( parentmass );
     double shat = q2 / ( parentmass * parentmass );
 
     EvtComplex a;
     a = c9eff * v * 2 / ( 1 + mhatkstar ) + 4 * mhatb * c7eff * t1 / shat;
     EvtComplex b;
     b = ( 1 + mhatkstar ) *
         ( c9eff * a1 + 2 * mhatb * ( 1 - mhatkstar ) * c7eff * t2 / shat );
     EvtComplex c;
     c = ( ( 1 - mhatkstar ) * c9eff * a2 +
           2 * mhatb * c7eff * ( t3 + ( 1 - mhatkstar * mhatkstar ) * t2 / shat ) ) /
         ( 1 - mhatkstar * mhatkstar );
     EvtComplex d;
     d = ( c9eff * ( ( 1 + mhatkstar ) * a1 - ( 1 - mhatkstar ) * a2 -
                     2 * mhatkstar * a0 ) -
           2 * mhatb * c7eff * t3 ) /
         shat;
     EvtComplex e;
     e = 2 * c10eff * v / ( 1 + mhatkstar );
     EvtComplex f;
     f = ( 1 + mhatkstar ) * c10eff * a1;
     EvtComplex g;
     g = c10eff * a2 / ( 1 + mhatkstar );
     EvtComplex h;
     h = c10eff *
         ( ( 1 + mhatkstar ) * a1 - ( 1 - mhatkstar ) * a2 - 2 * mhatkstar * a0 ) /
         shat;
 
     EvtTensor4C T1, T2;
 
-    static EvtIdSet bmesons{ "B-", "anti-B0", "anti-B_s0" };
-    static EvtIdSet bbarmesons{ "B+", "B0", "B_s0" };
+    static const EvtIdSet bmesons{ "B-", "anti-B0", "anti-B_s0" };
+    static const EvtIdSet bbarmesons{ "B+", "B0", "B_s0" };
 
     EvtParticle* lepPlus = nullptr;
     EvtParticle* lepMinus = nullptr;
 
     int charge1 = EvtPDL::chg3( parent->getDaug( 1 )->getId() );
     int charge2 = EvtPDL::chg3( parent->getDaug( 2 )->getId() );
 
     lepPlus = ( charge1 > charge2 ) ? parent->getDaug( 1 ) : parent->getDaug( 2 );
     lepMinus = ( charge1 < charge2 ) ? parent->getDaug( 1 )
                                      : parent->getDaug( 2 );
 
     if ( bmesons.contains( parentID ) ) {
         T1 = a * dual( EvtGenFunctions::directProd( pbhat, pkstarhat ) ) -
              b * uniti * EvtTensor4C::g() +
              c * uniti * EvtGenFunctions::directProd( pbhat, phat ) +
              d * uniti * EvtGenFunctions::directProd( pbhat, qhat );
 
         T2 = e * dual( EvtGenFunctions::directProd( pbhat, pkstarhat ) ) -
              f * uniti * EvtTensor4C::g() +
              g * uniti * EvtGenFunctions::directProd( pbhat, phat ) +
              h * uniti * EvtGenFunctions::directProd( pbhat, qhat );
 
         l11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ), lepMinus->spParent( 0 ) );
         l21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ), lepMinus->spParent( 0 ) );
         l12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ), lepMinus->spParent( 1 ) );
         l22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ), lepMinus->spParent( 1 ) );
 
         a11 = EvtLeptonACurrent( lepPlus->spParent( 0 ), lepMinus->spParent( 0 ) );
         a21 = EvtLeptonACurrent( lepPlus->spParent( 1 ), lepMinus->spParent( 0 ) );
         a12 = EvtLeptonACurrent( lepPlus->spParent( 0 ), lepMinus->spParent( 1 ) );
         a22 = EvtLeptonACurrent( lepPlus->spParent( 1 ), lepMinus->spParent( 1 ) );
 
     } else {
         if ( bbarmesons.contains( parentID ) ) {
             T1 = -a * dual( EvtGenFunctions::directProd( pbhat, pkstarhat ) ) -
                  b * uniti * EvtTensor4C::g() +
                  c * uniti * EvtGenFunctions::directProd( pbhat, phat ) +
                  d * uniti * EvtGenFunctions::directProd( pbhat, qhat );
 
             T2 = -e * dual( EvtGenFunctions::directProd( pbhat, pkstarhat ) ) -
                  f * uniti * EvtTensor4C::g() +
                  g * uniti * EvtGenFunctions::directProd( pbhat, phat ) +
                  h * uniti * EvtGenFunctions::directProd( pbhat, qhat );
 
             l11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                      lepMinus->spParent( 1 ) );
             l21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                      lepMinus->spParent( 1 ) );
             l12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                      lepMinus->spParent( 0 ) );
             l22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                      lepMinus->spParent( 0 ) );
 
             a11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                      lepMinus->spParent( 1 ) );
             a21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                      lepMinus->spParent( 1 ) );
             a12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                      lepMinus->spParent( 0 ) );
             a22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                      lepMinus->spParent( 0 ) );
 
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "Wrong lepton number\n";
             T1.zero();
             T2.zero();    // Set all tensor terms to zero.
         }
     }
 
     int i;
 
     for ( i = 0; i < 3; i++ ) {
         EvtVector4C eps = parent->getDaug( 0 )->epsParent( i ).conj();
 
         EvtVector4C E1 = T1.cont1( eps );
         EvtVector4C E2 = T2.cont1( eps );
 
         amp.vertex( i, 0, 0, l11 * E1 + a11 * E2 );
         amp.vertex( i, 0, 1, l12 * E1 + a12 * E2 );
         amp.vertex( i, 1, 0, l21 * E1 + a21 * E2 );
         amp.vertex( i, 1, 1, l22 * E1 + a22 * E2 );
     }
 }
diff --git a/src/EvtGenModels/Evtbs2llGammaAmp.cpp b/src/EvtGenModels/Evtbs2llGammaAmp.cpp
index 0c457ce..5f46912 100644
--- a/src/EvtGenModels/Evtbs2llGammaAmp.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaAmp.cpp
@@ -1,857 +1,857 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/Evtbs2llGammaAmp.hh"
 
 #include "EvtGenBase/EvtAmp.hh"
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtScalarParticle.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVectorParticle.hh"
 
 #include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
 #include "EvtGenModels/Evtbs2llGammaFFMNT.hh"
 
 #include <cstdlib>
 
 // input:   *parent      - the pointer to the parent particle (B-meson, the
 //                                          object of the EvtParticle class);
 //          *formFactors - the pointer to instance of EvtbTosllGammaFF class object;
 //          *WilsCoeff   - the pointer to the Standart Model Wilson Coefficients class;
 //           mu          - the scale parameter, GeV;
 //           Nf          - number of "effective" flavors (for b-quark Nf=5);
 //           res_swch    - resonant switching parameter:
 //                         = 0 the resonant contribution switched OFF,
 //                         = 1 the resonant contribution switched ON;
 //           ias         - switching parameter for \alpha_s(M_Z) value:
 //                         = 0 PDG 1sigma minimal alpha_s(M_Z),
 //                         = 1 PDG average value  alpha_s(M_Z),
 //                         = 2 PDG 1sigma maximal alpha_s(M_Z).
 //           Egamma_min  - photon energy cut, GeV;
 //           Wolfenstein parameterization for CKM matrix
 //                         CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
 
 void Evtbs2llGammaAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
                                 Evtbs2llGammaFF* formFactors,
                                 EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
                                 int Nf, int res_swch, int ias, double Egamma_min,
                                 double CKM_A, double CKM_lambda,
                                 double CKM_barrho, double CKM_bareta )
 {
     //  FILE *mytest;
 
     int iG = 0;    // photon is the first daughter particle
     int il1 = 1,
         il2 = 2;    // leptons are the second and thirds daughter particles
 
     EvtComplex unit1( 1.0, 0.0 );    // real unit
     EvtComplex uniti( 0.0, 1.0 );    // imaginary unit
 
     double M1 = parent->mass();                    // B - meson mass, GeV
     double ml = parent->getDaug( il1 )->mass();    // leptonic mass, GeV
     double mq = 0.0;    // light quark mass from the dispersion QM, GeV
     double mc = formFactors->getQuarkMass(
         4 );    // m_c mass from the dispersion QM, GeV
     double mb = formFactors->getQuarkMass(
         5 );               // m_b mass from the dispersion QM, GeV
     double Mw = 80.403;    // GeV W-boson mass, GeV
     double mt = 174.2;     // GeV t-quark mass, GeV
     double fb = 0.0;       // leptonic decay constant of B-meson, Gev
 
     EvtComplex Vtb, Vtq, Vub, Vuq, Vcb,
         Vcq;                  // V_{tb}, V_{tq}, V_{ub}, V_{uq}, V_{cb}, V_{cq}
     EvtComplex CKM_factor;    // V^*_{tq}*V_{tb}, where q={d,s}
     EvtComplex lambda_qu;     // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
     EvtComplex lambda_qc;     // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}, where q={d,s}
     double Relambda_qu, Imlambda_qu;
 
     // to find charges of ell^+ and ell^- in the B-meson  daughters
     int charge1 = EvtPDL::chg3( parent->getDaug( il1 )->getId() );
     int charge2 = EvtPDL::chg3( parent->getDaug( il2 )->getId() );
     if ( charge1 == 0 || charge2 == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n The function EvtbsTollGammaAmp::CalcAmp(...)"
             << "\n Error in the leptonic charge getting!"
             << "\n charge1             =" << charge1
             << "\n charge2             =" << charge2 << "\n charge gamma        ="
             << EvtPDL::chg3( parent->getDaug( iG )->getId() )
             << "\n number of daughters =" << parent->getNDaug() << std::endl;
         ::abort();
     }
 
     EvtParticle* lepPlus = nullptr;
     EvtParticle* lepMinus = nullptr;
 
     lepPlus = ( charge1 > charge2 )
                   ? parent->getDaug( il1 )
                   : parent->getDaug( il2 );    // positive charged
     lepMinus = ( charge1 < charge2 )
                    ? parent->getDaug( il1 )
                    : parent->getDaug( il2 );    // negative charged
 
     EvtVector4R p = parent->getP4Restframe();    // B-meson momentum in the B-rest frame
     EvtVector4R k =
         parent->getDaug( iG )->getP4();    // 4-momentum of photon in the B-rest frame
     EvtVector4R q = p - k;    // transition 4-momentum q=p-k in the B-rest frame
     EvtVector4R p_1;          // 4-momentum of ell^+ in the B-rest frame
     EvtVector4R p_2;          // 4-momentum of ell^- in the B-rest frame
 
     // the preparation of the leptonic 4-momentums in the B-rest frame
     if ( charge1 > charge2 ) {
         p_1 = parent->getDaug( il1 )->getP4();
         p_2 = parent->getDaug( il2 )->getP4();
     } else {
         p_1 = parent->getDaug( il2 )->getP4();
         p_2 = parent->getDaug( il1 )->getP4();
     }
 
     EvtVector4R p_minus_p_1 =
         p - p_1;    // transition momentum of the B-meson and antilepton p-p_1
     EvtVector4R p_minus_p_2 =
         p - p_2;    // transition momentum of the B-meson and lepton p-p_2
 
     double q2 = q.mass2();             // Mandelstam variable s=q^2
     double p2 = p.mass2();             // p^2=M1^2
     double t = p_minus_p_1.mass2();    // Mandelstam variable t=(p-p_1)^2
     double u = p_minus_p_2.mass2();    // Mandelstam variable u=(p-p_2)^2
 
     // scalar products
     double pk = 0.5 * ( p2 - q2 );                // (p*k)
     double p1k = 0.5 * ( pow( ml, 2.0 ) - u );    // (p1*k)
     double p2k = 0.5 * ( pow( ml, 2.0 ) - t );    // (p2*k)
 
     double hatq2 = q2 / ( M1 * M1 );    // \hat s = q^2/M_1^2
     double Egam = 0.5 * M1 *
                   ( 1 - hatq2 );    // photon energy in the B-meson rest frame
 
     EvtVector4R hatp = p / M1;
     EvtVector4R hatk = k / M1;
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen")
     //         << "\n\n The function EvtbsTollGammaAmp::CalcAmp(...)"
     //         << "\n q =  p-k  =" << p-k     << "   q^2 = " << (p-k).mass2()
     //         << "\n q = p1+p2 =" << p_1+p_2 << "   q^2 = " << (p_1+p_2).mass2()
     //         << "\n m_ell     =" << parent->getDaug(il1)->mass()
     //         << "\n m_ell     =" << parent->getDaug(il2)->mass()
     //         << "\n m_gamma   =" << parent->getDaug(iG)->mass()
     //         << std::endl;
 
     EvtId idparent = parent->getId();    // B-meson Id
 
     if ( idparent == EvtPDL::getId( std::string( "B_s0" ) ) ||
          idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) ) {
         mq = formFactors->getQuarkMass( 3 );    // m_s mass from the dispersion QM
         fb = 0.24;                              // leptonic decay constant
             // V_{ts}
         Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
               pow( CKM_lambda, 2.0 ) *
                   ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
                   sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
         Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
         // V_{us}
         Vuq = CKM_lambda * unit1;
         // V_{cs}
         Vcq = unit1 - 0.5 * pow( CKM_lambda, 2.0 ) -
               0.125 * pow( CKM_lambda, 4.0 ) * ( 1.0 + 4.0 * pow( CKM_A, 2.0 ) );
     }
 
     if ( idparent == EvtPDL::getId( std::string( "B0" ) ) ||
          idparent == EvtPDL::getId( std::string( "anti-B0" ) ) ) {
         mq = formFactors->getQuarkMass( 2 );    // m_d mass from the dispersion QM
         fb = 0.20;                              // leptonic decay constant
             // V_{td}
         Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
                           ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
                           sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
         Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
         // V_{ud}
         Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
                         0.125 * pow( CKM_lambda, 4.0 ) );
         // V_{cd}
         Vcq = unit1 *
               ( -CKM_lambda +
                 0.5 * pow( CKM_A, 2.0 ) * pow( CKM_lambda, 5.0 ) *
                     ( 1.0 - 2.0 * ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
                                 sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ) ) );
     }
 
     if ( mq < 0.001 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n The function EvtbsTollGammaAmp::CalcAmp(..// 4-momentum of ell^+.)"
             << "\n Error in the model set!"
             << " mq = " << mq << std::endl;
         ::abort();
     }
 
     Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
                                      2.0 ) );    // V_{tb}
     Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
           ( CKM_barrho * unit1 - CKM_bareta * uniti ) /
           sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );      // V_{ub}
     Vcb = unit1 * CKM_A * pow( CKM_lambda, 2.0 );    // V_{cb}
 
     CKM_factor = conj( Vtq ) * Vtb;    // V^*_{tq}*V_{tb}
 
     lambda_qu = conj( Vuq ) * Vub /
                 CKM_factor;    // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
     Relambda_qu = real( lambda_qu );
     Imlambda_qu = imag( lambda_qu );
 
     lambda_qc = conj( Vcq ) * Vcb /
                 CKM_factor;    // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}
 
     // The Wilson Coefficients preparation according to the paper
     // A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
     double c1, c2;
     EvtComplex a1, c7gam, c9eff_b2q, c9eff_barb2barq, c10a;
 
     // foton energy cut and removal of the J/psi amd psi' resonant area
     if ( Egam < Egamma_min || ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ) {
         c1 = 0.0;
         c2 = 0.0;
         a1 = unit1 * 0.0;
         c7gam = unit1 * 0.0;
         c9eff_b2q = unit1 * 0.0;
         c9eff_barb2barq = unit1 * 0.0;
         c10a = unit1 * 0.0;
     } else {
         c1 = WilsCoeff->C1( mu, Mw, Nf, ias );
         c2 = WilsCoeff->C2( mu, Mw, Nf, ias );
         a1 = unit1 * ( c1 + c2 / 3.0 );
         c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
         c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb, mq, mc, mu,
                                          mt, Mw, ml, Relambda_qu, Imlambda_qu );
         c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2, mb, mq,
                                                mc, mu, mt, Mw, ml, Relambda_qu,
                                                Imlambda_qu );
         c10a = WilsCoeff->GetC10Eff( mt, Mw );
     }
 
     EvtComplex Fv,
         Fa;    // The change of the sign is included in the amplitudes definition!
     EvtComplex Ftv_b2q, Ftv_barb2barq;
     EvtComplex Fta_b2q, Fta_barb2barq;
 
     // foton energy cut and removal of the J/psi amd psi' resonant area
     if ( Egam < Egamma_min || ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ) {
         fb = 0.0;
         Fa = unit1 * 0.0;
         Fv = unit1 * 0.0;
         Fta_b2q = unit1 * 0.0;
         Fta_barb2barq = unit1 * 0.0;
         Ftv_b2q = unit1 * 0.0;
         Ftv_barb2barq = unit1 * 0.0;
     } else {
         if ( fb < 0.01 ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "\n\n The function EvtbsTollGammaAmp::CalcAmp(...)"
                 << "\n Leptonic decay constant fb is not uninitialized in this function!"
                 << " fb = " << fb << std::endl;
             ::abort();
         }
 
         // For \bar B^0_q -> l^+ l^- gamma
         formFactors->getPhotonFF( 0, fb, parent->getId(), q2, M1, mb, mq, c7gam,
                                   a1, lambda_qu, lambda_qc, Fv, Fa, Ftv_b2q,
                                   Fta_b2q );
 
         // For B^0_q -> l^+ l^- gamma
         formFactors->getPhotonFF( 1, fb, parent->getId(), q2, M1, mb, mq, c7gam,
                                   a1, lambda_qu, lambda_qc, Fv, Fa,
                                   Ftv_barb2barq, Fta_barb2barq );
     }
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen")
     //      << "\n ============================================================================"
     //      << "\n ============================================================================"
     //      << "\n\n The function Evtbs2llGammaAmp::CalcAmp(...) passed."
     //      << "\n Particle masses:"
     //      << "\n B - meson mass M1 = " << M1
     //      << "\n photon minimum E  = " << Egamma_min
     //      << "\n q2                = " << q2
     //      << "\n leptonic mass  ml = " << ml
     //      << "\n light quark mass  = " << mq
     //      << "\n c - quark mass mc = " << mc
     //      << "\n b - quark mass mb = " << mb
     //      << "\n t - quark mass mt = " << mt
     //      << "\n W - boson mass Mw = " << Mw
     //      << "\n ============================================================================"
     //      << "\n Input parameters:"
     //      << "\n scale parameter         mu = " << mu
     //      << "\n number of flavors       Nf = " << Nf
     //      << "\n resonant switching         = " << res_swch
     //      << "\n parameter for alpha_s(M_Z) = " << ias
     //      << "\n photon energy cut (GeV)    = " << Egamma_min
     //      << "\n ============================================================================"
     //      << "\n Form-factors"
     //      << "\n Egam          = " << Egam
     //      << "\n Egamma_min    = " << Egamma_min
     //      << "\n Fv            = " << Fv
     //      << "\n Fa            = " << Fa
     //      << "\n Ftv_b2q       = " << Ftv_b2q
     //      << "\n Fta_b2q       = " << Fta_b2q
     //      << "\n Ftv_barb2barq = " << Ftv_barb2barq
     //      << "\n Fta_barb2barq = " << Fta_barb2barq
     //      << "\n ============================================================================"
     //      << "\n Wilson Coefficients:"
     //      << "\n Egam                = " << Egam
     //      << "\n Egamma_min          = " << Egamma_min
     //      << "\n Re(c7gam)           = " << real(c7gam)
     //        << " Im(c7gam)           = " << imag(c7gam)
     //      << "\n Re(c9eff_b2q)       = " << real(c9eff_b2q)
     //        << " Im(c9eff_b2q)       = " << imag(c9eff_b2q)
     //      << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
     //        << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
     //      << "\n Re(c10a)            = " << real(c10a)
     //        << " Im(c10a)            = " << imag(c10a)
     //      << std::endl;
 
     // Hadronic matrix element coefficients
     EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, e_b2q, e_barb2barq,
         f_b2q, f_barb2barq;
     EvtComplex brammS, brammT;
 
     a_b2q = c9eff_b2q * Fv + 2.0 * c7gam * Ftv_b2q * mb * M1 / q2;
     a_barb2barq = c9eff_barb2barq * Fv +
                   2.0 * c7gam * Ftv_barb2barq * mb * M1 / q2;
 
     b_b2q = ( c9eff_b2q * Fa + 2.0 * c7gam * Fta_b2q * mb * M1 / q2 ) * pk /
             ( M1 * M1 );
     b_barb2barq = ( c9eff_barb2barq * Fa +
                     2.0 * c7gam * Fta_barb2barq * mb * M1 / q2 ) *
                   pk / ( M1 * M1 );
 
     e_b2q = c10a * Fv;
     e_barb2barq = e_b2q;
 
     f_b2q = c10a * Fa * pk / ( M1 * M1 );
     f_barb2barq = f_b2q;
 
     brammS = 0.0;    // in the Bq-meson rest frame!
     brammT = 0.5 * c10a * ml * fb *
              ( 1.0 / p2k + 1.0 / p1k );    // for Bramsstrahlung
 
     EvtTensor4C T1, T2;    // hadronic matrix element tensor structures
     EvtVector4C E1, E2;
     EvtComplex E3;
 
     int i;    // photon polarisations counter
 
     EvtVector4C lvc11, lvc12;    // spin structures for
     EvtVector4C lvc21, lvc22;    // the leptonic vector current
 
     EvtVector4C lac11, lac12;    // spin structures for
     EvtVector4C lac21, lac22;    // the leptonic axial current
 
     EvtComplex lsc11, lsc12;    // spin structures for
     EvtComplex lsc21, lsc22;    // the leptonic scalar current
 
     EvtTensor4C ltc11, ltc12;    // spin structures for
     EvtTensor4C ltc21, ltc22;    // the leptonic tensor current
 
     // B - and barB - mesons descriptors
-    static EvtIdSet bmesons{ "anti-B0", "anti-B_s0" };
-    static EvtIdSet bbarmesons{ "B0", "B_s0" };
+    static const EvtIdSet bmesons{ "anti-B0", "anti-B_s0" };
+    static const EvtIdSet bbarmesons{ "B0", "B_s0" };
 
     EvtId parentID = parent->getId();
 
     if ( bmesons.contains( parentID ) ) {
         // The amplitude for the decay barB -> gamma ell^+ ell^-  or
         // b \bar q -> gamma ell^+ ell^-
 
         T1 = -a_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
              b_b2q * uniti * EvtTensor4C::g();
 
         T2 = -e_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
              f_b2q * uniti * EvtTensor4C::g();
 
         // spin combinations for vector lepton current
         lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 0 ) );
         lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 0 ) );
         lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 1 ) );
         lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 1 ) );
 
         lac11 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 0 ) );
         lac21 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 0 ) );
         lac12 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 1 ) );
         lac22 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 1 ) );
 
         lsc11 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 0 ) );
         lsc21 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 0 ) );
         lsc12 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 1 ) );
         lsc22 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 1 ) );
 
         // \epsilon^{\alpha\beta\mu\nu}*TCurrent_{\mu\nu}
         ltc11 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
                                          lepMinus->spParent( 0 ) ) );
         ltc21 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
                                          lepMinus->spParent( 0 ) ) );
         ltc12 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
                                          lepMinus->spParent( 1 ) ) );
         ltc22 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
                                          lepMinus->spParent( 1 ) ) );
 
         // summing up photon polarisations
         for ( i = 0; i < 2; i++ ) {
             // conjaction of epsG (photon polarization vector)
             EvtVector4C epsG = parent->getDaug( 0 )->epsParentPhoton( i ).conj();
 
             // de-escalation T with epsG
             E1 = T1.cont2( epsG );
             E2 = T2.cont2( epsG );
             E3 = ( epsG * hatp ) * brammS;
 
             // foton energy cut and removal of the J/psi amd psi' resonant area
             if ( Egam < Egamma_min ||
                  ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ) {
                 CKM_factor = 0.0 * unit1;
             }
 
             // 1
             amp.vertex( i, 0, 0,
                         CKM_factor *
                             ( lvc11 * E1 + lac11 * E2 + uniti * lsc11 * E3 +
                               uniti * ( ( ltc11.cont2( hatp ) ) * epsG ) *
                                   brammT ) );
             //      EvtGenReport(EVTGEN_NOTICE,"EvtGen")
             //        << "\n 1" << CKM_factor*(lvc11*E1+lac11*E2+uniti*lsc11*E3+uniti*((ltc11.cont2(hatp))*epsG)*brammT)
             //        << std::endl;
 
             // 2
             amp.vertex( i, 0, 1,
                         CKM_factor *
                             ( lvc12 * E1 + lac12 * E2 + uniti * lsc12 * E3 +
                               uniti * ( ( ltc12.cont2( hatp ) ) * epsG ) *
                                   brammT ) );
             //      EvtGenReport(EVTGEN_NOTICE,"EvtGen")
             //        << "\n 2" << CKM_factor*(lvc12*E1+lac12*E2+uniti*lsc12*E3+uniti*((ltc12.cont2(hatp))*epsG)*brammT)
             //        << std::endl;
 
             // 3
             amp.vertex( i, 1, 0,
                         CKM_factor *
                             ( lvc21 * E1 + lac21 * E2 + uniti * lsc21 * E3 +
                               uniti * ( ( ltc21.cont2( hatp ) ) * epsG ) *
                                   brammT ) );
             //      EvtGenReport(EVTGEN_NOTICE,"EvtGen")
             //        << "\n 3" << CKM_factor*(lvc21*E1+lac21*E2+uniti*lsc21*E3+uniti*((ltc21.cont2(hatp))*epsG)*brammT)
             //        << std::endl;
 
             // 4
             amp.vertex( i, 1, 1,
                         CKM_factor *
                             ( lvc22 * E1 + lac22 * E2 + uniti * lsc22 * E3 +
                               uniti * ( ( ltc22.cont2( hatp ) ) * epsG ) *
                                   brammT ) );
             //      EvtGenReport(EVTGEN_NOTICE,"EvtGen")
             //        << "\n 4" << CKM_factor*(lvc22*E1+lac22*E2+uniti*lsc22*E3+uniti*((ltc22.cont2(hatp))*epsG)*brammT)
             //        << std::endl;
         }
 
     } else {
         if ( bbarmesons.contains( parentID ) ) {
             // The amplitude for the decay B -> gamma ell^+ ell^- or
             // q bar b -> gamma ell^+ ell^-
 
             T1 = -a_barb2barq * unit1 *
                      dual( EvtGenFunctions::directProd( hatp, hatk ) ) +
                  b_barb2barq * uniti * EvtTensor4C::g();
 
             T2 = -e_barb2barq * unit1 *
                      dual( EvtGenFunctions::directProd( hatp, hatk ) ) +
                  f_barb2barq * uniti * EvtTensor4C::g();
 
             lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 1 ) );
             lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 1 ) );
             lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 0 ) );
             lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 0 ) );
 
             lac11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 1 ) );
             lac21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 1 ) );
             lac12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 0 ) );
             lac22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 0 ) );
 
             lsc11 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 1 ) );
             lsc21 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 1 ) );
             lsc12 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 0 ) );
             lsc22 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 0 ) );
 
             // \epsilon^{\alpha\beta\mu\nu}*TCurrent_{\mu\nu}
             ltc11 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
                                              lepMinus->spParent( 1 ) ) );
             ltc21 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
                                              lepMinus->spParent( 1 ) ) );
             ltc12 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
                                              lepMinus->spParent( 0 ) ) );
             ltc22 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
                                              lepMinus->spParent( 0 ) ) );
 
             // summing up photon polarisations
             for ( i = 0; i < 2; i++ ) {
                 EvtVector4C barepsG = parent->getDaug( 0 )->epsParentPhoton( i );
 
                 E1 = T1.cont2( barepsG );
                 E2 = T2.cont2( barepsG );
                 E3 = ( barepsG * hatp ) * brammS;
 
                 // foton energy cut and removal of the J/psi amd psi' resonant area
                 if ( Egam < Egamma_min ||
                      ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ) {
                     CKM_factor = 0.0 * unit1;
                 }
 
                 amp.vertex( i, 1, 1,
                             conj( CKM_factor ) *
                                 ( lvc11 * E1 + lac11 * E2 +
                                   uniti * lsc11 * E3 +    // -?
                                   uniti * ( ( ltc11.cont2( hatp ) ) * barepsG ) *
                                       brammT ) );
                 amp.vertex( i, 1, 0,
                             conj( CKM_factor ) *
                                 ( lvc12 * E1 + lac12 * E2 +
                                   uniti * lsc12 * E3 +    // -?
                                   uniti * ( ( ltc12.cont2( hatp ) ) * barepsG ) *
                                       brammT ) );
                 amp.vertex( i, 0, 1,
                             conj( CKM_factor ) *
                                 ( lvc21 * E1 + lac21 * E2 +
                                   uniti * lsc21 * E3 +    // -?
                                   uniti * ( ( ltc21.cont2( hatp ) ) * barepsG ) *
                                       brammT ) );
                 amp.vertex( i, 0, 0,
                             conj( CKM_factor ) *
                                 ( lvc22 * E1 + lac22 * E2 +
                                   uniti * lsc22 * E3 +    // -?
                                   uniti * ( ( ltc22.cont2( hatp ) ) * barepsG ) *
                                       brammT ) );
             }
 
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "\n\n The function Evtbs2llGammaAmp::CalcAmp(...)"
                 << "\n Wrong B-meson number" << std::endl;
             ::abort();
         }
     }
 }
 
 //
 // The decays B -> Gamma ell^+ ell^- maximum probability calculation for the
 // d^2\Gamma/dq^2 d\cos\theta distribution.
 //
 // \theta - the angle between the photon and ell^- directions in the
 //          B-meson rest frame.
 //
 // If ias=0 (nonresonant case), the maximum is achieved at q2
 //           B0s:                q2 = 4*ml^2, Mphi^2, q_max^2;
 //           B0d:                q2 = 4*ml^2, Mrho^2, Momega^2, q_max^2;
 // If ias=1 (resonant case), the maximum in the same points, because the
 //          resonat area is remove
 //
 double Evtbs2llGammaAmp::CalcMaxProb( EvtId parnum, EvtId photnum, EvtId l1num,
                                       EvtId l2num, Evtbs2llGammaFF* formFactors,
                                       EvtbTosllWilsCoeffNLO* WilsCoeff,
                                       double mu, int Nf, int res_swch, int ias,
                                       double Egamma_min, double CKM_A,
                                       double CKM_lambda, double CKM_barrho,
                                       double CKM_bareta )
 {
     double maxfoundprob = -100.0;    // maximum of the probability
                                      //  int ijk_atmax = 1000000;
 
     double M1 = EvtPDL::getMeanMass( parnum );    // B - meson mass
     double ml = EvtPDL::getMeanMass( l1num );     // leptonic mass
 
     double Mrho = EvtPDL::getMeanMass(
         EvtPDL::getId( std::string( "rho0" ) ) );    // mass of the rho-meson, MeV
     double Momega = EvtPDL::getMeanMass( EvtPDL::getId(
         std::string( "omega" ) ) );    // mass of the omega-meson, MeV
     double Mphi = EvtPDL::getMeanMass(
         EvtPDL::getId( std::string( "phi" ) ) );    // mass of the phi-meson, MeV
 
     // EvtGenReport(EVTGEN_NOTICE,"EvtGen")
     //   << "\n M1         = " << M1
     //   << "\n ml         = " << ml
     //   << "\n Mrho       = " << Mrho
     //   << "\n Momega     = " << Momega
     //   << "\n Mphi       = " << Mphi
     //   << "\n Egamma_min = " << Egamma_min
     //   << std::endl;
 
     double list_of_max_q2_points[5];
     list_of_max_q2_points[0] = pow( 2.0 * ml, 2.0 );
     list_of_max_q2_points[1] = pow( Mrho, 2.0 );
     list_of_max_q2_points[2] = pow( Momega, 2.0 );
     list_of_max_q2_points[3] = pow( Mphi, 2.0 );
     list_of_max_q2_points[4] =
         pow( M1, 2.0 ) - 2.0 * M1 * Egamma_min;    // q^2_max at photon energy cut
 
     //  if(list_of_max_points[4]<0){
     //     EvtGenReport(EVTGEN_ERROR,"EvtGen")
     //       << "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
     //       << "\n Bad photon energy cut: Egamma_min > M1 in the rest frame of B-meson!"
     //       << "\n q2_max     = " << list_of_max_points[4]
     //       << "\n M1         = " << M1
     //       << "\n Egamma_min = " << Egamma_min
     //       << std::endl;
     //  ::abort();
     //  }
 
     if ( Egamma_min > Mrho ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
             << "\n Bad photon energy cut: Egamma_min > M_rho0 in the rest frame of B-meson."
             << "\n Mrho       = " << Mrho << "\n Egamma_min = " << Egamma_min
             << std::endl;
         ::abort();
     }
 
     if ( Egamma_min <= 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
             << "\n Bad photon energy cut: Egamma_min <= 0 in the rest frame of B-meson."
             << "\n Egamma_min = " << Egamma_min << std::endl;
         ::abort();
     }
 
     if ( res_swch == 0 || res_swch == 1 ) {
         int i_list;
         for ( i_list = 0; i_list <= 4; i_list++ ) {
             double s;          // mandelstam variable "s";
             double t_minus;    // minimum and maximum of the mandelstam variable "t"
             double t_plus;    // as function of the mandelstam variable "s=q2";
             double t_for_s;
             int ijk;        // counter for variable "t";
             int max_ijk;    // maximal value of this counter;
 
             s = list_of_max_q2_points[i_list];
 
             t_plus = pow( M1, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
             t_plus = t_plus + sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
                                   ( pow( M1, 2.0 ) - s );
             t_plus *= 0.5;
 
             t_minus = pow( M1, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
             t_minus = t_minus - sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
                                     ( pow( M1, 2.0 ) - s );
             t_minus *= 0.5;
 
             if ( fabs( t_plus - t_minus ) < 0.000001 )
                 t_minus = t_plus;
 
             max_ijk = 1000;
             double dt = ( t_plus - t_minus ) / ( (double)max_ijk );
             if ( fabs( dt ) < 0.00001 )
                 dt = 0.0;
 
             if ( dt < 0.0 ) {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
                     << "\n dt      = " << dt << " < 0."
                     << "\n s       = " << s << "\n t_plus  = " << t_plus
                     << "\n t_minus = " << t_minus << "\n M1      = " << M1
                     << "\n ml      = " << ml << std::endl;
                 ::abort();
             }
 
             for ( ijk = 0; ijk <= max_ijk; ijk++ ) {
                 t_for_s = t_minus + dt * ( (double)ijk );
 
                 // B-meson rest frame particles and they kinematics inicialization
                 double Eg, El2;
                 Eg = ( pow( M1, 2.0 ) - s ) / ( 2.0 * M1 );    // photon energy
                 El2 = ( s + t_for_s - pow( ml, 2.0 ) ) /
                       ( 2.0 * M1 );    // ell^- energy
 
                 double modl2;
                 modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
 
                 double cosBellminus;    // angle between the B-meson and ell^- directions
                 cosBellminus = ( pow( ml, 2.0 ) + 2.0 * Eg * El2 - t_for_s ) /
                                ( 2.0 * Eg * modl2 );
 
                 if ( ( fabs( cosBellminus ) > 1.0 ) &&
                      ( fabs( cosBellminus ) <= 1.0001 ) ) {
                     EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
                         << "\n Debug in the function EvtbsTollGammaAmp::CalcMaxProb(...):"
                         << "\n cos(theta) = " << cosBellminus << std::endl;
                     cosBellminus = cosBellminus / fabs( cosBellminus );
                 }
                 if ( fabs( cosBellminus ) > 1.0001 ) {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "\n\n In the function EvtbsTollGammaAmp::CalcMaxProb(...)"
                         << "\n |cos(theta)| = " << fabs( cosBellminus ) << " > 1"
                         << "\n s       = " << s << "\n t_for_s = " << t_for_s
                         << "\n t_plus  = " << t_plus << "\n t_minus = " << t_minus
                         << "\n dt      = " << dt << "\n Eg      = " << Eg
                         << "\n El2     = " << El2 << "\n modl2   = " << modl2
                         << "\n ml      = " << ml << std::endl;
                     ::abort();
                 }
 
                 EvtVector4R p, k, p1, p2;
                 p.set( M1, 0.0, 0.0, 0.0 );
                 k.set( Eg, Eg, 0.0, 0.0 );
                 p2.set( El2, modl2 * cosBellminus,
                         -modl2 * sqrt( 1.0 - pow( cosBellminus, 2.0 ) ), 0.0 );
                 p1 = p - k - p2;
 
                 // B-meson state preparation at the rest frame of B-meson
                 EvtScalarParticle* scalar_part;
                 EvtParticle* root_part;
                 scalar_part = new EvtScalarParticle;
 
                 scalar_part->noLifeTime();
                 scalar_part->init( parnum, p );
                 root_part = (EvtParticle*)scalar_part;
                 root_part->setDiagonalSpinDensity();
 
                 // Amplitude initialization
                 EvtId listdaug[3];
                 listdaug[0] = photnum;
                 listdaug[1] = l1num;
                 listdaug[2] = l2num;
 
                 EvtAmp amp;
                 amp.init( parnum, 3, listdaug );
 
                 // Daughters states preparation at the rest frame of B-meson
                 root_part->makeDaughters( 3, listdaug );
 
                 EvtParticle *gamm, *lep1, *lep2;
                 gamm = root_part->getDaug( 0 );
                 lep1 = root_part->getDaug( 1 );
                 lep2 = root_part->getDaug( 2 );
 
                 gamm->noLifeTime();
                 lep1->noLifeTime();
                 lep2->noLifeTime();
 
                 gamm->init( photnum, k );
                 lep1->init( l1num, p1 );
                 lep2->init( l2num, p2 );
 
                 EvtSpinDensity rho;
                 rho.setDiag( root_part->getSpinStates() );
 
                 // The amplitude calculation at the
                 // "maximum amplitude" kinematical configuration
                 CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf,
                          res_swch, ias, Egamma_min, CKM_A, CKM_lambda,
                          CKM_barrho, CKM_bareta );
 
                 // Now find the probability at this q2 and cos theta lepton point
                 double nikmax = rho.normalizedProb( amp.getSpinDensity() );
 
                 if ( nikmax > maxfoundprob ) {
                     maxfoundprob = nikmax;
                     EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
                         << "\n maxfoundprob ( s =" << s << ",  t = " << t_for_s
                         << " ) = " << maxfoundprob << "\n ijk =" << ijk
                         << std::endl;
                 }
 
                 delete scalar_part;
                 //          delete root_part;
                 delete gamm;
                 delete lep1;
                 delete lep2;
 
             }    // for(ijk=0; ijk<=max_ijk; ijk++)
         }        // i_list - variable loop
     }            // if(res_swch==0||res_swch==1)
     else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function EvtbsTollVectorAmpNew::CalcMaxProb(...)"
             << "\n Unexpected value of the variable res_swch !!!"
             << "\n res_swch = " << res_swch << std::endl;
         ::abort();
     }
 
     if ( maxfoundprob <= 0.0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function EvtbsTollVectorAmpNew::CalcMaxProb(...)"
             << "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
             << "\n res_swch     = " << res_swch << std::endl;
         ::abort();
     }
 
     maxfoundprob *= 1.01;
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen")
     //         << "\n **********************************************************************"
     //         << "\n The function Evtbs2llGammaAmp::CalcMaxProb(...) passed with arguments:"
     //         << "\n mu =" << mu << " Nf =" << Nf
     //         << " res_swch =" << res_swch
     //         << " ias =" << ias
     //         << "\n CKM_A      = " << CKM_A
     //         << " CKM_lambda = " << CKM_lambda
     //         << "\n CKM_barrho = " << CKM_barrho
     //         << " CKM_bareta = " << CKM_bareta
     //         << "\n The distribution maximum maxfoundprob =" << maxfoundprob
     //         << "\n ijk = " << ijk_atmax
     //         << "\n **********************************************************************"
     //         << std::endl;
 
     return maxfoundprob;
 }
 
 // Triangular function
 double Evtbs2llGammaAmp::lambda( double a, double b, double c )
 {
     double l;
 
     l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
         2.0 * a * c - 2.0 * b * c;
 
     return l;
 }
diff --git a/src/EvtGenModels/Evtbs2llGammaISRFSR.cpp b/src/EvtGenModels/Evtbs2llGammaISRFSR.cpp
index e5084cd..dba9a3e 100644
--- a/src/EvtGenModels/Evtbs2llGammaISRFSR.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaISRFSR.cpp
@@ -1,196 +1,196 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/Evtbs2llGammaISRFSR.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
 #include "EvtGenModels/Evtbs2llGammaFFMNT.hh"
 #include "EvtGenModels/Evtbs2llGammaISRFSRAmp.hh"
 
 #include <stdlib.h>
 #include <string.h>
 
 Evtbs2llGammaISRFSR::~Evtbs2llGammaISRFSR()
 {
     delete m_mntffmodel;
     if ( m_calcamp )
         delete m_calcamp;
 }
 
 // The module name specification
-std::string Evtbs2llGammaISRFSR::getName()
+std::string Evtbs2llGammaISRFSR::getName() const
 {
     return "BSTOGLLISRFSR";
 }
 
 // The implementation of the clone() method
-EvtDecayBase* Evtbs2llGammaISRFSR::clone()
+EvtDecayBase* Evtbs2llGammaISRFSR::clone() const
 {
     return new Evtbs2llGammaISRFSR;
 }
 
 // The inicialization of the decay model
 //
 // Tn the our model we have are following 4 arguments:
 //
 //           mu          - the scale parameter, GeV;
 //           Nf          - number of "effective" flavors (for b-quark Nf=5);
 //           sr          - state radiation type:
 //                         = 0 ISR only,
 //                         = 1 FSR only,
 //                         = 2 ISR + FSR (== BSTOGLLMNT model);
 //           res_swch    - resonant switching parametr:
 //                         = 0 the resonant contribution switched OFF,
 //                         = 1 the resonant contribution switched ON;
 //           ias         - switching parametr for \alpha_s(M_Z) value:
 //                         = 0 PDG 1sigma minimal alpha_s(M_Z),
 //                         = 1 PDG average value  alpha_s(M_Z),
 //                         = 2 PDG 1sigma maximal alpha_s(M_Z).
 //	     Egamma_min  - photon energy cut, GeV;
 //           Wolfenstein parameterization for CKM matrix
 //                         CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
 //
 void Evtbs2llGammaISRFSR::init()
 {
     // check that there are 10 arguments
     checkNArg( 10, 11 );
     // check that there are 3 daughteres
     checkNDaug( 3 );
 
     // We expect that the parent to be a scalar (B-meson)
     // and the daughters to be Gamma, l^+ and l^-
     checkSpinParent( EvtSpinType::SCALAR );
 
     // We expect that the first daughter is the photon
     EvtSpinType::spintype photontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     if ( !( photontype == EvtSpinType::PHOTON ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Evtbs2llGammaISRFSR generator expected "
             << " a PHOTON 1st daughter, found:"
             << EvtPDL::name( getDaug( 0 ) ).c_str() << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     // We expect that the second and third daughters
     // are the ell+ and ell- == DIRAC
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
 
     m_mntffmodel = new Evtbs2llGammaFFMNT();
     m_wilscoeff = new EvtbTosllWilsCoeffNLO();
     if ( photontype == EvtSpinType::PHOTON ) {
         m_calcamp = new Evtbs2llGammaISRFSRAmp();
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "The init()-function in the Evtbs2llGammaISRFSR generator:"
             << "The absence in the radiative decay!" << std::endl;
         ::abort();
     }
 }
 
 // Set the maximum probability of the decay
 // differencial distribution d^2\Gamma/d\hat s d\cos\theta
 void Evtbs2llGammaISRFSR::initProbMax()
 {
     double mymaxprob = -10.0;    // maximum of the probability
 
     EvtId parnum, photnum, l1num, l2num;
 
     parnum = getParentId();
     photnum = getDaug( 0 );
     l1num = getDaug( 1 );
     l2num = getDaug( 2 );
 
     double mu = getArg( 0 );            // the scale parameter
     int Nf = (int)getArg( 1 );          // number of "effective" flavors
     int sr = (int)getArg( 2 );          // state radiation type
     int res_swch = (int)getArg( 3 );    // resonant switching parametr
     int ias = (int)getArg( 4 );         // switching parametr for \alpha_s(M_Z)
     double Egamma_min = getArg( 5 );    // photon energy cut
     double CKM_A = getArg( 6 );
     double CKM_lambda = getArg( 7 );
     double CKM_barrho = getArg( 8 );
     double CKM_bareta = getArg( 9 );
     double mumumass_min = 0.;
     if ( getNArg() == 11 )
         mumumass_min = getArg( 10 );
 
     mymaxprob = m_calcamp->CalcMaxProb( parnum, photnum, l1num, l2num,
                                         m_mntffmodel, m_wilscoeff, mu, Nf, sr,
                                         res_swch, ias, Egamma_min, CKM_A,
                                         CKM_lambda, CKM_barrho, CKM_bareta,
                                         mumumass_min );
 
     if ( mymaxprob <= 0.0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "The function void Evtbs2llGammaISRFSR::initProbMax()"
             << "\n Unexpected value of the probability maximum!"
             << "\n mymaxprob = " << mymaxprob << std::endl;
         ::abort();
     }
 
     setProbMax( mymaxprob );
 }
 
 void Evtbs2llGammaISRFSR::decay( EvtParticle* p )
 {
     double mu = getArg( 0 );            // the scale parameter
     int Nf = (int)getArg( 1 );          // number of "effective" flavors
     int sr = (int)getArg( 2 );          // state radiation type
     int res_swch = (int)getArg( 3 );    // resonant switching parametr
     int ias = (int)getArg( 4 );         // switching parametr for \alpha_s(M_Z)
     double Egamma_min = getArg( 5 );    // photon energy cut
     double CKM_A = getArg( 6 );
     double CKM_lambda = getArg( 7 );
     double CKM_barrho = getArg( 8 );
     double CKM_bareta = getArg( 9 );
     double mumumass_min = 0.;
     if ( getNArg() == 11 )
         mumumass_min = getArg( 10 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     // The class "Evtbs2llGammaFFMNT" is the derived class of the
     // class  "Evtbs2llGammaFF" (see the file "Evtbs2llGammaFF.hh")
     m_calcamp->CalcAmp( p, m_amp2, m_mntffmodel, m_wilscoeff, mu, Nf, sr,
                         res_swch, ias, Egamma_min, CKM_A, CKM_lambda,
                         CKM_barrho, CKM_bareta, mumumass_min );
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n "
     //<< "\n The function Evtbs2llGammaISRFSR::decay(...) passed with arguments:"
     //                          << "\n mu = " << mu << " Nf =" << Nf
     //                          << "\n res_swch = " << res_swch
     //                          << "\n sr = " << sr << "\n ias = " << ias
     //		 	              << "\n Egamma_min =" << Egamma_min
     //                          << "\n CKM_A = " << CKM_A
     //                          << "\n CKM_lambda = " << CKM_lambda
     //                          << "\n CKM_barrho = " << CKM_barrho
     //                          << "\n CKM_bareta = " << CKM_bareta
     //                          << "\n "
     //                          << std::endl;
 }
diff --git a/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp b/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
index d2f967f..ec336a8 100644
--- a/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
@@ -1,896 +1,896 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/Evtbs2llGammaISRFSRAmp.hh"
 
 #include "EvtGenBase/EvtAmp.hh"
 #include "EvtGenBase/EvtComplex.hh"
 #include "EvtGenBase/EvtDiracSpinor.hh"
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtId.hh"
 #include "EvtGenBase/EvtIdSet.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 #include "EvtGenBase/EvtScalarParticle.hh"
 #include "EvtGenBase/EvtTensor4C.hh"
 #include "EvtGenBase/EvtVector4C.hh"
 #include "EvtGenBase/EvtVectorParticle.hh"
 
 #include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
 #include "EvtGenModels/Evtbs2llGammaFFMNT.hh"
 
 #include <cstdlib>
 
 // input:   *parent      - the pointer to the parent particle (B-meson, the
 //                                          object of the EvtParticle class);
 //          *formFactors - the pointer to instance of EvtbTosllGammaFF class object;
 //          *WilsCoeff   - the pointer to the Standart Model Wilson Coefficients class;
 //           mu          - the scale parameter, GeV;
 //           Nf          - number of "effective" flavors (for b-quark Nf=5);
 //           sr          - state radiation type:
 //                         = 0 the ISR only,
 //                         = 1 the FSR only,
 //                         = 2 both ISR + FSR (== BSTOGLLMNT model);
 //           res_swch    - resonant switching parameter:
 //                         = 0 the resonant contribution switched OFF,
 //                         = 1 the resonant contribution switched ON;
 //           ias         - switching parameter for \alpha_s(M_Z) value:
 //                         = 0 PDG 1sigma minimal alpha_s(M_Z),
 //                         = 1 PDG average value  alpha_s(M_Z),
 //                         = 2 PDG 1sigma maximal alpha_s(M_Z).
 //           Egamma_min  - photon energy cut, GeV;
 //           Wolfenstein parameterization for CKM matrix
 //                         CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
 
 void Evtbs2llGammaISRFSRAmp::CalcAmp( EvtParticle* parent, EvtAmp& amp,
                                       Evtbs2llGammaFF* formFactors,
                                       EvtbTosllWilsCoeffNLO* WilsCoeff,
                                       double mu, int Nf, int sr, int res_swch,
                                       int ias, double Egamma_min, double CKM_A,
                                       double CKM_lambda, double CKM_barrho,
                                       double CKM_bareta, double mumumass_min )
 {
     //  FILE *mytest;
 
     int iG = 0;    // photon is the first daughter particle
     int il1 = 1,
         il2 = 2;    // leptons are the second and thirds daughter particles
 
     EvtComplex unit1( 1.0, 0.0 );    // real unit
     EvtComplex uniti( 0.0, 1.0 );    // imaginary unit
 
     double M1 = parent->mass();                    // B - meson mass, GeV
     double ml = parent->getDaug( il1 )->mass();    // leptonic mass, GeV
     double mq = 0.0;    // light quark mass from the dispersion QM, GeV
     double mc = formFactors->getQuarkMass(
         4 );    // m_c mass from the dispersion QM, GeV
     double mb = formFactors->getQuarkMass(
         5 );               // m_b mass from the dispersion QM, GeV
     double Mw = 80.403;    // GeV W-boson mass, GeV
     double mt = 174.2;     // GeV t-quark mass, GeV
     double fb = 0.0;       // leptonic decay constant of B-meson, Gev
 
     EvtComplex Vtb, Vtq, Vub, Vuq, Vcb,
         Vcq;                  // V_{tb}, V_{tq}, V_{ub}, V_{uq}, V_{cb}, V_{cq}
     EvtComplex CKM_factor;    // V^*_{tq}*V_{tb}, where q={d,s}
     EvtComplex lambda_qu;     // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}, where q={d,s}
     EvtComplex lambda_qc;     // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}, where q={d,s}
     double Relambda_qu, Imlambda_qu;
 
     // to find charges of ell^+ and ell^- in the B-meson  daughters
     int charge1 = EvtPDL::chg3( parent->getDaug( il1 )->getId() );
     int charge2 = EvtPDL::chg3( parent->getDaug( il2 )->getId() );
     if ( charge1 == 0 || charge2 == 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n The function EvtbsTollGammaAmp::CalcAmp(...)"
             << "\n Error in the leptonic charge getting!"
             << "\n charge1             =" << charge1
             << "\n charge2             =" << charge2 << "\n charge gamma        ="
             << EvtPDL::chg3( parent->getDaug( iG )->getId() )
             << "\n number of daughters =" << parent->getNDaug() << std::endl;
         ::abort();
     }
 
     EvtParticle* lepPlus = nullptr;
     EvtParticle* lepMinus = nullptr;
 
     lepPlus = ( charge1 > charge2 )
                   ? parent->getDaug( il1 )
                   : parent->getDaug( il2 );    // positive charged
     lepMinus = ( charge1 < charge2 )
                    ? parent->getDaug( il1 )
                    : parent->getDaug( il2 );    // negative charged
 
     EvtVector4R p = parent->getP4Restframe();    // B-meson momentum in the B-rest frame
     EvtVector4R k =
         parent->getDaug( iG )->getP4();    // 4-momentum of photon in the B-rest frame
     EvtVector4R q = p - k;    // transition 4-momentum q=p-k in the B-rest frame
     EvtVector4R p_1;          // 4-momentum of ell^+ in the B-rest frame
     EvtVector4R p_2;          // 4-momentum of ell^- in the B-rest frame
 
     // the preparation of the leptonic 4-momentums in the B-rest frame
     if ( charge1 > charge2 ) {
         p_1 = parent->getDaug( il1 )->getP4();
         p_2 = parent->getDaug( il2 )->getP4();
     } else {
         p_1 = parent->getDaug( il2 )->getP4();
         p_2 = parent->getDaug( il1 )->getP4();
     }
 
     EvtVector4R p_minus_p_1 =
         p - p_1;    // transition momentum of the B-meson and antilepton p-p_1
     EvtVector4R p_minus_p_2 =
         p - p_2;    // transition momentum of the B-meson and lepton p-p_2
 
     double q2 = q.mass2();             // Mandelstam variable s=q^2
     double p2 = p.mass2();             // p^2=M1^2
     double t = p_minus_p_1.mass2();    // Mandelstam variable t=(p-p_1)^2
     double u = p_minus_p_2.mass2();    // Mandelstam variable u=(p-p_2)^2
 
     // scalar products
     double pk = 0.5 * ( p2 - q2 );                // (p*k)
     double p1k = 0.5 * ( pow( ml, 2.0 ) - u );    // (p1*k)
     double p2k = 0.5 * ( pow( ml, 2.0 ) - t );    // (p2*k)
 
     double hatq2 = q2 / ( M1 * M1 );    // \hat s = q^2/M_1^2
     double Egam = 0.5 * M1 *
                   ( 1 - hatq2 );    // photon energy in the B-meson rest frame
 
     EvtVector4R hatp = p / M1;
     EvtVector4R hatk = k / M1;
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen")
     //         << "\n\n The function EvtbsTollGammaISRFSRAmp::CalcAmp(...)"
     //         << "\n q =  p-k  =" << p-k     << "   q^2 = " << (p-k).mass2()
     //         << "\n q = p1+p2 =" << p_1+p_2 << "   q^2 = " << (p_1+p_2).mass2()
     //         << "\n m_ell     =" << parent->getDaug(il1)->mass()
     //         << "\n m_ell     =" << parent->getDaug(il2)->mass()
     //         << "\n m_gamma   =" << parent->getDaug(iG)->mass()
     //         << std::endl;
 
     EvtId idparent = parent->getId();    // B-meson Id
 
     if ( idparent == EvtPDL::getId( std::string( "B_s0" ) ) ||
          idparent == EvtPDL::getId( std::string( "anti-B_s0" ) ) ) {
         mq = formFactors->getQuarkMass( 3 );    // m_s mass from the dispersion QM
         fb = 0.24;                              // leptonic decay constant
             // V_{ts}
         Vtq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) +
               pow( CKM_lambda, 2.0 ) *
                   ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
                   sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
         Vtq = -CKM_A * pow( CKM_lambda, 2.0 ) * Vtq;
         // V_{us}
         Vuq = CKM_lambda * unit1;
         // V_{cs}
         Vcq = unit1 - 0.5 * pow( CKM_lambda, 2.0 ) -
               0.125 * pow( CKM_lambda, 4.0 ) * ( 1.0 + 4.0 * pow( CKM_A, 2.0 ) );
     }
 
     if ( idparent == EvtPDL::getId( std::string( "B0" ) ) ||
          idparent == EvtPDL::getId( std::string( "anti-B0" ) ) ) {
         mq = formFactors->getQuarkMass( 2 );    // m_d mass from the dispersion QM
         fb = 0.20;                              // leptonic decay constant
             // V_{td}
         Vtq = unit1 - ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) ) *
                           ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
                           sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );
         Vtq = CKM_A * pow( CKM_lambda, 3.0 ) * Vtq;
         // V_{ud}
         Vuq = unit1 * ( 1.0 - 0.5 * pow( CKM_lambda, 2.0 ) -
                         0.125 * pow( CKM_lambda, 4.0 ) );
         // V_{cd}
         Vcq = unit1 *
               ( -CKM_lambda +
                 0.5 * pow( CKM_A, 2.0 ) * pow( CKM_lambda, 5.0 ) *
                     ( 1.0 - 2.0 * ( CKM_barrho * unit1 + CKM_bareta * uniti ) /
                                 sqrt( 1.0 - pow( CKM_lambda, 2.0 ) ) ) );
     }
 
     if ( mq < 0.001 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n The function EvtbsTollGammaISRFSRAmp::CalcAmp(..// 4-momentum of ell^+.)"
             << "\n Error in the model set!"
             << " mq = " << mq << std::endl;
         ::abort();
     }
 
     Vtb = unit1 * ( 1.0 - 0.5 * pow( CKM_A * CKM_lambda * CKM_lambda,
                                      2.0 ) );    // V_{tb}
     Vub = CKM_A * pow( CKM_lambda, 3.0 ) *
           ( CKM_barrho * unit1 - CKM_bareta * uniti ) /
           sqrt( 1.0 - pow( CKM_lambda, 2.0 ) );      // V_{ub}
     Vcb = unit1 * CKM_A * pow( CKM_lambda, 2.0 );    // V_{cb}
 
     CKM_factor = conj( Vtq ) * Vtb;    // V^*_{tq}*V_{tb}
 
     lambda_qu = conj( Vuq ) * Vub /
                 CKM_factor;    // V^*_{uq}*V_{ub}/V^*_{tq}*V_{tb}
     Relambda_qu = real( lambda_qu );
     Imlambda_qu = imag( lambda_qu );
 
     lambda_qc = conj( Vcq ) * Vcb /
                 CKM_factor;    // V^*_{cq}*V_{cb}/V^*_{tq}*V_{tb}
 
     // The Wilson Coefficients preparation according to the paper
     // A.J.Buras, M.Munz, Phys.Rev.D52, p.189 (1995)
     double c1, c2;
     EvtComplex a1, c7gam, c9eff_b2q, c9eff_barb2barq, c10a;
 
     // foton energy cut and removal of the J/psi amd psi' resonant area
     if ( Egam < Egamma_min || ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ||
          ( q2 <= mumumass_min * mumumass_min ) ) {
         c1 = 0.0;
         c2 = 0.0;
         a1 = unit1 * 0.0;
         c7gam = unit1 * 0.0;
         c9eff_b2q = unit1 * 0.0;
         c9eff_barb2barq = unit1 * 0.0;
         c10a = unit1 * 0.0;
     } else {
         c1 = WilsCoeff->C1( mu, Mw, Nf, ias );
         c2 = WilsCoeff->C2( mu, Mw, Nf, ias );
         a1 = unit1 * ( c1 + c2 / 3.0 );
         c7gam = WilsCoeff->GetC7Eff( mu, Mw, mt, Nf, ias );
         c9eff_b2q = WilsCoeff->GetC9Eff( 0, res_swch, ias, Nf, q2, mb, mq, mc, mu,
                                          mt, Mw, ml, Relambda_qu, Imlambda_qu );
         c9eff_barb2barq = WilsCoeff->GetC9Eff( 1, res_swch, ias, Nf, q2, mb, mq,
                                                mc, mu, mt, Mw, ml, Relambda_qu,
                                                Imlambda_qu );
         c10a = WilsCoeff->GetC10Eff( mt, Mw );
     }
 
     EvtComplex Fv,
         Fa;    // The change of the sign is included in the amplitudes definition!
     EvtComplex Ftv_b2q, Ftv_barb2barq;
     EvtComplex Fta_b2q, Fta_barb2barq;
 
     // foton energy cut and removal of the J/psi amd psi' resonant area
     if ( Egam < Egamma_min || ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ||
          ( q2 <= mumumass_min * mumumass_min ) ) {
         fb = 0.0;
         Fa = unit1 * 0.0;
         Fv = unit1 * 0.0;
         Fta_b2q = unit1 * 0.0;
         Fta_barb2barq = unit1 * 0.0;
         Ftv_b2q = unit1 * 0.0;
         Ftv_barb2barq = unit1 * 0.0;
     } else {
         if ( fb < 0.01 ) {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "\n\n The function EvtbsTollGammaISRFSRAmp::CalcAmp(...)"
                 << "\n Leptonic decay constant fb is not uninitialized in this function!"
                 << " fb = " << fb << std::endl;
             ::abort();
         }
 
         // For \bar B^0_q -> l^+ l^- gamma
         formFactors->getPhotonFF( 0, fb, parent->getId(), q2, M1, mb, mq, c7gam,
                                   a1, lambda_qu, lambda_qc, Fv, Fa, Ftv_b2q,
                                   Fta_b2q );
 
         // For B^0_q -> l^+ l^- gamma
         formFactors->getPhotonFF( 1, fb, parent->getId(), q2, M1, mb, mq, c7gam,
                                   a1, lambda_qu, lambda_qc, Fv, Fa,
                                   Ftv_barb2barq, Fta_barb2barq );
     }
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen")
     //      << "\n ============================================================================"
     //      << "\n ============================================================================"
     //      << "\n\n The function Evtbs2llGammaISRFSRAmp::CalcAmp(...) passed."
     //      << "\n Particle masses:"
     //      << "\n B - meson mass M1 = " << M1
     //      << "\n photon minimum E  = " << Egamma_min
     //      << "\n q2                = " << q2
     //      << "\n leptonic mass  ml = " << ml
     //      << "\n light quark mass  = " << mq
     //      << "\n c - quark mass mc = " << mc
     //      << "\n b - quark mass mb = " << mb
     //      << "\n t - quark mass mt = " << mt
     //      << "\n W - boson mass Mw = " << Mw
     //      << "\n ============================================================================"
     //      << "\n Input parameters:"
     //      << "\n scale parameter         mu = " << mu
     //      << "\n number of flavors       Nf = " << Nf
     //      << "\n state radiation switching  = " << sr
     //      << "\n resonant switching         = " << res_swch
     //      << "\n parameter for alpha_s(M_Z) = " << ias
     //      << "\n photon energy cut (GeV)    = " << Egamma_min
     //      << "\n ============================================================================"
     //      << "\n Form-factors"
     //      << "\n Egam          = " << Egam
     //      << "\n Egamma_min    = " << Egamma_min
     //      << "\n Fv            = " << Fv
     //      << "\n Fa            = " << Fa
     //      << "\n Ftv_b2q       = " << Ftv_b2q
     //      << "\n Fta_b2q       = " << Fta_b2q
     //      << "\n Ftv_barb2barq = " << Ftv_barb2barq
     //      << "\n Fta_barb2barq = " << Fta_barb2barq
     //      << "\n ============================================================================"
     //      << "\n Wilson Coefficients:"
     //      << "\n Egam                = " << Egam
     //      << "\n Egamma_min          = " << Egamma_min
     //      << "\n Re(c7gam)           = " << real(c7gam)
     //        << " Im(c7gam)           = " << imag(c7gam)
     //      << "\n Re(c9eff_b2q)       = " << real(c9eff_b2q)
     //        << " Im(c9eff_b2q)       = " << imag(c9eff_b2q)
     //      << "\n Re(c9eff_barb2barq) = " << real(c9eff_barb2barq)
     //        << " Im(c9eff_barb2barq) = " << imag(c9eff_barb2barq)
     //      << "\n Re(c10a)            = " << real(c10a)
     //        << " Im(c10a)            = " << imag(c10a)
     //      << std::endl;
 
     // Hadronic matrix element coefficients
     EvtComplex a_b2q, a_barb2barq, b_b2q, b_barb2barq, e_b2q, e_barb2barq,
         f_b2q, f_barb2barq;
     EvtComplex brammS, brammT;
 
     a_b2q = c9eff_b2q * Fv + 2.0 * c7gam * Ftv_b2q * mb * M1 / q2;
     a_barb2barq = c9eff_barb2barq * Fv +
                   2.0 * c7gam * Ftv_barb2barq * mb * M1 / q2;
 
     b_b2q = ( c9eff_b2q * Fa + 2.0 * c7gam * Fta_b2q * mb * M1 / q2 ) * pk /
             ( M1 * M1 );
     b_barb2barq = ( c9eff_barb2barq * Fa +
                     2.0 * c7gam * Fta_barb2barq * mb * M1 / q2 ) *
                   pk / ( M1 * M1 );
 
     e_b2q = c10a * Fv;
     e_barb2barq = e_b2q;
 
     f_b2q = c10a * Fa * pk / ( M1 * M1 );
     f_barb2barq = f_b2q;
 
     brammS = 0.0;    // in the Bq-meson rest frame!
     brammT = 0.5 * c10a * ml * fb *
              ( 1.0 / p2k + 1.0 / p1k );    // for Bramsstrahlung
 
     // The separation of the ISR and FSR contributions
     if ( sr == 0 ) {    // ISR only
         brammS = 0.0;
         brammT = 0.0;
     }
     if ( sr == 1 ) {    // FSR only
         a_b2q = 0.0;
         a_barb2barq = 0.0;
         b_b2q = 0.0;
         b_barb2barq = 0.0;
         e_b2q = 0.0;
         e_barb2barq = 0.0;
         f_b2q = 0.0;
         f_barb2barq = 0.0;
     }
 
     EvtTensor4C T1, T2;    // hadronic matrix element tensor structures
     EvtVector4C E1, E2;
     EvtComplex E3;
 
     int i;    // photon polarisations counter
 
     EvtVector4C lvc11, lvc12;    // spin structures for
     EvtVector4C lvc21, lvc22;    // the leptonic vector current
 
     EvtVector4C lac11, lac12;    // spin structures for
     EvtVector4C lac21, lac22;    // the leptonic axial current
 
     EvtComplex lsc11, lsc12;    // spin structures for
     EvtComplex lsc21, lsc22;    // the leptonic scalar current
 
     EvtTensor4C ltc11, ltc12;    // spin structures for
     EvtTensor4C ltc21, ltc22;    // the leptonic tensor current
 
     // B - and barB - mesons descriptors
-    static EvtIdSet bmesons{ "anti-B0", "anti-B_s0" };
-    static EvtIdSet bbarmesons{ "B0", "B_s0" };
+    static const EvtIdSet bmesons{ "anti-B0", "anti-B_s0" };
+    static const EvtIdSet bbarmesons{ "B0", "B_s0" };
 
     EvtId parentID = parent->getId();
 
     if ( bmesons.contains( parentID ) ) {
         // The amplitude for the decay barB -> gamma ell^+ ell^-  or
         // b \bar q -> gamma ell^+ ell^-
 
         T1 = -a_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
              b_b2q * uniti * EvtTensor4C::g();
 
         T2 = -e_b2q * unit1 * dual( EvtGenFunctions::directProd( hatp, hatk ) ) -
              f_b2q * uniti * EvtTensor4C::g();
 
         // spin combinations for vector lepton current
         lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 0 ) );
         lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 0 ) );
         lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 1 ) );
         lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 1 ) );
 
         lac11 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 0 ) );
         lac21 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 0 ) );
         lac12 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 1 ) );
         lac22 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 1 ) );
 
         lsc11 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 0 ) );
         lsc21 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 0 ) );
         lsc12 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
                                    lepMinus->spParent( 1 ) );
         lsc22 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
                                    lepMinus->spParent( 1 ) );
 
         // \epsilon^{\alpha\beta\mu\nu}*TCurrent_{\mu\nu}
         ltc11 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
                                          lepMinus->spParent( 0 ) ) );
         ltc21 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
                                          lepMinus->spParent( 0 ) ) );
         ltc12 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
                                          lepMinus->spParent( 1 ) ) );
         ltc22 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
                                          lepMinus->spParent( 1 ) ) );
 
         // summing up photon polarisations
         for ( i = 0; i < 2; i++ ) {
             // conjaction of epsG (photon polarization vector)
             EvtVector4C epsG = parent->getDaug( 0 )->epsParentPhoton( i ).conj();
 
             // de-escalation T with epsG
             E1 = T1.cont2( epsG );
             E2 = T2.cont2( epsG );
             E3 = ( epsG * hatp ) * brammS;
 
             // foton energy cut and removal of the J/psi amd psi' resonant area
             if ( Egam < Egamma_min ||
                  ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ||
                  ( q2 <= mumumass_min * mumumass_min ) ) {
                 CKM_factor = 0.0 * unit1;
             }
 
             // 1
             amp.vertex( i, 0, 0,
                         CKM_factor *
                             ( lvc11 * E1 + lac11 * E2 + uniti * lsc11 * E3 +
                               uniti * ( ( ltc11.cont2( hatp ) ) * epsG ) *
                                   brammT ) );
             //      EvtGenReport(EVTGEN_NOTICE,"EvtGen")
             //        << "\n 1" << CKM_factor*(lvc11*E1+lac11*E2+uniti*lsc11*E3+uniti*((ltc11.cont2(hatp))*epsG)*brammT)
             //        << std::endl;
 
             // 2
             amp.vertex( i, 0, 1,
                         CKM_factor *
                             ( lvc12 * E1 + lac12 * E2 + uniti * lsc12 * E3 +
                               uniti * ( ( ltc12.cont2( hatp ) ) * epsG ) *
                                   brammT ) );
             //      EvtGenReport(EVTGEN_NOTICE,"EvtGen")
             //        << "\n 2" << CKM_factor*(lvc12*E1+lac12*E2+uniti*lsc12*E3+uniti*((ltc12.cont2(hatp))*epsG)*brammT)
             //        << std::endl;
 
             // 3
             amp.vertex( i, 1, 0,
                         CKM_factor *
                             ( lvc21 * E1 + lac21 * E2 + uniti * lsc21 * E3 +
                               uniti * ( ( ltc21.cont2( hatp ) ) * epsG ) *
                                   brammT ) );
             //      EvtGenReport(EVTGEN_NOTICE,"EvtGen")
             //        << "\n 3" << CKM_factor*(lvc21*E1+lac21*E2+uniti*lsc21*E3+uniti*((ltc21.cont2(hatp))*epsG)*brammT)
             //        << std::endl;
 
             // 4
             amp.vertex( i, 1, 1,
                         CKM_factor *
                             ( lvc22 * E1 + lac22 * E2 + uniti * lsc22 * E3 +
                               uniti * ( ( ltc22.cont2( hatp ) ) * epsG ) *
                                   brammT ) );
             //      EvtGenReport(EVTGEN_NOTICE,"EvtGen")
             //        << "\n 4" << CKM_factor*(lvc22*E1+lac22*E2+uniti*lsc22*E3+uniti*((ltc22.cont2(hatp))*epsG)*brammT)
             //        << std::endl;
         }
 
     } else {
         if ( bbarmesons.contains( parentID ) ) {
             // The amplitude for the decay B -> gamma ell^+ ell^- or
             // q bar b -> gamma ell^+ ell^-
 
             T1 = -a_barb2barq * unit1 *
                      dual( EvtGenFunctions::directProd( hatp, hatk ) ) +
                  b_barb2barq * uniti * EvtTensor4C::g();
 
             T2 = -e_barb2barq * unit1 *
                      dual( EvtGenFunctions::directProd( hatp, hatk ) ) +
                  f_barb2barq * uniti * EvtTensor4C::g();
 
             lvc11 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 1 ) );
             lvc21 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 1 ) );
             lvc12 = EvtLeptonVCurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 0 ) );
             lvc22 = EvtLeptonVCurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 0 ) );
 
             lac11 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 1 ) );
             lac21 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 1 ) );
             lac12 = EvtLeptonACurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 0 ) );
             lac22 = EvtLeptonACurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 0 ) );
 
             lsc11 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 1 ) );
             lsc21 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 1 ) );
             lsc12 = EvtLeptonSCurrent( lepPlus->spParent( 1 ),
                                        lepMinus->spParent( 0 ) );
             lsc22 = EvtLeptonSCurrent( lepPlus->spParent( 0 ),
                                        lepMinus->spParent( 0 ) );
 
             // \epsilon^{\alpha\beta\mu\nu}*TCurrent_{\mu\nu}
             ltc11 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
                                              lepMinus->spParent( 1 ) ) );
             ltc21 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
                                              lepMinus->spParent( 1 ) ) );
             ltc12 = dual( EvtLeptonTCurrent( lepPlus->spParent( 1 ),
                                              lepMinus->spParent( 0 ) ) );
             ltc22 = dual( EvtLeptonTCurrent( lepPlus->spParent( 0 ),
                                              lepMinus->spParent( 0 ) ) );
 
             // summing up photon polarisations
             for ( i = 0; i < 2; i++ ) {
                 EvtVector4C barepsG = parent->getDaug( 0 )->epsParentPhoton( i );
 
                 E1 = T1.cont2( barepsG );
                 E2 = T2.cont2( barepsG );
                 E3 = ( barepsG * hatp ) * brammS;
 
                 // foton energy cut and removal of the J/psi amd psi' resonant area
                 if ( Egam < Egamma_min ||
                      ( res_swch == 1 && q2 >= 9.199 && q2 <= 15.333 ) ||
                      ( q2 <= mumumass_min * mumumass_min ) ) {
                     CKM_factor = 0.0 * unit1;
                 }
 
                 amp.vertex( i, 1, 1,
                             conj( CKM_factor ) *
                                 ( lvc11 * E1 + lac11 * E2 +
                                   uniti * lsc11 * E3 +    // -?
                                   uniti * ( ( ltc11.cont2( hatp ) ) * barepsG ) *
                                       brammT ) );
                 amp.vertex( i, 1, 0,
                             conj( CKM_factor ) *
                                 ( lvc12 * E1 + lac12 * E2 +
                                   uniti * lsc12 * E3 +    // -?
                                   uniti * ( ( ltc12.cont2( hatp ) ) * barepsG ) *
                                       brammT ) );
                 amp.vertex( i, 0, 1,
                             conj( CKM_factor ) *
                                 ( lvc21 * E1 + lac21 * E2 +
                                   uniti * lsc21 * E3 +    // -?
                                   uniti * ( ( ltc21.cont2( hatp ) ) * barepsG ) *
                                       brammT ) );
                 amp.vertex( i, 0, 0,
                             conj( CKM_factor ) *
                                 ( lvc22 * E1 + lac22 * E2 +
                                   uniti * lsc22 * E3 +    // -?
                                   uniti * ( ( ltc22.cont2( hatp ) ) * barepsG ) *
                                       brammT ) );
             }
 
         } else {
             EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                 << "\n\n The function Evtbs2llGammaISRFSRAmp::CalcAmp(...)"
                 << "\n Wrong B-meson number" << std::endl;
             ::abort();
         }
     }
 }
 
 //
 // The decays B -> Gamma ell^+ ell^- maximum probability calculation for the
 // d^2\Gamma/dq^2 d\cos\theta distribution.
 //
 // \theta - the angle between the photon and ell^- directions in the
 //          B-meson rest frame.
 //
 // If ias=0 (nonresonant case), the maximum is achieved at q2
 //           B0s:                q2 = 4*ml^2, Mphi^2, q_max^2;
 //           B0d:                q2 = 4*ml^2, Mrho^2, Momega^2, q_max^2;
 // If ias=1 (resonant case), the maximum in the same points, because the
 //          resonat area is remove
 //
 double Evtbs2llGammaISRFSRAmp::CalcMaxProb(
     EvtId parnum, EvtId photnum, EvtId l1num, EvtId l2num,
     Evtbs2llGammaFF* formFactors, EvtbTosllWilsCoeffNLO* WilsCoeff, double mu,
     int Nf, int sr, int res_swch, int ias, double Egamma_min, double CKM_A,
     double CKM_lambda, double CKM_barrho, double CKM_bareta, double mumumass_min )
 {
     double maxfoundprob = -100.0;    // maximum of the probability
 
     double M1 = EvtPDL::getMeanMass( parnum );    // B - meson mass
     double ml = EvtPDL::getMeanMass( l1num );     // leptonic mass
 
     double Mrho = EvtPDL::getMeanMass(
         EvtPDL::getId( std::string( "rho0" ) ) );    // mass of the rho-meson, MeV
     double Momega = EvtPDL::getMeanMass( EvtPDL::getId(
         std::string( "omega" ) ) );    // mass of the omega-meson, MeV
     double Mphi = EvtPDL::getMeanMass(
         EvtPDL::getId( std::string( "phi" ) ) );    // mass of the phi-meson, MeV
 
     // EvtGenReport(EVTGEN_NOTICE,"EvtGen")
     //   << "\n M1         = " << M1
     //   << "\n ml         = " << ml
     //   << "\n Mrho       = " << Mrho
     //   << "\n Momega     = " << Momega
     //   << "\n Mphi       = " << Mphi
     //   << "\n Egamma_min = " << Egamma_min
     //   << std::endl;
 
     double list_of_max_q2_points[5];
     list_of_max_q2_points[0] = pow( 2.0 * ml, 2.0 );
     list_of_max_q2_points[1] = pow( Mrho, 2.0 );
     list_of_max_q2_points[2] = pow( Momega, 2.0 );
     list_of_max_q2_points[3] = pow( Mphi, 2.0 );
     list_of_max_q2_points[4] =
         pow( M1, 2.0 ) - 2.0 * M1 * Egamma_min;    // q^2_max at photon energy cut
 
     //  if(list_of_max_points[4]<0){
     //     EvtGenReport(EVTGEN_ERROR,"EvtGen")
     //       << "\n\n In the function EvtbsTollGammaAmp::CalcScalarMaxProb(...)"
     //       << "\n Bad photon energy cut: Egamma_min > M1 in the rest frame of B-meson!"
     //       << "\n q2_max     = " << list_of_max_points[4]
     //       << "\n M1         = " << M1
     //       << "\n Egamma_min = " << Egamma_min
     //       << std::endl;
     //  ::abort();
     //  }
 
     if ( Egamma_min > Mrho ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
             << "\n Bad photon energy cut: Egamma_min > M_rho0 in the rest frame of B-meson."
             << "\n Mrho       = " << Mrho << "\n Egamma_min = " << Egamma_min
             << std::endl;
         ::abort();
     }
 
     if ( Egamma_min <= 0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
             << "\n Bad photon energy cut: Egamma_min <= 0 in the rest frame of B-meson."
             << "\n Egamma_min = " << Egamma_min << std::endl;
         ::abort();
     }
 
     if ( res_swch == 0 || res_swch == 1 ) {
         int i_list;
         for ( i_list = 0; i_list <= 4; i_list++ ) {
             double s;          // mandelstam variable "s";
             double t_minus;    // minimum and maximum of the mandelstam variable "t"
             double t_plus;    // as function of the mandelstam variable "s=q2";
             double t_for_s;
             int ijk;        // counter for variable "t";
             int max_ijk;    // maximal value of this counter;
 
             s = list_of_max_q2_points[i_list];
 
             t_plus = pow( M1, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
             t_plus = t_plus + sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
                                   ( pow( M1, 2.0 ) - s );
             t_plus *= 0.5;
 
             t_minus = pow( M1, 2.0 ) + 2.0 * pow( ml, 2.0 ) - s;
             t_minus = t_minus - sqrt( 1.0 - 4.0 * pow( ml, 2.0 ) / s ) *
                                     ( pow( M1, 2.0 ) - s );
             t_minus *= 0.5;
 
             if ( fabs( t_plus - t_minus ) < 0.000001 )
                 t_minus = t_plus;
 
             max_ijk = 1000;
             double dt = ( t_plus - t_minus ) / ( (double)max_ijk );
             if ( fabs( dt ) < 0.00001 )
                 dt = 0.0;
 
             if ( dt < 0.0 ) {
                 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                     << "\n\n In the function EvtbsTollGammaISRFSRAmp::CalcScalarMaxProb(...)"
                     << "\n dt      = " << dt << " < 0."
                     << "\n s       = " << s << "\n t_plus  = " << t_plus
                     << "\n t_minus = " << t_minus << "\n M1      = " << M1
                     << "\n ml      = " << ml << std::endl;
                 ::abort();
             }
 
             for ( ijk = 0; ijk <= max_ijk; ijk++ ) {
                 t_for_s = t_minus + dt * ( (double)ijk );
 
                 // B-meson rest frame particles and they kinematics inicialization
                 double Eg, El2;
                 Eg = ( pow( M1, 2.0 ) - s ) / ( 2.0 * M1 );    // photon energy
                 El2 = ( s + t_for_s - pow( ml, 2.0 ) ) /
                       ( 2.0 * M1 );    // ell^- energy
 
                 double modl2;
                 modl2 = sqrt( pow( El2, 2.0 ) - pow( ml, 2.0 ) );
 
                 double cosBellminus;    // angle between the B-meson and ell^- directions
                 cosBellminus = ( pow( ml, 2.0 ) + 2.0 * Eg * El2 - t_for_s ) /
                                ( 2.0 * Eg * modl2 );
 
                 if ( ( fabs( cosBellminus ) > 1.0 ) &&
                      ( fabs( cosBellminus ) <= 1.0001 ) ) {
                     EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
                         << "\n Debug in the function EvtbsTollGammaISRFSRAmp::CalcMaxProb(...):"
                         << "\n cos(theta) = " << cosBellminus << std::endl;
                     cosBellminus = cosBellminus / fabs( cosBellminus );
                 }
                 if ( fabs( cosBellminus ) > 1.0001 ) {
                     EvtGenReport( EVTGEN_ERROR, "EvtGen" )
                         << "\n\n In the function EvtbsTollGammaISRFSRAmp::CalcMaxProb(...)"
                         << "\n |cos(theta)| = " << fabs( cosBellminus ) << " > 1"
                         << "\n s       = " << s << "\n t_for_s = " << t_for_s
                         << "\n t_plus  = " << t_plus << "\n t_minus = " << t_minus
                         << "\n dt      = " << dt << "\n Eg      = " << Eg
                         << "\n El2     = " << El2 << "\n modl2   = " << modl2
                         << "\n ml      = " << ml << std::endl;
                     ::abort();
                 }
 
                 EvtVector4R p, k, p1, p2;
                 p.set( M1, 0.0, 0.0, 0.0 );
                 k.set( Eg, Eg, 0.0, 0.0 );
                 p2.set( El2, modl2 * cosBellminus,
                         -modl2 * sqrt( 1.0 - pow( cosBellminus, 2.0 ) ), 0.0 );
                 p1 = p - k - p2;
 
                 // B-meson state preparation at the rest frame of B-meson
                 EvtScalarParticle* scalar_part;
                 EvtParticle* root_part;
                 scalar_part = new EvtScalarParticle;
 
                 scalar_part->noLifeTime();
                 scalar_part->init( parnum, p );
                 root_part = (EvtParticle*)scalar_part;
                 root_part->setDiagonalSpinDensity();
 
                 // Amplitude initialization
                 EvtId listdaug[3];
                 listdaug[0] = photnum;
                 listdaug[1] = l1num;
                 listdaug[2] = l2num;
 
                 EvtAmp amp;
                 amp.init( parnum, 3, listdaug );
 
                 // Daughters states preparation at the rest frame of B-meson
                 root_part->makeDaughters( 3, listdaug );
 
                 EvtParticle *gamm, *lep1, *lep2;
                 gamm = root_part->getDaug( 0 );
                 lep1 = root_part->getDaug( 1 );
                 lep2 = root_part->getDaug( 2 );
 
                 gamm->noLifeTime();
                 lep1->noLifeTime();
                 lep2->noLifeTime();
 
                 gamm->init( photnum, k );
                 lep1->init( l1num, p1 );
                 lep2->init( l2num, p2 );
 
                 EvtSpinDensity rho;
                 rho.setDiag( root_part->getSpinStates() );
 
                 // The amplitude calculation at the
                 // "maximum amplitude" kinematical configuration
                 CalcAmp( root_part, amp, formFactors, WilsCoeff, mu, Nf, sr,
                          res_swch, ias, Egamma_min, CKM_A, CKM_lambda,
                          CKM_barrho, CKM_bareta, mumumass_min );
 
                 // Now find the probability at this q2 and cos theta lepton point
                 double nikmax = rho.normalizedProb( amp.getSpinDensity() );
 
                 if ( nikmax > maxfoundprob ) {
                     double maxfoundprob_old;
                     maxfoundprob_old = maxfoundprob;
                     maxfoundprob = nikmax;
                     EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
                         << "\n maxfoundprob ( s =" << s << ",  t = " << t_for_s
                         << " ) = " << maxfoundprob
                         << "\n maxfoundprob_old = " << maxfoundprob_old
                         << "\n ijk =" << ijk << std::endl;
                 }
 
                 delete scalar_part;
                 //          delete root_part;
                 delete gamm;
                 delete lep1;
                 delete lep2;
 
             }    // for(ijk=0; ijk<=max_ijk; ijk++)
         }        // i_list - variable loop
     }            // if(res_swch==0||res_swch==1)
     else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
             << "\n Unexpected value of the variable res_swch !!!"
             << "\n res_swch = " << res_swch << std::endl;
         ::abort();
     }
 
     if ( maxfoundprob < 0.0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
             << "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
             << "\n mu =" << mu << " Nf =" << Nf << "\n sr =" << sr
             << " res_swch =" << res_swch << " ias =" << ias
             << "\n Egamma_min =" << Egamma_min << "\n CKM_A      = " << CKM_A
             << " CKM_lambda = " << CKM_lambda << "\n CKM_barrho = " << CKM_barrho
             << " CKM_bareta = " << CKM_bareta << std::endl;
         ::abort();
     }
 
     if ( maxfoundprob == 0.0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "\n\n In the function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...)"
             << "\n maxfoundprob = " << maxfoundprob << " <0 or =0!"
             << "\n mu =" << mu << " Nf =" << Nf << "\n sr =" << sr
             << " res_swch =" << res_swch << " ias =" << ias
             << "\n Egamma_min =" << Egamma_min << "\n CKM_A      = " << CKM_A
             << " CKM_lambda = " << CKM_lambda << "\n CKM_barrho = " << CKM_barrho
             << " CKM_bareta = " << CKM_bareta << std::endl;
         maxfoundprob = 0.00000001;
     }
 
     maxfoundprob *= 1.01;
 
     EvtGenReport( EVTGEN_NOTICE, "EvtGen" )
         << "\n **********************************************************************"
         << "\n The function Evtbs2llGammaISRFSRAmp::CalcMaxProb(...) passed with arguments:"
         << "\n mu =" << mu << " Nf =" << Nf << "\n sr =" << sr
         << " res_swch =" << res_swch << " ias =" << ias
         << "\n CKM_A      = " << CKM_A << " CKM_lambda = " << CKM_lambda
         << "\n Egamma_min =" << Egamma_min << "\n CKM_barrho = " << CKM_barrho
         << " CKM_bareta = " << CKM_bareta
         << "\n The distribution maximum maxfoundprob =" << maxfoundprob
         << "\n **********************************************************************"
         << std::endl;
 
     return maxfoundprob;
 }
 
 // Triangular function
 double Evtbs2llGammaISRFSRAmp::lambda( double a, double b, double c )
 {
     double l;
 
     l = pow( a, 2.0 ) + pow( b, 2.0 ) + pow( c, 2.0 ) - 2.0 * a * b -
         2.0 * a * c - 2.0 * b * c;
 
     return l;
 }
diff --git a/src/EvtGenModels/Evtbs2llGammaMNT.cpp b/src/EvtGenModels/Evtbs2llGammaMNT.cpp
index 3bb235f..04eb2c9 100644
--- a/src/EvtGenModels/Evtbs2llGammaMNT.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaMNT.cpp
@@ -1,183 +1,183 @@
 
 /***********************************************************************
 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
 *                                                                      *
 * This file is part of EvtGen.                                         *
 *                                                                      *
 * EvtGen is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by *
 * the Free Software Foundation, either version 3 of the License, or    *
 * (at your option) any later version.                                  *
 *                                                                      *
 * EvtGen is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
 * GNU General Public License for more details.                         *
 *                                                                      *
 * You should have received a copy of the GNU General Public License    *
 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************/
 
 #include "EvtGenModels/Evtbs2llGammaMNT.hh"
 
 #include "EvtGenBase/EvtGenKine.hh"
 #include "EvtGenBase/EvtPDL.hh"
 #include "EvtGenBase/EvtParticle.hh"
 #include "EvtGenBase/EvtReport.hh"
 
 #include "EvtGenModels/EvtbTosllWilsCoeffNLO.hh"
 #include "EvtGenModels/Evtbs2llGammaAmp.hh"
 #include "EvtGenModels/Evtbs2llGammaFFMNT.hh"
 
 #include <stdlib.h>
 #include <string.h>
 
 Evtbs2llGammaMNT::~Evtbs2llGammaMNT()
 {
     delete m_mntffmodel;
     if ( m_calcamp )
         delete m_calcamp;
 }
 
 // The module name specification
-std::string Evtbs2llGammaMNT::getName()
+std::string Evtbs2llGammaMNT::getName() const
 {
     return "BSTOGLLMNT";
 }
 
-// The implementation of the clone() method
-EvtDecayBase* Evtbs2llGammaMNT::clone()
+// The implementation of the clone() const method
+EvtDecayBase* Evtbs2llGammaMNT::clone() const
 {
     return new Evtbs2llGammaMNT;
 }
 
 // The inicialization of the decay model
 //
 // Tn the our model we have are following 4 arguments:
 //
 //           mu          - the scale parameter, GeV;
 //           Nf          - number of "effective" flavors (for b-quark Nf=5);
 //           res_swch    - resonant switching parametr:
 //                         = 0 the resonant contribution switched OFF,
 //                         = 1 the resonant contribution switched ON;
 //           ias         - switching parametr for \alpha_s(M_Z) value:
 //                         = 0 PDG 1sigma minimal alpha_s(M_Z),
 //                         = 1 PDG average value  alpha_s(M_Z),
 //                         = 2 PDG 1sigma maximal alpha_s(M_Z).
 //	     Egamma_max  - photon energy cut, GeV;
 //           Wolfenstein parameterization for CKM matrix
 //                         CKM_A, CKM_lambda, CKM_barrho, CKM_bareta
 //
 void Evtbs2llGammaMNT::init()
 {
     // check that there are 9 arguments
     checkNArg( 9 );
     // check that there are 3 daughteres
     checkNDaug( 3 );
 
     // We expect that the parent to be a scalar (B-meson)
     // and the daughters to be Gamma, l^+ and l^-
     checkSpinParent( EvtSpinType::SCALAR );
 
     // We expect that the first daughter is the photon
     EvtSpinType::spintype photontype = EvtPDL::getSpinType( getDaug( 0 ) );
 
     if ( !( photontype == EvtSpinType::PHOTON ) ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Evtbs2llGammaMNT generator expected "
             << " a PHOTON 1st daughter, found:"
             << EvtPDL::name( getDaug( 0 ) ).c_str() << std::endl;
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "Will terminate execution!" << std::endl;
         ::abort();
     }
 
     // We expect that the second and third daughters
     // are the ell+ and ell- == DIRAC
     checkSpinDaughter( 1, EvtSpinType::DIRAC );
     checkSpinDaughter( 2, EvtSpinType::DIRAC );
 
     m_mntffmodel = new Evtbs2llGammaFFMNT();
     m_wilscoeff = new EvtbTosllWilsCoeffNLO();
     if ( photontype == EvtSpinType::PHOTON ) {
         m_calcamp = new Evtbs2llGammaAmp();
     } else {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "The init()-function in the Evtbs2llGammaMNT generator:"
             << "The absence in the radiative decay!" << std::endl;
         ::abort();
     }
 }
 
 // Set the maximum probability of the decay
 // differencial distribution d^2\Gamma/d\hat s d\cos\theta
 void Evtbs2llGammaMNT::initProbMax()
 {
     double mymaxprob = -10.0;    // maximum of the probability
 
     EvtId parnum, photnum, l1num, l2num;
 
     parnum = getParentId();
     photnum = getDaug( 0 );
     l1num = getDaug( 1 );
     l2num = getDaug( 2 );
 
     double mu = getArg( 0 );            // the scale parameter
     int Nf = (int)getArg( 1 );          // number of "effective" flavors
     int res_swch = (int)getArg( 2 );    // resonant switching parametr
     int ias = (int)getArg( 3 );         // switching parametr for \alpha_s(M_Z)
     double Egamma_max = getArg( 4 );    // photon energy cut
     double CKM_A = getArg( 5 );
     double CKM_lambda = getArg( 6 );
     double CKM_barrho = getArg( 7 );
     double CKM_bareta = getArg( 8 );
 
     mymaxprob = m_calcamp->CalcMaxProb( parnum, photnum, l1num, l2num,
                                         m_mntffmodel, m_wilscoeff, mu, Nf,
                                         res_swch, ias, Egamma_max, CKM_A,
                                         CKM_lambda, CKM_barrho, CKM_bareta );
 
     if ( mymaxprob <= 0.0 ) {
         EvtGenReport( EVTGEN_ERROR, "EvtGen" )
             << "The function void Evtbs2llGammaMNT::initProbMax()"
             << "\n Unexpected value of the probability maximum!"
             << "\n mymaxprob = " << mymaxprob << std::endl;
         ::abort();
     }
 
     setProbMax( mymaxprob );
 }
 
 void Evtbs2llGammaMNT::decay( EvtParticle* p )
 {
     double mu = getArg( 0 );            // the scale parameter
     int Nf = (int)getArg( 1 );          // number of "effective" flavors
     int res_swch = (int)getArg( 2 );    // resonant switching parametr
     int ias = (int)getArg( 3 );         // switching parametr for \alpha_s(M_Z)
     double Egamma_max = getArg( 4 );    // photon energy cut
     double CKM_A = getArg( 5 );
     double CKM_lambda = getArg( 6 );
     double CKM_barrho = getArg( 7 );
     double CKM_bareta = getArg( 8 );
 
     p->initializePhaseSpace( getNDaug(), getDaugs() );
 
     // The class "Evtbs2llGammaFFMNT" is the derived class of the
     // class  "Evtbs2llGammaFF" (see the file "Evtbs2llGammaFF.hh")
     m_calcamp->CalcAmp( p, m_amp2, m_mntffmodel, m_wilscoeff, mu, Nf, res_swch,
                         ias, Egamma_max, CKM_A, CKM_lambda, CKM_barrho,
                         CKM_bareta );
 
     //  EvtGenReport(EVTGEN_NOTICE,"EvtGen") << "\n "
     //                          << "\n The function Evtbs2llGammaMNT::decay(...) passed with arguments:"
     //                          << "\n mu = " << mu << " Nf =" << Nf
     //                          << "\n res_swch = " << res_swch
     //                          << "\n ias = " << ias
     //		 	    << "\n Egamma_max =" << Egamma_max
     //                          << "\n CKM_A = " << CKM_A
     //                          << "\n CKM_lambda = " << CKM_lambda
     //                          << "\n CKM_barrho = " << CKM_barrho
     //                          << "\n CKM_bareta = " << CKM_bareta
     //                          << "\n "
     //                          << std::endl;
 }