Page MenuHomeHEPForge

D132.1759173981.diff
No OneTemporary

Size
440 KB
Referenced Files
None
Subscribers
None

D132.1759173981.diff

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/EvtGenBase/EvtAmp.hh b/EvtGenBase/EvtAmp.hh
--- a/EvtGenBase/EvtAmp.hh
+++ b/EvtGenBase/EvtAmp.hh
@@ -31,22 +31,22 @@
EvtAmp();
EvtAmp( const EvtAmp& amp );
- void init( EvtId p, int ndaug, EvtId* daug );
+ void init( EvtId p, int ndaug, const EvtId* daug );
void setAmp( int* ind, const EvtComplex& amp );
const EvtComplex& getAmp( int* ind ) const;
- EvtSpinDensity getSpinDensity();
+ EvtSpinDensity getSpinDensity() const;
- EvtSpinDensity contract( int i, const EvtAmp& a );
- EvtAmp contract( int i, const EvtSpinDensity& rho );
+ EvtSpinDensity contract( int i, const EvtAmp& a ) const;
+ EvtAmp contract( int i, const EvtSpinDensity& rho ) const;
//sum over the i:th daugther of a1 and contract with parent of a2
- EvtAmp contract( int i, const EvtAmp& a1, const EvtAmp& a2 );
+ EvtAmp contract( int i, const EvtAmp& a1, const EvtAmp& a2 ) const;
- EvtSpinDensity getForwardSpinDensity( EvtSpinDensity* rho_list, int k );
- EvtSpinDensity getBackwardSpinDensity( EvtSpinDensity* rho_list );
+ EvtSpinDensity getForwardSpinDensity( EvtSpinDensity* rho_list, int k ) const;
+ EvtSpinDensity getBackwardSpinDensity( EvtSpinDensity* rho_list ) const;
EvtAmp& operator=( const EvtAmp& amp );
@@ -75,7 +75,7 @@
*/
void vertex( int* i1, const EvtComplex& amp );
- void dump();
+ void dump() const;
private:
friend class EvtDecayAmp;
diff --git a/EvtGenBase/EvtDecayBase.hh b/EvtGenBase/EvtDecayBase.hh
--- a/EvtGenBase/EvtDecayBase.hh
+++ b/EvtGenBase/EvtDecayBase.hh
@@ -34,10 +34,10 @@
public:
//These pure virtual methods has to be implemented
//by any derived class
- virtual std::string getName() = 0;
+ virtual std::string getName() const = 0;
virtual void decay( EvtParticle* p ) = 0;
virtual void makeDecay( EvtParticle* p, bool recursive = true ) = 0;
- virtual EvtDecayBase* clone() = 0;
+ virtual EvtDecayBase* clone() const = 0;
//These virtual methods can be implemented by the
//derived class to implement nontrivial functionality.
@@ -62,7 +62,7 @@
void disableCheckQ() { m_chkCharge = false; };
void checkQ();
int getNDaug() const { return m_ndaug; }
- EvtId* getDaugs() { return m_daug.data(); }
+ 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; }
@@ -80,14 +80,14 @@
bool summary() const { return m_summary; }
bool verbose() const { return m_verbose; }
- void saveDecayInfo( EvtId ipar, int ndaug, EvtId* daug, int narg,
+ 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 );
@@ -104,11 +104,14 @@
// lange - some models can take more daughters
// than they really have to fool aliases (VSSBMIX for example)
- virtual int nRealDaughters() { return m_ndaug; }
+ virtual int nRealDaughters() const { return m_ndaug; }
protected:
bool m_daugsDecayedByParentModel;
- bool daugsDecayedByParentModel() { return m_daugsDecayedByParentModel; }
+ bool daugsDecayedByParentModel() const
+ {
+ return m_daugsDecayedByParentModel;
+ }
private:
std::vector<double> m_storedArgs;
diff --git a/EvtGenBase/EvtDecayTable.hh b/EvtGenBase/EvtDecayTable.hh
--- a/EvtGenBase/EvtDecayTable.hh
+++ b/EvtGenBase/EvtDecayTable.hh
@@ -34,42 +34,45 @@
class EvtDecayTable {
public:
- static EvtDecayTable* getInstance();
+ static EvtDecayTable& getInstance();
- int getNMode( int ipar );
+ int getNMode( int ipar ) const;
EvtDecayBase* getDecay( int ipar, int imode );
void readDecayFile( const std::string dec_name, bool verbose = true );
void readXMLDecayFile( const std::string dec_name, bool verbose = true );
- bool stringToBoolean( std::string valStr );
- void checkParticle( std::string particle );
+ bool stringToBoolean( std::string valStr ) const;
+ void checkParticle( std::string particle ) const;
int findChannel( EvtId parent, std::string model, int ndaug, EvtId* daugs,
- int narg, std::string* args );
+ int narg, std::string* args ) const;
- int inChannelList( EvtId parent, int ndaug, EvtId* daugs );
+ int inChannelList( EvtId parent, int ndaug, EvtId* daugs ) const;
EvtDecayBase* getDecayFunc( EvtParticle* p );
- void printSummary();
+ void printSummary() const;
- void checkConj();
+ void checkConj() const;
- std::vector<EvtParticleDecayList> getDecayTable() { return m_decaytable; };
+ std::vector<EvtParticleDecayList> getDecayTable() const
+ {
+ return m_decaytable;
+ }
EvtDecayBase* findDecayModel( int aliasInt, int modeInt );
EvtDecayBase* findDecayModel( EvtId id, int modeInt );
- bool hasPythia( int aliasInt );
- bool hasPythia( EvtId id );
+ bool hasPythia( int aliasInt ) const;
+ bool hasPythia( EvtId id ) const;
- int getNModes( int aliasInt );
- int getNModes( EvtId id );
+ int getNModes( int aliasInt ) const;
+ int getNModes( EvtId id ) const;
std::vector<std::string> splitString( std::string& theString,
- std::string& splitter );
+ std::string& splitter ) const;
protected:
EvtDecayTable();
diff --git a/EvtGenBase/EvtMTRandomEngine.hh b/EvtGenBase/EvtMTRandomEngine.hh
--- a/EvtGenBase/EvtMTRandomEngine.hh
+++ b/EvtGenBase/EvtMTRandomEngine.hh
@@ -27,17 +27,18 @@
class EvtMTRandomEngine : public EvtRandomEngine {
public:
- EvtMTRandomEngine( unsigned int seed = 1430957218 );
+ EvtMTRandomEngine( unsigned long int seed = 1430957218 );
- virtual double random() override;
+ double random() override;
- virtual void setSeed( unsigned int seed ) override;
+ void setSeed( unsigned long int seed ) override;
+
+ unsigned long int lastSeed() const override { return m_lastSeed; }
private:
std::mt19937 m_engine;
-
- typedef std::uniform_real_distribution<double> URDist;
- URDist m_distribution;
+ std::uniform_real_distribution<double> m_distribution;
+ unsigned long int m_lastSeed;
};
#endif
diff --git a/EvtGenBase/EvtModel.hh b/EvtGenBase/EvtModel.hh
--- a/EvtGenBase/EvtModel.hh
+++ b/EvtGenBase/EvtModel.hh
@@ -25,7 +25,6 @@
#include "EvtGenBase/EvtStringHash.hh"
#include <map>
-//#include <fstream.h>
//Class to read in and handle the decays available
//to EvtGen for each particle, and the model to be
@@ -47,7 +46,7 @@
private:
EvtModel();
- static EvtModel* m_instance;
+ static thread_local EvtModel* m_instance;
std::map<std::string, EvtDecayBase*> m_modelNameHash;
std::map<std::string, EvtDecayBase*> m_commandNameHash;
diff --git a/EvtGenBase/EvtPDL.hh b/EvtGenBase/EvtPDL.hh
--- a/EvtGenBase/EvtPDL.hh
+++ b/EvtGenBase/EvtPDL.hh
@@ -27,6 +27,7 @@
#include "EvtGenBase/EvtStringHash.hh"
#include <iosfwd>
+#include <limits>
#include <map>
#include <string>
#include <vector>
@@ -86,7 +87,9 @@
static EvtPDL& getInstance();
- std::size_t m_firstAlias;
+ void reset();
+
+ std::size_t m_firstAlias{ std::numeric_limits<std::size_t>::max() };
std::vector<EvtPartProp> m_partlist;
diff --git a/EvtGenBase/EvtPartProp.hh b/EvtGenBase/EvtPartProp.hh
--- a/EvtGenBase/EvtPartProp.hh
+++ b/EvtGenBase/EvtPartProp.hh
@@ -62,13 +62,13 @@
const std::string& getName() { return m_name; }
void setName( std::string pname );
- EvtId getId() { return m_id; }
+ EvtId getId() const { return m_id; }
void setId( EvtId id ) { m_id = id; }
EvtId getIdChgConj() { return m_idchgconj; }
void setIdChgConj( EvtId idchgconj ) { m_idchgconj = idchgconj; }
- int getStdHep() { return m_stdhep; }
+ int getStdHep() const { return m_stdhep; }
void setStdHep( int stdhep ) { m_stdhep = stdhep; }
int getLundKC() { return m_lundkc; }
diff --git a/EvtGenBase/EvtParticle.hh b/EvtGenBase/EvtParticle.hh
--- a/EvtGenBase/EvtParticle.hh
+++ b/EvtGenBase/EvtParticle.hh
@@ -148,21 +148,21 @@
* adds them to the parent. Note that momentum
* is left uninitialized, this is _only_ creation.
*/
- void makeDaughters( size_t ndaug, EvtId* id );
+ void makeDaughters( size_t ndaug, const EvtId* id );
/**
* Creates the daughters in the list of ids and
* adds them to the parent. Note that momentum
* is left uninitialized, this is _only_ creation.
*/
- void makeDaughters( size_t ndaug, std::vector<EvtId> idVector );
+ void makeDaughters( size_t ndaug, const std::vector<EvtId> idVector );
/**
* Similar to the routine above except that here
* momentum is generated according to phase space
* daughters are filled with this momentum.
*/
- double initializePhaseSpace( size_t numdaughter, EvtId* daughters,
+ double initializePhaseSpace( size_t numdaughter, const EvtId* daughters,
bool forceResetMasses = false,
double poleSize = -1., int whichTwo1 = 0,
int whichTwo2 = 1 );
diff --git a/EvtGenBase/EvtParticleDecay.hh b/EvtGenBase/EvtParticleDecay.hh
--- a/EvtGenBase/EvtParticleDecay.hh
+++ b/EvtGenBase/EvtParticleDecay.hh
@@ -34,7 +34,7 @@
~EvtParticleDecay()
{
- if ( m_decay != nullptr )
+ if ( m_decay )
delete m_decay;
}
@@ -42,12 +42,12 @@
void setDecayModel( EvtDecayBase* decay ) { m_decay = decay; }
EvtDecayBase* getDecayModel() { return m_decay; }
- double getBrfrSum() { return m_brfrsum; }
+ double getBrfrSum() const { return m_brfrsum; }
void setBrfrSum( double brfrsum ) { m_brfrsum = brfrsum; }
- double getMassMin() { return m_massmin; }
+ double getMassMin() const { return m_massmin; }
void setMassMin( double massmin ) { m_massmin = massmin; }
- void printSummary();
+ void printSummary() const;
private:
EvtDecayBase* m_decay;
diff --git a/EvtGenBase/EvtParticleDecayList.hh b/EvtGenBase/EvtParticleDecayList.hh
--- a/EvtGenBase/EvtParticleDecayList.hh
+++ b/EvtGenBase/EvtParticleDecayList.hh
@@ -66,7 +66,7 @@
void addMode( EvtDecayBase* decay, double brfr, double massmin );
void finalize();
- void printSummary();
+ void printSummary() const;
bool isJetSet() const;
diff --git a/EvtGenBase/EvtRadCorr.hh b/EvtGenBase/EvtRadCorr.hh
--- a/EvtGenBase/EvtRadCorr.hh
+++ b/EvtGenBase/EvtRadCorr.hh
@@ -26,8 +26,7 @@
class EvtRadCorr {
public:
- EvtRadCorr();
- ~EvtRadCorr();
+ EvtRadCorr() = delete;
static void doRadCorr( EvtParticle* p );
@@ -42,7 +41,7 @@
static void setNormalRadCorr();
private:
- static EvtAbsRadCorr* m_fsrEngine;
+ static thread_local EvtAbsRadCorr* m_fsrEngine;
static bool m_alwaysRadCorr;
static bool m_neverRadCorr;
};
diff --git a/EvtGenBase/EvtRandom.hh b/EvtGenBase/EvtRandom.hh
--- a/EvtGenBase/EvtRandom.hh
+++ b/EvtGenBase/EvtRandom.hh
@@ -34,7 +34,9 @@
static double random();
- static void setSeed( unsigned int seed );
+ static void setSeed( unsigned long int seed );
+
+ static unsigned long int lastSeed();
//This class does not take ownership of the random engine;
//the caller needs to make sure that the engine is not
@@ -42,7 +44,7 @@
static void setRandomEngine( EvtRandomEngine* randomEngine );
private:
- static EvtRandomEngine* m_randomEngine;
+ static thread_local EvtRandomEngine* m_randomEngine;
};
#endif
diff --git a/EvtGenBase/EvtRandomEngine.hh b/EvtGenBase/EvtRandomEngine.hh
--- a/EvtGenBase/EvtRandomEngine.hh
+++ b/EvtGenBase/EvtRandomEngine.hh
@@ -31,7 +31,9 @@
virtual double random() = 0;
- virtual void setSeed( unsigned int seed ) = 0;
+ virtual void setSeed( unsigned long int seed ) = 0;
+
+ virtual unsigned long int lastSeed() const = 0;
private:
};
diff --git a/EvtGenBase/EvtSimpleRandomEngine.hh b/EvtGenBase/EvtSimpleRandomEngine.hh
--- a/EvtGenBase/EvtSimpleRandomEngine.hh
+++ b/EvtGenBase/EvtSimpleRandomEngine.hh
@@ -31,7 +31,9 @@
double random() override;
- void setSeed( unsigned int seed ) override;
+ void setSeed( unsigned long int seed ) override;
+
+ unsigned long int lastSeed() const override { return m_next; }
private:
unsigned long int m_next;
diff --git a/EvtGenBase/EvtStatus.hh b/EvtGenBase/EvtStatus.hh
--- a/EvtGenBase/EvtStatus.hh
+++ b/EvtGenBase/EvtStatus.hh
@@ -37,7 +37,7 @@
}
static int* rejectFlag()
{
- static int rejectEvent = 0;
+ static thread_local int rejectEvent = 0;
return &rejectEvent;
}
static int getRejectFlag()
diff --git a/EvtGenBase/EvtSymTable.hh b/EvtGenBase/EvtSymTable.hh
--- a/EvtGenBase/EvtSymTable.hh
+++ b/EvtGenBase/EvtSymTable.hh
@@ -37,7 +37,7 @@
static std::string get( const std::string& name, int& ierr );
private:
- static std::map<std::string, std::string> m_symMap;
+ static thread_local std::map<std::string, std::string> m_symMap;
};
#endif
diff --git a/EvtGenBase/EvtTwoBodyKine.hh b/EvtGenBase/EvtTwoBodyKine.hh
--- a/EvtGenBase/EvtTwoBodyKine.hh
+++ b/EvtGenBase/EvtTwoBodyKine.hh
@@ -35,7 +35,7 @@
};
EvtTwoBodyKine();
- EvtTwoBodyKine( double mA, double mB, double mAB );
+ EvtTwoBodyKine( const double mA, const double mB, const double mAB );
// Accessors
diff --git a/EvtGenExternal/EvtExternalGenFactory.hh b/EvtGenExternal/EvtExternalGenFactory.hh
--- a/EvtGenExternal/EvtExternalGenFactory.hh
+++ b/EvtGenExternal/EvtExternalGenFactory.hh
@@ -24,41 +24,44 @@
#include "EvtGenModels/EvtAbsExternalGen.hh"
#include <map>
+#include <memory>
// Description: A factory type method to create engines for external physics
// generators like Pythia.
-class EvtExternalGenFactory {
+class EvtExternalGenFactory final {
public:
- enum GenId
+ enum class GenId
{
PythiaGenId = 0,
TauolaGenId
};
- static EvtExternalGenFactory* getInstance();
+ static EvtExternalGenFactory& getInstance();
- EvtAbsExternalGen* getGenerator( GenId genId = GenId::PythiaGenId );
+ EvtAbsExternalGen* getGenerator( const GenId genId );
void initialiseAllGenerators();
void definePythiaGenerator( std::string xmlDir, bool convertPhysCodes,
bool useEvtGenRandom = true );
- void defineTauolaGenerator( bool useEvtGenRandom = true );
+ void defineTauolaGenerator( bool useEvtGenRandom = true,
+ bool seedTauolaFortran = true );
//methods to add configuration commands to the pythia generators
//void addPythiaCommand( std::string generator, std::string module, std::string param, std::string value);
//void addPythia6Command(std::string generator, std::string module, std::string param, std::string value);
- protected:
- EvtExternalGenFactory();
- ~EvtExternalGenFactory();
-
- typedef std::map<GenId, EvtAbsExternalGen*> ExtGenMap;
- //typedef std::map<GenId, std::map<std::string, std::vector<std::string>>> ExtGenCommandMap;
-
private:
- EvtExternalGenFactory( const EvtExternalGenFactory& ){};
+ EvtExternalGenFactory() = default;
+ ~EvtExternalGenFactory() = default;
+ EvtExternalGenFactory( const EvtExternalGenFactory& ) = delete;
+ EvtExternalGenFactory( EvtExternalGenFactory&& ) = delete;
+ EvtExternalGenFactory& operator=( const EvtExternalGenFactory& ) = delete;
+ EvtExternalGenFactory& operator=( EvtExternalGenFactory&& ) = delete;
+
+ typedef std::map<GenId, std::unique_ptr<EvtAbsExternalGen>> ExtGenMap;
+ //typedef std::map<GenId, std::map<std::string, std::vector<std::string>>> ExtGenCommandMap;
ExtGenMap m_extGenMap;
//ExtGenCommandMap m_extGenCommandMap;
diff --git a/EvtGenExternal/EvtExternalGenList.hh b/EvtGenExternal/EvtExternalGenList.hh
--- a/EvtGenExternal/EvtExternalGenList.hh
+++ b/EvtGenExternal/EvtExternalGenList.hh
@@ -34,7 +34,8 @@
EvtExternalGenList( bool convertPythiaCodes = false,
std::string pythiaXmlDir = "",
std::string photonType = "gamma",
- bool useEvtGenRandom = true );
+ bool useEvtGenRandom = true,
+ bool seedTauolaFortran = true );
virtual ~EvtExternalGenList();
diff --git a/EvtGenExternal/EvtPythia.hh b/EvtGenExternal/EvtPythia.hh
--- a/EvtGenExternal/EvtPythia.hh
+++ b/EvtGenExternal/EvtPythia.hh
@@ -34,14 +34,13 @@
// Class to handle generic phase space decays not done
// in other decay models.
-class EvtPythia : public EvtDecayIncoherent {
+class EvtPythia final : public EvtDecayIncoherent {
public:
- EvtPythia();
- ~EvtPythia();
+ EvtPythia() = default;
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
@@ -52,11 +51,11 @@
std::string commandName() override;
void command( std::string ) override;
- protected:
- EvtAbsExternalGen* m_pythiaEngine;
-
private:
void fixPolarisations( EvtParticle* p );
+
+ EvtAbsExternalGen* m_pythiaEngine{ nullptr };
+
std::vector<std::string> m_commandList;
};
diff --git a/EvtGenExternal/EvtPythiaEngine.hh b/EvtGenExternal/EvtPythiaEngine.hh
--- a/EvtGenExternal/EvtPythiaEngine.hh
+++ b/EvtGenExternal/EvtPythiaEngine.hh
@@ -47,8 +47,6 @@
EvtPythiaEngine( std::string xmlDir = "./xmldoc",
bool convertPhysCodes = false, bool useEvtGenRandom = true );
- virtual ~EvtPythiaEngine();
-
bool doDecay( EvtParticle* theMother ) override;
void initialise() override;
@@ -58,10 +56,13 @@
void updateParticleLists();
void updatePhysicsParameters();
- void createPythiaParticle( EvtId& particleId, int PDGCode );
bool validPDGCode( int PDGCode );
- void updatePythiaDecayTable( EvtId& particleId, int aliasInt, int PDGCode );
- void storeDaughterInfo( EvtParticle* theParticle, int startInt );
+ void createPythiaParticle( Pythia8::Pythia& thePythiaGenerator,
+ EvtId& particleId, int PDGCode );
+ void updatePythiaDecayTable( Pythia8::Pythia& thePythiaGenerator,
+ EvtId& particleId, int aliasInt, int PDGCode );
+ void storeDaughterInfo( Pythia8::Event& theEvent, EvtParticle* theParticle,
+ int startInt );
void clearDaughterVectors();
void clearPythiaModeMap();
@@ -70,19 +71,20 @@
int getModeInt( EvtDecayBase* decayModel );
+ bool m_convertPhysCodes;
+ // Specify if we are going to use the random number generator (engine) from EvtGen for Pythia 8.
+ bool m_useEvtGenRandom;
+ bool m_initialised{ false };
+
std::unique_ptr<Pythia8::Pythia> m_genericPythiaGen;
std::unique_ptr<Pythia8::Pythia> m_aliasPythiaGen;
- Pythia8::Pythia* m_thePythiaGenerator;
+
+ std::shared_ptr<EvtPythiaRandom> m_evtgenRandom;
std::vector<int> m_daugPDGVector;
std::vector<EvtVector4R> m_daugP4Vector;
- typedef std::map<int, std::vector<int>> PythiaModeMap;
- PythiaModeMap m_pythiaModeMap;
-
- bool m_convertPhysCodes, m_initialised, m_useEvtGenRandom;
-
- std::shared_ptr<EvtPythiaRandom> m_evtgenRandom;
+ std::map<int, std::vector<int>> m_pythiaModeMap;
std::map<int, int> m_addedPDGCodes;
};
diff --git a/EvtGenExternal/EvtTauola.hh b/EvtGenExternal/EvtTauola.hh
--- a/EvtGenExternal/EvtTauola.hh
+++ b/EvtGenExternal/EvtTauola.hh
@@ -29,21 +29,19 @@
// Description: Use the Tauola external generator for tau decays
-class EvtTauola : public EvtDecayIncoherent {
+class EvtTauola final : 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;
- protected:
- EvtAbsExternalGen* m_tauolaEngine = nullptr;
-
private:
+ EvtAbsExternalGen* m_tauolaEngine = nullptr;
};
#endif
diff --git a/EvtGenExternal/EvtTauolaEngine.hh b/EvtGenExternal/EvtTauolaEngine.hh
--- a/EvtGenExternal/EvtTauolaEngine.hh
+++ b/EvtGenExternal/EvtTauolaEngine.hh
@@ -43,14 +43,13 @@
#endif
#include "EvtGenBase/EvtHepMCEvent.hh"
-#include <map>
-#include <vector>
+#include <mutex>
// Description: Interface to the TAUOLA external generator
class EvtTauolaEngine : public EvtAbsExternalGen {
public:
- EvtTauolaEngine( bool useEvtGenRandom = true );
+ EvtTauolaEngine( bool useEvtGenRandom = true, bool seedTauolaFortran = true );
bool doDecay( EvtParticle* theMother ) override;
@@ -58,18 +57,29 @@
protected:
private:
- bool m_initialised;
- int m_tauPDG, m_nTauolaModes;
- int m_neutPropType, m_posPropType, m_negPropType;
-
- GenParticlePtr createGenParticle( EvtParticle* theParticle );
+ GenParticlePtr createGenParticle( const EvtParticle* theParticle ) const;
void setUpPossibleTauModes();
void setOtherParameters();
- int getModeInt( EvtDecayBase* decayModel );
+ int getModeInt( EvtDecayBase* decayModel ) const;
void decayTauEvent( EvtParticle* tauParticle );
+
+ bool m_useEvtGenRandom{ true };
+ bool m_seedTauolaFortran{ true };
+
+ // PDG standard code integer ID for tau particle
+ static constexpr int m_tauPDG{ 15 };
+ // Number of possible decay modes in Tauola
+ static constexpr int m_nTauolaModes{ 22 };
+ // Neutral and charged spin propagator choices
+ static int m_neutPropType;
+ static int m_posPropType;
+ static int m_negPropType;
+
+ static bool m_initialised;
+ static std::mutex m_tauola_mutex;
};
#endif
diff --git a/EvtGenModels/EvtBBScalar.hh b/EvtGenModels/EvtBBScalar.hh
--- a/EvtGenModels/EvtBBScalar.hh
+++ b/EvtGenModels/EvtBBScalar.hh
@@ -43,8 +43,8 @@
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;
diff --git a/EvtGenModels/EvtBLLNuL.hh b/EvtGenModels/EvtBLLNuL.hh
--- a/EvtGenModels/EvtBLLNuL.hh
+++ b/EvtGenModels/EvtBLLNuL.hh
@@ -38,8 +38,8 @@
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;
diff --git a/EvtGenModels/EvtBTo3piCP.hh b/EvtGenModels/EvtBTo3piCP.hh
--- a/EvtGenModels/EvtBTo3piCP.hh
+++ b/EvtGenModels/EvtBTo3piCP.hh
@@ -32,8 +32,8 @@
public:
EvtBTo3piCP() {}
- std::string getName() override;
- EvtBTo3piCP* clone() override;
+ std::string getName() const override;
+ EvtBTo3piCP* clone() const override;
void init() override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtBTo4piCP.hh b/EvtGenModels/EvtBTo4piCP.hh
--- a/EvtGenModels/EvtBTo4piCP.hh
+++ b/EvtGenModels/EvtBTo4piCP.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtBToDDalitzCPK.hh b/EvtGenModels/EvtBToDDalitzCPK.hh
--- a/EvtGenModels/EvtBToDDalitzCPK.hh
+++ b/EvtGenModels/EvtBToDDalitzCPK.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtBToDiBaryonlnupQCD.hh b/EvtGenModels/EvtBToDiBaryonlnupQCD.hh
--- a/EvtGenModels/EvtBToDiBaryonlnupQCD.hh
+++ b/EvtGenModels/EvtBToDiBaryonlnupQCD.hh
@@ -37,8 +37,8 @@
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;
diff --git a/EvtGenModels/EvtBToKpipiCP.hh b/EvtGenModels/EvtBToKpipiCP.hh
--- a/EvtGenModels/EvtBToKpipiCP.hh
+++ b/EvtGenModels/EvtBToKpipiCP.hh
@@ -43,8 +43,8 @@
public:
EvtBToKpipiCP() {}
- std::string getName() override;
- EvtBToKpipiCP* clone() override;
+ std::string getName() const override;
+ EvtBToKpipiCP* clone() const override;
void init() override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtBToPlnuBK.hh b/EvtGenModels/EvtBToPlnuBK.hh
--- a/EvtGenModels/EvtBToPlnuBK.hh
+++ b/EvtGenModels/EvtBToPlnuBK.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtBToVlnuBall.hh b/EvtGenModels/EvtBToVlnuBall.hh
--- a/EvtGenModels/EvtBToVlnuBall.hh
+++ b/EvtGenModels/EvtBToVlnuBall.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtBToXElNu.hh b/EvtGenModels/EvtBToXElNu.hh
--- a/EvtGenModels/EvtBToXElNu.hh
+++ b/EvtGenModels/EvtBToXElNu.hh
@@ -37,10 +37,10 @@
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;
diff --git a/EvtGenModels/EvtBaryonPCR.hh b/EvtGenModels/EvtBaryonPCR.hh
--- a/EvtGenModels/EvtBaryonPCR.hh
+++ b/EvtGenModels/EvtBaryonPCR.hh
@@ -35,8 +35,8 @@
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;
diff --git a/EvtGenModels/EvtBcBsNPi.hh b/EvtGenModels/EvtBcBsNPi.hh
--- a/EvtGenModels/EvtBcBsNPi.hh
+++ b/EvtGenModels/EvtBcBsNPi.hh
@@ -36,8 +36,8 @@
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
--- a/EvtGenModels/EvtBcBsStarNPi.hh
+++ b/EvtGenModels/EvtBcBsStarNPi.hh
@@ -36,8 +36,8 @@
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
--- a/EvtGenModels/EvtBcPsiNPi.hh
+++ b/EvtGenModels/EvtBcPsiNPi.hh
@@ -36,8 +36,8 @@
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
--- a/EvtGenModels/EvtBcSMuNu.hh
+++ b/EvtGenModels/EvtBcSMuNu.hh
@@ -35,8 +35,8 @@
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;
diff --git a/EvtGenModels/EvtBcTMuNu.hh b/EvtGenModels/EvtBcTMuNu.hh
--- a/EvtGenModels/EvtBcTMuNu.hh
+++ b/EvtGenModels/EvtBcTMuNu.hh
@@ -33,8 +33,8 @@
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;
diff --git a/EvtGenModels/EvtBcToNPi.hh b/EvtGenModels/EvtBcToNPi.hh
--- a/EvtGenModels/EvtBcToNPi.hh
+++ b/EvtGenModels/EvtBcToNPi.hh
@@ -35,9 +35,9 @@
public:
EvtBcToNPi( bool printAuthorInfo = false );
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtBcVHad.hh b/EvtGenModels/EvtBcVHad.hh
--- a/EvtGenModels/EvtBcVHad.hh
+++ b/EvtGenModels/EvtBcVHad.hh
@@ -37,8 +37,8 @@
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;
diff --git a/EvtGenModels/EvtBcVMuNu.hh b/EvtGenModels/EvtBcVMuNu.hh
--- a/EvtGenModels/EvtBcVMuNu.hh
+++ b/EvtGenModels/EvtBcVMuNu.hh
@@ -33,8 +33,8 @@
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;
diff --git a/EvtGenModels/EvtBcVNpi.hh b/EvtGenModels/EvtBcVNpi.hh
--- a/EvtGenModels/EvtBcVNpi.hh
+++ b/EvtGenModels/EvtBcVNpi.hh
@@ -37,8 +37,8 @@
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;
diff --git a/EvtGenModels/EvtBcVPPHad.hh b/EvtGenModels/EvtBcVPPHad.hh
--- a/EvtGenModels/EvtBcVPPHad.hh
+++ b/EvtGenModels/EvtBcVPPHad.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtBsMuMuKK.hh b/EvtGenModels/EvtBsMuMuKK.hh
--- a/EvtGenModels/EvtBsMuMuKK.hh
+++ b/EvtGenModels/EvtBsMuMuKK.hh
@@ -32,8 +32,8 @@
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;
diff --git a/EvtGenModels/EvtBsquark.hh b/EvtGenModels/EvtBsquark.hh
--- a/EvtGenModels/EvtBsquark.hh
+++ b/EvtGenModels/EvtBsquark.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtBto2piCPiso.hh b/EvtGenModels/EvtBto2piCPiso.hh
--- a/EvtGenModels/EvtBto2piCPiso.hh
+++ b/EvtGenModels/EvtBto2piCPiso.hh
@@ -26,8 +26,8 @@
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;
diff --git a/EvtGenModels/EvtBtoKD3P.hh b/EvtGenModels/EvtBtoKD3P.hh
--- a/EvtGenModels/EvtBtoKD3P.hh
+++ b/EvtGenModels/EvtBtoKD3P.hh
@@ -52,7 +52,7 @@
class EvtBtoKD3P : public EvtDecayAmp {
public:
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
// Initialize model
void init() override;
@@ -60,9 +60,9 @@
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:
diff --git a/EvtGenModels/EvtBtoKpiCPiso.hh b/EvtGenModels/EvtBtoKpiCPiso.hh
--- a/EvtGenModels/EvtBtoKpiCPiso.hh
+++ b/EvtGenModels/EvtBtoKpiCPiso.hh
@@ -26,8 +26,8 @@
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;
diff --git a/EvtGenModels/EvtBtoXsEtap.hh b/EvtGenModels/EvtBtoXsEtap.hh
--- a/EvtGenModels/EvtBtoXsEtap.hh
+++ b/EvtGenModels/EvtBtoXsEtap.hh
@@ -27,9 +27,9 @@
class EvtBtoXsEtap : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtBtoXsgamma.hh b/EvtGenModels/EvtBtoXsgamma.hh
--- a/EvtGenModels/EvtBtoXsgamma.hh
+++ b/EvtGenModels/EvtBtoXsgamma.hh
@@ -33,9 +33,9 @@
class EvtBtoXsgamma : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtBtoXsll.hh b/EvtGenModels/EvtBtoXsll.hh
--- a/EvtGenModels/EvtBtoXsll.hh
+++ b/EvtGenModels/EvtBtoXsll.hh
@@ -39,9 +39,9 @@
class EvtBtoXsll : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtCBTo3piMPP.hh b/EvtGenModels/EvtCBTo3piMPP.hh
--- a/EvtGenModels/EvtCBTo3piMPP.hh
+++ b/EvtGenModels/EvtCBTo3piMPP.hh
@@ -30,8 +30,8 @@
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;
diff --git a/EvtGenModels/EvtCBTo3piP00.hh b/EvtGenModels/EvtCBTo3piP00.hh
--- a/EvtGenModels/EvtCBTo3piP00.hh
+++ b/EvtGenModels/EvtCBTo3piP00.hh
@@ -32,8 +32,8 @@
public:
EvtCBTo3piP00() {}
- std::string getName() override;
- EvtCBTo3piP00* clone() override;
+ std::string getName() const override;
+ EvtCBTo3piP00* clone() const override;
void init() override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtD0ToKspipi.hh b/EvtGenModels/EvtD0ToKspipi.hh
--- a/EvtGenModels/EvtD0ToKspipi.hh
+++ b/EvtGenModels/EvtD0ToKspipi.hh
@@ -14,8 +14,8 @@
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;
diff --git a/EvtGenModels/EvtD0gammaDalitz.hh b/EvtGenModels/EvtD0gammaDalitz.hh
--- a/EvtGenModels/EvtD0gammaDalitz.hh
+++ b/EvtGenModels/EvtD0gammaDalitz.hh
@@ -88,8 +88,8 @@
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;
diff --git a/EvtGenModels/EvtD0mixDalitz.hh b/EvtGenModels/EvtD0mixDalitz.hh
--- a/EvtGenModels/EvtD0mixDalitz.hh
+++ b/EvtGenModels/EvtD0mixDalitz.hh
@@ -123,8 +123,8 @@
}
// 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;
diff --git a/EvtGenModels/EvtDDalitz.hh b/EvtGenModels/EvtDDalitz.hh
--- a/EvtGenModels/EvtDDalitz.hh
+++ b/EvtGenModels/EvtDDalitz.hh
@@ -30,8 +30,8 @@
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;
diff --git a/EvtGenModels/EvtDMix.hh b/EvtGenModels/EvtDMix.hh
--- a/EvtGenModels/EvtDMix.hh
+++ b/EvtGenModels/EvtDMix.hh
@@ -27,9 +27,9 @@
class EvtDMix : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtDToKpienu.hh b/EvtGenModels/EvtDToKpienu.hh
--- a/EvtGenModels/EvtDToKpienu.hh
+++ b/EvtGenModels/EvtDToKpienu.hh
@@ -31,8 +31,8 @@
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;
diff --git a/EvtGenModels/EvtDalitzTable.hh b/EvtGenModels/EvtDalitzTable.hh
--- a/EvtGenModels/EvtDalitzTable.hh
+++ b/EvtGenModels/EvtDalitzTable.hh
@@ -37,23 +37,23 @@
class EvtDalitzTable {
public:
- static EvtDalitzTable* getInstance( const std::string dec_name = "",
- bool verbose = true );
+ static const EvtDalitzTable& getInstance( const std::string dec_name = "",
+ bool verbose = true );
- bool fileHasBeenRead( const std::string dec_name );
- void readXMLDecayFile( const std::string dec_name, bool verbose = true );
- void checkParticle( std::string particle );
-
- void addDecay( EvtId parent, const EvtDalitzDecayInfo& dec );
- void copyDecay( EvtId parent, EvtId* daughters, EvtId copy, EvtId* copyd );
-
- std::vector<EvtDalitzDecayInfo> getDalitzTable( const EvtId& parent );
+ std::vector<EvtDalitzDecayInfo> getDalitzTable( const EvtId& parent ) const;
protected:
EvtDalitzTable();
~EvtDalitzTable();
private:
+ bool fileHasBeenRead( const std::string dec_name ) const;
+ void readXMLDecayFile( const std::string dec_name, bool verbose = true );
+ void checkParticle( std::string particle ) const;
+
+ void addDecay( EvtId parent, const EvtDalitzDecayInfo& dec );
+ void copyDecay( EvtId parent, EvtId* daughters, EvtId copy, EvtId* copyd );
+
EvtDalitzReso getResonance( std::string shape, EvtDalitzPlot dp,
EvtCyclic3::Pair angPair,
EvtCyclic3::Pair resPair,
diff --git a/EvtGenModels/EvtEtaDalitz.hh b/EvtGenModels/EvtEtaDalitz.hh
--- a/EvtGenModels/EvtEtaDalitz.hh
+++ b/EvtGenModels/EvtEtaDalitz.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtEtaLLPiPi.hh b/EvtGenModels/EvtEtaLLPiPi.hh
--- a/EvtGenModels/EvtEtaLLPiPi.hh
+++ b/EvtGenModels/EvtEtaLLPiPi.hh
@@ -38,8 +38,8 @@
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;
diff --git a/EvtGenModels/EvtFlatQ2.hh b/EvtGenModels/EvtFlatQ2.hh
--- a/EvtGenModels/EvtFlatQ2.hh
+++ b/EvtGenModels/EvtFlatQ2.hh
@@ -29,8 +29,8 @@
class EvtFlatQ2 : 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;
diff --git a/EvtGenModels/EvtFlatSqDalitz.hh b/EvtGenModels/EvtFlatSqDalitz.hh
--- a/EvtGenModels/EvtFlatSqDalitz.hh
+++ b/EvtGenModels/EvtFlatSqDalitz.hh
@@ -30,8 +30,8 @@
class EvtFlatSqDalitz : public EvtDecayIncoherent {
public:
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void init() override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtFourBodyPhsp.hh b/EvtGenModels/EvtFourBodyPhsp.hh
--- a/EvtGenModels/EvtFourBodyPhsp.hh
+++ b/EvtGenModels/EvtFourBodyPhsp.hh
@@ -39,8 +39,8 @@
variable = 4
};
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void init() override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtGenericDalitz.hh b/EvtGenModels/EvtGenericDalitz.hh
--- a/EvtGenModels/EvtGenericDalitz.hh
+++ b/EvtGenModels/EvtGenericDalitz.hh
@@ -34,8 +34,8 @@
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
diff --git a/EvtGenModels/EvtGoityRoberts.hh b/EvtGenModels/EvtGoityRoberts.hh
--- a/EvtGenModels/EvtGoityRoberts.hh
+++ b/EvtGenModels/EvtGoityRoberts.hh
@@ -28,8 +28,8 @@
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;
diff --git a/EvtGenModels/EvtHQET.hh b/EvtGenModels/EvtHQET.hh
--- a/EvtGenModels/EvtHQET.hh
+++ b/EvtGenModels/EvtHQET.hh
@@ -33,8 +33,8 @@
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;
diff --git a/EvtGenModels/EvtHQET2.hh b/EvtGenModels/EvtHQET2.hh
--- a/EvtGenModels/EvtHQET2.hh
+++ b/EvtGenModels/EvtHQET2.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtHelAmp.hh b/EvtGenModels/EvtHelAmp.hh
--- a/EvtGenModels/EvtHelAmp.hh
+++ b/EvtGenModels/EvtHelAmp.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtHypNonLepton.hh b/EvtGenModels/EvtHypNonLepton.hh
--- a/EvtGenModels/EvtHypNonLepton.hh
+++ b/EvtGenModels/EvtHypNonLepton.hh
@@ -29,8 +29,8 @@
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;
@@ -42,7 +42,7 @@
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
--- a/EvtGenModels/EvtISGW.hh
+++ b/EvtGenModels/EvtISGW.hh
@@ -30,8 +30,8 @@
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;
diff --git a/EvtGenModels/EvtISGW2.hh b/EvtGenModels/EvtISGW2.hh
--- a/EvtGenModels/EvtISGW2.hh
+++ b/EvtGenModels/EvtISGW2.hh
@@ -37,8 +37,8 @@
class EvtISGW2 : 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;
diff --git a/EvtGenModels/EvtKKLambdaC.hh b/EvtGenModels/EvtKKLambdaC.hh
--- a/EvtGenModels/EvtKKLambdaC.hh
+++ b/EvtGenModels/EvtKKLambdaC.hh
@@ -33,8 +33,8 @@
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;
diff --git a/EvtGenModels/EvtKStopizmumu.hh b/EvtGenModels/EvtKStopizmumu.hh
--- a/EvtGenModels/EvtKStopizmumu.hh
+++ b/EvtGenModels/EvtKStopizmumu.hh
@@ -31,9 +31,9 @@
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;
diff --git a/EvtGenModels/EvtKstarnunu.hh b/EvtGenModels/EvtKstarnunu.hh
--- a/EvtGenModels/EvtKstarnunu.hh
+++ b/EvtGenModels/EvtKstarnunu.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtLNuGamma.hh b/EvtGenModels/EvtLNuGamma.hh
--- a/EvtGenModels/EvtLNuGamma.hh
+++ b/EvtGenModels/EvtLNuGamma.hh
@@ -30,8 +30,8 @@
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;
diff --git a/EvtGenModels/EvtLambdaP_BarGamma.hh b/EvtGenModels/EvtLambdaP_BarGamma.hh
--- a/EvtGenModels/EvtLambdaP_BarGamma.hh
+++ b/EvtGenModels/EvtLambdaP_BarGamma.hh
@@ -35,8 +35,8 @@
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;
diff --git a/EvtGenModels/EvtLambdacPHH.hh b/EvtGenModels/EvtLambdacPHH.hh
--- a/EvtGenModels/EvtLambdacPHH.hh
+++ b/EvtGenModels/EvtLambdacPHH.hh
@@ -38,8 +38,8 @@
public:
EvtLambdacPHH();
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void init() override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtLb2Baryonlnu.hh b/EvtGenModels/EvtLb2Baryonlnu.hh
--- a/EvtGenModels/EvtLb2Baryonlnu.hh
+++ b/EvtGenModels/EvtLb2Baryonlnu.hh
@@ -37,8 +37,8 @@
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;
diff --git a/EvtGenModels/EvtLb2plnuLCSR.hh b/EvtGenModels/EvtLb2plnuLCSR.hh
--- a/EvtGenModels/EvtLb2plnuLCSR.hh
+++ b/EvtGenModels/EvtLb2plnuLCSR.hh
@@ -39,8 +39,8 @@
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;
diff --git a/EvtGenModels/EvtLb2plnuLQCD.hh b/EvtGenModels/EvtLb2plnuLQCD.hh
--- a/EvtGenModels/EvtLb2plnuLQCD.hh
+++ b/EvtGenModels/EvtLb2plnuLQCD.hh
@@ -39,8 +39,8 @@
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;
diff --git a/EvtGenModels/EvtMelikhov.hh b/EvtGenModels/EvtMelikhov.hh
--- a/EvtGenModels/EvtMelikhov.hh
+++ b/EvtGenModels/EvtMelikhov.hh
@@ -33,8 +33,8 @@
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;
diff --git a/EvtGenModels/EvtOmegaDalitz.hh b/EvtGenModels/EvtOmegaDalitz.hh
--- a/EvtGenModels/EvtOmegaDalitz.hh
+++ b/EvtGenModels/EvtOmegaDalitz.hh
@@ -31,8 +31,8 @@
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;
diff --git a/EvtGenModels/EvtPVVCPLH.hh b/EvtGenModels/EvtPVVCPLH.hh
--- a/EvtGenModels/EvtPVVCPLH.hh
+++ b/EvtGenModels/EvtPVVCPLH.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtPartWave.hh b/EvtGenModels/EvtPartWave.hh
--- a/EvtGenModels/EvtPartWave.hh
+++ b/EvtGenModels/EvtPartWave.hh
@@ -35,8 +35,8 @@
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;
diff --git a/EvtGenModels/EvtPhiDalitz.hh b/EvtGenModels/EvtPhiDalitz.hh
--- a/EvtGenModels/EvtPhiDalitz.hh
+++ b/EvtGenModels/EvtPhiDalitz.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtPhsp.hh b/EvtGenModels/EvtPhsp.hh
--- a/EvtGenModels/EvtPhsp.hh
+++ b/EvtGenModels/EvtPhsp.hh
@@ -31,9 +31,9 @@
class EvtPhsp : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtPhspDecaytimeCut.hh b/EvtGenModels/EvtPhspDecaytimeCut.hh
--- a/EvtGenModels/EvtPhspDecaytimeCut.hh
+++ b/EvtGenModels/EvtPhspDecaytimeCut.hh
@@ -31,9 +31,9 @@
class EvtPhspDecaytimeCut : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtPhspFlatLifetime.hh b/EvtGenModels/EvtPhspFlatLifetime.hh
--- a/EvtGenModels/EvtPhspFlatLifetime.hh
+++ b/EvtGenModels/EvtPhspFlatLifetime.hh
@@ -38,10 +38,10 @@
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;
diff --git a/EvtGenModels/EvtPi0Dalitz.hh b/EvtGenModels/EvtPi0Dalitz.hh
--- a/EvtGenModels/EvtPi0Dalitz.hh
+++ b/EvtGenModels/EvtPi0Dalitz.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtPsi2JpsiPiPi.hh b/EvtGenModels/EvtPsi2JpsiPiPi.hh
--- a/EvtGenModels/EvtPsi2JpsiPiPi.hh
+++ b/EvtGenModels/EvtPsi2JpsiPiPi.hh
@@ -36,8 +36,8 @@
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;
diff --git a/EvtGenModels/EvtPto3P.hh b/EvtGenModels/EvtPto3P.hh
--- a/EvtGenModels/EvtPto3P.hh
+++ b/EvtGenModels/EvtPto3P.hh
@@ -32,8 +32,8 @@
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;
diff --git a/EvtGenModels/EvtRareLbToLll.hh b/EvtGenModels/EvtRareLbToLll.hh
--- a/EvtGenModels/EvtRareLbToLll.hh
+++ b/EvtGenModels/EvtRareLbToLll.hh
@@ -36,9 +36,9 @@
class EvtRareLbToLll : public EvtDecayAmp {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void init() override;
diff --git a/EvtGenModels/EvtSLBKPole.hh b/EvtGenModels/EvtSLBKPole.hh
--- a/EvtGenModels/EvtSLBKPole.hh
+++ b/EvtGenModels/EvtSLBKPole.hh
@@ -33,8 +33,8 @@
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;
diff --git a/EvtGenModels/EvtSLN.hh b/EvtGenModels/EvtSLN.hh
--- a/EvtGenModels/EvtSLN.hh
+++ b/EvtGenModels/EvtSLN.hh
@@ -31,8 +31,8 @@
public:
EvtSLN() {}
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void init() override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtSLPole.hh b/EvtGenModels/EvtSLPole.hh
--- a/EvtGenModels/EvtSLPole.hh
+++ b/EvtGenModels/EvtSLPole.hh
@@ -31,8 +31,8 @@
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;
diff --git a/EvtGenModels/EvtSSDCP.hh b/EvtGenModels/EvtSSDCP.hh
--- a/EvtGenModels/EvtSSDCP.hh
+++ b/EvtGenModels/EvtSSDCP.hh
@@ -31,8 +31,8 @@
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;
diff --git a/EvtGenModels/EvtSSD_DirectCP.hh b/EvtGenModels/EvtSSD_DirectCP.hh
--- a/EvtGenModels/EvtSSD_DirectCP.hh
+++ b/EvtGenModels/EvtSSD_DirectCP.hh
@@ -30,8 +30,8 @@
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;
diff --git a/EvtGenModels/EvtSSSCP.hh b/EvtGenModels/EvtSSSCP.hh
--- a/EvtGenModels/EvtSSSCP.hh
+++ b/EvtGenModels/EvtSSSCP.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtSSSCPT.hh b/EvtGenModels/EvtSSSCPT.hh
--- a/EvtGenModels/EvtSSSCPT.hh
+++ b/EvtGenModels/EvtSSSCPT.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtSSSCPpng.hh b/EvtGenModels/EvtSSSCPpng.hh
--- a/EvtGenModels/EvtSSSCPpng.hh
+++ b/EvtGenModels/EvtSSSCPpng.hh
@@ -30,8 +30,8 @@
class EvtSSSCPpng : public EvtDecayAmp {
public:
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtSTS.hh b/EvtGenModels/EvtSTS.hh
--- a/EvtGenModels/EvtSTS.hh
+++ b/EvtGenModels/EvtSTS.hh
@@ -29,8 +29,8 @@
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;
diff --git a/EvtGenModels/EvtSTSCP.hh b/EvtGenModels/EvtSTSCP.hh
--- a/EvtGenModels/EvtSTSCP.hh
+++ b/EvtGenModels/EvtSTSCP.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtSVP.hh b/EvtGenModels/EvtSVP.hh
--- a/EvtGenModels/EvtSVP.hh
+++ b/EvtGenModels/EvtSVP.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtSVPCP.hh b/EvtGenModels/EvtSVPCP.hh
--- a/EvtGenModels/EvtSVPCP.hh
+++ b/EvtGenModels/EvtSVPCP.hh
@@ -37,8 +37,8 @@
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;
diff --git a/EvtGenModels/EvtSVPHelAmp.hh b/EvtGenModels/EvtSVPHelAmp.hh
--- a/EvtGenModels/EvtSVPHelAmp.hh
+++ b/EvtGenModels/EvtSVPHelAmp.hh
@@ -39,8 +39,8 @@
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;
diff --git a/EvtGenModels/EvtSVPHelCPMix.hh b/EvtGenModels/EvtSVPHelCPMix.hh
--- a/EvtGenModels/EvtSVPHelCPMix.hh
+++ b/EvtGenModels/EvtSVPHelCPMix.hh
@@ -35,8 +35,8 @@
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;
diff --git a/EvtGenModels/EvtSVS.hh b/EvtGenModels/EvtSVS.hh
--- a/EvtGenModels/EvtSVS.hh
+++ b/EvtGenModels/EvtSVS.hh
@@ -29,8 +29,8 @@
class EvtSVS : 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;
diff --git a/EvtGenModels/EvtSVSCP.hh b/EvtGenModels/EvtSVSCP.hh
--- a/EvtGenModels/EvtSVSCP.hh
+++ b/EvtGenModels/EvtSVSCP.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtSVSCPLH.hh b/EvtGenModels/EvtSVSCPLH.hh
--- a/EvtGenModels/EvtSVSCPLH.hh
+++ b/EvtGenModels/EvtSVSCPLH.hh
@@ -32,8 +32,8 @@
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;
diff --git a/EvtGenModels/EvtSVSCPiso.hh b/EvtGenModels/EvtSVSCPiso.hh
--- a/EvtGenModels/EvtSVSCPiso.hh
+++ b/EvtGenModels/EvtSVSCPiso.hh
@@ -33,8 +33,8 @@
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;
diff --git a/EvtGenModels/EvtSVSNONCPEIGEN.hh b/EvtGenModels/EvtSVSNONCPEIGEN.hh
--- a/EvtGenModels/EvtSVSNONCPEIGEN.hh
+++ b/EvtGenModels/EvtSVSNONCPEIGEN.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtSVVCP.hh b/EvtGenModels/EvtSVVCP.hh
--- a/EvtGenModels/EvtSVVCP.hh
+++ b/EvtGenModels/EvtSVVCP.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtSVVCPLH.hh b/EvtGenModels/EvtSVVCPLH.hh
--- a/EvtGenModels/EvtSVVCPLH.hh
+++ b/EvtGenModels/EvtSVVCPLH.hh
@@ -29,8 +29,8 @@
public:
EvtSVVCPLH() {}
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
void init() override;
diff --git a/EvtGenModels/EvtSVVHelAmp.hh b/EvtGenModels/EvtSVVHelAmp.hh
--- a/EvtGenModels/EvtSVVHelAmp.hh
+++ b/EvtGenModels/EvtSVVHelAmp.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtSVVHelCPMix.hh b/EvtGenModels/EvtSVVHelCPMix.hh
--- a/EvtGenModels/EvtSVVHelCPMix.hh
+++ b/EvtGenModels/EvtSVVHelCPMix.hh
@@ -49,8 +49,8 @@
class EvtSVVHelCPMix : public EvtDecayAmp {
public:
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void init() override;
diff --git a/EvtGenModels/EvtSVVNONCPEIGEN.hh b/EvtGenModels/EvtSVVNONCPEIGEN.hh
--- a/EvtGenModels/EvtSVVNONCPEIGEN.hh
+++ b/EvtGenModels/EvtSVVNONCPEIGEN.hh
@@ -64,8 +64,8 @@
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;
diff --git a/EvtGenModels/EvtSingleParticle.hh b/EvtGenModels/EvtSingleParticle.hh
--- a/EvtGenModels/EvtSingleParticle.hh
+++ b/EvtGenModels/EvtSingleParticle.hh
@@ -29,9 +29,9 @@
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;
diff --git a/EvtGenModels/EvtSll.hh b/EvtGenModels/EvtSll.hh
--- a/EvtGenModels/EvtSll.hh
+++ b/EvtGenModels/EvtSll.hh
@@ -29,8 +29,8 @@
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;
diff --git a/EvtGenModels/EvtTSS.hh b/EvtGenModels/EvtTSS.hh
--- a/EvtGenModels/EvtTSS.hh
+++ b/EvtGenModels/EvtTSS.hh
@@ -30,8 +30,8 @@
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;
diff --git a/EvtGenModels/EvtTVP.hh b/EvtGenModels/EvtTVP.hh
--- a/EvtGenModels/EvtTVP.hh
+++ b/EvtGenModels/EvtTVP.hh
@@ -35,8 +35,8 @@
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;
diff --git a/EvtGenModels/EvtTVSPwave.hh b/EvtGenModels/EvtTVSPwave.hh
--- a/EvtGenModels/EvtTVSPwave.hh
+++ b/EvtGenModels/EvtTVSPwave.hh
@@ -32,8 +32,8 @@
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;
diff --git a/EvtGenModels/EvtTauHadnu.hh b/EvtGenModels/EvtTauHadnu.hh
--- a/EvtGenModels/EvtTauHadnu.hh
+++ b/EvtGenModels/EvtTauHadnu.hh
@@ -29,8 +29,8 @@
public:
EvtTauHadnu() {}
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
void init() override;
diff --git a/EvtGenModels/EvtTauScalarnu.hh b/EvtGenModels/EvtTauScalarnu.hh
--- a/EvtGenModels/EvtTauScalarnu.hh
+++ b/EvtGenModels/EvtTauScalarnu.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtTauVectornu.hh b/EvtGenModels/EvtTauVectornu.hh
--- a/EvtGenModels/EvtTauVectornu.hh
+++ b/EvtGenModels/EvtTauVectornu.hh
@@ -29,8 +29,8 @@
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;
diff --git a/EvtGenModels/EvtTaulnunu.hh b/EvtGenModels/EvtTaulnunu.hh
--- a/EvtGenModels/EvtTaulnunu.hh
+++ b/EvtGenModels/EvtTaulnunu.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtThreeBodyPhsp.hh b/EvtGenModels/EvtThreeBodyPhsp.hh
--- a/EvtGenModels/EvtThreeBodyPhsp.hh
+++ b/EvtGenModels/EvtThreeBodyPhsp.hh
@@ -31,9 +31,9 @@
class EvtThreeBodyPhsp : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtVPHOtoVISRHi.hh b/EvtGenModels/EvtVPHOtoVISRHi.hh
--- a/EvtGenModels/EvtVPHOtoVISRHi.hh
+++ b/EvtGenModels/EvtVPHOtoVISRHi.hh
@@ -29,8 +29,8 @@
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;
diff --git a/EvtGenModels/EvtVSPPwave.hh b/EvtGenModels/EvtVSPPwave.hh
--- a/EvtGenModels/EvtVSPPwave.hh
+++ b/EvtGenModels/EvtVSPPwave.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtVSS.hh b/EvtGenModels/EvtVSS.hh
--- a/EvtGenModels/EvtVSS.hh
+++ b/EvtGenModels/EvtVSS.hh
@@ -27,8 +27,8 @@
class EvtVSS : 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;
diff --git a/EvtGenModels/EvtVSSBMixCPT.hh b/EvtGenModels/EvtVSSBMixCPT.hh
--- a/EvtGenModels/EvtVSSBMixCPT.hh
+++ b/EvtGenModels/EvtVSSBMixCPT.hh
@@ -32,14 +32,14 @@
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;
diff --git a/EvtGenModels/EvtVSSMix.hh b/EvtGenModels/EvtVSSMix.hh
--- a/EvtGenModels/EvtVSSMix.hh
+++ b/EvtGenModels/EvtVSSMix.hh
@@ -29,8 +29,8 @@
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;
diff --git a/EvtGenModels/EvtVVP.hh b/EvtGenModels/EvtVVP.hh
--- a/EvtGenModels/EvtVVP.hh
+++ b/EvtGenModels/EvtVVP.hh
@@ -36,8 +36,8 @@
public:
EvtVVP() {}
- std::string getName() override;
- EvtDecayBase* clone() override;
+ std::string getName() const override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
void init() override;
diff --git a/EvtGenModels/EvtVVPIPI_WEIGHTED.hh b/EvtGenModels/EvtVVPIPI_WEIGHTED.hh
--- a/EvtGenModels/EvtVVPIPI_WEIGHTED.hh
+++ b/EvtGenModels/EvtVVPIPI_WEIGHTED.hh
@@ -32,8 +32,8 @@
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;
diff --git a/EvtGenModels/EvtVVSPwave.hh b/EvtGenModels/EvtVVSPwave.hh
--- a/EvtGenModels/EvtVVSPwave.hh
+++ b/EvtGenModels/EvtVVSPwave.hh
@@ -29,8 +29,8 @@
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;
diff --git a/EvtGenModels/EvtVVpipi.hh b/EvtGenModels/EvtVVpipi.hh
--- a/EvtGenModels/EvtVVpipi.hh
+++ b/EvtGenModels/EvtVVpipi.hh
@@ -30,8 +30,8 @@
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;
diff --git a/EvtGenModels/EvtVectorIsr.hh b/EvtGenModels/EvtVectorIsr.hh
--- a/EvtGenModels/EvtVectorIsr.hh
+++ b/EvtGenModels/EvtVectorIsr.hh
@@ -32,9 +32,9 @@
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;
diff --git a/EvtGenModels/EvtVll.hh b/EvtGenModels/EvtVll.hh
--- a/EvtGenModels/EvtVll.hh
+++ b/EvtGenModels/EvtVll.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtVtoSll.hh b/EvtGenModels/EvtVtoSll.hh
--- a/EvtGenModels/EvtVtoSll.hh
+++ b/EvtGenModels/EvtVtoSll.hh
@@ -27,8 +27,8 @@
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;
diff --git a/EvtGenModels/EvtVub.hh b/EvtGenModels/EvtVub.hh
--- a/EvtGenModels/EvtVub.hh
+++ b/EvtGenModels/EvtVub.hh
@@ -36,9 +36,9 @@
class EvtVub : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtVubBLNP.hh b/EvtGenModels/EvtVubBLNP.hh
--- a/EvtGenModels/EvtVubBLNP.hh
+++ b/EvtGenModels/EvtVubBLNP.hh
@@ -32,9 +32,9 @@
class EvtVubBLNP : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtVubBLNPHybrid.hh b/EvtGenModels/EvtVubBLNPHybrid.hh
--- a/EvtGenModels/EvtVubBLNPHybrid.hh
+++ b/EvtGenModels/EvtVubBLNPHybrid.hh
@@ -44,9 +44,9 @@
class EvtVubBLNPHybrid : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtVubHybrid.hh b/EvtGenModels/EvtVubHybrid.hh
--- a/EvtGenModels/EvtVubHybrid.hh
+++ b/EvtGenModels/EvtVubHybrid.hh
@@ -46,9 +46,9 @@
class EvtVubHybrid : public EvtDecayIncoherent {
public:
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtVubNLO.hh b/EvtGenModels/EvtVubNLO.hh
--- a/EvtGenModels/EvtVubNLO.hh
+++ b/EvtGenModels/EvtVubNLO.hh
@@ -39,9 +39,9 @@
EvtVubNLO() = default;
~EvtVubNLO();
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
diff --git a/EvtGenModels/EvtXPsiGamma.hh b/EvtGenModels/EvtXPsiGamma.hh
--- a/EvtGenModels/EvtXPsiGamma.hh
+++ b/EvtGenModels/EvtXPsiGamma.hh
@@ -39,8 +39,8 @@
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;
diff --git a/EvtGenModels/EvtY3SToY1SpipiMoxhay.hh b/EvtGenModels/EvtY3SToY1SpipiMoxhay.hh
--- a/EvtGenModels/EvtY3SToY1SpipiMoxhay.hh
+++ b/EvtGenModels/EvtY3SToY1SpipiMoxhay.hh
@@ -46,8 +46,8 @@
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;
diff --git a/EvtGenModels/EvtYmSToYnSpipiCLEO.hh b/EvtGenModels/EvtYmSToYnSpipiCLEO.hh
--- a/EvtGenModels/EvtYmSToYnSpipiCLEO.hh
+++ b/EvtGenModels/EvtYmSToYnSpipiCLEO.hh
@@ -52,8 +52,8 @@
//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;
diff --git a/EvtGenModels/EvtbTosllAli.hh b/EvtGenModels/EvtbTosllAli.hh
--- a/EvtGenModels/EvtbTosllAli.hh
+++ b/EvtGenModels/EvtbTosllAli.hh
@@ -34,8 +34,8 @@
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;
diff --git a/EvtGenModels/EvtbTosllBall.hh b/EvtGenModels/EvtbTosllBall.hh
--- a/EvtGenModels/EvtbTosllBall.hh
+++ b/EvtGenModels/EvtbTosllBall.hh
@@ -33,8 +33,8 @@
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;
diff --git a/EvtGenModels/EvtbTosllMS.hh b/EvtGenModels/EvtbTosllMS.hh
--- a/EvtGenModels/EvtbTosllMS.hh
+++ b/EvtGenModels/EvtbTosllMS.hh
@@ -40,8 +40,8 @@
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;
diff --git a/EvtGenModels/EvtbTosllMSExt.hh b/EvtGenModels/EvtbTosllMSExt.hh
--- a/EvtGenModels/EvtbTosllMSExt.hh
+++ b/EvtGenModels/EvtbTosllMSExt.hh
@@ -41,8 +41,8 @@
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;
diff --git a/EvtGenModels/Evtbs2llGammaISRFSR.hh b/EvtGenModels/Evtbs2llGammaISRFSR.hh
--- a/EvtGenModels/Evtbs2llGammaISRFSR.hh
+++ b/EvtGenModels/Evtbs2llGammaISRFSR.hh
@@ -35,8 +35,8 @@
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;
diff --git a/EvtGenModels/Evtbs2llGammaMNT.hh b/EvtGenModels/Evtbs2llGammaMNT.hh
--- a/EvtGenModels/Evtbs2llGammaMNT.hh
+++ b/EvtGenModels/Evtbs2llGammaMNT.hh
@@ -40,8 +40,8 @@
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;
diff --git a/History.md b/History.md
--- a/History.md
+++ b/History.md
@@ -11,6 +11,16 @@
===
## R02-0X-00
+4 Oct 2024 Heather Ratcliffe, Thomas Latham, Fernando Abudinen
+* D132: Introduce thread safety
+ - Protect statics: make them const or thread\_local
+ - Improve const-correctness of many functions
+ - Make thread\_local the RNG, particle property table, external factory, decay tables, and sym tables
+ - Add explicit mutexing to non-thread-safe externals (Sherpa, Tauola, Photos)
+ - Propagate the EvtGen seed to the Fortran RNG in Tauola
+ - Some fixes to EvtBtoXsEtap and EvtBtoXsgamma
+ - Reorganise test code for multi-threading
+
1 Oct 2024 Fernando Abudinen
* D131: Tauola tests
- Translated TAUOLA tests in validation to new json format
diff --git a/src/EvtGen.cpp b/src/EvtGen.cpp
--- a/src/EvtGen.cpp
+++ b/src/EvtGen.cpp
@@ -54,7 +54,7 @@
//the destruction of objects that it depends on, e.g., EvtPDL.
if ( getenv( "EVTINFO" ) ) {
- EvtDecayTable::getInstance()->printSummary();
+ EvtDecayTable::getInstance().printSummary();
}
}
@@ -90,8 +90,8 @@
{
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Initializing EvtGen" << endl;
- if ( randomEngine == nullptr ) {
- static EvtSimpleRandomEngine defaultRandomEngine;
+ if ( !randomEngine ) {
+ static thread_local EvtSimpleRandomEngine defaultRandomEngine;
EvtRandom::setRandomEngine( &defaultRandomEngine );
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "No random engine given in "
@@ -110,9 +110,9 @@
EvtPDL::readPDT( pdtTable );
if ( useXml ) {
- EvtDecayTable::getInstance()->readXMLDecayFile( decayName, false );
+ EvtDecayTable::getInstance().readXMLDecayFile( decayName, false );
} else {
- EvtDecayTable::getInstance()->readDecayFile( decayName, false );
+ EvtDecayTable::getInstance().readDecayFile( decayName, false );
}
m_mixingType = mixingType;
@@ -146,9 +146,9 @@
indec.open( uDecayName );
if ( indec ) {
if ( useXml ) {
- EvtDecayTable::getInstance()->readXMLDecayFile( uDecayName, true );
+ EvtDecayTable::getInstance().readXMLDecayFile( uDecayName, true );
} else {
- EvtDecayTable::getInstance()->readDecayFile( uDecayName, true );
+ EvtDecayTable::getInstance().readDecayFile( uDecayName, true );
}
} else {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
diff --git a/src/EvtGenBase/EvtAmp.cpp b/src/EvtGenBase/EvtAmp.cpp
--- a/src/EvtGenBase/EvtAmp.cpp
+++ b/src/EvtGenBase/EvtAmp.cpp
@@ -64,7 +64,7 @@
}
}
-void EvtAmp::init( EvtId p, int ndaugs, EvtId* daug )
+void EvtAmp::init( EvtId p, int ndaugs, const EvtId* daug )
{
setNDaug( ndaugs );
int ichild;
@@ -138,7 +138,7 @@
return m_amp[position];
}
-EvtSpinDensity EvtAmp::getSpinDensity()
+EvtSpinDensity EvtAmp::getSpinDensity() const
{
EvtSpinDensity rho;
rho.setDim( m_pstates );
@@ -200,7 +200,7 @@
}
}
-EvtSpinDensity EvtAmp::getBackwardSpinDensity( EvtSpinDensity* rho_list )
+EvtSpinDensity EvtAmp::getBackwardSpinDensity( EvtSpinDensity* rho_list ) const
{
EvtSpinDensity rho;
@@ -226,7 +226,7 @@
return ampprime.contract( 0, ( *this ) );
}
-EvtSpinDensity EvtAmp::getForwardSpinDensity( EvtSpinDensity* rho_list, int i )
+EvtSpinDensity EvtAmp::getForwardSpinDensity( EvtSpinDensity* rho_list, int i ) const
{
EvtSpinDensity rho;
@@ -257,7 +257,7 @@
return ampprime.contract( m_dnontrivial[i], ( *this ) );
}
-EvtAmp EvtAmp::contract( int k, const EvtSpinDensity& rho )
+EvtAmp EvtAmp::contract( int k, const EvtSpinDensity& rho ) const
{
EvtAmp temp;
@@ -319,7 +319,7 @@
return temp;
}
-EvtSpinDensity EvtAmp::contract( int k, const EvtAmp& amp2 )
+EvtSpinDensity EvtAmp::contract( int k, const EvtAmp& amp2 ) const
{
int i, j, l;
@@ -380,7 +380,7 @@
return rho;
}
-EvtAmp EvtAmp::contract( int, const EvtAmp&, const EvtAmp& )
+EvtAmp EvtAmp::contract( int, const EvtAmp&, const EvtAmp& ) const
{
//Do we need this method?
EvtAmp tmp;
@@ -389,7 +389,7 @@
return tmp;
}
-void EvtAmp::dump()
+void EvtAmp::dump() const
{
int i, list[10];
for ( i = 0; i < 10; i++ ) {
diff --git a/src/EvtGenBase/EvtCPUtil.cpp b/src/EvtGenBase/EvtCPUtil.cpp
--- a/src/EvtGenBase/EvtCPUtil.cpp
+++ b/src/EvtGenBase/EvtCPUtil.cpp
@@ -41,7 +41,7 @@
EvtCPUtil* EvtCPUtil::getInstance()
{
- static EvtCPUtil* theCPUtil = nullptr;
+ static thread_local EvtCPUtil* theCPUtil = nullptr;
if ( !theCPUtil ) {
theCPUtil = new EvtCPUtil( 1 );
@@ -153,16 +153,16 @@
double probB0 )
{
//Can not call this recursively!!!
- static int entryCount = 0;
+ static thread_local int entryCount = 0;
entryCount++;
//added by Lange Jan4,2000
- static EvtId B0B = EvtPDL::getId( "anti-B0" );
- static EvtId B0 = EvtPDL::getId( "B0" );
- static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
- static EvtId BS = EvtPDL::getId( "B_s0" );
+ static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+ static const EvtId B0 = EvtPDL::getId( "B0" );
+ static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+ static const EvtId BS = EvtPDL::getId( "B_s0" );
- static EvtId UPS4S = EvtPDL::getId( "Upsilon(4S)" );
+ static const EvtId UPS4S = EvtPDL::getId( "Upsilon(4S)" );
int isB0 = EvtRandom::Flat( 0.0, 1.0 ) < probB0;
@@ -294,8 +294,8 @@
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;
@@ -312,8 +312,8 @@
if ( !( p->getParent() ) )
return false;
- 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" );
if ( ( p->getId() != B0 ) && ( p->getId() != B0B ) )
return false;
@@ -371,18 +371,18 @@
//============================================================================
void EvtCPUtil::OtherB( EvtParticle* p, double& t, EvtId& otherb )
{
- static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
- static EvtId BS0 = EvtPDL::getId( "B_s0" );
- static EvtId B0B = EvtPDL::getId( "anti-B0" );
- static EvtId B0 = EvtPDL::getId( "B0" );
- static EvtId D0B = EvtPDL::getId( "anti-D0" );
- static EvtId D0 = EvtPDL::getId( "D0" );
- static EvtId UPS4 = EvtPDL::getId( "Upsilon(4S)" );
+ static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+ static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+ static const EvtId B0B = EvtPDL::getId( "anti-B0" );
+ static const EvtId B0 = EvtPDL::getId( "B0" );
+ static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+ static const EvtId D0 = EvtPDL::getId( "D0" );
+ static const EvtId UPS4 = EvtPDL::getId( "Upsilon(4S)" );
if ( p->getId() == BS0 || p->getId() == BSB ) {
- static double ctauL = EvtPDL::getctau( EvtPDL::getId( "B_s0L" ) );
- static double ctauH = EvtPDL::getctau( EvtPDL::getId( "B_s0H" ) );
- static double ctau = ctauL < ctauH ? ctauH : ctauL;
+ static const double ctauL = EvtPDL::getctau( EvtPDL::getId( "B_s0L" ) );
+ static const double ctauH = EvtPDL::getctau( EvtPDL::getId( "B_s0H" ) );
+ static const double ctau = ctauL < ctauH ? ctauH : ctauL;
t = -log( EvtRandom::Flat() ) * ctau;
EvtParticle* parent = p->getParent();
if ( parent != nullptr &&
@@ -403,9 +403,9 @@
}
if ( p->getId() == D0 || p->getId() == D0B ) {
- static double ctauL = EvtPDL::getctau( EvtPDL::getId( "D0L" ) );
- static double ctauH = EvtPDL::getctau( EvtPDL::getId( "D0H" ) );
- static double ctau = ctauL < ctauH ? ctauH : ctauL;
+ static const double ctauL = EvtPDL::getctau( EvtPDL::getId( "D0L" ) );
+ static const double ctauH = EvtPDL::getctau( EvtPDL::getId( "D0H" ) );
+ static const double ctau = ctauL < ctauH ? ctauH : ctauL;
t = -log( EvtRandom::Flat() ) * ctau;
EvtParticle* parent = p->getParent();
if ( parent != nullptr &&
@@ -474,16 +474,16 @@
EvtId lId = EvtPDL::getId( lname );
EvtId hId = EvtPDL::getId( hname );
- double ctauL = EvtPDL::getctau( lId );
- double ctauH = EvtPDL::getctau( hId );
+ const double ctauL = EvtPDL::getctau( lId );
+ const double ctauH = EvtPDL::getctau( hId );
// Bug Fixed: Corrected the average as gamma is the relevent parameter
- double ctau = 2.0 * ( ctauL * ctauH ) / ( ctauL + ctauH );
+ const double ctau = 2.0 * ( ctauL * ctauH ) / ( ctauL + ctauH );
//double ctau=0.5*(ctauL+ctauH);
// Bug Fixed: ctau definition changed above
//double y=(ctauH-ctauL)/(2*ctau);
- double y = ( ctauH - ctauL ) / ( ctauH + ctauL );
+ const double y = ( ctauH - ctauL ) / ( ctauH + ctauL );
//deltam and qoverp defined in DECAY.DEC
@@ -511,7 +511,7 @@
double prob;
// Find the longest of the two lifetimes
- double ctaulong = ctauL <= ctauH ? ctauH : ctauL;
+ const double ctaulong = ctauL <= ctauH ? ctauH : ctauL;
// Bug fixed: Ensure cosine argument is dimensionless so /ctau
do {
diff --git a/src/EvtGenBase/EvtDecayBase.cpp b/src/EvtGenBase/EvtDecayBase.cpp
--- a/src/EvtGenBase/EvtDecayBase.cpp
+++ b/src/EvtGenBase/EvtDecayBase.cpp
@@ -205,8 +205,8 @@
} //initProbMax
-void EvtDecayBase::saveDecayInfo( EvtId ipar, int ndaug, EvtId* daug, int narg,
- std::vector<std::string>& args,
+void EvtDecayBase::saveDecayInfo( EvtId ipar, int ndaug, const EvtId* daug,
+ int narg, std::vector<std::string>& args,
std::string name, double brfr )
{
int i;
@@ -419,8 +419,8 @@
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;
diff --git a/src/EvtGenBase/EvtDecayTable.cpp b/src/EvtGenBase/EvtDecayTable.cpp
--- a/src/EvtGenBase/EvtDecayTable.cpp
+++ b/src/EvtGenBase/EvtDecayTable.cpp
@@ -55,18 +55,14 @@
m_decaytable.clear();
}
-EvtDecayTable* EvtDecayTable::getInstance()
+EvtDecayTable& EvtDecayTable::getInstance()
{
- static EvtDecayTable* theDecayTable = nullptr;
-
- if ( !theDecayTable ) {
- theDecayTable = new EvtDecayTable();
- }
+ static thread_local EvtDecayTable theDecayTable;
return theDecayTable;
}
-int EvtDecayTable::getNMode( int ipar )
+int EvtDecayTable::getNMode( int ipar ) const
{
return m_decaytable[ipar].getNMode();
}
@@ -76,7 +72,7 @@
return m_decaytable[ipar].getDecayModel( imode );
}
-void EvtDecayTable::printSummary()
+void EvtDecayTable::printSummary() const
{
for ( size_t i = 0; i < EvtPDL::entries(); i++ ) {
m_decaytable[i].printSummary();
@@ -1476,13 +1472,13 @@
}
}
-bool EvtDecayTable::stringToBoolean( std::string valStr )
+bool EvtDecayTable::stringToBoolean( std::string valStr ) const
{
return ( valStr == "true" || valStr == "1" || valStr == "on" ||
valStr == "yes" );
}
-void EvtDecayTable::checkParticle( std::string particle )
+void EvtDecayTable::checkParticle( std::string particle ) const
{
if ( EvtPDL::getId( particle ) == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
@@ -1513,13 +1509,13 @@
return theModel;
}
-bool EvtDecayTable::hasPythia( EvtId id )
+bool EvtDecayTable::hasPythia( EvtId id ) const
{
bool hasPythia = this->hasPythia( id.getAlias() );
return hasPythia;
}
-bool EvtDecayTable::hasPythia( int aliasInt )
+bool EvtDecayTable::hasPythia( int aliasInt ) const
{
bool hasPythia( false );
if ( aliasInt >= 0 && aliasInt < (int)EvtPDL::entries() ) {
@@ -1529,13 +1525,13 @@
return hasPythia;
}
-int EvtDecayTable::getNModes( EvtId id )
+int EvtDecayTable::getNModes( EvtId id ) const
{
int nModes = this->getNModes( id.getAlias() );
return nModes;
}
-int EvtDecayTable::getNModes( int aliasInt )
+int EvtDecayTable::getNModes( int aliasInt ) const
{
int nModes( 0 );
@@ -1547,7 +1543,7 @@
}
int EvtDecayTable::findChannel( EvtId parent, std::string model, int ndaug,
- EvtId* daugs, int narg, std::string* args )
+ EvtId* daugs, int narg, std::string* args ) const
{
int i, j, right;
EvtId daugs_scratch[50];
@@ -1612,7 +1608,7 @@
return -1;
}
-int EvtDecayTable::inChannelList( EvtId parent, int ndaug, EvtId* daugs )
+int EvtDecayTable::inChannelList( EvtId parent, int ndaug, EvtId* daugs ) const
{
int i, j, k;
EvtId daugs_scratch[MAX_DAUG];
@@ -1663,7 +1659,7 @@
}
std::vector<std::string> EvtDecayTable::splitString( std::string& theString,
- std::string& splitter )
+ std::string& splitter ) const
{
// Code from STLplus
std::vector<std::string> result;
diff --git a/src/EvtGenBase/EvtDiracSpinor.cpp b/src/EvtGenBase/EvtDiracSpinor.cpp
--- a/src/EvtGenBase/EvtDiracSpinor.cpp
+++ b/src/EvtGenBase/EvtDiracSpinor.cpp
@@ -262,7 +262,7 @@
// no conjugate here; done in the multiplication
// yes this is stupid and fooled me to for a long time (ryd)
- static EvtGammaMatrix m = EvtGammaMatrix::g0() * EvtGammaMatrix::g5();
+ static const EvtGammaMatrix m = EvtGammaMatrix::g0() * EvtGammaMatrix::g5();
temp = d * ( m * dp );
return temp;
@@ -274,22 +274,22 @@
temp.zero();
EvtComplex i2( 0, 0.5 );
- static EvtGammaMatrix mat01 =
+ static const EvtGammaMatrix mat01 =
EvtGammaMatrix::g0() * ( EvtGammaMatrix::g0() * EvtGammaMatrix::g1() -
EvtGammaMatrix::g1() * EvtGammaMatrix::g0() );
- static EvtGammaMatrix mat02 =
+ static const EvtGammaMatrix mat02 =
EvtGammaMatrix::g0() * ( EvtGammaMatrix::g0() * EvtGammaMatrix::g2() -
EvtGammaMatrix::g2() * EvtGammaMatrix::g0() );
- static EvtGammaMatrix mat03 =
+ static const EvtGammaMatrix mat03 =
EvtGammaMatrix::g0() * ( EvtGammaMatrix::g0() * EvtGammaMatrix::g3() -
EvtGammaMatrix::g3() * EvtGammaMatrix::g0() );
- static EvtGammaMatrix mat12 =
+ static const EvtGammaMatrix mat12 =
EvtGammaMatrix::g0() * ( EvtGammaMatrix::g1() * EvtGammaMatrix::g2() -
EvtGammaMatrix::g2() * EvtGammaMatrix::g1() );
- static EvtGammaMatrix mat13 =
+ static const EvtGammaMatrix mat13 =
EvtGammaMatrix::g0() * ( EvtGammaMatrix::g1() * EvtGammaMatrix::g3() -
EvtGammaMatrix::g3() * EvtGammaMatrix::g1() );
- static EvtGammaMatrix mat23 =
+ static const EvtGammaMatrix mat23 =
EvtGammaMatrix::g0() * ( EvtGammaMatrix::g2() * EvtGammaMatrix::g3() -
EvtGammaMatrix::g3() * EvtGammaMatrix::g2() );
@@ -327,7 +327,7 @@
EvtDiracSpinor EvtDiracSpinor::adjoint() const
{
EvtDiracSpinor d = this->conj(); // first conjugate, then multiply with gamma0
- EvtGammaMatrix g0 = EvtGammaMatrix::g0();
+ const EvtGammaMatrix g0 = EvtGammaMatrix::g0();
EvtDiracSpinor result; // automatically initialized to 0
for ( int i = 0; i < 4; ++i )
diff --git a/src/EvtGenBase/EvtExtGeneratorCommandsTable.cpp b/src/EvtGenBase/EvtExtGeneratorCommandsTable.cpp
--- a/src/EvtGenBase/EvtExtGeneratorCommandsTable.cpp
+++ b/src/EvtGenBase/EvtExtGeneratorCommandsTable.cpp
@@ -32,7 +32,7 @@
EvtExtGeneratorCommandsTable* EvtExtGeneratorCommandsTable::getInstance()
{
- static EvtExtGeneratorCommandsTable* theCommandMap = nullptr;
+ static thread_local EvtExtGeneratorCommandsTable* theCommandMap = nullptr;
if ( !theCommandMap ) {
theCommandMap = new EvtExtGeneratorCommandsTable();
diff --git a/src/EvtGenBase/EvtGammaMatrix.cpp b/src/EvtGenBase/EvtGammaMatrix.cpp
--- a/src/EvtGenBase/EvtGammaMatrix.cpp
+++ b/src/EvtGenBase/EvtGammaMatrix.cpp
@@ -37,7 +37,7 @@
{
int i, j;
- static EvtComplex zero( 0.0, 0.0 );
+ static const EvtComplex zero( 0.0, 0.0 );
for ( i = 0; i < 4; i++ ) {
for ( j = 0; j < 4; j++ ) {
@@ -107,7 +107,7 @@
{
int i, j;
- static EvtComplex zero( 0.0, 0.0 );
+ static const EvtComplex zero( 0.0, 0.0 );
for ( i = 0; i < 4; i++ ) {
for ( j = 0; j < 4; j++ ) {
@@ -118,8 +118,8 @@
const EvtGammaMatrix& EvtGammaMatrix::va0()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -146,8 +146,8 @@
const EvtGammaMatrix& EvtGammaMatrix::va1()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -174,8 +174,8 @@
const EvtGammaMatrix& EvtGammaMatrix::va2()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -202,8 +202,8 @@
const EvtGammaMatrix& EvtGammaMatrix::va3()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -230,8 +230,8 @@
const EvtGammaMatrix& EvtGammaMatrix::g0()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -255,8 +255,8 @@
const EvtGammaMatrix& EvtGammaMatrix::g1()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -279,8 +279,8 @@
const EvtGammaMatrix& EvtGammaMatrix::g2()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -303,8 +303,8 @@
const EvtGammaMatrix& EvtGammaMatrix::g3()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -327,8 +327,8 @@
const EvtGammaMatrix& EvtGammaMatrix::g5()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -371,8 +371,8 @@
const EvtGammaMatrix& EvtGammaMatrix::v0()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -395,8 +395,8 @@
const EvtGammaMatrix& EvtGammaMatrix::v1()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -419,8 +419,8 @@
const EvtGammaMatrix& EvtGammaMatrix::v2()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -443,8 +443,8 @@
const EvtGammaMatrix& EvtGammaMatrix::v3()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -467,8 +467,8 @@
const EvtGammaMatrix& EvtGammaMatrix::id()
{
- static EvtGammaMatrix g;
- static int first = 1;
+ static thread_local EvtGammaMatrix g;
+ static thread_local int first = 1;
if ( first ) {
first = 0;
@@ -556,8 +556,8 @@
const EvtGammaMatrix& EvtGammaMatrix::sigmaUpper( unsigned int mu,
unsigned int nu )
{
- static EvtGammaMatrix sigma[4][4];
- static bool hasBeenCalled = false;
+ static thread_local EvtGammaMatrix sigma[4][4];
+ static thread_local bool hasBeenCalled = false;
if ( !hasBeenCalled ) {
EvtComplex I( 0, 1 );
for ( int i = 0; i < 4; ++i )
@@ -597,8 +597,8 @@
{
const EvtComplex I( 0, 1 );
EvtGammaMatrix a, b;
- static EvtGammaMatrix sigma[4][4];
- static bool hasBeenCalled = false;
+ static thread_local EvtGammaMatrix sigma[4][4];
+ static thread_local bool hasBeenCalled = false;
static const EvtTensor4C eta = EvtTensor4C::g();
if ( !hasBeenCalled ) // has to be initialized only at the first call
diff --git a/src/EvtGenBase/EvtIncoherentMixing.cpp b/src/EvtGenBase/EvtIncoherentMixing.cpp
--- a/src/EvtGenBase/EvtIncoherentMixing.cpp
+++ b/src/EvtGenBase/EvtIncoherentMixing.cpp
@@ -58,8 +58,8 @@
//=============================================================================
void EvtIncoherentMixing::incoherentB0Mix( const EvtId id, double& t, int& mix )
{
- 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" );
if ( ( B0 != id ) && ( B0B != id ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
@@ -100,8 +100,8 @@
// ============================================================================
void EvtIncoherentMixing::incoherentBsMix( const EvtId id, double& t, int& mix )
{
- static EvtId BS = EvtPDL::getId( "B_s0" );
- static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+ static const EvtId BS = EvtPDL::getId( "B_s0" );
+ static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
if ( ( BS != id ) && ( BSB != id ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
@@ -146,8 +146,8 @@
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;
@@ -164,8 +164,8 @@
if ( !( p->getParent() ) )
return false;
- 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" );
if ( ( p->getId() != B0 ) && ( p->getId() != B0B ) )
return false;
diff --git a/src/EvtGenBase/EvtMTRandomEngine.cpp b/src/EvtGenBase/EvtMTRandomEngine.cpp
--- a/src/EvtGenBase/EvtMTRandomEngine.cpp
+++ b/src/EvtGenBase/EvtMTRandomEngine.cpp
@@ -24,8 +24,8 @@
#include <iostream>
-EvtMTRandomEngine::EvtMTRandomEngine( unsigned int seed ) :
- m_engine( seed ), m_distribution( URDist( 0.0, 1.0 ) )
+EvtMTRandomEngine::EvtMTRandomEngine( unsigned long int seed ) :
+ m_engine{ seed }, m_distribution{ 0.0, 1.0 }, m_lastSeed{ seed }
{
EvtGenReport( EVTGEN_INFO, "EvtMTRandomEngine" )
<< "Mersenne-Twister random number generator with seed = " << seed
@@ -37,7 +37,8 @@
return m_distribution( m_engine );
}
-void EvtMTRandomEngine::setSeed( unsigned int seed )
+void EvtMTRandomEngine::setSeed( unsigned long int seed )
{
m_engine.seed( seed );
+ m_lastSeed = seed;
}
diff --git a/src/EvtGenBase/EvtModel.cpp b/src/EvtGenBase/EvtModel.cpp
--- a/src/EvtGenBase/EvtModel.cpp
+++ b/src/EvtGenBase/EvtModel.cpp
@@ -37,7 +37,7 @@
#include <string>
using std::fstream;
-EvtModel* EvtModel::m_instance = nullptr;
+thread_local EvtModel* EvtModel::m_instance = nullptr;
EvtModel::EvtModel()
{
diff --git a/src/EvtGenBase/EvtPDL.cpp b/src/EvtGenBase/EvtPDL.cpp
--- a/src/EvtGenBase/EvtPDL.cpp
+++ b/src/EvtGenBase/EvtPDL.cpp
@@ -37,6 +37,13 @@
return theInstance;
}
+void EvtPDL::reset()
+{
+ m_firstAlias = std::numeric_limits<std::size_t>::max();
+ m_partlist.clear();
+ m_particleNameLookup.clear();
+}
+
void EvtPDL::read( const std::string& fname )
{
std::ifstream pdtIn( fname );
@@ -51,6 +58,8 @@
void EvtPDL::readPDT( std::istream& indec )
{
+ getInstance().reset();
+
char cmnd[100];
char xxxx[100];
@@ -339,7 +348,7 @@
return getInstance().m_partlist[i.getId()].getWidth();
}
-double EvtPDL::getctau( EvtId i )
+double EvtPDL::getctau( const EvtId i )
{
return getInstance().m_partlist[i.getId()].getctau();
}
diff --git a/src/EvtGenBase/EvtParticle.cpp b/src/EvtGenBase/EvtParticle.cpp
--- a/src/EvtGenBase/EvtParticle.cpp
+++ b/src/EvtGenBase/EvtParticle.cpp
@@ -313,14 +313,14 @@
//Will include effects of mixing here
//added by Lange Jan4,2000
- static EvtId BS0 = EvtPDL::getId( "B_s0" );
- static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
- static EvtId BD0 = EvtPDL::getId( "B0" );
- static EvtId BDB = EvtPDL::getId( "anti-B0" );
- static EvtId D0 = EvtPDL::getId( "D0" );
- static EvtId D0B = EvtPDL::getId( "anti-D0" );
- static EvtId U4S = EvtPDL::getId( "Upsilon(4S)" );
- static EvtIdSet borUps{ BS0, BSB, BD0, BDB, U4S };
+ static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+ static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+ static const EvtId BD0 = EvtPDL::getId( "B0" );
+ static const EvtId BDB = EvtPDL::getId( "anti-B0" );
+ static const EvtId D0 = EvtPDL::getId( "D0" );
+ static const EvtId D0B = EvtPDL::getId( "anti-D0" );
+ static const EvtId U4S = EvtPDL::getId( "Upsilon(4S)" );
+ static const EvtIdSet borUps{ BS0, BSB, BD0, BDB, U4S };
//only makes sense if there is no parent particle which is a B or an Upsilon
bool hasBorUps = false;
@@ -375,7 +375,7 @@
}
EvtDecayBase* decayer;
- decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
+ decayer = EvtDecayTable::getInstance().getDecayFunc( p );
if ( decayer ) {
p->makeDaughters( decayer->nRealDaughters(), decayer->getDaugs() );
@@ -450,7 +450,7 @@
//}
EvtDecayBase* decayer;
- decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
+ decayer = EvtDecayTable::getInstance().getDecayFunc( p );
// if ( decayer ) {
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "calling decay for " << EvtPDL::name(p->getId()) << " " << p->mass() << " " << p->getP4() << " " << p->getNDaug() << " " << p << endl;
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "NDaug= " << decayer->getNDaug() << endl;
@@ -480,10 +480,10 @@
return;
}
- static EvtId BS0 = EvtPDL::getId( "B_s0" );
- static EvtId BSB = EvtPDL::getId( "anti-B_s0" );
- static EvtId BD0 = EvtPDL::getId( "B0" );
- static EvtId BDB = EvtPDL::getId( "anti-B0" );
+ static const EvtId BS0 = EvtPDL::getId( "B_s0" );
+ static const EvtId BSB = EvtPDL::getId( "anti-B_s0" );
+ static const EvtId BD0 = EvtPDL::getId( "B0" );
+ static const EvtId BDB = EvtPDL::getId( "anti-B0" );
// static EvtId D0=EvtPDL::getId("D0");
// static EvtId D0B=EvtPDL::getId("anti-D0");
@@ -493,7 +493,7 @@
if ( m_ndaug == 1 &&
( thisId == BS0 || thisId == BSB || thisId == BD0 || thisId == BDB ) ) {
p = p->getDaug( 0 );
- decayer = EvtDecayTable::getInstance()->getDecayFunc( p );
+ decayer = EvtDecayTable::getInstance().getDecayFunc( p );
}
//now we have accepted a set of masses - time
if ( decayer != nullptr ) {
@@ -1097,7 +1097,8 @@
*part = new EvtStringParticle;
}
-double EvtParticle::initializePhaseSpace( size_t numdaughter, EvtId* daughters,
+double EvtParticle::initializePhaseSpace( size_t numdaughter,
+ const EvtId* daughters,
bool forceDaugMassReset,
double poleSize, int whichTwo1,
int whichTwo2 )
@@ -1107,8 +1108,8 @@
//lange
// this->makeDaughters(numdaughter,daughters);
- static EvtVector4R p4[100];
- static double mass[100];
+ static thread_local EvtVector4R p4[100];
+ static thread_local double mass[100];
m_b = this->mass();
@@ -1231,7 +1232,7 @@
delete[] idArray;
}
-void EvtParticle::makeDaughters( size_t ndaugstore, EvtId* id )
+void EvtParticle::makeDaughters( size_t ndaugstore, const EvtId* id )
{
if ( m_channel < 0 ) {
setChannel( 0 );
diff --git a/src/EvtGenBase/EvtParticleDecay.cpp b/src/EvtGenBase/EvtParticleDecay.cpp
--- a/src/EvtGenBase/EvtParticleDecay.cpp
+++ b/src/EvtGenBase/EvtParticleDecay.cpp
@@ -33,7 +33,7 @@
#include <string>
#include <vector>
using std::fstream;
-void EvtParticleDecay::printSummary()
+void EvtParticleDecay::printSummary() const
{
if ( m_decay != nullptr ) {
m_decay->printSummary();
diff --git a/src/EvtGenBase/EvtParticleDecayList.cpp b/src/EvtGenBase/EvtParticleDecayList.cpp
--- a/src/EvtGenBase/EvtParticleDecayList.cpp
+++ b/src/EvtGenBase/EvtParticleDecayList.cpp
@@ -82,7 +82,7 @@
delete[] m_decaylist;
}
-void EvtParticleDecayList::printSummary()
+void EvtParticleDecayList::printSummary() const
{
int i;
for ( i = 0; i < m_nmode; i++ ) {
diff --git a/src/EvtGenBase/EvtRadCorr.cpp b/src/EvtGenBase/EvtRadCorr.cpp
--- a/src/EvtGenBase/EvtRadCorr.cpp
+++ b/src/EvtGenBase/EvtRadCorr.cpp
@@ -27,24 +27,10 @@
#include <stdlib.h>
using std::endl;
-EvtAbsRadCorr* EvtRadCorr::m_fsrEngine = nullptr;
+thread_local EvtAbsRadCorr* EvtRadCorr::m_fsrEngine = nullptr;
bool EvtRadCorr::m_alwaysRadCorr = false;
bool EvtRadCorr::m_neverRadCorr = false;
-EvtRadCorr::EvtRadCorr()
-{
- m_fsrEngine = nullptr;
- m_alwaysRadCorr = false;
- m_neverRadCorr = false;
-}
-
-EvtRadCorr::~EvtRadCorr()
-{
- if ( m_fsrEngine )
- delete m_fsrEngine;
- m_fsrEngine = nullptr;
-}
-
void EvtRadCorr::setRadCorrEngine( EvtAbsRadCorr* fsrEngine )
{
m_fsrEngine = fsrEngine;
diff --git a/src/EvtGenBase/EvtRandom.cpp b/src/EvtGenBase/EvtRandom.cpp
--- a/src/EvtGenBase/EvtRandom.cpp
+++ b/src/EvtGenBase/EvtRandom.cpp
@@ -31,7 +31,7 @@
using std::endl;
-EvtRandomEngine* EvtRandom::m_randomEngine = nullptr;
+thread_local EvtRandomEngine* EvtRandom::m_randomEngine = nullptr;
void EvtRandom::setRandomEngine( EvtRandomEngine* randomEngine )
{
@@ -50,7 +50,7 @@
return m_randomEngine->random();
}
-void EvtRandom::setSeed( unsigned int seed )
+void EvtRandom::setSeed( unsigned long int seed )
{
if ( m_randomEngine == nullptr ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
@@ -62,6 +62,18 @@
m_randomEngine->setSeed( seed );
}
+unsigned long int EvtRandom::lastSeed()
+{
+ if ( m_randomEngine == nullptr ) {
+ EvtGenReport( EVTGEN_ERROR, "EvtGen" )
+ << "No random engine available in "
+ << "EvtRandom::random()." << endl;
+ ::abort();
+ }
+
+ return m_randomEngine->lastSeed();
+}
+
// Random number routine to generate numbers between
// min and max. By djl on July 27, 1995.
double EvtRandom::Flat( double min, double max )
diff --git a/src/EvtGenBase/EvtRaritaSchwingerParticle.cpp b/src/EvtGenBase/EvtRaritaSchwingerParticle.cpp
--- a/src/EvtGenBase/EvtRaritaSchwingerParticle.cpp
+++ b/src/EvtGenBase/EvtRaritaSchwingerParticle.cpp
@@ -57,11 +57,11 @@
spminus.set( 0.0, 0.0, 0.0, sqmt2 );
}
- static EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
- EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
- static EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
- static EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
- EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+ static const EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
+ EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+ static const EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
+ static const EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
+ EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
m_spinorRest[0] = dirProd( eplus, spplus );
m_spinorRest[1] = dirProd( sqrt( 2.0 / 3.0 ) * ezero, spplus ) +
diff --git a/src/EvtGenBase/EvtSemiLeptonicBaryonAmp.cpp b/src/EvtGenBase/EvtSemiLeptonicBaryonAmp.cpp
--- a/src/EvtGenBase/EvtSemiLeptonicBaryonAmp.cpp
+++ b/src/EvtGenBase/EvtSemiLeptonicBaryonAmp.cpp
@@ -41,12 +41,12 @@
void EvtSemiLeptonicBaryonAmp::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
@@ -373,25 +373,25 @@
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 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" );
// 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 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" );
// Set the spin density matrix of the parent baryon
EvtSpinDensity rho;
diff --git a/src/EvtGenBase/EvtSemiLeptonicScalarAmp.cpp b/src/EvtGenBase/EvtSemiLeptonicScalarAmp.cpp
--- a/src/EvtGenBase/EvtSemiLeptonicScalarAmp.cpp
+++ b/src/EvtGenBase/EvtSemiLeptonicScalarAmp.cpp
@@ -34,12 +34,12 @@
void EvtSemiLeptonicScalarAmp::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
diff --git a/src/EvtGenBase/EvtSemiLeptonicTensorAmp.cpp b/src/EvtGenBase/EvtSemiLeptonicTensorAmp.cpp
--- a/src/EvtGenBase/EvtSemiLeptonicTensorAmp.cpp
+++ b/src/EvtGenBase/EvtSemiLeptonicTensorAmp.cpp
@@ -34,19 +34,19 @@
void EvtSemiLeptonicTensorAmp::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 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 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+" );
+
+ 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+" );
//Add the lepton and neutrino 4 momenta to find q2
diff --git a/src/EvtGenBase/EvtSemiLeptonicVectorAmp.cpp b/src/EvtGenBase/EvtSemiLeptonicVectorAmp.cpp
--- a/src/EvtGenBase/EvtSemiLeptonicVectorAmp.cpp
+++ b/src/EvtGenBase/EvtSemiLeptonicVectorAmp.cpp
@@ -35,19 +35,19 @@
void EvtSemiLeptonicVectorAmp::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 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 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+" );
+
+ 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+" );
//Add the lepton and neutrino 4 momenta to find q2
diff --git a/src/EvtGenBase/EvtSimpleRandomEngine.cpp b/src/EvtGenBase/EvtSimpleRandomEngine.cpp
--- a/src/EvtGenBase/EvtSimpleRandomEngine.cpp
+++ b/src/EvtGenBase/EvtSimpleRandomEngine.cpp
@@ -32,7 +32,7 @@
return ( temp + 1.0 ) / 32769.0;
}
-void EvtSimpleRandomEngine::setSeed( unsigned int seed )
+void EvtSimpleRandomEngine::setSeed( unsigned long int seed )
{
m_next = seed;
}
diff --git a/src/EvtGenBase/EvtSymTable.cpp b/src/EvtGenBase/EvtSymTable.cpp
--- a/src/EvtGenBase/EvtSymTable.cpp
+++ b/src/EvtGenBase/EvtSymTable.cpp
@@ -30,7 +30,7 @@
using std::endl;
using std::fstream;
-std::map<std::string, std::string> EvtSymTable::m_symMap;
+thread_local std::map<std::string, std::string> EvtSymTable::m_symMap;
EvtSymTable::EvtSymTable()
{
diff --git a/src/EvtGenBase/EvtTensor3C.cpp b/src/EvtGenBase/EvtTensor3C.cpp
--- a/src/EvtGenBase/EvtTensor3C.cpp
+++ b/src/EvtGenBase/EvtTensor3C.cpp
@@ -321,7 +321,7 @@
const EvtTensor3C& EvtTensor3C::id()
{
- static EvtTensor3C identity( 1.0, 1.0, 1.0 );
+ static const EvtTensor3C identity( 1.0, 1.0, 1.0 );
return identity;
}
diff --git a/src/EvtGenBase/EvtTensor4C.cpp b/src/EvtGenBase/EvtTensor4C.cpp
--- a/src/EvtGenBase/EvtTensor4C.cpp
+++ b/src/EvtGenBase/EvtTensor4C.cpp
@@ -42,7 +42,7 @@
const EvtTensor4C& EvtTensor4C::g()
{
- static EvtTensor4C g_metric( 1.0, -1.0, -1.0, -1.0 );
+ static const EvtTensor4C g_metric( 1.0, -1.0, -1.0, -1.0 );
return g_metric;
}
diff --git a/src/EvtGenBase/EvtTensorParticle.cpp b/src/EvtGenBase/EvtTensorParticle.cpp
--- a/src/EvtGenBase/EvtTensorParticle.cpp
+++ b/src/EvtGenBase/EvtTensorParticle.cpp
@@ -97,31 +97,31 @@
EvtSpinDensity EvtTensorParticle::rotateToHelicityBasis() const
{
- static EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
- EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
- static EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
- static EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
- EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
-
- static EvtTensor4C dPpp( EvtGenFunctions::directProd( eplus, eplus ) );
- static EvtTensor4C dPp0( EvtGenFunctions::directProd( eplus, ezero ) );
- static EvtTensor4C dP0p( EvtGenFunctions::directProd( ezero, eplus ) );
- static EvtTensor4C dPpm( EvtGenFunctions::directProd( eplus, eminus ) );
- static EvtTensor4C dP00( EvtGenFunctions::directProd( ezero, ezero ) );
- static EvtTensor4C dPmp( EvtGenFunctions::directProd( eminus, eplus ) );
- static EvtTensor4C dPmm( EvtGenFunctions::directProd( eminus, eminus ) );
- static EvtTensor4C dPm0( EvtGenFunctions::directProd( eminus, ezero ) );
- static EvtTensor4C dP0m( EvtGenFunctions::directProd( ezero, eminus ) );
-
- static EvtTensor4C es0( conj( dPpp ) );
- static EvtTensor4C es1(
+ static const EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
+ EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+ static const EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
+ static const EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
+ EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+
+ static const EvtTensor4C dPpp( EvtGenFunctions::directProd( eplus, eplus ) );
+ static const EvtTensor4C dPp0( EvtGenFunctions::directProd( eplus, ezero ) );
+ static const EvtTensor4C dP0p( EvtGenFunctions::directProd( ezero, eplus ) );
+ static const EvtTensor4C dPpm( EvtGenFunctions::directProd( eplus, eminus ) );
+ static const EvtTensor4C dP00( EvtGenFunctions::directProd( ezero, ezero ) );
+ static const EvtTensor4C dPmp( EvtGenFunctions::directProd( eminus, eplus ) );
+ static const EvtTensor4C dPmm( EvtGenFunctions::directProd( eminus, eminus ) );
+ static const EvtTensor4C dPm0( EvtGenFunctions::directProd( eminus, ezero ) );
+ static const EvtTensor4C dP0m( EvtGenFunctions::directProd( ezero, eminus ) );
+
+ static const EvtTensor4C es0( conj( dPpp ) );
+ static const EvtTensor4C es1(
conj( ( 1 / sqrt( 2.0 ) ) * dPp0 + ( 1 / sqrt( 2.0 ) ) * dP0p ) );
- static EvtTensor4C es2( conj( ( 1 / sqrt( 6.0 ) ) * dPpm +
- ( 2 / sqrt( 6.0 ) ) * dP00 +
- ( 1 / sqrt( 6.0 ) ) * dPmp ) );
- static EvtTensor4C es3(
+ static const EvtTensor4C es2( conj( ( 1 / sqrt( 6.0 ) ) * dPpm +
+ ( 2 / sqrt( 6.0 ) ) * dP00 +
+ ( 1 / sqrt( 6.0 ) ) * dPmp ) );
+ static const EvtTensor4C es3(
conj( ( 1 / sqrt( 2.0 ) ) * dPm0 + ( 1 / sqrt( 2.0 ) ) * dP0m ) );
- static EvtTensor4C es4( conj( dPmm ) );
+ static const EvtTensor4C es4( conj( dPmm ) );
EvtSpinDensity R;
R.setDim( 5 );
@@ -142,11 +142,11 @@
{
EvtTensor4C es[5];
- static EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
- EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
- static EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
- static EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
- EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+ static thread_local EvtVector4C eplus(
+ 0.0, -1.0 / sqrt( 2.0 ), EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+ static thread_local EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
+ static thread_local EvtVector4C eminus(
+ 0.0, 1.0 / sqrt( 2.0 ), EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
eplus.applyRotateEuler( alpha, beta, gamma );
ezero.applyRotateEuler( alpha, beta, gamma );
diff --git a/src/EvtGenBase/EvtTwoBodyKine.cpp b/src/EvtGenBase/EvtTwoBodyKine.cpp
--- a/src/EvtGenBase/EvtTwoBodyKine.cpp
+++ b/src/EvtGenBase/EvtTwoBodyKine.cpp
@@ -32,7 +32,8 @@
{
}
-EvtTwoBodyKine::EvtTwoBodyKine( double mA, double mB, double mAB ) :
+EvtTwoBodyKine::EvtTwoBodyKine( const double mA, const double mB,
+ const double mAB ) :
m_mA( mA ), m_mB( mB ), m_mAB( mAB )
{
if ( mAB < mA + mB ) {
diff --git a/src/EvtGenBase/EvtVectorParticle.cpp b/src/EvtGenBase/EvtVectorParticle.cpp
--- a/src/EvtGenBase/EvtVectorParticle.cpp
+++ b/src/EvtGenBase/EvtVectorParticle.cpp
@@ -73,15 +73,15 @@
EvtSpinDensity EvtVectorParticle::rotateToHelicityBasis() const
{
- static EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
- EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
- static EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
- static EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
- EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
-
- static EvtVector4C eplusC( eplus.conj() );
- static EvtVector4C ezeroC( ezero.conj() );
- static EvtVector4C eminusC( eminus.conj() );
+ static const EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
+ EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+ static const EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
+ static const EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
+ EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
+
+ static const EvtVector4C eplusC( eplus.conj() );
+ static const EvtVector4C ezeroC( ezero.conj() );
+ static const EvtVector4C eminusC( eminus.conj() );
EvtSpinDensity R;
R.setDim( 3 );
diff --git a/src/EvtGenExternal/EvtExternalGenFactory.cpp b/src/EvtGenExternal/EvtExternalGenFactory.cpp
--- a/src/EvtGenExternal/EvtExternalGenFactory.cpp
+++ b/src/EvtGenExternal/EvtExternalGenFactory.cpp
@@ -33,29 +33,9 @@
#include <iostream>
using std::endl;
-EvtExternalGenFactory::EvtExternalGenFactory()
+EvtExternalGenFactory& EvtExternalGenFactory::getInstance()
{
- m_extGenMap.clear();
-}
-
-EvtExternalGenFactory::~EvtExternalGenFactory()
-{
- ExtGenMap::iterator iter;
- for ( iter = m_extGenMap.begin(); iter != m_extGenMap.end(); ++iter ) {
- EvtAbsExternalGen* theGenerator = iter->second;
- delete theGenerator;
- }
-
- m_extGenMap.clear();
-}
-
-EvtExternalGenFactory* EvtExternalGenFactory::getInstance()
-{
- static EvtExternalGenFactory* theFactory = nullptr;
-
- if ( theFactory == nullptr ) {
- theFactory = new EvtExternalGenFactory();
- }
+ static thread_local EvtExternalGenFactory theFactory;
return theFactory;
}
@@ -66,8 +46,6 @@
bool convertPhysCodes,
bool useEvtGenRandom )
{
- GenId genId = EvtExternalGenFactory::PythiaGenId;
-
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Defining EvtPythiaEngine: data tables defined in " << xmlDir << endl;
if ( convertPhysCodes == true ) {
@@ -84,9 +62,8 @@
<< "Using EvtGen random engine for Pythia 8 as well" << endl;
}
- EvtAbsExternalGen* pythiaGenerator =
- new EvtPythiaEngine( xmlDir, convertPhysCodes, useEvtGenRandom );
- m_extGenMap[genId] = pythiaGenerator;
+ m_extGenMap[GenId::PythiaGenId] = std::make_unique<EvtPythiaEngine>(
+ xmlDir, convertPhysCodes, useEvtGenRandom );
}
#else
void EvtExternalGenFactory::definePythiaGenerator( std::string, bool, bool )
@@ -95,46 +72,41 @@
#endif
#ifdef EVTGEN_TAUOLA
-void EvtExternalGenFactory::defineTauolaGenerator( bool useEvtGenRandom )
+void EvtExternalGenFactory::defineTauolaGenerator( bool useEvtGenRandom,
+ bool seedTauolaFortran )
{
- GenId genId = EvtExternalGenFactory::TauolaGenId;
-
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Defining EvtTauolaEngine." << endl;
- EvtAbsExternalGen* tauolaGenerator = new EvtTauolaEngine( useEvtGenRandom );
- m_extGenMap[genId] = tauolaGenerator;
+ m_extGenMap[GenId::TauolaGenId] =
+ std::make_unique<EvtTauolaEngine>( useEvtGenRandom, seedTauolaFortran );
}
#else
-void EvtExternalGenFactory::defineTauolaGenerator( bool )
+void EvtExternalGenFactory::defineTauolaGenerator( bool, bool )
{
}
#endif
-EvtAbsExternalGen* EvtExternalGenFactory::getGenerator( GenId genId )
+EvtAbsExternalGen* EvtExternalGenFactory::getGenerator( const GenId genId )
{
- EvtAbsExternalGen* theGenerator( nullptr );
+ ExtGenMap::iterator iter = m_extGenMap.find( genId );
- ExtGenMap::iterator iter;
-
- if ( ( iter = m_extGenMap.find( genId ) ) != m_extGenMap.end() ) {
- // Retrieve the external generator engine
- theGenerator = iter->second;
-
- } else {
+ if ( iter == m_extGenMap.end() ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "EvtAbsExternalGen::getGenerator: could not find generator for genId = "
- << genId << endl;
+ //FIXME C++23 use std::to_underlying
+ << static_cast<std::underlying_type_t<GenId>>( genId ) << endl;
+ return nullptr;
}
- return theGenerator;
+ // Retrieve the external generator engine
+ auto& theGenerator = iter->second;
+ return theGenerator.get();
}
void EvtExternalGenFactory::initialiseAllGenerators()
{
- ExtGenMap::iterator iter;
- for ( iter = m_extGenMap.begin(); iter != m_extGenMap.end(); ++iter ) {
- EvtAbsExternalGen* theGenerator = iter->second;
- if ( theGenerator != nullptr ) {
+ for ( auto& [id, theGenerator] : m_extGenMap ) {
+ if ( theGenerator ) {
theGenerator->initialise();
}
}
diff --git a/src/EvtGenExternal/EvtExternalGenList.cpp b/src/EvtGenExternal/EvtExternalGenList.cpp
--- a/src/EvtGenExternal/EvtExternalGenList.cpp
+++ b/src/EvtGenExternal/EvtExternalGenList.cpp
@@ -31,11 +31,12 @@
EvtExternalGenList::EvtExternalGenList( bool convertPythiaCodes,
std::string pythiaXmlDir,
std::string photonType,
- bool useEvtGenRandom ) :
+ bool useEvtGenRandom,
+ bool seedTauolaFortran ) :
m_photonType{ photonType }, m_useEvtGenRandom{ useEvtGenRandom }
{
// Instantiate the external generator factory
- EvtExternalGenFactory* extFactory = EvtExternalGenFactory::getInstance();
+ EvtExternalGenFactory& extFactory = EvtExternalGenFactory::getInstance();
if ( pythiaXmlDir.size() < 1 ) {
// If we have no string defined, check the value of the
@@ -47,10 +48,10 @@
}
}
- extFactory->definePythiaGenerator( pythiaXmlDir, convertPythiaCodes,
- useEvtGenRandom );
+ extFactory.definePythiaGenerator( pythiaXmlDir, convertPythiaCodes,
+ useEvtGenRandom );
- extFactory->defineTauolaGenerator( useEvtGenRandom );
+ extFactory.defineTauolaGenerator( useEvtGenRandom, seedTauolaFortran );
}
EvtExternalGenList::~EvtExternalGenList()
diff --git a/src/EvtGenExternal/EvtPythia.cpp b/src/EvtGenExternal/EvtPythia.cpp
--- a/src/EvtGenExternal/EvtPythia.cpp
+++ b/src/EvtGenExternal/EvtPythia.cpp
@@ -33,25 +33,12 @@
#include <cmath>
#include <iostream>
-EvtPythia::EvtPythia()
-{
- // Set the Pythia engine to a null pointer at first.
- // When we do the decay, we retrieve the pointer to the Pythia engine
- // and use that for all decays. All clones will use the same Pythia engine.
- m_pythiaEngine = nullptr;
-}
-
-EvtPythia::~EvtPythia()
-{
- m_commandList.clear();
-}
-
-std::string EvtPythia::getName()
+std::string EvtPythia::getName() const
{
return "PYTHIA";
}
-EvtDecayBase* EvtPythia::clone()
+EvtDecayBase* EvtPythia::clone() const
{
return new EvtPythia();
}
@@ -77,8 +64,8 @@
// This should only create the full Pythia engine once, and all clones will point to the same engine.
if ( !m_pythiaEngine ) {
- m_pythiaEngine = EvtExternalGenFactory::getInstance()->getGenerator(
- EvtExternalGenFactory::PythiaGenId );
+ m_pythiaEngine = EvtExternalGenFactory::getInstance().getGenerator(
+ EvtExternalGenFactory::GenId::PythiaGenId );
}
if ( m_pythiaEngine ) {
@@ -99,7 +86,7 @@
int nDaug = p->getNDaug();
int i( 0 );
- static EvtId Jpsi = EvtPDL::getId( "J/psi" );
+ static const EvtId Jpsi = EvtPDL::getId( "J/psi" );
for ( i = 0; i < nDaug; i++ ) {
EvtParticle* theDaug = p->getDaug( i );
diff --git a/src/EvtGenExternal/EvtPythiaEngine.cpp b/src/EvtGenExternal/EvtPythiaEngine.cpp
--- a/src/EvtGenExternal/EvtPythiaEngine.cpp
+++ b/src/EvtGenExternal/EvtPythiaEngine.cpp
@@ -47,12 +47,13 @@
using std::endl;
EvtPythiaEngine::EvtPythiaEngine( std::string xmlDir, bool convertPhysCodes,
- bool useEvtGenRandom )
+ bool useEvtGenRandom ) :
+ m_convertPhysCodes{ convertPhysCodes }, m_useEvtGenRandom{ useEvtGenRandom }
{
- // Create two Pythia generators. One will be for generic
- // Pythia decays in the decay.dec file. The other one will be to
- // only decay aliased particles, which are in general "signal"
- // decays different from those in the decay.dec file.
+ // Create two Pythia generators.
+ // One will be for generic Pythia decays in the decay.dec file.
+ // The other one will be to only decay aliased particles, which are in
+ // general "signal" decays different from those in the decay.dec file.
// Even though it is not possible to have two different particle
// versions in one Pythia generator, we can use two generators to
// get the required behaviour.
@@ -65,26 +66,9 @@
<< "Creating alias Pythia generator" << endl;
m_aliasPythiaGen = std::make_unique<Pythia8::Pythia>( xmlDir, false );
- m_thePythiaGenerator = nullptr;
- m_daugPDGVector.clear();
- m_daugP4Vector.clear();
-
- m_convertPhysCodes = convertPhysCodes;
-
- // Specify if we are going to use the random number generator (engine)
- // from EvtGen for Pythia 8.
- m_useEvtGenRandom = useEvtGenRandom;
-
- m_evtgenRandom = std::make_shared<EvtPythiaRandom>();
-
- m_initialised = false;
-}
-
-EvtPythiaEngine::~EvtPythiaEngine()
-{
- m_thePythiaGenerator = nullptr;
- this->clearDaughterVectors();
- this->clearPythiaModeMap();
+ if ( m_useEvtGenRandom ) {
+ m_evtgenRandom = std::make_shared<EvtPythiaRandom>();
+ }
}
void EvtPythiaEngine::clearDaughterVectors()
@@ -95,12 +79,6 @@
void EvtPythiaEngine::clearPythiaModeMap()
{
- PythiaModeMap::iterator iter;
- for ( iter = m_pythiaModeMap.begin(); iter != m_pythiaModeMap.end(); ++iter ) {
- std::vector<int> modeVector = iter->second;
- modeVector.clear();
- }
-
m_pythiaModeMap.clear();
}
@@ -127,7 +105,7 @@
this->updatePhysicsParameters();
// Set the random number generator
- if ( m_useEvtGenRandom == true ) {
+ if ( m_useEvtGenRandom ) {
#if PYTHIA_VERSION_INTEGER < 8310
m_genericPythiaGen->setRndmEnginePtr( m_evtgenRandom.get() );
m_aliasPythiaGen->setRndmEnginePtr( m_evtgenRandom.get() );
@@ -160,7 +138,7 @@
// we wanted via the specifications made to the decay.dec file, even though event-by-event
// the EvtGen decay channel and the Pythia decay channel may be different.
- if ( m_initialised == false ) {
+ if ( !m_initialised ) {
this->initialise();
}
@@ -178,15 +156,15 @@
}
EvtId particleId = theParticle->getId();
- int isAlias = particleId.isAlias();
+ const bool isAlias = particleId.isAlias();
// Choose the generator depending if we have an aliased (parent) particle or not
- m_thePythiaGenerator = ( isAlias == 1 ? m_aliasPythiaGen.get()
- : m_genericPythiaGen.get() );
+ Pythia8::Pythia& thePythiaGenerator = ( isAlias ? *m_aliasPythiaGen
+ : *m_genericPythiaGen );
// Need to use the reference to the Pythia8::Event object,
// otherwise it will just return a new empty, default event object.
- Pythia8::Event& theEvent = m_thePythiaGenerator->event;
+ Pythia8::Event& theEvent = thePythiaGenerator.event;
theEvent.reset();
// Initialise the event to be the particle rest frame
@@ -204,7 +182,7 @@
int iTrial( 0 );
bool generatedEvent( false );
for ( iTrial = 0; iTrial < 10; iTrial++ ) {
- generatedEvent = m_thePythiaGenerator->next();
+ generatedEvent = thePythiaGenerator.next();
if ( generatedEvent ) {
break;
}
@@ -225,7 +203,7 @@
// Now store the daughter info. Since this is a recursive function
// to loop through the full Pythia decay tree, we do not want to create
// EvtParticles here but in the next step.
- this->storeDaughterInfo( theParticle, 1 );
+ this->storeDaughterInfo( theEvent, theParticle, 1 );
// Now create the EvtParticle daughters of the (parent) particle.
// We need to use the EvtParticle::makeDaughters function
@@ -241,10 +219,9 @@
return success;
}
-void EvtPythiaEngine::storeDaughterInfo( EvtParticle* theParticle, int startInt )
+void EvtPythiaEngine::storeDaughterInfo( Pythia8::Event& theEvent,
+ EvtParticle* theParticle, int startInt )
{
- Pythia8::Event& theEvent = m_thePythiaGenerator->event;
-
std::vector<int> daugList = theEvent.daughterList( startInt );
std::vector<int>::iterator daugIter;
@@ -256,7 +233,7 @@
if ( daugParticle.isQuark() || daugParticle.isGluon() ) {
// Recursively search for correct daughter type
- this->storeDaughterInfo( theParticle, daugInt );
+ this->storeDaughterInfo( theEvent, theParticle, daugInt );
} else {
// We have a daughter that is not a quark nor gluon particle.
@@ -336,7 +313,7 @@
int pythiaModeInt = *modeIter;
- EvtDecayBase* decayModel = EvtDecayTable::getInstance()->findDecayModel(
+ EvtDecayBase* decayModel = EvtDecayTable::getInstance().findDecayModel(
aliasInt, pythiaModeInt );
if ( decayModel != nullptr ) {
@@ -476,31 +453,34 @@
// Get the list of all possible decays for the particle, using the alias integer.
// If the particle is not actually an alias, aliasInt = idInt.
- bool hasPythiaDecays = EvtDecayTable::getInstance()->hasPythia( aliasInt );
+ const bool hasPythiaDecays = EvtDecayTable::getInstance().hasPythia(
+ aliasInt );
if ( hasPythiaDecays ) {
- int isAlias = particleId.isAlias();
+ const bool isAlias = particleId.isAlias();
// Decide what generator to use depending on whether we have
// an aliased particle or not
- m_thePythiaGenerator = ( isAlias == 1 ? m_aliasPythiaGen.get()
- : m_genericPythiaGen.get() );
+ Pythia8::Pythia& thePythiaGenerator =
+ ( isAlias ? *m_aliasPythiaGen : *m_genericPythiaGen );
// Find the Pythia particle name given the standard PDG code integer
- std::string dataName = m_thePythiaGenerator->particleData.name(
+ const std::string dataName = thePythiaGenerator.particleData.name(
PDGCode );
- bool alreadyStored = ( m_addedPDGCodes.find( abs( PDGCode ) ) !=
- m_addedPDGCodes.end() );
+ const bool alreadyStored = ( m_addedPDGCodes.find( abs( PDGCode ) ) !=
+ m_addedPDGCodes.end() );
if ( dataName == " " && !alreadyStored ) {
// Particle and its antiparticle do not exist in the Pythia database.
// Create a new particle, then create the new decay modes.
- this->createPythiaParticle( particleId, PDGCode );
+ this->createPythiaParticle( thePythiaGenerator, particleId,
+ PDGCode );
}
// For the particle, create the Pythia decay modes.
// Update Pythia data tables.
- this->updatePythiaDecayTable( particleId, aliasInt, PDGCode );
+ this->updatePythiaDecayTable( thePythiaGenerator, particleId,
+ aliasInt, PDGCode );
} // Loop over Pythia decays
@@ -534,7 +514,8 @@
return isValid;
}
-void EvtPythiaEngine::updatePythiaDecayTable( EvtId& particleId, int aliasInt,
+void EvtPythiaEngine::updatePythiaDecayTable( Pythia8::Pythia& thePythiaGenerator,
+ EvtId& particleId, int aliasInt,
int PDGCode )
{
// Update the particle data table in Pythia.
@@ -544,7 +525,7 @@
// Since we do not want to implement CP violation here, just use the same branching
// fractions for particle and anti-particle modes.
- int nModes = EvtDecayTable::getInstance()->getNModes( aliasInt );
+ const int nModes = EvtDecayTable::getInstance().getNModes( aliasInt );
int iMode( 0 );
bool firstMode( true );
@@ -560,7 +541,7 @@
// Loop over the decay modes for this particle
for ( iMode = 0; iMode < nModes; iMode++ ) {
EvtDecayBase* decayModel =
- EvtDecayTable::getInstance()->findDecayModel( aliasInt, iMode );
+ EvtDecayTable::getInstance().findDecayModel( aliasInt, iMode );
if ( decayModel != nullptr ) {
int nDaug = decayModel->getNDaug();
@@ -615,7 +596,7 @@
} // Daughter list
- m_thePythiaGenerator->readString( oss.str() );
+ thePythiaGenerator.readString( oss.str() );
} // is Pythia
@@ -643,7 +624,7 @@
rescaleStr.setf( std::ios::scientific );
rescaleStr << PDGCode << ":rescaleBR = 1.0";
- m_thePythiaGenerator->readString( rescaleStr.str() );
+ thePythiaGenerator.readString( rescaleStr.str() );
}
int EvtPythiaEngine::getModeInt( EvtDecayBase* decayModel )
@@ -730,7 +711,8 @@
return modeInt;
}
-void EvtPythiaEngine::createPythiaParticle( EvtId& particleId, int PDGCode )
+void EvtPythiaEngine::createPythiaParticle( Pythia8::Pythia& thePythiaGenerator,
+ EvtId& particleId, int PDGCode )
{
// Use the EvtGen name, PDGId and other variables to define the new Pythia particle.
EvtId antiPartId = EvtPDL::chargeConj( particleId );
@@ -770,7 +752,7 @@
<< " " << mMin << " " << mMax << " " << tau0;
// Pass this information to Pythia
- m_thePythiaGenerator->readString( oss.str() );
+ thePythiaGenerator.readString( oss.str() );
// Also store the absolute value of the PDG entry
// to keep track of which new particles have been added,
diff --git a/src/EvtGenExternal/EvtTauola.cpp b/src/EvtGenExternal/EvtTauola.cpp
--- a/src/EvtGenExternal/EvtTauola.cpp
+++ b/src/EvtGenExternal/EvtTauola.cpp
@@ -31,12 +31,12 @@
#include <iostream>
#include <string>
-std::string EvtTauola::getName()
+std::string EvtTauola::getName() const
{
return "TAUOLA";
}
-EvtDecayBase* EvtTauola::clone()
+EvtDecayBase* EvtTauola::clone() const
{
return new EvtTauola();
}
@@ -57,8 +57,8 @@
// point to the same engine.
if ( !m_tauolaEngine ) {
- m_tauolaEngine = EvtExternalGenFactory::getInstance()->getGenerator(
- EvtExternalGenFactory::TauolaGenId );
+ m_tauolaEngine = EvtExternalGenFactory::getInstance().getGenerator(
+ EvtExternalGenFactory::GenId::TauolaGenId );
}
if ( m_tauolaEngine ) {
diff --git a/src/EvtGenExternal/EvtTauolaEngine.cpp b/src/EvtGenExternal/EvtTauolaEngine.cpp
--- a/src/EvtGenExternal/EvtTauolaEngine.cpp
+++ b/src/EvtGenExternal/EvtTauolaEngine.cpp
@@ -32,36 +32,60 @@
#include "Tauola/Log.h"
#include "Tauola/Tauola.h"
+#include <array>
#include <cmath>
#include <iostream>
+#include <limits>
#include <memory>
#include <sstream>
#include <string>
using std::endl;
-EvtTauolaEngine::EvtTauolaEngine( bool useEvtGenRandom )
+// Mutex Tauola as it is not thread safe.
+int EvtTauolaEngine::m_neutPropType = 0;
+int EvtTauolaEngine::m_posPropType = 0;
+int EvtTauolaEngine::m_negPropType = 0;
+bool EvtTauolaEngine::m_initialised = false;
+std::mutex EvtTauolaEngine::m_tauola_mutex;
+
+EvtTauolaEngine::EvtTauolaEngine( bool useEvtGenRandom, bool seedTauolaFortran ) :
+ m_useEvtGenRandom{ useEvtGenRandom }, m_seedTauolaFortran{ seedTauolaFortran }
+{
+}
+
+void EvtTauolaEngine::initialise()
{
- // PDG standard code integer ID for tau particle
- m_tauPDG = 15;
- // Number of possible decay modes in Tauola
- m_nTauolaModes = 22;
+ const std::lock_guard<std::mutex> lock( m_tauola_mutex );
+
+ // Set up all possible tau decay modes.
+ // This should be done just before the first doDecay() call,
+ // since we want to make sure that any decay.dec files are processed
+ // first to get lists of particle modes and their alias definitions
+ // (for creating EvtParticles with the right history information).
+
+ if ( m_initialised ) {
+ return;
+ }
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Setting up TAUOLA." << endl;
// These three lines are not really necessary since they are the default.
// But they are here so that we know what the initial conditions are.
- Tauolapp::Tauola::setDecayingParticle( m_tauPDG ); // tau PDG code
- Tauolapp::Tauola::setSameParticleDecayMode(
- Tauolapp::Tauola::All ); // all modes allowed
- Tauolapp::Tauola::setOppositeParticleDecayMode(
- Tauolapp::Tauola::All ); // all modes allowed
- // Limit the number of warnings printed out. Can't choose zero here, unfortunately
+ // tau PDG code
+ Tauolapp::Tauola::setDecayingParticle( m_tauPDG );
+ // all modes allowed
+ Tauolapp::Tauola::setSameParticleDecayMode( Tauolapp::Tauola::All );
+ // all modes allowed
+ Tauolapp::Tauola::setOppositeParticleDecayMode( Tauolapp::Tauola::All );
+
+ // Limit the number of warnings printed out.
+ // Can't choose zero here, unfortunately.
Tauolapp::Log::SetWarningLimit( 1 );
// Initial the Tauola external generator
- if ( useEvtGenRandom == true ) {
+ if ( m_useEvtGenRandom ) {
EvtGenReport( EVTGEN_INFO, "EvtGen" )
<< "Using EvtGen random number engine also for Tauola++" << endl;
@@ -74,30 +98,11 @@
Tauolapp::Tauola::initialize();
- // Initialise various default parameters
- // Neutral and charged spin propagator choices
- m_neutPropType = 0;
- m_posPropType = 0;
- m_negPropType = 0;
-
// Set-up possible decay modes _after_ we have read the (user) decay file
- m_initialised = false;
-}
-
-void EvtTauolaEngine::initialise()
-{
- // Set up all possible tau decay modes.
- // This should be done just before the first doDecay() call,
- // since we want to make sure that any decay.dec files are processed
- // first to get lists of particle modes and their alias definitions
- // (for creating EvtParticles with the right history information).
+ this->setUpPossibleTauModes();
+ this->setOtherParameters();
- if ( m_initialised == false ) {
- this->setUpPossibleTauModes();
- this->setOtherParameters();
-
- m_initialised = true;
- }
+ m_initialised = true;
}
void EvtTauolaEngine::setUpPossibleTauModes()
@@ -111,47 +116,39 @@
// separately (via selecting a random number and comparing it to be less than
// the cumulative BF) for each event.
- int nPDL = EvtPDL::entries();
- int iPDL( 0 );
+ const int nPDL = EvtPDL::entries();
bool gotAnyTauolaModes( false );
- for ( iPDL = 0; iPDL < nPDL; iPDL++ ) {
- EvtId particleId = EvtPDL::getEntry( iPDL );
- int PDGId = EvtPDL::getStdHep( particleId );
+ for ( int iPDL = 0; iPDL < nPDL; iPDL++ ) {
+ const EvtId particleId = EvtPDL::getEntry( iPDL );
+ const int PDGId = EvtPDL::getStdHep( particleId );
if ( abs( PDGId ) == m_tauPDG && gotAnyTauolaModes == false ) {
- int aliasInt = particleId.getAlias();
+ const int aliasInt = particleId.getAlias();
// Get the list of decay modes for this tau particle (alias)
- int nModes = EvtDecayTable::getInstance()->getNModes( aliasInt );
- int iMode( 0 ), iTauMode( 0 );
+ const int nModes = EvtDecayTable::getInstance().getNModes( aliasInt );
// Vector to store tau mode branching fractions.
// The size of this vector equals the total number of possible
// Tauola decay modes. Initialise all BFs to zero.
- std::vector<double> tauolaModeBFs( m_nTauolaModes );
-
- for ( iTauMode = 0; iTauMode < m_nTauolaModes; iTauMode++ ) {
- tauolaModeBFs[iTauMode] = 0.0;
- }
+ std::vector<double> tauolaModeBFs;
+ tauolaModeBFs.assign( m_nTauolaModes, 0.0 );
double totalTauModeBF( 0.0 );
int nNonTauolaModes( 0 );
// Loop through each decay mode
- for ( iMode = 0; iMode < nModes; iMode++ ) {
+ for ( int iMode = 0; iMode < nModes; iMode++ ) {
EvtDecayBase* decayModel =
- EvtDecayTable::getInstance()->findDecayModel( aliasInt,
- iMode );
+ EvtDecayTable::getInstance().findDecayModel( aliasInt, iMode );
if ( decayModel ) {
// Check that the decay model name matches TAUOLA
std::string modelName = decayModel->getName();
if ( modelName == "TAUOLA" ) {
- if ( gotAnyTauolaModes == false ) {
- gotAnyTauolaModes = true;
- }
+ gotAnyTauolaModes = true;
// Extract the decay mode integer type and branching fraction
double BF = decayModel->getBranchingFraction();
@@ -165,10 +162,8 @@
} else {
nNonTauolaModes++;
}
-
} // Decay mode exists
-
- } // Loop over decay models
+ } // Loop over decay models
if ( gotAnyTauolaModes == true && nNonTauolaModes > 0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
@@ -184,7 +179,7 @@
<< "Setting TAUOLA BF modes using the definitions for the particle "
<< EvtPDL::name( particleId ) << endl;
- for ( iTauMode = 0; iTauMode < m_nTauolaModes; iTauMode++ ) {
+ for ( int iTauMode = 0; iTauMode < m_nTauolaModes; iTauMode++ ) {
tauolaModeBFs[iTauMode] /= totalTauModeBF;
double modeBF = tauolaModeBFs[iTauMode];
EvtGenReport( EVTGEN_INFO, "EvtGen" )
@@ -197,13 +192,11 @@
<< "Any other TAUOLA BF modes for other tau particle decay mode definitions will be ignored!"
<< endl;
}
-
} // Got tau particle and have yet to get a TAUOLA mode
-
- } // Loop through PDL entries
+ } // Loop through PDL entries
}
-int EvtTauolaEngine::getModeInt( EvtDecayBase* decayModel )
+int EvtTauolaEngine::getModeInt( EvtDecayBase* decayModel ) const
{
int modeInt( 0 );
@@ -282,22 +275,16 @@
// 4) TauolaBRi, where i = 1,2,3,4: Redefine sub-channel branching fractions using the setTaukle
// function, after initialized() has been called. Default values = 0.5, 0.5, 0.5 and 0.6667
- int j( 1 );
- std::vector<double> BRVect;
- BRVect.push_back( 0.5 );
- BRVect.push_back( 0.5 );
- BRVect.push_back( 0.5 );
- BRVect.push_back( 0.6667 );
-
- for ( j = 1; j < 5; j++ ) {
+ std::array<double, 4> BRVect{ 0.5, 0.5, 0.5, 0.6667 };
+ for ( int j = 0; j < 4; j++ ) {
std::ostringstream o;
- o << j;
+ o << j + 1;
std::string BRName = "TauolaBR" + o.str();
std::string stringBR = EvtSymTable::get( BRName, iErr );
// If the definition name is not found, get() just returns the first argument string
if ( stringBR != BRName ) {
- BRVect[j - 1] = std::atof( stringBR.c_str() );
+ BRVect[j] = std::atof( stringBR.c_str() );
}
}
@@ -322,11 +309,11 @@
bool EvtTauolaEngine::doDecay( EvtParticle* tauParticle )
{
- if ( m_initialised == false ) {
+ if ( !m_initialised ) {
this->initialise();
}
- if ( tauParticle == nullptr ) {
+ if ( !tauParticle ) {
return false;
}
@@ -460,16 +447,29 @@
tauMap[singleTau] = tauParticle;
}
- // Now pass the event to Tauola for processing
- // Create a Tauola event object
+ {
+ const std::lock_guard<std::mutex> lock( m_tauola_mutex );
+
+ if ( m_useEvtGenRandom && m_seedTauolaFortran ) {
+ static thread_local auto lastSeed{
+ std::numeric_limits<unsigned long int>::max() };
+ if ( lastSeed != EvtRandom::lastSeed() ) {
+ lastSeed = EvtRandom::lastSeed();
+ Tauolapp::Tauola::setSeed( lastSeed, 0, 0 );
+ }
+ }
+
+ // Now pass the event to Tauola for processing
+ // Create a Tauola event object
#ifdef EVTGEN_HEPMC3
- Tauolapp::TauolaHepMC3Event tauolaEvent( theEvent.get() );
+ Tauolapp::TauolaHepMC3Event tauolaEvent( theEvent.get() );
#else
- Tauolapp::TauolaHepMCEvent tauolaEvent( theEvent.get() );
+ Tauolapp::TauolaHepMCEvent tauolaEvent( theEvent.get() );
#endif
- // Run the Tauola algorithm
- tauolaEvent.decayTaus();
+ // Run the Tauola algorithm
+ tauolaEvent.decayTaus();
+ }
// Loop over all tau particles in the HepMC event and create their EvtParticle daughters.
// Store all final "stable" descendent particles as the tau daughters, i.e.
@@ -570,7 +570,7 @@
theEvent->clear();
}
-GenParticlePtr EvtTauolaEngine::createGenParticle( EvtParticle* theParticle )
+GenParticlePtr EvtTauolaEngine::createGenParticle( const EvtParticle* theParticle ) const
{
// Method to create an HepMC::GenParticle version of the given EvtParticle.
if ( theParticle == nullptr ) {
diff --git a/src/EvtGenModels/EvtBBScalar.cpp b/src/EvtGenModels/EvtBBScalar.cpp
--- a/src/EvtGenModels/EvtBBScalar.cpp
+++ b/src/EvtGenModels/EvtBBScalar.cpp
@@ -70,12 +70,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtBLLNuL.cpp b/src/EvtGenModels/EvtBLLNuL.cpp
--- a/src/EvtGenModels/EvtBLLNuL.cpp
+++ b/src/EvtGenModels/EvtBLLNuL.cpp
@@ -30,13 +30,13 @@
{
}
-std::string EvtBLLNuL::getName()
+std::string EvtBLLNuL::getName() const
{
// The model name
return "BLLNUL";
}
-EvtDecayBase* EvtBLLNuL::clone()
+EvtDecayBase* EvtBLLNuL::clone() const
{
return new EvtBLLNuL();
}
@@ -59,7 +59,7 @@
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 = "
diff --git a/src/EvtGenModels/EvtBTo3hCP.cpp b/src/EvtGenModels/EvtBTo3hCP.cpp
--- a/src/EvtGenModels/EvtBTo3hCP.cpp
+++ b/src/EvtGenModels/EvtBTo3hCP.cpp
@@ -566,7 +566,7 @@
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 );
@@ -634,7 +634,7 @@
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;
@@ -697,7 +697,7 @@
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;
@@ -750,7 +750,7 @@
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;
diff --git a/src/EvtGenModels/EvtBTo3piCP.cpp b/src/EvtGenModels/EvtBTo3piCP.cpp
--- a/src/EvtGenModels/EvtBTo3piCP.cpp
+++ b/src/EvtGenModels/EvtBTo3piCP.cpp
@@ -30,12 +30,12 @@
#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;
}
@@ -75,8 +75,8 @@
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;
diff --git a/src/EvtGenModels/EvtBTo4piCP.cpp b/src/EvtGenModels/EvtBTo4piCP.cpp
--- a/src/EvtGenModels/EvtBTo4piCP.cpp
+++ b/src/EvtGenModels/EvtBTo4piCP.cpp
@@ -36,8 +36,8 @@
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;
@@ -97,8 +97,8 @@
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;
@@ -146,12 +146,12 @@
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;
}
@@ -178,8 +178,8 @@
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;
diff --git a/src/EvtGenModels/EvtBToDDalitzCPK.cpp b/src/EvtGenModels/EvtBToDDalitzCPK.cpp
--- a/src/EvtGenModels/EvtBToDDalitzCPK.cpp
+++ b/src/EvtGenModels/EvtBToDDalitzCPK.cpp
@@ -35,14 +35,14 @@
//=============================================================================
// 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;
}
@@ -60,16 +60,16 @@
// 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;
diff --git a/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp b/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
--- a/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
+++ b/src/EvtGenModels/EvtBToDiBaryonlnupQCD.cpp
@@ -29,12 +29,12 @@
#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;
}
@@ -149,18 +149,20 @@
// 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 );
diff --git a/src/EvtGenModels/EvtBToKpipiCP.cpp b/src/EvtGenModels/EvtBToKpipiCP.cpp
--- a/src/EvtGenModels/EvtBToKpipiCP.cpp
+++ b/src/EvtGenModels/EvtBToKpipiCP.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -74,8 +74,8 @@
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;
diff --git a/src/EvtGenModels/EvtBToPlnuBK.cpp b/src/EvtGenModels/EvtBToPlnuBK.cpp
--- a/src/EvtGenModels/EvtBToPlnuBK.cpp
+++ b/src/EvtGenModels/EvtBToPlnuBK.cpp
@@ -35,12 +35,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtBToVlnuBall.cpp b/src/EvtGenModels/EvtBToVlnuBall.cpp
--- a/src/EvtGenModels/EvtBToVlnuBall.cpp
+++ b/src/EvtGenModels/EvtBToVlnuBall.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtBToXElNu.cpp b/src/EvtGenModels/EvtBToXElNu.cpp
--- a/src/EvtGenModels/EvtBToXElNu.cpp
+++ b/src/EvtGenModels/EvtBToXElNu.cpp
@@ -35,12 +35,12 @@
using std::endl;
-std::string EvtBToXElNu::getName()
+std::string EvtBToXElNu::getName() const
{
return "BTOXELNU";
}
-EvtDecayBase* EvtBToXElNu::clone()
+EvtDecayBase* EvtBToXElNu::clone() const
{
return new EvtBToXElNu;
}
diff --git a/src/EvtGenModels/EvtBaryonPCR.cpp b/src/EvtGenModels/EvtBaryonPCR.cpp
--- a/src/EvtGenModels/EvtBaryonPCR.cpp
+++ b/src/EvtGenModels/EvtBaryonPCR.cpp
@@ -37,12 +37,12 @@
#undef D0
#endif
-std::string EvtBaryonPCR::getName()
+std::string EvtBaryonPCR::getName() const
{
return "BaryonPCR";
}
-EvtBaryonPCR* EvtBaryonPCR::clone()
+EvtBaryonPCR* EvtBaryonPCR::clone() const
{
return new EvtBaryonPCR;
}
@@ -50,9 +50,9 @@
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();
@@ -72,20 +72,20 @@
{
// 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;
diff --git a/src/EvtGenModels/EvtBaryonPCRFF.cpp b/src/EvtGenModels/EvtBaryonPCRFF.cpp
--- a/src/EvtGenModels/EvtBaryonPCRFF.cpp
+++ b/src/EvtGenModels/EvtBaryonPCRFF.cpp
@@ -36,12 +36,12 @@
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;
@@ -166,10 +166,10 @@
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;
diff --git a/src/EvtGenModels/EvtBcBsNPi.cpp b/src/EvtGenModels/EvtBcBsNPi.cpp
--- a/src/EvtGenModels/EvtBcBsNPi.cpp
+++ b/src/EvtGenModels/EvtBcBsNPi.cpp
@@ -40,12 +40,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtBcBsStarNPi.cpp b/src/EvtGenModels/EvtBcBsStarNPi.cpp
--- a/src/EvtGenModels/EvtBcBsStarNPi.cpp
+++ b/src/EvtGenModels/EvtBcBsStarNPi.cpp
@@ -46,12 +46,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtBcPsiNPi.cpp b/src/EvtGenModels/EvtBcPsiNPi.cpp
--- a/src/EvtGenModels/EvtBcPsiNPi.cpp
+++ b/src/EvtGenModels/EvtBcPsiNPi.cpp
@@ -46,12 +46,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtBcSMuNu.cpp b/src/EvtGenModels/EvtBcSMuNu.cpp
--- a/src/EvtGenModels/EvtBcSMuNu.cpp
+++ b/src/EvtGenModels/EvtBcSMuNu.cpp
@@ -34,12 +34,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtBcTMuNu.cpp b/src/EvtGenModels/EvtBcTMuNu.cpp
--- a/src/EvtGenModels/EvtBcTMuNu.cpp
+++ b/src/EvtGenModels/EvtBcTMuNu.cpp
@@ -34,12 +34,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtBcToNPi.cpp b/src/EvtGenModels/EvtBcToNPi.cpp
--- a/src/EvtGenModels/EvtBcToNPi.cpp
+++ b/src/EvtGenModels/EvtBcToNPi.cpp
@@ -40,12 +40,12 @@
}
}
-std::string EvtBcToNPi::getName()
+std::string EvtBcToNPi::getName() const
{
return "EvtBcToNPi";
}
-EvtDecayBase* EvtBcToNPi::clone()
+EvtDecayBase* EvtBcToNPi::clone() const
{
return new EvtBcToNPi;
}
diff --git a/src/EvtGenModels/EvtBcVHad.cpp b/src/EvtGenModels/EvtBcVHad.cpp
--- a/src/EvtGenModels/EvtBcVHad.cpp
+++ b/src/EvtGenModels/EvtBcVHad.cpp
@@ -33,12 +33,12 @@
#include <iostream>
-std::string EvtBcVHad::getName()
+std::string EvtBcVHad::getName() const
{
return "BC_VHAD";
}
-EvtDecayBase* EvtBcVHad::clone()
+EvtDecayBase* EvtBcVHad::clone() const
{
return new EvtBcVHad;
}
diff --git a/src/EvtGenModels/EvtBcVMuNu.cpp b/src/EvtGenModels/EvtBcVMuNu.cpp
--- a/src/EvtGenModels/EvtBcVMuNu.cpp
+++ b/src/EvtGenModels/EvtBcVMuNu.cpp
@@ -34,12 +34,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtBcVNpi.cpp b/src/EvtGenModels/EvtBcVNpi.cpp
--- a/src/EvtGenModels/EvtBcVNpi.cpp
+++ b/src/EvtGenModels/EvtBcVNpi.cpp
@@ -36,12 +36,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtBcVPPHad.cpp b/src/EvtGenModels/EvtBcVPPHad.cpp
--- a/src/EvtGenModels/EvtBcVPPHad.cpp
+++ b/src/EvtGenModels/EvtBcVPPHad.cpp
@@ -30,12 +30,12 @@
#include <iostream>
-std::string EvtBcVPPHad::getName()
+std::string EvtBcVPPHad::getName() const
{
return "BC_VPPHAD";
}
-EvtDecayBase* EvtBcVPPHad::clone()
+EvtDecayBase* EvtBcVPPHad::clone() const
{
return new EvtBcVPPHad;
}
diff --git a/src/EvtGenModels/EvtBsMuMuKK.cpp b/src/EvtGenModels/EvtBsMuMuKK.cpp
--- a/src/EvtGenModels/EvtBsMuMuKK.cpp
+++ b/src/EvtGenModels/EvtBsMuMuKK.cpp
@@ -37,12 +37,12 @@
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;
}
@@ -552,47 +552,50 @@
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 );
@@ -605,12 +608,12 @@
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 );
}
diff --git a/src/EvtGenModels/EvtBsquark.cpp b/src/EvtGenModels/EvtBsquark.cpp
--- a/src/EvtGenModels/EvtBsquark.cpp
+++ b/src/EvtGenModels/EvtBsquark.cpp
@@ -32,12 +32,12 @@
#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;
}
@@ -55,10 +55,10 @@
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() );
diff --git a/src/EvtGenModels/EvtBto2piCPiso.cpp b/src/EvtGenModels/EvtBto2piCPiso.cpp
--- a/src/EvtGenModels/EvtBto2piCPiso.cpp
+++ b/src/EvtGenModels/EvtBto2piCPiso.cpp
@@ -32,12 +32,12 @@
#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;
}
@@ -58,9 +58,9 @@
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
@@ -91,11 +91,11 @@
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;
diff --git a/src/EvtGenModels/EvtBtoKD3P.cpp b/src/EvtGenModels/EvtBtoKD3P.cpp
--- a/src/EvtGenModels/EvtBtoKD3P.cpp
+++ b/src/EvtGenModels/EvtBtoKD3P.cpp
@@ -34,13 +34,13 @@
using std::endl;
//------------------------------------------------------------------
-EvtDecayBase* EvtBtoKD3P::clone()
+EvtDecayBase* EvtBtoKD3P::clone() const
{
return new EvtBtoKD3P();
}
//------------------------------------------------------------------
-std::string EvtBtoKD3P::getName()
+std::string EvtBtoKD3P::getName() const
{
return "BTOKD3P";
}
@@ -92,15 +92,15 @@
// 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 ) );
+ EvtPto3P* model1 = dynamic_cast<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 ) );
+ EvtPto3P* model2 = dynamic_cast<EvtPto3P*>(
+ EvtDecayTable::getInstance().getDecayFunc( theD ) );
// on the first call:
if ( false == m_decayedOnce ) {
@@ -124,8 +124,8 @@
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;
diff --git a/src/EvtGenModels/EvtBtoKpiCPiso.cpp b/src/EvtGenModels/EvtBtoKpiCPiso.cpp
--- a/src/EvtGenModels/EvtBtoKpiCPiso.cpp
+++ b/src/EvtGenModels/EvtBtoKpiCPiso.cpp
@@ -28,12 +28,12 @@
#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;
}
@@ -55,13 +55,13 @@
//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 ) ) ) {
@@ -116,13 +116,13 @@
{
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;
diff --git a/src/EvtGenModels/EvtBtoXsEtap.cpp b/src/EvtGenModels/EvtBtoXsEtap.cpp
--- a/src/EvtGenModels/EvtBtoXsEtap.cpp
+++ b/src/EvtGenModels/EvtBtoXsEtap.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -44,8 +44,21 @@
void EvtBtoXsEtap::init()
{
// check that there are no arguments
-
checkNArg( 0 );
+
+ // check that there are only two daughters
+ checkNDaug( 2 );
+
+ // check that second daughter is eta', which is self conjugate.
+ const EvtId etap = EvtPDL::getId( "eta'" );
+ if ( getDaug( 1 ) != etap ) {
+ EvtGenReport( EVTGEN_ERROR, "EvtGen" )
+ << EvtBtoXsEtap::getName().c_str()
+ << " generator did not get eta' as second daughter." << endl;
+ EvtGenReport( EVTGEN_ERROR, "EvtGen" )
+ << "Will terminate execution!" << endl;
+ ::abort();
+ }
}
void EvtBtoXsEtap::initProbMax()
@@ -65,14 +78,14 @@
double m_b;
int i;
p->makeDaughters( getNDaug(), getDaugs() );
- EvtParticle* pdaug[MAX_DAUG];
+ EvtParticle* pdaug[2];
for ( i = 0; i < getNDaug(); i++ ) {
pdaug[i] = p->getDaug( i );
}
- static EvtVector4R p4[MAX_DAUG];
- static double mass[MAX_DAUG];
+ EvtVector4R p4[2];
+ double mass[2];
m_b = p->mass();
diff --git a/src/EvtGenModels/EvtBtoXsgamma.cpp b/src/EvtGenModels/EvtBtoXsgamma.cpp
--- a/src/EvtGenModels/EvtBtoXsgamma.cpp
+++ b/src/EvtGenModels/EvtBtoXsgamma.cpp
@@ -35,12 +35,12 @@
#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;
}
@@ -57,12 +57,18 @@
// check that at least one b->sg model has been selected
if ( getNArg() == 0 ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
- << "EvtBtoXsgamma generator expected "
+ << EvtBtoXsgamma::getName().c_str() << " generator expected "
<< " at least 1 argument but found: " << getNArg() << endl;
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
<< "Will terminate execution!" << endl;
::abort();
}
+
+ // check that there are only two daughters
+ checkNDaug( 2 );
+
+ // check that second daughter has photon spin
+ checkSpinDaughter( 1, EvtSpinType::PHOTON );
}
void EvtBtoXsgamma::initProbMax()
@@ -104,14 +110,14 @@
double m_b;
int i;
p->makeDaughters( getNDaug(), getDaugs() );
- EvtParticle* pdaug[MAX_DAUG];
+ EvtParticle* pdaug[2];
for ( i = 0; i < getNDaug(); i++ ) {
pdaug[i] = p->getDaug( i );
}
- static EvtVector4R p4[MAX_DAUG];
- static double mass[MAX_DAUG];
+ EvtVector4R p4[2];
+ double mass[2];
m_b = p->mass();
diff --git a/src/EvtGenModels/EvtBtoXsll.cpp b/src/EvtGenModels/EvtBtoXsll.cpp
--- a/src/EvtGenModels/EvtBtoXsll.cpp
+++ b/src/EvtGenModels/EvtBtoXsll.cpp
@@ -34,12 +34,12 @@
#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;
}
@@ -213,7 +213,8 @@
double ml = mass[1];
double pb( 0. );
- static int nmsg = 0;
+ static thread_local int nmsg = 0;
+
double xhadronMass = -999.0;
EvtVector4R p4xhadron;
diff --git a/src/EvtGenModels/EvtCBTo3piMPP.cpp b/src/EvtGenModels/EvtCBTo3piMPP.cpp
--- a/src/EvtGenModels/EvtCBTo3piMPP.cpp
+++ b/src/EvtGenModels/EvtCBTo3piMPP.cpp
@@ -29,12 +29,12 @@
#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;
}
@@ -69,8 +69,8 @@
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;
diff --git a/src/EvtGenModels/EvtCBTo3piP00.cpp b/src/EvtGenModels/EvtCBTo3piP00.cpp
--- a/src/EvtGenModels/EvtCBTo3piP00.cpp
+++ b/src/EvtGenModels/EvtCBTo3piP00.cpp
@@ -28,12 +28,12 @@
#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;
}
@@ -67,8 +67,8 @@
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;
diff --git a/src/EvtGenModels/EvtD0ToKspipi.cpp b/src/EvtGenModels/EvtD0ToKspipi.cpp
--- a/src/EvtGenModels/EvtD0ToKspipi.cpp
+++ b/src/EvtGenModels/EvtD0ToKspipi.cpp
@@ -8,12 +8,12 @@
#include <iostream>
-std::string EvtD0ToKspipi::getName()
+std::string EvtD0ToKspipi::getName() const
{
return "D0TOKSPIPI";
}
-EvtDecayBase* EvtD0ToKspipi::clone()
+EvtDecayBase* EvtD0ToKspipi::clone() const
{
return new EvtD0ToKspipi;
}
@@ -87,7 +87,7 @@
// 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 &&
diff --git a/src/EvtGenModels/EvtD0gammaDalitz.cpp b/src/EvtGenModels/EvtD0gammaDalitz.cpp
--- a/src/EvtGenModels/EvtD0gammaDalitz.cpp
+++ b/src/EvtGenModels/EvtD0gammaDalitz.cpp
@@ -54,12 +54,12 @@
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;
}
@@ -119,7 +119,7 @@
EvtParticle* parent =
part->getParent(); // If there are no mistakes, should be B+ or B-.
if ( parent != nullptr &&
- EvtDecayTable::getInstance()->getDecayFunc( parent )->getName() ==
+ EvtDecayTable::getInstance().getDecayFunc( parent )->getName() ==
"BTODDALITZCPK" ) {
EvtId parId = parent->getId();
if ( ( parId == m_BP ) || ( parId == m_BM ) || ( parId == m_B0 ) ||
@@ -134,24 +134,25 @@
// Read the D decay parameters from the B decay model.
// Gamma angle in rad.
- double gamma = EvtDecayTable::getInstance()->getDecayFunc( parent )->getArg(
- 0 );
+ const double gamma =
+ EvtDecayTable::getInstance().getDecayFunc( parent )->getArg( 0 );
// Strong phase in rad.
- double delta = EvtDecayTable::getInstance()->getDecayFunc( parent )->getArg(
- 1 );
+ const double delta =
+ EvtDecayTable::getInstance().getDecayFunc( parent )->getArg( 1 );
// Ratio between B->D0K and B->D0barK
- double rB = EvtDecayTable::getInstance()->getDecayFunc( parent )->getArg( 2 );
+ const 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();
+ const EvtVector4R pA = part->getDaug( m_d1 )->getP4();
+ const EvtVector4R pB = part->getDaug( m_d2 )->getP4();
+ const 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();
+ const double mSqAB = ( pA + pB ).mass2();
+ const double mSqAC = ( pA + pC ).mass2();
+ const double mSqBC = ( pB + pC ).mass2();
EvtComplex amp( 1.0, 0.0 );
@@ -196,32 +197,34 @@
// 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 );
@@ -248,25 +251,26 @@
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.
diff --git a/src/EvtGenModels/EvtD0mixDalitz.cpp b/src/EvtGenModels/EvtD0mixDalitz.cpp
--- a/src/EvtGenModels/EvtD0mixDalitz.cpp
+++ b/src/EvtGenModels/EvtD0mixDalitz.cpp
@@ -215,34 +215,34 @@
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 );
@@ -263,44 +263,46 @@
} 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 );
@@ -331,26 +333,26 @@
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.
diff --git a/src/EvtGenModels/EvtDDalitz.cpp b/src/EvtGenModels/EvtDDalitz.cpp
--- a/src/EvtGenModels/EvtDDalitz.cpp
+++ b/src/EvtGenModels/EvtDDalitz.cpp
@@ -38,12 +38,12 @@
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;
}
@@ -53,10 +53,10 @@
// 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.
@@ -104,26 +104,21 @@
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 );
@@ -356,12 +351,12 @@
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;
@@ -371,7 +366,7 @@
if ( ( BP == parId ) || ( BM == parId ) || ( B0 == parId ) ||
( B0B == parId ) )
if ( EvtDecayTable::getInstance()
- ->getDecayFunc( p->getParent() )
+ .getDecayFunc( p->getParent() )
->getName() == "BTODDALITZCPK" )
isBToDK = true;
}
@@ -472,17 +467,17 @@
if ( isBToDK ) {
// Gamma angle in rad.
- double gamma = EvtDecayTable::getInstance()
- ->getDecayFunc( p->getParent() )
- ->getArg( 0 );
+ const double gamma = EvtDecayTable::getInstance()
+ .getDecayFunc( p->getParent() )
+ ->getArg( 0 );
// Strong phase in rad.
- double delta = EvtDecayTable::getInstance()
- ->getDecayFunc( p->getParent() )
- ->getArg( 1 );
+ const 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 );
+ const double A = EvtDecayTable::getInstance()
+ .getDecayFunc( p->getParent() )
+ ->getArg( 2 );
EvtComplex Factor( fabs( A ) * cos( delta ),
fabs( A ) * sin( delta ) );
@@ -558,15 +553,15 @@
if ( isBToDK ) {
// Gamma angle in rad.
double gamma = EvtDecayTable::getInstance()
- ->getDecayFunc( p->getParent() )
+ .getDecayFunc( p->getParent() )
->getArg( 0 );
// Strong phase in rad.
double delta = EvtDecayTable::getInstance()
- ->getDecayFunc( p->getParent() )
+ .getDecayFunc( p->getParent() )
->getArg( 1 );
// Ratio between B->D0K and B->D0barK
double A = EvtDecayTable::getInstance()
- ->getDecayFunc( p->getParent() )
+ .getDecayFunc( p->getParent() )
->getArg( 2 );
EvtComplex Factor( fabs( A ) * cos( delta ),
diff --git a/src/EvtGenModels/EvtDMix.cpp b/src/EvtGenModels/EvtDMix.cpp
--- a/src/EvtGenModels/EvtDMix.cpp
+++ b/src/EvtGenModels/EvtDMix.cpp
@@ -29,12 +29,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtDToKpienu.cpp b/src/EvtGenModels/EvtDToKpienu.cpp
--- a/src/EvtGenModels/EvtDToKpienu.cpp
+++ b/src/EvtGenModels/EvtDToKpienu.cpp
@@ -27,12 +27,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtDalitzTable.cpp b/src/EvtGenModels/EvtDalitzTable.cpp
--- a/src/EvtGenModels/EvtDalitzTable.cpp
+++ b/src/EvtGenModels/EvtDalitzTable.cpp
@@ -46,25 +46,21 @@
m_readFiles.clear();
}
-EvtDalitzTable* EvtDalitzTable::getInstance( const std::string dec_name,
- bool verbose )
+const EvtDalitzTable& EvtDalitzTable::getInstance( const std::string dec_name,
+ bool verbose )
{
- static EvtDalitzTable* theDalitzTable = nullptr;
+ static thread_local EvtDalitzTable theDalitzTable;
- if ( theDalitzTable == nullptr ) {
- theDalitzTable = new EvtDalitzTable();
- }
-
- if ( !theDalitzTable->fileHasBeenRead( dec_name ) ) {
- theDalitzTable->readXMLDecayFile( dec_name, verbose );
+ 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;
@@ -429,7 +425,7 @@
}
}
-void EvtDalitzTable::checkParticle( std::string particle )
+void EvtDalitzTable::checkParticle( std::string particle ) const
{
if ( EvtPDL::getId( particle ) == EvtId( -1, -1 ) ) {
EvtGenReport( EVTGEN_ERROR, "EvtGen" )
@@ -487,11 +483,14 @@
<< "Did not find dalitz decays for particle:" << copy << "\n";
}
-std::vector<EvtDalitzDecayInfo> EvtDalitzTable::getDalitzTable( const EvtId& parent )
+std::vector<EvtDalitzDecayInfo> EvtDalitzTable::getDalitzTable(
+ const EvtId& parent ) const
{
std::vector<EvtDalitzDecayInfo> table;
- if ( m_dalitztable.find( parent ) != m_dalitztable.end() ) {
- table = m_dalitztable[parent];
+
+ auto iter = m_dalitztable.find( parent );
+ if ( iter != m_dalitztable.end() ) {
+ table = iter->second;
}
if ( table.empty() ) {
diff --git a/src/EvtGenModels/EvtEtaDalitz.cpp b/src/EvtGenModels/EvtEtaDalitz.cpp
--- a/src/EvtGenModels/EvtEtaDalitz.cpp
+++ b/src/EvtGenModels/EvtEtaDalitz.cpp
@@ -28,12 +28,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtEtaLLPiPi.cpp b/src/EvtGenModels/EvtEtaLLPiPi.cpp
--- a/src/EvtGenModels/EvtEtaLLPiPi.cpp
+++ b/src/EvtGenModels/EvtEtaLLPiPi.cpp
@@ -75,12 +75,12 @@
}
}
-std::string EvtEtaLLPiPi::getName()
+std::string EvtEtaLLPiPi::getName() const
{
return "ETA_LLPIPI";
}
-EvtDecayBase* EvtEtaLLPiPi::clone()
+EvtDecayBase* EvtEtaLLPiPi::clone() const
{
return new EvtEtaLLPiPi();
}
diff --git a/src/EvtGenModels/EvtFlatQ2.cpp b/src/EvtGenModels/EvtFlatQ2.cpp
--- a/src/EvtGenModels/EvtFlatQ2.cpp
+++ b/src/EvtGenModels/EvtFlatQ2.cpp
@@ -45,12 +45,12 @@
return L;
}
-std::string EvtFlatQ2::getName()
+std::string EvtFlatQ2::getName() const
{
return "FLATQ2";
}
-EvtDecayBase* EvtFlatQ2::clone()
+EvtDecayBase* EvtFlatQ2::clone() const
{
return new EvtFlatQ2;
}
diff --git a/src/EvtGenModels/EvtFlatSqDalitz.cpp b/src/EvtGenModels/EvtFlatSqDalitz.cpp
--- a/src/EvtGenModels/EvtFlatSqDalitz.cpp
+++ b/src/EvtGenModels/EvtFlatSqDalitz.cpp
@@ -30,12 +30,12 @@
#include <cmath>
#include <string>
-std::string EvtFlatSqDalitz::getName()
+std::string EvtFlatSqDalitz::getName() const
{
return "FLATSQDALITZ";
}
-EvtDecayBase* EvtFlatSqDalitz::clone()
+EvtDecayBase* EvtFlatSqDalitz::clone() const
{
return new EvtFlatSqDalitz;
}
diff --git a/src/EvtGenModels/EvtFourBodyPhsp.cpp b/src/EvtGenModels/EvtFourBodyPhsp.cpp
--- a/src/EvtGenModels/EvtFourBodyPhsp.cpp
+++ b/src/EvtGenModels/EvtFourBodyPhsp.cpp
@@ -28,12 +28,12 @@
#include <cmath>
-std::string EvtFourBodyPhsp::getName()
+std::string EvtFourBodyPhsp::getName() const
{
return "FOURBODYPHSP";
}
-EvtDecayBase* EvtFourBodyPhsp::clone()
+EvtDecayBase* EvtFourBodyPhsp::clone() const
{
return new EvtFourBodyPhsp;
}
diff --git a/src/EvtGenModels/EvtGenericDalitz.cpp b/src/EvtGenModels/EvtGenericDalitz.cpp
--- a/src/EvtGenModels/EvtGenericDalitz.cpp
+++ b/src/EvtGenModels/EvtGenericDalitz.cpp
@@ -26,12 +26,12 @@
#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();
}
@@ -46,7 +46,7 @@
EvtId d3 = getDaug( 2 );
std::vector<EvtDalitzDecayInfo> decays =
- EvtDalitzTable::getInstance( getArgStr( 0 ) )->getDalitzTable( parnum );
+ EvtDalitzTable::getInstance( getArgStr( 0 ) ).getDalitzTable( parnum );
std::vector<EvtDalitzDecayInfo>::iterator i = decays.begin();
for ( ; i != decays.end(); i++ ) {
diff --git a/src/EvtGenModels/EvtGoityRoberts.cpp b/src/EvtGenModels/EvtGoityRoberts.cpp
--- a/src/EvtGenModels/EvtGoityRoberts.cpp
+++ b/src/EvtGenModels/EvtGoityRoberts.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -61,14 +61,14 @@
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 );
@@ -91,10 +91,10 @@
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;
@@ -344,10 +344,10 @@
{
//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;
diff --git a/src/EvtGenModels/EvtHQET.cpp b/src/EvtGenModels/EvtHQET.cpp
--- a/src/EvtGenModels/EvtHQET.cpp
+++ b/src/EvtGenModels/EvtHQET.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtHQET2.cpp b/src/EvtGenModels/EvtHQET2.cpp
--- a/src/EvtGenModels/EvtHQET2.cpp
+++ b/src/EvtGenModels/EvtHQET2.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtHelAmp.cpp b/src/EvtGenModels/EvtHelAmp.cpp
--- a/src/EvtGenModels/EvtHelAmp.cpp
+++ b/src/EvtGenModels/EvtHelAmp.cpp
@@ -32,12 +32,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtHypNonLepton.cpp b/src/EvtGenModels/EvtHypNonLepton.cpp
--- a/src/EvtGenModels/EvtHypNonLepton.cpp
+++ b/src/EvtGenModels/EvtHypNonLepton.cpp
@@ -29,12 +29,12 @@
#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";
}
@@ -88,7 +88,7 @@
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;
@@ -158,7 +158,7 @@
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];
diff --git a/src/EvtGenModels/EvtISGW.cpp b/src/EvtGenModels/EvtISGW.cpp
--- a/src/EvtGenModels/EvtISGW.cpp
+++ b/src/EvtGenModels/EvtISGW.cpp
@@ -33,12 +33,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtISGW2.cpp b/src/EvtGenModels/EvtISGW2.cpp
--- a/src/EvtGenModels/EvtISGW2.cpp
+++ b/src/EvtGenModels/EvtISGW2.cpp
@@ -35,12 +35,12 @@
#include <stdlib.h>
#include <string>
-std::string EvtISGW2::getName()
+std::string EvtISGW2::getName() const
{
return "ISGW2";
}
-EvtDecayBase* EvtISGW2::clone()
+EvtDecayBase* EvtISGW2::clone() const
{
return new EvtISGW2;
}
@@ -55,150 +55,150 @@
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;
diff --git a/src/EvtGenModels/EvtISGW2FF.cpp b/src/EvtGenModels/EvtISGW2FF.cpp
--- a/src/EvtGenModels/EvtISGW2FF.cpp
+++ b/src/EvtGenModels/EvtISGW2FF.cpp
@@ -35,58 +35,58 @@
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 );
@@ -134,75 +134,75 @@
//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 ||
@@ -260,32 +260,32 @@
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;
@@ -453,39 +453,39 @@
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;
@@ -693,26 +693,26 @@
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 );
@@ -814,25 +814,25 @@
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 );
@@ -956,38 +956,38 @@
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 );
@@ -1162,38 +1162,38 @@
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 );
@@ -1367,41 +1367,41 @@
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 );
@@ -1551,38 +1551,38 @@
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 );
diff --git a/src/EvtGenModels/EvtISGWFF.cpp b/src/EvtGenModels/EvtISGWFF.cpp
--- a/src/EvtGenModels/EvtISGWFF.cpp
+++ b/src/EvtGenModels/EvtISGWFF.cpp
@@ -33,58 +33,58 @@
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 );
@@ -129,76 +129,76 @@
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;
@@ -247,22 +247,22 @@
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 );
@@ -329,22 +329,22 @@
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 );
@@ -405,21 +405,21 @@
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;
@@ -478,20 +478,20 @@
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 );
@@ -576,22 +576,22 @@
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 );
@@ -656,22 +656,22 @@
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 );
@@ -728,22 +728,22 @@
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 );
@@ -809,21 +809,21 @@
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 );
diff --git a/src/EvtGenModels/EvtKKLambdaC.cpp b/src/EvtGenModels/EvtKKLambdaC.cpp
--- a/src/EvtGenModels/EvtKKLambdaC.cpp
+++ b/src/EvtGenModels/EvtKKLambdaC.cpp
@@ -31,12 +31,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtKstarnunu.cpp b/src/EvtGenModels/EvtKstarnunu.cpp
--- a/src/EvtGenModels/EvtKstarnunu.cpp
+++ b/src/EvtGenModels/EvtKstarnunu.cpp
@@ -32,12 +32,12 @@
#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;
}
@@ -65,12 +65,12 @@
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() );
diff --git a/src/EvtGenModels/EvtLNuGamma.cpp b/src/EvtGenModels/EvtLNuGamma.cpp
--- a/src/EvtGenModels/EvtLNuGamma.cpp
+++ b/src/EvtGenModels/EvtLNuGamma.cpp
@@ -34,12 +34,12 @@
#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;
}
@@ -76,8 +76,8 @@
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 );
diff --git a/src/EvtGenModels/EvtLambdaP_BarGamma.cpp b/src/EvtGenModels/EvtLambdaP_BarGamma.cpp
--- a/src/EvtGenModels/EvtLambdaP_BarGamma.cpp
+++ b/src/EvtGenModels/EvtLambdaP_BarGamma.cpp
@@ -48,12 +48,12 @@
{
}
-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;
}
diff --git a/src/EvtGenModels/EvtLambdacPHH.cpp b/src/EvtGenModels/EvtLambdacPHH.cpp
--- a/src/EvtGenModels/EvtLambdacPHH.cpp
+++ b/src/EvtGenModels/EvtLambdacPHH.cpp
@@ -83,12 +83,12 @@
// 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;
}
@@ -111,11 +111,11 @@
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 );
diff --git a/src/EvtGenModels/EvtLb2Baryonlnu.cpp b/src/EvtGenModels/EvtLb2Baryonlnu.cpp
--- a/src/EvtGenModels/EvtLb2Baryonlnu.cpp
+++ b/src/EvtGenModels/EvtLb2Baryonlnu.cpp
@@ -48,12 +48,12 @@
m_calcamp = nullptr;
}
-std::string EvtLb2Baryonlnu::getName()
+std::string EvtLb2Baryonlnu::getName() const
{
return "Lb2Baryonlnu";
}
-EvtDecayBase* EvtLb2Baryonlnu::clone()
+EvtDecayBase* EvtLb2Baryonlnu::clone() const
{
return new EvtLb2Baryonlnu;
}
@@ -61,9 +61,9 @@
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();
@@ -81,34 +81,34 @@
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;
diff --git a/src/EvtGenModels/EvtLb2BaryonlnuFF.cpp b/src/EvtGenModels/EvtLb2BaryonlnuFF.cpp
--- a/src/EvtGenModels/EvtLb2BaryonlnuFF.cpp
+++ b/src/EvtGenModels/EvtLb2BaryonlnuFF.cpp
@@ -37,22 +37,22 @@
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;
@@ -239,20 +239,20 @@
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;
diff --git a/src/EvtGenModels/EvtLb2plnuLCSR.cpp b/src/EvtGenModels/EvtLb2plnuLCSR.cpp
--- a/src/EvtGenModels/EvtLb2plnuLCSR.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLCSR.cpp
@@ -48,12 +48,12 @@
m_calcamp = nullptr;
}
-std::string EvtLb2plnuLCSR::getName()
+std::string EvtLb2plnuLCSR::getName() const
{
return "Lb2plnuLCSR";
}
-EvtDecayBase* EvtLb2plnuLCSR::clone()
+EvtDecayBase* EvtLb2plnuLCSR::clone() const
{
return new EvtLb2plnuLCSR;
}
@@ -61,9 +61,9 @@
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();
@@ -81,10 +81,10 @@
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;
diff --git a/src/EvtGenModels/EvtLb2plnuLCSRFF.cpp b/src/EvtGenModels/EvtLb2plnuLCSRFF.cpp
--- a/src/EvtGenModels/EvtLb2plnuLCSRFF.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLCSRFF.cpp
@@ -36,10 +36,10 @@
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 ) ) {
diff --git a/src/EvtGenModels/EvtLb2plnuLQCD.cpp b/src/EvtGenModels/EvtLb2plnuLQCD.cpp
--- a/src/EvtGenModels/EvtLb2plnuLQCD.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLQCD.cpp
@@ -48,12 +48,12 @@
m_calcamp = nullptr;
}
-std::string EvtLb2plnuLQCD::getName()
+std::string EvtLb2plnuLQCD::getName() const
{
return "Lb2plnuLQCD";
}
-EvtDecayBase* EvtLb2plnuLQCD::clone()
+EvtDecayBase* EvtLb2plnuLQCD::clone() const
{
return new EvtLb2plnuLQCD;
}
@@ -61,9 +61,9 @@
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();
@@ -81,10 +81,10 @@
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;
diff --git a/src/EvtGenModels/EvtLb2plnuLQCDFF.cpp b/src/EvtGenModels/EvtLb2plnuLQCDFF.cpp
--- a/src/EvtGenModels/EvtLb2plnuLQCDFF.cpp
+++ b/src/EvtGenModels/EvtLb2plnuLQCDFF.cpp
@@ -36,10 +36,10 @@
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 ) ) {
diff --git a/src/EvtGenModels/EvtMelikhov.cpp b/src/EvtGenModels/EvtMelikhov.cpp
--- a/src/EvtGenModels/EvtMelikhov.cpp
+++ b/src/EvtGenModels/EvtMelikhov.cpp
@@ -31,12 +31,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtOmegaDalitz.cpp b/src/EvtGenModels/EvtOmegaDalitz.cpp
--- a/src/EvtGenModels/EvtOmegaDalitz.cpp
+++ b/src/EvtGenModels/EvtOmegaDalitz.cpp
@@ -31,12 +31,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtPVVCPLH.cpp b/src/EvtGenModels/EvtPVVCPLH.cpp
--- a/src/EvtGenModels/EvtPVVCPLH.cpp
+++ b/src/EvtGenModels/EvtPVVCPLH.cpp
@@ -34,12 +34,12 @@
#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;
}
@@ -68,8 +68,8 @@
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
@@ -89,9 +89,11 @@
//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
@@ -119,7 +121,7 @@
//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;
@@ -181,8 +183,8 @@
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;
diff --git a/src/EvtGenModels/EvtPartWave.cpp b/src/EvtGenModels/EvtPartWave.cpp
--- a/src/EvtGenModels/EvtPartWave.cpp
+++ b/src/EvtGenModels/EvtPartWave.cpp
@@ -36,12 +36,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtPhiDalitz.cpp b/src/EvtGenModels/EvtPhiDalitz.cpp
--- a/src/EvtGenModels/EvtPhiDalitz.cpp
+++ b/src/EvtGenModels/EvtPhiDalitz.cpp
@@ -37,12 +37,12 @@
// 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;
}
diff --git a/src/EvtGenModels/EvtPhsp.cpp b/src/EvtGenModels/EvtPhsp.cpp
--- a/src/EvtGenModels/EvtPhsp.cpp
+++ b/src/EvtGenModels/EvtPhsp.cpp
@@ -28,12 +28,12 @@
#include <stdlib.h>
#include <string>
-std::string EvtPhsp::getName()
+std::string EvtPhsp::getName() const
{
return "PHSP";
}
-EvtDecayBase* EvtPhsp::clone()
+EvtDecayBase* EvtPhsp::clone() const
{
return new EvtPhsp;
}
diff --git a/src/EvtGenModels/EvtPhspDecaytimeCut.cpp b/src/EvtGenModels/EvtPhspDecaytimeCut.cpp
--- a/src/EvtGenModels/EvtPhspDecaytimeCut.cpp
+++ b/src/EvtGenModels/EvtPhspDecaytimeCut.cpp
@@ -29,12 +29,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtPhspFlatLifetime.cpp b/src/EvtGenModels/EvtPhspFlatLifetime.cpp
--- a/src/EvtGenModels/EvtPhspFlatLifetime.cpp
+++ b/src/EvtGenModels/EvtPhspFlatLifetime.cpp
@@ -32,7 +32,7 @@
//==============================================================================
// Return the name of the model
//==============================================================================
-std::string EvtPhspFlatLifetime::getName()
+std::string EvtPhspFlatLifetime::getName() const
{
return "PHSPFLATLIFETIME";
}
@@ -40,7 +40,7 @@
//==============================================================================
// Copy the model
//==============================================================================
-EvtDecayBase* EvtPhspFlatLifetime::clone()
+EvtDecayBase* EvtPhspFlatLifetime::clone() const
{
return new EvtPhspFlatLifetime;
}
diff --git a/src/EvtGenModels/EvtPi0Dalitz.cpp b/src/EvtGenModels/EvtPi0Dalitz.cpp
--- a/src/EvtGenModels/EvtPi0Dalitz.cpp
+++ b/src/EvtGenModels/EvtPi0Dalitz.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtPsi2JpsiPiPi.cpp b/src/EvtGenModels/EvtPsi2JpsiPiPi.cpp
--- a/src/EvtGenModels/EvtPsi2JpsiPiPi.cpp
+++ b/src/EvtGenModels/EvtPsi2JpsiPiPi.cpp
@@ -79,12 +79,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtRareLbToLll.cpp b/src/EvtGenModels/EvtRareLbToLll.cpp
--- a/src/EvtGenModels/EvtRareLbToLll.cpp
+++ b/src/EvtGenModels/EvtRareLbToLll.cpp
@@ -37,13 +37,13 @@
#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;
}
diff --git a/src/EvtGenModels/EvtRareLbToLllWC.cpp b/src/EvtGenModels/EvtRareLbToLllWC.cpp
--- a/src/EvtGenModels/EvtRareLbToLllWC.cpp
+++ b/src/EvtGenModels/EvtRareLbToLllWC.cpp
@@ -28,7 +28,7 @@
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 );
@@ -114,7 +114,7 @@
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 );
diff --git a/src/EvtGenModels/EvtSLBKPole.cpp b/src/EvtGenModels/EvtSLBKPole.cpp
--- a/src/EvtGenModels/EvtSLBKPole.cpp
+++ b/src/EvtGenModels/EvtSLBKPole.cpp
@@ -33,12 +33,12 @@
#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;
diff --git a/src/EvtGenModels/EvtSLBKPoleFF.cpp b/src/EvtGenModels/EvtSLBKPoleFF.cpp
--- a/src/EvtGenModels/EvtSLBKPoleFF.cpp
+++ b/src/EvtGenModels/EvtSLBKPoleFF.cpp
@@ -94,26 +94,26 @@
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;
diff --git a/src/EvtGenModels/EvtSLBaryonAmp.cpp b/src/EvtGenModels/EvtSLBaryonAmp.cpp
--- a/src/EvtGenModels/EvtSLBaryonAmp.cpp
+++ b/src/EvtGenModels/EvtSLBaryonAmp.cpp
@@ -45,12 +45,12 @@
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
@@ -375,45 +375,45 @@
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;
diff --git a/src/EvtGenModels/EvtSLDiBaryonAmp.cpp b/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
--- a/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
+++ b/src/EvtGenModels/EvtSLDiBaryonAmp.cpp
@@ -35,12 +35,12 @@
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
@@ -419,18 +419,18 @@
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 ) ) {
diff --git a/src/EvtGenModels/EvtSLN.cpp b/src/EvtGenModels/EvtSLN.cpp
--- a/src/EvtGenModels/EvtSLN.cpp
+++ b/src/EvtGenModels/EvtSLN.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -65,9 +65,9 @@
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() );
diff --git a/src/EvtGenModels/EvtSLPole.cpp b/src/EvtGenModels/EvtSLPole.cpp
--- a/src/EvtGenModels/EvtSLPole.cpp
+++ b/src/EvtGenModels/EvtSLPole.cpp
@@ -33,12 +33,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtSSDCP.cpp b/src/EvtGenModels/EvtSSDCP.cpp
--- a/src/EvtGenModels/EvtSSDCP.cpp
+++ b/src/EvtGenModels/EvtSSDCP.cpp
@@ -35,12 +35,12 @@
#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;
}
@@ -177,11 +177,11 @@
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;
diff --git a/src/EvtGenModels/EvtSSD_DirectCP.cpp b/src/EvtGenModels/EvtSSD_DirectCP.cpp
--- a/src/EvtGenModels/EvtSSD_DirectCP.cpp
+++ b/src/EvtGenModels/EvtSSD_DirectCP.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtSSSCP.cpp b/src/EvtGenModels/EvtSSSCP.cpp
--- a/src/EvtGenModels/EvtSSSCP.cpp
+++ b/src/EvtGenModels/EvtSSSCP.cpp
@@ -30,12 +30,12 @@
#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;
}
@@ -62,8 +62,8 @@
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;
diff --git a/src/EvtGenModels/EvtSSSCPT.cpp b/src/EvtGenModels/EvtSSSCPT.cpp
--- a/src/EvtGenModels/EvtSSSCPT.cpp
+++ b/src/EvtGenModels/EvtSSSCPT.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -74,8 +74,8 @@
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;
diff --git a/src/EvtGenModels/EvtSSSCPpng.cpp b/src/EvtGenModels/EvtSSSCPpng.cpp
--- a/src/EvtGenModels/EvtSSSCPpng.cpp
+++ b/src/EvtGenModels/EvtSSSCPpng.cpp
@@ -32,12 +32,12 @@
#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;
}
@@ -64,8 +64,8 @@
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;
diff --git a/src/EvtGenModels/EvtSTS.cpp b/src/EvtGenModels/EvtSTS.cpp
--- a/src/EvtGenModels/EvtSTS.cpp
+++ b/src/EvtGenModels/EvtSTS.cpp
@@ -31,12 +31,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtSTSCP.cpp b/src/EvtGenModels/EvtSTSCP.cpp
--- a/src/EvtGenModels/EvtSTSCP.cpp
+++ b/src/EvtGenModels/EvtSTSCP.cpp
@@ -33,7 +33,7 @@
#include <stdlib.h>
#include <string>
-std::string EvtSTSCP::getName()
+std::string EvtSTSCP::getName() const
{
return "STS_CP";
}
@@ -46,7 +46,7 @@
setProbMax( 20 * ( getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 ) ) );
}
-EvtDecayBase* EvtSTSCP::clone()
+EvtDecayBase* EvtSTSCP::clone() const
{
return new EvtSTSCP;
}
@@ -66,8 +66,8 @@
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;
diff --git a/src/EvtGenModels/EvtSVP.cpp b/src/EvtGenModels/EvtSVP.cpp
--- a/src/EvtGenModels/EvtSVP.cpp
+++ b/src/EvtGenModels/EvtSVP.cpp
@@ -29,12 +29,12 @@
#include <cmath>
-std::string EvtSVP::getName()
+std::string EvtSVP::getName() const
{
return "SVP";
}
-EvtDecayBase* EvtSVP::clone()
+EvtDecayBase* EvtSVP::clone() const
{
return new EvtSVP;
}
diff --git a/src/EvtGenModels/EvtSVPCP.cpp b/src/EvtGenModels/EvtSVPCP.cpp
--- a/src/EvtGenModels/EvtSVPCP.cpp
+++ b/src/EvtGenModels/EvtSVPCP.cpp
@@ -36,12 +36,12 @@
#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;
}
@@ -65,8 +65,8 @@
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;
diff --git a/src/EvtGenModels/EvtSVPHelAmp.cpp b/src/EvtGenModels/EvtSVPHelAmp.cpp
--- a/src/EvtGenModels/EvtSVPHelAmp.cpp
+++ b/src/EvtGenModels/EvtSVPHelAmp.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtSVPHelCPMix.cpp b/src/EvtGenModels/EvtSVPHelCPMix.cpp
--- a/src/EvtGenModels/EvtSVPHelCPMix.cpp
+++ b/src/EvtGenModels/EvtSVPHelCPMix.cpp
@@ -34,12 +34,12 @@
#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;
}
@@ -63,8 +63,8 @@
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)
@@ -84,11 +84,12 @@
}
}
- 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.
@@ -100,7 +101,7 @@
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 ) );
diff --git a/src/EvtGenModels/EvtSVS.cpp b/src/EvtGenModels/EvtSVS.cpp
--- a/src/EvtGenModels/EvtSVS.cpp
+++ b/src/EvtGenModels/EvtSVS.cpp
@@ -29,12 +29,12 @@
#include <stdlib.h>
#include <string>
-std::string EvtSVS::getName()
+std::string EvtSVS::getName() const
{
return "SVS";
}
-EvtDecayBase* EvtSVS::clone()
+EvtDecayBase* EvtSVS::clone() const
{
return new EvtSVS;
}
diff --git a/src/EvtGenModels/EvtSVSCP.cpp b/src/EvtGenModels/EvtSVSCP.cpp
--- a/src/EvtGenModels/EvtSVSCP.cpp
+++ b/src/EvtGenModels/EvtSVSCP.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -64,8 +64,8 @@
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() );
diff --git a/src/EvtGenModels/EvtSVSCPLH.cpp b/src/EvtGenModels/EvtSVSCPLH.cpp
--- a/src/EvtGenModels/EvtSVSCPLH.cpp
+++ b/src/EvtGenModels/EvtSVSCPLH.cpp
@@ -33,12 +33,12 @@
#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;
}
@@ -54,7 +54,7 @@
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 );
@@ -93,8 +93,8 @@
{
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;
diff --git a/src/EvtGenModels/EvtSVSCPiso.cpp b/src/EvtGenModels/EvtSVSCPiso.cpp
--- a/src/EvtGenModels/EvtSVSCPiso.cpp
+++ b/src/EvtGenModels/EvtSVSCPiso.cpp
@@ -33,12 +33,12 @@
#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;
}
@@ -103,8 +103,8 @@
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;
diff --git a/src/EvtGenModels/EvtSVSNONCPEIGEN.cpp b/src/EvtGenModels/EvtSVSNONCPEIGEN.cpp
--- a/src/EvtGenModels/EvtSVSNONCPEIGEN.cpp
+++ b/src/EvtGenModels/EvtSVSNONCPEIGEN.cpp
@@ -32,12 +32,12 @@
#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;
}
@@ -83,8 +83,8 @@
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;
diff --git a/src/EvtGenModels/EvtSVVCP.cpp b/src/EvtGenModels/EvtSVVCP.cpp
--- a/src/EvtGenModels/EvtSVVCP.cpp
+++ b/src/EvtGenModels/EvtSVVCP.cpp
@@ -33,12 +33,12 @@
#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;
}
@@ -67,8 +67,8 @@
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;
diff --git a/src/EvtGenModels/EvtSVVCPLH.cpp b/src/EvtGenModels/EvtSVVCPLH.cpp
--- a/src/EvtGenModels/EvtSVVCPLH.cpp
+++ b/src/EvtGenModels/EvtSVVCPLH.cpp
@@ -34,12 +34,12 @@
#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;
}
@@ -68,8 +68,8 @@
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;
@@ -93,8 +93,8 @@
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.
diff --git a/src/EvtGenModels/EvtSVVHelAmp.cpp b/src/EvtGenModels/EvtSVVHelAmp.cpp
--- a/src/EvtGenModels/EvtSVVHelAmp.cpp
+++ b/src/EvtGenModels/EvtSVVHelAmp.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtSVVHelCPMix.cpp b/src/EvtGenModels/EvtSVVHelCPMix.cpp
--- a/src/EvtGenModels/EvtSVVHelCPMix.cpp
+++ b/src/EvtGenModels/EvtSVVHelCPMix.cpp
@@ -37,12 +37,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtSVVNONCPEIGEN.cpp b/src/EvtGenModels/EvtSVVNONCPEIGEN.cpp
--- a/src/EvtGenModels/EvtSVVNONCPEIGEN.cpp
+++ b/src/EvtGenModels/EvtSVVNONCPEIGEN.cpp
@@ -34,12 +34,12 @@
#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;
}
@@ -94,8 +94,8 @@
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;
diff --git a/src/EvtGenModels/EvtSingleParticle.cpp b/src/EvtGenModels/EvtSingleParticle.cpp
--- a/src/EvtGenModels/EvtSingleParticle.cpp
+++ b/src/EvtGenModels/EvtSingleParticle.cpp
@@ -30,12 +30,12 @@
#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();
}
diff --git a/src/EvtGenModels/EvtSll.cpp b/src/EvtGenModels/EvtSll.cpp
--- a/src/EvtGenModels/EvtSll.cpp
+++ b/src/EvtGenModels/EvtSll.cpp
@@ -31,12 +31,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtTSS.cpp b/src/EvtGenModels/EvtTSS.cpp
--- a/src/EvtGenModels/EvtTSS.cpp
+++ b/src/EvtGenModels/EvtTSS.cpp
@@ -30,12 +30,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtTVP.cpp b/src/EvtGenModels/EvtTVP.cpp
--- a/src/EvtGenModels/EvtTVP.cpp
+++ b/src/EvtGenModels/EvtTVP.cpp
@@ -29,12 +29,12 @@
#include <cmath>
-std::string EvtTVP::getName()
+std::string EvtTVP::getName() const
{
return "TVP";
}
-EvtDecayBase* EvtTVP::clone()
+EvtDecayBase* EvtTVP::clone() const
{
return new EvtTVP;
}
diff --git a/src/EvtGenModels/EvtTVSPwave.cpp b/src/EvtGenModels/EvtTVSPwave.cpp
--- a/src/EvtGenModels/EvtTVSPwave.cpp
+++ b/src/EvtGenModels/EvtTVSPwave.cpp
@@ -30,12 +30,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtTauHadnu.cpp b/src/EvtGenModels/EvtTauHadnu.cpp
--- a/src/EvtGenModels/EvtTauHadnu.cpp
+++ b/src/EvtGenModels/EvtTauHadnu.cpp
@@ -34,12 +34,12 @@
using namespace std;
-std::string EvtTauHadnu::getName()
+std::string EvtTauHadnu::getName() const
{
return "TAUHADNU";
}
-EvtDecayBase* EvtTauHadnu::clone()
+EvtDecayBase* EvtTauHadnu::clone() const
{
return new EvtTauHadnu;
}
@@ -113,7 +113,7 @@
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-" };
diff --git a/src/EvtGenModels/EvtTauScalarnu.cpp b/src/EvtGenModels/EvtTauScalarnu.cpp
--- a/src/EvtGenModels/EvtTauScalarnu.cpp
+++ b/src/EvtGenModels/EvtTauScalarnu.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -60,7 +60,7 @@
void EvtTauScalarnu::decay( EvtParticle* p )
{
- static EvtId TAUM = EvtPDL::getId( "tau-" );
+ static const EvtId TAUM = EvtPDL::getId( "tau-" );
p->initializePhaseSpace( getNDaug(), getDaugs() );
EvtParticle* nut;
diff --git a/src/EvtGenModels/EvtTauVectornu.cpp b/src/EvtGenModels/EvtTauVectornu.cpp
--- a/src/EvtGenModels/EvtTauVectornu.cpp
+++ b/src/EvtGenModels/EvtTauVectornu.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -60,7 +60,7 @@
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;
diff --git a/src/EvtGenModels/EvtTaulnunu.cpp b/src/EvtGenModels/EvtTaulnunu.cpp
--- a/src/EvtGenModels/EvtTaulnunu.cpp
+++ b/src/EvtGenModels/EvtTaulnunu.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -61,7 +61,7 @@
void EvtTaulnunu::decay( EvtParticle* p )
{
- static EvtId TAUM = EvtPDL::getId( "tau-" );
+ static const EvtId TAUM = EvtPDL::getId( "tau-" );
p->initializePhaseSpace( getNDaug(), getDaugs() );
diff --git a/src/EvtGenModels/EvtThreeBodyPhsp.cpp b/src/EvtGenModels/EvtThreeBodyPhsp.cpp
--- a/src/EvtGenModels/EvtThreeBodyPhsp.cpp
+++ b/src/EvtGenModels/EvtThreeBodyPhsp.cpp
@@ -30,12 +30,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtVPHOtoVISRHi.cpp b/src/EvtGenModels/EvtVPHOtoVISRHi.cpp
--- a/src/EvtGenModels/EvtVPHOtoVISRHi.cpp
+++ b/src/EvtGenModels/EvtVPHOtoVISRHi.cpp
@@ -33,12 +33,12 @@
using std::endl;
-std::string EvtVPHOtoVISRHi::getName()
+std::string EvtVPHOtoVISRHi::getName() const
{
return "VPHOTOVISRHI";
}
-EvtDecayBase* EvtVPHOtoVISRHi::clone()
+EvtDecayBase* EvtVPHOtoVISRHi::clone() const
{
return new EvtVPHOtoVISRHi;
}
@@ -71,18 +71,18 @@
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;
diff --git a/src/EvtGenModels/EvtVSPPwave.cpp b/src/EvtGenModels/EvtVSPPwave.cpp
--- a/src/EvtGenModels/EvtVSPPwave.cpp
+++ b/src/EvtGenModels/EvtVSPPwave.cpp
@@ -30,12 +30,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtVSS.cpp b/src/EvtGenModels/EvtVSS.cpp
--- a/src/EvtGenModels/EvtVSS.cpp
+++ b/src/EvtGenModels/EvtVSS.cpp
@@ -30,12 +30,12 @@
#include <stdlib.h>
#include <string>
-std::string EvtVSS::getName()
+std::string EvtVSS::getName() const
{
return "VSS";
}
-EvtDecayBase* EvtVSS::clone()
+EvtDecayBase* EvtVSS::clone() const
{
return new EvtVSS;
}
diff --git a/src/EvtGenModels/EvtVSSBMixCPT.cpp b/src/EvtGenModels/EvtVSSBMixCPT.cpp
--- a/src/EvtGenModels/EvtVSSBMixCPT.cpp
+++ b/src/EvtGenModels/EvtVSSBMixCPT.cpp
@@ -33,12 +33,12 @@
#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;
}
@@ -207,8 +207,8 @@
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
diff --git a/src/EvtGenModels/EvtVSSMix.cpp b/src/EvtGenModels/EvtVSSMix.cpp
--- a/src/EvtGenModels/EvtVSSMix.cpp
+++ b/src/EvtGenModels/EvtVSSMix.cpp
@@ -31,12 +31,12 @@
#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;
}
@@ -61,8 +61,8 @@
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;
diff --git a/src/EvtGenModels/EvtVVP.cpp b/src/EvtGenModels/EvtVVP.cpp
--- a/src/EvtGenModels/EvtVVP.cpp
+++ b/src/EvtGenModels/EvtVVP.cpp
@@ -29,12 +29,12 @@
#include <cmath>
-std::string EvtVVP::getName()
+std::string EvtVVP::getName() const
{
return "VVP";
}
-EvtDecayBase* EvtVVP::clone()
+EvtDecayBase* EvtVVP::clone() const
{
return new EvtVVP;
}
diff --git a/src/EvtGenModels/EvtVVPIPI_WEIGHTED.cpp b/src/EvtGenModels/EvtVVPIPI_WEIGHTED.cpp
--- a/src/EvtGenModels/EvtVVPIPI_WEIGHTED.cpp
+++ b/src/EvtGenModels/EvtVVPIPI_WEIGHTED.cpp
@@ -31,21 +31,21 @@
#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 );
diff --git a/src/EvtGenModels/EvtVVSPwave.cpp b/src/EvtGenModels/EvtVVSPwave.cpp
--- a/src/EvtGenModels/EvtVVSPwave.cpp
+++ b/src/EvtGenModels/EvtVVSPwave.cpp
@@ -31,12 +31,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtVVpipi.cpp b/src/EvtGenModels/EvtVVpipi.cpp
--- a/src/EvtGenModels/EvtVVpipi.cpp
+++ b/src/EvtGenModels/EvtVVpipi.cpp
@@ -31,21 +31,21 @@
#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 );
diff --git a/src/EvtGenModels/EvtVectorIsr.cpp b/src/EvtGenModels/EvtVectorIsr.cpp
--- a/src/EvtGenModels/EvtVectorIsr.cpp
+++ b/src/EvtGenModels/EvtVectorIsr.cpp
@@ -36,12 +36,12 @@
#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;
}
@@ -85,7 +85,7 @@
//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;
diff --git a/src/EvtGenModels/EvtVll.cpp b/src/EvtGenModels/EvtVll.cpp
--- a/src/EvtGenModels/EvtVll.cpp
+++ b/src/EvtGenModels/EvtVll.cpp
@@ -31,12 +31,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtVtoSll.cpp b/src/EvtGenModels/EvtVtoSll.cpp
--- a/src/EvtGenModels/EvtVtoSll.cpp
+++ b/src/EvtGenModels/EvtVtoSll.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtVub.cpp b/src/EvtGenModels/EvtVub.cpp
--- a/src/EvtGenModels/EvtVub.cpp
+++ b/src/EvtGenModels/EvtVub.cpp
@@ -33,12 +33,12 @@
#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;
}
@@ -146,9 +146,6 @@
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
diff --git a/src/EvtGenModels/EvtVubBLNP.cpp b/src/EvtGenModels/EvtVubBLNP.cpp
--- a/src/EvtGenModels/EvtVubBLNP.cpp
+++ b/src/EvtGenModels/EvtVubBLNP.cpp
@@ -44,12 +44,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtVubBLNPHybrid.cpp b/src/EvtGenModels/EvtVubBLNPHybrid.cpp
--- a/src/EvtGenModels/EvtVubBLNPHybrid.cpp
+++ b/src/EvtGenModels/EvtVubBLNPHybrid.cpp
@@ -44,12 +44,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtVubHybrid.cpp b/src/EvtGenModels/EvtVubHybrid.cpp
--- a/src/EvtGenModels/EvtVubHybrid.cpp
+++ b/src/EvtGenModels/EvtVubHybrid.cpp
@@ -38,12 +38,12 @@
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;
}
@@ -89,9 +89,9 @@
// 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;
diff --git a/src/EvtGenModels/EvtVubNLO.cpp b/src/EvtGenModels/EvtVubNLO.cpp
--- a/src/EvtGenModels/EvtVubNLO.cpp
+++ b/src/EvtGenModels/EvtVubNLO.cpp
@@ -46,12 +46,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtXPsiGamma.cpp b/src/EvtGenModels/EvtXPsiGamma.cpp
--- a/src/EvtGenModels/EvtXPsiGamma.cpp
+++ b/src/EvtGenModels/EvtXPsiGamma.cpp
@@ -34,12 +34,12 @@
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;
}
diff --git a/src/EvtGenModels/EvtY3SToY1SpipiMoxhay.cpp b/src/EvtGenModels/EvtY3SToY1SpipiMoxhay.cpp
--- a/src/EvtGenModels/EvtY3SToY1SpipiMoxhay.cpp
+++ b/src/EvtGenModels/EvtY3SToY1SpipiMoxhay.cpp
@@ -31,21 +31,21 @@
#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 );
diff --git a/src/EvtGenModels/EvtYmSToYnSpipiCLEO.cpp b/src/EvtGenModels/EvtYmSToYnSpipiCLEO.cpp
--- a/src/EvtGenModels/EvtYmSToYnSpipiCLEO.cpp
+++ b/src/EvtGenModels/EvtYmSToYnSpipiCLEO.cpp
@@ -32,21 +32,21 @@
#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 );
diff --git a/src/EvtGenModels/EvtbTosllAli.cpp b/src/EvtGenModels/EvtbTosllAli.cpp
--- a/src/EvtGenModels/EvtbTosllAli.cpp
+++ b/src/EvtGenModels/EvtbTosllAli.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtbTosllBall.cpp b/src/EvtGenModels/EvtbTosllBall.cpp
--- a/src/EvtGenModels/EvtbTosllBall.cpp
+++ b/src/EvtGenModels/EvtbTosllBall.cpp
@@ -34,12 +34,12 @@
#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;
}
diff --git a/src/EvtGenModels/EvtbTosllMS.cpp b/src/EvtGenModels/EvtbTosllMS.cpp
--- a/src/EvtGenModels/EvtbTosllMS.cpp
+++ b/src/EvtGenModels/EvtbTosllMS.cpp
@@ -45,13 +45,13 @@
}
// 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;
}
diff --git a/src/EvtGenModels/EvtbTosllMSExt.cpp b/src/EvtGenModels/EvtbTosllMSExt.cpp
--- a/src/EvtGenModels/EvtbTosllMSExt.cpp
+++ b/src/EvtGenModels/EvtbTosllMSExt.cpp
@@ -42,13 +42,13 @@
}
// 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;
}
diff --git a/src/EvtGenModels/EvtbTosllScalarAmp.cpp b/src/EvtGenModels/EvtbTosllScalarAmp.cpp
--- a/src/EvtGenModels/EvtbTosllScalarAmp.cpp
+++ b/src/EvtGenModels/EvtbTosllScalarAmp.cpp
@@ -98,8 +98,8 @@
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;
diff --git a/src/EvtGenModels/EvtbTosllVectorAmp.cpp b/src/EvtGenModels/EvtbTosllVectorAmp.cpp
--- a/src/EvtGenModels/EvtbTosllVectorAmp.cpp
+++ b/src/EvtGenModels/EvtbTosllVectorAmp.cpp
@@ -127,8 +127,8 @@
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;
diff --git a/src/EvtGenModels/Evtbs2llGammaAmp.cpp b/src/EvtGenModels/Evtbs2llGammaAmp.cpp
--- a/src/EvtGenModels/Evtbs2llGammaAmp.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaAmp.cpp
@@ -375,8 +375,8 @@
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();
diff --git a/src/EvtGenModels/Evtbs2llGammaISRFSR.cpp b/src/EvtGenModels/Evtbs2llGammaISRFSR.cpp
--- a/src/EvtGenModels/Evtbs2llGammaISRFSR.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaISRFSR.cpp
@@ -40,13 +40,13 @@
}
// 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;
}
diff --git a/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp b/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
--- a/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaISRFSRAmp.cpp
@@ -399,8 +399,8 @@
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();
diff --git a/src/EvtGenModels/Evtbs2llGammaMNT.cpp b/src/EvtGenModels/Evtbs2llGammaMNT.cpp
--- a/src/EvtGenModels/Evtbs2llGammaMNT.cpp
+++ b/src/EvtGenModels/Evtbs2llGammaMNT.cpp
@@ -40,13 +40,13 @@
}
// 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;
}
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -20,13 +20,11 @@
# the test executables require ROOT for histogramming etc.
-find_package(ROOT QUIET COMPONENTS Hist)
+find_package(ROOT 6.18 QUIET COMPONENTS Hist)
find_package(nlohmann_json 3.6.1 QUIET)
-if (ROOT_FOUND AND nlohmann_json_FOUND)
- add_library(root_interface INTERFACE IMPORTED)
- target_include_directories(root_interface INTERFACE ${ROOT_INCLUDE_DIRS})
- target_link_libraries(root_interface INTERFACE ${ROOT_LIBRARIES})
-
+find_package(Threads QUIET)
+find_package(TBB QUIET)
+if (ROOT_FOUND AND nlohmann_json_FOUND AND Threads_FOUND AND TBB_FOUND)
# build each of the executables
foreach( test_exe evt_dalitz evtgenlhc_test1 example1 exampleWriteHepMC testDecayModel )
add_executable(${test_exe} ${test_exe}.cc)
@@ -38,11 +36,13 @@
target_compile_definitions(${test_exe} PRIVATE EVTGEN_EXTERNAL)
target_link_libraries(${test_exe} PRIVATE EvtGenExternal)
endif()
- target_link_libraries(${test_exe} PRIVATE root_interface)
+ target_link_libraries(${test_exe} PRIVATE ROOT::Core ROOT::RIO ROOT::Hist ROOT::Tree)
endforeach()
- # testDecayModel needs nlohmann_json as well
+ # testDecayModel needs nlohmann_json and Threads as well
target_link_libraries(testDecayModel PRIVATE nlohmann_json::nlohmann_json)
+ target_link_libraries(testDecayModel PRIVATE Threads::Threads)
+ target_link_libraries(testDecayModel PRIVATE TBB::tbb)
# install the executables
install(TARGETS evt_dalitz evtgenlhc_test1 example1 exampleWriteHepMC testDecayModel
diff --git a/test/checkJsonFiles.py b/test/checkJsonFiles.py
--- a/test/checkJsonFiles.py
+++ b/test/checkJsonFiles.py
@@ -289,6 +289,11 @@
for jsonFileName in jsonFiles :
+ if not jsonFileName.endswith('.json') :
+ if jsonFileName == 'config' :
+ continue
+ print(f'Skipping {jsonFileName}')
+
print(f'Checking file: {jsonFileName}')
checker = JsonFileChecker( jsonFileName )
diff --git a/test/evtgenlhc_test1.cc b/test/evtgenlhc_test1.cc
--- a/test/evtgenlhc_test1.cc
+++ b/test/evtgenlhc_test1.cc
@@ -1195,7 +1195,7 @@
int i;
for ( i = 0; i < nevent; i++ ) {
- EvtDecayTable::getInstance()->readDecayFile(
+ EvtDecayTable::getInstance().readDecayFile(
std::string( "../DECAY.DEC" ) );
}
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n";
diff --git a/test/jsonFiles/config/2_stdthreads.json b/test/jsonFiles/config/2_stdthreads.json
new file mode 100644
--- /dev/null
+++ b/test/jsonFiles/config/2_stdthreads.json
@@ -0,0 +1,5 @@
+{
+ "threads" : 2,
+ "thread_model" : "StdLib",
+ "fsr_generator" : "PHOTOS"
+}
diff --git a/test/jsonFiles/config/2_tbbthreads.json b/test/jsonFiles/config/2_tbbthreads.json
new file mode 100644
--- /dev/null
+++ b/test/jsonFiles/config/2_tbbthreads.json
@@ -0,0 +1,5 @@
+{
+ "threads" : 2,
+ "thread_model" : "TBB",
+ "fsr_generator" : "PHOTOS"
+}
diff --git a/test/jsonFiles/config/default.json b/test/jsonFiles/config/default.json
new file mode 100644
--- /dev/null
+++ b/test/jsonFiles/config/default.json
@@ -0,0 +1,5 @@
+{
+ "threads" : 1,
+ "thread_model" : "StdLib",
+ "fsr_generator" : "PHOTOS"
+}
diff --git a/test/testDecayModel.hh b/test/testDecayModel.hh
--- a/test/testDecayModel.hh
+++ b/test/testDecayModel.hh
@@ -27,7 +27,9 @@
#include "nlohmann/json.hpp"
+#include <array>
#include <cmath>
+#include <mutex>
#include <string>
#include <utility>
#include <vector>
@@ -35,74 +37,356 @@
class EvtGen;
class EvtParticle;
-class TestInfo {
+/**
+ \enum FSRGenerator
+ Enumeration of possible FSR generators and their settings
+*/
+enum class FSRGenerator
+{
+ PHOTOS, ///< PHOTOS generator
+ SherpaPhotons1, ///< Sherpa Photons generator, mode 1
+ SherpaPhotons20, ///< Sherpa Photons generator, mode 2, exact ME calculations off
+ SherpaPhotons21 ///< Sherpa Photons generator, mode 2, exact ME calculations on
+};
+
+/**
+ \enum ThreadModel
+ Enumeration of possible models for multi-threading
+*/
+enum class ThreadModel
+{
+ StdLib, ///< C++ standard library model
+ TBB ///< Intel Thread Building Blocks model
+};
+
+//! \cond DOXYGEN_IGNORE
+
+/*
+ Here we define a custom version of the NLOHMANN_JSON_SERIALIZE_ENUM macro.
+ The macro supplied by the nlohmann_json package will convert any
+ unrecognised string to the first enum state, which here we throw an
+ exception in such cases.
+ In addition, we define the to_string utility function.
+*/
+
+#define CUSTOM_NLOHMANN_JSON_SERIALIZE_ENUM( ENUM_TYPE, ... ) \
+ template <typename BasicJsonType> \
+ inline void to_json( BasicJsonType& j, const ENUM_TYPE& e ) \
+ { \
+ static_assert( std::is_enum<ENUM_TYPE>::value, \
+ #ENUM_TYPE " must be an enum!" ); \
+ static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
+ auto it = std::find_if( \
+ std::begin( m ), std::end( m ), \
+ [e]( const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair ) -> bool { \
+ return ej_pair.first == e; \
+ } ); \
+ if ( it == std::end( m ) ) { \
+ throw std::runtime_error{ \
+ "ERROR in conversion to JSON, invalid state for " #ENUM_TYPE }; \
+ } \
+ j = it->second; \
+ } \
+ template <typename BasicJsonType> \
+ inline void from_json( const BasicJsonType& j, ENUM_TYPE& e ) \
+ { \
+ static_assert( std::is_enum<ENUM_TYPE>::value, \
+ #ENUM_TYPE " must be an enum!" ); \
+ static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
+ auto it = std::find_if( \
+ std::begin( m ), std::end( m ), \
+ [&j]( const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair ) -> bool { \
+ return ej_pair.second == j; \
+ } ); \
+ if ( it == std::end( m ) ) { \
+ throw std::runtime_error{ \
+ "ERROR in conversion from JSON, invalid state for " #ENUM_TYPE }; \
+ } \
+ e = it->first; \
+ } \
+ inline std::string to_string( const ENUM_TYPE& e ) \
+ { \
+ static_assert( std::is_enum<ENUM_TYPE>::value, \
+ #ENUM_TYPE " must be an enum!" ); \
+ nlohmann::json j; \
+ to_json( j, e ); \
+ return j.get<std::string>(); \
+ }
+
+// Generate functions for serialisation of the FSRGenerator and ThreadModel enums
+
+CUSTOM_NLOHMANN_JSON_SERIALIZE_ENUM(
+ FSRGenerator, {
+ { FSRGenerator::PHOTOS, "PHOTOS" },
+ { FSRGenerator::SherpaPhotons1, "SherpaPhotons1" },
+ { FSRGenerator::SherpaPhotons20, "SherpaPhotons20" },
+ { FSRGenerator::SherpaPhotons21, "SherpaPhotons21" },
+ } )
+
+CUSTOM_NLOHMANN_JSON_SERIALIZE_ENUM( ThreadModel,
+ {
+ { ThreadModel::StdLib, "StdLib" },
+ { ThreadModel::TBB, "TBB" },
+ } )
+
+//! \endcond
+
+/**
+ \class HistInfo
+ Information about a given histogram: variable name(s), daughter indices
+*/
+class HistInfo {
public:
- TestInfo( const std::string& name, const int d1, const int d2,
- const std::string& nameY = "", const int d1Y = 0,
- const int d2Y = 0 ) :
- m_name{ name }, m_nameY{ nameY }, m_d1{ d1 }, m_d2{ d2 }, m_d1Y{ d1Y }, m_d2Y{ d2Y }
+ /**
+ \enum Axis
+ Enumeration of histogram axes
+ */
+ enum class Axis
+ {
+ X,
+ Y
+ };
+
+ /// Constructor for 1D histogram
+ HistInfo( const std::string& name, const int d1, const int d2 ) :
+ m_nameX{ name }, m_d1X{ d1 }, m_d2X{ d2 }
{
}
- const std::string getName( const int var = 1 ) const
+ /// Constructor for 2D histogram
+ HistInfo( const std::string& nameX, const int d1X, const int d2X,
+ const std::string& nameY, const int d1Y, const int d2Y ) :
+ m_nameX{ nameX }, m_nameY{ nameY }, m_d1X{ d1X }, m_d2X{ d2X }, m_d1Y{ d1Y }, m_d2Y{ d2Y }
{
- return var == 2 ? m_nameY : m_name;
}
- int getd1( const int var = 1 ) const { return var == 2 ? m_d1Y : m_d1; }
- int getd2( const int var = 1 ) const { return var == 2 ? m_d2Y : m_d2; }
+
+ /// Retrieve variable name for given axis
+ const std::string getName( const Axis var = Axis::X ) const
+ {
+ return var == Axis::Y ? m_nameY : m_nameX;
+ }
+
+ /// Retrieve daughter 1 index for given axis
+ int getd1( const Axis var = Axis::X ) const
+ {
+ return var == Axis::Y ? m_d1Y : m_d1X;
+ }
+
+ /// Retrieve daughter 2 index for given axis
+ int getd2( const Axis var = Axis::X ) const
+ {
+ return var == Axis::Y ? m_d2Y : m_d2X;
+ }
private:
- std::string m_name;
+ /// x-axis variable name
+ std::string m_nameX;
+ /// y-axis variable name
std::string m_nameY;
- int m_d1;
- int m_d2;
- int m_d1Y;
- int m_d2Y;
+ /// x-axis daughter 1 index
+ int m_d1X{ 0 };
+ /// x-axis daughter 2 index
+ int m_d2X{ 0 };
+ /// y-axis daughter 1 index
+ int m_d1Y{ 0 };
+ /// y-axis daughter 2 index
+ int m_d2Y{ 0 };
};
+/**
+ \class TestHistos
+ \brief The set of histograms to be populated for a given test
+
+ Defined such that each thread can have its own set of histograms, which can
+ then be combined by the main thread after synchronisation and saved to the
+ output file.
+
+ To work properly with tbb::parallel_reduce, a default-constructed TestHistos
+ instance must act like a zero in a summation operation.
+*/
+class TestHistos {
+ public:
+ /// Default constructor
+ TestHistos() = default;
+ /// Constructor - creates the histograms specified in the JSON configuration
+ TestHistos( const std::string& parentName, const nlohmann::json& config );
+ /// Copy constructor
+ TestHistos( const TestHistos& rhs );
+ /// Move constructor
+ TestHistos( TestHistos&& rhs ) noexcept;
+ /// Copy asignment operator
+ TestHistos& operator=( const TestHistos& rhs );
+ /// Move asignment operator
+ TestHistos& operator=( TestHistos&& rhs ) noexcept;
+ /// Destructor
+ ~TestHistos() = default;
+
+ /// Add the rhs histograms to our own
+ void add( const TestHistos& rhs );
+
+ /// Normalise all histograms
+ void normalise();
+
+ /// Write all histograms to the supplied ROOT file
+ void save( TFile* outputFile );
+
+ /// typedef for 1D histogram store
+ using HistStore1D = std::vector<std::pair<HistInfo, std::unique_ptr<TH1>>>;
+ /// typedef for 2D histogram store
+ using HistStore2D = std::vector<std::pair<HistInfo, std::unique_ptr<TH2>>>;
+
+ /// Retrieve a const reference to the 1D histogram store
+ const HistStore1D& get1DHistos() const { return m_1DhistVect; }
+ /// Retrieve a reference to the 1D histogram store
+ HistStore1D& get1DHistos() { return m_1DhistVect; }
+ /// Retrieve a const reference to the 2D histogram store
+ const HistStore2D& get2DHistos() const { return m_2DhistVect; }
+ /// Retrieve a reference to the 2D histogram store
+ HistStore2D& get2DHistos() { return m_2DhistVect; }
+ /// Retrieve a const pointer to the mixed histogram
+ const TH1* getMixedHist() const { return m_mixedHist.get(); }
+ /// Retrieve a pointer to the mixed histogram
+ TH1* getMixedHist() { return m_mixedHist.get(); }
+
+ private:
+ /// Swap the histogram stores between two instances
+ void swap( TestHistos& rhs ) noexcept;
+
+ /// The store of 1D histograms
+ HistStore1D m_1DhistVect;
+ /// The store of 2D histograms
+ HistStore2D m_2DhistVect;
+ /// The mixed histogram
+ std::unique_ptr<TH1> m_mixedHist;
+};
+
+/**
+ \struct TestConfig
+ The settings for the test, as read from the JSON file
+*/
+struct TestConfig {
+ /// Name of the parent particle
+ std::string parentName;
+ /// Names of all first-generation decay products
+ std::vector<std::string> daughterNames;
+ /// Names of all second-generation decay products
+ std::vector<std::vector<std::string>> grandDaughterNames;
+
+ /// Names of the decay models
+ std::vector<std::string> modelNames;
+ /// Parameters of the decay models
+ std::vector<std::vector<std::string>> modelParameters;
+
+ /// Flag to control whether the charge-conjugate decay shoudl be generated
+ std::vector<bool> doConjDecay;
+
+ /// Extra global commands, e.g. noFSR
+ std::vector<std::string> extraCommands;
+
+ /// The FSR generator to use
+ FSRGenerator fsrGenerator;
+
+ /// The threading model to use
+ ThreadModel threadModel;
+
+ /// The name of the output ROOT file
+ std::string outFileName;
+ /// The name of the reference ROOT file
+ std::string refFileName;
+ /// The name of the decay file
+ std::string decFileName;
+
+ /// The number of events to generate
+ std::size_t nEvents;
+ /// The number of threads to use
+ std::size_t nThreads;
+ /// The base of the random number seed
+ std::size_t rngSeed;
+
+ /// Flag to control printing of debug output
+ bool debugFlag;
+
+ /// The set of histograms to be filled
+ TestHistos testHistograms;
+};
+
+/**
+ \class TestDecayModel
+ \brief Setup and run a test of a particular decay chain
+
+ The test configuration is loaded from a JSON object.
+ This contains the configuration of the model to test and the histograms to
+ fill, plus the configuration of how to run the test (FSR settings, thread
+ model, number of threads).
+*/
class TestDecayModel {
public:
- TestDecayModel( const nlohmann::json& config );
+ /// Constructor
+ explicit TestDecayModel( const nlohmann::json& config );
- bool run();
+ /// Run the test
+ void run();
private:
- bool checkMandatoryFields();
+ /// Check that all mandatory fields are present in the JSON record
+ static bool checkMandatoryFields( const nlohmann::json& config );
+
+ /// Populate the test configuration from the JSON record
+ static TestConfig readConfig( const nlohmann::json& config );
+
+ /// Run multi-threaded with standard library threading model
+ TestHistos runStdThreads() const;
- std::string createDecFile(
- const std::string& parent, const std::vector<std::string>& daughterNames,
- const std::vector<std::vector<std::string>>& grandDaughterNames,
- const std::vector<std::string>& models,
- const std::vector<std::vector<std::string>>& parameters,
- const std::vector<bool>& doConjDecay,
- const std::vector<std::string>& extras,
- const std::string decFileName ) const;
+ /// Run multi-threaded with Intel Thread Building Blocks threading model
+ TestHistos runTBBThreads() const;
- void defineHistos( TFile* theFile );
+ /**
+ For the specified range of events, run the main body: initialise,
+ create and read the decay file, generate events
+ */
+ TestHistos runDecayBody( const std::size_t firstEvent,
+ const std::size_t nEvents ) const;
- void generateEvents( EvtGen& theGen, const std::string& decFile,
- const std::string& parentName, const bool doConjDecay,
- const int nEvents, const bool debugFlag );
+ /// Create the decay file for the decay chain under test
+ void createDecFile() const;
- int findChargedDaugtherWithMaxE( const EvtParticle* parent ) const;
+ /// Generate the specified range of events and fill the histograms
+ void generateEvents( EvtGen& theGen, TestHistos& theHistos,
+ const std::size_t firstEvent,
+ const std::size_t nEvents ) const;
+ /// Calculate the value of the given variable for the generated decay
double getValue( const EvtParticle* rootPart, const std::string& varName,
const int d1, const int d2 ) const;
- void compareHistos( const std::string& refFileName ) const;
+ /// Compare generated histograms with those from a reference file
+ void compareHistos( const TestHistos& theHistos,
+ const std::string& refFileName ) const;
+ /**
+ \brief Find the index of the daughter with the largest energy
+
+ Sign convention: take negative daughter if mother is neutral,
+ otherwise the one with the same sign as the mother.
+ */
+ int findChargedDaughterWithMaxE( const EvtParticle* parent ) const;
+
+ /// Find the particle group for the given particle ID
int getPartGroup( const int PDGId ) const;
+ /// Check whether the given particle group is of the requested type
bool isPartType( const int group, const std::string& particleType ) const;
+ /// Calculate the cosine of the acoplanarity angle
double getCosAcoplanarityAngle( const EvtParticle* selectedParent,
const int sel_NDaugMax, const int d1,
const int d2 ) const;
- const nlohmann::json& m_config;
- std::vector<std::pair<TestInfo, TH1*>> m_1DhistVect;
- std::vector<std::pair<TestInfo, TH2*>> m_2DhistVect;
- TH1* m_mixedHist{ nullptr };
+ /// The test configuration
+ const TestConfig m_config;
+
+ /// Thread safety mutex
+ static std::once_flag m_createDecFile_threadlock;
};
#endif
diff --git a/test/testDecayModel.cc b/test/testDecayModel.cc
--- a/test/testDecayModel.cc
+++ b/test/testDecayModel.cc
@@ -38,18 +38,223 @@
#include "EvtGenExternal/EvtExternalGenList.hh"
#endif
+#include "TROOT.h"
+
+#include "tbb/tbb.h"
+
+#include <chrono>
#include <fstream>
+#include <future>
#include <iostream>
#include <list>
#include <memory>
using nlohmann::json;
-TestDecayModel::TestDecayModel( const json& config ) : m_config{ config }
+std::once_flag TestDecayModel::m_createDecFile_threadlock;
+
+TestHistos::TestHistos( const std::string& parentName, const json& config )
+{
+ // Histogram information
+ const std::size_t nHistos{ config.size() };
+
+ m_1DhistVect.reserve( nHistos );
+ m_2DhistVect.reserve( nHistos );
+
+ for ( const auto& hInfo : config ) {
+ const auto varTitle{ hInfo.at( "title" ).get<std::string>() };
+
+ const auto varName{ hInfo.at( "variable" ).get<std::string>() };
+ // Integer values that define what particles need to be used
+ // for invariant mass combinations or helicity angles etc
+ const auto d1{ hInfo.at( "d1" ).get<int>() };
+ const auto d2{ hInfo.at( "d2" ).get<int>() };
+
+ const auto nBins{ hInfo.at( "nbins" ).get<int>() };
+ const auto xmin{ hInfo.at( "xmin" ).get<double>() };
+ const auto xmax{ hInfo.at( "xmax" ).get<double>() };
+
+ std::string histName( varName.c_str() );
+ if ( d1 != 0 ) {
+ histName += "_";
+ histName += std::to_string( d1 );
+ }
+ if ( d2 != 0 ) {
+ histName += "_";
+ histName += std::to_string( d2 );
+ }
+
+ if ( !hInfo.contains( "variableY" ) ) {
+ auto hist = std::make_unique<TH1D>( histName.c_str(),
+ varTitle.c_str(), nBins, xmin,
+ xmax );
+ m_1DhistVect.emplace_back(
+ std::make_pair( HistInfo{ varName, d1, d2 }, std::move( hist ) ) );
+ } else {
+ const auto varNameY{ hInfo.at( "variableY" ).get<std::string>() };
+ const auto d1Y{ hInfo.at( "d1Y" ).get<int>() };
+ const auto d2Y{ hInfo.at( "d2Y" ).get<int>() };
+
+ const auto nBinsY{ hInfo.at( "nbinsY" ).get<int>() };
+ const auto ymin{ hInfo.at( "ymin" ).get<double>() };
+ const auto ymax{ hInfo.at( "ymax" ).get<double>() };
+
+ histName += "_";
+ histName += varNameY;
+ if ( d1Y != 0 ) {
+ histName += "_";
+ histName += std::to_string( d1Y );
+ }
+ if ( d2Y != 0 ) {
+ histName += "_";
+ histName += std::to_string( d2Y );
+ }
+ auto hist = std::make_unique<TH2D>( histName.c_str(),
+ varTitle.c_str(), nBins, xmin,
+ xmax, nBinsY, ymin, ymax );
+ m_2DhistVect.emplace_back(
+ std::make_pair( HistInfo{ varName, d1, d2, varNameY, d1Y, d2Y },
+ std::move( hist ) ) );
+ }
+ }
+
+ // Add a mixed/unmixed histogram
+ // Useful for the case where the parent is a neutral K, D or B
+ const std::array<std::string, 14> parentsThatMix{
+ "B_s0", "anti-B_s0", "B_s0L", "B_s0H", "B0", "anti-B0", "B0L",
+ "B0H", "D0", "anti-D0", "K0", "anti-K0", "K_S0", "K_L0" };
+ if ( std::find( parentsThatMix.begin(), parentsThatMix.end(), parentName ) !=
+ parentsThatMix.end() ) {
+ const std::string varTitle{ parentName + " mixed" };
+ m_mixedHist = std::make_unique<TH1D>( "mixed", varTitle.c_str(), 2, 0.0,
+ 2.0 );
+ // TODO maybe set bin labels?
+ }
+}
+
+TestHistos::TestHistos( const TestHistos& rhs )
+{
+ m_1DhistVect.reserve( rhs.m_1DhistVect.size() );
+ for ( auto& [info, hist] : rhs.m_1DhistVect ) {
+ auto newHist = std::unique_ptr<TH1>{ static_cast<TH1*>( hist->Clone() ) };
+ m_1DhistVect.push_back( std::make_pair( info, std::move( newHist ) ) );
+ }
+
+ m_2DhistVect.reserve( rhs.m_2DhistVect.size() );
+ for ( auto& [info, hist] : rhs.m_2DhistVect ) {
+ auto newHist = std::unique_ptr<TH2>{ static_cast<TH2*>( hist->Clone() ) };
+ m_2DhistVect.push_back( std::make_pair( info, std::move( newHist ) ) );
+ }
+
+ if ( rhs.m_mixedHist ) {
+ m_mixedHist.reset( static_cast<TH1*>( rhs.m_mixedHist->Clone() ) );
+ }
+}
+
+TestHistos::TestHistos( TestHistos&& rhs ) noexcept
+{
+ this->swap( rhs );
+}
+
+TestHistos& TestHistos::operator=( const TestHistos& rhs )
+{
+ TestHistos tmp{ rhs };
+ this->swap( tmp );
+ return *this;
+}
+
+TestHistos& TestHistos::operator=( TestHistos&& rhs ) noexcept
{
+ this->swap( rhs );
+ return *this;
}
-bool TestDecayModel::checkMandatoryFields()
+void TestHistos::swap( TestHistos& rhs ) noexcept
+{
+ m_1DhistVect.swap( rhs.m_1DhistVect );
+ m_2DhistVect.swap( rhs.m_2DhistVect );
+ std::swap( m_mixedHist, rhs.m_mixedHist );
+}
+
+void TestHistos::add( const TestHistos& rhs )
+{
+ // handle the special case where we have been default constructed and the rhs has not
+ if ( m_1DhistVect.empty() && m_2DhistVect.empty() && !m_mixedHist ) {
+ ( *this ) = rhs;
+ return;
+ }
+
+ // TODO - should really check that the sets of histograms are the same between left and right
+
+ const std::size_t n1DHists{ rhs.m_1DhistVect.size() };
+ for ( std::size_t i{ 0 }; i < n1DHists; ++i ) {
+ m_1DhistVect[i].second->Add( rhs.m_1DhistVect[i].second.get() );
+ }
+
+ const std::size_t n2DHists{ rhs.m_2DhistVect.size() };
+ for ( std::size_t i{ 0 }; i < n2DHists; ++i ) {
+ m_2DhistVect[i].second->Add( rhs.m_2DhistVect[i].second.get() );
+ }
+
+ if ( m_mixedHist && rhs.m_mixedHist ) {
+ m_mixedHist->Add( rhs.m_mixedHist.get() );
+ }
+}
+
+void TestHistos::normalise()
+{
+ for ( auto& [_, hist] : m_1DhistVect ) {
+ const double area{ hist->Integral() };
+ if ( area > 0.0 ) {
+ hist->Scale( 1.0 / area );
+ }
+ }
+ for ( auto& [_, hist] : m_2DhistVect ) {
+ const double area{ hist->Integral() };
+ if ( area > 0.0 ) {
+ hist->Scale( 1.0 / area );
+ }
+ }
+ if ( m_mixedHist ) {
+ const double area{ m_mixedHist->Integral() };
+ if ( area > 0.0 ) {
+ m_mixedHist->Scale( 1.0 / area );
+ }
+ }
+}
+
+void TestHistos::save( TFile* outputFile )
+{
+ outputFile->cd();
+
+ for ( auto& [info, hist] : m_1DhistVect ) {
+ hist->SetDirectory( outputFile );
+ hist->Write();
+ hist.release();
+ }
+
+ for ( auto& [info, hist] : m_2DhistVect ) {
+ hist->SetDirectory( outputFile );
+ hist->Write();
+ hist.release();
+ }
+
+ if ( m_mixedHist ) {
+ m_mixedHist->SetDirectory( outputFile );
+ m_mixedHist->Write();
+ m_mixedHist.release();
+ }
+}
+
+TestDecayModel::TestDecayModel( const json& config ) :
+ m_config{ checkMandatoryFields( config )
+ ? readConfig( config )
+ : throw std::runtime_error{
+ "ERROR : json does not contain all required fields" } }
+{
+}
+
+bool TestDecayModel::checkMandatoryFields( const json& config )
{
const std::array<std::string, 7> mandatoryFields{ "parent", "daughters",
"models", "parameters",
@@ -64,14 +269,14 @@
bool allMandatoryFields{ true };
for ( const auto& field : mandatoryFields ) {
- if ( !m_config.contains( field ) ) {
+ if ( !config.contains( field ) ) {
std::cerr << "ERROR : json does not contain required field: " << field
<< std::endl;
allMandatoryFields = false;
continue;
}
if ( field == "histograms" ) {
- const json& jHistos{ m_config.at( "histograms" ) };
+ const json& jHistos{ config.at( "histograms" ) };
for ( const auto& hInfo : jHistos ) {
for ( const auto& hField : mandatoryHistoFields ) {
if ( !hInfo.contains( hField ) ) {
@@ -98,196 +303,320 @@
return allMandatoryFields;
}
-bool TestDecayModel::run()
+TestConfig TestDecayModel::readConfig( const json& config )
{
- // Check that we have, and then get all the mandatory fields first
- if ( !checkMandatoryFields() ) {
- std::cerr << "ERROR : json does not contain all mandatory fields - dumping config for debugging:\n";
- std::cerr << m_config << std::endl;
- return false;
- }
+ TestConfig cfg;
- const auto parentName{ m_config.at( "parent" ).get<std::string>() };
- const auto daughterNames{
- m_config.at( "daughters" ).get<std::vector<std::string>>() };
- const auto modelNames{
- m_config.at( "models" ).get<std::vector<std::string>>() };
- const auto modelParameters{
- m_config.at( "parameters" ).get<std::vector<std::vector<std::string>>>() };
- const auto nEvents{ m_config.at( "events" ).get<int>() };
+ // Get all the mandatory fields first
+ cfg.parentName = config.at( "parent" ).get<std::string>();
+ cfg.daughterNames = config.at( "daughters" ).get<std::vector<std::string>>();
+ cfg.modelNames = config.at( "models" ).get<std::vector<std::string>>();
+ cfg.modelParameters =
+ config.at( "parameters" ).get<std::vector<std::vector<std::string>>>();
+ cfg.nEvents = config.at( "events" ).get<std::size_t>();
+
+ // Histogram information
+ cfg.testHistograms = TestHistos{ cfg.parentName, config.at( "histograms" ) };
// Then check for optional fields, setting default values if not present
- const auto grandDaughterNames{
- ( m_config.contains( "grand_daughters" ) &&
- m_config.at( "grand_daughters" ).is_array() )
- ? m_config.at( "grand_daughters" )
- .get<std::vector<std::vector<std::string>>>()
- : std::vector<std::vector<std::string>>{} };
+ if ( config.contains( "grand_daughters" ) &&
+ config.at( "grand_daughters" ).is_array() ) {
+ cfg.grandDaughterNames = config.at( "grand_daughters" )
+ .get<std::vector<std::vector<std::string>>>();
+ }
- const auto extraCommands{
- ( m_config.contains( "extras" ) && m_config.at( "extras" ).is_array() )
- ? m_config.at( "extras" ).get<std::vector<std::string>>()
- : std::vector<std::string>{} };
+ if ( config.contains( "extras" ) && config.at( "extras" ).is_array() ) {
+ cfg.extraCommands = config.at( "extras" ).get<std::vector<std::string>>();
+ }
+
+ // Set the number of threads to use, 1 by default
+ cfg.nThreads = 1;
+ if ( config.contains( "threads" ) ) {
+ cfg.nThreads = config.at( "threads" ).get<std::size_t>();
+ }
// Set the FSR generator. Use PHOTOS by default.
- const auto fsrGenerator{
- ( m_config.contains( "fsr_generator" ) )
- ? m_config.at( "fsr_generator" ).get<std::string>()
- : "PHOTOS" };
+ cfg.fsrGenerator = FSRGenerator::PHOTOS;
+ if ( config.contains( "fsr_generator" ) ) {
+ cfg.fsrGenerator = config.at( "fsr_generator" ).get<FSRGenerator>();
+ }
- // Set reference and output file names, insert fsrGenerator name if FSR simulation is not deactivated
- const bool noFSR = std::find( extraCommands.begin(), extraCommands.end(),
- "noFSR" ) != extraCommands.end();
+ // Set the type of threading to use, stdlib by default
+ cfg.threadModel = ThreadModel::StdLib;
+ if ( config.contains( "thread_model" ) ) {
+ cfg.threadModel = config.at( "thread_model" ).get<ThreadModel>();
+ }
- const std::string fileNameEnd = noFSR ? ".root"
- : "_" + fsrGenerator + ".root";
+ // Set the RNG seed base (defaults to zero), to which the event number is added
+ cfg.rngSeed = 0;
+ if ( config.contains( "rng_seed" ) ) {
+ cfg.rngSeed = config.at( "rng_seed" ).get<std::size_t>();
+ }
- const auto outFileStrSize =
- m_config.at( "outfile" ).get<std::string>().size() - 5;
+ // Set reference and output file names
+ // Insert fsrGenerator name if FSR simulation is not deactivated
+ const bool noFSR = std::find( cfg.extraCommands.begin(),
+ cfg.extraCommands.end(),
+ "noFSR" ) != cfg.extraCommands.end();
- const auto outFileName =
- m_config.at( "outfile" ).get<std::string>().substr( 0, outFileStrSize ) +
- fileNameEnd;
- const auto refFileName = "Ref/" + outFileName;
+ const std::string fileNameEnd =
+ noFSR ? ".root" : "_" + to_string( cfg.fsrGenerator ) + ".root";
- const auto debugFlag{ ( m_config.contains( "debug_flag" ) &&
- m_config.at( "debug_flag" ).is_boolean() )
- ? m_config.at( "debug_flag" ).get<bool>()
- : false };
+ const auto outFileStrSize = config.at( "outfile" ).get<std::string>().size() -
+ 5;
- std::vector<bool> doConjDecay;
- if ( m_config.contains( "do_conjugate_decay" ) &&
- m_config.at( "do_conjugate_decay" ).is_array() ) {
- doConjDecay = m_config.at( "do_conjugate_decay" ).get<std::vector<bool>>();
+ cfg.outFileName =
+ config.at( "outfile" ).get<std::string>().substr( 0, outFileStrSize ) +
+ fileNameEnd;
+ cfg.refFileName = "Ref/" + cfg.outFileName;
+ cfg.decFileName = cfg.outFileName.substr( 0, cfg.outFileName.size() - 5 ) +
+ ".dec";
+
+ cfg.debugFlag = ( config.contains( "debug_flag" ) &&
+ config.at( "debug_flag" ).is_boolean() )
+ ? config.at( "debug_flag" ).get<bool>()
+ : false;
+
+ if ( config.contains( "do_conjugate_decay" ) &&
+ config.at( "do_conjugate_decay" ).is_array() ) {
+ cfg.doConjDecay =
+ config.at( "do_conjugate_decay" ).get<std::vector<bool>>();
}
- if ( doConjDecay.size() != modelNames.size() ) {
- doConjDecay.resize( modelNames.size(), false );
+ if ( cfg.doConjDecay.size() != cfg.modelNames.size() ) {
+ cfg.doConjDecay.resize( cfg.modelNames.size(), false );
}
- // Initialise the EvtGen object and hence the EvtPDL tables
- // The EvtGen object is used by generateEvents, while the
- // latter are also used within createDecFile
+ return cfg;
+}
- // Define the random number generator
- auto randomEngine{ std::make_unique<EvtMTRandomEngine>() };
+void TestDecayModel::run()
+{
+ TestHistos theHistos;
- EvtAbsRadCorr* radCorrEngine{ nullptr };
- std::list<EvtDecayBase*> extraModels;
+ const auto start{ std::chrono::steady_clock::now() };
-#ifdef EVTGEN_EXTERNAL
- bool convertPythiaCodes( false );
- bool useEvtGenRandom( true );
- EvtExternalGenList genList( convertPythiaCodes, "", "gamma", useEvtGenRandom );
- if ( fsrGenerator == "PHOTOS" ) {
- radCorrEngine = genList.getPhotosModel();
- } else if ( fsrGenerator == "SherpaPhotons1" ) {
- radCorrEngine = genList.getSherpaPhotonsModel( 1e-7, 1, 0 );
- } else if ( fsrGenerator == "SherpaPhotons20" ) {
- radCorrEngine = genList.getSherpaPhotonsModel( 1e-7, 2, 0 );
- } else if ( fsrGenerator == "SherpaPhotons21" ) {
- radCorrEngine = genList.getSherpaPhotonsModel( 1e-7, 2, 1 );
+ if ( m_config.nThreads > 1 ) {
+ // Run multi-threaded using the specified thread model
+ switch ( m_config.threadModel ) {
+ case ThreadModel::StdLib:
+ theHistos = runStdThreads();
+ break;
+ case ThreadModel::TBB:
+ theHistos = runTBBThreads();
+ break;
+ }
} else {
- std::cerr << "ERROR: The option fsr_generator = '" << fsrGenerator
- << "' is not supported. " << std::endl;
- return false;
+ // Run in the main thread
+ theHistos = runDecayBody( 0, m_config.nEvents );
}
- extraModels = genList.getListOfModels();
-#endif
- EvtGen theGen( "../DECAY.DEC", "../evt.pdl", randomEngine.get(),
- radCorrEngine, &extraModels );
+ const auto end{ std::chrono::steady_clock::now() };
+ const std::chrono::duration<double, std::milli> elapsed_ms{ ( end - start ) };
+ const std::chrono::duration<double, std::milli> elapsed_ms_per_event{
+ elapsed_ms / m_config.nEvents };
- /*! Creates a decay file based on json file input. */
- const std::string decFileName{
- outFileName.substr( 0, outFileName.size() - 5 ) };
- const std::string decFile{ createDecFile( parentName, daughterNames,
- grandDaughterNames, modelNames,
- modelParameters, doConjDecay,
- extraCommands, decFileName ) };
+ std::cout << "Took " << elapsed_ms.count() << " ms to generate "
+ << m_config.nEvents << " events using " << m_config.nThreads
+ << " " << to_string( m_config.threadModel ) << " threads ("
+ << elapsed_ms_per_event.count() << " ms per event)" << std::endl;
- /*! Define the root output file and histograms to be saved. */
- std::unique_ptr<TFile> outFile{
- TFile::Open( outFileName.c_str(), "recreate" ) };
- defineHistos( outFile.get() );
+ // Normalise histograms.
+ theHistos.normalise();
- /*! Generate events and fill histograms. */
- generateEvents( theGen, decFile, parentName, doConjDecay[0], nEvents,
- debugFlag );
+ // Compare with reference histograms
+ compareHistos( theHistos, m_config.refFileName );
- // Normalize histograms.
- for ( auto& [_, hist] : m_1DhistVect ) {
- const double area{ hist->Integral() };
- if ( area > 0.0 ) {
- hist->Scale( 1.0 / area );
+ // Create the root output file and write the histograms to it
+ // Only save the mixed/unmixed histogram for neutral K, D, B
+ std::unique_ptr<TFile> outFile{
+ TFile::Open( m_config.outFileName.c_str(), "recreate" ) };
+ theHistos.save( outFile.get() );
+ outFile->Close();
+ std::cout << "Created output file: " << m_config.outFileName.c_str()
+ << std::endl;
+}
+
+TestHistos TestDecayModel::runStdThreads() const
+{
+ // Determine the number of threads and the number of events per thread
+ const std::size_t nThreads{ std::min( m_config.nThreads, m_config.nEvents ) };
+ const std::size_t nEventsPerThread{ ( m_config.nEvents % nThreads )
+ ? m_config.nEvents / nThreads + 1
+ : m_config.nEvents / nThreads };
+
+ // Create the store for the results from each thread
+ std::vector<std::future<TestHistos>> allHistos;
+ allHistos.reserve( nThreads );
+
+ // Launch the threads
+ std::size_t firstEvent{ 0 };
+ std::size_t nEvents{ nEventsPerThread };
+
+ for ( std::size_t iThread{ 0 }; iThread < nThreads; ++iThread ) {
+ // The last thread may need to generate slightly fewer events to get the required total
+ if ( ( firstEvent + nEvents ) >= m_config.nEvents ) {
+ nEvents = m_config.nEvents - firstEvent;
}
+
+ std::cout << "Thread " << iThread << " will generate " << nEvents
+ << " events" << std::endl;
+
+ allHistos.emplace_back(
+ std::async( std::launch::async, [this, firstEvent, nEvents]() {
+ return runDecayBody( firstEvent, nEvents );
+ } ) );
+
+ firstEvent += nEvents;
}
- for ( auto& [_, hist] : m_2DhistVect ) {
- const double area{ hist->Integral() };
- if ( area > 0.0 ) {
- hist->Scale( 1.0 / area );
+
+ // Now wait for each thread to finish
+ bool complete{ false };
+ do {
+ // Set the flag to completed and set it back if we find incomplete threads
+ complete = true;
+ for ( auto& future : allHistos ) {
+ auto status = future.wait_for( std::chrono::seconds( 10 ) );
+ if ( status != std::future_status::ready ) {
+ complete = false;
+ }
}
+ } while ( !complete );
+
+ // Accumulate the histograms from all threads
+ TestHistos theHistos{ allHistos[0].get() };
+ for ( std::size_t iThread{ 1 }; iThread < nThreads; ++iThread ) {
+ theHistos.add( allHistos[iThread].get() );
}
- /*! Compare with reference histograms. */
- compareHistos( refFileName );
+ return theHistos;
+}
- // Write output.
- outFile->cd();
- for ( auto& [_, hist] : m_1DhistVect ) {
- hist->Write();
- }
- for ( auto& [_, hist] : m_2DhistVect ) {
- hist->Write();
+TestHistos TestDecayModel::runTBBThreads() const
+{
+ tbb::global_control gc{ tbb::global_control::parameter::max_allowed_parallelism,
+ m_config.nThreads };
+
+ TestHistos init;
+
+ return tbb::parallel_reduce(
+ tbb::blocked_range<std::size_t>( 0, m_config.nEvents ), init,
+ [this]( const tbb::blocked_range<std::size_t>& range,
+ const TestHistos& init ) -> TestHistos {
+ std::cout << "Thread "
+ << tbb::this_task_arena::current_thread_index()
+ << " will generate " << range.size()
+ << " events: " << range.begin() << " - " << range.end()
+ << std::endl;
+ TestHistos tmp{ init };
+ tmp.add( runDecayBody( range.begin(), range.size() ) );
+ return tmp;
+ },
+ []( const TestHistos& lhs, const TestHistos& rhs ) -> TestHistos {
+ TestHistos tmp{ lhs };
+ tmp.add( rhs );
+ return tmp;
+ } );
+}
+
+TestHistos TestDecayModel::runDecayBody( const std::size_t firstEvent,
+ const std::size_t nEvents ) const
+{
+ // Initialise the EvtGen object and hence the EvtPDL tables
+ // The EvtGen object is used by generateEvents, while the
+ // latter are also used within createDecFile
+
+ // Define the random number generator
+ static thread_local auto randomEngine{ std::make_unique<EvtMTRandomEngine>() };
+
+ // TODO - need to streamline the extra models stuff
+ static thread_local EvtAbsRadCorr* radCorrEngine{ nullptr };
+ std::list<EvtDecayBase*> extraModels;
+
+ static thread_local bool initialised{ false };
+
+#ifdef EVTGEN_EXTERNAL
+ if ( !initialised ) {
+ bool convertPythiaCodes( false );
+ bool useEvtGenRandom( true );
+ bool seedTauolaFortran( true );
+ EvtExternalGenList genList( convertPythiaCodes, "", "gamma",
+ useEvtGenRandom, seedTauolaFortran );
+ switch ( m_config.fsrGenerator ) {
+ case FSRGenerator::PHOTOS:
+ radCorrEngine = genList.getPhotosModel();
+ break;
+ case FSRGenerator::SherpaPhotons1:
+ radCorrEngine = genList.getSherpaPhotonsModel( 1e-7, 1, 0 );
+ break;
+ case FSRGenerator::SherpaPhotons20:
+ radCorrEngine = genList.getSherpaPhotonsModel( 1e-7, 2, 0 );
+ break;
+ case FSRGenerator::SherpaPhotons21:
+ radCorrEngine = genList.getSherpaPhotonsModel( 1e-7, 2, 1 );
+ break;
+ }
+ extraModels = genList.getListOfModels();
}
- if ( m_mixedHist ) {
- m_mixedHist->Write();
+#endif
+
+ static thread_local EvtGen theGen{ "../DECAY.DEC", "../evt.pdl",
+ randomEngine.get(), radCorrEngine,
+ &extraModels };
+
+ // Creates a decay file based on json file input
+ // We don't want this to be called by every thread!
+ std::call_once( m_createDecFile_threadlock, [this]() { createDecFile(); } );
+
+ // Read the decay file
+ if ( !initialised ) {
+ theGen.readUDecay( m_config.decFileName.c_str() );
+ initialised = true;
}
- outFile->Close();
- std::cout << "Created output file: " << outFileName.c_str() << std::endl;
- return true;
+ // Define the histograms to be saved
+ TestHistos theHistos{ m_config.testHistograms };
+
+ // Generate events and fill histograms
+ generateEvents( theGen, theHistos, firstEvent, nEvents );
+
+ return theHistos;
}
-std::string TestDecayModel::createDecFile(
- const std::string& parent, const std::vector<std::string>& daughterNames,
- const std::vector<std::vector<std::string>>& grandDaughterNames,
- const std::vector<std::string>& modelNames,
- const std::vector<std::vector<std::string>>& parameters,
- const std::vector<bool>& doConjDecay,
- const std::vector<std::string>& extras, const std::string decFileName ) const
+void TestDecayModel::createDecFile() const
{
// Create (or overwrite) the decay file
- std::string decName( decFileName + ".dec" );
- std::ofstream decFile;
- decFile.open( decName.c_str() );
+ std::ofstream decFile{ m_config.decFileName };
// Create daughter aliases if needed
std::vector<std::string> aliasPrefix;
- for ( long unsigned int daughter_index{ 0 };
- daughter_index < daughterNames.size(); daughter_index++ ) {
- if ( !grandDaughterNames.empty() &&
- !grandDaughterNames[daughter_index].empty() ) {
- decFile << "Alias My" << daughterNames[daughter_index] << " "
- << daughterNames[daughter_index] << std::endl;
- if ( doConjDecay[daughter_index + 1] ) {
+ for ( std::size_t daughter_index{ 0 };
+ daughter_index < m_config.daughterNames.size(); daughter_index++ ) {
+ if ( !m_config.grandDaughterNames.empty() &&
+ !m_config.grandDaughterNames[daughter_index].empty() ) {
+ decFile << "Alias My" << m_config.daughterNames[daughter_index] << " "
+ << m_config.daughterNames[daughter_index] << std::endl;
+ if ( m_config.doConjDecay[daughter_index + 1] ) {
const EvtId daugID{
- EvtPDL::getId( daughterNames[daughter_index] ) };
+ EvtPDL::getId( m_config.daughterNames[daughter_index] ) };
const EvtId daugConjID{ EvtPDL::chargeConj( daugID ) };
const std::string conjName{ daugConjID.getName() };
std::string conjName_Alias{ daugConjID.getName() };
- if ( std::find( std::begin( daughterNames ),
- std::end( daughterNames ), daugConjID.getName() ) !=
- std::end( daughterNames ) ) {
+ if ( std::find( std::begin( m_config.daughterNames ),
+ std::end( m_config.daughterNames ),
+ daugConjID.getName() ) !=
+ std::end( m_config.daughterNames ) ) {
conjName_Alias = conjName_Alias + "_" + daughter_index;
}
decFile << "Alias My" << conjName_Alias << " " << conjName
<< std::endl;
- decFile << "ChargeConj My" << daughterNames[daughter_index]
- << " My" << conjName_Alias << std::endl;
- } else if ( doConjDecay[0] ) {
- decFile << "ChargeConj My" << daughterNames[daughter_index]
- << " My" << daughterNames[daughter_index] << std::endl;
+ decFile << "ChargeConj My"
+ << m_config.daughterNames[daughter_index] << " My"
+ << conjName_Alias << std::endl;
+ } else if ( m_config.doConjDecay[0] ) {
+ decFile << "ChargeConj My"
+ << m_config.daughterNames[daughter_index] << " My"
+ << m_config.daughterNames[daughter_index] << std::endl;
}
aliasPrefix.push_back( "My" );
} else {
@@ -295,61 +624,64 @@
}
}
- for ( const auto& iExtra : extras ) {
+ for ( const auto& iExtra : m_config.extraCommands ) {
decFile << iExtra << std::endl;
}
// Parent decay
- decFile << "Decay " << parent << std::endl;
+ decFile << "Decay " << m_config.parentName << std::endl;
decFile << "1.0";
- for ( long unsigned int daughter_index{ 0 };
- daughter_index < daughterNames.size(); daughter_index++ ) {
+ for ( std::size_t daughter_index{ 0 };
+ daughter_index < m_config.daughterNames.size(); daughter_index++ ) {
decFile << " " << aliasPrefix[daughter_index]
- << daughterNames[daughter_index];
+ << m_config.daughterNames[daughter_index];
}
- decFile << " " << modelNames[0];
+ decFile << " " << m_config.modelNames[0];
- for ( const auto& par : parameters[0] ) {
+ for ( const auto& par : m_config.modelParameters[0] ) {
decFile << " " << par;
}
decFile << ";" << std::endl;
decFile << "Enddecay" << std::endl;
- if ( doConjDecay[0] ) {
- EvtId parID{ EvtPDL::getId( parent ) };
+ if ( m_config.doConjDecay[0] ) {
+ EvtId parID{ EvtPDL::getId( m_config.parentName ) };
EvtId parConjID{ EvtPDL::chargeConj( parID ) };
decFile << "CDecay " << parConjID.getName() << std::endl;
}
// Daughter decays into granddaughters
- for ( long unsigned int daughter_index{ 0 };
- daughter_index < grandDaughterNames.size(); daughter_index++ ) {
- if ( grandDaughterNames[daughter_index].empty() )
+ for ( std::size_t daughter_index{ 0 };
+ daughter_index < m_config.grandDaughterNames.size(); daughter_index++ ) {
+ if ( m_config.grandDaughterNames[daughter_index].empty() )
continue;
decFile << "Decay " << aliasPrefix[daughter_index]
- << daughterNames[daughter_index] << std::endl;
+ << m_config.daughterNames[daughter_index] << std::endl;
decFile << "1.0";
- for ( long unsigned int grandDaughter_index{ 0 };
- grandDaughter_index < grandDaughterNames[daughter_index].size();
+ for ( std::size_t grandDaughter_index{ 0 };
+ grandDaughter_index <
+ m_config.grandDaughterNames[daughter_index].size();
grandDaughter_index++ ) {
decFile << " "
- << grandDaughterNames[daughter_index][grandDaughter_index];
+ << m_config.grandDaughterNames[daughter_index][grandDaughter_index];
}
- decFile << " " << modelNames[daughter_index + 1];
- for ( const auto& par : parameters[daughter_index + 1] ) {
+ decFile << " " << m_config.modelNames[daughter_index + 1];
+ for ( const auto& par : m_config.modelParameters[daughter_index + 1] ) {
decFile << " " << par;
}
decFile << ";" << std::endl;
decFile << "Enddecay" << std::endl;
- if ( doConjDecay[daughter_index + 1] ) {
- EvtId daugID{ EvtPDL::getId( daughterNames[daughter_index] ) };
+ if ( m_config.doConjDecay[daughter_index + 1] ) {
+ EvtId daugID{
+ EvtPDL::getId( m_config.daughterNames[daughter_index] ) };
EvtId daugConjID{ EvtPDL::chargeConj( daugID ) };
std::string conjName_Alias{ daugConjID.getName() };
- if ( std::find( std::begin( daughterNames ),
- std::end( daughterNames ), daugConjID.getName() ) !=
- std::end( daughterNames ) ) {
+ if ( std::find( std::begin( m_config.daughterNames ),
+ std::end( m_config.daughterNames ),
+ daugConjID.getName() ) !=
+ std::end( m_config.daughterNames ) ) {
conjName_Alias = conjName_Alias + "_" + daughter_index;
}
decFile << "CDecay " << aliasPrefix[daughter_index]
@@ -360,104 +692,24 @@
decFile << "End" << std::endl;
decFile.close();
-
- return decName;
}
-void TestDecayModel::defineHistos( TFile* outFile )
+void TestDecayModel::generateEvents( EvtGen& theGen, TestHistos& theHistos,
+ const std::size_t firstEvent,
+ const std::size_t nEvents ) const
{
- // Histogram information
- const json& jHistos{ m_config.at( "histograms" ) };
- const size_t nHistos{ jHistos.size() };
-
- m_1DhistVect.reserve( nHistos );
- m_2DhistVect.reserve( nHistos );
-
- for ( const auto& hInfo : jHistos ) {
- const auto varTitle{ hInfo.at( "title" ).get<std::string>() };
-
- const auto varName{ hInfo.at( "variable" ).get<std::string>() };
- // Integer values that define what particles need to be used
- // for invariant mass combinations or helicity angles etc
- const auto d1{ hInfo.at( "d1" ).get<int>() };
- const auto d2{ hInfo.at( "d2" ).get<int>() };
-
- const auto nBins{ hInfo.at( "nbins" ).get<int>() };
- const auto xmin{ hInfo.at( "xmin" ).get<double>() };
- const auto xmax{ hInfo.at( "xmax" ).get<double>() };
-
- std::string histName( varName.c_str() );
- if ( d1 != 0 ) {
- histName += "_";
- histName += std::to_string( d1 );
- }
- if ( d2 != 0 ) {
- histName += "_";
- histName += std::to_string( d2 );
- }
-
- if ( !hInfo.contains( "variableY" ) ) {
- TH1* hist{ new TH1D{ histName.c_str(), varTitle.c_str(), nBins,
- xmin, xmax } };
- hist->SetDirectory( outFile );
- m_1DhistVect.emplace_back(
- std::make_pair( TestInfo( varName, d1, d2 ), hist ) );
- continue;
- } else {
- const auto varNameY{ hInfo.at( "variableY" ).get<std::string>() };
- const auto d1Y{ hInfo.at( "d1Y" ).get<int>() };
- const auto d2Y{ hInfo.at( "d2Y" ).get<int>() };
-
- const auto nBinsY{ hInfo.at( "nbinsY" ).get<int>() };
- const auto ymin{ hInfo.at( "ymin" ).get<double>() };
- const auto ymax{ hInfo.at( "ymax" ).get<double>() };
-
- histName += "_";
- histName += varNameY;
- if ( d1Y != 0 ) {
- histName += "_";
- histName += std::to_string( d1Y );
- }
- if ( d2Y != 0 ) {
- histName += "_";
- histName += std::to_string( d2Y );
- }
- TH2* hist{ new TH2D{ histName.c_str(), varTitle.c_str(), nBins,
- xmin, xmax, nBinsY, ymin, ymax } };
- hist->SetDirectory( outFile );
- m_2DhistVect.emplace_back( std::make_pair(
- TestInfo( varName, d1, d2, varNameY, d1Y, d2Y ), hist ) );
- }
- }
-
- // For the case where the parent is either a neutral B or D add a mixed/unmixed histogram
- const auto parentName{ m_config.at( "parent" ).get<std::string>() };
- const int parentID{ abs( EvtPDL::getStdHep( EvtPDL::getId( parentName ) ) ) };
- if ( parentID == 511 || parentID == 531 || parentID == 421 ) {
- const std::string varTitle{ parentName + " mixed" };
- m_mixedHist = new TH1D{ "mixed", varTitle.c_str(), 2, 0.0, 2.0 };
- // TODO maybe set bin labels?
- m_mixedHist->SetDirectory( outFile );
- }
-}
-
-void TestDecayModel::generateEvents( EvtGen& theGen, const std::string& decFile,
- const std::string& parentName,
- const bool doConjDecay, const int nEvents,
- const bool debug_flag )
-{
- // Read the decay file
- theGen.readUDecay( decFile.c_str() );
-
// Generate the decays
- EvtId parId{ EvtPDL::getId( parentName.c_str() ) };
- EvtId conjId{ doConjDecay ? EvtPDL::chargeConj( parId ) : parId };
- for ( int i{ 0 }; i < nEvents; i++ ) {
+ const EvtId parId{ EvtPDL::getId( m_config.parentName.c_str() ) };
+ const EvtId conjId{ m_config.doConjDecay[0] ? EvtPDL::chargeConj( parId )
+ : parId };
+
+ for ( std::size_t i{ firstEvent }; i < ( firstEvent + nEvents ); i++ ) {
if ( i % 1000 == 0 ) {
- std::cout << "Event " << nEvents - i << std::endl;
+ std::cout << "Event " << firstEvent + nEvents - i << std::endl;
}
- EvtRandom::setSeed( i );
+ // seed the RNG based on the event number
+ EvtRandom::setSeed( m_config.rngSeed + i );
// Initial 4-momentum and particle
EvtVector4R pInit( EvtPDL::getMass( parId ), 0.0, 0.0, 0.0 );
@@ -472,23 +724,24 @@
// Check for mixing (and fill histogram)
EvtParticle* prodParent{ nullptr };
- if ( m_mixedHist ) {
+ TH1* mixedHist{ theHistos.getMixedHist() };
+ if ( mixedHist ) {
if ( parent->getNDaug() == 1 ) {
prodParent = parent;
parent = prodParent->getDaug( 0 );
- m_mixedHist->Fill( 1 );
+ mixedHist->Fill( 1 );
} else {
- m_mixedHist->Fill( 0 );
+ mixedHist->Fill( 0 );
}
}
// To debug
- if ( debug_flag ) {
+ if ( m_config.debugFlag ) {
std::cout << "Parent PDG code: " << parent->getPDGId()
<< " has daughters " << parent->getNDaug() << std::endl;
- for ( size_t iDaughter{ 0 }; iDaughter < parent->getNDaug();
+ for ( std::size_t iDaughter{ 0 }; iDaughter < parent->getNDaug();
iDaughter++ ) {
std::cout << "Parent PDG code of daughter " << iDaughter
<< " : " << parent->getDaug( iDaughter )->getPDGId()
@@ -496,7 +749,7 @@
<< parent->getDaug( iDaughter )->getNDaug()
<< std::endl;
- for ( size_t iGrandDaughter{ 0 };
+ for ( std::size_t iGrandDaughter{ 0 };
iGrandDaughter < parent->getDaug( iDaughter )->getNDaug();
iGrandDaughter++ ) {
std::cout << "Parent PDG code of grand daughter "
@@ -520,7 +773,7 @@
const std::string perDaughter = "_perDaughter";
// Store information
- for ( auto& [info, hist] : m_1DhistVect ) {
+ for ( auto& [info, hist] : theHistos.get1DHistos() ) {
if ( !hist ) {
continue;
}
@@ -576,7 +829,7 @@
// If otherwise the variable contains the substring '_FSRPhotons', then add an entry per photon
if ( leadingChargedDaughter == -1 ) {
- leadingChargedDaughter = findChargedDaugtherWithMaxE( parent );
+ leadingChargedDaughter = findChargedDaughterWithMaxE( parent );
}
reducedVarName.erase( findFSRstr, fsrStr.length() );
@@ -607,19 +860,23 @@
}
}
- for ( auto& [info, hist] : m_2DhistVect ) {
+ for ( auto& [info, hist] : theHistos.get2DHistos() ) {
if ( !hist ) {
continue;
}
- const double valueX{ getValue( parent, info.getName(), info.getd1(),
- info.getd2() ) };
- const double valueY{ getValue( parent, info.getName( 2 ),
- info.getd1( 2 ), info.getd2( 2 ) ) };
+ const double valueX{ getValue( parent,
+ info.getName( HistInfo::Axis::X ),
+ info.getd1( HistInfo::Axis::X ),
+ info.getd2( HistInfo::Axis::X ) ) };
+ const double valueY{ getValue( parent,
+ info.getName( HistInfo::Axis::Y ),
+ info.getd1( HistInfo::Axis::Y ),
+ info.getd2( HistInfo::Axis::Y ) ) };
hist->Fill( valueX, valueY );
}
- if ( debug_flag ) {
+ if ( m_config.debugFlag ) {
if ( prodParent ) {
prodParent->printTree();
} else {
@@ -636,7 +893,7 @@
}
}
-int TestDecayModel::findChargedDaugtherWithMaxE( const EvtParticle* parent ) const
+int TestDecayModel::findChargedDaughterWithMaxE( const EvtParticle* parent ) const
{
/* This function returns the index of the charged daughter with the highest energy
* following the sign convention below. */
@@ -1290,8 +1547,8 @@
double nFSRPhotons{ 0 };
- for ( size_t iDaughter{ 0 }; iDaughter < selectedParent->getNDaug();
- iDaughter++ ) {
+ for ( std::size_t iDaughter{ 0 };
+ iDaughter < selectedParent->getNDaug(); iDaughter++ ) {
const EvtParticle* iDaug = selectedParent->getDaug( iDaughter );
if ( iDaug->getAttribute( "FSR" ) == 1 )
@@ -1305,8 +1562,8 @@
double totalFSREnergy{ 0 };
- for ( size_t iDaughter{ 0 }; iDaughter < selectedParent->getNDaug();
- iDaughter++ ) {
+ for ( std::size_t iDaughter{ 0 };
+ iDaughter < selectedParent->getNDaug(); iDaughter++ ) {
const EvtParticle* iDaug = selectedParent->getDaug( iDaughter );
if ( iDaug->getAttribute( "FSR" ) == 1 )
@@ -1322,7 +1579,8 @@
return value;
}
-void TestDecayModel::compareHistos( const std::string& refFileName ) const
+void TestDecayModel::compareHistos( const TestHistos& theHistos,
+ const std::string& refFileName ) const
{
// Compare histograms with the same name, calculating the chi-squared
std::unique_ptr<TFile> refFile{ TFile::Open( refFileName.c_str(), "read" ) };
@@ -1334,7 +1592,9 @@
// TODO - should we plot the (signed) chisq histogram? and save it as pdf/png?
- for ( auto& [_, hist] : m_1DhistVect ) {
+ // TODO - add comparison of mixedHist
+
+ for ( auto& [_, hist] : theHistos.get1DHistos() ) {
const std::string histName{ hist->GetName() };
// Get equivalent reference histogram
const TH1* refHist{
@@ -1345,7 +1605,7 @@
int nDof{ 0 };
int iGood{ 0 };
const double pValue{
- refHist->Chi2TestX( hist, chiSq, nDof, iGood, "WW" ) };
+ refHist->Chi2TestX( hist.get(), chiSq, nDof, iGood, "WW" ) };
const double integral{ refHist->Integral() };
std::cout << "Histogram " << histName << " chiSq/nDof = " << chiSq
<< "/" << nDof << ", pValue = " << pValue
@@ -1357,7 +1617,7 @@
}
}
- for ( auto& [_, hist] : m_2DhistVect ) {
+ for ( auto& [_, hist] : theHistos.get2DHistos() ) {
const std::string histName{ hist->GetName() };
// Get equivalent reference histogram
const TH2* refHist{
@@ -1368,7 +1628,7 @@
int nDof{ 0 };
int iGood{ 0 };
const double pValue{
- refHist->Chi2TestX( hist, chiSq, nDof, iGood, "WW" ) };
+ refHist->Chi2TestX( hist.get(), chiSq, nDof, iGood, "WW" ) };
const double integral{ refHist->Integral() };
std::cout << "Histogram " << histName << " chiSq/nDof = " << chiSq
<< "/" << nDof << ", pValue = " << pValue
@@ -1524,33 +1784,46 @@
int main( int argc, char* argv[] )
{
- if ( argc != 2 && argc != 3 ) {
- std::cerr << "Expecting at least one argument: json input file."
- << "\nOne additional argument supported for fsrGenerator"
+ if ( argc < 2 || argc > 3 ) {
+ std::cerr << "Expecting at least one argument: test configuration json file"
+ << "\nAdditional argument supported for: general configuration json file"
<< std::endl;
return 1;
}
- /*! Load input file in json format. */
- json config;
- std::ifstream inputStr{ argv[1] };
- inputStr >> config;
- inputStr.close();
+ // Tweak ROOT behaviour
+ ROOT::EnableThreadSafety();
+ TH1::AddDirectory( kFALSE );
+
+ // Load input file in json format
+ const std::string testConfigFileName{ argv[1] };
+ const std::string generalConfigFileName{
+ ( argc > 2 ) ? argv[2] : "jsonFiles/config/default.json" };
+
+ json generalConfig;
+ json testConfig;
+
+ {
+ std::ifstream inputStr{ generalConfigFileName };
+ inputStr >> generalConfig;
+ }
- if ( argc == 3 ) {
- config["fsr_generator"] = argv[2];
+ {
+ std::ifstream inputStr{ testConfigFileName };
+ inputStr >> testConfig;
}
- bool allOK{ true };
- if ( config.is_array() ) {
- for ( const auto& cc : config ) {
+ if ( testConfig.is_array() ) {
+ for ( auto& cc : testConfig ) {
+ cc.merge_patch( generalConfig );
TestDecayModel test{ cc };
- allOK &= test.run();
+ test.run();
}
} else {
- TestDecayModel test{ config };
- allOK &= test.run();
+ testConfig.merge_patch( generalConfig );
+ TestDecayModel test{ testConfig };
+ test.run();
}
- return allOK ? 0 : 1;
+ return 0;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Sep 29, 8:26 PM (19 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6560637
Default Alt Text
D132.1759173981.diff (440 KB)

Event Timeline