Definition at line 38 of file SherpaHadronizer.cc.
◆ SherpaHadronizer()
Definition at line 106 of file SherpaHadronizer.cc.
110 if (!
params.exists(
"SherpaProcess"))
114 if (!
params.exists(
"SherpaPath"))
118 if (!
params.exists(
"SherpaPathPiece"))
122 if (!
params.exists(
"SherpaResultDir"))
126 if (!
params.exists(
"SherpaDefaultWeight"))
130 if (!
params.exists(
"maxEventsToPrint"))
142 if (!
params.exists(
"SherpaWeightsBlock")) {
147 if (WeightsBlock.
exists(
"SherpaWeights"))
150 throw cms::Exception(
"SherpaInterface") <<
"SherpaWeights does not exists in SherpaWeightsBlock" << std::endl;
151 if (WeightsBlock.
exists(
"SherpaVariationWeights"))
155 <<
"SherpaVariationWeights does not exists in SherpaWeightsBlock" << std::endl;
156 edm::LogVerbatim(
"SherpaHadronizer") <<
"SherpaHadronizer will try rearrange the event weights according to "
157 "SherpaWeights and SherpaVariationWeights";
161 int retval = Fetcher.Fetch();
163 throw cms::Exception(
"SherpaInterface") <<
"SherpaHadronizer: Preparation of Sherpack failed ... ";
169 for (
unsigned i = 0;
i < setNames.size(); ++
i) {
172 edm::LogVerbatim(
"SherpaHadronizer") <<
"Write Sherpa parameter set " << setNames[
i] <<
" to " << setNames[
i]
175 std::ofstream os(datfile.c_str());
177 for (std::vector<std::string>::const_iterator itPar = pars.begin(); itPar != pars.end(); ++itPar) {
178 os << (*itPar) << std::endl;
References arguments, Exception, edm::ParameterSet::exists(), spf::SherpackFetcher::Fetch(), edm::ParameterSet::getParameter(), mps_fire::i, isInitialized, maxEventsToPrint, CalibrationSummaryClient_cfi::params, rearrangeWeights, SherpaDefaultWeight, SherpaParameterSet, SherpaPath, SherpaPathPiece, SherpaProcess, SherpaResultDir, AlCaHLTBitMon_QueryRunRegistry::string, variationweightlist, and weightlist.
◆ ~SherpaHadronizer()
SherpaHadronizer::~SherpaHadronizer |
( |
| ) |
|
|
override |
◆ classname()
const char* SherpaHadronizer::classname |
( |
| ) |
const |
|
inline |
◆ decay()
bool SherpaHadronizer::decay |
( |
| ) |
|
◆ declareSpecialSettings()
bool SherpaHadronizer::declareSpecialSettings |
( |
const std::vector< std::string > & |
| ) |
|
|
inline |
◆ declareStableParticles()
bool SherpaHadronizer::declareStableParticles |
( |
const std::vector< int > & |
pdgIds | ) |
|
◆ doSetRandomEngine()
void SherpaHadronizer::doSetRandomEngine |
( |
CLHEP::HepRandomEngine * |
v | ) |
|
|
overrideprivatevirtual |
◆ finalizeEvent()
void SherpaHadronizer::finalizeEvent |
( |
| ) |
|
◆ generatePartonsAndHadronize()
bool SherpaHadronizer::generatePartonsAndHadronize |
( |
| ) |
|
Definition at line 242 of file SherpaHadronizer.cc.
246 bool gen_event =
true;
247 while ((itry < 3) && gen_event) {
253 std::cerr <<
"Exception from Generator->GenerateOneEvent() catch. Call # " << itry <<
" for this event\n";
258 auto evt = std::make_unique<HepMC::GenEvent>();
270 bool unweighted =
false;
271 double weight_normalization = -1;
272 if (ATOOLS::ToType<int>(ATOOLS::rpa->
gen.Variable(
"EVENT_GENERATION_MODE")) == 1) {
273 if (evt->weights().size() > 2) {
275 weight_normalization = evt->weights()[2];
278 <<
"Requested unweighted production. Missing normalization weight." << std::endl;
283 std::vector<double> newWeights;
286 if (evt->weights().has_key(
i)) {
287 newWeights.push_back(evt->weights()[
i]);
290 <<
"Missing weights! Key " <<
i <<
" not found, please check the weight definition!" << std::endl;
294 if (evt->weights().has_key(
i)) {
296 newWeights.push_back(evt->weights()[
i] / weight_normalization);
298 newWeights.push_back(evt->weights()[
i]);
302 <<
"Missing weights! Key " <<
i <<
" not found, please check the weight definition!" << std::endl;
307 evt->weights().clear();
308 for (
auto &elem : newWeights) {
309 evt->weights().push_back(elem);
314 evt->weights()[0] /= weight_normalization;
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, Exception, mps_fire::i, eostools::move(), rearrangeWeights, gen::BaseHadronizer::resetEvent(), variationweightlist, and weightlist.
◆ getGenLumiInfoHeader()
std::unique_ptr< GenLumiInfoHeader > SherpaHadronizer::getGenLumiInfoHeader |
( |
| ) |
const |
|
overridevirtual |
◆ initializeForInternalPartons()
bool SherpaHadronizer::initializeForInternalPartons |
( |
| ) |
|
◆ readSettings()
bool SherpaHadronizer::readSettings |
( |
int |
| ) |
|
|
inline |
◆ residualDecay()
bool SherpaHadronizer::residualDecay |
( |
| ) |
|
◆ statistics()
void SherpaHadronizer::statistics |
( |
| ) |
|
◆ arguments
std::vector<std::string> SherpaHadronizer::arguments |
|
private |
◆ Generator
SHERPA::Sherpa* SherpaHadronizer::Generator = new SHERPA::Sherpa() |
|
private |
◆ isInitialized
bool SherpaHadronizer::isInitialized |
|
private |
◆ isRNGinitialized
bool SherpaHadronizer::isRNGinitialized |
|
private |
◆ maxEventsToPrint
unsigned int SherpaHadronizer::maxEventsToPrint |
|
private |
◆ rearrangeWeights
bool SherpaHadronizer::rearrangeWeights |
◆ SherpaChecksum
std::string SherpaHadronizer::SherpaChecksum |
|
private |
◆ SherpaDefaultWeight
double SherpaHadronizer::SherpaDefaultWeight |
|
private |
◆ SherpaParameterSet
◆ SherpaPath
std::string SherpaHadronizer::SherpaPath |
|
private |
◆ SherpaPathPiece
std::string SherpaHadronizer::SherpaPathPiece |
|
private |
◆ SherpaProcess
std::string SherpaHadronizer::SherpaProcess |
|
private |
◆ SherpaResultDir
std::string SherpaHadronizer::SherpaResultDir |
|
private |
◆ variationweightlist
std::vector<std::string> SherpaHadronizer::variationweightlist |
|
private |
◆ weightlist
std::vector<std::string> SherpaHadronizer::weightlist |
|
private |