#include <ExternalDecayDriver.h>
Public Member Functions | |
HepMC::GenEvent * | decay (HepMC::GenEvent *) |
ExternalDecayDriver (const edm::ParameterSet &) | |
void | init (const edm::EventSetup &) |
const std::vector< int > & | operatesOnParticles () |
const std::vector< std::string > & | specialSettings () |
void | statistics () const |
~ExternalDecayDriver () | |
Private Attributes | |
EvtGenInterface * | fEvtGenInterface |
bool | fIsInitialized |
std::vector< int > | fPDGs |
PhotosInterface * | fPhotosInterface |
std::vector< std::string > | fSpecialSettings |
TauolaInterface * | fTauolaInterface |
Definition at line 18 of file ExternalDecayDriver.h.
ExternalDecayDriver::ExternalDecayDriver | ( | const edm::ParameterSet & | pset | ) |
Definition at line 21 of file ExternalDecayDriver.cc.
References gen::PhotosInterface::avoidTauLeptonicDecays(), gen::PhotosInterface::configureOnlyFor(), decayRandomEngine, Exception, fEvtGenInterface, fPhotosInterface, fTauolaInterface, gen::TauolaInterface::getInstance(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gen::TauolaInterface::setPSet(), and AlCaHLTBitMon_QueryRunRegistry::string.
: fIsInitialized(false), fTauolaInterface(0), fEvtGenInterface(0), fPhotosInterface(0) { std::vector<std::string> extGenNames = pset.getParameter< std::vector<std::string> >("parameterSets"); Service<RandomNumberGenerator> rng; if(!rng.isAvailable()) { throw cms::Exception("Configuration") << "The RandomNumberProducer module requires the RandomNumberGeneratorService\n" "which appears to be absent. Please add that service to your configuration\n" "or remove the modules that require it." << std::endl; } decayRandomEngine = &rng->getEngine(); for (unsigned int ip=0; ip<extGenNames.size(); ++ip ) { std::string curSet = extGenNames[ip]; if ( curSet == "EvtGen" ) { fEvtGenInterface = new gen::EvtGenInterface(pset.getUntrackedParameter< ParameterSet >(curSet)); } else if ( curSet == "Tauola" ) { // this is for old tauola27 (+pretauola) // // --> fTauolaInterface = new gen::TauolaInterface(pset.getUntrackedParameter< ParameterSet >(curSet)); // // for tauola++, here it should be something like: // fTauolaInterface = TauolaInterface::getInstance(); fTauolaInterface->setPSet( pset.getUntrackedParameter< ParameterSet >(curSet) ); fPhotosInterface = new gen::PhotosInterface(); fPhotosInterface->configureOnlyFor( 15 ); fPhotosInterface->avoidTauLeptonicDecays(); } else if ( curSet == "Photos" ) { if ( !fPhotosInterface ) fPhotosInterface = new gen::PhotosInterface(); } } }
ExternalDecayDriver::~ExternalDecayDriver | ( | ) |
Definition at line 70 of file ExternalDecayDriver.cc.
References fEvtGenInterface, fPhotosInterface, and fTauolaInterface.
{ if ( fEvtGenInterface ) delete fEvtGenInterface; if ( fTauolaInterface ) delete fTauolaInterface; if ( fPhotosInterface ) delete fPhotosInterface; }
HepMC::GenEvent * ExternalDecayDriver::decay | ( | HepMC::GenEvent * | evt | ) |
Definition at line 77 of file ExternalDecayDriver.cc.
References gen::PhotosInterface::apply(), gen::EvtGenInterface::decay(), gen::TauolaInterface::decay(), fEvtGenInterface, fIsInitialized, fPhotosInterface, and fTauolaInterface.
{ if ( !fIsInitialized ) return evt; if ( fEvtGenInterface ) { evt = fEvtGenInterface->decay( evt ); if ( !evt ) return 0; } if ( fTauolaInterface ) { evt = fTauolaInterface->decay( evt ); if ( !evt ) return 0; } if ( fPhotosInterface ) { evt = fPhotosInterface->apply( evt ); if ( !evt ) return 0; } return evt; }
void ExternalDecayDriver::init | ( | const edm::EventSetup & | es | ) |
Definition at line 103 of file ExternalDecayDriver.cc.
References fEvtGenInterface, fIsInitialized, fPDGs, fPhotosInterface, fSpecialSettings, fTauolaInterface, i, gen::EvtGenInterface::init(), gen::TauolaInterface::init(), gen::PhotosInterface::init(), gen::TauolaInterface::operatesOnParticles(), gen::EvtGenInterface::operatesOnParticles(), and gen::PhotosInterface::specialSettings().
{ if ( fIsInitialized ) return; if ( fTauolaInterface ) { fTauolaInterface->init( es ); for ( std::vector<int>::const_iterator i=fTauolaInterface->operatesOnParticles().begin(); i!=fTauolaInterface->operatesOnParticles().end(); i++ ) fPDGs.push_back( *i ); } if ( fEvtGenInterface ) { fEvtGenInterface->init(); for ( std::vector<int>::const_iterator i=fEvtGenInterface->operatesOnParticles().begin(); i!=fEvtGenInterface->operatesOnParticles().end(); i++ ) fPDGs.push_back( *i ); } if ( fPhotosInterface ) { fPhotosInterface->init(); // for tauola++ if ( fPhotosInterface ) { for ( unsigned int iss=0; iss<fPhotosInterface->specialSettings().size(); iss++ ) { fSpecialSettings.push_back( fPhotosInterface->specialSettings()[iss] ); } } } // this is specific to old tauola27 only, because it calls up photos automatically // // // if ( fTauolaInterface ) // { // // override ! // fSpecialSettings.clear(); // fSpecialSettings.push_back( "QED-brem-off:15" ); // } fIsInitialized = true; return; }
const std::vector<int>& gen::ExternalDecayDriver::operatesOnParticles | ( | ) | [inline] |
const std::vector<std::string>& gen::ExternalDecayDriver::specialSettings | ( | ) | [inline] |
Definition at line 29 of file ExternalDecayDriver.h.
References fSpecialSettings.
{ return fSpecialSettings; }
void ExternalDecayDriver::statistics | ( | ) | const |
Definition at line 153 of file ExternalDecayDriver.cc.
References fTauolaInterface, and gen::TauolaInterface::statistics().
{ if ( fTauolaInterface ) fTauolaInterface->statistics(); // similar for EvtGen and/or Photos, if needs be return; }
Definition at line 39 of file ExternalDecayDriver.h.
Referenced by decay(), ExternalDecayDriver(), init(), and ~ExternalDecayDriver().
bool gen::ExternalDecayDriver::fIsInitialized [private] |
Definition at line 37 of file ExternalDecayDriver.h.
std::vector<int> gen::ExternalDecayDriver::fPDGs [private] |
Definition at line 41 of file ExternalDecayDriver.h.
Referenced by init(), and operatesOnParticles().
Definition at line 40 of file ExternalDecayDriver.h.
Referenced by decay(), ExternalDecayDriver(), init(), and ~ExternalDecayDriver().
std::vector<std::string> gen::ExternalDecayDriver::fSpecialSettings [private] |
Definition at line 42 of file ExternalDecayDriver.h.
Referenced by init(), and specialSettings().
Definition at line 38 of file ExternalDecayDriver.h.
Referenced by decay(), ExternalDecayDriver(), init(), statistics(), and ~ExternalDecayDriver().