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

25  : fIsInitialized(false)
26 {
27  std::vector<std::string> extGenNames =
28  pset.getParameter< std::vector<std::string> >("parameterSets");
29 
30  for (unsigned int ip=0; ip<extGenNames.size(); ++ip ) {
31  std::string curSet = extGenNames[ip];
32  if ( curSet == "EvtGen") {
33  fEvtGenInterface = std::unique_ptr<EvtGenInterfaceBase>(EvtGenFactory::get()->create("EvtGen", pset.getUntrackedParameter< ParameterSet >(curSet)));
37  }
38  else if( curSet == "EvtGen1" || curSet == "EvtGen130" ) {
39  fEvtGenInterface = std::unique_ptr<EvtGenInterfaceBase>(EvtGenFactory::get()->create("EvtGen130", pset.getUntrackedParameter< ParameterSet >(curSet)));
45  }
46  else if ( curSet == "Tauola" || curSet == "Tauolapp" || curSet == "Tauolapp114" ) {
47  fTauolaInterface = std::unique_ptr<TauolaInterfaceBase>(TauolaFactory::get()->create("Tauolapp114", pset.getUntrackedParameter< ParameterSet >(curSet)));
48  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter< ParameterSet >(curSet)));
49  fPhotosInterface->configureOnlyFor( 15 );
50  fPhotosInterface->avoidTauLeptonicDecays();
53  }
54  else if ( curSet == "Photos" || curSet == "Photos2155" ) {
55  if ( !fPhotosInterface ) {
56  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter< ParameterSet>(curSet)));
58  }
59  }
60  else if (curSet == "Photospp" || curSet == "Photospp356" ) {
61  if ( !fPhotosInterface ) {
62  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(PhotosFactory::get()->create("Photospp356", pset.getUntrackedParameter< ParameterSet>(curSet)));
64  }
65  }
66  }
67 }
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 77 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fIsInitialized, fPhotosInterface, and fTauolaInterface.

Referenced by decay().

78 {
79  if ( !fIsInitialized ) return evt;
80 
81  if ( fEvtGenInterface ) {
82  evt = fEvtGenInterface->decay( evt );
83  if ( !evt ) return nullptr;
84  }
85 
86  if ( fTauolaInterface ) {
87  evt = fTauolaInterface->decay( evt );
88  if ( !evt ) return nullptr;
89  }
90 
91  if ( fPhotosInterface ) {
92  evt = fPhotosInterface->apply( evt );
93  if ( !evt ) return nullptr;
94  }
95 
96  return evt;
97 }
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 71 of file ExternalDecayDriver.cc.

References decay(), and fTauolaInterface.

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

Definition at line 100 of file ExternalDecayDriver.cc.

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

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

References fEvtGenInterface, fPhotosInterface, and fTauolaInterface.

148 {
149  if ( fTauolaInterface ) fTauolaInterface->setRandomEngine(v);
150  if ( fEvtGenInterface ) fEvtGenInterface->setRandomEngine(v);
151  if ( fPhotosInterface ) fPhotosInterface->setRandomEngine(v);
152 }
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 138 of file ExternalDecayDriver.cc.

References fPhotosInterface, and fTauolaInterface.

139 {
140  if ( fTauolaInterface ) fTauolaInterface->statistics();
141  if ( fPhotosInterface ) fPhotosInterface->statistics();
142  // similar for EvtGen if needed
143  return;
144 }
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().