Skip to content
Snippets Groups Projects
Commit e28c6186 authored by Tim Martin's avatar Tim Martin
Browse files

Update clients of DecisionSummaryMakerAlg to read in data given that there...

Update clients of DecisionSummaryMakerAlg to read in data given that there might be more that one Decision object, and using global key HLTSummary
parent faaf1a36
9 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!28528Revert 63f845ae,!27054Atr20369 210,!26342Monopole: Handle fractionally charged particles,!20010ATR-19246 TriggerMT Decision Encoding in ESD Update
......@@ -90,7 +90,7 @@ serialiser.CollectionsToSerialize = ["xAOD::TrigCompositeContainer_v1#MTCalibPeb
# Tool adding stream tags to HLT result
stmaker = StreamTagMakerTool()
stmaker.ChainDecisions = "HLTFinalDecisions"
stmaker.ChainDecisions = "HLTSummary"
stmaker.ChainToStream = {}
stmaker.ChainToStream["HLT_MTCalibPeb1"] = "DataScouting_05_Jets"
stmaker.ChainToStream["HLT_MTCalibPeb2"] = "Main"
......@@ -101,7 +101,7 @@ stmaker.StreamRobs["Main"] = [0x42002e, 0x420060, 0x420064]
# Tool adding HLT bits to HLT result
bitsmaker = TriggerBitsMakerTool()
bitsmaker.ChainDecisions = "HLTFinalDecisions"
bitsmaker.ChainDecisions = "HLTSummary"
bitsmaker.ChainToBit = {}
bitsmaker.ChainToBit["HLT_MTCalibPeb1"] = 3
bitsmaker.ChainToBit["HLT_MTCalibPeb2"] = 50
......
......@@ -123,8 +123,21 @@ StatusCode TrigSignatureMoniMT::fillCount(const std::vector<TrigCompositeUtils::
StatusCode TrigSignatureMoniMT::execute() {
auto l1Decisions = SG::makeHandle( m_l1DecisionsKey );
CHECK( l1Decisions->at( 0 )->name() == "l1seeded" );
CHECK( l1Decisions->at( 1 )->name() == "unprescaled" ); // see L1Decoder implementation
const TrigCompositeUtils::Decision* l1SeededChains = nullptr; // Activated by L1
const TrigCompositeUtils::Decision* unprescaledChains = nullptr; // Activated and passed prescale check
for (const TrigCompositeUtils::Decision* d : *l1Decisions) {
if (d->name() == "l1seeded") {
l1SeededChains = d;
} else if (d->name() == "unprescaled") {
unprescaledChains = d;
}
}
if (l1SeededChains == nullptr || unprescaledChains == nullptr) {
ATH_MSG_ERROR("Unable to read in the summary from the L1Decoder.");
return StatusCode::FAILURE;
}
auto fillL1 = [&]( int index ) -> StatusCode {
TrigCompositeUtils::DecisionIDContainer ids;
......
......@@ -36,7 +36,7 @@ class TrigSignatureMoniMT : public ::AthAlgorithm
SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_l1DecisionsKey{ this, "L1Decisions", "L1DecoderSummary", "Chains activated after the L1" };
SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalDecisionKey{ this, "FinalDecisionKey", "HLTFinalDecisions", "Final stage of all decisions" };
SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalDecisionKey{ this, "FinalDecisionKey", "HLTSummary", "Final stage of all decisions" };
Gaudi::Property<std::vector<std::string> > m_allChains{ this, "ChainsList", {}, "List of all configured chains" };
......@@ -51,12 +51,15 @@ class TrigSignatureMoniMT : public ::AthAlgorithm
ToolHandleArray<DecisionCollectorTool> m_collectorTools{ this, "CollectorTools", {}, "Tools that collect decisions for steps" };
int nBinsX() const { return m_allChains.size() +1; }
int nBinsX() const;
int nBinsY() const;
StatusCode initHist(TH2*);
StatusCode fillCount(const std::vector<TrigCompositeUtils::DecisionID>& dc, int row);
StatusCode fillPass(const TrigCompositeUtils::DecisionIDContainer& dc, int row);
};
inline int TrigSignatureMoniMT::nBinsX() const {
return m_allChains.size() +1;
}
#endif //> !TRIGSTEERMONITOR_TRIGSIGNATUREMONIMT_H
......@@ -26,7 +26,7 @@ public:
virtual StatusCode finalize() override;
private:
SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalChainDecisions { this, "ChainDecisions", "UNDEFINED", "Container with final chain decisions" };
SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalChainDecisions { this, "ChainDecisions", "HLTSummary", "Container with final chain decisions" };
Gaudi::Property<std::map<std::string, int>> m_chainToStreamProperty { this, "ChainToBit", {}, "Mapping from the chain name to bit position in trigger bits array"};
......
......@@ -44,10 +44,36 @@ StatusCode StreamTagMakerTool::finalize() {
StatusCode StreamTagMakerTool::fill( HLT::HLTResultMT& resultToFill ) const {
// obtain chain decisions,
using namespace TrigCompositeUtils;
auto chainsHandle = SG::makeHandle( m_finalChainDecisions );
const Decision* passRawChains = nullptr;
const Decision* rerunChains = nullptr;
for (const Decision* d : *chainsHandle) {
if (d->name() == "HLTPassRaw") {
passRawChains = d;
} else if (d->name() == "HLTRerun") {
rerunChains = d;
}
}
if (passRawChains == nullptr || rerunChains == nullptr) {
ATH_MSG_ERROR("Unable to read in the HLTSummary from the DecisionSummaryMakerAlg");
return StatusCode::FAILURE;
}
// for each accepted chain lookup the map of chainID -> ST
for ( TrigCompositeUtils::DecisionID chain: TrigCompositeUtils::decisionIDs( chainsHandle->at( 0 )) ) {
for ( DecisionID chain: decisionIDs( passRawChains ) ) {
// Note: The default is to NOT allow rerun chains to add a stream tag
if (!m_allowRerunChains) {
const auto iterator = std::find(decisionIDs(rerunChains).begin(), decisionIDs(rerunChains).end(), chain);
if ( iterator != decisionIDs(rerunChains).end() ) {
// This chain has entries in both the passedRaw and rerun sets. As we are not allowing rerun chains, we skip this one.
continue;
}
}
auto mappingIter = m_mapping.find( chain );
// each chain has to have stream
if( mappingIter == m_mapping.end() ) {
......
......@@ -28,11 +28,20 @@ public:
virtual StatusCode finalize() override;
private:
SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalChainDecisions { this, "ChainDecisions", "UNDEFINED", "Container with final chain decisions" };
SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalChainDecisions { this, "ChainDecisions", "HLTSummary",
"Container with final chain decisions" };
Gaudi::Property<std::map<std::string, std::string>> m_chainToStreamProperty { this, "ChainToStream", {}, "Mapping from the chain name to string name (temporary solution, will be replaced)"};
Gaudi::Property<std::map<std::string, std::vector<uint32_t>>> m_streamSubDets { this, "StreamSubDets", {}, "Mapping from the stream name to subdetector IDs (temporary solution, will be replaced)"};
Gaudi::Property<std::map<std::string, std::vector<uint32_t>>> m_streamRobs { this, "StreamRobs", {}, "Mapping from the stream name to ROB IDs (temporary solution, will be replaced)"};
Gaudi::Property<bool> m_allowRerunChains { this, "AllowRerunChains", false,
"Normally false, but if set to true this will allow resurrected chains which ran in the second pass to also add stream tags"};
Gaudi::Property<std::map<std::string, std::string>> m_chainToStreamProperty { this, "ChainToStream", {},
"Mapping from the chain name to string name (temporary solution, will be replaced)"};
Gaudi::Property<std::map<std::string, std::vector<uint32_t>>> m_streamSubDets { this, "StreamSubDets", {},
"Mapping from the stream name to subdetector IDs (temporary solution, will be replaced)"};
Gaudi::Property<std::map<std::string, std::vector<uint32_t>>> m_streamRobs { this, "StreamRobs", {},
"Mapping from the stream name to ROB IDs (temporary solution, will be replaced)"};
typedef std::map< TrigCompositeUtils::DecisionID, eformat::helper::StreamTag> ChainToStreamMap;
ChainToStreamMap m_mapping;
......
......@@ -25,7 +25,21 @@ StatusCode TriggerBitsMakerTool::initialize() {
StatusCode TriggerBitsMakerTool::fill( HLT::HLTResultMT& resultToFill ) const {
auto chainsHandle = SG::makeHandle( m_finalChainDecisions );
for ( TrigCompositeUtils::DecisionID chain: TrigCompositeUtils::decisionIDs( chainsHandle->at( 0 )) ) {
const TrigCompositeUtils::Decision* passRawChains = nullptr;
for (const TrigCompositeUtils::Decision* d : *chainsHandle) {
if (d->name() == "HLTPassRaw") {
passRawChains = d;
break;
}
}
if (passRawChains == nullptr) {
ATH_MSG_ERROR("Unable to read in the HLTSummary from the DecisionSummaryMakerAlg");
return StatusCode::FAILURE;
}
for ( TrigCompositeUtils::DecisionID chain: TrigCompositeUtils::decisionIDs( passRawChains ) ) {
auto mappingIter = m_mapping.find( chain );
// each chain has to have stream
if( mappingIter == m_mapping.end() ) {
......
......@@ -230,7 +230,6 @@ egammaEFCaloStep = stepSeq("egammaEFCalotep", filterL2ElectronRoIsAlg, [ efClust
from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg
summaryStep0 = TriggerSummaryAlg( "TriggerSummaryStep1" )
summaryStep0.InputDecision = "L1DecoderSummary"
summaryStep0.HLTSummary = "MonitoringSummaryStep1"
summaryStep0.FinalDecisions = [ caloHypoDecisions ]
summaryStep0.OutputLevel = DEBUG
......@@ -359,11 +358,11 @@ serialiser.CollectionsToSerialize = [ "xAOD::TrigCompositeContainer_v1#remap_Ega
stmaker = StreamTagMakerTool()
stmaker.OutputLevel = DEBUG
stmaker.ChainDecisions = "HLTFinalDecisions"
stmaker.ChainDecisions = "HLTSummary"
stmaker.ChainToStream = dict( [(c, "Main") for c in testChains ] )
stmaker.ChainToStream["HLT_e5_etcut"] = "PhotonPerf" # just made up the name
bitsmaker = TriggerBitsMakerTool()
bitsmaker.ChainDecisions = "HLTFinalDecisions"
bitsmaker.ChainDecisions = "HLTSummary"
bitsmaker.ChainToBit = dict( [ (chain, 10*num) for num,chain in enumerate(testChains) ] )
bitsmaker.OutputLevel = DEBUG
......@@ -433,7 +432,7 @@ ServiceMgr += AuditorSvc()
# This triggers the L1 decoder to signal the start of processing,
# and the HLT summary alg to signal end of processing and handle the writing of data.
topSequence.L1DecoderTest.EnableCostMonitoring = True
summary.EnableCostMonitoring = True
summMaker.EnableCostMonitoring = True
# Write out the data at the end
addTC("TrigCostContainer")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment