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 ()
 
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 26 of file ExternalDecayDriver.h.

Constructor & Destructor Documentation

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

Definition at line 18 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::kTauola, and AlCaHLTBitMon_QueryRunRegistry::string.

19  : fIsInitialized(false),
23 {
24  std::vector<std::string> extGenNames =
25  pset.getParameter< std::vector<std::string> >("parameterSets");
26 
27  for (unsigned int ip=0; ip<extGenNames.size(); ++ip ){
28  std::string curSet = extGenNames[ip];
29  if ( curSet == "EvtGen" || curSet == "EvtGenLHC91"){
30  fEvtGenInterface = (EvtGenInterfaceBase*)(EvtGenFactory::get()->create("EvtGenLHC91", pset.getUntrackedParameter< ParameterSet >(curSet)));
34  }
35  else if ( curSet == "Tauola" || curSet == "Tauolapp113a" ){
36  // this is for old tauola27 (+pretauola)
37  //
38  // --> fTauolaInterface = new gen::TauolaInterface(pset.getUntrackedParameter< ParameterSet >(curSet));
39  //
40  // for tauola++, here it should be something like:
41  //
42  fTauolaInterface = (TauolaInterfaceBase*)(TauolaFactory::get()->create("Tauolapp113a", pset.getUntrackedParameter< ParameterSet >(curSet)));
43  fPhotosInterface = (PhotosInterfaceBase*)(PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter< ParameterSet >(curSet)));
48  }
49  else if ( curSet == "Photos" || curSet == "Photos2155" ){
50  if ( !fPhotosInterface ){
53  }
54  }
55  }
56 }
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
T get(const Candidate &c)
Definition: component.h:55
virtual void avoidTauLeptonicDecays()=0
ExternalDecayDriver::~ExternalDecayDriver ( )

Definition at line 58 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fPhotosInterface, and fTauolaInterface.

59 {
60  if ( fEvtGenInterface ) delete fEvtGenInterface;
61  if ( fTauolaInterface ) delete fTauolaInterface;
62  if ( fPhotosInterface ) delete fPhotosInterface;
63 }
TauolaInterfaceBase * fTauolaInterface
PhotosInterfaceBase * fPhotosInterface
EvtGenInterfaceBase * fEvtGenInterface

Member Function Documentation

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

Definition at line 65 of file ExternalDecayDriver.cc.

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

66 {
67 
68  if ( !fIsInitialized ) return evt;
69 
70  if ( fEvtGenInterface )
71  {
72  evt = fEvtGenInterface->decay( evt );
73  if ( !evt ) return 0;
74  }
75 
76  if ( fTauolaInterface )
77  {
78  evt = fTauolaInterface->decay( evt );
79  if ( !evt ) return 0;
80  }
81 
82  if ( fPhotosInterface )
83  {
84  evt = fPhotosInterface->apply( evt );
85  if ( !evt ) return 0;
86  }
87 
88  return evt;
89 }
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 91 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().

92 {
93 
94  if ( fIsInitialized ) return;
95 
96  if ( fTauolaInterface )
97  {
98  fTauolaInterface->init( es );
99  for ( std::vector<int>::const_iterator i=fTauolaInterface->operatesOnParticles().begin();
100  i!=fTauolaInterface->operatesOnParticles().end(); i++ )
101  fPDGs.push_back( *i );
102  }
103 
104  if ( fEvtGenInterface )
105  {
107  for ( std::vector<int>::const_iterator i=fEvtGenInterface->operatesOnParticles().begin();
108  i!=fEvtGenInterface->operatesOnParticles().end(); i++ )
109  fPDGs.push_back( *i );
110  }
111 
112 
113  if ( fPhotosInterface )
114  {
116 // for tauola++
117  if ( fPhotosInterface )
118  {
119  for ( unsigned int iss=0; iss<fPhotosInterface->specialSettings().size(); iss++ )
120  {
122  }
123  }
124  }
125 
126 // this is specific to old tauola27 only, because it calls up photos automatically
127 //
128 //
129 // if ( fTauolaInterface )
130 // {
131 // // override !
132 // fSpecialSettings.clear();
133 // fSpecialSettings.push_back( "QED-brem-off:15" );
134 // }
135 
136  fIsInitialized = true;
137 
138  return;
139 }
int i
Definition: DBlmapReader.cc:9
virtual void init()=0
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 35 of file ExternalDecayDriver.h.

References fPDGs.

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

Definition at line 148 of file ExternalDecayDriver.cc.

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

149 {
154 }
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 43 of file ExternalDecayDriver.h.

References exSharedResources.

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

Definition at line 36 of file ExternalDecayDriver.h.

References fSpecialSettings.

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

Definition at line 141 of file ExternalDecayDriver.cc.

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

142 {
144  // similar for EvtGen and/or Photos, if needs be
145  return;
146 }
TauolaInterfaceBase * fTauolaInterface

Member Data Documentation

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

Definition at line 54 of file ExternalDecayDriver.h.

Referenced by ExternalDecayDriver(), and sharedResources().

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

Definition at line 47 of file ExternalDecayDriver.h.

Referenced by decay(), and init().

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

Definition at line 51 of file ExternalDecayDriver.h.

Referenced by init(), and operatesOnParticles().

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

Definition at line 52 of file ExternalDecayDriver.h.

Referenced by init(), and specialSettings().

TauolaInterfaceBase* gen::ExternalDecayDriver::fTauolaInterface
private