305 edm::LogError(
"EvtGenInterface::~EvtGenInterface") <<
"EvtGenInterface::init() PYTHIA8DATA not defined. Terminating program ";
309 bool useEvtGenRandom(
true);
312 EvtExternalGenList genList(convertPythiaCodes, pythiaDir,
photonType, useEvtGenRandom);
313 EvtAbsRadCorr* radCorrEngine=0;
314 if(usePhotos) radCorrEngine = genList.getPhotosModel();
315 std::list<EvtDecayBase*> extraModels = genList.getListOfModels();
316 std::list<EvtDecayBase*> myExtraModels;
317 for(
unsigned int i=0;
i<extraModels.size();
i++){
318 std::list<EvtDecayBase*>::iterator it = extraModels.begin();
320 TString
name=(*it)->getName();
321 if(name.Contains(
"PYTHIA") && usePythia) myExtraModels.push_back(*it);
322 if(name.Contains(
"TAUOLA") && useTauola) myExtraModels.push_back(*it);
328 std::list<EvtDecayBase*> userModels = userList.
getUserModels();
329 for(
unsigned int i=0;
i<userModels.size();
i++){
330 std::list<EvtDecayBase*>::iterator it = userModels.begin();
332 TString name=(*it)->getName();
333 edm::LogInfo(
"EvtGenInterface::~EvtGenInterface") <<
"Adding user model: "<<
name;
334 myExtraModels.push_back(*it);
342 throw cms::Exception(
"Configuration") <<
"EvtGenProducer requires B_Mixing to be 0 (coherent) or 1 (incoherent) \n"
343 "Please fix this in your configuration.";
352 std::vector<std::string> user_decays =
fPSet->
getParameter<std::vector<std::string> >(
"user_decay_file");
353 for(
unsigned int i=0;
i<user_decays.size();
i++){
355 m_EvtGen->readUDecay(user_decay.fullPath().c_str());
360 std::vector<std::string> user_decay_lines =
fPSet->
getParameter<std::vector<std::string> >(
"user_decay_embedded");
362 FILE* tmpf = std::fopen(user_decay_tmp.c_str(),
"w");
364 edm::LogError(
"EvtGenInterface::~EvtGenInterface") <<
"EvtGenInterface::init() fails when trying to open a temporary file for embedded user.dec. Terminating program ";
367 for (
unsigned int i=0;
i<user_decay_lines.size();
i++) {
368 user_decay_lines.at(
i) +=
"\n";
369 std::fputs(user_decay_lines.at(
i).c_str(), tmpf);
372 m_EvtGen->readUDecay(user_decay_tmp.c_str());
377 std::vector<int> tmpPIDs =
fPSet->
getParameter< std::vector<int> >(
"operates_on_particles");
379 bool goodinput=
false;
380 if(tmpPIDs.size()>0){
if(tmpPIDs.size()==1 && tmpPIDs[0]==0) goodinput=
false;
383 else{goodinput=
false;}
384 if(goodinput)
m_PDGs = tmpPIDs;
389 for(
unsigned int i=0;
i<
m_PDGs.size();
i++){
390 edm::LogInfo(
"EvtGenInterface::~EvtGenInterface") <<
"EvtGenInterface::init() Particles to Operate on: " <<
m_PDGs[
i];
397 throw cms::Exception(
"Configuration") <<
"EvtGenProducer requires that the particles_to_polarize and particle_polarization\n"
398 "vectors be the same size. Please fix this in your configuration.";
400 for (
unsigned int ndx = 0; ndx <
polarize_ids.size(); ndx++) {
402 throw cms::Exception(
"Configuration") <<
"EvtGenProducer error: particle polarizations must be in the range -1 < P < 1";
409 std::vector<std::string> forced_names =
fPSet->
getParameter< std::vector<std::string> >(
"list_forced_decays");
410 for(
unsigned int i=0;
i<forced_names.size();
i++){
412 if(found.getId() == -1)
throw cms::Exception(
"Configuration") <<
"name in part list for ignored decays not found: " << forced_names[
i];
413 if(found.getId() == found.getAlias())
throw cms::Exception(
"Configuration") <<
"name of ignored decays is not an alias: " << forced_names[
i];
418 edm::LogInfo(
"EvtGenInterface::~EvtGenInterface") <<
"Number of Forced Paricles is: " <<
forced_pdgids.size() << std::endl;
T getParameter(std::string const &) const
edm::ParameterSet * fPSet
T getUntrackedParameter(std::string const &, T const &) const
static unsigned int getId(void)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< int > polarize_ids
std::vector< int > forced_pdgids
std::map< int, float > polarizations
std::vector< EvtId > forced_id
std::vector< double > polarize_pol
std::vector< int > m_PDGs
myEvtRandomEngine * the_engine
std::vector< std::string > fSpecialSettings
std::list< EvtDecayBase * > getUserModels()
std::vector< int > ignore_pdgids