CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
gen::ExternalDecayDriver Class Reference

#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

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

Detailed Description

Definition at line 18 of file ExternalDecayDriver.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file ExternalDecayDriver.cc.

References gen::PhotosInterfaceBase::avoidTauLeptonicDecays(), gen::PhotosInterfaceBase::configureOnlyFor(), decayRandomEngine, edm::hlt::Exception, fEvtGenInterface, fPhotosInterface, fTauolaInterface, reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gen::TauolaInterfaceBase::SetDecayRandomEngine(), gen::PhotosInterfaceBase::SetDecayRandomEngine(), gen::EvtGenInterfaceBase::SetPhotosDecayRandomEngine(), and AlCaHLTBitMon_QueryRunRegistry::string.

21  :
22  fIsInitialized(false),
26 {
27 
28  std::vector<std::string> extGenNames = pset.getParameter< std::vector<std::string> >("parameterSets");
29 
31  if(!rng.isAvailable()) {
32  throw cms::Exception("Configuration")
33  << "The RandomNumberProducer module requires the RandomNumberGeneratorService\n"
34  "which appears to be absent. Please add that service to your configuration\n"
35  "or remove the modules that require it." << std::endl;
36  }
37  decayRandomEngine = &rng->getEngine();
38 
39  for (unsigned int ip=0; ip<extGenNames.size(); ++ip ){
40  std::string curSet = extGenNames[ip];
41  if ( curSet == "EvtGen" || curSet == "EvtGenLHC91"){
42  fEvtGenInterface = (EvtGenInterfaceBase*)(EvtGenFactory::get()->create("EvtGenLHC91", pset.getUntrackedParameter< ParameterSet >(curSet)));
44  }
45  if( curSet == "Tauola" || curSet =="Tauolapp105"){
46  fTauolaInterface = (TauolaInterfaceBase*)(TauolaFactory::get()->create("Tauolapp105", pset.getUntrackedParameter< ParameterSet >(curSet)));
48  fPhotosInterface = (PhotosInterfaceBase*)(PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter< ParameterSet >(curSet)));
52  }
53  if ( curSet == "Photos" || curSet == "Photos2155"){
54  if ( !fPhotosInterface ){
57  }
58  }
59  }
60 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void SetDecayRandomEngine(CLHEP::HepRandomEngine *decayRandomEngine)
TauolaInterfaceBase * fTauolaInterface
CLHEP::HepRandomEngine * decayRandomEngine
PhotosInterfaceBase * fPhotosInterface
virtual void SetDecayRandomEngine(CLHEP::HepRandomEngine *decayRandomEngine)
virtual void configureOnlyFor(int)
virtual void SetPhotosDecayRandomEngine(CLHEP::HepRandomEngine *decayRandomEngine)
EvtGenInterfaceBase * fEvtGenInterface
virtual void avoidTauLeptonicDecays()
T get(const Candidate &c)
Definition: component.h:56
ExternalDecayDriver::~ExternalDecayDriver ( )

Definition at line 62 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fPhotosInterface, and fTauolaInterface.

62  {
63  if ( fEvtGenInterface ) delete fEvtGenInterface;
64  if ( fTauolaInterface ) delete fTauolaInterface;
65  if ( fPhotosInterface ) delete fPhotosInterface;
66 }
TauolaInterfaceBase * fTauolaInterface
PhotosInterfaceBase * fPhotosInterface
EvtGenInterfaceBase * fEvtGenInterface

Member Function Documentation

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

Definition at line 68 of file ExternalDecayDriver.cc.

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

68  {
69 
70  if ( !fIsInitialized ) return evt;
71 
72  if ( fEvtGenInterface ){
73  evt = fEvtGenInterface->decay( evt );
74  if ( !evt ) return 0;
75  }
76 
77  if ( fTauolaInterface ){
78  evt = fTauolaInterface->decay( evt );
79  if ( !evt ) return 0;
80  }
81 
82  if ( fPhotosInterface ){
83  evt = fPhotosInterface->apply( evt );
84  if ( !evt ) return 0;
85  }
86 
87  return evt;
88 }
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)
void ExternalDecayDriver::init ( const edm::EventSetup es)

Definition at line 90 of file ExternalDecayDriver.cc.

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

90  {
91 
92  if ( fIsInitialized ) return;
93 
94  if ( fTauolaInterface ) {
95  fTauolaInterface->init( es );
96  for ( std::vector<int>::const_iterator i=fTauolaInterface->operatesOnParticles().begin();
97  i!=fTauolaInterface->operatesOnParticles().end(); i++ )
98  fPDGs.push_back( *i );
99  }
100  if ( fEvtGenInterface ){
102  for ( std::vector<int>::const_iterator i=fEvtGenInterface->operatesOnParticles().begin();
103  i!=fEvtGenInterface->operatesOnParticles().end(); i++ )
104  fPDGs.push_back( *i );
105  }
106  if(fPhotosInterface){
108  if(fTauolaInterface){
109  if (fPhotosInterface){
110  for ( unsigned int iss=0; iss<fPhotosInterface->specialSettings().size(); iss++ ){
112  }
113  }
114  }
115  }
116  fIsInitialized = true;
117 
118  return;
119 }
int i
Definition: DBlmapReader.cc:9
TauolaInterfaceBase * fTauolaInterface
virtual void init(const edm::EventSetup &)
PhotosInterfaceBase * fPhotosInterface
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 26 of file ExternalDecayDriver.h.

References fPDGs.

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

Definition at line 27 of file ExternalDecayDriver.h.

References fSpecialSettings.

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

Definition at line 121 of file ExternalDecayDriver.cc.

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

122 {
124  // similar for EvtGen and/or Photos, if needs be
125  return;
126 }
TauolaInterfaceBase * fTauolaInterface

Member Data Documentation

EvtGenInterfaceBase* gen::ExternalDecayDriver::fEvtGenInterface
private

Definition at line 34 of file ExternalDecayDriver.h.

Referenced by decay(), ExternalDecayDriver(), init(), and ~ExternalDecayDriver().

bool gen::ExternalDecayDriver::fIsInitialized
private

Definition at line 32 of file ExternalDecayDriver.h.

Referenced by decay(), and init().

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

Definition at line 36 of file ExternalDecayDriver.h.

Referenced by init(), and operatesOnParticles().

PhotosInterfaceBase* gen::ExternalDecayDriver::fPhotosInterface
private

Definition at line 35 of file ExternalDecayDriver.h.

Referenced by decay(), ExternalDecayDriver(), init(), and ~ExternalDecayDriver().

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

Definition at line 37 of file ExternalDecayDriver.h.

Referenced by init(), and specialSettings().

TauolaInterfaceBase* gen::ExternalDecayDriver::fTauolaInterface
private