Belle II Software development
EvtGenInterface.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11
12#include <EvtGen/EvtGen.hh>
13#include <EvtGenBase/EvtParticle.hh>
14#include <EvtGenBase/EvtVector4R.hh>
15#include <generators/evtgen/EvtGenFwRandEngine.h>
16#include <mdst/dataobjects/MCParticleGraph.h>
17#include <framework/dataobjects/MCInitialParticles.h>
18
19#include <framework/utilities/IOIntercept.h>
20
21#include <Math/Vector3D.h>
22#include <string>
23
24namespace Belle2 {
37
38 public:
45 static EvtGen* createEvtGen(const std::string& decayFileName, bool coherentMixing);
46
51 m_parent(0),
52 m_Generator(0),
54 m_logCaptureDebug("EvtGen", LogConfig::c_Debug, LogConfig::c_Warning, 20, 20)
55 {}
56
61
63 int setup(const std::string& decayFileName, const std::string& parentParticle,
64 const std::string& userFileName = std::string(""), bool coherentMixing = true);
65
67 int simulateEvent(MCInitialParticles initial, int inclusiveType, const std::string& inclusiveParticle);
68
72
73 private:
75 int addParticles2Graph(EvtParticle* particle, MCParticleGraph& graph, ROOT::Math::XYZVector pPrimaryVertex,
76 MCParticleGraph::GraphParticle* parent, double timeOffset = 0);
77
79 void updateGraphParticle(EvtParticle* eParticle, MCParticleGraph::GraphParticle* gParticle,
80 ROOT::Math::XYZVector pPrimaryVertex, double timeOffset = 0);
81
82 protected:
83 EvtParticle* m_parent;
85 EvtGen* m_Generator;
89 };
90
92}
93
Class to interface EvtGen.
int simulateEvent(MCInitialParticles initial, int inclusiveType, const std::string &inclusiveParticle)
Generate a single event.
int simulateDecay(MCParticleGraph &graph, MCParticleGraph::GraphParticle &parent)
Simulate a particle decay.
EvtGen * m_Generator
Variable needed for EvtGen generator.
IOIntercept::OutputToLogMessages m_logCaptureDebug
Capture EvtGen log and transform into basf2 logging as B2DEBUG messages.
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
static EvtGenFwRandEngine m_eng
Variable needed for random generator.
EvtParticle * m_parent
Variable needed for parent particle.
static EvtGen * createEvtGen(const std::string &decayFileName, bool coherentMixing)
Create and initialize an EvtGen instance:
EvtId m_ParentParticle
Variable needed for parent particle ID.
bool m_ParentInitialized
Whether parent particle is initialized.
void updateGraphParticle(EvtParticle *eParticle, MCParticleGraph::GraphParticle *gParticle, ROOT::Math::XYZVector pPrimaryVertex, double timeOffset=0)
Copy parameters from EvtParticle to MCParticle.
EvtGenInterface()
Constructor.
int addParticles2Graph(EvtParticle *particle, MCParticleGraph &graph, ROOT::Math::XYZVector pPrimaryVertex, MCParticleGraph::GraphParticle *parent, double timeOffset=0)
Convert EvtParticle structure to flat MCParticle list.
Capture stdout and stderr and convert into log messages.
Definition: IOIntercept.h:226
The LogConfig class.
Definition: LogConfig.h:22
This class contains the initial state for the given event.
Class to represent Particle data in graph.
Class to build, validate and sort a particle decay chain.
Evtgen random generator.
Abstract base class for different kinds of events.