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

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

+ Inheritance diagram for PHG4ParticleGeneratorBase:
+ Collaboration diagram for PHG4ParticleGeneratorBase:

Public Member Functions

 ~PHG4ParticleGeneratorBase () override
 
int InitRun (PHCompositeNode *topNode) override
 
int process_event (PHCompositeNode *topNode) 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
 
virtual int End (PHCompositeNode *)
 Called at the end of all processing.
 
virtual int EndRun (const int)
 Called at the end of each run.
 
virtual int Init (PHCompositeNode *)
 
virtual int Reset (PHCompositeNode *)
 Reset.
 
virtual int ResetEvent (PHCompositeNode *)
 Clean up after each event.
 
- 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.
 

Protected Member Functions

 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 ()
 
- Protected Member Functions inherited from SubsysReco
 SubsysReco (const std::string &name="NONAME")
 
- Protected Member Functions inherited from Fun4AllBase
 Fun4AllBase (const std::string &name="NONAME")
 

Private Attributes

gsl_rng * m_RandomGenerator = nullptr
 
int m_EmbedFlag = 0
 
int m_ReUseExistingVertexFlag = 0
 
unsigned int m_Seed = 0
 
double m_Vtx_x = 0.
 
double m_Vtx_y = 0.
 
double m_Vtx_z = 0.
 
double m_TZero = 0.
 
std::vector< PHG4Particle * > particlelist
 

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
}
 

Detailed Description

Definition at line 17 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 17 of file PHG4ParticleGeneratorBase.h

Constructor & Destructor Documentation

PHG4ParticleGeneratorBase::~PHG4ParticleGeneratorBase ( )
override

Definition at line 50 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 50 of file PHG4ParticleGeneratorBase.cc

References m_RandomGenerator, and particlelist.

PHG4ParticleGeneratorBase::PHG4ParticleGeneratorBase ( const std::string &  name = "GENERATORBASE")
protected

Definition at line 41 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 41 of file PHG4ParticleGeneratorBase.cc

References gsl_rng_set(), m_RandomGenerator, and m_Seed.

+ Here is the call graph for this function:

Member Function Documentation

void PHG4ParticleGeneratorBase::AddParticle ( const std::string &  particle,
const double  x,
const double  y,
const double  z 
)
virtual

Definition at line 162 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 162 of file PHG4ParticleGeneratorBase.cc

References get_pdgcode(), and particlelist.

Referenced by PHG4ParticleGeneratorD0::process_event(), and PHG4ParticleGeneratorVectorMeson::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PHG4ParticleGeneratorBase::AddParticle ( const int  pid,
const double  x,
const double  y,
const double  z 
)
virtual

Definition at line 168 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 168 of file PHG4ParticleGeneratorBase.cc

References particle, particlelist, PHG4Particle::set_pid(), PHG4Particle::set_px(), PHG4Particle::set_py(), and PHG4Particle::set_pz().

+ Here is the call graph for this function:

void PHG4ParticleGeneratorBase::CheckAndCreateParticleVector ( )
protected

Definition at line 178 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 178 of file PHG4ParticleGeneratorBase.cc

References particlelist.

Referenced by set_mom(), set_name(), and set_pid().

+ Here is the caller graph for this function:

virtual void PHG4ParticleGeneratorBase::Embed ( const int  i = 1)
inlinevirtual
int PHG4ParticleGeneratorBase::EmbedFlag ( ) const
inlineprotected

Definition at line 57 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 57 of file PHG4ParticleGeneratorBase.h

References m_EmbedFlag.

Referenced by PHG4ParticleGeneratorD0::process_event(), PHG4SimpleEventGenerator::process_event(), and PHG4ParticleGeneratorVectorMeson::process_event().

+ Here is the caller graph for this function:

double PHG4ParticleGeneratorBase::get_mass ( const int  pdgcode) const
protected

Definition at line 86 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 86 of file PHG4ParticleGeneratorBase.cc

References get_pdgname(), and Acts::UnitConstants::GeV.

Referenced by PHG4SimpleEventGenerator::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int PHG4ParticleGeneratorBase::get_pdgcode ( const std::string &  name) const
protected

Definition at line 61 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 61 of file PHG4ParticleGeneratorBase.cc

Referenced by AddParticle(), PHG4SimpleEventGenerator::process_event(), set_name(), and SetParticleId().

+ Here is the caller graph for this function:

std::string PHG4ParticleGeneratorBase::get_pdgname ( const int  pdgcode) const
protected

Definition at line 73 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 73 of file PHG4ParticleGeneratorBase.cc

Referenced by get_mass(), PHG4SimpleEventGenerator::InitRun(), and SetParticleId().

+ Here is the caller graph for this function:

int PHG4ParticleGeneratorBase::get_reuse_existing_vertex ( ) const
inline

Definition at line 44 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 44 of file PHG4ParticleGeneratorBase.h

References m_ReUseExistingVertexFlag.

Referenced by PHG4SimpleEventGenerator::InitRun(), and PHG4SimpleEventGenerator::process_event().

+ Here is the caller graph for this function:

unsigned int PHG4ParticleGeneratorBase::get_seed ( ) const
inline

Definition at line 47 of file PHG4ParticleGeneratorBase.h.

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

References m_Seed.

Referenced by PHG4SimpleEventGenerator::InitRun().

+ Here is the caller graph for this function:

virtual double PHG4ParticleGeneratorBase::get_t0 ( ) const
inlinevirtual

Definition at line 35 of file PHG4ParticleGeneratorBase.h.

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

References m_TZero.

Referenced by PHG4SimpleEventGenerator::InitRun(), PHG4ParticleGun::process_event(), PHG4IonGun::process_event(), PHG4ParticleGenerator::process_event(), PHG4ParticleGeneratorD0::process_event(), PHG4ParticleGeneratorVectorMeson::process_event(), and PHG4SimpleEventGenerator::process_event().

+ Here is the caller graph for this function:

virtual double PHG4ParticleGeneratorBase::get_vtx_x ( ) const
inlinevirtual

Definition at line 32 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 32 of file PHG4ParticleGeneratorBase.h

References m_Vtx_x.

Referenced by PHG4ParticleGun::process_event(), PHG4IonGun::process_event(), PHG4ParticleGenerator::process_event(), PHG4ParticleGeneratorD0::process_event(), PHG4ParticleGeneratorVectorMeson::process_event(), and PHG4SimpleEventGenerator::process_event().

+ Here is the caller graph for this function:

virtual double PHG4ParticleGeneratorBase::get_vtx_y ( ) const
inlinevirtual

Definition at line 33 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 33 of file PHG4ParticleGeneratorBase.h

References m_Vtx_y.

Referenced by PHG4ParticleGun::process_event(), PHG4IonGun::process_event(), PHG4ParticleGenerator::process_event(), PHG4ParticleGeneratorD0::process_event(), PHG4ParticleGeneratorVectorMeson::process_event(), and PHG4SimpleEventGenerator::process_event().

+ Here is the caller graph for this function:

virtual double PHG4ParticleGeneratorBase::get_vtx_z ( ) const
inlinevirtual

Definition at line 34 of file PHG4ParticleGeneratorBase.h.

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

References m_Vtx_z.

Referenced by PHG4ParticleGun::process_event(), PHG4IonGun::process_event(), PHG4ParticleGenerator::process_event(), PHG4ParticleGeneratorD0::process_event(), PHG4ParticleGeneratorVectorMeson::process_event(), and PHG4SimpleEventGenerator::process_event().

+ Here is the caller graph for this function:

int PHG4ParticleGeneratorBase::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 SubsysReco.

Reimplemented in PHG4ParticleGeneratorVectorMeson, PHG4SimpleEventGenerator, PHG4ParticleGeneratorD0, and PHG4PileupGenerator.

Definition at line 128 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 128 of file PHG4ParticleGeneratorBase.cc

References PHCompositeNode::addNode(), and PHNodeIterator::findFirst().

Referenced by PHG4PileupGenerator::InitRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector<PHG4Particle *>::iterator PHG4ParticleGeneratorBase::particlelist_begin ( )
inlineprotected

Definition at line 58 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 58 of file PHG4ParticleGeneratorBase.h

References particlelist.

Referenced by PHG4ParticleGun::process_event(), PHG4ParticleGenerator::process_event(), PHG4ParticleGeneratorD0::process_event(), PHG4ParticleGeneratorVectorMeson::process_event(), and ResetParticleList().

+ Here is the caller graph for this function:

std::vector<PHG4Particle *>::iterator PHG4ParticleGeneratorBase::particlelist_end ( )
inlineprotected

Definition at line 59 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 59 of file PHG4ParticleGeneratorBase.h

References particlelist.

Referenced by PHG4ParticleGun::process_event(), PHG4ParticleGenerator::process_event(), PHG4ParticleGeneratorD0::process_event(), PHG4ParticleGeneratorVectorMeson::process_event(), and ResetParticleList().

+ Here is the caller graph for this function:

void PHG4ParticleGeneratorBase::Print ( const std::string &  what = "ALL") const
inlineoverridevirtual

Print out some info about this module.

Parameters
whatcan be used to specify what to print exactly.

Reimplemented from SubsysReco.

Definition at line 37 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 37 of file PHG4ParticleGeneratorBase.h

References PrintParticles().

+ Here is the call graph for this function:

void PHG4ParticleGeneratorBase::PrintParticles ( const std::string &  what = "ALL") const
virtual

Definition at line 150 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 150 of file PHG4ParticleGeneratorBase.cc

References i, and particlelist.

Referenced by PHG4ParticleGenerator::Print(), and Print().

+ Here is the caller graph for this function:

int PHG4ParticleGeneratorBase::process_event ( PHCompositeNode )
overridevirtual

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

Reimplemented from SubsysReco.

Reimplemented in PHG4ParticleGeneratorVectorMeson, PHG4SimpleEventGenerator, PHG4ParticleGeneratorD0, PHG4PileupGenerator, and PHG4ParticleGun.

Definition at line 144 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 144 of file PHG4ParticleGeneratorBase.cc

References Fun4AllBase::Name(), and PHWHERE.

Referenced by PHG4PileupGenerator::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

gsl_rng* PHG4ParticleGeneratorBase::RandomGenerator ( ) const
inlineprotected

Definition at line 56 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 56 of file PHG4ParticleGeneratorBase.h

References m_RandomGenerator.

Referenced by PHG4ParticleGenerator::process_event(), PHG4ParticleGeneratorD0::process_event(), PHG4PileupGenerator::process_event(), PHG4SimpleEventGenerator::process_event(), PHG4ParticleGeneratorVectorMeson::process_event(), PHG4ParticleGeneratorVectorMeson::smearvtx(), and PHG4SimpleEventGenerator::smearvtx().

+ Here is the caller graph for this function:

void PHG4ParticleGeneratorBase::ResetParticleList ( )
protected

Definition at line 314 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 314 of file PHG4ParticleGeneratorBase.cc

References particlelist, particlelist_begin(), and particlelist_end().

Referenced by PHG4ParticleGeneratorD0::process_event(), and PHG4ParticleGeneratorVectorMeson::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int PHG4ParticleGeneratorBase::ReuseExistingVertex ( PHCompositeNode topNode)
virtual
void PHG4ParticleGeneratorBase::set_mom ( const double  x,
const double  y,
const double  z 
)
virtual

Definition at line 111 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 111 of file PHG4ParticleGeneratorBase.cc

References CheckAndCreateParticleVector(), and particlelist.

Referenced by Fun4All_EICAnalysis_DVCS(), Fun4All_G4_block(), Fun4All_G4_Calos(), Fun4All_G4_EICIR(), Fun4All_G4_Example01(), Fun4All_G4_Example02(), Fun4All_G4_Example03(), Fun4All_G4_Geantino(), Fun4All_G4_LeadBrick(), Fun4All_G4_MyDetector(), Fun4All_G4_Prototype2(), Fun4All_G4_Prototype3(), Fun4All_G4_Prototype4(), Fun4All_G4_sPHENIX_photonjet(), Fun4All_G4_sPHENIX_photons(), Fun4All_G4_sPHENIX_truthphotonjet(), Fun4All_G4_Write_Dst(), and Fun4All_single_particle().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PHG4ParticleGeneratorBase::set_name ( const std::string &  particle = "proton")
virtual
void PHG4ParticleGeneratorBase::set_pid ( const int  pid)
virtual

Definition at line 105 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 105 of file PHG4ParticleGeneratorBase.cc

References CheckAndCreateParticleVector(), and particlelist.

+ Here is the call graph for this function:

void PHG4ParticleGeneratorBase::set_reuse_existing_vertex ( const int  i = 1)
inline
void PHG4ParticleGeneratorBase::set_seed ( const unsigned int  iseed)

Definition at line 205 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 205 of file PHG4ParticleGeneratorBase.cc

References gsl_rng_set(), m_RandomGenerator, m_Seed, and Fun4AllBase::Name().

Referenced by Wrapper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void PHG4ParticleGeneratorBase::set_t0 ( const double  t)
inlinevirtual

Definition at line 30 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 30 of file PHG4ParticleGeneratorBase.h

References m_TZero, and t.

Referenced by PHG4ParticleGeneratorD0::process_event(), and PHG4PileupGenerator::process_event().

+ Here is the caller graph for this function:

virtual void PHG4ParticleGeneratorBase::set_vtx_z ( const double  z)
inlinevirtual

Definition at line 29 of file PHG4ParticleGeneratorBase.h.

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

References m_Vtx_z, and physmon_track_finding_ttbar::z.

Referenced by PHG4ParticleGenerator::process_event(), and PHG4ParticleGeneratorD0::process_event().

+ Here is the caller graph for this function:

void PHG4ParticleGeneratorBase::SetParticleId ( PHG4Particle particle,
PHG4InEvent ineve 
)
protected

Definition at line 188 of file PHG4ParticleGeneratorBase.cc.

View newest version in sPHENIX GitHub at line 188 of file PHG4ParticleGeneratorBase.cc

References PHG4InEvent::AddEmbeddedParticle(), PHG4Particle::get_name(), get_pdgcode(), get_pdgname(), PHG4Particle::get_pid(), m_EmbedFlag, PHG4Particle::set_name(), PHG4Particle::set_pid(), and size.

Referenced by PHG4ParticleGun::process_event(), PHG4ParticleGenerator::process_event(), PHG4IonGun::process_event(), PHG4ParticleGeneratorD0::process_event(), and PHG4ParticleGeneratorVectorMeson::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

int PHG4ParticleGeneratorBase::m_EmbedFlag = 0
private

Definition at line 64 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 64 of file PHG4ParticleGeneratorBase.h

Referenced by Embed(), EmbedFlag(), and SetParticleId().

gsl_rng* PHG4ParticleGeneratorBase::m_RandomGenerator = nullptr
private

Definition at line 63 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 63 of file PHG4ParticleGeneratorBase.h

Referenced by PHG4ParticleGeneratorBase(), RandomGenerator(), set_seed(), and ~PHG4ParticleGeneratorBase().

int PHG4ParticleGeneratorBase::m_ReUseExistingVertexFlag = 0
private

Definition at line 65 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 65 of file PHG4ParticleGeneratorBase.h

Referenced by get_reuse_existing_vertex(), ReuseExistingVertex(), and set_reuse_existing_vertex().

unsigned int PHG4ParticleGeneratorBase::m_Seed = 0
private

Definition at line 66 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 66 of file PHG4ParticleGeneratorBase.h

Referenced by get_seed(), PHG4ParticleGeneratorBase(), and set_seed().

double PHG4ParticleGeneratorBase::m_TZero = 0.
private

Definition at line 70 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 70 of file PHG4ParticleGeneratorBase.h

Referenced by get_t0(), and set_t0().

double PHG4ParticleGeneratorBase::m_Vtx_x = 0.
private

Definition at line 67 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 67 of file PHG4ParticleGeneratorBase.h

Referenced by get_vtx_x(), and set_vtx().

double PHG4ParticleGeneratorBase::m_Vtx_y = 0.
private

Definition at line 68 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 68 of file PHG4ParticleGeneratorBase.h

Referenced by get_vtx_y(), and set_vtx().

double PHG4ParticleGeneratorBase::m_Vtx_z = 0.
private

Definition at line 69 of file PHG4ParticleGeneratorBase.h.

View newest version in sPHENIX GitHub at line 69 of file PHG4ParticleGeneratorBase.h

Referenced by get_vtx_z(), set_vtx(), and set_vtx_z().

std::vector<PHG4Particle *> PHG4ParticleGeneratorBase::particlelist
private

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