Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:20:11

0001 #ifndef JETBACKGROUND_DETERMINETOWERBACKGROUND_H
0002 #define JETBACKGROUND_DETERMINETOWERBACKGROUND_H
0003 
0004 //===========================================================
0005 /// \file DetermineTowerBackground.h
0006 /// \brief UE background calculator
0007 /// \author Dennis V. Perepelitsa
0008 //===========================================================
0009 
0010 #include <fun4all/SubsysReco.h>
0011 
0012 // system includes
0013 #include <jetbase/Jet.h>
0014 #include <string>
0015 #include <vector>
0016 
0017 // forward declarations
0018 class PHCompositeNode;
0019 
0020 /// \class DetermineTowerBackground
0021 ///
0022 /// \brief UE background calculator
0023 ///
0024 /// This module constructs dE/deta vs. eta and v2 estimates given an
0025 /// (unsubtracted) set of calorimeter towers and possible a set of
0026 /// exclusion jets (seeds)
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_towerNodePrefix(const std::string &prefix)
0048   {
0049     m_towerNodePrefix = prefix;
0050     return;
0051   }
0052 
0053  private:
0054 
0055   int CreateNode(PHCompositeNode *topNode);
0056   void FillNode(PHCompositeNode *topNode);
0057 
0058   int _do_flow{0};
0059   float _v2{0};
0060   float _Psi2{0};
0061   std::vector<std::vector<float> > _UE;
0062   int _nStrips{0};
0063   int _nTowers{0};
0064 
0065   int _HCAL_NETA{-1};
0066   int _HCAL_NPHI{-1};
0067 
0068   
0069   std::vector<std::vector<float> > _EMCAL_E;
0070   std::vector<std::vector<float> > _IHCAL_E;
0071   std::vector<std::vector<float> > _OHCAL_E;
0072 
0073   std::vector<std::vector<int> > _EMCAL_ISBAD;
0074   std::vector<std::vector<int> > _IHCAL_ISBAD;
0075   std::vector<std::vector<int> > _OHCAL_ISBAD;
0076 
0077   // 1-D energies vs. phi (integrated over eta strips with complete
0078   // phi coverage, and all layers)
0079   std::vector<float> _FULLCALOFLOW_PHI_E;
0080   std::vector<float> _FULLCALOFLOW_PHI_VAL;
0081 
0082   bool _do_reweight{true}; // flag to indicate if reweighting is used
0083   std::vector<float> _EMCAL_PHI_WEIGHTS;
0084   std::vector<float> _IHCAL_PHI_WEIGHTS;
0085   std::vector<float> _OHCAL_PHI_WEIGHTS;
0086 
0087   std::string _backgroundName{"TestTowerBackground"};
0088 
0089   int _seed_type{0};
0090   float _seed_jet_D{4.0};
0091   float _seed_max_const{3.0};
0092   float _seed_jet_pt{7.0};
0093 
0094   std::vector<float> _seed_eta;
0095   std::vector<float> _seed_phi;
0096 
0097   Jet::PROPERTY _index_SeedD{};
0098   Jet::PROPERTY _index_SeedItr{};
0099 
0100   bool _is_flow_failure{false};
0101   bool _reweight_failed{false};
0102 
0103   std::string m_towerNodePrefix{"TOWERINFO_CALIB"};
0104   std::string EMTowerName;
0105   std::string IHTowerName;
0106   std::string OHTowerName;
0107 };
0108 
0109 #endif