File indexing completed on 2025-08-05 08:13:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef CLUSTERSTATUSMAPPER_H
0012 #define CLUSTERSTATUSMAPPER_H
0013
0014
0015
0016 #include <jetqa/JetQADefs.h>
0017
0018
0019 #include "CaloStatusMapperDefs.h"
0020
0021
0022 #include <calobase/TowerInfoContainerv2.h>
0023
0024
0025 #include <fun4all/SubsysReco.h>
0026
0027
0028 #include <map>
0029 #include <string>
0030 #include <vector>
0031
0032
0033 class PHCompositeNode;
0034 class Fun4AllHistoManager;
0035 class TH1;
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 std::string moduleName {"CaloStatusMapper"};
0062
0063
0064 std::string histTag {""};
0065
0066
0067 std::vector<CaloStatusMapperDefs::NodeDef> inNodeNames
0068 {
0069 {"TOWERINFO_CALIB_CEMC", CaloStatusMapperDefs::Calo::EMCal},
0070 {"TOWERINFO_CALIB_HCALIN", CaloStatusMapperDefs::Calo::HCal},
0071 {"TOWERINFO_CALIB_HCALOUT", CaloStatusMapperDefs::Calo::HCal}
0072 };
0073
0074
0075 bool doTrgSelect {false};
0076
0077
0078 uint32_t trgToSelect {JetQADefs::GL1::MBDNSJet1};
0079
0080 };
0081
0082
0083 CaloStatusMapper(const std::string& modulename = "CaloStatusMapper", const bool debug = false);
0084 CaloStatusMapper(const Config& config);
0085 ~CaloStatusMapper() override;
0086
0087
0088 void SetConfig(const Config& config) {m_config = config;}
0089
0090
0091 Config GetConfig() {return m_config;}
0092
0093
0094 int Init(PHCompositeNode* ) override;
0095 int process_event(PHCompositeNode* topNode) override;
0096 int End(PHCompositeNode* ) override;
0097
0098 private:
0099
0100
0101 void InitHistManager();
0102 void BuildHistograms();
0103 void GrabNodes(PHCompositeNode* topNode);
0104 std::string MakeBaseName(const std::string& base, const std::string& node, const std::string& stat = "") const;
0105
0106
0107 Config m_config;
0108
0109
0110 Fun4AllHistoManager* m_manager {nullptr};
0111
0112
0113 TriggerAnalyzer* m_analyzer {nullptr};
0114
0115
0116 std::map<CaloStatusMapperDefs::Stat, std::string> m_mapStatLabels {CaloStatusMapperDefs::StatLabels()};
0117
0118
0119 std::map<std::string, TH1*> m_hists;
0120
0121
0122 std::vector<TowerInfoContainer*> m_inNodes;
0123
0124
0125 uint64_t m_nEvent {0};
0126
0127 };
0128
0129 #endif
0130
0131