Project
Loading...
Searching...
No Matches
o2::eventgen::GeneratorHybrid Class Reference

#include <GeneratorHybrid.h>

Inherits o2::eventgen::Generator.

Public Member Functions

GeneratorHybrid & operator= (const GeneratorHybrid &)=delete
 
 GeneratorHybrid (const GeneratorHybrid &)=delete
 
Bool_t Init () override
 
Bool_t generateEvent () override
 
Bool_t importParticles () override
 
void updateHeader (o2::dataformats::MCEventHeader *eventHeader) override
 
void stop () override
 
Bool_t parseJSON (const std::string &path)
 
Bool_t confSetter (const auto &gen)
 
template<typename T >
std::string jsonValueToString (const T &value)
 
std::vector< std::shared_ptr< o2::eventgen::Generator > > const & getGenerators ()
 
- 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 ()
 
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
 

Static Public Member Functions

static GeneratorHybrid & Instance (const std::string &inputgens="")
 
- Static Public Member Functions inherited from o2::eventgen::Generator
static void setTotalNEvents (unsigned int &n)
 
static unsigned int getTotalNEvents ()
 
static bool isHyperloop ()
 

Additional Inherited Members

- Public Types inherited from o2::eventgen::Generator
enum  ETriggerMode_t { kTriggerOFF , kTriggerOR , kTriggerAND }
 
- Static Public Attributes inherited from o2::eventgen::Generator
static constexpr int NHyperloopParallelGenerators = 8
 
- 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 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
 
- Static Protected Attributes inherited from o2::eventgen::Generator
static std::atomic< int > InstanceCounter {0}
 

Detailed Description

Definition at line 53 of file GeneratorHybrid.h.

Constructor & Destructor Documentation

◆ GeneratorHybrid()

o2::eventgen::GeneratorHybrid::GeneratorHybrid ( const GeneratorHybrid &  )
delete

Member Function Documentation

◆ confSetter()

Bool_t o2::eventgen::GeneratorHybrid::confSetter ( const auto &  gen)

Definition at line 588 of file GeneratorHybrid.cxx.

◆ generateEvent()

bool o2::eventgen::GeneratorHybrid::generateEvent ( )
overridevirtual

methods to override

Implements o2::eventgen::Generator.

Definition at line 398 of file GeneratorHybrid.cxx.

◆ getGenerators()

std::vector< std::shared_ptr< o2::eventgen::Generator > > const & o2::eventgen::GeneratorHybrid::getGenerators ( )
inline

Definition at line 73 of file GeneratorHybrid.h.

◆ importParticles()

bool o2::eventgen::GeneratorHybrid::importParticles ( )
overridevirtual

Implements o2::eventgen::Generator.

Definition at line 439 of file GeneratorHybrid.cxx.

◆ Init()

Bool_t o2::eventgen::GeneratorHybrid::Init ( )
overridevirtual

Initialize the generator if needed

init

success

Reimplemented from o2::eventgen::Generator.

Definition at line 221 of file GeneratorHybrid.cxx.

◆ Instance()

GeneratorHybrid & o2::eventgen::GeneratorHybrid::Instance ( const std::string &  inputgens = "")
static

Definition at line 28 of file GeneratorHybrid.cxx.

◆ jsonValueToString()

template<typename T >
std::string o2::eventgen::GeneratorHybrid::jsonValueToString ( const T &  value)

Definition at line 580 of file GeneratorHybrid.cxx.

◆ operator=()

GeneratorHybrid & o2::eventgen::GeneratorHybrid::operator= ( const GeneratorHybrid &  )
delete

◆ parseJSON()

Bool_t o2::eventgen::GeneratorHybrid::parseJSON ( const std::string &  path)

Definition at line 698 of file GeneratorHybrid.cxx.

◆ stop()

void o2::eventgen::GeneratorHybrid::stop ( )
overridevirtual

Release external resources (forked subprocesses, open files, ...) once the generator is no longer needed, without relying on destructor timing

Reimplemented from o2::eventgen::Generator.

Definition at line 201 of file GeneratorHybrid.cxx.

◆ updateHeader()

void o2::eventgen::GeneratorHybrid::updateHeader ( o2::dataformats::MCEventHeader *  eventHeader)
overridevirtual

Reimplemented from o2::eventgen::Generator.

Definition at line 562 of file GeneratorHybrid.cxx.


The documentation for this class was generated from the following files: