ATLAS Offline Software
Loading...
Searching...
No Matches
NavigationDAODTesterAlgv2.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIG_NAVTOOLS_NAVIGATIONDAODTESTERALGV2_H
6#define TRIG_NAVTOOLS_NAVIGATIONDAODTESTERALGV2_H
7
16
18#include "GaudiKernel/ToolHandle.h"
19#include "Gaudi/Property.h"
25
27
28#include <vector>
29#include <map>
30#include <string>
31#include <mutex>
32
33
34namespace Trig {
35
37{
38public:
39 NavigationDAODTesterAlgv2(const std::string &name, ISvcLocator *pSvcLocator);
40 virtual ~NavigationDAODTesterAlgv2() override = default;
41
42 virtual StatusCode initialize() override;
43 virtual StatusCode execute(const EventContext &context) const override;
44 virtual StatusCode finalize() override;
45
46private:
47
48 // Tool handles
49 PublicToolHandle<Trig::TrigDecisionTool> m_tdt{
50 this, "TrigDecisionTool", "", "Read R3 navigation data from TDT"};
51
52 PublicToolHandle<Trig::R3MatchingTool> m_matchingTool{
53 this, "R3MatchingTool", "Trig::R3MatchingTool", "R3 matching tool for converted navigation"};
54
55 PublicToolHandle<Trig::MatchFromCompositeTool> m_matchFromCompositeTool{
56 this, "MatchFromCompositeTool", "Trig::MatchFromCompositeTool", "R2 matching from pre-stored TrigComposite containers"};
57
58 // Properties
59 Gaudi::Property<std::vector<std::string>> m_chains{
60 this, "Chains", {}, "The trigger chains to test"};
61
62 Gaudi::Property<std::vector<std::string>> m_chainsToExclude{
63 this, "ChainsToExclude", {},
64 "Chain name patterns to skip (substring match), e.g. 'noL1'. "
65 "DAOD-tester-local exception list for pathological chain families whose "
66 "TrigMatch layout does not support the generic R2/R3 comparison. "
67 "Note: nomucomb chains no longer need excluding - they are handled by "
68 "the dedicated linearised path (see ChainsWithLinearisedR2Matching)."};
69
70 Gaudi::Property<std::vector<std::string>> m_linearisedR2Chains{
71 this, "ChainsWithLinearisedR2Matching", {"nomucomb"},
72 "Chain name patterns (substring match) whose TrigMatch container uses "
73 "the linearised layout: N entries of vector size 1, one per "
74 "individually matched offline object, instead of one entry of size "
75 "= sum of leg multiplicities per matched combination. These chains "
76 "are compared PER OBJECT (pool of individually matched objects vs "
77 "single-object R3 matching) instead of per combination, since the "
78 "reference carries no combination structure."};
79
80
81 Gaudi::Property<bool> m_failOnDifference{
82 this, "FailOnDifference", false,
83 "Return FAILURE if the navigation does not compare equal"};
84
85 Gaudi::Property<bool> m_verifyCombinationsSize{
86 this, "VerifyCombinationsSize", true,
87 "Check if combinations have matching size (that is Run2 >= Run3)"};
88
89 Gaudi::Property<bool> m_verifyCombinations{
90 this, "VerifyCombinationsContent", true,
91 "Check if combinations are compatible (point to same objects)"};
92
93 Gaudi::Property<std::string> m_inputPrefix{
94 this, "InputPrefix", "TrigMatch_",
95 "Prefix used for pre-matched trigger combinations branches"};
96
97 Gaudi::Property<bool> m_printSubfeatures{
98 this, "PrintSubfeatures", false,
99 "When true, print subfeatures (lower-pT objects from Run2->Run3 conversion) for each passing chain"};
100
101 Gaudi::Property<bool> m_dumpFeaturesWithoutR2{
102 this, "DumpFeaturesWithoutR2", false,
103 "Diagnostic: when the TrigMatch_<chain> container is absent (e.g. when "
104 "running directly on the conversion output at AOD level, where no R2 "
105 "matching reference exists), still print the per-leg R3 features of "
106 "passed chains. The cross-leg feature pooling converter defect shows "
107 "up directly in this dump (identical pooled lists on every leg)."};
108
109 // Mutable counters for statistics (thread-safe)
110 mutable std::map<std::string, int> m_failingChains ATLAS_THREAD_SAFE;
115 mutable std::map<std::string, int> m_emptyR2Chains ATLAS_THREAD_SAFE;
116 mutable std::mutex m_failingChainsMutex;
117
118 // Helper methods
119
123 std::size_t numberOfLegs(const std::string& chain) const;
124
129 void dumpFeaturesPerLeg(const std::string& chain,
130 std::size_t nLegs,
131 MSG::Level level,
132 const std::string& linkName = "") const;
133
135 static bool matchesAnyPattern(const std::string& chain,
136 const std::vector<std::string>& patterns);
137
142 static const xAOD::IParticle* resolveOriginal(const xAOD::IParticle* p);
143
149 static bool matchLinearisedR2(std::vector<const xAOD::IParticle*> pool,
150 const std::vector<const xAOD::IParticle*>& particles);
151
152}; // end class NavigationDAODTesterAlgv2
153
154
155} // end namespace Trig
156
157#endif // TRIG_NAVTOOLS_NAVIGATIONDAODTESTERALGV2_H
Define macros for attributes used to control the static checker.
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Property< bool > m_dumpFeaturesWithoutR2
static bool matchesAnyPattern(const std::string &chain, const std::vector< std::string > &patterns)
True if the chain name contains any of the patterns (substring match).
std::map< std::string, int > m_failingChains ATLAS_THREAD_SAFE
void dumpFeaturesPerLeg(const std::string &chain, std::size_t nLegs, MSG::Level level, const std::string &linkName="") const
Dump the per-leg R3 features of a chain at the given message level.
virtual ~NavigationDAODTesterAlgv2() override=default
PublicToolHandle< Trig::TrigDecisionTool > m_tdt
Gaudi::Property< std::vector< std::string > > m_chains
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &context) const override
PublicToolHandle< Trig::MatchFromCompositeTool > m_matchFromCompositeTool
std::size_t numberOfLegs(const std::string &chain) const
Number of legs of a chain, derived from ChainNameParser::multiplicities().
Gaudi::Property< std::vector< std::string > > m_linearisedR2Chains
static const xAOD::IParticle * resolveOriginal(const xAOD::IParticle *p)
Resolve a possible shallow copy to its original object via the "originalObjectLink" decoration (mirro...
NavigationDAODTesterAlgv2(const std::string &name, ISvcLocator *pSvcLocator)
static bool matchLinearisedR2(std::vector< const xAOD::IParticle * > pool, const std::vector< const xAOD::IParticle * > &particles)
R2 verdict for chains with linearised TrigMatch layout (e.g.
Gaudi::Property< bool > m_verifyCombinationsSize
PublicToolHandle< Trig::R3MatchingTool > m_matchingTool
Gaudi::Property< std::string > m_inputPrefix
Gaudi::Property< std::vector< std::string > > m_chainsToExclude
Class providing the definition of the 4-vector interface.
std::vector< std::string > patterns
Definition listroot.cxx:187
The common trigger namespace for trigger analysis tools.
Framework include files.
Definition libname.h:15