ATLAS Offline Software
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 
13 namespace 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 }
Trig::NavigationTesterAlg::~NavigationTesterAlg
~NavigationTesterAlg() override=default
Trig::NavigationTesterAlg::m_tdtRun3
PublicToolHandle< Trig::TrigDecisionTool > m_tdtRun3
Definition: NavigationTesterAlg.h:25
Trig::NavigationTesterAlg::m_verifyCombinations
Gaudi::Property< bool > m_verifyCombinations
Definition: NavigationTesterAlg.h:40
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
Trig::NavigationTesterAlg::CombinationsVector
std::vector< std::vector< const xAOD::IParticle * > > CombinationsVector
Definition: NavigationTesterAlg.h:44
Trig::NavigationTesterAlg::initialize
StatusCode initialize() override
Definition: NavigationTesterAlg.cxx:63
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
Trig::NavigationTesterAlg::NavigationTesterAlg
NavigationTesterAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: NavigationTesterAlg.cxx:59
Trig::NavigationTesterAlg::verifyCombinationsContent
StatusCode verifyCombinationsContent(const CombinationsSet &run2, const CombinationsSet &run3, const std::string &chain) const
Definition: NavigationTesterAlg.cxx:194
Trig::NavigationTesterAlg::m_toolRun3
ToolHandle< Trig::IIParticleRetrievalTool > m_toolRun3
Definition: NavigationTesterAlg.h:30
TrigDecisionTool.h
Trig::NavigationTesterAlg::m_verifyCombinationsSize
Gaudi::Property< bool > m_verifyCombinationsSize
Definition: NavigationTesterAlg.h:37
Trig::NavigationTesterAlg::CombinationsSet
std::set< std::set< const xAOD::IParticle * > > CombinationsSet
Definition: NavigationTesterAlg.h:45
Trig::NavigationTesterAlg::combinationsEmpty
bool combinationsEmpty(const CombinationsVector &combs) const
Definition: NavigationTesterAlg.cxx:257
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
RunTileCalibRec.run3
run3
Definition: RunTileCalibRec.py:208
Trig::NavigationTesterAlg::verifyFlatContent
StatusCode verifyFlatContent(const std::string &chain) const
Definition: NavigationTesterAlg.cxx:146
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trig::NavigationTesterAlg::verifyCombinationsSize
StatusCode verifyCombinationsSize(const CombinationsVector &run2, const CombinationsVector &run3, const std::string &chain) const
Definition: NavigationTesterAlg.cxx:181
Trig::NavigationTesterAlg::execute
StatusCode execute(const EventContext &context) const override
Definition: NavigationTesterAlg.cxx:76
IIParticleRetrievalTool.h
AthReentrantAlgorithm.h
Trig::NavigationTesterAlg::m_tdtRun2
PublicToolHandle< Trig::TrigDecisionTool > m_tdtRun2
Definition: NavigationTesterAlg.h:26
ReadCellNoiseFromCoolCompare.run2
run2
Definition: ReadCellNoiseFromCoolCompare.py:53
Trig::NavigationTesterAlg::m_chains
Gaudi::Property< std::vector< std::string > > m_chains
Definition: NavigationTesterAlg.h:32
Trig::NavigationTesterAlg
Definition: NavigationTesterAlg.h:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trig::NavigationTesterAlg::m_failOnDifference
Gaudi::Property< bool > m_failOnDifference
Definition: NavigationTesterAlg.h:34
Trig::NavigationTesterAlg::m_tdt
PublicToolHandle< Trig::TrigDecisionTool > m_tdt
Definition: NavigationTesterAlg.h:24
Trig::NavigationTesterAlg::m_toolRun2
ToolHandle< Trig::IIParticleRetrievalTool > m_toolRun2
Definition: NavigationTesterAlg.h:28