Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /// ===========================================================================
0002 /*! \file   TrksInJetQABaseManager.h
0003  *  \author Derek Anderson
0004  *  \date   04.03.2024
0005  *
0006  *  Base hist manager submodule for the TrksInJetQA module which
0007  *  consolidates methods/data common to all of the hist managers
0008  */
0009 /// ===========================================================================
0010 
0011 #ifndef TRKSINJETQABASEMANAGER_H
0012 #define TRKSINJETQABASEMANAGER_H
0013 
0014 // module utilities
0015 #include "TrksInJetQAConfig.h"
0016 #include "TrksInJetQADefs.h"
0017 #include "TrksInJetQAHist.h"
0018 
0019 // phool includes
0020 #include <phool/phool.h>
0021 
0022 // root includes
0023 #include <TDirectory.h>
0024 #include <TH1.h>
0025 #include <TH2.h>
0026 
0027 // c++ utilities
0028 #include <iostream>
0029 #include <regex>
0030 #include <string>
0031 #include <utility>
0032 #include <vector>
0033 
0034 // ============================================================================
0035 //! Base histogram manager for TrksInJetQA module
0036 // ============================================================================
0037 /*! This class consolidates all common functionality
0038  *  for Histogram Managers deployed in the TrksInJetQA
0039  *  module. The histogram managers define what variables
0040  *  to histogram for a given object (e.g. tracks) and
0041  *  how to extract the relevant information from that
0042  *  object.
0043  */
0044 class TrksInJetQABaseManager
0045 {
0046  public:
0047   // ctor/dtor
0048   TrksInJetQABaseManager(TrksInJetQAConfig& config, TrksInJetQAHist& hist);
0049   virtual ~TrksInJetQABaseManager();
0050 
0051   // public methods
0052   void MakeHistograms(const std::string& prefix = "", const std::string& suffix = "");
0053   void SaveHistograms(TDirectory* topDir, const std::string& outDirName);
0054   void GrabHistograms(std::vector<TH1D*>& vecOutHist1D, std::vector<TH2D*>& vecOutHist2D);
0055 
0056  protected:
0057   // private methods
0058   void BuildHistograms(const std::string& prefix = "", const std::string& suffix = "");
0059 
0060   // private helper methods
0061   bool IsInMvtx(const uint16_t layer) const;
0062   bool IsInIntt(const uint16_t layer) const;
0063   bool IsInTpc(const uint16_t layer) const;
0064   int Index(const int type, const int hist) const;
0065 
0066   // virtual private methods
0067   virtual void DefineHistograms() = 0;
0068 
0069   // histograms
0070   TrksInJetQADefs::MapHist1D m_mapHist1D;
0071   TrksInJetQADefs::MapHist2D m_mapHist2D;
0072 
0073   // histogram definitions
0074   TrksInJetQADefs::MapHistTypes m_mapHistTypes;
0075   TrksInJetQADefs::MapHistDef1D m_mapHistDef1D;
0076   TrksInJetQADefs::MapHistDef2D m_mapHistDef2D;
0077 
0078   // module utilities
0079   TrksInJetQAConfig m_config;
0080   TrksInJetQAHist m_hist;
0081 
0082 };  // end TrksInJetQABaseManager
0083 
0084 #endif
0085 
0086 // end ========================================================================