CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
gen::ConcurrentExternalDecayDriver Class Reference

#include <ConcurrentExternalDecayDriver.h>

Public Member Functions

 ConcurrentExternalDecayDriver (const edm::ParameterSet &)
 
HepMC::GenEventdecay (HepMC::GenEvent *evt)
 
HepMC::GenEventdecay (HepMC::GenEvent *evt, lhef::LHEEvent *lheEvent)
 
void init (const edm::EventSetup &)
 
const std::vector< int > & operatesOnParticles ()
 
void setRandomEngine (CLHEP::HepRandomEngine *)
 
const std::vector< std::string > & specialSettings ()
 
void statistics () const
 
 ~ConcurrentExternalDecayDriver ()
 

Private Attributes

bool fIsInitialized
 
std::vector< int > fPDGs
 
std::vector< std::string > fSpecialSettings
 

Detailed Description

Definition at line 28 of file ConcurrentExternalDecayDriver.h.

Constructor & Destructor Documentation

◆ ConcurrentExternalDecayDriver()

ConcurrentExternalDecayDriver::ConcurrentExternalDecayDriver ( const edm::ParameterSet pset)

Definition at line 23 of file ConcurrentExternalDecayDriver.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  throw cms::Exception("ThreadUnsafeDecayer") << "The decayer " << curSet << " is not thread-friendly.";
29  /*
30  if (curSet == "EvtGen") {
31  fEvtGenInterface = std::unique_ptr<EvtGenInterfaceBase>(
32  EvtGenFactory::get()->create("EvtGen", pset.getUntrackedParameter<ParameterSet>(curSet)));
33  exSharedResources.emplace_back(edm::SharedResourceNames::kEvtGen);
34  exSharedResources.emplace_back(edm::SharedResourceNames::kPythia6);
35  exSharedResources.emplace_back(gen::FortranInstance::kFortranInstance);
36  } else if (curSet == "EvtGen1" || curSet == "EvtGen130") {
37  fEvtGenInterface = std::unique_ptr<EvtGenInterfaceBase>(
38  EvtGenFactory::get()->create("EvtGen130", pset.getUntrackedParameter<ParameterSet>(curSet)));
39  exSharedResources.emplace_back(edm::SharedResourceNames::kEvtGen);
40  exSharedResources.emplace_back(edm::SharedResourceNames::kPythia8);
41  exSharedResources.emplace_back(edm::SharedResourceNames::kTauola);
42  exSharedResources.emplace_back(edm::SharedResourceNames::kPhotos);
43  exSharedResources.emplace_back(gen::FortranInstance::kFortranInstance);
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();
51  exSharedResources.emplace_back(edm::SharedResourceNames::kTauola);
52  exSharedResources.emplace_back(edm::SharedResourceNames::kPhotos);
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)));
57  exSharedResources.emplace_back(edm::SharedResourceNames::kPhotos);
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)));
63  exSharedResources.emplace_back(edm::SharedResourceNames::kPhotos);
64  }
65  }
66  */
67  }
68 }

References Exception, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~ConcurrentExternalDecayDriver()

ConcurrentExternalDecayDriver::~ConcurrentExternalDecayDriver ( )
default

Member Function Documentation

◆ decay() [1/2]

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

Definition at line 78 of file ConcurrentExternalDecayDriver.cc.

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

References fIsInitialized.

Referenced by decay().

◆ decay() [2/2]

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

Definition at line 72 of file ConcurrentExternalDecayDriver.cc.

72  {
73  /* if (fTauolaInterface)
74  fTauolaInterface->SetLHE(lheEvent); */
75  return decay(evt);
76 }

References decay().

◆ init()

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

Definition at line 103 of file ConcurrentExternalDecayDriver.cc.

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

References fIsInitialized.

◆ operatesOnParticles()

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

Definition at line 36 of file ConcurrentExternalDecayDriver.h.

36 { return fPDGs; }

References fPDGs.

◆ setRandomEngine()

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

Definition at line 152 of file ConcurrentExternalDecayDriver.cc.

152  {
153  /*
154  if (fTauolaInterface)
155  fTauolaInterface->setRandomEngine(v);
156  if (fEvtGenInterface)
157  fEvtGenInterface->setRandomEngine(v);
158  if (fPhotosInterface)
159  fPhotosInterface->setRandomEngine(v);
160  */
161 }

◆ specialSettings()

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

Definition at line 37 of file ConcurrentExternalDecayDriver.h.

37 { return fSpecialSettings; }

References fSpecialSettings.

◆ statistics()

void ConcurrentExternalDecayDriver::statistics ( ) const

Definition at line 142 of file ConcurrentExternalDecayDriver.cc.

142  {
143  /* if (fTauolaInterface)
144  fTauolaInterface->statistics();
145  if (fPhotosInterface)
146  fPhotosInterface->statistics();
147  */
148  // similar for EvtGen if needed
149  return;
150 }

Member Data Documentation

◆ fIsInitialized

bool gen::ConcurrentExternalDecayDriver::fIsInitialized
private

Definition at line 47 of file ConcurrentExternalDecayDriver.h.

Referenced by decay(), and init().

◆ fPDGs

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

Definition at line 51 of file ConcurrentExternalDecayDriver.h.

Referenced by operatesOnParticles().

◆ fSpecialSettings

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

Definition at line 52 of file ConcurrentExternalDecayDriver.h.

Referenced by specialSettings().

gen::ConcurrentExternalDecayDriver::fPDGs
std::vector< int > fPDGs
Definition: ConcurrentExternalDecayDriver.h:51
gen::ConcurrentExternalDecayDriver::fIsInitialized
bool fIsInitialized
Definition: ConcurrentExternalDecayDriver.h:47
gen::ConcurrentExternalDecayDriver::fSpecialSettings
std::vector< std::string > fSpecialSettings
Definition: ConcurrentExternalDecayDriver.h:52
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Exception
Definition: hltDiff.cc:245
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
gen::ConcurrentExternalDecayDriver::decay
HepMC::GenEvent * decay(HepMC::GenEvent *evt)
Definition: ConcurrentExternalDecayDriver.cc:78