10 #include <generators/modules/evtgeninput/EvtGenInputModule.h>
13 #include <generators/evtgen/EvtGenInterface.h>
14 #include <generators/evtgen/EvtGenUtilities.h>
17 #include <framework/utilities/FileSystem.h>
18 #include <framework/datastore/StoreArray.h>
19 #include <mdst/dataobjects/MCParticleGraph.h>
37 setDescription(
"EvtGenInput module. The module is served as an interface for EvtGen Event Generator so that the EvtGen generator can store the generated particles into MCParticles. The users need to provide their own decay mode based on the standard DECAY.DEC.");
45 addParam(
"InclusiveType",
m_inclusiveType,
"inclusive decay type (0: generic, 1: inclusive, 2: inclusive (charge conjugate)", 0);
49 "particle from the beam energies which fits inside the mass window "
50 "before giving up", 100000);
82 B2FATAL(
"Could not create parent particle within mass window: "
83 <<
"minMass=" << minMass <<
" GeV, "
84 <<
"maxMass=" << maxMass <<
" GeV");
92 static void addInitialParticle(
MCParticleGraph& mpg,
int pdg, ROOT::Math::PxPyPzEVector p4)
102 part.setProductionVertex(0, 0, 0);
103 part.setProductionTime(0);
104 part.setValidVertex(
false);
113 B2DEBUG(10,
"Starting event generation");
120 B2FATAL(
"EvtGenInputModule::event(): BeamParameters have changed within a job, this is not supported for EvtGen!");
136 ROOT::Math::PxPyPzEVector pParentParticle = initial.
getLER() + initial.
getHER();
137 ROOT::Math::XYZVector primaryVertex = initial.
getVertex();
145 addInitialParticle(
mpg, 11, initial.
getHER());
146 addInitialParticle(
mpg, -11, initial.
getLER());
152 B2DEBUG(10,
"EvtGen: generated event with " << nPart <<
" particles.");
164 <<
"' does not exist");
169 <<
"' does not exist");
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
static const double electronMass
electron mass
int simulateEvent(MCParticleGraph &graph, ROOT::Math::PxPyPzEVector pParentParticle, ROOT::Math::XYZVector pPrimaryVertex, int inclusiveType, const std::string &inclusiveParticle)
Generate a single event.
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 std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
The base module for generator modules, which sets the generator information as EventExtraInfo.
This class contains the initial state for the given event.
const ROOT::Math::PxPyPzEVector & getLER() const
Get 4vector of the low energy beam.
const ROOT::Math::PxPyPzEVector & getHER() const
Get 4vector of the high energy beam.
const ROOT::Math::XYZVector & getVertex() const
Get the position of the collision.
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
Class to represent Particle data in graph.
Class to build, validate and sort a particle decay chain.
@ c_Initial
bit 5: Particle is initial such as e+ or e- and not going to Geant4
@ c_PrimaryParticle
bit 0: Particle is primary particle.
@ c_StableInGenerator
bit 1: Particle is stable, i.e., not decaying in the generator.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_Input
This module is an input module (reads data).
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
void initialize()
function to be executed on initialize()
MCInitialParticles & generate()
Generate a new event.
void clear()
Reset particles and decay information to make the class reusable.
GraphParticle & addParticle()
Add new particle to the graph.
Abstract base class for different kinds of events.