ATLAS Offline Software
DataHandleTestTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 #ifndef ASG_TOOLS__DATA_HANDLES_TEST_TOOL_H
10 #define ASG_TOOLS__DATA_HANDLES_TEST_TOOL_H
11 
12 #include <AsgTools/AsgTool.h>
19 
20 // AthSimulation doesn't contain the muon-container, so we can't
21 // really build the tool, but it is simpler to build an empty tool
22 // than to exclude the tool completely from the AthSimulation build.
23 #ifndef SIMULATIONBASE
24 #include <xAODMuon/MuonContainer.h>
25 #endif
26 
27 namespace asg
28 {
33 
34  struct DataHandleTestTool : virtual public IDataHandleTestTool,
35  public AsgTool
36  {
38 
39 
40  public:
41  DataHandleTestTool (const std::string& val_name);
42 
44  public:
46 
47  public:
48  StatusCode initialize () override;
49 
50  public:
51  void runTest ATLAS_NOT_THREAD_SAFE () override;
52 
53  public:
54 #ifndef SIMULATIONBASE
55  SG::ReadHandleKey<xAOD::MuonContainer> m_readKey {this, "readKey", "Muons", "regular read key"};
56  SG::ReadHandleKey<xAOD::MuonContainer> m_readKeyEmpty {this, "readKeyEmpty", "", "regular read key (empty by default)"};
57  SG::ReadDecorHandleKey<xAOD::MuonContainer> m_readDecorKey {this, "readDecorKey", "Muons.pt", "read decor key"};
58  SG::ReadDecorHandleKey<xAOD::MuonContainer> m_readDecorKeyEmpty {this, "readDecorKeyEmpty", "", "read decor key (empty by default)"};
59  SG::ReadHandleKeyArray<xAOD::MuonContainer> m_readKeyArray {this, "readKeyArray", {}, "array read key"};
60  SG::WriteHandleKey<xAOD::MuonContainer> m_writeKey {this, "writeKey", "", "regular write key"};
61  SG::WriteDecorHandleKey<xAOD::MuonContainer> m_writeDecorKey {this, "writeDecorKey", "", "write decor key"};
62  SG::WriteDecorHandleKey<xAOD::MuonContainer> m_writeDecorKeyExisting {this, "writeDecorKeyExisting", "", "write decor key (existing)"};
63 #endif
64  bool m_readFailure {false};
65  bool m_readArray {false};
66  bool m_readDecorFailure {false};
67  std::string m_doWriteName;
68  std::string m_doWriteDecorName;
70  };
71 }
72 
73 #endif
asg::DataHandleTestTool::m_readKey
SG::ReadHandleKey< xAOD::MuonContainer > m_readKey
Definition: DataHandleTestTool.h:55
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
asg::DataHandleTestTool::m_writeDecorKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_writeDecorKey
Definition: DataHandleTestTool.h:61
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
asg::DataHandleTestTool::m_doWriteName
std::string m_doWriteName
Definition: DataHandleTestTool.h:67
asg::DataHandleTestTool::DataHandleTestTool
DataHandleTestTool(const std::string &val_name)
standard constructor
Definition: DataHandleTestTool.cxx:37
asg::DataHandleTestTool::m_doWriteDecorName
std::string m_doWriteDecorName
Definition: DataHandleTestTool.h:68
asg
Definition: DataHandleTestTool.h:28
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
asg::DataHandleTestTool::m_readDecorKeyEmpty
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_readDecorKeyEmpty
Definition: DataHandleTestTool.h:58
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
asg::DataHandleTestTool::m_readDecorFailure
bool m_readDecorFailure
Definition: DataHandleTestTool.h:66
asg::DataHandleTestTool
a tool used to unit test AnaToolHandle
Definition: DataHandleTestTool.h:36
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
asg::DataHandleTestTool::m_readArray
bool m_readArray
Definition: DataHandleTestTool.h:65
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
asg::DataHandleTestTool::m_doWriteDecorNameExisting
std::string m_doWriteDecorNameExisting
Definition: DataHandleTestTool.h:69
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
asg::DataHandleTestTool::m_writeDecorKeyExisting
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_writeDecorKeyExisting
Definition: DataHandleTestTool.h:62
asg::IDataHandleTestTool
the interface for DataHandleTestTool
Definition: IDataHandleTestTool.h:20
asg::DataHandleTestTool::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: DataHandleTestTool.cxx:58
asg::DataHandleTestTool::ATLAS_NOT_THREAD_SAFE
void runTest ATLAS_NOT_THREAD_SAFE() override
run the test
asg::DataHandleTestTool::~DataHandleTestTool
~DataHandleTestTool()
standard destructor
Definition: DataHandleTestTool.cxx:51
MuonContainer.h
asg::DataHandleTestTool::m_readDecorKey
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_readDecorKey
Definition: DataHandleTestTool.h:57
WriteDecorHandleKey.h
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
asg::DataHandleTestTool::m_readKeyEmpty
SG::ReadHandleKey< xAOD::MuonContainer > m_readKeyEmpty
Definition: DataHandleTestTool.h:56
IDataHandleTestTool.h
asg::DataHandleTestTool::m_writeKey
SG::WriteHandleKey< xAOD::MuonContainer > m_writeKey
Definition: DataHandleTestTool.h:60
ReadHandleKeyArray.h
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
AsgTool.h
asg::DataHandleTestTool::m_readKeyArray
SG::ReadHandleKeyArray< xAOD::MuonContainer > m_readKeyArray
Definition: DataHandleTestTool.h:59
asg::DataHandleTestTool::m_readFailure
bool m_readFailure
Definition: DataHandleTestTool.h:64