File indexing completed on 2025-08-05 08:13:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BEAMBACKGROUNDFILTERANDQA_H
0013 #define BEAMBACKGROUNDFILTERANDQA_H
0014
0015
0016 #include "BaseBeamBackgroundFilter.h"
0017 #include "NullFilter.h"
0018 #include "StreakSidebandFilter.h"
0019
0020
0021 #include <fun4all/SubsysReco.h>
0022
0023
0024 #include <phparameter/PHParameters.h>
0025
0026
0027 #include <map>
0028 #include <memory>
0029 #include <string>
0030 #include <vector>
0031
0032
0033 class Fun4AllHistoManager;
0034 class PHCompositeNode;
0035 class QAHistManagerHistDef;
0036 class TowerInfoContainer;
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 class BeamBackgroundFilterAndQA : public SubsysReco {
0048
0049 public:
0050
0051
0052
0053
0054 struct Config
0055 {
0056
0057
0058 bool debug = true;
0059 bool doQA = true;
0060 bool doEvtAbort = false;
0061
0062
0063 std::string moduleName = "BeamBackgroundFilterAndQA";
0064
0065
0066 std::string flagPrefix = "HasBeamBackground";
0067
0068
0069 std::string histTag = "";
0070
0071
0072 std::vector<std::string> filtersToApply = {"Null", "StreakSideband"};
0073
0074
0075 NullFilter::Config null;
0076 StreakSidebandFilter::Config sideband;
0077
0078
0079 };
0080
0081
0082 BeamBackgroundFilterAndQA(const std::string& name = "BeamBackgroundFilterAndQA", const bool debug = false);
0083 BeamBackgroundFilterAndQA(const Config& config);
0084 ~BeamBackgroundFilterAndQA() override;
0085
0086
0087 void SetConfig(const Config& config) {m_config = config;}
0088
0089
0090 Config GetConfig() const {return m_config;}
0091
0092
0093 int Init(PHCompositeNode* topNode) override;
0094 int process_event(PHCompositeNode* topNode) override;
0095 int End(PHCompositeNode* ) override;
0096
0097 private:
0098
0099
0100 void InitFilters();
0101 void InitFlags(PHCompositeNode* topNode);
0102 void InitHistManager();
0103 void BuildHistograms();
0104 void RegisterHistograms();
0105 void SetDefaultFlags();
0106 void UpdateFlags(PHCompositeNode* topNode);
0107 bool ApplyFilters(PHCompositeNode* topNode);
0108 std::string MakeFlagName(const std::string& filter = "");
0109
0110
0111 Fun4AllHistoManager* m_manager;
0112
0113
0114 PHParameters m_flags;
0115
0116
0117 std::map<std::string, TH1*> m_hists;
0118
0119
0120 Config m_config;
0121
0122
0123 std::map<std::string, std::unique_ptr<BaseBeamBackgroundFilter>> m_filters;
0124
0125 };
0126
0127 #endif
0128
0129