301 std::cout <<
"EvtGenInterface::init() PYTHIA8DATA not defined. Terminating program " << std::endl;
exit(0);
304 bool useEvtGenRandom(
true);
307 EvtExternalGenList genList(convertPythiaCodes, pythiaDir,
photonType, useEvtGenRandom);
308 EvtAbsRadCorr* radCorrEngine=0;
309 if(usePhotos) radCorrEngine = genList.getPhotosModel();
310 std::list<EvtDecayBase*> extraModels = genList.getListOfModels();
311 std::list<EvtDecayBase*> myExtraModels;
312 for(
unsigned int i=0;
i<extraModels.size();
i++){
313 std::list<EvtDecayBase*>::iterator it = extraModels.begin();
315 TString
name=(*it)->getName();
316 if(name.Contains(
"PYTHIA") && usePythia) myExtraModels.push_back(*it);
317 if(name.Contains(
"TAUOLA") && useTauola) myExtraModels.push_back(*it);
323 std::list<EvtDecayBase*> userModels = userList.
getUserModels();
324 for(
unsigned int i=0;
i<userModels.size();
i++){
325 std::list<EvtDecayBase*>::iterator it = userModels.begin();
327 TString name=(*it)->getName();
328 std::cout<<
" Adding user model: "<<name<<std::endl;
329 myExtraModels.push_back(*it);
337 throw cms::Exception(
"Configuration") <<
"EvtGenProducer requires B_Mixing to be 0 (coherent) or 1 (incoherent) \n"
338 "Please fix this in your configuration.";
347 std::vector<std::string> user_decays =
fPSet->
getParameter<std::vector<std::string> >(
"user_decay_file");
348 for(
unsigned int i=0;
i<user_decays.size();
i++){
350 m_EvtGen->readUDecay(user_decay.fullPath().c_str());
356 std::vector<int> tmpPIDs =
fPSet->
getParameter< std::vector<int> >(
"operates_on_particles");
358 bool goodinput=
false;
359 if(tmpPIDs.size()>0){
if(tmpPIDs.size()==1 && tmpPIDs[0]==0) goodinput=
false;}
360 else{goodinput=
false;}
361 if(goodinput)
m_PDGs = tmpPIDs;
368 for(
unsigned int i=0;
i<
m_PDGs.size();
i++){
369 std::cout <<
"EvtGenInterface::init() Particles to Operate on: " <<
m_PDGs[
i] << std::endl;
376 throw cms::Exception(
"Configuration") <<
"EvtGenProducer requires that the particles_to_polarize and particle_polarization\n"
377 "vectors be the same size. Please fix this in your configuration.";
379 for (
unsigned int ndx = 0; ndx <
polarize_ids.size(); ndx++) {
381 throw cms::Exception(
"Configuration") <<
"EvtGenProducer error: particle polarizations must be in the range -1 < P < 1";
388 std::vector<std::string> forced_names =
fPSet->
getParameter< std::vector<std::string> >(
"list_forced_decays");
389 for(
unsigned int i=0;
i<forced_names.size();
i++){
391 if(found.getId() == -1)
throw cms::Exception(
"Configuration") <<
"name in part list for ignored decays not found: " << forced_names[
i];
392 if(found.getId() == found.getAlias())
throw cms::Exception(
"Configuration") <<
"name of ignored decays is not an alias: " << forced_names[
i];
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::list< EvtDecayBase * > getUserModels()
std::vector< int > ignore_pdgids