Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /// ===========================================================================
0002 /*! \file   TrksInJetQAJetManager.h
0003  *  \author Derek Anderson
0004  *  \date   03.26.2024
0005  *
0006  *  A submodule for the TrksInJetQA module
0007  *  to generate QA plots for jets
0008  */
0009 /// ===========================================================================
0010 
0011 #ifndef TRKSINJETQAJETMANAGER_H
0012 #define TRKSINJETQAJETMANAGER_H
0013 
0014 // submodule definitions
0015 #include "TrksInJetQABaseManager.h"
0016 
0017 // jet includes
0018 #include <jetbase/Jet.h>
0019 
0020 // tracking includes
0021 #include <trackbase_historic/SvtxTrack.h>
0022 
0023 // root includes
0024 #include <TH1.h>
0025 #include <TH2.h>
0026 
0027 // c++ utilities
0028 #include <limits>
0029 #include <optional>
0030 #include <utility>
0031 #include <vector>
0032 
0033 // ============================================================================
0034 //! Jet histogram manager for TrksInJetQA module
0035 // ============================================================================
0036 /*! This histogram manager defines what to histogram
0037  *  from jets.
0038  */
0039 class TrksInJetQAJetManager : public TrksInJetQABaseManager
0040 {
0041  public:
0042   ///! enumerate jet types 
0043   enum Type
0044   {
0045     All
0046   };
0047 
0048   ///! enumerate 1D histograms
0049   enum H1D
0050   {
0051     Eta,
0052     Phi,
0053     Pt,
0054     NTrk,
0055     PtSum
0056   };
0057 
0058   ///! enumerate 2D histograms
0059   enum H2D
0060   {
0061     PtVsEta,
0062     PtSumVsPt,
0063     NTrkVsEta,
0064     NTrkVsPt
0065   };
0066 
0067   // --------------------------------------------------------------------------
0068   //! Jet histogram content
0069   // --------------------------------------------------------------------------
0070   /*! A small struct to consolidate what variables
0071    *  to histogram for jets.
0072    */
0073   struct JetQAContent
0074   {
0075     double eta = std::numeric_limits<double>::max();
0076     double phi = std::numeric_limits<double>::max();
0077     double pt = std::numeric_limits<double>::max();
0078     double nTrk = std::numeric_limits<double>::max();
0079     double ptSum = std::numeric_limits<double>::max();
0080   };
0081 
0082   // ctor/dtor
0083   using TrksInJetQABaseManager::TrksInJetQABaseManager;
0084   virtual ~TrksInJetQAJetManager() override = default;
0085 
0086   // public methods
0087   void GetInfo(Jet* jet, std::optional<std::vector<SvtxTrack*>> tracks = std::nullopt);
0088 
0089  private:
0090   // private methods
0091   void FillHistograms(const int type, JetQAContent& content);
0092 
0093   // inherited interal methods
0094   void DefineHistograms() override;
0095 
0096 };  // end TrksInJetQAJetManager
0097 
0098 #endif
0099 
0100 // end ========================================================================