CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
gen::EvtGenInterface Class Reference

#include <EvtGenInterface.h>

Inheritance diagram for gen::EvtGenInterface:
gen::EvtGenInterfaceBase

Public Member Functions

HepMC::GenEventdecay (HepMC::GenEvent *) override
 
 EvtGenInterface (const edm::ParameterSet &)
 
void init () override
 
const std::vector< int > & operatesOnParticles () override
 
void setRandomEngine (CLHEP::HepRandomEngine *v) override
 
 ~EvtGenInterface () override
 
- Public Member Functions inherited from gen::EvtGenInterfaceBase
 EvtGenInterfaceBase ()
 
virtual void SetPhotosDecayRandomEngine (CLHEP::HepRandomEngine *decayRandomEngine)
 
virtual const std::vector< std::string > & specialSettings ()
 
virtual ~EvtGenInterfaceBase ()
 

Static Public Member Functions

static double flat ()
 

Private Member Functions

bool addToHepMC (HepMC::GenParticle *partHep, const EvtId &idEvt, HepMC::GenEvent *theEvent, bool del_daug)
 
bool findLastinChain (HepMC::GenParticle *&p)
 
void go_through_daughters (EvtParticle *part)
 
bool hasnoDaughter (HepMC::GenParticle *p)
 
void SetDefault_m_PDGs ()
 
void update_particles (HepMC::GenParticle *partHep, HepMC::GenEvent *theEvent, HepMC::GenParticle *p)
 

Private Attributes

int BmixingOption = 1
 
std::vector< EvtId > forced_id
 
std::vector< int > forced_pdgids
 
edm::ParameterSetfPSet
 
std::vector< int > ignore_pdgids
 
EvtGen * m_EvtGen
 
std::map< int, float > polarizations
 
std::vector< int > polarize_ids
 
std::vector< double > polarize_pol
 
myEvtRandomEnginethe_engine
 

Static Private Attributes

static CLHEP::HepRandomEngine * fRandomEngine
 

Additional Inherited Members

- Protected Attributes inherited from gen::EvtGenInterfaceBase
std::vector< std::string > fSpecialSettings
 
std::vector< int > m_PDGs
 

Detailed Description

Definition at line 37 of file EvtGenInterface.h.

Constructor & Destructor Documentation

◆ EvtGenInterface()

EvtGenInterface::EvtGenInterface ( const edm::ParameterSet pset)

Definition at line 58 of file EvtGenInterface.cc.

58  {
59  fPSet = new ParameterSet(pset);
60  the_engine = new myEvtRandomEngine(nullptr);
61 }

References muonDTDigis_cfi::pset.

◆ ~EvtGenInterface()

EvtGenInterface::~EvtGenInterface ( )
override

Definition at line 290 of file EvtGenInterface.cc.

290 {}

Member Function Documentation

◆ addToHepMC()

bool EvtGenInterface::addToHepMC ( HepMC::GenParticle *  partHep,
const EvtId &  idEvt,
HepMC::GenEvent theEvent,
bool  del_daug 
)
private

Definition at line 541 of file EvtGenInterface.cc.

544  {
545  // Set up the parent particle from the HepMC GenEvent tree.
546  //EvtVector4R pInit(EvtPDL::getMass(idEvt),partHep->momentum().px(),partHep->momentum().py(),partHep->momentum().pz());
547  EvtVector4R pInit(
548  partHep->momentum().e(), partHep->momentum().px(), partHep->momentum().py(), partHep->momentum().pz());
549  EvtParticle* parent = EvtParticleFactory::particleFactory(idEvt, pInit);
550  HepMC::FourVector posHep = (partHep->production_vertex())->position();
551  EvtVector4R vInit(posHep.t(), posHep.x(), posHep.y(), posHep.z());
552  // Reset polarization if requested....
553  if (EvtPDL::getSpinType(idEvt) == EvtSpinType::DIRAC && polarizations.count(partHep->pdg_id()) > 0) {
554  const HepMC::FourVector& momHep = partHep->momentum();
555  EvtVector4R momEvt;
556  momEvt.set(momHep.t(), momHep.x(), momHep.y(), momHep.z());
557  // Particle is spin 1/2, so we can polarize it. Check polarizations map for particle, grab its polarization if it exists
558  // and make the spin density matrix
559  float pol = polarizations.find(partHep->pdg_id())->second;
560  GlobalVector pPart(momHep.x(), momHep.y(), momHep.z());
561  GlobalVector zHat(0., 0., 1.);
562  GlobalVector zCrossP = zHat.cross(pPart);
563  GlobalVector polVec = pol * zCrossP.unit();
564  EvtSpinDensity theSpinDensity;
565  theSpinDensity.setDim(2);
566  theSpinDensity.set(0, 0, EvtComplex(1. / 2. + polVec.z() / 2., 0.));
567  theSpinDensity.set(0, 1, EvtComplex(polVec.x() / 2., -polVec.y() / 2.));
568  theSpinDensity.set(1, 0, EvtComplex(polVec.x() / 2., polVec.y() / 2.));
569  theSpinDensity.set(1, 1, EvtComplex(1. / 2. - polVec.z() / 2., 0.));
570  parent->setSpinDensityForwardHelicityBasis(theSpinDensity);
571  }
572  if (parent) {
573  // Generate the event
574  m_EvtGen->generateDecay(parent);
575  if (del_daug)
576  go_through_daughters(parent); // will delete all daugthers which are listed as forced, to allow decay them later
577 
578  // create HepMCTree
579  EvtHepMCEvent evtHepMCEvent;
580  evtHepMCEvent.constructEvent(parent, vInit);
581  HepMC::GenEvent* evtGenHepMCTree = evtHepMCEvent.getEvent();
582  parent->deleteTree();
583 
584  // update the event using a recursive function
585  if (!evtGenHepMCTree->particles_empty())
586  update_particles(partHep, theEvent, (*evtGenHepMCTree->particles_begin()));
587 
588  } else {
589  // this should never hapend, in such case, speak out.
590  return false;
591  }
592  return true;
593 }

References Vector3DBase< T, FrameTag >::cross(), class-composition::parent, position, edm::second(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ decay()

HepMC::GenEvent * EvtGenInterface::decay ( HepMC::GenEvent evt)
overridevirtual

Reimplemented from gen::EvtGenInterfaceBase.

Definition at line 456 of file EvtGenInterface.cc.

456  {
457  if (the_engine->engine() == nullptr) {
459  << "The EvtGen code attempted to use a random number engine while\n"
460  << "the engine pointer was null in EvtGenInterface::decay. This might\n"
461  << "mean that the code was modified to generate a random number outside\n"
462  << "the event and beginLuminosityBlock methods, which is not allowed.\n";
463  }
464  CLHEP::RandFlat m_flat(*the_engine->engine(), 0., 1.);
465 
466  // decay all request unforced particles and store the forced decays to later decay one per event
467  unsigned int nisforced = 0;
468  std::vector<std::vector<HepMC::GenParticle*> > forcedparticles;
469  for (unsigned int i = 0; i < forced_pdgids.size(); i++)
470  forcedparticles.push_back(std::vector<HepMC::GenParticle*>());
471 
472  // notice this is a dynamic loop
473  for (HepMC::GenEvent::particle_const_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
474  if ((*p)->status() == 1) { // all particles to be decays are set to status 1 by generator.hadronizer
475  int idHep = (*p)->pdg_id();
476  bool isignore = false;
477  for (unsigned int i = 0; i < ignore_pdgids.size(); i++) {
478  if (idHep == ignore_pdgids[i])
479  isignore = true;
480  }
481  if (!isignore) {
482  bool isforced = false;
483  for (unsigned int i = 0; i < forced_pdgids.size(); i++) {
484  if (idHep == forced_pdgids[i]) {
485  forcedparticles.at(i).push_back(*p); // storing and counting forced decays.
486  nisforced++;
487  isforced = true;
488  break;
489  }
490  }
491  bool isDefaultEvtGen = false;
492  for (unsigned int i = 0; i < m_PDGs.size(); i++) {
493  if (abs(idHep) == abs(m_PDGs[i])) {
494  isDefaultEvtGen = true;
495  break;
496  }
497  }
498  EvtId idEvt = EvtPDL::evtIdFromStdHep(idHep);
499  int ipart = idEvt.getId();
500  EvtDecayTable* evtDecayTable = EvtDecayTable::getInstance();
501  if (!isforced && isDefaultEvtGen && ipart != -1 && evtDecayTable->getNMode(ipart) != 0) {
502  addToHepMC(*p, idEvt, evt, true); // generate decay and remove daugther if they are forced
503  }
504  }
505  }
506  }
507 
508  // decay all forced particles (only 1/event is forced)... with no mixing allowed
509  unsigned int which = (unsigned int)(nisforced * flat());
510  if (which == nisforced && nisforced > 0)
511  which = nisforced - 1;
512 
513  unsigned int idx = 0;
514  for (unsigned int i = 0; i < forcedparticles.size(); i++) {
515  for (unsigned int j = 0; j < forcedparticles.at(i).size(); j++) {
516  EvtId idEvt = EvtPDL::evtIdFromStdHep(forcedparticles.at(i).at(j)->pdg_id()); // "standard" decay Id
517  if (idx == which) {
518  idEvt = forced_id[i]; // force decay Id
519  edm::LogInfo("EvtGenInterface::decay ")
520  << EvtPDL::getStdHep(idEvt) << " will force to decay " << idx + 1 << " out of " << nisforced << std::endl;
521  }
522  bool decayed = false;
523  while (!decayed) {
524  decayed = addToHepMC(forcedparticles.at(i).at(j), idEvt, evt, false);
525  }
526  idx++;
527  }
528  }
529 
530  // add code to ensure all particles have an end vertex and if they are undecayed with no end vertes set to status 1
531  for (HepMC::GenEvent::particle_const_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
532  if ((*p)->end_vertex() && (*p)->status() == 1)
533  edm::LogWarning("EvtGenInterface::decay error: incorrect status!"); //(*p)->set_status(2);
534  if ((*p)->end_vertex() && (*p)->end_vertex()->particles_out_size() == 0)
535  edm::LogWarning("EvtGenInterface::decay error: empty end vertex!");
536  }
537  return evt;
538 }

References funct::abs(), Exception, mps_fire::i, charmTagsComputerCvsB_cfi::idx, createfilelist::int, dqmiolumiharvest::j, edm::errors::LogicError, gen::p, and eostools::which().

◆ findLastinChain()

bool EvtGenInterface::findLastinChain ( HepMC::GenParticle *&  p)
private

Definition at line 633 of file EvtGenInterface.cc.

633  {
634  if (p->end_vertex()) {
635  if (p->end_vertex()->particles_out_size() != 0) {
636  for (HepMC::GenVertex::particles_out_const_iterator d = p->end_vertex()->particles_out_const_begin();
637  d != p->end_vertex()->particles_out_const_end();
638  d++) {
639  if (abs((*d)->pdg_id()) == abs(p->pdg_id())) {
640  p = *d;
642  return false;
643  }
644  }
645  }
646  }
647  return true;
648 }

References funct::abs(), ztail::d, and gen::p.

◆ flat()

double EvtGenInterface::flat ( )
static

Definition at line 623 of file EvtGenInterface.cc.

623  {
624  if (!fRandomEngine) {
625  throw cms::Exception("LogicError")
626  << "EvtGenInterface::flat: Attempt to generate random number when engine pointer is null\n"
627  << "This might mean that the code was modified to generate a random number outside the\n"
628  << "event and beginLuminosityBlock methods, which is not allowed.\n";
629  }
630  return fRandomEngine->flat();
631 }

References Exception.

◆ go_through_daughters()

void EvtGenInterface::go_through_daughters ( EvtParticle *  part)
private

Definition at line 659 of file EvtGenInterface.cc.

659  {
660  int NDaug = part->getNDaug();
661  if (NDaug) {
662  EvtParticle* Daughter;
663  for (int i = 0; i < NDaug; i++) {
664  Daughter = part->getDaug(i);
665  int idHep = Daughter->getPDGId();
666  int found = 0;
667  for (unsigned int j = 0; j < forced_pdgids.size(); j++) {
668  if (idHep == forced_pdgids[j]) {
669  found = 1;
670  Daughter->deleteDaughters();
671  break;
672  }
673  }
674  if (!found)
675  go_through_daughters(Daughter);
676  }
677  }
678 }

References newFWLiteAna::found, mps_fire::i, and dqmiolumiharvest::j.

◆ hasnoDaughter()

bool EvtGenInterface::hasnoDaughter ( HepMC::GenParticle *  p)
private

Definition at line 650 of file EvtGenInterface.cc.

650  {
651  if (p->end_vertex()) {
652  if (p->end_vertex()->particles_out_size() != 0) {
653  return false;
654  }
655  }
656  return true;
657 }

References gen::p.

◆ init()

void EvtGenInterface::init ( void  )
overridevirtual

Reimplemented from gen::EvtGenInterfaceBase.

Definition at line 292 of file EvtGenInterface.cc.

292  {
293  // flags for pythia8
294  fSpecialSettings.push_back("Pythia8:ParticleDecays:mixB = off");
295  //
296 
297  edm::FileInPath decay_table(fPSet->getParameter<std::string>("decay_table"));
298  edm::FileInPath pdt(fPSet->getParameter<edm::FileInPath>("particle_property_file"));
299 
300  bool usePythia = fPSet->getUntrackedParameter<bool>("use_internal_pythia", true);
301  bool useTauola = fPSet->getUntrackedParameter<bool>("use_internal_tauola", true);
302  bool usePhotos = fPSet->getUntrackedParameter<bool>("use_internal_photos", true);
303 
304  //Setup evtGen following instructions on http://evtgen.warwick.ac.uk/docs/external/
305  bool convertPythiaCodes = fPSet->getUntrackedParameter<bool>(
306  "convertPythiaCodes", true); // Specify if we want to use Pythia 6 physics codes for decays
307  std::string pythiaDir =
308  std::getenv("PYTHIA8DATA"); // Specify the pythia xml data directory to use the default PYTHIA8DATA location
309  if (pythiaDir.empty()) {
310  edm::LogError("EvtGenInterface::~EvtGenInterface")
311  << "EvtGenInterface::init() PYTHIA8DATA not defined. Terminating program ";
312  exit(0);
313  }
314  std::string photonType("gamma"); // Specify the photon type for Photos
315  bool useEvtGenRandom(true); // Specify if we want to use the EvtGen random number engine for these generators
316 
317  // Set up the default external generator list: Photos, Pythia and/or Tauola
318  EvtExternalGenList genList(convertPythiaCodes, pythiaDir, photonType, useEvtGenRandom);
319  EvtAbsRadCorr* radCorrEngine = nullptr;
320  if (usePhotos)
321  radCorrEngine = genList.getPhotosModel(); // Get interface to radiative correction engine
322  std::list<EvtDecayBase*> extraModels = genList.getListOfModels(); // get interface to Pythia and Tauola
323  std::list<EvtDecayBase*> myExtraModels;
324  for (unsigned int i = 0; i < extraModels.size(); i++) {
325  std::list<EvtDecayBase*>::iterator it = extraModels.begin();
326  std::advance(it, i);
327  TString name = (*it)->getName();
328  if (name.Contains("PYTHIA") && usePythia)
329  myExtraModels.push_back(*it);
330  if (name.Contains("TAUOLA") && useTauola)
331  myExtraModels.push_back(*it);
332  }
333 
334  //Set up user evtgen models
335 
336  EvtModelUserReg userList;
337  std::list<EvtDecayBase*> userModels = userList.getUserModels(); // get interface to user models
338  for (unsigned int i = 0; i < userModels.size(); i++) {
339  std::list<EvtDecayBase*>::iterator it = userModels.begin();
340  std::advance(it, i);
341  TString name = (*it)->getName();
342  edm::LogInfo("EvtGenInterface::~EvtGenInterface") << "Adding user model: " << name;
343  myExtraModels.push_back(*it);
344  }
345 
346  // Set up the incoherent (1) or coherent (0) B mixing option
347  BmixingOption = fPSet->getUntrackedParameter<int>("B_Mixing", 1);
348  if (BmixingOption != 0 && BmixingOption != 1) {
349  throw cms::Exception("Configuration") << "EvtGenProducer requires B_Mixing to be 0 (coherent) or 1 (incoherent) \n"
350  "Please fix this in your configuration.";
351  }
352 
354  // Create the EvtGen generator object, passing the external generators
355  m_EvtGen = new EvtGen(
356  decay_table.fullPath().c_str(), pdt.fullPath().c_str(), the_engine, radCorrEngine, &myExtraModels, BmixingOption);
357 
358  // Add additional user information
359  if (fPSet->exists("user_decay_file")) {
360  std::vector<std::string> user_decays = fPSet->getParameter<std::vector<std::string> >("user_decay_file");
361  for (unsigned int i = 0; i < user_decays.size(); i++) {
362  edm::FileInPath user_decay(user_decays.at(i));
363  m_EvtGen->readUDecay(user_decay.fullPath().c_str());
364  }
365  }
366 
367  if (fPSet->exists("user_decay_embedded")) {
368  std::vector<std::string> user_decay_lines = fPSet->getParameter<std::vector<std::string> >("user_decay_embedded");
369  auto tmp_dir = boost::filesystem::temp_directory_path();
370  tmp_dir += "/%%%%-%%%%-%%%%-%%%%";
371  auto tmp_path = boost::filesystem::unique_path(tmp_dir);
372  std::string user_decay_tmp = std::string(tmp_path.c_str());
373  FILE* tmpf = std::fopen(user_decay_tmp.c_str(), "w");
374  if (!tmpf) {
375  edm::LogError("EvtGenInterface::~EvtGenInterface")
376  << "EvtGenInterface::init() fails when trying to open a temporary file for embedded user.dec. Terminating "
377  "program ";
378  exit(0);
379  }
380  for (unsigned int i = 0; i < user_decay_lines.size(); i++) {
381  user_decay_lines.at(i) += "\n";
382  std::fputs(user_decay_lines.at(i).c_str(), tmpf);
383  }
384  std::fclose(tmpf);
385  m_EvtGen->readUDecay(user_decay_tmp.c_str());
386  }
387 
388  // setup pdgid which the generator/hadronizer should not decay
389  if (fPSet->exists("operates_on_particles")) {
390  std::vector<int> tmpPIDs = fPSet->getParameter<std::vector<int> >("operates_on_particles");
391  m_PDGs.clear();
392  bool goodinput = false;
393  if (!tmpPIDs.empty()) {
394  if (tmpPIDs.size() == 1 && tmpPIDs[0] == 0)
395  goodinput = false;
396  else
397  goodinput = true;
398  } else {
399  goodinput = false;
400  }
401  if (goodinput)
402  m_PDGs = tmpPIDs;
403  else
405  } else
407 
408  for (unsigned int i = 0; i < m_PDGs.size(); i++) {
409  edm::LogInfo("EvtGenInterface::~EvtGenInterface")
410  << "EvtGenInterface::init() Particles to Operate on: " << m_PDGs[i];
411  }
412 
413  // Obtain information to set polarization of particles
414  polarize_ids = fPSet->getUntrackedParameter<std::vector<int> >("particles_to_polarize", std::vector<int>());
415  polarize_pol = fPSet->getUntrackedParameter<std::vector<double> >("particle_polarizations", std::vector<double>());
416  if (polarize_ids.size() != polarize_pol.size()) {
417  throw cms::Exception("Configuration")
418  << "EvtGenProducer requires that the particles_to_polarize and particle_polarization\n"
419  "vectors be the same size. Please fix this in your configuration.";
420  }
421  for (unsigned int ndx = 0; ndx < polarize_ids.size(); ndx++) {
422  if (polarize_pol[ndx] < -1. || polarize_pol[ndx] > 1.) {
423  throw cms::Exception("Configuration")
424  << "EvtGenProducer error: particle polarizations must be in the range -1 < P < 1";
425  }
426  polarizations.insert(std::pair<int, float>(polarize_ids[ndx], polarize_pol[ndx]));
427  }
428 
429  // Forced decays are particles that are aliased and forced to be decayed by EvtGen
430  if (fPSet->exists("list_forced_decays")) {
431  std::vector<std::string> forced_names = fPSet->getParameter<std::vector<std::string> >("list_forced_decays");
432  for (unsigned int i = 0; i < forced_names.size(); i++) {
433  EvtId found = EvtPDL::getId(forced_names[i]);
434  if (found.getId() == -1)
435  throw cms::Exception("Configuration") << "name in part list for ignored decays not found: " << forced_names[i];
436  if (found.getId() == found.getAlias())
437  throw cms::Exception("Configuration") << "name of ignored decays is not an alias: " << forced_names[i];
438  forced_id.push_back(found);
439  forced_pdgids.push_back(EvtPDL::getStdHep(found)); // force_pdgids is the list of stdhep codes
440  }
441  }
442  edm::LogInfo("EvtGenInterface::~EvtGenInterface")
443  << "Number of Forced Paricles is: " << forced_pdgids.size() << std::endl;
444  for (unsigned int j = 0; j < forced_id.size(); j++) {
445  edm::LogInfo("EvtGenInterface::~EvtGenInterface")
446  << "Forced Paricles are: " << forced_pdgids.at(j) << " " << forced_id.at(j) << std::endl;
447  }
448  // Ignore decays are particles that are not to be decayed by EvtGen
449  if (fPSet->exists("list_ignored_pdgids")) {
450  ignore_pdgids = fPSet->getUntrackedParameter<std::vector<int> >("list_ignored_pdgids");
451  }
452 
453  return;
454 }

References Exception, beamvalidation::exit(), newFWLiteAna::found, edm::FileInPath::fullPath(), getId(), EvtModelUserReg::getUserModels(), mps_fire::i, dqmiolumiharvest::j, Skims_PA_cff::name, objects.autophobj::photonType, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ operatesOnParticles()

const std::vector<int>& gen::EvtGenInterface::operatesOnParticles ( )
inlineoverridevirtual

Reimplemented from gen::EvtGenInterfaceBase.

Definition at line 44 of file EvtGenInterface.h.

44 { return m_PDGs; }

References gen::EvtGenInterfaceBase::m_PDGs.

◆ SetDefault_m_PDGs()

void EvtGenInterface::SetDefault_m_PDGs ( )
private

Definition at line 63 of file EvtGenInterface.cc.

63  {
64  // fill up default list of particles to be declared stable in the "master generator"
65  // these are assumed to be PDG ID's
66  //
67  // Note: Pythia6's kc=43, 44, and 84 commented out because they're obsolete (per S.Mrenna)
68  //
69  m_PDGs.push_back(300553);
70  m_PDGs.push_back(511);
71  m_PDGs.push_back(521);
72  m_PDGs.push_back(523);
73  m_PDGs.push_back(513);
74  m_PDGs.push_back(533);
75  m_PDGs.push_back(531); //B_s0
76 
77  m_PDGs.push_back(15);
78 
79  m_PDGs.push_back(413);
80  m_PDGs.push_back(423);
81  m_PDGs.push_back(433);
82  m_PDGs.push_back(411);
83  m_PDGs.push_back(421);
84  m_PDGs.push_back(431);
85  m_PDGs.push_back(10411);
86  m_PDGs.push_back(10421);
87  m_PDGs.push_back(10413);
88  m_PDGs.push_back(10423);
89  m_PDGs.push_back(20413);
90  m_PDGs.push_back(20423);
91 
92  m_PDGs.push_back(415);
93  m_PDGs.push_back(425);
94  m_PDGs.push_back(10431);
95  m_PDGs.push_back(20433);
96  m_PDGs.push_back(10433);
97  m_PDGs.push_back(435);
98 
99  m_PDGs.push_back(310);
100  m_PDGs.push_back(311);
101  m_PDGs.push_back(313);
102  m_PDGs.push_back(323);
103  m_PDGs.push_back(10321);
104  m_PDGs.push_back(10311);
105  m_PDGs.push_back(10313);
106  m_PDGs.push_back(10323);
107  m_PDGs.push_back(20323);
108  m_PDGs.push_back(20313);
109  m_PDGs.push_back(325);
110  m_PDGs.push_back(315);
111 
112  m_PDGs.push_back(100313);
113  m_PDGs.push_back(100323);
114  m_PDGs.push_back(30313);
115  m_PDGs.push_back(30323);
116  m_PDGs.push_back(30343);
117  m_PDGs.push_back(30353);
118  m_PDGs.push_back(30363);
119 
120  m_PDGs.push_back(111);
121  m_PDGs.push_back(221);
122  m_PDGs.push_back(113);
123  m_PDGs.push_back(213);
124  m_PDGs.push_back(223);
125  m_PDGs.push_back(331);
126  m_PDGs.push_back(333);
127  m_PDGs.push_back(20213);
128  m_PDGs.push_back(20113);
129  m_PDGs.push_back(215);
130  m_PDGs.push_back(115);
131  m_PDGs.push_back(10213);
132  m_PDGs.push_back(10113);
133  m_PDGs.push_back(9000111); // PDG ID = 9000111, Pythia6 ID = 10111
134  m_PDGs.push_back(9000211); // PDG ID = 9000211, Pythia6 ID = 10211
135  m_PDGs.push_back(9010221); // PDG ID = 9010211, Pythia6 ID = ???
136  m_PDGs.push_back(10221);
137  m_PDGs.push_back(20223);
138  m_PDGs.push_back(20333);
139  m_PDGs.push_back(225);
140  m_PDGs.push_back(9020221); // PDG ID = 9020211, Pythia6 ID = ???
141  m_PDGs.push_back(335);
142  m_PDGs.push_back(10223);
143  m_PDGs.push_back(10333);
144  m_PDGs.push_back(100213);
145  m_PDGs.push_back(100113);
146 
147  m_PDGs.push_back(441);
148  m_PDGs.push_back(100441);
149  m_PDGs.push_back(443);
150  m_PDGs.push_back(100443);
151  m_PDGs.push_back(9000443);
152  m_PDGs.push_back(9010443);
153  m_PDGs.push_back(9020443);
154  m_PDGs.push_back(10441);
155  m_PDGs.push_back(20443);
156  m_PDGs.push_back(445);
157 
158  m_PDGs.push_back(30443);
159  m_PDGs.push_back(551);
160  m_PDGs.push_back(553);
161  m_PDGs.push_back(100553);
162  m_PDGs.push_back(200553);
163  m_PDGs.push_back(10551);
164  m_PDGs.push_back(20553);
165  m_PDGs.push_back(555);
166  m_PDGs.push_back(10553);
167 
168  m_PDGs.push_back(110551);
169  m_PDGs.push_back(120553);
170  m_PDGs.push_back(100555);
171  m_PDGs.push_back(210551);
172  m_PDGs.push_back(220553);
173  m_PDGs.push_back(200555);
174  m_PDGs.push_back(30553);
175  m_PDGs.push_back(20555);
176 
177  m_PDGs.push_back(557);
178  m_PDGs.push_back(130553);
179  m_PDGs.push_back(120555);
180  m_PDGs.push_back(100557);
181  m_PDGs.push_back(110553);
182  m_PDGs.push_back(210553);
183  m_PDGs.push_back(10555);
184  m_PDGs.push_back(110555);
185 
186  m_PDGs.push_back(4122);
187  m_PDGs.push_back(4132);
188  // m_PDGs.push_back( 84 ); // obsolete
189  m_PDGs.push_back(4112);
190  m_PDGs.push_back(4212);
191  m_PDGs.push_back(4232);
192  m_PDGs.push_back(4222);
193  m_PDGs.push_back(4322);
194  m_PDGs.push_back(4312);
195 
196  m_PDGs.push_back(13122);
197  m_PDGs.push_back(13124);
198  m_PDGs.push_back(23122);
199  m_PDGs.push_back(33122);
200  m_PDGs.push_back(43122);
201  m_PDGs.push_back(53122);
202  m_PDGs.push_back(13126);
203  m_PDGs.push_back(13212);
204  //m_PDGs.push_back( 13241 ); unknown particle -typo?
205 
206  m_PDGs.push_back(3126);
207  m_PDGs.push_back(3124);
208  m_PDGs.push_back(3122);
209  m_PDGs.push_back(3222);
210  m_PDGs.push_back(2214);
211  m_PDGs.push_back(2224);
212  m_PDGs.push_back(3324);
213  m_PDGs.push_back(2114);
214  m_PDGs.push_back(1114);
215  m_PDGs.push_back(3112);
216  m_PDGs.push_back(3212);
217  m_PDGs.push_back(3114);
218  m_PDGs.push_back(3224);
219  m_PDGs.push_back(3214);
220  m_PDGs.push_back(3216);
221  m_PDGs.push_back(3322);
222  m_PDGs.push_back(3312);
223  m_PDGs.push_back(3314);
224  m_PDGs.push_back(3334);
225 
226  m_PDGs.push_back(4114);
227  m_PDGs.push_back(4214);
228  m_PDGs.push_back(4224);
229  m_PDGs.push_back(4314);
230  m_PDGs.push_back(4324);
231  m_PDGs.push_back(4332);
232  m_PDGs.push_back(4334);
233  //m_PDGs.push_back( 43 ); // obsolete (?)
234  //m_PDGs.push_back( 44 ); // obsolete (?)
235  m_PDGs.push_back(10443);
236 
237  m_PDGs.push_back(5122);
238  m_PDGs.push_back(5132);
239  m_PDGs.push_back(5232);
240  m_PDGs.push_back(5332);
241  m_PDGs.push_back(5222);
242  m_PDGs.push_back(5112);
243  m_PDGs.push_back(5212);
244  m_PDGs.push_back(541);
245  m_PDGs.push_back(14122);
246  m_PDGs.push_back(14124);
247  m_PDGs.push_back(5312);
248  m_PDGs.push_back(5322);
249  m_PDGs.push_back(10521);
250  m_PDGs.push_back(20523);
251  m_PDGs.push_back(10523);
252 
253  m_PDGs.push_back(525);
254  m_PDGs.push_back(10511);
255  m_PDGs.push_back(20513);
256  m_PDGs.push_back(10513);
257  m_PDGs.push_back(515);
258  m_PDGs.push_back(10531);
259  m_PDGs.push_back(20533);
260  m_PDGs.push_back(10533);
261  m_PDGs.push_back(535);
262  m_PDGs.push_back(543);
263  m_PDGs.push_back(545);
264  m_PDGs.push_back(5114);
265  m_PDGs.push_back(5224);
266  m_PDGs.push_back(5214);
267  m_PDGs.push_back(5314);
268  m_PDGs.push_back(5324);
269  m_PDGs.push_back(5334);
270  m_PDGs.push_back(10541);
271  m_PDGs.push_back(10543);
272  m_PDGs.push_back(20543);
273 
274  m_PDGs.push_back(4424);
275  m_PDGs.push_back(4422);
276  m_PDGs.push_back(4414);
277  m_PDGs.push_back(4412);
278  m_PDGs.push_back(4432);
279  m_PDGs.push_back(4434);
280 
281  m_PDGs.push_back(130);
282 
283  for (unsigned int i = 0; i < m_PDGs.size(); i++) {
284  int pdt = HepPID::translatePythiatoPDT(m_PDGs.at(i));
285  if (pdt != m_PDGs.at(i))
286  m_PDGs.at(i) = pdt;
287  }
288 }

References mps_fire::i.

◆ setRandomEngine()

void EvtGenInterface::setRandomEngine ( CLHEP::HepRandomEngine *  v)
overridevirtual

Implements gen::EvtGenInterfaceBase.

Definition at line 618 of file EvtGenInterface.cc.

618  {
620  fRandomEngine = v;
621 }

References gen::v.

◆ update_particles()

void EvtGenInterface::update_particles ( HepMC::GenParticle *  partHep,
HepMC::GenEvent theEvent,
HepMC::GenParticle *  p 
)
private

Definition at line 596 of file EvtGenInterface.cc.

596  {
597  if (p->end_vertex()) {
598  if (!partHep->end_vertex()) {
599  HepMC::GenVertex* vtx = new HepMC::GenVertex(p->end_vertex()->position());
600  theEvent->add_vertex(vtx);
601  vtx->add_particle_in(partHep);
602  }
603  if (p->end_vertex()->particles_out_size() != 0) {
604  for (HepMC::GenVertex::particles_out_const_iterator d = p->end_vertex()->particles_out_const_begin();
605  d != p->end_vertex()->particles_out_const_end();
606  d++) {
607  HepMC::GenParticle* daughter = new HepMC::GenParticle((*d)->momentum(), (*d)->pdg_id(), (*d)->status());
608  daughter->suggest_barcode(theEvent->particles_size() + 1);
609  partHep->end_vertex()->add_particle_out(daughter);
610  if ((*d)->end_vertex())
611  update_particles(daughter, theEvent, (*d)); // if daugthers add them as well
612  }
613  partHep->set_status(p->status());
614  }
615  }
616 }

References ztail::d, GenParticle::GenParticle, gen::p, and badGlobalMuonTaggersAOD_cff::vtx.

Member Data Documentation

◆ BmixingOption

int gen::EvtGenInterface::BmixingOption = 1
private

Definition at line 68 of file EvtGenInterface.h.

◆ forced_id

std::vector<EvtId> gen::EvtGenInterface::forced_id
private

Definition at line 59 of file EvtGenInterface.h.

◆ forced_pdgids

std::vector<int> gen::EvtGenInterface::forced_pdgids
private

Definition at line 60 of file EvtGenInterface.h.

◆ fPSet

edm::ParameterSet* gen::EvtGenInterface::fPSet
private

Definition at line 69 of file EvtGenInterface.h.

◆ fRandomEngine

CLHEP::HepRandomEngine * EvtGenInterface::fRandomEngine
staticprivate

Definition at line 71 of file EvtGenInterface.h.

◆ ignore_pdgids

std::vector<int> gen::EvtGenInterface::ignore_pdgids
private

Definition at line 62 of file EvtGenInterface.h.

◆ m_EvtGen

EvtGen* gen::EvtGenInterface::m_EvtGen
private

Definition at line 57 of file EvtGenInterface.h.

◆ polarizations

std::map<int, float> gen::EvtGenInterface::polarizations
private

Definition at line 67 of file EvtGenInterface.h.

◆ polarize_ids

std::vector<int> gen::EvtGenInterface::polarize_ids
private

Definition at line 65 of file EvtGenInterface.h.

◆ polarize_pol

std::vector<double> gen::EvtGenInterface::polarize_pol
private

Definition at line 66 of file EvtGenInterface.h.

◆ the_engine

myEvtRandomEngine* gen::EvtGenInterface::the_engine
private

Definition at line 72 of file EvtGenInterface.h.

Vector3DBase
Definition: Vector3DBase.h:8
myEvtRandomEngine
Definition: myEvtRandomEngine.h:27
gen::EvtGenInterface::fRandomEngine
static CLHEP::HepRandomEngine * fRandomEngine
Definition: EvtGenInterface.h:71
gen::EvtGenInterface::polarize_pol
std::vector< double > polarize_pol
Definition: EvtGenInterface.h:66
mps_fire.i
i
Definition: mps_fire.py:355
gen::EvtGenInterface::flat
static double flat()
Definition: EvtGenInterface.cc:623
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
edm::errors::LogicError
Definition: EDMException.h:37
EvtModelUserReg::getUserModels
std::list< EvtDecayBase * > getUserModels()
gen::EvtGenInterface::BmixingOption
int BmixingOption
Definition: EvtGenInterface.h:68
edm::LogInfo
Definition: MessageLogger.h:254
charmTagsComputerCvsB_cfi.idx
idx
Definition: charmTagsComputerCvsB_cfi.py:108
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
myEvtRandomEngine::engine
CLHEP::HepRandomEngine * engine() const
Definition: myEvtRandomEngine.h:37
gen::EvtGenInterface::the_engine
myEvtRandomEngine * the_engine
Definition: EvtGenInterface.h:72
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
edm::FileInPath
Definition: FileInPath.h:64
gen::EvtGenInterfaceBase::m_PDGs
std::vector< int > m_PDGs
Definition: EvtGenInterfaceBase.h:27
part
part
Definition: HCALResponse.h:20
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
gen::p
double p[5][pyjets_maxn]
Definition: Cascade2Hadronizer.cc:74
gen::EvtGenInterface::ignore_pdgids
std::vector< int > ignore_pdgids
Definition: EvtGenInterface.h:62
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
objects.autophobj.photonType
photonType
Definition: autophobj.py:157
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
gen::EvtGenInterface::fPSet
edm::ParameterSet * fPSet
Definition: EvtGenInterface.h:69
gen::EvtGenInterface::addToHepMC
bool addToHepMC(HepMC::GenParticle *partHep, const EvtId &idEvt, HepMC::GenEvent *theEvent, bool del_daug)
Definition: EvtGenInterface.cc:541
gen::EvtGenInterface::m_EvtGen
EvtGen * m_EvtGen
Definition: EvtGenInterface.h:57
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
gen::v
double v[5][pyjets_maxn]
Definition: Cascade2Hadronizer.cc:74
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
createfilelist.int
int
Definition: createfilelist.py:10
Vector3DBase::cross
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
EvtModelUserReg
Definition: EvtModelUserReg.h:11
gen::EvtGenInterface::findLastinChain
bool findLastinChain(HepMC::GenParticle *&p)
Definition: EvtGenInterface.cc:633
gen::EvtGenInterface::go_through_daughters
void go_through_daughters(EvtParticle *part)
Definition: EvtGenInterface.cc:659
gen::EvtGenInterface::forced_pdgids
std::vector< int > forced_pdgids
Definition: EvtGenInterface.h:60
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
gen::EvtGenInterface::polarizations
std::map< int, float > polarizations
Definition: EvtGenInterface.h:67
gen::EvtGenInterface::SetDefault_m_PDGs
void SetDefault_m_PDGs()
Definition: EvtGenInterface.cc:63
Exception
Definition: hltDiff.cc:246
myEvtRandomEngine::setRandomEngine
void setRandomEngine(CLHEP::HepRandomEngine *v)
Definition: myEvtRandomEngine.h:35
gen::EvtGenInterface::forced_id
std::vector< EvtId > forced_id
Definition: EvtGenInterface.h:59
gen::EvtGenInterface::update_particles
void update_particles(HepMC::GenParticle *partHep, HepMC::GenEvent *theEvent, HepMC::GenParticle *p)
Definition: EvtGenInterface.cc:596
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
ztail.d
d
Definition: ztail.py:151
gen::EvtGenInterfaceBase::fSpecialSettings
std::vector< std::string > fSpecialSettings
Definition: EvtGenInterfaceBase.h:28
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
gen::EvtGenInterface::polarize_ids
std::vector< int > polarize_ids
Definition: EvtGenInterface.h:65
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
getId
static unsigned int getId()
Definition: DQMStoreStats.h:129
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
eostools.which
def which(cmd)
Definition: eostools.py:336
class-composition.parent
parent
Definition: class-composition.py:88
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27