File indexing completed on 2025-08-06 08:18:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #define TRKSINJETQAHITMANAGER_CC
0012
0013
0014 #include "TrksInJetQAHitManager.h"
0015
0016
0017
0018
0019
0020
0021 void TrksInJetQAHitManager::GetInfo(TrkrHit* hit,
0022 TrkrDefs::hitsetkey& setKey,
0023 TrkrDefs::hitkey& hitKey)
0024 {
0025
0026 const uint16_t layer = TrkrDefs::getLayer(setKey);
0027 const bool isMvtx = IsInMvtx(layer);
0028 const bool isIntt = IsInIntt(layer);
0029 const bool isTpc = IsInTpc(layer);
0030
0031
0032
0033
0034 uint16_t phiBin = std::numeric_limits<uint16_t>::max();
0035 uint16_t zBin = std::numeric_limits<uint16_t>::max();
0036 if (isMvtx)
0037 {
0038 phiBin = MvtxDefs::getCol(hitKey);
0039 zBin = MvtxDefs::getRow(hitKey);
0040 }
0041 else if (isIntt)
0042 {
0043 phiBin = InttDefs::getCol(hitKey);
0044 zBin = InttDefs::getRow(hitKey);
0045 }
0046 else if (isTpc)
0047 {
0048 phiBin = TpcDefs::getPad(hitKey);
0049
0050 }
0051
0052
0053 HitQAContent content{
0054 .ene = hit->getEnergy(),
0055 .adc = hit->getAdc(),
0056 .layer = layer,
0057 .phiBin = phiBin,
0058 .zBin = zBin};
0059
0060
0061 FillHistograms(Type::All, content);
0062 if (m_config.doSubsysHist)
0063 {
0064 if (isMvtx)
0065 {
0066 FillHistograms(Type::Mvtx, content);
0067 }
0068 else if (isIntt)
0069 {
0070 FillHistograms(Type::Intt, content);
0071 }
0072 else if (isTpc)
0073 {
0074 FillHistograms(Type::Tpc, content);
0075 }
0076 }
0077 }
0078
0079
0080
0081
0082
0083
0084 void TrksInJetQAHitManager::FillHistograms(const int type, HitQAContent& content)
0085 {
0086
0087 m_mapHist1D[Index(type, H1D::Ene)]->Fill(content.ene);
0088 m_mapHist1D[Index(type, H1D::ADC)]->Fill(content.adc);
0089 m_mapHist1D[Index(type, H1D::Layer)]->Fill(content.layer);
0090 m_mapHist1D[Index(type, H1D::PhiBin)]->Fill(content.phiBin);
0091 m_mapHist1D[Index(type, H1D::ZBin)]->Fill(content.zBin);
0092
0093
0094 m_mapHist2D[Index(type, H2D::EneVsLayer)]->Fill(content.layer, content.ene);
0095 m_mapHist2D[Index(type, H2D::EneVsADC)]->Fill(content.adc, content.ene);
0096 m_mapHist2D[Index(type, H2D::PhiVsZBin)]->Fill(content.zBin, content.phiBin);
0097 }
0098
0099
0100
0101
0102 void TrksInJetQAHitManager::DefineHistograms()
0103 {
0104
0105 std::vector<TrksInJetQADefs::BinDef> vecBins = m_hist.GetVecHistBins();
0106
0107
0108 m_mapHistTypes[Type::All] = "All";
0109 if (m_config.doSubsysHist)
0110 {
0111 m_mapHistTypes[Type::Mvtx] = "Mvtx";
0112 m_mapHistTypes[Type::Intt] = "Intt";
0113 m_mapHistTypes[Type::Tpc] = "Tpc";
0114 }
0115
0116
0117 m_mapHistDef1D[H1D::Ene] = std::tuple("HitEne", vecBins.at(TrksInJetQAHist::Var::Ene));
0118 m_mapHistDef1D[H1D::ADC] = std::tuple("HitAdc", vecBins.at(TrksInJetQAHist::Var::Adc));
0119 m_mapHistDef1D[H1D::Layer] = std::tuple("HitLayer", vecBins.at(TrksInJetQAHist::Var::Layer));
0120 m_mapHistDef1D[H1D::PhiBin] = std::tuple("HitPhiBin", vecBins.at(TrksInJetQAHist::Var::PhiBin));
0121 m_mapHistDef1D[H1D::ZBin] = std::tuple("HitZBin", vecBins.at(TrksInJetQAHist::Var::ZBin));
0122
0123
0124 m_mapHistDef2D[H2D::EneVsLayer] = std::tuple("HitEneVsLayer",
0125 vecBins.at(TrksInJetQAHist::Var::Layer),
0126 vecBins.at(TrksInJetQAHist::Var::Ene));
0127 m_mapHistDef2D[H2D::EneVsADC] = std::tuple("HitEneVsADC",
0128 vecBins.at(TrksInJetQAHist::Var::Adc),
0129 vecBins.at(TrksInJetQAHist::Var::Ene));
0130 m_mapHistDef2D[H2D::PhiVsZBin] = std::tuple("HitPhiVsZBin",
0131 vecBins.at(TrksInJetQAHist::Var::ZBin),
0132 vecBins.at(TrksInJetQAHist::Var::PhiBin));
0133 }
0134
0135