Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGen.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
void EvtGen::initialize( const std::string& decayName, std::istream& pdtTable, | void EvtGen::initialize( const std::string& decayName, std::istream& pdtTable, | ||||
EvtRandomEngine* randomEngine, EvtAbsRadCorr* isrEngine, | EvtRandomEngine* randomEngine, EvtAbsRadCorr* isrEngine, | ||||
const std::list<EvtDecayBase*>* extraModels, | const std::list<EvtDecayBase*>* extraModels, | ||||
int mixingType, bool useXml ) | int mixingType, bool useXml ) | ||||
{ | { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Initializing EvtGen" << endl; | EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "Initializing EvtGen" << endl; | ||||
if ( randomEngine == 0 ) { | if ( randomEngine == nullptr ) { | ||||
static EvtSimpleRandomEngine defaultRandomEngine; | static EvtSimpleRandomEngine defaultRandomEngine; | ||||
EvtRandom::setRandomEngine( &defaultRandomEngine ); | EvtRandom::setRandomEngine( &defaultRandomEngine ); | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "No random engine given in " | << "No random engine given in " | ||||
<< "EvtGen::EvtGen constructor, " | << "EvtGen::EvtGen constructor, " | ||||
<< "will use default EvtSimpleRandomEngine." << endl; | << "will use default EvtSimpleRandomEngine." << endl; | ||||
} else { | } else { | ||||
EvtRandom::setRandomEngine( randomEngine ); | EvtRandom::setRandomEngine( randomEngine ); | ||||
Show All 15 Lines | void EvtGen::initialize( const std::string& decayName, std::istream& pdtTable, | ||||
_mixingType = mixingType; | _mixingType = mixingType; | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "Mixing type integer set to " << _mixingType << endl; | << "Mixing type integer set to " << _mixingType << endl; | ||||
EvtCPUtil::getInstance()->setMixingType( _mixingType ); | EvtCPUtil::getInstance()->setMixingType( _mixingType ); | ||||
// Set the radiative correction engine | // Set the radiative correction engine | ||||
if ( isrEngine != 0 ) { | if ( isrEngine != nullptr ) { | ||||
EvtRadCorr::setRadCorrEngine( isrEngine ); | EvtRadCorr::setRadCorrEngine( isrEngine ); | ||||
} else { | } else { | ||||
// Owing to the pure abstract interface, we still need to define a concrete | // Owing to the pure abstract interface, we still need to define a concrete | ||||
// implementation of a radiative correction engine. Use one which does nothing. | // implementation of a radiative correction engine. Use one which does nothing. | ||||
EvtAbsRadCorr* noRadCorr = new EvtNoRadCorr(); | EvtAbsRadCorr* noRadCorr = new EvtNoRadCorr(); | ||||
EvtRadCorr::setRadCorrEngine( noRadCorr ); | EvtRadCorr::setRadCorrEngine( noRadCorr ); | ||||
} | } | ||||
Show All 24 Lines | if ( uDecayName.size() == 0 ) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
EvtHepMCEvent* EvtGen::generateDecay( int PDGId, EvtVector4R refFrameP4, | EvtHepMCEvent* EvtGen::generateDecay( int PDGId, EvtVector4R refFrameP4, | ||||
EvtVector4R translation, | EvtVector4R translation, | ||||
EvtSpinDensity* spinDensity ) | EvtSpinDensity* spinDensity ) | ||||
{ | { | ||||
EvtParticle* theParticle( 0 ); | EvtParticle* theParticle( nullptr ); | ||||
if ( spinDensity == 0 ) { | if ( spinDensity == nullptr ) { | ||||
theParticle = EvtParticleFactory::particleFactory( | theParticle = EvtParticleFactory::particleFactory( | ||||
EvtPDL::evtIdFromStdHep( PDGId ), refFrameP4 ); | EvtPDL::evtIdFromStdHep( PDGId ), refFrameP4 ); | ||||
} else { | } else { | ||||
theParticle = EvtParticleFactory::particleFactory( | theParticle = EvtParticleFactory::particleFactory( | ||||
EvtPDL::evtIdFromStdHep( PDGId ), refFrameP4, *spinDensity ); | EvtPDL::evtIdFromStdHep( PDGId ), refFrameP4, *spinDensity ); | ||||
} | } | ||||
generateDecay( theParticle ); | generateDecay( theParticle ); | ||||
Show All 37 Lines |