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
 
std::unique_ptr< EvtGenInterfaceBasefEvtGenInterface
 
bool fIsInitialized
 
std::vector< int > fPDGs
 
std::unique_ptr< PhotosInterfaceBasefPhotosInterface
 
std::vector< std::string > fSpecialSettings
 
std::unique_ptr< 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 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, AlCaHLTBitMon_QueryRunRegistry::string, and ~ExternalDecayDriver().

27  : fIsInitialized(false)
28 {
29  std::vector<std::string> extGenNames =
30  pset.getParameter< std::vector<std::string> >("parameterSets");
31 
32  for (unsigned int ip=0; ip<extGenNames.size(); ++ip ) {
33  std::string curSet = extGenNames[ip];
34  if ( curSet == "EvtGen") {
35  fEvtGenInterface = std::unique_ptr<EvtGenInterfaceBase>(EvtGenFactory::get()->create("EvtGen", pset.getUntrackedParameter< ParameterSet >(curSet)));
39  }
40  else if( curSet == "EvtGen1" || curSet == "EvtGen130" ) {
41  fEvtGenInterface = std::unique_ptr<EvtGenInterfaceBase>(EvtGenFactory::get()->create("EvtGen130", pset.getUntrackedParameter< ParameterSet >(curSet)));
47  }
48  else if ( curSet == "Tauola" || curSet == "Tauolapp" || curSet == "Tauolapp114" ) {
49  fTauolaInterface = std::unique_ptr<TauolaInterfaceBase>(TauolaFactory::get()->create("Tauolapp114", pset.getUntrackedParameter< ParameterSet >(curSet)));
50  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter< ParameterSet >(curSet)));
51  fPhotosInterface->configureOnlyFor( 15 );
52  fPhotosInterface->avoidTauLeptonicDecays();
55  }
56  else if ( curSet == "Photos" || curSet == "Photos2155" ) {
57  if ( !fPhotosInterface ) {
58  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter< ParameterSet>(curSet)));
60  }
61  }
62  else if (curSet == "Photospp" || curSet == "Photospp356" ) {
63  if ( !fPhotosInterface ) {
64  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(PhotosFactory::get()->create("Photospp356", pset.getUntrackedParameter< ParameterSet>(curSet)));
66  }
67  }
68  }
69 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< 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
std::unique_ptr< EvtGenInterfaceBase > fEvtGenInterface
std::unique_ptr< TauolaInterfaceBase > fTauolaInterface
static const std::string kFortranInstance
static const std::string kPythia8
T get(const Candidate &c)
Definition: component.h:55
ExternalDecayDriver::~ExternalDecayDriver ( )
default

Referenced by ExternalDecayDriver().

Member Function Documentation

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

Definition at line 79 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fIsInitialized, fPhotosInterface, and fTauolaInterface.

Referenced by decay().

80 {
81  if ( !fIsInitialized ) return evt;
82 
83  if ( fEvtGenInterface ) {
84  evt = fEvtGenInterface->decay( evt );
85  if ( !evt ) return nullptr;
86  }
87 
88  if ( fTauolaInterface ) {
89  evt = fTauolaInterface->decay( evt );
90  if ( !evt ) return nullptr;
91  }
92 
93  if ( fPhotosInterface ) {
94  evt = fPhotosInterface->apply( evt );
95  if ( !evt ) return nullptr;
96  }
97 
98  return evt;
99 }
std::unique_ptr< PhotosInterfaceBase > fPhotosInterface
std::unique_ptr< EvtGenInterfaceBase > fEvtGenInterface
std::unique_ptr< TauolaInterfaceBase > fTauolaInterface
HepMC::GenEvent * ExternalDecayDriver::decay ( HepMC::GenEvent evt,
lhef::LHEEvent lheEvent 
)

Definition at line 73 of file ExternalDecayDriver.cc.

References decay(), and fTauolaInterface.

73  {
74  if(fTauolaInterface) fTauolaInterface->SetLHE(lheEvent);
75  return decay(evt);
76 }
std::unique_ptr< TauolaInterfaceBase > fTauolaInterface
HepMC::GenEvent * decay(HepMC::GenEvent *evt)
void ExternalDecayDriver::init ( const edm::EventSetup es)

Definition at line 102 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fIsInitialized, fPDGs, fPhotosInterface, fSpecialSettings, fTauolaInterface, and mps_fire::i.

103 {
104  if ( fIsInitialized ) return;
105 
106  if ( fTauolaInterface ) {
107  fTauolaInterface->init( es );
108  for ( std::vector<int>::const_iterator i=fTauolaInterface->operatesOnParticles().begin();
109  i!=fTauolaInterface->operatesOnParticles().end(); i++ )
110  fPDGs.push_back( *i );
111  }
112 
113  if ( fEvtGenInterface ) {
114  fEvtGenInterface->init();
115  for ( std::vector<int>::const_iterator i=fEvtGenInterface->operatesOnParticles().begin();
116  i!=fEvtGenInterface->operatesOnParticles().end(); i++ )
117  fPDGs.push_back( *i );
118  for ( unsigned int iss=0; iss<fEvtGenInterface->specialSettings().size(); iss++ ) {
119  fSpecialSettings.push_back( fEvtGenInterface->specialSettings()[iss] );
120  }
121 
122  }
123 
124  if ( fPhotosInterface ) {
125  fPhotosInterface->init();
126  // for tauola++
127  if ( fPhotosInterface ) {
128  for ( unsigned int iss=0; iss<fPhotosInterface->specialSettings().size(); iss++ ){
129  fSpecialSettings.push_back( fPhotosInterface->specialSettings()[iss] );
130  }
131  }
132  }
133 
134  fIsInitialized = true;
135 
136  return;
137 }
std::unique_ptr< PhotosInterfaceBase > fPhotosInterface
std::unique_ptr< EvtGenInterfaceBase > fEvtGenInterface
std::vector< std::string > fSpecialSettings
std::unique_ptr< TauolaInterfaceBase > fTauolaInterface
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 149 of file ExternalDecayDriver.cc.

References decayRandomEngine, fEvtGenInterface, fPhotosInterface, fTauolaInterface, and gen::v.

150 {
152  if ( fTauolaInterface ) fTauolaInterface->setRandomEngine(v);
153  if ( fEvtGenInterface ) fEvtGenInterface->setRandomEngine(v);
154  if ( fPhotosInterface ) fPhotosInterface->setRandomEngine(v);
155 }
CLHEP::HepRandomEngine * decayRandomEngine
std::unique_ptr< PhotosInterfaceBase > fPhotosInterface
double v[5][pyjets_maxn]
std::unique_ptr< EvtGenInterfaceBase > fEvtGenInterface
std::unique_ptr< TauolaInterfaceBase > fTauolaInterface
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 140 of file ExternalDecayDriver.cc.

References fPhotosInterface, and fTauolaInterface.

141 {
142  if ( fTauolaInterface ) fTauolaInterface->statistics();
143  if ( fPhotosInterface ) fPhotosInterface->statistics();
144  // similar for EvtGen if needed
145  return;
146 }
std::unique_ptr< PhotosInterfaceBase > fPhotosInterface
std::unique_ptr< TauolaInterfaceBase > fTauolaInterface

Member Data Documentation

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

Definition at line 58 of file ExternalDecayDriver.h.

Referenced by ExternalDecayDriver().

std::unique_ptr<EvtGenInterfaceBase> gen::ExternalDecayDriver::fEvtGenInterface
private

Definition at line 53 of file ExternalDecayDriver.h.

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

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().

std::unique_ptr<PhotosInterfaceBase> gen::ExternalDecayDriver::fPhotosInterface
private

Definition at line 54 of file ExternalDecayDriver.h.

Referenced by decay(), ExternalDecayDriver(), init(), setRandomEngine(), and statistics().

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

Definition at line 56 of file ExternalDecayDriver.h.

Referenced by init().

std::unique_ptr<TauolaInterfaceBase> gen::ExternalDecayDriver::fTauolaInterface
private

Definition at line 52 of file ExternalDecayDriver.h.

Referenced by decay(), ExternalDecayDriver(), init(), setRandomEngine(), and statistics().