ATLAS Offline Software
Loading...
Searching...
No Matches
NavigationTesterAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "GaudiKernel/ToolHandle.h"
7#include "Gaudi/Property.h"
10
11#include <vector>
12
13namespace Trig {
15 {
16 public:
17 NavigationTesterAlg(const std::string &name, ISvcLocator *pSvcLocator);
18 ~NavigationTesterAlg() override = default;
19
20 StatusCode initialize() override;
21 StatusCode execute(const EventContext &context) const override;
22
23 private:
24 PublicToolHandle<Trig::TrigDecisionTool> m_tdt{this, "TrigDecisionTool", "", "When enabled read navigation from TDT/off by default"};
25 PublicToolHandle<Trig::TrigDecisionTool> m_tdtRun3{this, "TrigDecisionToolRun3", "", "Use for directly accessing objects"};
26 PublicToolHandle<Trig::TrigDecisionTool> m_tdtRun2{this, "TrigDecisionToolRun2", "", "Use for directly accessing objects"};
27
28 ToolHandle<Trig::IIParticleRetrievalTool> m_toolRun2{
29 this, "RetrievalToolRun2Nav", "", "The tool configured to use Run 2 format"};
30 ToolHandle<Trig::IIParticleRetrievalTool> m_toolRun3{
31 this, "RetrievalToolRun3Nav", "", "The tool configured to use Run 3 format"};
32 Gaudi::Property<std::vector<std::string>> m_chains{
33 this, "Chains", {}, "The chains to test"};
34 Gaudi::Property<bool> m_failOnDifference{
35 this, "FailOnDifference", false,
36 "Return FAILURE if the navigation does not compare equal"};
37 Gaudi::Property<bool> m_verifyCombinationsSize{
38 this, "VerifyCombinationsSize", true,
39 "Check if combinations have matching size (that is Run2 >= Run3)"};
40 Gaudi::Property<bool> m_verifyCombinations{
41 this, "VerifyCombinationsContent", true,
42 "Check if combinations are compatible (point to same objects)"};
43
44 using CombinationsVector=std::vector<std::vector<const xAOD::IParticle *>>;
45 using CombinationsSet=std::set<std::set<const xAOD::IParticle *>>;
46 StatusCode verifyFlatContent(const std::string& chain) const;
47 StatusCode verifyCombinationsSize(const CombinationsVector& run2, const CombinationsVector& run3, const std::string& chain) const;
48 StatusCode verifyCombinationsContent(const CombinationsSet& run2, const CombinationsSet& run3, const std::string& chain) const;
49 bool combinationsEmpty(const CombinationsVector& combs) const;
50
51 }; //> end class AthAlgorithm
52}
An algorithm that can be simultaneously executed in multiple threads.
StatusCode verifyFlatContent(const std::string &chain) const
PublicToolHandle< Trig::TrigDecisionTool > m_tdtRun3
StatusCode verifyCombinationsSize(const CombinationsVector &run2, const CombinationsVector &run3, const std::string &chain) const
PublicToolHandle< Trig::TrigDecisionTool > m_tdtRun2
PublicToolHandle< Trig::TrigDecisionTool > m_tdt
ToolHandle< Trig::IIParticleRetrievalTool > m_toolRun3
std::vector< std::vector< const xAOD::IParticle * > > CombinationsVector
~NavigationTesterAlg() override=default
StatusCode execute(const EventContext &context) const override
StatusCode initialize() override
std::set< std::set< const xAOD::IParticle * > > CombinationsSet
StatusCode verifyCombinationsContent(const CombinationsSet &run2, const CombinationsSet &run3, const std::string &chain) const
Gaudi::Property< bool > m_verifyCombinations
Gaudi::Property< bool > m_verifyCombinationsSize
Gaudi::Property< bool > m_failOnDifference
bool combinationsEmpty(const CombinationsVector &combs) const
ToolHandle< Trig::IIParticleRetrievalTool > m_toolRun2
Gaudi::Property< std::vector< std::string > > m_chains
NavigationTesterAlg(const std::string &name, ISvcLocator *pSvcLocator)
The common trigger namespace for trigger analysis tools.