|
ATLAS Offline Software
|
#include <TrigSignatureMoni.h>
|
int | nBinsX (SG::ReadHandle< TrigConf::HLTMenu > &) const |
|
int | nBinsX () const |
|
int | nChains (SG::ReadHandle< TrigConf::HLTMenu > &) const |
|
int | nBCIDs () const |
|
int | nSequenceBins () const |
|
int | nSteps () const |
|
int | nBaseSteps () const |
|
StatusCode | initHist (LockedHandle< TH2 > &, SG::ReadHandle< TrigConf::HLTMenu > &, bool=true) |
|
StatusCode | initSeqHist (LockedHandle< TH2 > &, std::set< std::string > &) |
|
StatusCode | fillDecisionCount (const std::vector< TrigCompositeUtils::DecisionID > &, int) const |
|
StatusCode | fillPassEvents (const TrigCompositeUtils::DecisionIDContainer &, int) const |
|
StatusCode | fillRate (const TrigCompositeUtils::DecisionIDContainer &, int) const |
|
StatusCode | fillHistogram (const TrigCompositeUtils::DecisionIDContainer &, int, LockedHandle< TH2 > &) const |
|
StatusCode | fillSequences (const std::set< std::string > &) const |
|
StatusCode | fillStreamsAndGroups (const std::map< std::string, TrigCompositeUtils::DecisionIDContainer > &, const TrigCompositeUtils::DecisionIDContainer &) const |
|
|
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > | m_l1DecisionsKey { this, "L1Decisions", "HLTSeedingSummary", "Chains activated after the L1" } |
|
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" } |
|
ServiceHandle< IIncidentSvc > | m_incidentSvc { this, "IncidentSvc", "IncidentSvc", "Incident service"} |
|
ServiceHandle< ITHistSvc > | m_histSvc { this, "THistSvc", "THistSvc/THistSvc", "Histogramming svc" } |
|
Gaudi::Property< std::string > | m_bookingPath { this, "HistPath", "/EXPERT/HLTFramework", "Booking path for the histogram"} |
|
Gaudi::Property< unsigned int > | m_duration {this, "RateIntegrationDuration", 10, "Integration time for the rate histogram in seconds"} |
|
Gaudi::Property< unsigned int > | m_intervals {this, "RateIntegrationIntervals", 6, "Number of the rate histogram publications"} |
|
ToolHandleArray< DecisionCollectorTool > | m_decisionCollectorTools { this, "DecisionCollectorTools", {}, "Tools that collect decisions (yes/no) for steps" } |
|
ToolHandleArray< DecisionCollectorTool > | m_featureCollectorTools { this, "FeatureCollectorTools", {}, "Tools that collect decision counts for specific features for steps" } |
|
LockedHandle< TH2 > m_passHistogram | ATLAS_THREAD_SAFE |
|
LockedHandle< TH2 > m_countHistogram | ATLAS_THREAD_SAFE |
|
RateHistogram | m_rateHistogram |
|
RateHistogram | m_sequenceHistogram |
|
std::map< unsigned int, int > | m_chainIDToBinMap |
| Chain id to histogram bin map. More...
|
|
std::map< std::string, int > | m_nameToBinMap |
| Sequence/group/bunchgroup name to bin map. More...
|
|
std::map< std::string, int > | m_sequenceToBinMap |
| Sequence to bin map for sequence histogram. More...
|
|
std::map< unsigned int, std::set< std::string > > | m_chainIDToBunchMap |
| Chain ID to bunchgroup name map. More...
|
|
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > | m_groupToChainMap |
| Group name to chain objects map. More...
|
|
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > | m_streamToChainMap |
| Stream name to chain objects map, excluding express. More...
|
|
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > | m_expressChainMap |
| Stream name to chain objects map, including only express. More...
|
|
Definition at line 36 of file TrigSignatureMoni.h.
◆ TrigSignatureMoni()
TrigSignatureMoni::TrigSignatureMoni |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ execute()
StatusCode TrigSignatureMoni::execute |
( |
const EventContext & |
context | ) |
const |
|
overridevirtual |
Definition at line 298 of file TrigSignatureMoni.cxx.
305 if (
d->name() ==
"l1seeded") {
307 }
else if (
d->name() ==
"unprescaled") {
308 unprescaledChains =
d;
312 if (l1SeededChains ==
nullptr || unprescaledChains ==
nullptr) {
313 ATH_MSG_ERROR(
"Unable to read in the summary from the HLTSeeding.");
314 return StatusCode::FAILURE;
324 m_passHistogram->Fill(1,
double(
index + 1));
327 return StatusCode::SUCCESS;
337 std::vector<TrigCompositeUtils::DecisionID> stepSum;
338 std::set<std::string> stepSequences;
339 ctool->getDecisions( stepSum, context );
340 ctool->getSequencesPerEvent( stepSequences, context );
341 ATH_MSG_DEBUG(
" Step " <<
step <<
" decisions (for decisions): " << stepSum.size() );
350 std::vector<TrigCompositeUtils::DecisionID> stepSum;
351 std::set<std::string> stepSequences;
352 ctool->getDecisions( stepSum, context );
353 ATH_MSG_DEBUG(
" Step " <<
step <<
" decisions (for features): " << stepSum.size() );
364 if (!decisionObject) {
365 ATH_MSG_WARNING(
"Unable to locate trigger navigation terminus node. Cannot tell which chains passed the event.");
373 if (!expressDecisionObject) {
374 ATH_MSG_WARNING(
"Unable to locate trigger navigation express terminus node. Cannot tell which chains passed the express stream in this event.");
380 const int countOutputRow {
nSteps()-1};
388 const int countExpressRow {
nSteps()};
395 if (!finalIDs.empty()) {
396 m_passHistogram->Fill(1,
double(countOutputRow));
399 if (!expressFinalIDs.empty()) {
400 m_passHistogram->Fill(1,
double(countExpressRow));
404 return StatusCode::SUCCESS;
◆ fillDecisionCount()
Definition at line 236 of file TrigSignatureMoni.cxx.
244 m_countHistogram->Fill(id2bin->second,
double(
row));
248 return StatusCode::SUCCESS;
◆ fillHistogram()
◆ fillPassEvents()
◆ fillRate()
◆ fillSequences()
StatusCode TrigSignatureMoni::fillSequences |
( |
const std::set< std::string > & |
sequences | ) |
const |
|
private |
◆ fillStreamsAndGroups()
Definition at line 260 of file TrigSignatureMoni.cxx.
261 const int countOutputRow {
nSteps()-1};
263 for (
const auto&
name : nameToChainsMap) {
265 if (
name.second.find(
id) !=
name.second.end()){
267 m_countHistogram->Fill(
bin, countOutputRow);
269 m_passHistogram->Fill(
bin, countOutputRow);
274 return StatusCode::SUCCESS;
◆ handle()
void TrigSignatureMoni::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtual |
◆ initHist()
Definition at line 431 of file TrigSignatureMoni.cxx.
432 TAxis*
x =
hist->GetXaxis();
433 x->SetBinLabel(1,
"All");
436 std::set<std::string> sortedChainsList;
438 sortedChainsList.insert(
chain.name() );
441 for (
const std::string&
chainName: sortedChainsList ) {
450 x->SetBinLabel(
bin, (
"str_"+
stream.first).c_str());
456 x->SetBinLabel(
bin, (
"str_"+
stream.first).c_str());
462 x->SetBinLabel(
bin, (
"grp_"+
group.first.substr(
group.first.find(
':')+1)).c_str() );
468 TAxis*
y =
hist->GetYaxis();
469 y->SetBinLabel(1,
steps ?
"L1" :
"Input");
470 y->SetBinLabel(2,
"AfterPS");
474 y->SetBinLabel(
y->GetNbins()-1,
"Output");
475 y->SetBinLabel(
y->GetNbins(),
"Express");
477 return StatusCode::SUCCESS;
◆ initialize()
StatusCode TrigSignatureMoni::initialize |
( |
| ) |
|
|
overridevirtual |
◆ initSeqHist()
StatusCode TrigSignatureMoni::initSeqHist |
( |
LockedHandle< TH2 > & |
hist, |
|
|
std::set< std::string > & |
sequenceSet |
|
) |
| |
|
private |
Definition at line 480 of file TrigSignatureMoni.cxx.
481 TAxis*
x =
hist->GetXaxis();
485 for (
const std::string& seqName : sequenceSet) {
486 x->SetBinLabel(
bin, seqName.c_str());
491 TAxis*
y =
hist->GetYaxis();
492 y->SetBinLabel(1,
"Rate");
494 return StatusCode::SUCCESS;
◆ nBaseSteps()
int TrigSignatureMoni::nBaseSteps |
( |
| ) |
const |
|
private |
◆ nBCIDs()
int TrigSignatureMoni::nBCIDs |
( |
| ) |
const |
|
private |
◆ nBinsX() [1/2]
int TrigSignatureMoni::nBinsX |
( |
| ) |
const |
|
private |
◆ nBinsX() [2/2]
◆ nChains()
◆ nSequenceBins()
int TrigSignatureMoni::nSequenceBins |
( |
| ) |
const |
|
private |
◆ nSteps()
int TrigSignatureMoni::nSteps |
( |
| ) |
const |
|
private |
◆ start()
StatusCode TrigSignatureMoni::start |
( |
| ) |
|
|
overridevirtual |
Definition at line 32 of file TrigSignatureMoni.cxx.
43 std::unordered_map<std::string,std::string> mapStrNameToTypeName;
46 mapStrNameToTypeName.insert({
stream.getAttribute(
"name"),
stream.getAttribute(
"type")+
"_"+
stream.getAttribute(
"name")});
49 ATH_MSG_ERROR(
"Exception reading stream tag configuration from the HLT menu: " << ex.what());
50 return StatusCode::FAILURE;
54 for (
const std::string&
group :
chain.groups()) {
56 if (
group.starts_with(
"RATE")){
64 if (
it==mapStrNameToTypeName.cend()) {
66 <<
" is missing from menu streams definition");
67 return StatusCode::FAILURE;
69 if (
it->second ==
"express_express") {
81 const int x {
nBinsX(hltMenuHandle)};
84 std::unique_ptr<TH2> hSA = std::make_unique<TH2I>(
"SignatureAcceptance",
"Raw acceptance of signatures in;chain;step",
x, 1,
x + 1,
y, 1,
y + 1);
85 std::unique_ptr<TH2> hDC = std::make_unique<TH2I>(
"DecisionCount",
"Positive decisions count per step;chain;step",
x, 1,
x + 1,
y, 1,
y + 1);
106 std::set<std::string> sequencesSet;
108 ctool->getSequencesNames(sequencesSet);
110 const int xc = sequencesSet.size();
120 return StatusCode::SUCCESS;
◆ stop()
StatusCode TrigSignatureMoni::stop |
( |
| ) |
|
|
overridevirtual |
Definition at line 123 of file TrigSignatureMoni.cxx.
128 ATH_MSG_INFO(
"No chains configured, no counts to print" );
129 return StatusCode::SUCCESS;
132 auto fixedWidth = [](
const std::string&
s,
size_t sz) {
133 std::ostringstream
ss;
134 ss << std::setw(
sz) << std::left <<
s;
142 std::map<std::string, std::set<int>> chainToStepsId;
145 for (
const std::string& seqName :
chain.sequencers()){
147 std::smatch stepNameMatch;
148 std::regex_search(seqName.begin(), seqName.end(), stepNameMatch,
std::regex(
"[Ss]tep[0-9]+"));
150 std::string stepName = stepNameMatch[0];
151 stepName[0] = std::toupper(stepName[0]);
154 chainToStepsId[
chain.name()].insert(nstep);
162 auto collToString = [&](
int xbin,
const LockedHandle<TH2>&
hist,
int startOfset=0,
int endOffset=0){
164 const int stepsSize =
hist->GetYaxis()->GetNbins() -
nBaseSteps();
165 for (
int ybin = 1; ybin <=
hist->GetYaxis()->GetNbins()-endOffset; ++ybin) {
166 if (ybin > startOfset) {
169 const std::string
chainName = m_passHistogram->GetXaxis()->GetBinLabel(xbin);
171 if (ybin < 3 || ybin > stepsSize + 2 || chainToStepsId[
chainName].
count(ybin - 2) != 0) {
174 v += fixedWidth(
"-", 11);
177 v += fixedWidth(
" ", 11);
184 v += fixedWidth(
"L1", 11);
185 v += fixedWidth(
"AfterPS", 11);
189 v += fixedWidth(
"Output", 11);
190 v += fixedWidth(
"Express", 11);
192 ATH_MSG_INFO(
"Chains passing step (1st row events & 2nd row decision counts):");
200 for (
int bin = 1;
bin <= (*m_passHistogram)->GetXaxis()->GetNbins(); ++
bin) {
201 const std::string
chainName = m_passHistogram->GetXaxis()->GetBinLabel(
bin);
205 ATH_MSG_INFO( fixedWidth(
"-- #" + chainID +
" Events", 30) << collToString(
bin, m_passHistogram) );
206 ATH_MSG_INFO( fixedWidth(
"-- #" + chainID +
" Features", 30) << collToString(
bin, m_countHistogram , 2, 1 ) );
213 return StatusCode::SUCCESS;
◆ ATLAS_THREAD_SAFE [1/2]
LockedHandle<TH2> m_passHistogram TrigSignatureMoni::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [2/2]
LockedHandle<TH2> m_countHistogram TrigSignatureMoni::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ m_bookingPath
Gaudi::Property<std::string> TrigSignatureMoni::m_bookingPath { this, "HistPath", "/EXPERT/HLTFramework", "Booking path for the histogram"} |
|
private |
◆ m_chainIDToBinMap
std::map<unsigned int, int> TrigSignatureMoni::m_chainIDToBinMap |
|
private |
◆ m_chainIDToBunchMap
std::map<unsigned int, std::set<std::string> > TrigSignatureMoni::m_chainIDToBunchMap |
|
private |
◆ m_decisionCollectorTools
ToolHandleArray<DecisionCollectorTool> TrigSignatureMoni::m_decisionCollectorTools { this, "DecisionCollectorTools", {}, "Tools that collect decisions (yes/no) for steps" } |
|
private |
◆ m_duration
Gaudi::Property<unsigned int> TrigSignatureMoni::m_duration {this, "RateIntegrationDuration", 10, "Integration time for the rate histogram in seconds"} |
|
private |
◆ m_expressChainMap
◆ m_featureCollectorTools
ToolHandleArray<DecisionCollectorTool> TrigSignatureMoni::m_featureCollectorTools { this, "FeatureCollectorTools", {}, "Tools that collect decision counts for specific features for steps" } |
|
private |
◆ m_finalDecisionKey
◆ m_groupToChainMap
◆ m_histSvc
ServiceHandle<ITHistSvc> TrigSignatureMoni::m_histSvc { this, "THistSvc", "THistSvc/THistSvc", "Histogramming svc" } |
|
private |
◆ m_HLTMenuKey
◆ m_incidentSvc
ServiceHandle<IIncidentSvc> TrigSignatureMoni::m_incidentSvc { this, "IncidentSvc", "IncidentSvc", "Incident service"} |
|
private |
◆ m_intervals
Gaudi::Property<unsigned int> TrigSignatureMoni::m_intervals {this, "RateIntegrationIntervals", 6, "Number of the rate histogram publications"} |
|
private |
◆ m_l1DecisionsKey
◆ m_L1MenuKey
◆ m_nameToBinMap
std::map<std::string, int> TrigSignatureMoni::m_nameToBinMap |
|
private |
◆ m_rateHistogram
◆ m_sequenceHistogram
◆ m_sequenceToBinMap
std::map<std::string, int> TrigSignatureMoni::m_sequenceToBinMap |
|
private |
◆ m_streamToChainMap
The documentation for this class was generated from the following files:
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > m_groupToChainMap
Group name to chain objects map.
std::unique_ptr< Athena::AlgorithmTimer > & getTimer()
TrigCompositeUtils::DecisionID numeric() const
numeric ID
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > m_streamToChainMap
Stream name to chain objects map, excluding express.
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
StatusCode fillRate(const TrigCompositeUtils::DecisionIDContainer &, int) const
ServiceHandle< ITHistSvc > m_histSvc
StatusCode initSeqHist(LockedHandle< TH2 > &, std::set< std::string > &)
StatusCode fillSequences(const std::set< std::string > &) const
std::map< std::string, int > m_sequenceToBinMap
Sequence to bin map for sequence histogram.
StatusCode initHist(LockedHandle< TH2 > &, SG::ReadHandle< TrigConf::HLTMenu > &, bool=true)
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > m_expressChainMap
Stream name to chain objects map, including only express.
StatusCode fillStreamsAndGroups(const std::map< std::string, TrigCompositeUtils::DecisionIDContainer > &, const TrigCompositeUtils::DecisionIDContainer &) const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const Decision * getTerminusNode(SG::ReadHandle< DecisionContainer > &container)
int nChains(SG::ReadHandle< TrigConf::HLTMenu > &) const
void startTimer(unsigned int duration, unsigned int intervals)
int nSequenceBins() const
StatusCode fillHistogram(const TrigCompositeUtils::DecisionIDContainer &, int, LockedHandle< TH2 > &) const
const Decision * getExpressTerminusNode(const DecisionContainer &container)
Returns the express-accept navigation node from a collection or nullptr if missing.
::StatusCode StatusCode
StatusCode definition for legacy code.
ServiceHandle< IIncidentSvc > m_incidentSvc
std::map< unsigned int, std::set< std::string > > m_chainIDToBunchMap
Chain ID to bunchgroup name map.
StatusCode fillDecisionCount(const std::vector< TrigCompositeUtils::DecisionID > &, int) const
StatusCode init(const std::string &histoName, const std::string &histoTitle, const int x, const int y, const std::string ®isterPath, const ServiceHandle< ITHistSvc > &histSvc)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Class used to describe composite objects in the HLT.
RateHistogram m_sequenceHistogram
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ToolHandleArray< DecisionCollectorTool > m_decisionCollectorTools
std::map< unsigned int, int > m_chainIDToBinMap
Chain id to histogram bin map.
std::string to_string(const DetectorType &type)
ToolHandleArray< DecisionCollectorTool > m_featureCollectorTools
Base class for Trigger configuration data and wrapper around underlying representation.
Gaudi::Property< unsigned int > m_intervals
static const std::string & type()
Incident type.
std::map< std::string, int > m_nameToBinMap
Sequence/group/bunchgroup name to bin map.
bool isLegId(const HLT::Identifier &legIdentifier)
Recognise whether the chain ID is a leg ID.
std::set< DecisionID > DecisionIDContainer
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_finalDecisionKey
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
std::string name() const
reports human redable name if it is enabled or, empty string
void fill(const double x, const double y) const
StatusCode fillPassEvents(const TrigCompositeUtils::DecisionIDContainer &, int) const
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
Gaudi::Property< unsigned int > m_duration
Gaudi::Property< std::string > m_bookingPath
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_l1DecisionsKey
RateHistogram m_rateHistogram