Commit 867caaa0 authored by Daniele Zanzi's avatar Daniele Zanzi Committed by Vakhtang Tsulaia
Browse files

remove bunch group from L1 menu json (ATR-24353)

parent d48bc75e
......@@ -21,6 +21,7 @@ StatusCode TrigSignatureMoni::initialize() {
ATH_CHECK(m_finalDecisionKey.initialize());
ATH_CHECK(m_HLTMenuKey.initialize());
ATH_CHECK(m_L1MenuKey.initialize());
ATH_CHECK(m_L1BunchGroupKey.initialize());
ATH_CHECK(m_decisionCollectorTools.retrieve());
ATH_CHECK(m_featureCollectorTools.retrieve());
ATH_CHECK(m_histSvc.retrieve());
......@@ -33,6 +34,7 @@ StatusCode TrigSignatureMoni::initialize() {
StatusCode TrigSignatureMoni::start() {
SG::ReadHandle<TrigConf::L1Menu> l1MenuHandle = SG::makeHandle(m_L1MenuKey);
SG::ReadHandle<TrigConf::L1BunchGroupSet> l1BunchGroupHandle = SG::makeHandle(m_L1BunchGroupKey);
SG::ReadHandle<TrigConf::HLTMenu> hltMenuHandle = SG::makeHandle(m_HLTMenuKey);
ATH_CHECK(hltMenuHandle.isValid());
......@@ -104,10 +106,10 @@ StatusCode TrigSignatureMoni::start() {
// Initialize BunchGroupCount that will count bunchgroup per chain
const int xb {nChains(hltMenuHandle)};
const int yb {nBunchGroups(l1MenuHandle)};
const int yb {nBunchGroups(l1BunchGroupHandle)};
std::unique_ptr<TH2> hBG = std::make_unique<TH2I>("BunchGroupCount", "Bunch group count per chain;chain;bunchgroup", xb, 1, xb + 1, yb, 1, yb + 1);
ATH_CHECK(m_histSvc->regShared( m_bookingPath + "/" + name() + "/BunchGroupCount", std::move(hBG), m_bunchHistogram));
ATH_CHECK(initBunchHist(m_bunchHistogram, hltMenuHandle, l1MenuHandle));
ATH_CHECK(initBunchHist(m_bunchHistogram, hltMenuHandle, l1BunchGroupHandle));
// Initialize Rate histogram to save the rates of positive decisions in given interval
// per chain/group/sequence per in, after ps, out steps
......@@ -481,8 +483,8 @@ int TrigSignatureMoni::nBCIDchains() const {
return m_BCIDchainIDToBinMap.size();
}
int TrigSignatureMoni::nBunchGroups(SG::ReadHandle<TrigConf::L1Menu>& l1MenuHandle) const {
return l1MenuHandle.isValid() ? (l1MenuHandle->getObject("bunchGroups").getKeys().size() - 1) : 16;
int TrigSignatureMoni::nBunchGroups(SG::ReadHandle<TrigConf::L1BunchGroupSet>& l1BunchGroupHandle) const {
return l1BunchGroupHandle.isValid() ? (l1BunchGroupHandle->getObject("bunchGroups").getKeys().size() - 1) : 16;
}
StatusCode TrigSignatureMoni::initHist(LockedHandle<TH2>& hist, SG::ReadHandle<TrigConf::HLTMenu>& hltMenuHandle, bool steps) {
......@@ -560,9 +562,9 @@ StatusCode TrigSignatureMoni::initBCIDhist(LockedHandle<TH2>& hist, const std::v
return StatusCode::SUCCESS;
}
StatusCode TrigSignatureMoni::initBunchHist(LockedHandle<TH2>& hist, SG::ReadHandle<TrigConf::HLTMenu>& hltMenuHandle, SG::ReadHandle<TrigConf::L1Menu>& l1MenuHandle) {
StatusCode TrigSignatureMoni::initBunchHist(LockedHandle<TH2>& hist, SG::ReadHandle<TrigConf::HLTMenu>& hltMenuHandle, SG::ReadHandle<TrigConf::L1BunchGroupSet>& l1BunchGroupHandle) {
bool gotL1Menu = l1MenuHandle.isValid() && l1MenuHandle->isInitialized();
bool gotL1BunchGroup = l1BunchGroupHandle.isValid() && l1BunchGroupHandle->isInitialized();
TAxis* x = hist->GetXaxis();
x->SetBinLabel(1, "All");
......@@ -580,8 +582,8 @@ StatusCode TrigSignatureMoni::initBunchHist(LockedHandle<TH2>& hist, SG::ReadHan
}
std::vector<std::string> sortedBunchGroups;
if (gotL1Menu) {
sortedBunchGroups = l1MenuHandle->getObject("bunchGroups").getKeys();
if (gotL1BunchGroup) {
sortedBunchGroups = l1BunchGroupHandle->getObject("bunchGroups").getKeys();
std::sort(sortedBunchGroups.begin(), sortedBunchGroups.end());
sortedBunchGroups.erase(std::remove(sortedBunchGroups.begin(), sortedBunchGroups.end(), "BGRP0"), sortedBunchGroups.end());
} else {
......@@ -593,7 +595,7 @@ StatusCode TrigSignatureMoni::initBunchHist(LockedHandle<TH2>& hist, SG::ReadHan
bin = 1;
TAxis* y = hist->GetYaxis();
for (const std::string& group : sortedBunchGroups){
std::string bgname = gotL1Menu ? l1MenuHandle->getAttribute( "bunchGroups." + group + ".name", true) : group;
std::string bgname = gotL1BunchGroup ? l1BunchGroupHandle->getAttribute( "bunchGroups." + group + ".name", true) : group;
y->SetBinLabel( bin, bgname.c_str() );
m_nameToBinMap[group] = bin;
++bin;
......
......@@ -20,6 +20,7 @@
#include "DecisionCollectorTool.h"
#include "TrigConfData/HLTMenu.h"
#include "TrigConfData/L1Menu.h"
#include "TrigConfData/L1BunchGroupSet.h"
#include "TrigConfData/DataStructure.h"
#include "TimeDivider.h"
......@@ -92,6 +93,7 @@ class TrigSignatureMoni : public extends<AthReentrantAlgorithm, IIncidentListene
SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalDecisionKey{ this, "FinalDecisionKey", "HLTNav_Summary", "Final stage of all decisions" };
SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{ this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu" };
SG::ReadHandleKey<TrigConf::L1Menu> m_L1MenuKey{ this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu" };
SG::ReadHandleKey<TrigConf::L1BunchGroupSet> m_L1BunchGroupKey{ this, "L1BunchGroup", "DetectorStore+L1BunchGroup", "L1 BunchGroup" };
ServiceHandle<IIncidentSvc> m_incidentSvc{ this, "IncidentSvc", "IncidentSvc", "Incident service"};
ServiceHandle<ITHistSvc> m_histSvc{ this, "THistSvc", "THistSvc/THistSvc", "Histogramming svc" };
......@@ -143,15 +145,15 @@ class TrigSignatureMoni : public extends<AthReentrantAlgorithm, IIncidentListene
// Returns number of base steps: in, after ps, out steps
int nBaseSteps() const;
// Returns number of bunchgroups from l1 menu
int nBunchGroups(SG::ReadHandle<TrigConf::L1Menu>& ) const;
// Returns number of bunchgroups from L1 BunchGroupSet
int nBunchGroups(SG::ReadHandle<TrigConf::L1BunchGroupSet>& ) const;
// Returns number of BCID chains to monitor
int nBCIDchains() const;
// Init different types of histograms
StatusCode initHist(LockedHandle<TH2>&, SG::ReadHandle<TrigConf::HLTMenu>&, bool = true);
StatusCode initBunchHist(LockedHandle<TH2>&, SG::ReadHandle<TrigConf::HLTMenu>&, SG::ReadHandle<TrigConf::L1Menu>&);
StatusCode initBunchHist(LockedHandle<TH2>&, SG::ReadHandle<TrigConf::HLTMenu>&, SG::ReadHandle<TrigConf::L1BunchGroupSet>&);
StatusCode initBCIDhist(LockedHandle<TH2>&, const std::vector<std::string>&);
StatusCode initSeqHist(LockedHandle<TH2>&, std::set<std::string>&);
......
......@@ -53,9 +53,6 @@ class L1MenuJSONConverter(object):
# items
confObj["items"] = self.menu.items.json()
# bunchgroups
confObj["bunchGroups"] = self.menu.ctp.bunchGroupSet.json()
# thresholds
confObj["thresholds"] = odict()
confObj["thresholds"]["internal"] = odict()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment