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 28 of file ExternalDecayDriver.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file ExternalDecayDriver.cc.

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

77  {
78  if (!fIsInitialized)
79  return evt;
80 
81  if (fEvtGenInterface) {
82  evt = fEvtGenInterface->decay(evt);
83  if (!evt)
84  return nullptr;
85  }
86 
87  if (fTauolaInterface) {
88  evt = fTauolaInterface->decay(evt);
89  if (!evt)
90  return nullptr;
91  }
92 
93  if (fPhotosInterface) {
94  evt = fPhotosInterface->apply(evt);
95  if (!evt)
96  return nullptr;
97  }
98 
99  return evt;
100 }
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)
73  fTauolaInterface->SetLHE(lheEvent);
74  return decay(evt);
75 }
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.

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

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

Definition at line 149 of file ExternalDecayDriver.cc.

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

149  {
151  if (fTauolaInterface)
152  fTauolaInterface->setRandomEngine(v);
153  if (fEvtGenInterface)
154  fEvtGenInterface->setRandomEngine(v);
155  if (fPhotosInterface)
156  fPhotosInterface->setRandomEngine(v);
157 }
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 45 of file ExternalDecayDriver.h.

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

Definition at line 37 of file ExternalDecayDriver.h.

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

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

Definition at line 140 of file ExternalDecayDriver.cc.

References fPhotosInterface, and fTauolaInterface.

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

Member Data Documentation

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

Definition at line 55 of file ExternalDecayDriver.h.

Referenced by ExternalDecayDriver().

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

Definition at line 50 of file ExternalDecayDriver.h.

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

bool gen::ExternalDecayDriver::fIsInitialized
private

Definition at line 48 of file ExternalDecayDriver.h.

Referenced by decay(), and init().

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

Definition at line 52 of file ExternalDecayDriver.h.

Referenced by init().

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

Definition at line 51 of file ExternalDecayDriver.h.

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

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

Definition at line 53 of file ExternalDecayDriver.h.

Referenced by init().

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

Definition at line 49 of file ExternalDecayDriver.h.

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