File indexing completed on 2025-08-03 08:18:25
0001 #ifndef G4EVAL_CALOEVALUATOR_H
0002 #define G4EVAL_CALOEVALUATOR_H
0003
0004
0005
0006
0007
0008
0009
0010 #include <fun4all/SubsysReco.h>
0011
0012 #include <set>
0013 #include <string>
0014
0015 class CaloEvalStack;
0016 class PHCompositeNode;
0017 class TFile;
0018 class TNtuple;
0019 class TTree;
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 class CaloEvaluator : public SubsysReco
0030 {
0031 public:
0032 CaloEvaluator(const std::string &name = "CALOEVALUATOR",
0033 const std::string &caloname = "CEMC",
0034 const std::string &filename = "g4eval_cemc.root");
0035 ~CaloEvaluator() override{};
0036
0037 int Init(PHCompositeNode *topNode) override;
0038 int process_event(PHCompositeNode *topNode) override;
0039 int End(PHCompositeNode *topNode) override;
0040
0041
0042
0043
0044 void set_event(int ievent)
0045 {
0046 _ievent = ievent;
0047 }
0048
0049 void set_strict(bool b) { _strict = b; }
0050
0051
0052
0053
0054
0055
0056
0057
0058 void add_truth_tracing_embed_flag(int flag)
0059 {
0060 _truth_trace_embed_flags.insert(flag);
0061 }
0062
0063
0064
0065
0066
0067 void set_truth_tracing_energy_threshold(float thresh)
0068 {
0069 _truth_e_threshold = thresh;
0070 }
0071
0072
0073
0074
0075 void set_reco_tracing_energy_threshold(float thresh)
0076 {
0077 _reco_e_threshold = thresh;
0078 }
0079
0080
0081
0082
0083 void set_do_gpoint_eval(bool b) { _do_gpoint_eval = b; }
0084 void set_do_gshower_eval(bool b) { _do_gshower_eval = b; }
0085 void set_do_tower_eval(bool b) { _do_tower_eval = b; }
0086 void set_do_cluster_eval(bool b) { _do_cluster_eval = b; }
0087 void set_use_towerinfo(bool b) { _use_towerinfo = b; }
0088
0089 private:
0090
0091 void printInputInfo(PHCompositeNode *topNode);
0092 void fillOutputNtuples(PHCompositeNode *topNode);
0093 void printOutputInfo(PHCompositeNode *topNode);
0094
0095 CaloEvalStack *_caloevalstack = nullptr;
0096 TFile *_tfile = nullptr;
0097 TNtuple *_ntp_cluster = nullptr;
0098 TNtuple *_ntp_gpoint = nullptr;
0099 TNtuple *_ntp_gshower = nullptr;
0100 TNtuple *_ntp_tower = nullptr;
0101 TTree *_tower_debug = nullptr;
0102
0103 unsigned int _ievent = 0;
0104 unsigned int _towerID_debug = 0;
0105 unsigned int m_EvtCounter = 0;
0106
0107 int _ieta_debug = 0;
0108 int _iphi_debug = 0;
0109
0110 float _eta_debug = 0.;
0111 float _phi_debug = 0.;
0112 float _e_debug = 0.;
0113 float _x_debug = 0.;
0114 float _y_debug = 0.;
0115 float _z_debug = 0.;
0116 float _truth_e_threshold = 0.;
0117 float _reco_e_threshold = 0.;
0118
0119 bool _do_cluster_eval = true;
0120 bool _do_gpoint_eval = true;
0121 bool _do_gshower_eval = true;
0122 bool _do_tower_eval = true;
0123 bool _use_towerinfo = false;
0124 bool _strict = false;
0125
0126 std::string _caloname;
0127 std::string _filename;
0128 std::set<int> _truth_trace_embed_flags;
0129 };
0130
0131 #endif