![]() |
Project
|
#include <GeneratorHepMC.h>
Inherits o2::eventgen::Generator, and o2::eventgen::GeneratorFileOrCmd.
Public Member Functions | |
GeneratorHepMC () | |
GeneratorHepMC (const Char_t *name, const Char_t *title="ALICEo2 HepMC Generator") | |
~GeneratorHepMC () override | |
Bool_t | Init () override |
void | setup (const GeneratorFileOrCmdParam ¶m0, const GeneratorHepMCParam ¶m, const conf::SimConfig &config) |
void | setup (const FileOrCmdGenConfig ¶m0, const HepMCGenConfig ¶m, const conf::SimConfig &config) |
Bool_t | generateEvent () override |
Bool_t | importParticles () override |
void | setEventsToSkip (uint64_t val) |
void | setVersion (const int &ver) |
![]() | |
Generator () | |
Generator (const Char_t *name, const Char_t *title="ALICEo2 Generator") | |
~Generator () override=default | |
Bool_t | Init () override |
Bool_t | ReadEvent (FairPrimaryGenerator *primGen) final |
Bool_t | triggerEvent () |
void | setMomentumUnit (double val) |
void | setEnergyUnit (double val) |
void | setPositionUnit (double val) |
void | setTimeUnit (double val) |
void | setBoost (Double_t val) |
void | setTriggerMode (ETriggerMode_t val) |
void | addTrigger (Trigger trigger) |
void | addDeepTrigger (DeepTrigger trigger) |
const std::vector< TParticle > & | getParticles () const |
void | clearParticles () |
virtual void | notifyEmbedding (const o2::dataformats::MCEventHeader *eventHeader) |
void | setTriggerOkHook (std::function< void(std::vector< TParticle > const &p, int eventCount)> f) |
void | setTriggerFalseHook (std::function< void(std::vector< TParticle > const &p, int eventCount)> f) |
![]() | |
void | setup (const GeneratorFileOrCmdParam ¶m, const conf::SimConfig &config) |
void | setup (const FileOrCmdGenConfig ¶m, const conf::SimConfig &config) |
void | setCmd (const std::string &cmd) |
void | setCmdPid (const pid_t cmdPid) |
void | setNEvents (unsigned int nev) |
void | setSeed (unsigned long seed) |
void | setBmax (float bmax) |
void | setFileNames (const std::string &filenames) |
void | setOutputSwitch (const std::string &opt) |
void | setSeedSwitch (const std::string &opt) |
void | setNEventsSwitch (const std::string &opt) |
void | setBmaxSwitch (const std::string &opt) |
void | setBackgroundSwitch (const std::string &opt) |
void | setWait (int miliseconds=500) |
Protected Types | |
typedef bool(* | Select) (std::shared_ptr< const HepMC3::GenParticle >) |
Protected Member Functions | |
GeneratorHepMC (const GeneratorHepMC &) | |
GeneratorHepMC & | operator= (const GeneratorHepMC &) |
const HepMC3::FourVector | getBoostedVector (const HepMC3::FourVector &vector, Double_t boost) |
void | updateHeader (o2::dataformats::MCEventHeader *eventHeader) override |
bool | makeReader () |
void | pruneEvent (Select select) |
ClassDefOverride (GeneratorHepMC, 1) | |
![]() | |
Generator (const Generator &) | |
Generator & | operator= (const Generator &) |
Bool_t | addTracks (FairPrimaryGenerator *primGen) |
Bool_t | boostEvent () |
void | addSubGenerator (int subGeneratorId, std::string const &subGeneratorDescription) |
void | notifySubGenerator (int subGeneratorId) |
![]() | |
virtual std::string | makeCmdLine () const |
virtual bool | executeCmdLine (const std::string &cmd) |
virtual bool | terminateCmd () |
virtual bool | makeTemp (const bool &) |
virtual bool | removeTemp () const |
virtual bool | makeFifo () const |
virtual bool | ensureFiles () |
virtual void | waitForData (const std::string &filename) const |
Protected Attributes | |
uint64_t | mEventsToSkip = 0 |
int | mVersion = 0 |
std::shared_ptr< HepMC3::Reader > | mReader |
HepMC3::GenEvent * | mEvent = nullptr |
bool | mPrune |
![]() | |
void * | mInterface = nullptr |
std::string | mInterfaceName |
ETriggerMode_t | mTriggerMode = kTriggerOFF |
std::vector< Trigger > | mTriggers |
std::vector< DeepTrigger > | mDeepTriggers |
std::function< void(std::vector< TParticle > const &p, int eventCount)> | mTriggerOkHook = [](std::vector<TParticle> const& p, int eventCount) {} |
std::function< void(std::vector< TParticle > const &p, int eventCount)> | mTriggerFalseHook = [](std::vector<TParticle> const& p, int eventCount) {} |
int | mReadEventCounter = 0 |
double | mMomentumUnit = 1. |
double | mEnergyUnit = 1. |
double | mPositionUnit = 0.1 |
double | mTimeUnit = 3.3356410e-12 |
std::vector< TParticle > | mParticles |
Double_t | mBoost |
int | mThisInstanceID = 0 |
![]() | |
std::string | mCmd = "" |
std::list< std::string > | mFileNames |
std::string | mTemporary |
unsigned int | mNEvents = 0 |
unsigned long | mSeed = 0 |
float | mBmax = -1.f |
std::string | mOutputSwitch = ">" |
std::string | mSeedSwitch = "-s" |
std::string | mNEventsSwitch = "-n" |
std::string | mBmaxSwitch = "-b" |
std::string | mBackgroundSwitch = "&" |
int | mWait = 500 |
int | mCmdPid = -1 |
Additional Inherited Members | |
![]() | |
enum | ETriggerMode_t { kTriggerOFF , kTriggerOR , kTriggerAND } |
![]() | |
static void | setTotalNEvents (unsigned int &n) |
static unsigned int | getTotalNEvents () |
![]() | |
static std::atomic< int > | InstanceCounter {0} |
Definition at line 51 of file GeneratorHepMC.h.
|
protected |
Type of function to select particles to keep when pruning events
Definition at line 113 of file GeneratorHepMC.h.
o2::eventgen::GeneratorHepMC::GeneratorHepMC | ( | ) |
default constructor
Definition at line 39 of file GeneratorHepMC.cxx.
o2::eventgen::GeneratorHepMC::GeneratorHepMC | ( | const Char_t * | name, |
const Char_t * | title = "ALICEo2 HepMC Generator" |
||
) |
|
override |
|
protected |
copy constructor
|
protected |
|
overridevirtual |
Generate a single event. The event is read in from the current input file. Returns false if a new event could not be read.
generate event
clear and read event
set units to desired output
failure
Implements o2::eventgen::Generator.
Definition at line 142 of file GeneratorHepMC.cxx.
|
protected |
methods
|
overridevirtual |
Import particles from the last read event into a vector TParticle. Returns false if no particles could be exported to the vector.
import particles
loop over particles
get particle information
get mother information
get daughter information
add to particle vector
end of loop over particles
success
Implements o2::eventgen::Generator.
Definition at line 276 of file GeneratorHepMC.cxx.
|
override |
|
protected |
Make our reader
Definition at line 505 of file GeneratorHepMC.cxx.
|
protected |
operator=
Prune event of particles that are not selected by passed function. The event structure is preserved.
Definition at line 175 of file GeneratorHepMC.cxx.
|
inline |
setters
Definition at line 90 of file GeneratorHepMC.h.
void o2::eventgen::GeneratorHepMC::setup | ( | const FileOrCmdGenConfig & | param0, |
const HepMCGenConfig & | param, | ||
const conf::SimConfig & | config | ||
) |
Definition at line 110 of file GeneratorHepMC.cxx.
void o2::eventgen::GeneratorHepMC::setup | ( | const GeneratorFileOrCmdParam & | param0, |
const GeneratorHepMCParam & | param, | ||
const conf::SimConfig & | config | ||
) |
Configure the generator from parameters and the general simulation configuration. This is implemented as a member function so as to better facilitate changes.
Definition at line 78 of file GeneratorHepMC.cxx.
Definition at line 91 of file GeneratorHepMC.h.
|
overrideprotectedvirtual |
methods that can be overridded
update header
Reimplemented from o2::eventgen::Generator.
Definition at line 411 of file GeneratorHepMC.cxx.
|
protected |
Event structure
Definition at line 124 of file GeneratorHepMC.h.
|
protected |
HepMC interface
Definition at line 119 of file GeneratorHepMC.h.
|
protected |
Option whether to prune event
Definition at line 126 of file GeneratorHepMC.h.
|
protected |
Definition at line 122 of file GeneratorHepMC.h.
|
protected |
HepMC event record version to expected. Deprecated.
Definition at line 121 of file GeneratorHepMC.h.