EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CaloEvaluator Class Reference

Compares reconstructed showers to truth particles. More...

#include <fun4all_coresoftware/blob/master/simulation/g4simulation/g4eval/CaloEvaluator.h>

+ Inheritance diagram for CaloEvaluator:
+ Collaboration diagram for CaloEvaluator:

Public Member Functions

 CaloEvaluator (const std::string &name="CALOEVALUATOR", const std::string &caloname="CEMC", const std::string &filename="g4eval_cemc.root")
 
 ~CaloEvaluator () override
 
int Init (PHCompositeNode *topNode) override
 
int process_event (PHCompositeNode *topNode) override
 
int End (PHCompositeNode *topNode) override
 Called at the end of all processing.
 
void set_strict (bool b)
 
void add_truth_tracing_embed_flag (int flag)
 
void set_truth_tracing_energy_threshold (float thresh)
 
void set_reco_tracing_energy_threshold (float thresh)
 
void set_do_gpoint_eval (bool b)
 
void set_do_gshower_eval (bool b)
 
void set_do_tower_eval (bool b)
 
void set_do_cluster_eval (bool b)
 
- Public Member Functions inherited from SubsysReco
 ~SubsysReco () override
 
virtual int EndRun (const int)
 Called at the end of each run.
 
virtual int InitRun (PHCompositeNode *)
 
virtual int Reset (PHCompositeNode *)
 Reset.
 
virtual int ResetEvent (PHCompositeNode *)
 Clean up after each event.
 
void Print (const std::string &="ALL") const 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 Member Functions

void printInputInfo (PHCompositeNode *topNode)
 print out the input object information (debugging upstream components)
 
void fillOutputNtuples (PHCompositeNode *topNode)
 dump the evaluator information into ntuple for external analysis
 
void printOutputInfo (PHCompositeNode *topNode)
 print out the ancestry information for detailed diagnosis
 

Private Attributes

std::string _caloname
 
unsigned int _ievent
 
unsigned int _towerID_debug
 
int _ieta_debug
 
int _iphi_debug
 
float _eta_debug
 
float _phi_debug
 
float _e_debug
 
float _x_debug
 
float _y_debug
 
float _z_debug
 
std::set< int > _truth_trace_embed_flags
 
float _truth_e_threshold
 
float _reco_e_threshold
 
CaloEvalStack_caloevalstack
 
bool _strict
 
bool _do_gpoint_eval
 
bool _do_gshower_eval
 
bool _do_tower_eval
 
bool _do_cluster_eval
 
TNtuple * _ntp_gpoint
 
TNtuple * _ntp_gshower
 
TNtuple * _ntp_tower
 
TTree * _tower_debug
 
TNtuple * _ntp_cluster
 
std::string _filename
 
TFile * _tfile
 

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

Detailed Description

Compares reconstructed showers to truth particles.

Plan: This module will trace the reconstructed clusters back to the greatest contributor Monte Carlo particle and then test one against the other.

Definition at line 29 of file CaloEvaluator.h.

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

Constructor & Destructor Documentation

CaloEvaluator::CaloEvaluator ( const std::string &  name = "CALOEVALUATOR",
const std::string &  caloname = "CEMC",
const std::string &  filename = "g4eval_cemc.root" 
)

Definition at line 44 of file CaloEvaluator.cc.

View newest version in sPHENIX GitHub at line 44 of file CaloEvaluator.cc

CaloEvaluator::~CaloEvaluator ( )
inlineoverride

Definition at line 35 of file CaloEvaluator.h.

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

Member Function Documentation

void CaloEvaluator::add_truth_tracing_embed_flag ( int  flag)
inline

Definition at line 50 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 50 of file CaloEvaluator.h

References _truth_trace_embed_flags.

int CaloEvaluator::End ( PHCompositeNode )
overridevirtual

Called at the end of all processing.

Reimplemented from SubsysReco.

Definition at line 164 of file CaloEvaluator.cc.

View newest version in sPHENIX GitHub at line 164 of file CaloEvaluator.cc

References _caloevalstack, _do_cluster_eval, _do_gpoint_eval, _do_gshower_eval, _do_tower_eval, _filename, _ievent, _ntp_cluster, _ntp_gpoint, _ntp_gshower, _ntp_tower, _tfile, _tower_debug, Fun4AllReturnCodes::EVENT_OK, Fun4AllBase::Name(), and Fun4AllBase::Verbosity().

+ Here is the call graph for this function:

void CaloEvaluator::fillOutputNtuples ( PHCompositeNode topNode)
private

dump the evaluator information into ntuple for external analysis

Definition at line 391 of file CaloEvaluator.cc.

View newest version in sPHENIX GitHub at line 391 of file CaloEvaluator.cc

References _caloevalstack, _caloname, _do_cluster_eval, _do_gpoint_eval, _do_tower_eval, _e_debug, _eta_debug, _ieta_debug, _ievent, _iphi_debug, _ntp_cluster, _ntp_gpoint, _ntp_gshower, _ntp_tower, _phi_debug, _reco_e_threshold, _tower_debug, _towerID_debug, _truth_e_threshold, _truth_trace_embed_flags, _x_debug, _y_debug, _z_debug, GlobalVertexMap::begin(), CaloRawClusterEval::best_cluster_from(), Acts::UnitConstants::e, GlobalVertexMap::empty(), Acts::VectorHelpers::eta(), exit(), RawTower::get_bineta(), RawTower::get_binphi(), CaloTruthEval::get_caloid(), RawTowerGeom::get_center_x(), RawTowerGeom::get_center_y(), RawTowerGeom::get_center_z(), PHG4Particle::get_e(), CaloTruthEval::get_embed(), RawCluster::get_energy(), RawTower::get_energy(), CaloRawTowerEval::get_energy_contribution(), CaloRawClusterEval::get_energy_contribution(), RawTowerGeom::get_eta(), RawCluster::get_id(), RawTower::get_id(), PHG4Shower::get_nhits(), RawCluster::get_phi(), RawTowerGeom::get_phi(), PHG4Particle::get_pid(), CaloTruthEval::get_primary_shower(), PHG4Particle::get_px(), PHG4Particle::get_py(), PHG4Particle::get_pz(), CaloEvalStack::get_rawcluster_eval(), CaloEvalStack::get_rawtower_eval(), CaloTruthEval::get_shower_energy_deposit(), RawTowerGeomContainer::get_tower_geometry(), PHG4Particle::get_track_id(), CaloEvalStack::get_truth_eval(), CaloTruthEval::get_vertex(), PHG4VtxPoint::get_x(), GlobalVertex::get_x(), RawCluster::get_x(), PHG4VtxPoint::get_y(), GlobalVertex::get_y(), RawCluster::get_y(), PHG4VtxPoint::get_z(), GlobalVertex::get_z(), RawCluster::get_z(), RawClusterContainer::getClustersMap(), RawCluster::getNTowers(), PHG4TruthInfoContainer::GetPrimaryVertexIndex(), PHG4TruthInfoContainer::GetPrimaryVtx(), RawClusterUtility::GetPseudorapidity(), RawTowerContainer::getTowers(), RawTower::identify(), CaloRawTowerEval::max_truth_primary_particle_by_energy(), CaloRawClusterEval::max_truth_primary_particle_by_energy(), Fun4AllBase::Name(), phi, PHWHERE, Fun4AllBase::Verbosity(), vtx(), x, y, and z.

Referenced by process_event().

+ Here is the caller graph for this function:

int CaloEvaluator::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 78 of file CaloEvaluator.cc.

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

References _do_cluster_eval, _do_gpoint_eval, _do_gshower_eval, _do_tower_eval, _e_debug, _eta_debug, _filename, _ieta_debug, _ievent, _iphi_debug, _ntp_cluster, _ntp_gpoint, _ntp_gshower, _ntp_tower, _phi_debug, _tfile, _tower_debug, _towerID_debug, _x_debug, _y_debug, _z_debug, and Fun4AllReturnCodes::EVENT_OK.

void CaloEvaluator::printInputInfo ( PHCompositeNode topNode)
private

print out the input object information (debugging upstream components)

Definition at line 193 of file CaloEvaluator.cc.

View newest version in sPHENIX GitHub at line 193 of file CaloEvaluator.cc

References _ievent, exit(), PHG4Particle::get_pid(), PHG4Particle::get_px(), PHG4Particle::get_py(), PHG4TruthInfoContainer::GetParticleRange(), Fun4AllBase::Name(), particle, PHWHERE, and Fun4AllBase::Verbosity().

Referenced by process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CaloEvaluator::printOutputInfo ( PHCompositeNode topNode)
private

print out the ancestry information for detailed diagnosis

Definition at line 230 of file CaloEvaluator.cc.

View newest version in sPHENIX GitHub at line 230 of file CaloEvaluator.cc

References _caloevalstack, _ievent, CaloRawClusterEval::all_clusters_from(), GlobalVertexMap::begin(), Acts::UnitConstants::e, GlobalVertexMap::empty(), exit(), PHG4Particle::get_e(), CaloTruthEval::get_embed(), RawCluster::get_energy(), CaloRawClusterEval::get_energy_contribution(), RawCluster::get_id(), RawCluster::get_phi(), PHG4Particle::get_pid(), PHG4Particle::get_px(), PHG4Particle::get_py(), PHG4Particle::get_pz(), CaloEvalStack::get_rawcluster_eval(), CaloTruthEval::get_shower_energy_deposit(), PHG4Particle::get_track_id(), CaloEvalStack::get_truth_eval(), CaloTruthEval::get_vertex(), PHG4VtxPoint::get_x(), GlobalVertex::get_x(), RawCluster::get_x(), PHG4VtxPoint::get_y(), GlobalVertex::get_y(), RawCluster::get_y(), PHG4VtxPoint::get_z(), GlobalVertex::get_z(), RawCluster::get_z(), RawCluster::getNTowers(), PHG4TruthInfoContainer::GetPrimaryParticleRange(), PHG4TruthInfoContainer::GetPrimaryVertexIndex(), PHG4TruthInfoContainer::GetPrimaryVtx(), phi, PHWHERE, Fun4AllBase::Verbosity(), vtx(), x, y, and z.

Referenced by process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int CaloEvaluator::process_event ( PHCompositeNode )
overridevirtual

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

Reimplemented from SubsysReco.

Definition at line 128 of file CaloEvaluator.cc.

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

References _caloevalstack, _caloname, _ievent, _strict, Fun4AllReturnCodes::EVENT_OK, fillOutputNtuples(), CaloEvalStack::next_event(), printInputInfo(), printOutputInfo(), CaloEvalStack::set_strict(), CaloEvalStack::set_verbosity(), and Fun4AllBase::Verbosity().

+ Here is the call graph for this function:

void CaloEvaluator::set_do_cluster_eval ( bool  b)
inline

Definition at line 78 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 78 of file CaloEvaluator.h

References _do_cluster_eval.

Referenced by BECAL_Eval(), EEMCH_Eval(), and ZDC_Eval().

+ Here is the caller graph for this function:

void CaloEvaluator::set_do_gpoint_eval ( bool  b)
inline

Definition at line 75 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 75 of file CaloEvaluator.h

References _do_gpoint_eval.

void CaloEvaluator::set_do_gshower_eval ( bool  b)
inline

Definition at line 76 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 76 of file CaloEvaluator.h

References _do_gshower_eval.

void CaloEvaluator::set_do_tower_eval ( bool  b)
inline

Definition at line 77 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 77 of file CaloEvaluator.h

References _do_tower_eval.

void CaloEvaluator::set_reco_tracing_energy_threshold ( float  thresh)
inline

Definition at line 67 of file CaloEvaluator.h.

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

References _reco_e_threshold.

void CaloEvaluator::set_strict ( bool  b)
inline

Definition at line 41 of file CaloEvaluator.h.

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

References _strict.

void CaloEvaluator::set_truth_tracing_energy_threshold ( float  thresh)
inline

Definition at line 59 of file CaloEvaluator.h.

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

References _truth_e_threshold.

Member Data Documentation

CaloEvalStack* CaloEvaluator::_caloevalstack
private

Definition at line 100 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 100 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), printOutputInfo(), and process_event().

std::string CaloEvaluator::_caloname
private

Definition at line 81 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 81 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and process_event().

bool CaloEvaluator::_do_cluster_eval
private

Definition at line 110 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 110 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), Init(), and set_do_cluster_eval().

bool CaloEvaluator::_do_gpoint_eval
private

Definition at line 107 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 107 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), Init(), and set_do_gpoint_eval().

bool CaloEvaluator::_do_gshower_eval
private

Definition at line 108 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 108 of file CaloEvaluator.h

Referenced by End(), Init(), and set_do_gshower_eval().

bool CaloEvaluator::_do_tower_eval
private

Definition at line 109 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 109 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), Init(), and set_do_tower_eval().

float CaloEvaluator::_e_debug
private

Definition at line 91 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 91 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().

float CaloEvaluator::_eta_debug
private

Definition at line 89 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 89 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().

std::string CaloEvaluator::_filename
private

Definition at line 119 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 119 of file CaloEvaluator.h

Referenced by End(), and Init().

int CaloEvaluator::_ieta_debug
private

Definition at line 87 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 87 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().

unsigned int CaloEvaluator::_ievent
private

Definition at line 83 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 83 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), Init(), printInputInfo(), printOutputInfo(), and process_event().

int CaloEvaluator::_iphi_debug
private

Definition at line 88 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 88 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().

TNtuple* CaloEvaluator::_ntp_cluster
private

Definition at line 116 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 116 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), and Init().

TNtuple* CaloEvaluator::_ntp_gpoint
private

Definition at line 112 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 112 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), and Init().

TNtuple* CaloEvaluator::_ntp_gshower
private

Definition at line 113 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 113 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), and Init().

TNtuple* CaloEvaluator::_ntp_tower
private

Definition at line 114 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 114 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), and Init().

float CaloEvaluator::_phi_debug
private

Definition at line 90 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 90 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().

float CaloEvaluator::_reco_e_threshold
private

Definition at line 98 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 98 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and set_reco_tracing_energy_threshold().

bool CaloEvaluator::_strict
private

Definition at line 105 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 105 of file CaloEvaluator.h

Referenced by process_event(), and set_strict().

TFile* CaloEvaluator::_tfile
private

Definition at line 120 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 120 of file CaloEvaluator.h

Referenced by End(), and Init().

TTree* CaloEvaluator::_tower_debug
private

Definition at line 115 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 115 of file CaloEvaluator.h

Referenced by End(), fillOutputNtuples(), and Init().

unsigned int CaloEvaluator::_towerID_debug
private

Definition at line 86 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 86 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().

float CaloEvaluator::_truth_e_threshold
private

Definition at line 97 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 97 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and set_truth_tracing_energy_threshold().

std::set<int> CaloEvaluator::_truth_trace_embed_flags
private

Definition at line 96 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 96 of file CaloEvaluator.h

Referenced by add_truth_tracing_embed_flag(), and fillOutputNtuples().

float CaloEvaluator::_x_debug
private

Definition at line 92 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 92 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().

float CaloEvaluator::_y_debug
private

Definition at line 93 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 93 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().

float CaloEvaluator::_z_debug
private

Definition at line 94 of file CaloEvaluator.h.

View newest version in sPHENIX GitHub at line 94 of file CaloEvaluator.h

Referenced by fillOutputNtuples(), and Init().


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