Page MenuHomeHEPForge

D132.id549.diff
No OneTemporary

D132.id549.diff

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,7 +80,7 @@
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;
@@ -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
@@ -36,40 +36,43 @@
public:
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/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/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
@@ -42,7 +42,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
@@ -42,7 +42,7 @@
static void setRandomEngine( EvtRandomEngine* randomEngine );
private:
- static EvtRandomEngine* m_randomEngine;
+ static thread_local EvtRandomEngine* m_randomEngine;
};
#endif
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,6 +24,7 @@
#include "EvtGenModels/EvtAbsExternalGen.hh"
#include <map>
+#include <mutex>
// Description: A factory type method to create engines for external physics
// generators like Pythia.
@@ -60,6 +61,8 @@
private:
EvtExternalGenFactory( const EvtExternalGenFactory& ){};
+ std::mutex m_factory_modification_mutex;
+
ExtGenMap m_extGenMap;
//ExtGenCommandMap m_extGenCommandMap;
};
diff --git a/EvtGenExternal/EvtPythia.hh b/EvtGenExternal/EvtPythia.hh
--- a/EvtGenExternal/EvtPythia.hh
+++ b/EvtGenExternal/EvtPythia.hh
@@ -23,6 +23,7 @@
#include "EvtGenBase/EvtDecayIncoherent.hh"
+#include <mutex>
#include <string>
#include <vector>
@@ -39,9 +40,9 @@
EvtPythia();
~EvtPythia();
- std::string getName() override;
+ std::string getName() const override;
- EvtDecayBase* clone() override;
+ EvtDecayBase* clone() const override;
void initProbMax() override;
@@ -57,7 +58,10 @@
private:
void fixPolarisations( EvtParticle* p );
+
std::vector<std::string> m_commandList;
+
+ static std::mutex m_engine_mutex;
};
#endif
diff --git a/EvtGenExternal/EvtTauola.hh b/EvtGenExternal/EvtTauola.hh
--- a/EvtGenExternal/EvtTauola.hh
+++ b/EvtGenExternal/EvtTauola.hh
@@ -23,6 +23,8 @@
#include "EvtGenBase/EvtDecayIncoherent.hh"
+#include <mutex>
+
class EvtParticle;
class EvtAbsExternalGen;
class EvtDecayBase;
@@ -31,9 +33,9 @@
class EvtTauola : 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;
@@ -44,6 +46,7 @@
EvtAbsExternalGen* m_tauolaEngine = nullptr;
private:
+ static std::mutex m_engine_mutex;
};
#endif
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/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/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/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/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/src/EvtGen.cpp b/src/EvtGen.cpp
--- a/src/EvtGen.cpp
+++ b/src/EvtGen.cpp
@@ -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 "
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;
diff --git a/src/EvtGenBase/EvtDecayTable.cpp b/src/EvtGenBase/EvtDecayTable.cpp
--- a/src/EvtGenBase/EvtDecayTable.cpp
+++ b/src/EvtGenBase/EvtDecayTable.cpp
@@ -57,7 +57,7 @@
EvtDecayTable* EvtDecayTable::getInstance()
{
- static EvtDecayTable* theDecayTable = nullptr;
+ static thread_local EvtDecayTable* theDecayTable = nullptr;
if ( !theDecayTable ) {
theDecayTable = new EvtDecayTable();
@@ -66,7 +66,7 @@
return theDecayTable;
}
-int EvtDecayTable::getNMode( int ipar )
+int EvtDecayTable::getNMode( int ipar ) const
{
return m_decaytable[ipar].getNMode();
}
@@ -76,7 +76,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 +1476,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 +1513,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 +1529,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 +1547,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 +1612,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 +1663,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/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
@@ -339,7 +339,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;
@@ -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");
@@ -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,7 +27,7 @@
#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;
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 )
{
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/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
@@ -51,11 +51,7 @@
EvtExternalGenFactory* EvtExternalGenFactory::getInstance()
{
- static EvtExternalGenFactory* theFactory = nullptr;
-
- if ( theFactory == nullptr ) {
- theFactory = new EvtExternalGenFactory();
- }
+ static EvtExternalGenFactory* theFactory = new EvtExternalGenFactory();
return theFactory;
}
@@ -66,6 +62,8 @@
bool convertPhysCodes,
bool useEvtGenRandom )
{
+ m_factory_modification_mutex.lock();
+
GenId genId = EvtExternalGenFactory::PythiaGenId;
EvtGenReport( EVTGEN_INFO, "EvtGen" )
@@ -87,6 +85,8 @@
EvtAbsExternalGen* pythiaGenerator =
new EvtPythiaEngine( xmlDir, convertPhysCodes, useEvtGenRandom );
m_extGenMap[genId] = pythiaGenerator;
+
+ m_factory_modification_mutex.unlock();
}
#else
void EvtExternalGenFactory::definePythiaGenerator( std::string, bool, bool )
@@ -97,12 +97,16 @@
#ifdef EVTGEN_TAUOLA
void EvtExternalGenFactory::defineTauolaGenerator( bool useEvtGenRandom )
{
+ m_factory_modification_mutex.lock();
+
GenId genId = EvtExternalGenFactory::TauolaGenId;
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Defining EvtTauolaEngine." << endl;
EvtAbsExternalGen* tauolaGenerator = new EvtTauolaEngine( useEvtGenRandom );
m_extGenMap[genId] = tauolaGenerator;
+
+ m_factory_modification_mutex.unlock();
}
#else
void EvtExternalGenFactory::defineTauolaGenerator( bool )
diff --git a/src/EvtGenExternal/EvtPythia.cpp b/src/EvtGenExternal/EvtPythia.cpp
--- a/src/EvtGenExternal/EvtPythia.cpp
+++ b/src/EvtGenExternal/EvtPythia.cpp
@@ -33,6 +33,8 @@
#include <cmath>
#include <iostream>
+std::mutex EvtPythia::m_engine_mutex;
+
EvtPythia::EvtPythia()
{
// Set the Pythia engine to a null pointer at first.
@@ -46,12 +48,12 @@
m_commandList.clear();
}
-std::string EvtPythia::getName()
+std::string EvtPythia::getName() const
{
return "PYTHIA";
}
-EvtDecayBase* EvtPythia::clone()
+EvtDecayBase* EvtPythia::clone() const
{
return new EvtPythia();
}
@@ -76,6 +78,7 @@
// We check to see if the engine has been created before doing the decay.
// This should only create the full Pythia engine once, and all clones will point to the same engine.
+ m_engine_mutex.lock();
if ( !m_pythiaEngine ) {
m_pythiaEngine = EvtExternalGenFactory::getInstance()->getGenerator(
EvtExternalGenFactory::PythiaGenId );
@@ -86,6 +89,7 @@
}
this->fixPolarisations( p );
+ m_engine_mutex.unlock();
}
void EvtPythia::fixPolarisations( EvtParticle* p )
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,14 @@
#include <iostream>
#include <string>
-std::string EvtTauola::getName()
+std::mutex EvtTauola::m_engine_mutex;
+
+std::string EvtTauola::getName() const
{
return "TAUOLA";
}
-EvtDecayBase* EvtTauola::clone()
+EvtDecayBase* EvtTauola::clone() const
{
return new EvtTauola();
}
@@ -56,6 +58,8 @@
// This should only create the full Tauola engine once, and all clones will
// point to the same engine.
+ m_engine_mutex.lock();
+
if ( !m_tauolaEngine ) {
m_tauolaEngine = EvtExternalGenFactory::getInstance()->getGenerator(
EvtExternalGenFactory::TauolaGenId );
@@ -64,4 +68,6 @@
if ( m_tauolaEngine ) {
m_tauolaEngine->doDecay( p );
}
+
+ m_engine_mutex.unlock();
}
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/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;
}
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/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/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;
}

File Metadata

Mime Type
text/plain
Expires
Fri, May 2, 5:57 AM (2 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4982888
Default Alt Text
D132.id549.diff (61 KB)

Event Timeline