303 "convertPythiaCodes",
true);
305 std::getenv(
"PYTHIA8DATA");
306 if (pythiaDir.empty()) {
308 <<
"EvtGenInterface::init() PYTHIA8DATA not defined. Terminating program ";
312 bool useEvtGenRandom(
true);
315 EvtExternalGenList genList(convertPythiaCodes, pythiaDir,
photonType, useEvtGenRandom);
316 EvtAbsRadCorr* radCorrEngine =
nullptr;
318 radCorrEngine = genList.getPhotosModel();
319 std::list<EvtDecayBase*> extraModels = genList.getListOfModels();
320 std::list<EvtDecayBase*> myExtraModels;
321 for (
unsigned int i = 0;
i < extraModels.size();
i++) {
322 std::list<EvtDecayBase*>::iterator
it = extraModels.begin();
324 TString
name = (*it)->getName();
325 if (
name.Contains(
"PYTHIA") && usePythia)
326 myExtraModels.push_back(*
it);
327 if (
name.Contains(
"TAUOLA") && useTauola)
328 myExtraModels.push_back(*
it);
334 std::list<EvtDecayBase*> userModels = userList.
getUserModels();
335 for (
unsigned int i = 0;
i < userModels.size();
i++) {
336 std::list<EvtDecayBase*>::iterator
it = userModels.begin();
338 TString
name = (*it)->getName();
339 edm::LogInfo(
"EvtGenInterface::~EvtGenInterface") <<
"Adding user model: " <<
name;
340 myExtraModels.push_back(*
it);
346 throw cms::Exception(
"Configuration") <<
"EvtGenProducer requires B_Mixing to be 0 (coherent) or 1 (incoherent) \n" 347 "Please fix this in your configuration.";
353 decay_table.fullPath().c_str(), pdt.fullPath().c_str(),
the_engine, radCorrEngine, &myExtraModels,
BmixingOption);
357 std::vector<std::string> user_decays =
fPSet->
getParameter<std::vector<std::string> >(
"user_decay_file");
358 for (
unsigned int i = 0;
i < user_decays.size();
i++) {
360 m_EvtGen->readUDecay(user_decay.fullPath().c_str());
365 std::vector<std::string> user_decay_lines =
fPSet->
getParameter<std::vector<std::string> >(
"user_decay_embedded");
366 char user_decay_tmp[] =
"user_decay_tmpfileXXXXXX";
367 int tmp_creation = mkstemp(user_decay_tmp);
368 FILE* tmpf = std::fopen(user_decay_tmp,
"w");
369 if (!tmpf || (tmp_creation == -1)) {
371 <<
"EvtGenInterface::init() fails when trying to open a temporary file for embedded user.dec. Terminating " 375 for (
unsigned int i = 0;
i < user_decay_lines.size();
i++) {
376 user_decay_lines.at(
i) +=
"\n";
377 std::fputs(user_decay_lines.at(
i).c_str(), tmpf);
380 m_EvtGen->readUDecay(user_decay_tmp);
385 std::vector<int> tmpPIDs =
fPSet->
getParameter<std::vector<int> >(
"operates_on_particles");
387 bool goodinput =
false;
388 if (!tmpPIDs.empty()) {
389 if (tmpPIDs.size() == 1 && tmpPIDs[0] == 0)
403 for (
unsigned int i = 0;
i <
m_PDGs.size();
i++) {
405 <<
"EvtGenInterface::init() Particles to Operate on: " <<
m_PDGs[
i];
413 <<
"EvtGenProducer requires that the particles_to_polarize and particle_polarization\n" 414 "vectors be the same size. Please fix this in your configuration.";
416 for (
unsigned int ndx = 0; ndx <
polarize_ids.size(); ndx++) {
419 <<
"EvtGenProducer error: particle polarizations must be in the range -1 < P < 1";
426 std::vector<std::string> forced_names =
fPSet->
getParameter<std::vector<std::string> >(
"list_forced_decays");
427 for (
unsigned int i = 0;
i < forced_names.size();
i++) {
429 if (
found.getId() == -1)
430 throw cms::Exception(
"Configuration") <<
"name in part list for ignored decays not found: " << forced_names[
i];
432 throw cms::Exception(
"Configuration") <<
"name of ignored decays is not an alias: " << forced_names[
i];
438 <<
"Number of Forced Paricles is: " <<
forced_pdgids.size() << std::endl;
edm::ParameterSet * fPSet
T getParameter(std::string const &) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< int > polarize_ids
Log< level::Error, false > LogError
std::vector< int > forced_pdgids
T getUntrackedParameter(std::string const &, T const &) const
std::map< int, float > polarizations
std::vector< EvtId > forced_id
std::vector< double > polarize_pol
Log< level::Info, false > LogInfo
std::vector< int > m_PDGs
static unsigned int getId()
myEvtRandomEngine * the_engine
std::vector< std::string > fSpecialSettings
std::list< EvtDecayBase * > getUserModels()
std::vector< int > ignore_pdgids