File indexing completed on 2025-08-05 08:16:35
0001 #ifndef JETBACKGROUND_DETERMINETOWERBACKGROUND_H
0002 #define JETBACKGROUND_DETERMINETOWERBACKGROUND_H
0003
0004
0005
0006
0007
0008
0009
0010 #include <fun4all/SubsysReco.h>
0011
0012
0013 #include <jetbase/Jet.h>
0014 #include <string>
0015 #include <vector>
0016
0017
0018 class PHCompositeNode;
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 class DetermineTowerBackground : public SubsysReco
0029 {
0030 public:
0031 DetermineTowerBackground(const std::string &name = "DetermineTowerBackground");
0032 ~DetermineTowerBackground() override {}
0033
0034 int InitRun(PHCompositeNode *topNode) override;
0035 int process_event(PHCompositeNode *topNode) override;
0036
0037 void SetBackgroundOutputName(const std::string &name) { _backgroundName = name; }
0038 void SetSeedType(int seed_type) { _seed_type = seed_type; }
0039 void SetFlow(int do_flow) { _do_flow = do_flow; };
0040
0041 void SetSeedJetD(float D) { _seed_jet_D = D; };
0042 void SetSeedJetPt(float pt) { _seed_jet_pt = pt; };
0043 void SetSeedMaxConst(float max_const) { _seed_max_const = max_const; };
0044
0045 void UseReweighting(bool do_reweight ) { _do_reweight = do_reweight; }
0046
0047 void set_towerinfo(bool use_towerinfo)
0048 {
0049 m_use_towerinfo = use_towerinfo;
0050 }
0051 void set_towerNodePrefix(const std::string &prefix)
0052 {
0053 m_towerNodePrefix = prefix;
0054 return;
0055 }
0056
0057 private:
0058
0059 int CreateNode(PHCompositeNode *topNode);
0060 void FillNode(PHCompositeNode *topNode);
0061
0062 int _do_flow{0};
0063 float _v2{0};
0064 float _Psi2{0};
0065 std::vector<std::vector<float> > _UE;
0066 int _nStrips{0};
0067 int _nTowers{0};
0068
0069 int _HCAL_NETA{-1};
0070 int _HCAL_NPHI{-1};
0071
0072
0073 std::vector<std::vector<float> > _EMCAL_E;
0074 std::vector<std::vector<float> > _IHCAL_E;
0075 std::vector<std::vector<float> > _OHCAL_E;
0076
0077 std::vector<std::vector<int> > _EMCAL_ISBAD;
0078 std::vector<std::vector<int> > _IHCAL_ISBAD;
0079 std::vector<std::vector<int> > _OHCAL_ISBAD;
0080
0081
0082
0083 std::vector<float> _FULLCALOFLOW_PHI_E;
0084 std::vector<float> _FULLCALOFLOW_PHI_VAL;
0085
0086 bool _do_reweight{true};
0087 std::vector<float> _EMCAL_PHI_WEIGHTS;
0088 std::vector<float> _IHCAL_PHI_WEIGHTS;
0089 std::vector<float> _OHCAL_PHI_WEIGHTS;
0090
0091 std::string _backgroundName{"TestTowerBackground"};
0092
0093 int _seed_type{0};
0094 float _seed_jet_D{4.0};
0095 float _seed_max_const{3.0};
0096 float _seed_jet_pt{7.0};
0097
0098 std::vector<float> _seed_eta;
0099 std::vector<float> _seed_phi;
0100
0101 Jet::PROPERTY _index_SeedD{};
0102 Jet::PROPERTY _index_SeedItr{};
0103
0104 bool m_use_towerinfo{false};
0105 bool _is_flow_failure{false};
0106 bool _reweight_failed{false};
0107
0108 std::string m_towerNodePrefix{"TOWERINFO_CALIB"};
0109 std::string EMTowerName;
0110 std::string IHTowerName;
0111 std::string OHTowerName;
0112 };
0113
0114 #endif