Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:22

0001 // ----------------------------------------------------------------------------
0002 // 'TrksInJetQA.h'
0003 // Derek Anderson
0004 // 03.25.2024
0005 //
0006 // A "small" Fun4All module to produce QA plots for tracks,
0007 // hits, and more.
0008 // ----------------------------------------------------------------------------
0009 
0010 #ifndef TRKSINJETQA_H
0011 #define TRKSINJETQA_H
0012 
0013 // c++ utilities
0014 #include <string>
0015 #include <vector>
0016 #include <cassert>
0017 #include <utility>
0018 #include <optional>
0019 // root libraries
0020 #include <TFile.h>
0021 // f4a libraries
0022 #include <fun4all/SubsysReco.h>
0023 #include <fun4all/Fun4AllReturnCodes.h>
0024 #include <fun4all/Fun4AllHistoManager.h>
0025 // phool libraries
0026 #include <phool/phool.h>
0027 #include <phool/PHCompositeNode.h>
0028 // qa utilities
0029 #include <qautils/QAHistManagerDef.h>
0030 // module utilities
0031 #include "TrksInJetQAHist.h"
0032 #include "TrksInJetQAConfig.h"
0033 // submodule definitions
0034 #include "TrksInJetQAInJetFiller.h"
0035 #include "TrksInJetQAInclusiveFiller.h"
0036 
0037 
0038 
0039 // TrksInJetQA definition -----------------------------------------------------
0040 
0041 class TrksInJetQA : public SubsysReco {
0042 
0043   public:
0044 
0045     //  output modes
0046     enum OutMode {File, QA};
0047 
0048     // ctor/dtor
0049     TrksInJetQA(const std::string& name);
0050     ~TrksInJetQA() override;
0051 
0052     // setters
0053     void SetOutFileName(const std::string& name)  {m_outFileName = name;}
0054     void SetHistSuffix(const std::string& suffix) {m_histSuffix  = suffix;}
0055 
0056     // public methods
0057     void Configure(
0058       TrksInJetQAConfig config,
0059       std::optional<TrksInJetQAHist> hist = std::nullopt
0060     );
0061 
0062 
0063     // f4a methods
0064     int Init(PHCompositeNode* /*topNode*/)      override;
0065     int process_event(PHCompositeNode* topNode) override;
0066     int End(PHCompositeNode* /*topNode*/)       override;
0067 
0068   private:
0069 
0070     // private methods
0071     void InitOutput();
0072     void InitHistograms();
0073     void RegisterHistograms();
0074 
0075     // io members
0076     //   - FIXME raw pointers should be smart ones!
0077     TFile*               m_outFile     = NULL;
0078     std::string          m_outFileName = "tracksInJetsQA.root";
0079     Fun4AllHistoManager* m_manager     = NULL;
0080 
0081     // optional suffix for histograms
0082     std::optional<std::string> m_histSuffix  = std::nullopt;
0083 
0084     // submodules to run
0085     std::unique_ptr<TrksInJetQAInJetFiller>     m_inJet;
0086     std::unique_ptr<TrksInJetQAInclusiveFiller> m_inclusive;
0087 
0088     // module utilities
0089     TrksInJetQAConfig m_config;
0090     TrksInJetQAHist   m_hist;
0091 
0092 };  // end TrksInJetQA
0093 
0094 #endif
0095 
0096 // end ------------------------------------------------------------------------