5#ifndef TRIG_NAVTOOLS_NAVIGATIONDAODTESTERALGV2_H
6#define TRIG_NAVTOOLS_NAVIGATIONDAODTESTERALGV2_H
18#include "GaudiKernel/ToolHandle.h"
19#include "Gaudi/Property.h"
43 virtual StatusCode
execute(
const EventContext &context)
const override;
44 virtual StatusCode
finalize()
override;
49 PublicToolHandle<Trig::TrigDecisionTool>
m_tdt{
50 this,
"TrigDecisionTool",
"",
"Read R3 navigation data from TDT"};
53 this,
"R3MatchingTool",
"Trig::R3MatchingTool",
"R3 matching tool for converted navigation"};
56 this,
"MatchFromCompositeTool",
"Trig::MatchFromCompositeTool",
"R2 matching from pre-stored TrigComposite containers"};
59 Gaudi::Property<std::vector<std::string>>
m_chains{
60 this,
"Chains", {},
"The trigger chains to test"};
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)."};
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."};
82 this,
"FailOnDifference",
false,
83 "Return FAILURE if the navigation does not compare equal"};
86 this,
"VerifyCombinationsSize",
true,
87 "Check if combinations have matching size (that is Run2 >= Run3)"};
90 this,
"VerifyCombinationsContent",
true,
91 "Check if combinations are compatible (point to same objects)"};
94 this,
"InputPrefix",
"TrigMatch_",
95 "Prefix used for pre-matched trigger combinations branches"};
98 this,
"PrintSubfeatures",
false,
99 "When true, print subfeatures (lower-pT objects from Run2->Run3 conversion) for each passing chain"};
102 this,
"R3MatchingRerun",
true,
103 "Pass rerun=true to the R3 matching, i.e. also accept chains whose "
104 "decision is only resurrected (prescaled or disabled chains evaluated "
105 "in rerun). This must match how the R2 reference was produced: the "
106 "DerivationFramework TriggerMatchingTool writes the TrigMatch_<chain> "
107 "containers with Rerun=true. With false, every rerun-only event of a "
108 "prescaled chain shows up as 'R2 passes, R3 fails' although the "
109 "converted navigation holds the matching objects."};
112 this,
"DRThresholdFromRun2Lists",
true,
113 "Choose the R3 matching dR as the Run 2 TrigMatch production did, per "
114 "trigger list (DerivationFrameworkPhys/PhysCommonConfig.py): 0.2 only "
115 "for chains of the Tau list, i.e. chains with a tau leg and no e/mu/g "
116 "leg (tau, di-tau, tau+xe), 0.1 for every chain of the NoTau list, "
117 "which includes the e+tau and mu+tau chains. Exact for the TriggerAPI "
118 "lists and the run2ExtraMatching*.txt files; chains added through "
119 "flags.Trigger.derivationsExtraChains are routed by the substring 'tau' "
120 "in their name instead. With false: 0.2 for any chain with a tau leg, "
121 "0.1 otherwise (the previous rule, which lets the R3 matching accept "
122 "lepton+tau objects the Run 2 reference never considered)."};
125 this,
"DumpFeaturesWithoutR2",
false,
126 "Diagnostic: when the TrigMatch_<chain> container is absent (e.g. when "
127 "running directly on the conversion output at AOD level, where no R2 "
128 "matching reference exists), still print the per-leg R3 features of "
129 "passed chains. The cross-leg feature pooling converter defect shows "
130 "up directly in this dump (identical pooled lists on every leg)."};
150 std::size_t
numberOfLegs(
const std::string& chain)
const;
159 const std::string& linkName =
"")
const;
163 const std::vector<std::string>&
patterns);
177 const std::vector<const xAOD::IParticle*>& particles);
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< bool > m_failOnDifference
Gaudi::Property< std::vector< std::string > > m_linearisedR2Chains
Gaudi::Property< bool > m_drFromRun2Lists
virtual StatusCode finalize() override
Gaudi::Property< bool > m_printSubfeatures
static const xAOD::IParticle * resolveOriginal(const xAOD::IParticle *p)
Resolve a possible shallow copy to its original object via the "originalObjectLink" decoration (mirro...
Gaudi::Property< bool > m_verifyCombinations
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_r3MatchingRerun
std::mutex m_failingChainsMutex
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
The common trigger namespace for trigger analysis tools.