Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:44

0001 /// ===========================================================================
0002 /*! \file   TrksInJetQABaseFiller.h
0003  *  \author Derek Anderson
0004  *  \date   04.11.2024
0005  *
0006  *  A submodule for the TrksInJetQA F4A module to produce
0007  *  QA histograms for tracks and more in jets
0008  */
0009 /// ===========================================================================
0010 
0011 #ifndef TRKSINJETQABASEFILLER_H
0012 #define TRKSINJETQABASEFILLER_H
0013 
0014 // submodule definitions
0015 #include "TrksInJetQAClustManager.h"
0016 #include "TrksInJetQAHitManager.h"
0017 #include "TrksInJetQAJetManager.h"
0018 #include "TrksInJetQATrkManager.h"
0019 
0020 // module utilties
0021 #include "TrksInJetQAConfig.h"
0022 #include "TrksInJetQAHist.h"
0023 
0024 // jet includes
0025 #include <jetbase/JetContainer.h>
0026 
0027 // phool libraries
0028 #include <phool/PHCompositeNode.h>
0029 #include <phool/getClass.h>
0030 #include <phool/phool.h>
0031 
0032 // tracking includes
0033 #include <trackbase/ActsGeometry.h>
0034 #include <trackbase/TrkrClusterContainer.h>
0035 #include <trackbase/TrkrHitSetContainer.h>
0036 #include <trackbase_historic/SvtxTrackMap.h>
0037 
0038 // root includes
0039 #include <TFile.h>
0040 
0041 // c++ includes
0042 #include <string>
0043 
0044 // ============================================================================
0045 //! Base histogram filler for TrksInJetQA module
0046 // ============================================================================
0047 /*! This class consolidates all common functionality
0048  *  for Histogram Fillers deployed in the TrksInJetQA
0049  *  module. The histogram fillers (as the name implies)
0050  *  define how to fill histograms for a specific
0051  *  population of objects:
0052  *    - Either those in-jets,
0053  *    - Or all of them ("inclusive"). 
0054  */
0055 class TrksInJetQABaseFiller
0056 {
0057  public:
0058   // ctor/dtor
0059   TrksInJetQABaseFiller(const TrksInJetQAConfig& config, TrksInJetQAHist& hist);
0060   virtual ~TrksInJetQABaseFiller() = default;
0061 
0062   // public methods
0063   void MakeHistograms(const std::string& prefix = "", const std::string& suffix = "");
0064   void SaveHistograms(TFile* outFile, const std::string& outDirName);
0065   void GrabHistograms(std::vector<TH1D*>& vecOutHist1D, std::vector<TH2D*>& vecOutHist2D);
0066 
0067   // virtual public methods
0068   virtual void Fill(PHCompositeNode* topNode) = 0;
0069 
0070  protected:
0071   // private methods
0072   void GetNodes(PHCompositeNode* topNode);
0073 
0074   // necessary dst nodes
0075   ActsGeometry* m_actsGeom {nullptr};
0076   TrkrHitSetContainer* m_hitMap {nullptr};
0077   TrkrClusterContainer* m_clustMap {nullptr};
0078   SvtxTrackMap* m_trkMap {nullptr};
0079   JetContainer* m_jetMap {nullptr};
0080 
0081   // submodules to use
0082   std::unique_ptr<TrksInJetQAHitManager> m_hitManager {nullptr};
0083   std::unique_ptr<TrksInJetQAClustManager> m_clustManager {nullptr};
0084   std::unique_ptr<TrksInJetQATrkManager> m_trackManager {nullptr};
0085   std::unique_ptr<TrksInJetQAJetManager> m_jetManager {nullptr};
0086 
0087   // module utilities
0088   TrksInJetQAConfig m_config;
0089   TrksInJetQAHist m_hist;
0090 
0091 };  // end TrksInJetQABaseFiller
0092 
0093 #endif
0094 
0095 // end ========================================================================