Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
InvMassDPhiInc2TestBenchAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GLOBALSIM_INVMASSDPHIINC2TESTBENCHALG_H
6 #define GLOBALSIM_INVMASSDPHIINC2TESTBENCHALG_H
7 
8 /*
9  * Create and write out vectors of bit strings represented GenericTobs
10  # and expectation values for the InvaariantMassDPhiInclusive2 Algorithm
11  *
12  */
13 
15 #include "GenericTob.h"
16 
17 #include <string>
18 #include <memory>
19 #include <vector>
20 
21 
22 namespace GlobalSim {
23 
25  public:
26 
27 
28  InvMassDPhiInc2TestBenchAlg(const std::string& name, ISvcLocator *pSvcLocator);
29 
30  virtual StatusCode initialize () override;
31  virtual StatusCode execute () override;
32 
33  using Result = std::string;
34  using ResultPtr = std::unique_ptr<Result>;
35 
36  private:
37 
40  this,
41  "genericTobContainer1WriteKey",
42  "genericTobContainer1",
43  "key to write out a GenericTob bit string Container (1/2"};
44 
45 
48  this,
49  "genericTobContainer2WriteKey",
50  "genericTobContainer2",
51  "key to write out a GenericTob bit string Container (2/2"};
52 
55  this,
56  "InvMassDPhiInc2ExpectationsWriteKey",
57  "InvMassDPhiInc2Expectations",
58  "key to write out expectations for InvariantMassDPhiInclusive2 regression tests"
59  };
60 
61  std::size_t m_dataIndex{0}; // indexes pointing to the current data.
62 
63 
64 
65  // filename used when reading test data from files.
66  Gaudi::Property<std::string>
68  "testsFileName1",
69  {},
70  "name of file with 32 bit data for GenericTobs 1 from HW Sim"};
71 
72 
73 
74  // filename used when reading test data from files.
75  Gaudi::Property<std::string>
77  "testsFileName2",
78  {},
79  "name of file with 32 bit data for GenericTobs 2 from HW Sim"};
80 
81 
82  // filename used when expected results from files.
83  Gaudi::Property<std::string>
85  "expectedResults_FileName",
86  {},
87  "name of file with expected generic tob values from HW Sim"};
88 
89  // Manually written test data (used when not reading data from files)
90  // GenericTobs represented as bit strings
91  Gaudi::Property<std::vector<std::string>>
93  this,
94  "test_tobs1",
95  {},
96  "test vectors for manual tests. Binary. Manual."};
97 
98 
99  // test Tobs after repeat has been applied to testVecs_in
100  std::vector<GlobalSim::GenericTobContainer> m_testTobs1{};
101 
102 
103  // Manually written test data (used when not reading data from files)
104  // GenericTobs represented as bit strings
105  Gaudi::Property<std::vector<std::string>>
107  this,
108  "test_tobs2",
109  {},
110  "test vectors for manual tests. Binary. Manual."};
111 
112 
113  // test Tobs after repeat has been applied to testVecs_in
114  std::vector<GlobalSim::GenericTobContainer> m_testTobs2{};
115 
116 
117  // expected results for manual testing
118  Gaudi::Property<std::string>
120  this,
121  "expResults",
122  {},
123  "expected counts for manual tests. Binary"};
124 
125 
126  // choose int rather than unsigned someting to avoid unpleasantness
127  // if initialised with a negative value
128  Gaudi::Property<int>
130  this,
131  "testRepeat",
132  {1},
133  "number of times to repeat manual test values"};
134 
135  // expected results - one value per event
136  std::vector<std::string> m_expectedResults{};
137 
138 
139  // m_fifo fillers, called from init()
145 
146  };
147 }
148 #endif
GlobalSim::InvMassDPhiInc2TestBenchAlg::init_manual
StatusCode init_manual()
Definition: InvMassDPhiInc2TestBenchAlg.cxx:95
GlobalSim::InvMassDPhiInc2TestBenchAlg::InvMassDPhiInc2TestBenchAlg
InvMassDPhiInc2TestBenchAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: InvMassDPhiInc2TestBenchAlg.cxx:13
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_testTobs1
std::vector< GlobalSim::GenericTobContainer > m_testTobs1
Definition: InvMassDPhiInc2TestBenchAlg.h:100
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_testTobs2_in
Gaudi::Property< std::vector< std::string > > m_testTobs2_in
Definition: InvMassDPhiInc2TestBenchAlg.h:106
GlobalSim::InvMassDPhiInc2TestBenchAlg::initialize
virtual StatusCode initialize() override
Definition: InvMassDPhiInc2TestBenchAlg.cxx:21
GlobalSim::InvMassDPhiInc2TestBenchAlg::init_tobs1_from_file
StatusCode init_tobs1_from_file()
Definition: InvMassDPhiInc2TestBenchAlg.cxx:81
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_expectedResults_FileName
Gaudi::Property< std::string > m_expectedResults_FileName
Definition: InvMassDPhiInc2TestBenchAlg.h:84
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_testTobs2
std::vector< GlobalSim::GenericTobContainer > m_testTobs2
Definition: InvMassDPhiInc2TestBenchAlg.h:114
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_tobs2_WriteKey
SG::WriteHandleKey< GenericTobContainer > m_tobs2_WriteKey
Definition: InvMassDPhiInc2TestBenchAlg.h:47
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_testTobs1_in
Gaudi::Property< std::vector< std::string > > m_testTobs1_in
Definition: InvMassDPhiInc2TestBenchAlg.h:92
GlobalSim::InvMassDPhiInc2TestBenchAlg::execute
virtual StatusCode execute() override
Definition: InvMassDPhiInc2TestBenchAlg.cxx:184
GenericTob.h
GlobalSim::InvMassDPhiInc2TestBenchAlg::Result
std::string Result
Definition: InvMassDPhiInc2TestBenchAlg.h:33
GlobalSim::InvMassDPhiInc2TestBenchAlg
Definition: InvMassDPhiInc2TestBenchAlg.h:24
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_expectations_WriteKey
SG::WriteHandleKey< Result > m_expectations_WriteKey
Definition: InvMassDPhiInc2TestBenchAlg.h:54
GlobalSim::InvMassDPhiInc2TestBenchAlg::init_tobs2_from_file
StatusCode init_tobs2_from_file()
Definition: InvMassDPhiInc2TestBenchAlg.cxx:86
AthAlgorithm.h
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
SG::WriteHandleKey< GenericTobContainer >
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_expResults_in
Gaudi::Property< std::string > m_expResults_in
Definition: InvMassDPhiInc2TestBenchAlg.h:119
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgorithm
Definition: AthAlgorithm.h:47
GlobalSim::InvMassDPhiInc2TestBenchAlg::init_expected_results_from_file
StatusCode init_expected_results_from_file()
Definition: InvMassDPhiInc2TestBenchAlg.cxx:90
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_testsFileName1
Gaudi::Property< std::string > m_testsFileName1
Definition: InvMassDPhiInc2TestBenchAlg.h:67
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_testRepeat
Gaudi::Property< int > m_testRepeat
Definition: InvMassDPhiInc2TestBenchAlg.h:129
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_expectedResults
std::vector< std::string > m_expectedResults
Definition: InvMassDPhiInc2TestBenchAlg.h:136
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_dataIndex
std::size_t m_dataIndex
Definition: InvMassDPhiInc2TestBenchAlg.h:61
GlobalSim::InvMassDPhiInc2TestBenchAlg::ResultPtr
std::unique_ptr< Result > ResultPtr
Definition: InvMassDPhiInc2TestBenchAlg.h:34
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_tobs1_WriteKey
SG::WriteHandleKey< GenericTobContainer > m_tobs1_WriteKey
Definition: InvMassDPhiInc2TestBenchAlg.h:39
GlobalSim::InvMassDPhiInc2TestBenchAlg::m_testsFileName2
Gaudi::Property< std::string > m_testsFileName2
Definition: InvMassDPhiInc2TestBenchAlg.h:76
GlobalSim::InvMassDPhiInc2TestBenchAlg::init_from_file
StatusCode init_from_file()
Definition: InvMassDPhiInc2TestBenchAlg.cxx:74