CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
gen::ExternalDecayDriver Class Reference

#include <ExternalDecayDriver.h>

Public Member Functions

HepMC::GenEventdecay (HepMC::GenEvent *evt)
 
HepMC::GenEventdecay (HepMC::GenEvent *evt, lhef::LHEEvent *lheEvent)
 
 ExternalDecayDriver (const edm::ParameterSet &)
 
void init (const edm::EventSetup &)
 
const std::vector< int > & operatesOnParticles ()
 
void setRandomEngine (CLHEP::HepRandomEngine *)
 
std::vector< std::string > const & sharedResources () const
 
const std::vector< std::string > & specialSettings ()
 
void statistics () const
 
 ~ExternalDecayDriver ()
 

Private Attributes

std::vector< std::string > exSharedResources
 
EvtGenInterfaceBasefEvtGenInterface
 
bool fIsInitialized
 
std::vector< int > fPDGs
 
PhotosInterfaceBasefPhotosInterface
 
std::vector< std::string > fSpecialSettings
 
TauolaInterfaceBasefTauolaInterface
 

Detailed Description

Definition at line 30 of file ExternalDecayDriver.h.

Constructor & Destructor Documentation

ExternalDecayDriver::ExternalDecayDriver ( const edm::ParameterSet pset)

Definition at line 26 of file ExternalDecayDriver.cc.

References gen::PhotosInterfaceBase::avoidTauLeptonicDecays(), gen::PhotosInterfaceBase::configureOnlyFor(), exSharedResources, fEvtGenInterface, fPhotosInterface, fTauolaInterface, reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), edm::SharedResourceNames::kEvtGen, gen::FortranInstance::kFortranInstance, edm::SharedResourceNames::kPhotos, edm::SharedResourceNames::kPythia6, edm::SharedResourceNames::kPythia8, edm::SharedResourceNames::kTauola, and AlCaHLTBitMon_QueryRunRegistry::string.

27  : fIsInitialized(false),
28  fTauolaInterface(nullptr),
29  fEvtGenInterface(nullptr),
30  fPhotosInterface(nullptr)
31 {
32  std::vector<std::string> extGenNames =
33  pset.getParameter< std::vector<std::string> >("parameterSets");
34 
35  for (unsigned int ip=0; ip<extGenNames.size(); ++ip ) {
36  std::string curSet = extGenNames[ip];
37  if ( curSet == "EvtGen") {
42  }
43  else if( curSet == "EvtGen1" || curSet == "EvtGen130" ) {
50  }
51  else if ( curSet == "Tauola" || curSet == "Tauolapp" || curSet == "Tauolapp114" ) {
52  fTauolaInterface = (TauolaInterfaceBase*)(TauolaFactory::get()->create("Tauolapp114", pset.getUntrackedParameter< ParameterSet >(curSet)));
53  fPhotosInterface = (PhotosInterfaceBase*)(PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter< ParameterSet >(curSet)));
58  }
59  else if ( curSet == "Photos" || curSet == "Photos2155" ) {
60  if ( !fPhotosInterface ) {
63  }
64  }
65  else if (curSet == "Photospp" || curSet == "Photospp356" ) {
66  if ( !fPhotosInterface ) {
67  fPhotosInterface = (PhotosInterfaceBase*)(PhotosFactory::get()->create("Photospp356", pset.getUntrackedParameter< ParameterSet>(curSet)));
69  }
70  }
71  }
72 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void configureOnlyFor(int)=0
TauolaInterfaceBase * fTauolaInterface
PhotosInterfaceBase * fPhotosInterface
static const std::string kTauola
static const std::string kPhotos
static const std::string kPythia6
static const std::string kEvtGen
std::vector< std::string > exSharedResources
static const std::string kFortranInstance
EvtGenInterfaceBase * fEvtGenInterface
static const std::string kPythia8
T get(const Candidate &c)
Definition: component.h:55
virtual void avoidTauLeptonicDecays()=0
ExternalDecayDriver::~ExternalDecayDriver ( )

Definition at line 75 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fPhotosInterface, and fTauolaInterface.

76 {
77  if ( fEvtGenInterface ) delete fEvtGenInterface;
78  if ( fTauolaInterface ) delete fTauolaInterface;
79  if ( fPhotosInterface ) delete fPhotosInterface;
80 }
TauolaInterfaceBase * fTauolaInterface
PhotosInterfaceBase * fPhotosInterface
EvtGenInterfaceBase * fEvtGenInterface

Member Function Documentation

HepMC::GenEvent * ExternalDecayDriver::decay ( HepMC::GenEvent evt)

Definition at line 89 of file ExternalDecayDriver.cc.

References gen::PhotosInterfaceBase::apply(), gen::EvtGenInterfaceBase::decay(), gen::TauolaInterfaceBase::decay(), fEvtGenInterface, fIsInitialized, fPhotosInterface, and fTauolaInterface.

Referenced by decay().

90 {
91  if ( !fIsInitialized ) return evt;
92 
93  if ( fEvtGenInterface ) {
94  evt = fEvtGenInterface->decay( evt );
95  if ( !evt ) return nullptr;
96  }
97 
98  if ( fTauolaInterface ) {
99  evt = fTauolaInterface->decay( evt );
100  if ( !evt ) return nullptr;
101  }
102 
103  if ( fPhotosInterface ) {
104  evt = fPhotosInterface->apply( evt );
105  if ( !evt ) return nullptr;
106  }
107 
108  return evt;
109 }
TauolaInterfaceBase * fTauolaInterface
PhotosInterfaceBase * fPhotosInterface
virtual HepMC::GenEvent * apply(HepMC::GenEvent *evt)
EvtGenInterfaceBase * fEvtGenInterface
virtual HepMC::GenEvent * decay(HepMC::GenEvent *evt)
virtual HepMC::GenEvent * decay(HepMC::GenEvent *evt)
HepMC::GenEvent * ExternalDecayDriver::decay ( HepMC::GenEvent evt,
lhef::LHEEvent lheEvent 
)

Definition at line 83 of file ExternalDecayDriver.cc.

References decay(), fTauolaInterface, and gen::TauolaInterfaceBase::SetLHE().

83  {
85  return decay(evt);
86 }
TauolaInterfaceBase * fTauolaInterface
HepMC::GenEvent * decay(HepMC::GenEvent *evt)
virtual void SetLHE(lhef::LHEEvent *l)
void ExternalDecayDriver::init ( const edm::EventSetup es)

Definition at line 112 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fIsInitialized, fPDGs, fPhotosInterface, fSpecialSettings, fTauolaInterface, mps_fire::i, gen::EvtGenInterfaceBase::init(), gen::PhotosInterfaceBase::init(), gen::TauolaInterfaceBase::init(), gen::EvtGenInterfaceBase::operatesOnParticles(), gen::TauolaInterfaceBase::operatesOnParticles(), gen::PhotosInterfaceBase::specialSettings(), and gen::EvtGenInterfaceBase::specialSettings().

113 {
114  if ( fIsInitialized ) return;
115 
116  if ( fTauolaInterface ) {
117  fTauolaInterface->init( es );
118  for ( std::vector<int>::const_iterator i=fTauolaInterface->operatesOnParticles().begin();
119  i!=fTauolaInterface->operatesOnParticles().end(); i++ )
120  fPDGs.push_back( *i );
121  }
122 
123  if ( fEvtGenInterface ) {
125  for ( std::vector<int>::const_iterator i=fEvtGenInterface->operatesOnParticles().begin();
126  i!=fEvtGenInterface->operatesOnParticles().end(); i++ )
127  fPDGs.push_back( *i );
128  for ( unsigned int iss=0; iss<fEvtGenInterface->specialSettings().size(); iss++ ) {
130  }
131 
132  }
133 
134  if ( fPhotosInterface ) {
136  // for tauola++
137  if ( fPhotosInterface ) {
138  for ( unsigned int iss=0; iss<fPhotosInterface->specialSettings().size(); iss++ ){
140  }
141  }
142  }
143 
144  fIsInitialized = true;
145 
146  return;
147 }
virtual void init()=0
TauolaInterfaceBase * fTauolaInterface
virtual void init(const edm::EventSetup &)
PhotosInterfaceBase * fPhotosInterface
virtual const std::vector< std::string > & specialSettings()
virtual const std::vector< int > & operatesOnParticles()
std::vector< std::string > fSpecialSettings
EvtGenInterfaceBase * fEvtGenInterface
virtual const std::vector< std::string > & specialSettings()
virtual const std::vector< int > & operatesOnParticles()
const std::vector<int>& gen::ExternalDecayDriver::operatesOnParticles ( )
inline

Definition at line 39 of file ExternalDecayDriver.h.

39 { return fPDGs; }
void ExternalDecayDriver::setRandomEngine ( CLHEP::HepRandomEngine *  v)

Definition at line 159 of file ExternalDecayDriver.cc.

References decayRandomEngine, fEvtGenInterface, fPhotosInterface, fTauolaInterface, gen::EvtGenInterfaceBase::setRandomEngine(), gen::PhotosInterfaceBase::setRandomEngine(), gen::TauolaInterfaceBase::setRandomEngine(), and gen::v.

160 {
165 }
TauolaInterfaceBase * fTauolaInterface
CLHEP::HepRandomEngine * decayRandomEngine
PhotosInterfaceBase * fPhotosInterface
double v[5][pyjets_maxn]
virtual void setRandomEngine(CLHEP::HepRandomEngine *decayRandomEngine)=0
EvtGenInterfaceBase * fEvtGenInterface
virtual void setRandomEngine(CLHEP::HepRandomEngine *v)=0
virtual void setRandomEngine(CLHEP::HepRandomEngine *v)=0
std::vector<std::string> const& gen::ExternalDecayDriver::sharedResources ( ) const
inline

Definition at line 48 of file ExternalDecayDriver.h.

48 { return exSharedResources; }
std::vector< std::string > exSharedResources
const std::vector<std::string>& gen::ExternalDecayDriver::specialSettings ( )
inline

Definition at line 40 of file ExternalDecayDriver.h.

References SelectingProcedure_cff::decay, and myMessageLogger_cff::statistics.

40 { return fSpecialSettings; }
std::vector< std::string > fSpecialSettings
void ExternalDecayDriver::statistics ( ) const

Definition at line 150 of file ExternalDecayDriver.cc.

References fPhotosInterface, fTauolaInterface, gen::PhotosInterfaceBase::statistics(), and gen::TauolaInterfaceBase::statistics().

151 {
154  // similar for EvtGen if needed
155  return;
156 }
TauolaInterfaceBase * fTauolaInterface
PhotosInterfaceBase * fPhotosInterface

Member Data Documentation

std::vector<std::string> gen::ExternalDecayDriver::exSharedResources
private

Definition at line 58 of file ExternalDecayDriver.h.

Referenced by ExternalDecayDriver().

EvtGenInterfaceBase* gen::ExternalDecayDriver::fEvtGenInterface
private
bool gen::ExternalDecayDriver::fIsInitialized
private

Definition at line 51 of file ExternalDecayDriver.h.

Referenced by decay(), and init().

std::vector<int> gen::ExternalDecayDriver::fPDGs
private

Definition at line 55 of file ExternalDecayDriver.h.

Referenced by init().

PhotosInterfaceBase* gen::ExternalDecayDriver::fPhotosInterface
private
std::vector<std::string> gen::ExternalDecayDriver::fSpecialSettings
private

Definition at line 56 of file ExternalDecayDriver.h.

Referenced by init().

TauolaInterfaceBase* gen::ExternalDecayDriver::fTauolaInterface
private