Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenExternal/EvtExternalGenFactory.cpp
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | EvtExternalGenFactory* EvtExternalGenFactory::getInstance() | ||||
if ( theFactory == 0 ) { | if ( theFactory == 0 ) { | ||||
theFactory = new EvtExternalGenFactory(); | theFactory = new EvtExternalGenFactory(); | ||||
} | } | ||||
return theFactory; | return theFactory; | ||||
} | } | ||||
// Only define the generator if we have the external ifdef variable set | |||||
#ifdef EVTGEN_PYTHIA | |||||
void EvtExternalGenFactory::definePythiaGenerator( std::string xmlDir, | void EvtExternalGenFactory::definePythiaGenerator( std::string xmlDir, | ||||
bool convertPhysCodes, | bool convertPhysCodes, | ||||
bool useEvtGenRandom ) | bool useEvtGenRandom ) | ||||
{ | { | ||||
// Only define the generator if we have the external ifdef variable set | |||||
#ifdef EVTGEN_PYTHIA | |||||
int genId = EvtExternalGenFactory::PythiaGenId; | int genId = EvtExternalGenFactory::PythiaGenId; | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "Defining EvtPythiaEngine: data tables defined in " << xmlDir << endl; | << "Defining EvtPythiaEngine: data tables defined in " << xmlDir << endl; | ||||
if ( convertPhysCodes == true ) { | if ( convertPhysCodes == true ) { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "Pythia 6 codes in decay files will be converted to Pythia 8 codes" | << "Pythia 6 codes in decay files will be converted to Pythia 8 codes" | ||||
<< endl; | << endl; | ||||
} else { | } else { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "Pythia 8 codes need to be used in decay files" << endl; | << "Pythia 8 codes need to be used in decay files" << endl; | ||||
} | } | ||||
if ( useEvtGenRandom == true ) { | if ( useEvtGenRandom == true ) { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "Using EvtGen random engine for Pythia 8 as well" << endl; | << "Using EvtGen random engine for Pythia 8 as well" << endl; | ||||
} | } | ||||
EvtAbsExternalGen* pythiaGenerator = | EvtAbsExternalGen* pythiaGenerator = | ||||
new EvtPythiaEngine( xmlDir, convertPhysCodes, useEvtGenRandom ); | new EvtPythiaEngine( xmlDir, convertPhysCodes, useEvtGenRandom ); | ||||
_extGenMap[genId] = pythiaGenerator; | _extGenMap[genId] = pythiaGenerator; | ||||
#endif | |||||
} | } | ||||
#else | |||||
void EvtExternalGenFactory::definePythiaGenerator( std::string, bool, bool ) | |||||
{ | |||||
} | |||||
#endif | |||||
#ifdef EVTGEN_PHOTOS | |||||
void EvtExternalGenFactory::definePhotosGenerator( std::string photonType, | void EvtExternalGenFactory::definePhotosGenerator( std::string photonType, | ||||
bool useEvtGenRandom ) | bool useEvtGenRandom ) | ||||
{ | { | ||||
#ifdef EVTGEN_PHOTOS | |||||
int genId = EvtExternalGenFactory::PhotosGenId; | int genId = EvtExternalGenFactory::PhotosGenId; | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "Defining EvtPhotosEngine using photonType = " << photonType << endl; | << "Defining EvtPhotosEngine using photonType = " << photonType << endl; | ||||
EvtAbsExternalGen* photosGenerator = new EvtPhotosEngine( photonType, | EvtAbsExternalGen* photosGenerator = new EvtPhotosEngine( photonType, | ||||
useEvtGenRandom ); | useEvtGenRandom ); | ||||
_extGenMap[genId] = photosGenerator; | _extGenMap[genId] = photosGenerator; | ||||
#endif | |||||
} | } | ||||
#else | |||||
void EvtExternalGenFactory::definePhotosGenerator( std::string, bool ) | |||||
{ | |||||
} | |||||
#endif | |||||
#ifdef EVTGEN_TAUOLA | |||||
void EvtExternalGenFactory::defineTauolaGenerator( bool useEvtGenRandom ) | void EvtExternalGenFactory::defineTauolaGenerator( bool useEvtGenRandom ) | ||||
{ | { | ||||
#ifdef EVTGEN_TAUOLA | |||||
int genId = EvtExternalGenFactory::TauolaGenId; | int genId = EvtExternalGenFactory::TauolaGenId; | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Defining EvtTauolaEngine." << endl; | EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Defining EvtTauolaEngine." << endl; | ||||
EvtAbsExternalGen* tauolaGenerator = new EvtTauolaEngine( useEvtGenRandom ); | EvtAbsExternalGen* tauolaGenerator = new EvtTauolaEngine( useEvtGenRandom ); | ||||
_extGenMap[genId] = tauolaGenerator; | _extGenMap[genId] = tauolaGenerator; | ||||
#endif | |||||
} | } | ||||
#else | |||||
void EvtExternalGenFactory::defineTauolaGenerator( bool ) | |||||
{ | |||||
} | |||||
#endif | |||||
EvtAbsExternalGen* EvtExternalGenFactory::getGenerator( int genId ) | EvtAbsExternalGen* EvtExternalGenFactory::getGenerator( int genId ) | ||||
{ | { | ||||
EvtAbsExternalGen* theGenerator( 0 ); | EvtAbsExternalGen* theGenerator( 0 ); | ||||
ExtGenMap::iterator iter; | ExtGenMap::iterator iter; | ||||
if ( ( iter = _extGenMap.find( genId ) ) != _extGenMap.end() ) { | if ( ( iter = _extGenMap.find( genId ) ) != _extGenMap.end() ) { | ||||
Show All 22 Lines |