Main Page
Namespaces
Classes
Package Documentation
GeneratorInterface
ExternalDecays
src
ConcurrentExternalDecayDriver.cc
Go to the documentation of this file.
1
#include "
GeneratorInterface/ExternalDecays/interface/ConcurrentExternalDecayDriver.h
"
2
3
#include "
GeneratorInterface/Core/interface/FortranInstance.h
"
4
#include "
GeneratorInterface/EvtGenInterface/interface/EvtGenFactory.h
"
5
#include "
GeneratorInterface/EvtGenInterface/interface/EvtGenInterfaceBase.h
"
6
#include "
GeneratorInterface/TauolaInterface/interface/TauolaFactory.h
"
7
#include "
GeneratorInterface/TauolaInterface/interface/TauolaInterfaceBase.h
"
8
#include "
GeneratorInterface/PhotosInterface/interface/PhotosFactory.h
"
9
#include "
GeneratorInterface/PhotosInterface/interface/PhotosInterfaceBase.h
"
10
#include "HepMC/GenEvent.h"
11
#include "
FWCore/Concurrency/interface/SharedResourceNames.h
"
12
// LHE Run
13
#include "
SimDataFormats/GeneratorProducts/interface/LHERunInfoProduct.h
"
14
#include "
GeneratorInterface/LHEInterface/interface/LHERunInfo.h
"
15
16
// LHE Event
17
#include "
SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h
"
18
#include "
GeneratorInterface/LHEInterface/interface/LHEEvent.h
"
19
20
using namespace
gen
;
21
using namespace
edm
;
22
23
ConcurrentExternalDecayDriver::ConcurrentExternalDecayDriver
(
const
ParameterSet
&
pset
) : 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
}
69
70
ConcurrentExternalDecayDriver::~ConcurrentExternalDecayDriver
() =
default
;
71
72
HepMC::GenEvent
*
ConcurrentExternalDecayDriver::decay
(
HepMC::GenEvent
* evt,
lhef::LHEEvent
* lheEvent) {
73
/* if (fTauolaInterface)
74
fTauolaInterface->SetLHE(lheEvent); */
75
return
decay
(evt);
76
}
77
78
HepMC::GenEvent
*
ConcurrentExternalDecayDriver::decay
(
HepMC::GenEvent
* evt) {
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
}
102
103
void
ConcurrentExternalDecayDriver::init
(
const
edm::EventSetup
& es) {
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
}
141
142
void
ConcurrentExternalDecayDriver::statistics
()
const
{
143
/* if (fTauolaInterface)
144
fTauolaInterface->statistics();
145
if (fPhotosInterface)
146
fPhotosInterface->statistics();
147
*/
148
// similar for EvtGen if needed
149
return
;
150
}
151
152
void
ConcurrentExternalDecayDriver::setRandomEngine
(CLHEP::HepRandomEngine*
v
) {
153
/*
154
if (fTauolaInterface)
155
fTauolaInterface->setRandomEngine(v);
156
if (fEvtGenInterface)
157
fEvtGenInterface->setRandomEngine(v);
158
if (fPhotosInterface)
159
fPhotosInterface->setRandomEngine(v);
160
*/
161
}
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Exception
Definition:
hltDiff.cc:292
gen::ConcurrentExternalDecayDriver::statistics
void statistics() const
Definition:
ConcurrentExternalDecayDriver.cc:142
lhef::LHEEvent
Definition:
LHEEvent.h:23
funct::false
false
Definition:
Factorize.h:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
TauolaInterfaceBase.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
LHERunInfoProduct.h
gen::ConcurrentExternalDecayDriver::~ConcurrentExternalDecayDriver
~ConcurrentExternalDecayDriver()
TauolaFactory.h
gen::v
double v[5][pyjets_maxn]
Definition:
Cascade2Hadronizer.cc:80
FortranInstance.h
PhotosInterfaceBase.h
SharedResourceNames.h
gen::ConcurrentExternalDecayDriver::ConcurrentExternalDecayDriver
ConcurrentExternalDecayDriver(const edm::ParameterSet &)
Definition:
ConcurrentExternalDecayDriver.cc:23
HepMC::GenEvent
Definition:
hepmc_rootio.cc:9
PhotosFactory.h
gen::ConcurrentExternalDecayDriver::decay
HepMC::GenEvent * decay(HepMC::GenEvent *evt)
Definition:
ConcurrentExternalDecayDriver.cc:78
EvtGenInterfaceBase.h
edm::EventSetup
Definition:
EventSetup.h:57
gen::ConcurrentExternalDecayDriver::init
void init(const edm::EventSetup &)
Definition:
ConcurrentExternalDecayDriver.cc:103
gen
Definition:
PythiaDecays.h:13
LHEEvent.h
EvtGenFactory.h
gen::ConcurrentExternalDecayDriver::fIsInitialized
bool fIsInitialized
Definition:
ConcurrentExternalDecayDriver.h:47
gen::ConcurrentExternalDecayDriver::setRandomEngine
void setRandomEngine(CLHEP::HepRandomEngine *)
Definition:
ConcurrentExternalDecayDriver.cc:152
ConcurrentExternalDecayDriver.h
edm
HLT enums.
Definition:
AlignableModifier.h:17
LHEEventProduct.h
LHERunInfo.h
edm::ParameterSet
Definition:
ParameterSet.h:36
Generated for CMSSW Reference Manual by
1.8.11