![]() |
Project
|
#include <GeneratorTParticle.h>
Inherits o2::eventgen::Generator, and o2::eventgen::GeneratorFileOrCmd.
Public Member Functions | |
| GeneratorTParticle () | |
| GeneratorTParticle (const std::string &name) | |
| virtual | ~GeneratorTParticle () |
| Bool_t | Init () override |
| void | stop () override |
| void | setup (const GeneratorFileOrCmdParam ¶m0, const GeneratorTParticleParam ¶m, const conf::SimConfig &config) |
| Bool_t | generateEvent () override |
| Bool_t | importParticles () override |
| void | setTreeName (const std::string &val) |
| void | setBranchName (const std::string &val) |
Public Member Functions inherited from o2::eventgen::Generator | |
| Generator () | |
| Generator (const Char_t *name, const Char_t *title="ALICEo2 Generator") | |
| ~Generator () override | |
| Bool_t | ReadEvent (FairPrimaryGenerator *primGen) final |
| Bool_t | finalizeEvent () |
| virtual void | updateHeader (o2::dataformats::MCEventHeader *eventHeader) |
| 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 FairGenerator | |
| FairGenerator () | |
| FairGenerator (const char *name, const char *title="FAIR Generator") | |
| virtual | ~FairGenerator () |
| virtual FairGenerator * | CloneGenerator () const |
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 Member Functions | |
| ClassDefOverride (GeneratorTParticle, 1) | |
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 FairGenerator | |
| FairGenerator (const FairGenerator &) | |
| FairGenerator & | operator= (const FairGenerator &) |
| ClassDef (FairGenerator, 1) | |
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 | |
| std::string | mTreeName = "T" |
| std::string | mBranchName = "Particles" |
| unsigned int | mEntry = 0 |
| TChain * | mChain = 0 |
| TClonesArray * | mTParticles |
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 bool | isHyperloop () |
Static Public Attributes inherited from o2::eventgen::Generator | |
| static constexpr int | NHyperloopParallelGenerators = 8 |
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 |
A class that reads in particles of class TParticle from a branch in a TChain.
Optionally, a program that generates such a TTree can be spawn, and the TParticles written to a file from which this object reads them in. This is done with
–configKeyValues "TParticle.progCmd=<eg program and options>"
which will execute the specified EG program with the given options. The EG program must support the command line options
-n NUMBER Number of events to generate -o FILENAME Name of file to write to
The tree name and particle branch names can be configured.
–configKeyValues "TParticle.treeName=T,TParticle.branchName=P"
File(s) to read are also configurable
–configKeyValues "TParticle.fileNames=foo.root,bar.root"
Definition at line 56 of file GeneratorTParticle.h.
| o2::eventgen::GeneratorTParticle::GeneratorTParticle | ( | ) |
CTOR
Definition at line 28 of file GeneratorTParticle.cxx.
|
inline |
CTOR
Definition at line 62 of file GeneratorTParticle.h.
|
virtual |
DTOR
Definition at line 34 of file GeneratorTParticle.cxx.
|
protected |
|
overridevirtual |
Read in the next entry from the chain. Returns false in case of errors or no more entries to read.
Implements o2::eventgen::Generator.
Definition at line 110 of file GeneratorTParticle.cxx.
|
overridevirtual |
Import the read-in particles into the steer particle stack
Implements o2::eventgen::Generator.
Definition at line 135 of file GeneratorTParticle.cxx.
|
overridevirtual |
Initialize this generator. This will set up the chain. Optionally, if a command line was specified by TParticle.progCmd then that command line is executed in the background and events are read from the output file of that program
Reimplemented from o2::eventgen::Generator.
Definition at line 60 of file GeneratorTParticle.cxx.
|
inline |
Set the branch name of the branch that holds a TClonesArray of TParticle objects
Definition at line 98 of file GeneratorTParticle.h.
|
inline |
Set the name of the tree in the files. The tree must reside in the top-level directory of the files.
Definition at line 95 of file GeneratorTParticle.h.
| void o2::eventgen::GeneratorTParticle::setup | ( | const GeneratorFileOrCmdParam & | param0, |
| const GeneratorTParticleParam & | 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 100 of file GeneratorTParticle.cxx.
|
overridevirtual |
Terminate the background command (if any), see Generator::stop().
Reimplemented from o2::eventgen::Generator.
Definition at line 52 of file GeneratorTParticle.cxx.
|
protected |
Name of branch containing a TClonesArray of TParticle
Definition at line 104 of file GeneratorTParticle.h.
|
protected |
Chain of files
Definition at line 108 of file GeneratorTParticle.h.
|
protected |
Current entry
Definition at line 106 of file GeneratorTParticle.h.
|
protected |
Array to read particles into
Definition at line 110 of file GeneratorTParticle.h.
|
protected |
Name of the tree to read
Definition at line 102 of file GeneratorTParticle.h.