Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:45

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef JETBASE_JETCALIB_H
0004 #define JETBASE_JETCALIB_H
0005 
0006 #include <calobase/TowerInfoContainer.h>
0007 #include <fun4all/SubsysReco.h>
0008 
0009 #include <iostream>
0010 #include <limits>
0011 #include <string>
0012 
0013 class CDBTF;
0014 class PHCompositeNode;
0015 class TF1;
0016 
0017 class JetCalib : public SubsysReco
0018 {
0019  public:
0020   explicit JetCalib(const std::string &name = "JetCalib");
0021   ~JetCalib() override;
0022 
0023   int InitRun(PHCompositeNode *topNode) override;
0024   int process_event(PHCompositeNode *topNode) override;
0025   int CreateNodeTree(PHCompositeNode *topNode);
0026 
0027   // Getters.
0028   void set_InputNode(const std::string &inputNode) { m_inputNode = inputNode; }
0029   void set_OutputNode(const std::string &outputNode) { m_outputNode = outputNode; }
0030   void set_JetRadius(float radius) { jet_radius = radius; }
0031   void set_ZvrtxNode(const std::string &zvrtxNode) { m_zvrtxNode = zvrtxNode; }
0032   void set_ApplyZvrtxDependentCalib(bool apply) { ApplyZvrtxDependentCalib = apply; }
0033   void set_ApplyEtaDependentCalib(bool apply) { ApplyEtaDependentCalib = apply; }
0034 
0035  private:
0036   // Functions.
0037   static std::string fetchCalibDir(const char *calibType);
0038   float doCalibration(const std::vector<std::vector<TF1 *>> &JetCalibFunc, float jetPt, float zvrtx, float eta) const;
0039 
0040   // Input.
0041   std::string m_inputNode{"AntiKt_Tower_r04"};
0042   std::string m_outputNode{"AntiKt_Tower_r04_Calib"};
0043   std::string m_zvrtxNode{"GlobalVertexMap"};
0044   float jet_radius{0.4};                 // Jet radius.
0045   bool ApplyZvrtxDependentCalib{false};  // Apply Z-vertex dependent calibration.
0046   bool ApplyEtaDependentCalib{false};    // Apply eta dependent calibration.
0047 
0048   // Variables.
0049   CDBTF *m_JetCalibFile{nullptr};
0050   std::vector<std::vector<TF1 *>> m_JetCalibFunc{};
0051 };
0052 
0053 #endif  // JETBASE_JETCALIB_H