File indexing completed on 2025-08-06 08:18:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef TRKSINJETQA_H
0012 #define TRKSINJETQA_H
0013
0014
0015 #include "JetQADefs.h"
0016 #include "TrksInJetQAConfig.h"
0017 #include "TrksInJetQAHist.h"
0018 #include "TrksInJetQAInJetFiller.h"
0019 #include "TrksInJetQAInclusiveFiller.h"
0020
0021
0022 #include <calotrigger/TriggerAnalyzer.h>
0023
0024
0025 #include <fun4all/Fun4AllHistoManager.h>
0026 #include <fun4all/Fun4AllReturnCodes.h>
0027 #include <fun4all/SubsysReco.h>
0028
0029
0030 #include <phool/PHCompositeNode.h>
0031 #include <phool/phool.h>
0032
0033
0034 #include <qautils/QAHistManagerDef.h>
0035
0036
0037 #include <TFile.h>
0038
0039
0040 #include <algorithm>
0041 #include <cassert>
0042 #include <cstdlib>
0043 #include <optional>
0044 #include <string>
0045 #include <utility>
0046 #include <vector>
0047
0048
0049
0050
0051
0052
0053
0054
0055 class TrksInJetQA : public SubsysReco
0056 {
0057 public:
0058
0059
0060 enum OutMode
0061 {
0062 File,
0063 QA
0064 };
0065
0066
0067 TrksInJetQA(const std::string& name = "TrksInJetQA");
0068 ~TrksInJetQA() override;
0069
0070
0071 void SetOutFileName(const std::string& name) { m_outFileName = name; }
0072 void SetHistPrefix(const std::string& prefix) { m_histPrefix = prefix; }
0073 void SetHistSuffix(const std::string& suffix) { m_histSuffix = suffix; }
0074 void SetTrgToSelect(const uint32_t trig = JetQADefs::GL1::MBDNSJet1)
0075 {
0076 m_doTrgSelect = true;
0077 m_trgToSelect = trig;
0078 }
0079
0080
0081 void Configure(const TrksInJetQAConfig& config,
0082 std::optional<TrksInJetQAHist> hist = std::nullopt);
0083
0084
0085 int Init(PHCompositeNode* ) override;
0086 int process_event(PHCompositeNode* topNode) override;
0087 int End(PHCompositeNode* ) override;
0088
0089 private:
0090
0091
0092 void InitOutput();
0093 void InitHistograms();
0094 void RegisterHistograms();
0095
0096
0097 TFile* m_outFile {nullptr};
0098 std::string m_moduleName;
0099 std::string m_outFileName {"tracksInJetsQA.root"};
0100 Fun4AllHistoManager* m_manager {nullptr};
0101 TriggerAnalyzer* m_analyzer {nullptr};
0102
0103
0104 bool m_doTrgSelect {false};
0105 uint32_t m_trgToSelect {JetQADefs::GL1::MBDNSJet1};
0106
0107
0108 std::optional<std::string> m_histPrefix {std::nullopt};
0109 std::optional<std::string> m_histSuffix {std::nullopt};
0110
0111
0112 std::unique_ptr<TrksInJetQAInJetFiller> m_inJet;
0113 std::unique_ptr<TrksInJetQAInclusiveFiller> m_inclusive;
0114
0115
0116 TrksInJetQAConfig m_config;
0117 TrksInJetQAHist m_hist;
0118
0119 };
0120
0121 #endif
0122
0123