![]() |
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 HepMCGenConfig ¶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 | stop () override |
| void | setEventsToSkip (uint64_t val) |
| void | setVersion (const int &ver) |
Public Member Functions inherited from o2::eventgen::Generator | |
| Generator () | |
| Generator (const Char_t *name, const Char_t *title="ALICEo2 Generator") | |
| ~Generator () override | |
| Bool_t | Init () override |
| Bool_t | ReadEvent (FairPrimaryGenerator *primGen) final |
| Bool_t | finalizeEvent () |
| Bool_t | triggerEvent () |
| void | setMomentumUnit (double val) |
| double | getMomentumUnit () const |
| void | setEnergyUnit (double val) |
| double | getEnergyUnit () const |
| void | setPositionUnit (double val) |
| double | getPositionUnit () const |
| void | setTimeUnit (double val) |
| double | getTimeUnit () const |
| 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) |
Public Member Functions inherited from o2::eventgen::GeneratorFileOrCmd | |
| 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 |
| void | setupHepMC (const HepMCGenConfig ¶m) |
| bool | makeReader () |
| void | establishEventOrder () |
| bool | buildIndex (const std::string &filename) |
| bool | readEntry (int entry) |
| Bool_t | generateEventOrdered () |
| void | pruneEvent (Select select) |
| ClassDefOverride (GeneratorHepMC, 2) | |
Protected Member Functions inherited from o2::eventgen::Generator | |
| 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) |
Protected Member Functions inherited from o2::eventgen::GeneratorFileOrCmd | |
| virtual std::string | makeCmdLine () const |
| virtual bool | executeCmdLine (const std::string &cmd) |
| virtual bool | terminateCmd (unsigned int graceMillis=0) |
| 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 |
| std::string | mCurrentFileName |
| std::vector< int > | mEventOrder |
| int | mEventCounter = 0 |
| int | mEventsServed = 0 |
| int | mEventsAvailable = 0 |
| int | mLastEntryRead = -1 |
| bool | mRandomize = false |
| bool | mRoundRobin = false |
| bool | mReshuffleOnRepeat = true |
| unsigned int | mRngSeed = 0 |
| bool | mIndexedHepMC2 = false |
| std::shared_ptr< std::istream > | mIndexedStream |
| std::vector< std::streamoff > | mEventOffsets |
Protected Attributes inherited from o2::eventgen::Generator | |
| 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 |
Protected Attributes inherited from o2::eventgen::GeneratorFileOrCmd | |
| 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 | |
Public Types inherited from o2::eventgen::Generator | |
| enum | ETriggerMode_t { kTriggerOFF , kTriggerOR , kTriggerAND } |
Static Public Member Functions inherited from o2::eventgen::Generator | |
| static void | setTotalNEvents (unsigned int &n) |
| static unsigned int | getTotalNEvents () |
Static Protected Attributes inherited from o2::eventgen::Generator | |
| static std::atomic< int > | InstanceCounter {0} |
Static Protected Attributes inherited from o2::eventgen::GeneratorFileOrCmd | |
| static constexpr unsigned int | sStopGraceMillis = 5000 |
Definition at line 55 of file GeneratorHepMC.h.
|
protected |
Type of function to select particles to keep when pruning events
Definition at line 131 of file GeneratorHepMC.h.
| o2::eventgen::GeneratorHepMC::GeneratorHepMC | ( | ) |
default constructor
Definition at line 46 of file GeneratorHepMC.cxx.
| o2::eventgen::GeneratorHepMC::GeneratorHepMC | ( | const Char_t * | name, |
| const Char_t * | title = "ALICEo2 HepMC Generator" |
||
| ) |
|
override |
|
protected |
copy constructor
|
protected |
Index the events of a file by byte offset and open the reader on it, so that any entry can later be reached with a single seek. Available only for ASCII format
Definition at line 597 of file GeneratorHepMC.cxx.
|
protected |
|
protected |
Fix the order in which the entries of the input file are served
Definition at line 686 of file GeneratorHepMC.cxx.
|
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 151 of file GeneratorHepMC.cxx.
|
protected |
Generate an event following the established event order in random mode
Definition at line 704 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 291 of file GeneratorHepMC.cxx.
|
override |
|
protected |
Make our reader, taking the next file off the list of file names
Definition at line 554 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 190 of file GeneratorHepMC.cxx.
|
protected |
Read the given entry of the indexed file
clear and read event
set units to desired output
Definition at line 660 of file GeneratorHepMC.cxx.
|
inline |
setters
Definition at line 97 of file GeneratorHepMC.h.
| void o2::eventgen::GeneratorHepMC::setup | ( | const FileOrCmdGenConfig & | param0, |
| const HepMCGenConfig & | param, | ||
| const conf::SimConfig & | config | ||
| ) |
Definition at line 108 of file GeneratorHepMC.cxx.
| void o2::eventgen::GeneratorHepMC::setup | ( | const GeneratorFileOrCmdParam & | param0, |
| const HepMCGenConfig & | 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 99 of file GeneratorHepMC.cxx.
|
protected |
Apply the HepMC-specific configuration
Definition at line 118 of file GeneratorHepMC.cxx.
Definition at line 98 of file GeneratorHepMC.h.
|
overridevirtual |
Terminate the background command (if any), see Generator::stop().
Reimplemented from o2::eventgen::Generator.
Definition at line 81 of file GeneratorHepMC.cxx.
|
overrideprotectedvirtual |
methods that can be overridded
update header
Reimplemented from o2::eventgen::Generator.
Definition at line 426 of file GeneratorHepMC.cxx.
|
protected |
Name of the file the reader is attached to, needed to re-open it
Definition at line 146 of file GeneratorHepMC.h.
|
protected |
Event structure
Definition at line 142 of file GeneratorHepMC.h.
|
protected |
Events already delivered in the current pass over the file
Definition at line 150 of file GeneratorHepMC.h.
|
protected |
Byte offset at which every entry of the input file starts
Definition at line 170 of file GeneratorHepMC.h.
|
protected |
Order in which the entries of the input file are served
Definition at line 148 of file GeneratorHepMC.h.
|
protected |
Events contained in the input file
Definition at line 154 of file GeneratorHepMC.h.
|
protected |
Events delivered in total
Definition at line 152 of file GeneratorHepMC.h.
|
protected |
HepMC interface
Definition at line 137 of file GeneratorHepMC.h.
|
protected |
Whether the indexed input is HepMC2 rather than HepMC3 ASCII
Definition at line 166 of file GeneratorHepMC.h.
|
protected |
The stream the reader is attached to, ours so that we may seek in it
Definition at line 168 of file GeneratorHepMC.h.
|
protected |
Entry the reader is currently positioned on, -1 if none
Definition at line 156 of file GeneratorHepMC.h.
|
protected |
Option whether to prune event
Definition at line 144 of file GeneratorHepMC.h.
|
protected |
Option whether to serve the events in random order
Definition at line 158 of file GeneratorHepMC.h.
|
protected |
Definition at line 140 of file GeneratorHepMC.h.
|
protected |
Option to have a new order when round-robin enabled
Definition at line 162 of file GeneratorHepMC.h.
|
protected |
Randomizer seed, 0 to leave gRandom alone
Definition at line 164 of file GeneratorHepMC.h.
|
protected |
Option whether to start over once all events have been used
Definition at line 160 of file GeneratorHepMC.h.
|
protected |
HepMC event record version to expected. Deprecated.
Definition at line 139 of file GeneratorHepMC.h.