Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4PileupGenerator Class Reference

#include <coresoftware/blob/master/simulation/g4simulation/g4main/PHG4PileupGenerator.h>

+ Inheritance diagram for PHG4PileupGenerator:
+ Collaboration diagram for PHG4PileupGenerator:

Public Member Functions

 PHG4PileupGenerator (const std::string &name="PILEUPGENERATOR")
 
 ~PHG4PileupGenerator () override
 
int Init (PHCompositeNode *topNode) override
 
int InitRun (PHCompositeNode *topNode) override
 
int process_event (PHCompositeNode *topNode) override
 
int Reset (PHCompositeNode *topNode) override
 Reset.
 
int ResetEvent (PHCompositeNode *topNode) override
 Clean up after each event.
 
int EndRun (const int runnumber) override
 Called at the end of each run.
 
int End (PHCompositeNode *topNode) override
 Called at the end of all processing.
 
void set_generator (PHG4ParticleGeneratorBase *generator)
 
void set_time_window (double past_nsec, double future_nsec)
 past times are negative, future times are positive
 
void set_collision_rate (double kHz)
 
void set_time_between_crossings (double nsec)
 
- Public Member Functions inherited from PHG4ParticleGeneratorBase
 ~PHG4ParticleGeneratorBase () override
 
virtual void set_name (const std::string &particle="proton")
 
virtual void set_pid (const int pid)
 
virtual void set_mom (const double x, const double y, const double z)
 
virtual void set_vtx (const double x, const double y, const double z)
 
virtual void set_vtx_z (const double z)
 
virtual void set_t0 (const double t)
 
virtual double get_vtx_x () const
 
virtual double get_vtx_y () const
 
virtual double get_vtx_z () const
 
virtual double get_t0 () const
 
void Print (const std::string &what="ALL") const override
 
virtual void PrintParticles (const std::string &what="ALL") const
 
virtual void AddParticle (const std::string &particle, const double x, const double y, const double z)
 
virtual void AddParticle (const int pid, const double x, const double y, const double z)
 
virtual void Embed (const int i=1)
 
virtual int ReuseExistingVertex (PHCompositeNode *topNode)
 
int get_reuse_existing_vertex () const
 
void set_reuse_existing_vertex (const int i=1)
 
void set_seed (const unsigned int iseed)
 
unsigned int get_seed () const
 
- Public Member Functions inherited from SubsysReco
 ~SubsysReco () override
 
- Public Member Functions inherited from Fun4AllBase
virtual ~Fun4AllBase ()
 
virtual const std::string Name () const
 Returns the name of this module.
 
virtual void Name (const std::string &name)
 Sets the name of this module.
 
virtual void Verbosity (const int ival)
 Sets the verbosity of this module (0 by default=quiet).
 
virtual void Verbosity (enu_Verbosity ival)
 Sets the verbosity of this module (0 by default=quiet).
 
virtual int Verbosity () const
 Gets the verbosity of this module.
 

Private Attributes

PHG4ParticleGeneratorBase_generator = nullptr
 
double _min_integration_time = -1000.
 
double _max_integration_time = 1000.
 
double _collision_rate = 100.
 
double _time_between_crossings = 106.
 
double _ave_coll_per_crossing = 1.
 
int _min_crossing = 0
 
int _max_crossing = 0
 

Additional Inherited Members

- Public Types inherited from Fun4AllBase
enum  enu_Verbosity {
  VERBOSITY_QUIET = 0, VERBOSITY_SOME = 1, VERBOSITY_MORE = 2, VERBOSITY_EVEN_MORE = 3,
  VERBOSITY_A_LOT = 4, VERBOSITY_MAX = std::numeric_limits<int>::max() - 10
}
 
- Protected Member Functions inherited from PHG4ParticleGeneratorBase
 PHG4ParticleGeneratorBase (const std::string &name="GENERATORBASE")
 
int get_pdgcode (const std::string &name) const
 
std::string get_pdgname (const int pdgcode) const
 
double get_mass (const int pdgcode) const
 
void CheckAndCreateParticleVector ()
 
void SetParticleId (PHG4Particle *particle, PHG4InEvent *ineve)
 
gsl_rng * RandomGenerator () const
 
int EmbedFlag () const
 
std::vector< PHG4Particle * >
::iterator 
particlelist_begin ()
 
std::vector< PHG4Particle * >
::iterator 
particlelist_end ()
 
void ResetParticleList ()
 

Detailed Description

Definition at line 12 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 12 of file PHG4PileupGenerator.h

Constructor & Destructor Documentation

PHG4PileupGenerator::PHG4PileupGenerator ( const std::string &  name = "PILEUPGENERATOR")

Definition at line 11 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 11 of file PHG4PileupGenerator.cc

PHG4PileupGenerator::~PHG4PileupGenerator ( )
override

Definition at line 17 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 17 of file PHG4PileupGenerator.cc

References _generator.

Member Function Documentation

int PHG4PileupGenerator::End ( PHCompositeNode )
overridevirtual

Called at the end of all processing.

Reimplemented from SubsysReco.

Definition at line 88 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 88 of file PHG4PileupGenerator.cc

References _generator, SubsysReco::End(), and Fun4AllReturnCodes::EVENT_OK.

+ Here is the call graph for this function:

int PHG4PileupGenerator::EndRun ( const int  )
overridevirtual

Called at the end of each run.

Reimplemented from SubsysReco.

Definition at line 81 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 81 of file PHG4PileupGenerator.cc

References _generator, SubsysReco::EndRun(), and Fun4AllReturnCodes::EVENT_OK.

+ Here is the call graph for this function:

int PHG4PileupGenerator::Init ( PHCompositeNode )
overridevirtual

Called during initialization. Typically this is where you can book histograms, and e.g. register them to Fun4AllServer (so they can be output to file using Fun4AllServer::dumpHistos() method).

Reimplemented from SubsysReco.

Definition at line 22 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 22 of file PHG4PileupGenerator.cc

References _generator, Fun4AllReturnCodes::EVENT_OK, and SubsysReco::Init().

+ Here is the call graph for this function:

int PHG4PileupGenerator::InitRun ( PHCompositeNode )
overridevirtual

Called for first event when run number is known. Typically this is where you may want to fetch data from database, because you know the run number.

Reimplemented from PHG4ParticleGeneratorBase.

Definition at line 29 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 29 of file PHG4PileupGenerator.cc

References _ave_coll_per_crossing, _collision_rate, _generator, _max_crossing, _max_integration_time, _min_crossing, _min_integration_time, _time_between_crossings, Acts::UnitConstants::e, Fun4AllReturnCodes::EVENT_OK, and PHG4ParticleGeneratorBase::InitRun().

+ Here is the call graph for this function:

int PHG4PileupGenerator::process_event ( PHCompositeNode )
overridevirtual

Called for each event. This is where you do the real work.

Reimplemented from PHG4ParticleGeneratorBase.

Definition at line 45 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 45 of file PHG4PileupGenerator.cc

References _ave_coll_per_crossing, _generator, _max_crossing, _min_crossing, _time_between_crossings, Fun4AllReturnCodes::EVENT_OK, PHG4ParticleGeneratorBase::process_event(), PHG4ParticleGeneratorBase::RandomGenerator(), and PHG4ParticleGeneratorBase::set_t0().

+ Here is the call graph for this function:

int PHG4PileupGenerator::Reset ( PHCompositeNode )
overridevirtual

Reset.

Reimplemented from SubsysReco.

Definition at line 67 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 67 of file PHG4PileupGenerator.cc

References _generator, Fun4AllReturnCodes::EVENT_OK, and SubsysReco::Reset().

+ Here is the call graph for this function:

int PHG4PileupGenerator::ResetEvent ( PHCompositeNode )
overridevirtual

Clean up after each event.

Reimplemented from SubsysReco.

Definition at line 74 of file PHG4PileupGenerator.cc.

View newest version in sPHENIX GitHub at line 74 of file PHG4PileupGenerator.cc

References _generator, Fun4AllReturnCodes::EVENT_OK, and SubsysReco::ResetEvent().

+ Here is the call graph for this function:

void PHG4PileupGenerator::set_collision_rate ( double  kHz)
inline

Definition at line 34 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 34 of file PHG4PileupGenerator.h

References _collision_rate.

void PHG4PileupGenerator::set_generator ( PHG4ParticleGeneratorBase generator)
inline

Definition at line 26 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 26 of file PHG4PileupGenerator.h

References _generator, and Fatras::Test::generator.

void PHG4PileupGenerator::set_time_between_crossings ( double  nsec)
inline

Definition at line 35 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 35 of file PHG4PileupGenerator.h

References _time_between_crossings.

void PHG4PileupGenerator::set_time_window ( double  past_nsec,
double  future_nsec 
)
inline

past times are negative, future times are positive

Definition at line 29 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 29 of file PHG4PileupGenerator.h

References _max_integration_time, and _min_integration_time.

Member Data Documentation

double PHG4PileupGenerator::_ave_coll_per_crossing = 1.
private

Definition at line 45 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 45 of file PHG4PileupGenerator.h

Referenced by InitRun(), and process_event().

double PHG4PileupGenerator::_collision_rate = 100.
private

Definition at line 42 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 42 of file PHG4PileupGenerator.h

Referenced by InitRun(), and set_collision_rate().

PHG4ParticleGeneratorBase* PHG4PileupGenerator::_generator = nullptr
private

Definition at line 38 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 38 of file PHG4PileupGenerator.h

Referenced by End(), EndRun(), Init(), InitRun(), process_event(), Reset(), ResetEvent(), set_generator(), and ~PHG4PileupGenerator().

int PHG4PileupGenerator::_max_crossing = 0
private

Definition at line 47 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 47 of file PHG4PileupGenerator.h

Referenced by InitRun(), and process_event().

double PHG4PileupGenerator::_max_integration_time = 1000.
private

Definition at line 41 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 41 of file PHG4PileupGenerator.h

Referenced by InitRun(), and set_time_window().

int PHG4PileupGenerator::_min_crossing = 0
private

Definition at line 46 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 46 of file PHG4PileupGenerator.h

Referenced by InitRun(), and process_event().

double PHG4PileupGenerator::_min_integration_time = -1000.
private

Definition at line 40 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 40 of file PHG4PileupGenerator.h

Referenced by InitRun(), and set_time_window().

double PHG4PileupGenerator::_time_between_crossings = 106.
private

Definition at line 43 of file PHG4PileupGenerator.h.

View newest version in sPHENIX GitHub at line 43 of file PHG4PileupGenerator.h

Referenced by InitRun(), process_event(), and set_time_between_crossings().


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