File indexing completed on 2025-08-03 08:16:59
0001
0002
0003 #ifndef CALOTOWERSTATUS_H
0004 #define CALOTOWERSTATUS_H
0005
0006 #include "CaloTowerDefs.h"
0007
0008 #include <calobase/TowerInfoContainer.h> // for TowerInfoContainer, TowerIn...
0009
0010 #include <fun4all/SubsysReco.h>
0011
0012 #include <iostream>
0013 #include <string>
0014
0015 class CDBTTree;
0016 class PHCompositeNode;
0017 class TowerInfoContainer;
0018
0019 class CaloTowerStatus : public SubsysReco
0020 {
0021 public:
0022 CaloTowerStatus(const std::string &name = "CaloTowerStatus");
0023
0024 ~CaloTowerStatus() override;
0025
0026 int InitRun(PHCompositeNode *topNode) override;
0027 int process_event(PHCompositeNode *topNode) override;
0028 void CreateNodeTree(PHCompositeNode *topNode);
0029
0030 void set_detector_type(CaloTowerDefs::DetectorSystem dettype)
0031 {
0032 m_dettype = dettype;
0033 return;
0034 }
0035 void set_inputNodePrefix(const std::string &name)
0036 {
0037 m_inputNodePrefix = name;
0038 return;
0039 }
0040 void set_badChi2_const_threshold(float threshold)
0041 {
0042 badChi2_treshold_const = threshold;
0043 return;
0044 }
0045 void set_badChi2_quadratic_threshold(float threshold)
0046 {
0047 badChi2_treshold_quadratic = threshold;
0048 return;
0049 }
0050 void set_fraction_badChi2_threshold(float threshold)
0051 {
0052 fraction_badChi2_threshold = threshold;
0053 return;
0054 }
0055 void set_badChi2_max_threshold(float threshold)
0056 {
0057 badChi2_treshold_max = threshold;
0058 return;
0059 }
0060 void set_z_score_threshold(float threshold)
0061 {
0062 z_score_threshold = threshold;
0063 return;
0064 }
0065 void set_time_cut(float threshold)
0066 {
0067 time_cut = threshold;
0068 return;
0069 }
0070 void set_directURL_hotMap(const std::string &str)
0071 {
0072 m_directURL_hotMap = str;
0073 use_directURL_hotMap = true;
0074 return;
0075 }
0076 void set_directURL_time(const std::string &str)
0077 {
0078 m_directURL_time = str;
0079 use_directURL_time = true;
0080 return;
0081 }
0082 void set_directURL_chi2(const std::string &str)
0083 {
0084 m_directURL_chi2 = str;
0085 use_directURL_chi2 = true;
0086 return;
0087 }
0088 void set_doAbortNoHotMap(bool status = true)
0089 {
0090 m_doAbortNoHotMap = status;
0091 return;
0092 }
0093 void set_isSim(bool isSim = true)
0094 {
0095 m_isSim = isSim;
0096 return;
0097 }
0098
0099 private:
0100 TowerInfoContainer *m_raw_towers{nullptr};
0101
0102 CDBTTree *m_cdbttree_chi2{nullptr};
0103 CDBTTree *m_cdbttree_time{nullptr};
0104 CDBTTree *m_cdbttree_hotMap{nullptr};
0105
0106 bool m_doHotChi2{true};
0107 bool m_doTime{true};
0108 bool m_doHotMap{true};
0109 bool m_doAbortNoHotMap{false};
0110
0111 CaloTowerDefs::DetectorSystem m_dettype{CaloTowerDefs::DETECTOR_INVALID};
0112
0113 std::string m_detector;
0114 std::string m_fieldname_time;
0115 std::string m_calibName_time;
0116 std::string m_fieldname_chi2;
0117 std::string m_calibName_chi2;
0118 std::string m_fieldname_hotMap;
0119 std::string m_fieldname_z_score;
0120 std::string m_calibName_hotMap;
0121 std::string m_inputNodePrefix{"TOWERS_"};
0122
0123 std::string m_directURL_time;
0124 std::string m_directURL_hotMap;
0125 std::string m_directURL_chi2;
0126 bool use_directURL_time{false};
0127 bool use_directURL_hotMap{false};
0128 bool use_directURL_chi2{false};
0129 bool m_isSim{false};
0130
0131 float badChi2_treshold_const = {1e4};
0132 float badChi2_treshold_quadratic = {1./100};
0133 float badChi2_treshold_max = {1e8};
0134 float fraction_badChi2_threshold = {0.01};
0135 float z_score_threshold = {5};
0136 float z_score_threshold_default = {5};
0137 float time_cut = 2;
0138 };
0139
0140 #endif