File indexing completed on 2025-12-17 09:21:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef CLUSTERSTATUSMAPPER_H
0012 #define CLUSTERSTATUSMAPPER_H
0013
0014
0015 #include "CaloStatusMapperDefs.h"
0016
0017
0018 #include <jetqa/JetQADefs.h>
0019
0020
0021
0022 #include <fun4all/SubsysReco.h>
0023
0024
0025 #include <cstdint>
0026 #include <map>
0027 #include <string>
0028 #include <utility>
0029 #include <vector>
0030
0031
0032 class PHCompositeNode;
0033 class Fun4AllHistoManager;
0034 class TH1;
0035 class TowerInfoContainer;
0036 class TriggerAnalyzer;
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 class CaloStatusMapper : public SubsysReco
0047 {
0048
0049 public:
0050
0051
0052
0053
0054 struct Config
0055 {
0056
0057
0058 bool debug {true};
0059
0060
0061 bool doNorm {false};
0062
0063
0064 bool doOptHist {false};
0065
0066
0067 std::string moduleName {"CaloStatusMapper"};
0068
0069
0070 std::string histTag {""};
0071
0072
0073 std::vector<CaloStatusMapperDefs::NodeDef> inNodeNames
0074 {
0075 {"TOWERINFO_CALIB_CEMC", CaloStatusMapperDefs::Calo::EMCal},
0076 {"TOWERINFO_CALIB_HCALIN", CaloStatusMapperDefs::Calo::HCal},
0077 {"TOWERINFO_CALIB_HCALOUT", CaloStatusMapperDefs::Calo::HCal}
0078 };
0079
0080
0081 bool doTrgSelect {false};
0082
0083
0084 uint32_t trgToSelect {JetQADefs::GL1::MBDNSJet1};
0085
0086 };
0087
0088
0089 CaloStatusMapper(const std::string& modulename = "CaloStatusMapper", const bool debug = false);
0090 CaloStatusMapper(const Config& config);
0091 ~CaloStatusMapper() override;
0092
0093
0094 void SetConfig(const Config& config) {m_config = config;}
0095
0096
0097 const Config& GetConfig() {return m_config;}
0098
0099
0100 int Init(PHCompositeNode* ) override;
0101 int process_event(PHCompositeNode* topNode) override;
0102 int End(PHCompositeNode* ) override;
0103
0104 private:
0105
0106
0107 void InitHistManager();
0108 void BuildHistograms();
0109 void GrabNodes(PHCompositeNode* topNode);
0110 std::string MakeBaseName(const std::string& base, const std::string& node, const std::string& stat = "") const;
0111
0112
0113 Config m_config;
0114
0115
0116 Fun4AllHistoManager* m_manager {nullptr};
0117
0118
0119 TriggerAnalyzer* m_analyzer {nullptr};
0120
0121
0122 std::map<std::string, TH1*> m_hists;
0123 TH1 *allCaloEnergy {nullptr};
0124
0125
0126 std::vector<TowerInfoContainer*> m_inNodes;
0127
0128
0129 uint64_t m_nEvent {0};
0130
0131
0132 std::map<std::string, int> m_totalBin;
0133
0134 };
0135
0136 #endif
0137
0138