File indexing completed on 2025-12-17 09:21:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "TrksInJetQABaseFiller.h"
0013
0014
0015
0016
0017
0018
0019 TrksInJetQABaseFiller::TrksInJetQABaseFiller(const TrksInJetQAConfig& config,
0020 TrksInJetQAHist& hist)
0021 : m_config(config)
0022 , m_hist(hist)
0023 {
0024
0025 if (m_config.doHitQA)
0026 {
0027 m_hitManager = std::make_unique<TrksInJetQAHitManager>(m_config, m_hist);
0028 }
0029 if (m_config.doClustQA)
0030 {
0031 m_clustManager = std::make_unique<TrksInJetQAClustManager>(m_config, m_hist);
0032 }
0033 if (m_config.doTrackQA)
0034 {
0035 m_trackManager = std::make_unique<TrksInJetQATrkManager>(m_config, m_hist);
0036 }
0037 if (m_config.doJetQA)
0038 {
0039 m_jetManager = std::make_unique<TrksInJetQAJetManager>(m_config, m_hist);
0040 }
0041 }
0042
0043
0044
0045
0046
0047
0048 void TrksInJetQABaseFiller::MakeHistograms(const std::string& prefix,
0049 const std::string& suffix)
0050 {
0051
0052 if (m_config.doHitQA)
0053 {
0054 m_hitManager->MakeHistograms(prefix, suffix);
0055 }
0056 if (m_config.doClustQA)
0057 {
0058 m_clustManager->MakeHistograms(prefix, suffix);
0059 }
0060 if (m_config.doTrackQA)
0061 {
0062 m_trackManager->MakeHistograms(prefix, suffix);
0063 }
0064 if (m_config.doJetQA)
0065 {
0066 m_jetManager->MakeHistograms(prefix, suffix);
0067 }
0068 }
0069
0070
0071
0072
0073
0074
0075
0076 void TrksInJetQABaseFiller::SaveHistograms(TFile* outFile, const std::string& outDirName)
0077 {
0078 TDirectory* outDir = outFile->mkdir(outDirName.c_str());
0079 if (!outDir)
0080 {
0081 std::cerr << PHWHERE << ": PANIC: unable to make output directory!" << std::endl;
0082 assert(outDir);
0083 }
0084
0085 if (m_config.doHitQA)
0086 {
0087 m_hitManager->SaveHistograms(outDir, m_config.hitOutDir);
0088 }
0089 if (m_config.doClustQA)
0090 {
0091 m_clustManager->SaveHistograms(outDir, m_config.clustOutDir);
0092 }
0093 if (m_config.doTrackQA)
0094 {
0095 m_trackManager->SaveHistograms(outDir, m_config.trackOutDir);
0096 }
0097 if (m_config.doJetQA)
0098 {
0099 m_jetManager->SaveHistograms(outDir, m_config.jetOutDir);
0100 }
0101 }
0102
0103
0104
0105
0106 void TrksInJetQABaseFiller::GrabHistograms(std::vector<TH1D*>& vecOutHist1D,
0107 std::vector<TH2D*>& vecOutHist2D)
0108 {
0109 if (m_config.doHitQA)
0110 {
0111 m_hitManager->GrabHistograms(vecOutHist1D, vecOutHist2D);
0112 }
0113 if (m_config.doClustQA)
0114 {
0115 m_clustManager->GrabHistograms(vecOutHist1D, vecOutHist2D);
0116 }
0117 if (m_config.doTrackQA)
0118 {
0119 m_trackManager->GrabHistograms(vecOutHist1D, vecOutHist2D);
0120 }
0121 if (m_config.doJetQA)
0122 {
0123 m_jetManager->GrabHistograms(vecOutHist1D, vecOutHist2D);
0124 }
0125 }
0126
0127
0128
0129
0130
0131
0132 void TrksInJetQABaseFiller::GetNodes(PHCompositeNode* topNode)
0133 {
0134
0135 if (m_config.doJetQA)
0136 {
0137 m_jetMap = findNode::getClass<JetContainer>(topNode, m_config.jetInNode);
0138 if (!m_jetMap)
0139 {
0140 std::cerr << PHWHERE << ": PANIC: couldn't grab jet map from node tree!" << std::endl;
0141 assert(m_jetMap);
0142 }
0143 }
0144
0145
0146 if (m_config.doTrackQA)
0147 {
0148 m_trkMap = findNode::getClass<SvtxTrackMap>(topNode, m_config.trkInNode);
0149 if (!m_trkMap)
0150 {
0151 std::cerr << PHWHERE << ": PANIC: couldn't grab track map from node tree!" << std::endl;
0152 assert(m_trkMap);
0153 }
0154 }
0155
0156
0157 if (m_config.doClustQA)
0158 {
0159 m_actsGeom = findNode::getClass<ActsGeometry>(topNode, "ActsGeometry");
0160 if (!m_actsGeom)
0161 {
0162 std::cerr << PHWHERE << ": PANIC: couldn't grab ACTS geometry from node tree!" << std::endl;
0163 assert(m_actsGeom);
0164 }
0165
0166 m_clustMap = findNode::getClass<TrkrClusterContainer>(topNode, m_config.clustInNode);
0167 if (!m_clustMap)
0168 {
0169 std::cerr << PHWHERE << ": PANIC: couldn't grab cluster map from node tree!" << std::endl;
0170 assert(m_clustMap);
0171 }
0172 }
0173
0174
0175 if (m_config.doHitQA)
0176 {
0177 m_hitMap = findNode::getClass<TrkrHitSetContainer>(topNode, m_config.hitInNode);
0178 if (!m_hitMap)
0179 {
0180 std::cerr << PHWHERE << ": PANIC: couldn't grab hit map from node tree!" << std::endl;
0181 assert(m_hitMap);
0182 }
0183 }
0184 }
0185
0186