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::ExternalDecayDriver ( const edm::ParameterSet pset)

Definition at line 23 of file ExternalDecayDriver.cc.

23  : fIsInitialized(false) {
24  std::vector<std::string> extGenNames = pset.getParameter<std::vector<std::string> >("parameterSets");
25 
26  for (unsigned int ip = 0; ip < extGenNames.size(); ++ip) {
27  std::string curSet = extGenNames[ip];
28  if (curSet == "EvtGen") {
29  fEvtGenInterface = std::unique_ptr<EvtGenInterfaceBase>(
30  EvtGenFactory::get()->create("EvtGen", pset.getUntrackedParameter<ParameterSet>(curSet)));
34  } else if (curSet == "EvtGen1" || curSet == "EvtGen130") {
35  fEvtGenInterface = std::unique_ptr<EvtGenInterfaceBase>(
36  EvtGenFactory::get()->create("EvtGen130", pset.getUntrackedParameter<ParameterSet>(curSet)));
42  } else if (curSet == "Tauola" || curSet == "Tauolapp" || curSet == "Tauolapp114") {
43  fTauolaInterface = std::unique_ptr<TauolaInterfaceBase>(
44  TauolaFactory::get()->create("Tauolapp114", pset.getUntrackedParameter<ParameterSet>(curSet)));
45  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(
46  PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter<ParameterSet>(curSet)));
47  fPhotosInterface->configureOnlyFor(15);
48  fPhotosInterface->avoidTauLeptonicDecays();
51  } else if (curSet == "Photos" || curSet == "Photos2155") {
52  if (!fPhotosInterface) {
53  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(
54  PhotosFactory::get()->create("Photos2155", pset.getUntrackedParameter<ParameterSet>(curSet)));
56  }
57  } else if (curSet == "Photospp" || curSet == "Photospp356") {
58  if (!fPhotosInterface) {
59  fPhotosInterface = std::unique_ptr<PhotosInterfaceBase>(
60  PhotosFactory::get()->create("Photospp356", pset.getUntrackedParameter<ParameterSet>(curSet)));
62  }
63  }
64  }
65 }

References beamerCreator::create(), exSharedResources, fEvtGenInterface, fPhotosInterface, fTauolaInterface, get, edm::SharedResourceNames::kEvtGen, gen::FortranInstance::kFortranInstance, edm::SharedResourceNames::kPhotos, edm::SharedResourceNames::kPythia6, edm::SharedResourceNames::kPythia8, edm::SharedResourceNames::kTauola, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~ExternalDecayDriver()

ExternalDecayDriver::~ExternalDecayDriver ( )
default

Member Function Documentation

◆ decay() [1/2]

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

Definition at line 75 of file ExternalDecayDriver.cc.

75  {
76  if (!fIsInitialized)
77  return evt;
78 
79  if (fEvtGenInterface) {
80  evt = fEvtGenInterface->decay(evt);
81  if (!evt)
82  return nullptr;
83  }
84 
85  if (fTauolaInterface) {
86  evt = fTauolaInterface->decay(evt);
87  if (!evt)
88  return nullptr;
89  }
90 
91  if (fPhotosInterface) {
92  evt = fPhotosInterface->apply(evt);
93  if (!evt)
94  return nullptr;
95  }
96 
97  return evt;
98 }

References fEvtGenInterface, fIsInitialized, fPhotosInterface, and fTauolaInterface.

Referenced by decay().

◆ decay() [2/2]

HepMC::GenEvent * ExternalDecayDriver::decay ( HepMC::GenEvent evt,
lhef::LHEEvent lheEvent 
)

Definition at line 69 of file ExternalDecayDriver.cc.

69  {
70  if (fTauolaInterface)
71  fTauolaInterface->SetLHE(lheEvent);
72  return decay(evt);
73 }

References decay(), and fTauolaInterface.

◆ init()

void ExternalDecayDriver::init ( const edm::EventSetup es)

Definition at line 100 of file ExternalDecayDriver.cc.

100  {
101  if (fIsInitialized)
102  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();
108  i++)
109  fPDGs.push_back(*i);
110  }
111 
112  if (fEvtGenInterface) {
113  fEvtGenInterface->init();
114  for (std::vector<int>::const_iterator i = fEvtGenInterface->operatesOnParticles().begin();
115  i != fEvtGenInterface->operatesOnParticles().end();
116  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  if (fPhotosInterface) {
124  fPhotosInterface->init();
125  // for tauola++
126  if (fPhotosInterface) {
127  for (unsigned int iss = 0; iss < fPhotosInterface->specialSettings().size(); iss++) {
128  fSpecialSettings.push_back(fPhotosInterface->specialSettings()[iss]);
129  }
130  }
131  }
132 
133  fIsInitialized = true;
134 
135  return;
136 }

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

◆ operatesOnParticles()

const std::vector<int>& gen::ExternalDecayDriver::operatesOnParticles ( )
inline

Definition at line 36 of file ExternalDecayDriver.h.

36 { return fPDGs; }

References fPDGs.

◆ setRandomEngine()

void ExternalDecayDriver::setRandomEngine ( CLHEP::HepRandomEngine *  v)

Definition at line 147 of file ExternalDecayDriver.cc.

147  {
148  if (fTauolaInterface)
149  fTauolaInterface->setRandomEngine(v);
150  if (fEvtGenInterface)
151  fEvtGenInterface->setRandomEngine(v);
152  if (fPhotosInterface)
153  fPhotosInterface->setRandomEngine(v);
154 }

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

◆ sharedResources()

std::vector<std::string> const& gen::ExternalDecayDriver::sharedResources ( ) const
inline

Definition at line 45 of file ExternalDecayDriver.h.

45 { return exSharedResources; }

References exSharedResources.

◆ specialSettings()

const std::vector<std::string>& gen::ExternalDecayDriver::specialSettings ( )
inline

Definition at line 37 of file ExternalDecayDriver.h.

37 { return fSpecialSettings; }

References fSpecialSettings.

◆ statistics()

void ExternalDecayDriver::statistics ( ) const

Definition at line 138 of file ExternalDecayDriver.cc.

138  {
139  if (fTauolaInterface)
140  fTauolaInterface->statistics();
141  if (fPhotosInterface)
142  fPhotosInterface->statistics();
143  // similar for EvtGen if needed
144  return;
145 }

References fPhotosInterface, and fTauolaInterface.

Member Data Documentation

◆ exSharedResources

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

Definition at line 55 of file ExternalDecayDriver.h.

Referenced by ExternalDecayDriver(), and sharedResources().

◆ fEvtGenInterface

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

Definition at line 50 of file ExternalDecayDriver.h.

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

◆ fIsInitialized

bool gen::ExternalDecayDriver::fIsInitialized
private

Definition at line 48 of file ExternalDecayDriver.h.

Referenced by decay(), and init().

◆ fPDGs

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

Definition at line 52 of file ExternalDecayDriver.h.

Referenced by init(), and operatesOnParticles().

◆ fPhotosInterface

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

Definition at line 51 of file ExternalDecayDriver.h.

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

◆ fSpecialSettings

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

Definition at line 53 of file ExternalDecayDriver.h.

Referenced by init(), and specialSettings().

◆ fTauolaInterface

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

Definition at line 49 of file ExternalDecayDriver.h.

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

mps_fire.i
i
Definition: mps_fire.py:355
gen::ExternalDecayDriver::exSharedResources
std::vector< std::string > exSharedResources
Definition: ExternalDecayDriver.h:55
gen::FortranInstance::kFortranInstance
static const std::string kFortranInstance
Definition: FortranInstance.h:88
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
gen::ExternalDecayDriver::fPhotosInterface
std::unique_ptr< PhotosInterfaceBase > fPhotosInterface
Definition: ExternalDecayDriver.h:51
gen::ExternalDecayDriver::decay
HepMC::GenEvent * decay(HepMC::GenEvent *evt)
Definition: ExternalDecayDriver.cc:75
edm::SharedResourceNames::kPythia8
static const std::string kPythia8
Definition: SharedResourceNames.h:27
gen::ExternalDecayDriver::fEvtGenInterface
std::unique_ptr< EvtGenInterfaceBase > fEvtGenInterface
Definition: ExternalDecayDriver.h:50
edm::SharedResourceNames::kPhotos
static const std::string kPhotos
Definition: SharedResourceNames.h:28
gen::ExternalDecayDriver::fTauolaInterface
std::unique_ptr< TauolaInterfaceBase > fTauolaInterface
Definition: ExternalDecayDriver.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
gen::v
double v[5][pyjets_maxn]
Definition: Cascade2Hadronizer.cc:74
gen::ExternalDecayDriver::fIsInitialized
bool fIsInitialized
Definition: ExternalDecayDriver.h:48
get
#define get
edm::SharedResourceNames::kEvtGen
static const std::string kEvtGen
Definition: SharedResourceNames.h:30
gen::ExternalDecayDriver::fSpecialSettings
std::vector< std::string > fSpecialSettings
Definition: ExternalDecayDriver.h:53
edm::SharedResourceNames::kPythia6
static const std::string kPythia6
Definition: SharedResourceNames.h:26
gen::ExternalDecayDriver::fPDGs
std::vector< int > fPDGs
Definition: ExternalDecayDriver.h:52
edm::SharedResourceNames::kTauola
static const std::string kTauola
Definition: SharedResourceNames.h:29
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27