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

#include <coresoftware/blob/master/simulation/g4simulation/g4eval/CaloTruthEval.h>

+ Collaboration diagram for CaloTruthEval:

Public Member Functions

 CaloTruthEval (PHCompositeNode *topNode, const std::string &caloname)
 example caloname: CEMC, HCALIN, HCALOUT
 
virtual ~CaloTruthEval ()
 
int get_caloid ()
 get the hash id for this calorimeter volume
 
void next_event (PHCompositeNode *topNode)
 reinitialize the eval for a new event
 
void do_caching (bool do_cache)
 activate or deactivate the memory caching inside the evaluation module
 
void set_strict (bool strict)
 
unsigned int get_errors ()
 get a count of the errors discovered thus far
 
void set_verbosity (int verbosity)
 adjust the messaging from the evalutaion module
 
bool has_reduced_node_pointers ()
 has the eval initialized correctly for reduced sim DST nodes?
 
PHG4Showerget_primary_shower (PHG4Shower *shower)
 what was the primary shower associated with the shower object?
 
PHG4Showerget_primary_shower (PHG4Particle *particle)
 what was the primary shower associated with the shower object?
 
PHG4Particleget_primary_particle (PHG4Shower *shower)
 what was the primary particle associated with the shower object?
 
PHG4Particleget_primary_particle (PHG4Particle *particle)
 what was the primary particle associated with another or same particle?
 
int get_embed (PHG4Particle *particle)
 what was the embed flag passed with this particle?
 
PHG4VtxPointget_vertex (PHG4Particle *particle)
 what was particle's creation point?
 
bool are_same_shower (PHG4Shower *s1, PHG4Shower *s2)
 are these two pointers in fact the same shower?
 
bool are_same_particle (PHG4Particle *p1, PHG4Particle *p2)
 are these two pointers in fact the same particle?
 
bool are_same_vertex (PHG4VtxPoint *vtx1, PHG4VtxPoint *vtx2)
 are these two pointers in fact the same vertex?
 
bool is_primary (PHG4Shower *shower)
 is this a primary shower?
 
bool is_primary (PHG4Particle *particle)
 is this a primary particle?
 
float get_shower_energy_deposit (PHG4Particle *primary)
 how much energy did this primary and its shower deposit in the calo volume?
 
float get_shower_eh_ratio (PHG4Particle *primary)
 what was the electron/hadron radio of energy deposits inside the calo colume?
 
bool has_full_node_pointers ()
 has the eval initialized correctly for full sim DST nodes?
 
std::set< PHG4Hit * > all_truth_hits (PHG4Shower *shower)
 what truth hits are contained within this shower entry in this calo volume?
 
std::set< PHG4Hit * > all_truth_hits (PHG4Particle *particle)
 what truth hits were left behind by this particle in this calo volume?
 
PHG4Particleget_parent_particle (PHG4Hit *g4hit)
 what particle created this truth hit?
 
PHG4Particleget_primary_particle (PHG4Hit *g4hit)
 what primary particle was responsible for this truth hit?
 
bool is_g4hit_from_particle (PHG4Hit *g4hit, PHG4Particle *particle)
 did this particle create this truth hit?
 
std::set< PHG4Hit * > get_shower_hits_from_primary (PHG4Particle *primary)
 what truth hits are the result of this primary particle and its shower
 

Private Member Functions

void get_node_pointers (PHCompositeNode *topNode)
 

Private Attributes

BaseTruthEval _basetrutheval
 
std::string _caloname
 
int _caloid
 
PHG4TruthInfoContainer_truthinfo = nullptr
 
PHG4HitContainer_g4hits = nullptr
 
int _g4hit_container_id = -1
 
bool _strict = false
 
int _verbosity = 1
 
unsigned int _errors = 0
 
bool _do_cache = true
 
std::map< PHG4Particle *, float > _cache_get_shower_energy_deposit
 
std::map< PHG4Shower
*, std::set< PHG4Hit * > > 
_cache_all_truth_hits_g4shower
 
std::map< PHG4Particle
*, std::set< PHG4Hit * > > 
_cache_all_truth_hits_g4particle
 
std::map< PHG4Hit
*, PHG4Particle * > 
_cache_get_primary_particle_g4hit
 
std::map< PHG4Particle
*, std::set< PHG4Hit * > > 
_cache_get_shower_hits_from_primary
 

Detailed Description

Definition at line 19 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 19 of file CaloTruthEval.h

Constructor & Destructor Documentation

CaloTruthEval::CaloTruthEval ( PHCompositeNode topNode,
const std::string &  caloname 
)

example caloname: CEMC, HCALIN, HCALOUT

Definition at line 17 of file CaloTruthEval.cc.

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

References get_node_pointers().

+ Here is the call graph for this function:

CaloTruthEval::~CaloTruthEval ( )
virtual

Definition at line 25 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 25 of file CaloTruthEval.cc

References _errors, and _verbosity.

Member Function Documentation

std::set< PHG4Hit * > CaloTruthEval::all_truth_hits ( PHG4Shower shower)

what truth hits are contained within this shower entry in this calo volume?

Definition at line 245 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 245 of file CaloTruthEval.cc

References _cache_all_truth_hits_g4shower, _do_cache, _errors, _g4hit_container_id, _g4hits, _strict, assert, PHG4Shower::end_g4hit_id(), PHG4Shower::find_g4hit_id(), PHG4HitContainer::findHit(), and has_full_node_pointers().

Referenced by get_shower_hits_from_primary().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::set< PHG4Hit * > CaloTruthEval::all_truth_hits ( PHG4Particle particle)

what truth hits were left behind by this particle in this calo volume?

Definition at line 314 of file CaloTruthEval.cc.

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

References _cache_all_truth_hits_g4particle, _do_cache, _errors, _g4hits, _strict, assert, PHG4HitContainer::getHits(), has_full_node_pointers(), and is_g4hit_from_particle().

+ Here is the call graph for this function:

bool CaloTruthEval::are_same_particle ( PHG4Particle p1,
PHG4Particle p2 
)

are these two pointers in fact the same particle?

Definition at line 103 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 103 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::are_same_particle().

+ Here is the call graph for this function:

bool CaloTruthEval::are_same_shower ( PHG4Shower s1,
PHG4Shower s2 
)

are these two pointers in fact the same shower?

Definition at line 98 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 98 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::are_same_shower().

+ Here is the call graph for this function:

bool CaloTruthEval::are_same_vertex ( PHG4VtxPoint vtx1,
PHG4VtxPoint vtx2 
)

are these two pointers in fact the same vertex?

Definition at line 108 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 108 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::are_same_vertex().

+ Here is the call graph for this function:

void CaloTruthEval::do_caching ( bool  do_cache)
inline

activate or deactivate the memory caching inside the evaluation module

Definition at line 33 of file CaloTruthEval.h.

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

References _do_cache.

Referenced by CaloRawTowerEval::do_caching().

+ Here is the caller graph for this function:

int CaloTruthEval::get_caloid ( )
inline

get the hash id for this calorimeter volume

Definition at line 27 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 27 of file CaloTruthEval.h

References _caloid.

Referenced by CaloEvaluator::fillOutputNtuples(), CaloEvalStack::get_caloid(), CaloRawClusterEval::get_caloid(), CaloRawTowerEval::get_caloid(), and get_shower_eh_ratio().

+ Here is the caller graph for this function:

int CaloTruthEval::get_embed ( PHG4Particle particle)

what was the embed flag passed with this particle?

Definition at line 88 of file CaloTruthEval.cc.

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

References _basetrutheval, and BaseTruthEval::get_embed().

Referenced by CaloEvaluator::fillOutputNtuples(), and CaloEvaluator::printOutputInfo().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int CaloTruthEval::get_errors ( )
inline

get a count of the errors discovered thus far

Definition at line 44 of file CaloTruthEval.h.

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

References _errors.

Referenced by CaloRawTowerEval::get_errors().

+ Here is the caller graph for this function:

void CaloTruthEval::get_node_pointers ( PHCompositeNode topNode)
private

Definition at line 488 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 488 of file CaloTruthEval.cc

References _caloname, _g4hit_container_id, _g4hits, _truthinfo, PHG4HitDefs::get_volume_id(), and perf_headwind::name.

Referenced by CaloTruthEval(), and next_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHG4Particle * CaloTruthEval::get_parent_particle ( PHG4Hit g4hit)

what particle created this truth hit?

Definition at line 370 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 370 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::get_particle().

+ Here is the call graph for this function:

PHG4Particle * CaloTruthEval::get_primary_particle ( PHG4Shower shower)

what was the primary particle associated with the shower object?

Definition at line 78 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 78 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::get_primary_particle().

Referenced by CaloRawClusterEval::all_clusters_from(), CaloRawTowerEval::all_towers_from(), CaloRawClusterEval::all_truth_primary_particles(), CaloRawTowerEval::all_truth_primary_particles(), CaloRawClusterEval::best_cluster_from(), CaloRawTowerEval::best_tower_from(), CaloRawClusterEval::get_energy_contribution(), CaloRawTowerEval::get_energy_contribution(), get_shower_energy_deposit(), get_shower_hits_from_primary(), CaloRawClusterEval::max_truth_primary_particle_by_energy(), and CaloRawTowerEval::max_truth_primary_particle_by_energy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHG4Particle * CaloTruthEval::get_primary_particle ( PHG4Particle particle)

what was the primary particle associated with another or same particle?

Definition at line 83 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 83 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::get_primary_particle().

+ Here is the call graph for this function:

PHG4Particle * CaloTruthEval::get_primary_particle ( PHG4Hit g4hit)

what primary particle was responsible for this truth hit?

Definition at line 375 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 375 of file CaloTruthEval.cc

References _basetrutheval, _cache_get_primary_particle_g4hit, _do_cache, _errors, _strict, assert, BaseTruthEval::get_primary_particle(), and has_full_node_pointers().

+ Here is the call graph for this function:

PHG4Shower * CaloTruthEval::get_primary_shower ( PHG4Shower shower)

what was the primary shower associated with the shower object?

Definition at line 68 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 68 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::get_primary_shower().

Referenced by CaloRawClusterEval::all_clusters_from(), CaloRawTowerEval::all_towers_from(), JetTruthEval::all_truth_showers(), CaloRawClusterEval::best_cluster_from(), CaloRawTowerEval::best_tower_from(), CaloEvaluator::fillOutputNtuples(), CaloRawClusterEval::get_energy_contribution(), CaloRawTowerEval::get_energy_contribution(), get_shower_eh_ratio(), get_shower_energy_deposit(), and get_shower_hits_from_primary().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHG4Shower * CaloTruthEval::get_primary_shower ( PHG4Particle particle)

what was the primary shower associated with the shower object?

Definition at line 73 of file CaloTruthEval.cc.

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

References _basetrutheval, and BaseTruthEval::get_primary_shower().

+ Here is the call graph for this function:

float CaloTruthEval::get_shower_eh_ratio ( PHG4Particle primary)

what was the electron/hadron radio of energy deposits inside the calo colume?

Definition at line 183 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 183 of file CaloTruthEval.cc

References _errors, _strict, assert, get_caloid(), PHG4Shower::get_eh_ratio(), get_primary_shower(), has_full_node_pointers(), and is_primary().

+ Here is the call graph for this function:

float CaloTruthEval::get_shower_energy_deposit ( PHG4Particle primary)

how much energy did this primary and its shower deposit in the calo volume?

Definition at line 123 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 123 of file CaloTruthEval.cc

References _cache_get_shower_energy_deposit, _do_cache, _errors, _g4hit_container_id, _strict, assert, PHG4Shower::get_edep(), get_primary_particle(), get_primary_shower(), has_reduced_node_pointers(), and is_primary().

Referenced by CaloEvaluator::fillOutputNtuples(), and CaloEvaluator::printOutputInfo().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::set< PHG4Hit * > CaloTruthEval::get_shower_hits_from_primary ( PHG4Particle primary)

what truth hits are the result of this primary particle and its shower

Definition at line 427 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 427 of file CaloTruthEval.cc

References _cache_get_shower_hits_from_primary, _do_cache, _errors, _strict, all_truth_hits(), assert, get_primary_particle(), get_primary_shower(), has_full_node_pointers(), and is_primary().

+ Here is the call graph for this function:

PHG4VtxPoint * CaloTruthEval::get_vertex ( PHG4Particle particle)

what was particle's creation point?

Definition at line 93 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 93 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::get_vertex().

Referenced by CaloEvaluator::fillOutputNtuples(), and CaloEvaluator::printOutputInfo().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CaloTruthEval::has_full_node_pointers ( )

has the eval initialized correctly for full sim DST nodes?

Definition at line 217 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 217 of file CaloTruthEval.cc

References _basetrutheval, _g4hits, _strict, _truthinfo, assert, and BaseTruthEval::has_full_node_pointers().

Referenced by all_truth_hits(), get_primary_particle(), get_shower_eh_ratio(), and get_shower_hits_from_primary().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CaloTruthEval::has_reduced_node_pointers ( )

has the eval initialized correctly for reduced sim DST nodes?

Definition at line 49 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 49 of file CaloTruthEval.cc

References _basetrutheval, _strict, _truthinfo, assert, and BaseTruthEval::has_reduced_node_pointers().

Referenced by get_shower_energy_deposit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CaloTruthEval::is_g4hit_from_particle ( PHG4Hit g4hit,
PHG4Particle particle 
)

did this particle create this truth hit?

Definition at line 422 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 422 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::is_g4hit_from_particle().

Referenced by all_truth_hits().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CaloTruthEval::is_primary ( PHG4Shower shower)

is this a primary shower?

Definition at line 113 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 113 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::is_primary().

Referenced by CaloRawClusterEval::all_clusters_from(), CaloRawTowerEval::all_towers_from(), CaloRawTowerEval::best_tower_from(), CaloRawTowerEval::get_energy_contribution(), get_shower_eh_ratio(), get_shower_energy_deposit(), and get_shower_hits_from_primary().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CaloTruthEval::is_primary ( PHG4Particle particle)

is this a primary particle?

Definition at line 118 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 118 of file CaloTruthEval.cc

References _basetrutheval, and BaseTruthEval::is_primary().

+ Here is the call graph for this function:

void CaloTruthEval::next_event ( PHCompositeNode topNode)

reinitialize the eval for a new event

Definition at line 36 of file CaloTruthEval.cc.

View newest version in sPHENIX GitHub at line 36 of file CaloTruthEval.cc

References _basetrutheval, _cache_all_truth_hits_g4particle, _cache_all_truth_hits_g4shower, _cache_get_primary_particle_g4hit, _cache_get_shower_energy_deposit, _cache_get_shower_hits_from_primary, get_node_pointers(), and BaseTruthEval::next_event().

Referenced by CaloRawTowerEval::next_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CaloTruthEval::set_strict ( bool  strict)
inline

strict mode will assert when an error is detected non-strict mode will notice and report at the End()

Definition at line 37 of file CaloTruthEval.h.

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

References _basetrutheval, _strict, and BaseTruthEval::set_strict().

Referenced by CaloRawTowerEval::set_strict().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CaloTruthEval::set_verbosity ( int  verbosity)
inline

adjust the messaging from the evalutaion module

Definition at line 47 of file CaloTruthEval.h.

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

References _basetrutheval, _verbosity, BaseTruthEval::set_verbosity(), and verbosity.

Referenced by CaloRawTowerEval::set_verbosity().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::map<PHG4Particle*, std::set<PHG4Hit*> > CaloTruthEval::_cache_all_truth_hits_g4particle
private

Definition at line 138 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 138 of file CaloTruthEval.h

Referenced by all_truth_hits(), and next_event().

std::map<PHG4Shower*, std::set<PHG4Hit*> > CaloTruthEval::_cache_all_truth_hits_g4shower
private

Definition at line 137 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 137 of file CaloTruthEval.h

Referenced by all_truth_hits(), and next_event().

std::map<PHG4Hit*, PHG4Particle*> CaloTruthEval::_cache_get_primary_particle_g4hit
private

Definition at line 139 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 139 of file CaloTruthEval.h

Referenced by get_primary_particle(), and next_event().

std::map<PHG4Particle*, float> CaloTruthEval::_cache_get_shower_energy_deposit
private

Definition at line 136 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 136 of file CaloTruthEval.h

Referenced by get_shower_energy_deposit(), and next_event().

std::map<PHG4Particle*, std::set<PHG4Hit*> > CaloTruthEval::_cache_get_shower_hits_from_primary
private

Definition at line 140 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 140 of file CaloTruthEval.h

Referenced by get_shower_hits_from_primary(), and next_event().

int CaloTruthEval::_caloid
private

Definition at line 126 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 126 of file CaloTruthEval.h

Referenced by get_caloid().

std::string CaloTruthEval::_caloname
private

Definition at line 125 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 125 of file CaloTruthEval.h

Referenced by get_node_pointers().

bool CaloTruthEval::_do_cache = true
private

Definition at line 135 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 135 of file CaloTruthEval.h

Referenced by all_truth_hits(), do_caching(), get_primary_particle(), get_shower_energy_deposit(), and get_shower_hits_from_primary().

unsigned int CaloTruthEval::_errors = 0
private
int CaloTruthEval::_g4hit_container_id = -1
private

Definition at line 129 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 129 of file CaloTruthEval.h

Referenced by all_truth_hits(), get_node_pointers(), and get_shower_energy_deposit().

PHG4HitContainer* CaloTruthEval::_g4hits = nullptr
private

Definition at line 128 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 128 of file CaloTruthEval.h

Referenced by all_truth_hits(), get_node_pointers(), and has_full_node_pointers().

bool CaloTruthEval::_strict = false
private
PHG4TruthInfoContainer* CaloTruthEval::_truthinfo = nullptr
private

Definition at line 127 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 127 of file CaloTruthEval.h

Referenced by get_node_pointers(), has_full_node_pointers(), and has_reduced_node_pointers().

int CaloTruthEval::_verbosity = 1
private

Definition at line 132 of file CaloTruthEval.h.

View newest version in sPHENIX GitHub at line 132 of file CaloTruthEval.h

Referenced by set_verbosity(), and ~CaloTruthEval().


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