Belle II Software  release-08-01-10
EvtGenInterface Class Reference

Class to interface EvtGen. More...

#include <EvtGenInterface.h>

Collaboration diagram for EvtGenInterface:

Public Member Functions

 EvtGenInterface ()
 Constructor.
 
 ~EvtGenInterface ()
 Destructor.
 
int setup (const std::string &decayFileName, const std::string &parentParticle, const std::string &userFileName=std::string(""), bool coherentMixing=true)
 Setup evtgen with the given decay files

 
int simulateEvent (MCParticleGraph &graph, ROOT::Math::PxPyPzEVector pParentParticle, ROOT::Math::XYZVector pPrimaryVertex, int inclusiveType, const std::string &inclusiveParticle)
 Generate a single event.
 
int simulateDecay (MCParticleGraph &graph, MCParticleGraph::GraphParticle &parent)
 Simulate a particle decay.
 

Static Public Member Functions

static EvtGen * createEvtGen (const std::string &decayFileName, bool coherentMixing)
 Create and initialize an EvtGen instance: More...
 

Protected Attributes

EvtParticle * m_parent
 Variable needed for parent particle. More...
 
EvtGen * m_Generator
 Variable needed for EvtGen generator.
 
EvtVector4R m_pinit
 Variable needed for initial momentum.
 
EvtId m_ParentParticle
 Variable needed for parent particle ID.
 
bool m_ParentInitialized
 Whether parent particle is initialized.
 
IOIntercept::OutputToLogMessages m_logCaptureDebug
 Capture EvtGen log and transform into basf2 logging as B2DEBUG messages.
 

Static Protected Attributes

static EvtGenFwRandEngine m_eng
 Variable needed for random generator.
 

Private Member Functions

int addParticles2Graph (EvtParticle *particle, MCParticleGraph &graph, ROOT::Math::XYZVector pPrimaryVertex, MCParticleGraph::GraphParticle *parent, double timeOffset=0)
 Convert EvtParticle structure to flat MCParticle list.
 
void updateGraphParticle (EvtParticle *eParticle, MCParticleGraph::GraphParticle *gParticle, ROOT::Math::XYZVector pPrimaryVertex, double timeOffset=0)
 Copy parameters from EvtParticle to MCParticle.
 

Detailed Description

Class to interface EvtGen.

This class is responsible to handle all interaction with evtgen and its classes when generating events. It sets up the models, calls evtgen to generate the events and converts the evtgen particles to a list of MCParticles

Definition at line 35 of file EvtGenInterface.h.

Member Function Documentation

◆ createEvtGen()

EvtGen * createEvtGen ( const std::string &  decayFileName,
bool  coherentMixing 
)
static

Create and initialize an EvtGen instance:

  • Make sure Random engine is setup correctly
  • Create evt.pdl on the fly from current contents of particle database
  • Add photos/all models
  • Use Coherent mixing unless set otherwise

Definition at line 47 of file EvtGenInterface.cc.

48 {
49  // Tauola prints normal things to stderr.. oh well.
51  initLogCapture.setIndent(" ");
52  initLogCapture.start();
53  EvtRandom::setRandomEngine(&EvtGenInterface::m_eng);
54 
55  // Official BelleII models
56  std::list<EvtDecayBase*> extraModels = EvtGenModelRegister::getModels();
57 
58  // Fill model list with pythia, photos etc.
59  // The parameter 'false' means that Pythia codes must not be converted,
60  // since the conversion is applied to all the decfiles since release-06.
61  EvtExternalGenList genList{false};
62  EvtAbsRadCorr* radCorrEngine = genList.getPhotosModel();
63  list<EvtDecayBase*> modelList = genList.getListOfModels();
64  extraModels.insert(extraModels.end(), modelList.begin(), modelList.end());
65 
68 
69  auto mixingMode = EvtCPUtil::Incoherent;
70  if (coherentMixing)
71  mixingMode = EvtCPUtil::Coherent;
72  else {
73  B2WARNING("Evtgen has been set to decay the B mesons incoherently. This is useful as a workaround only to generate Y(5S, 6S) -> BBar for QCD studies.");
74  B2WARNING("If you are generating Y(4S) events, you _really_ must use the coherent decay mode.");
75  }
76 
77  return new EvtGen(DECFileName.c_str(), tmp.getName().c_str(), &EvtGenInterface::m_eng,
78  radCorrEngine, &extraModels, mixingMode);
79 
80  initLogCapture.finish();
81 }
static EvtGenDatabasePDG * Instance()
Instance method that loads the EvtGen table.
void WriteEvtGenTable(std::ostream &out)
Write current database as EvtGen table to a stream.
static EvtGenFwRandEngine m_eng
Variable needed for random generator.
Helper file to create a temporary file and ensure deletion if object goes out of scope.
Definition: FileSystem.h:128
Capture stdout and stderr and convert into log messages.
Definition: IOIntercept.h:226
@ c_Info
Info: for informational messages, e.g.
Definition: LogConfig.h:27
static std::list< EvtDecayBase * > getModels()
Return a list of models.

Member Data Documentation

◆ m_parent

EvtParticle* m_parent
protected

Variable needed for parent particle.


Definition at line 84 of file EvtGenInterface.h.


The documentation for this class was generated from the following files: