Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenExternal/EvtPythia.cpp
Show All 33 Lines | |||||
#include <cmath> | #include <cmath> | ||||
#include <iostream> | #include <iostream> | ||||
EvtPythia::EvtPythia() | EvtPythia::EvtPythia() | ||||
{ | { | ||||
// Set the Pythia engine to a null pointer at first. | // Set the Pythia engine to a null pointer at first. | ||||
// When we do the decay, we retrieve the pointer to the Pythia engine | // 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. | // and use that for all decays. All clones will use the same Pythia engine. | ||||
_pythiaEngine = 0; | m_pythiaEngine = 0; | ||||
} | } | ||||
EvtPythia::~EvtPythia() | EvtPythia::~EvtPythia() | ||||
{ | { | ||||
_commandList.clear(); | m_commandList.clear(); | ||||
} | } | ||||
std::string EvtPythia::getName() | std::string EvtPythia::getName() | ||||
{ | { | ||||
return "PYTHIA"; | return "PYTHIA"; | ||||
} | } | ||||
EvtDecayBase* EvtPythia::clone() | EvtDecayBase* EvtPythia::clone() | ||||
Show All 16 Lines | |||||
void EvtPythia::decay( EvtParticle* p ) | void EvtPythia::decay( EvtParticle* p ) | ||||
{ | { | ||||
// We have to initialise the Pythia engine after the decay.dec files have been read in, | // We have to initialise the Pythia engine after the decay.dec files have been read in, | ||||
// since we will be modifying Pythia data tables, and that is only possible once we have | // since we will be modifying Pythia data tables, and that is only possible once we have | ||||
// defined all Pythia-type decays we want to use. | // defined all Pythia-type decays we want to use. | ||||
// We check to see if the engine has been created before doing the decay. | // 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. | // This should only create the full Pythia engine once, and all clones will point to the same engine. | ||||
if ( !_pythiaEngine ) { | if ( !m_pythiaEngine ) { | ||||
_pythiaEngine = EvtExternalGenFactory::getInstance()->getGenerator( | m_pythiaEngine = EvtExternalGenFactory::getInstance()->getGenerator( | ||||
EvtExternalGenFactory::PythiaGenId ); | EvtExternalGenFactory::PythiaGenId ); | ||||
} | } | ||||
if ( _pythiaEngine ) { | if ( m_pythiaEngine ) { | ||||
_pythiaEngine->doDecay( p ); | m_pythiaEngine->doDecay( p ); | ||||
} | } | ||||
this->fixPolarisations( p ); | this->fixPolarisations( p ); | ||||
} | } | ||||
void EvtPythia::fixPolarisations( EvtParticle* p ) | void EvtPythia::fixPolarisations( EvtParticle* p ) | ||||
{ | { | ||||
// Special case to handle the J/psi polarisation | // Special case to handle the J/psi polarisation | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | std::string EvtPythia::commandName() | ||||
// Need to think about including user defined parameters in | // Need to think about including user defined parameters in | ||||
// EvtPythiaEngine::updatePhysicsParameters(). | // EvtPythiaEngine::updatePhysicsParameters(). | ||||
return std::string( "JetSetPar" ); | return std::string( "JetSetPar" ); | ||||
} | } | ||||
void EvtPythia::command( std::string cmd ) | void EvtPythia::command( std::string cmd ) | ||||
{ | { | ||||
// Locally store commands in a vector | // Locally store commands in a vector | ||||
_commandList.push_back( cmd ); | m_commandList.push_back( cmd ); | ||||
} | } |