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