![]() |
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 | 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) |
![]() | |
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 |
virtual void | updateHeader (o2::dataformats::MCEventHeader *eventHeader) |
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 Member Functions | |
ClassDefOverride (GeneratorTParticle, 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 | |
std::string | mTreeName = "T" |
std::string | mBranchName = "Particles" |
unsigned int | mEntry = 0 |
TChain * | mChain = 0 |
TClonesArray * | mTParticles |
![]() | |
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} |
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 100 of file GeneratorTParticle.cxx.
|
overridevirtual |
Import the read-in particles into the steer particle stack
Implements o2::eventgen::Generator.
Definition at line 125 of file GeneratorTParticle.cxx.
|
override |
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
Definition at line 50 of file GeneratorTParticle.cxx.
|
inline |
Set the branch name of the branch that holds a TClonesArray
of TParticle
objects
Definition at line 95 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 92 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 90 of file GeneratorTParticle.cxx.
|
protected |
Name of branch containing a TClonesArray of TParticle
Definition at line 101 of file GeneratorTParticle.h.
|
protected |
Chain of files
Definition at line 105 of file GeneratorTParticle.h.
|
protected |
Current entry
Definition at line 103 of file GeneratorTParticle.h.
|
protected |
Array to read particles into
Definition at line 107 of file GeneratorTParticle.h.
|
protected |
Name of the tree to read
Definition at line 99 of file GeneratorTParticle.h.