Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HypoTestBenchAlg.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_HYPOTESTBENCHALG_H
6 #define GLOBALSIM_HYPOTESTBENCHALG_H
7 
8 /*
9  * Create and write out a FIFO (vector) of eEMTObs to the event store/
10  * This simulates the action of the APP FIFOs, which feed TOBs to the
11  * APU Algorithhms
12  *
13  */
14 
16 
19 
20 
21 #include <string>
22 #include <memory>
23 #include <bitset>
24 #include <vector>
25 
26 
27 namespace GlobalSim {
28 
29  class HypoTestBenchAlg : public AthAlgorithm {
30  public:
31 
32 
33  HypoTestBenchAlg(const std::string& name, ISvcLocator *pSvcLocator);
34 
35  virtual StatusCode initialize () override;
36  virtual StatusCode execute () override;
37 
38  private:
39 
42  this,
43  "hypothesisFIFOWriteKey",
44  "hypoFIFO",
45  "key to write out Fifo containing ports data"};
46 
49  this,
50  "eEmSortSelectCountExpectationsWriteKey",
51  "eEmSortSelectCountExpectations",
52  "key to write out expectations for eEmSortSelecCount regression tests"
53  };
54 
55  Gaudi::Property<std::string>
57  "testsFileName",
58  {},
59  "name of file with APP FIFO data"};
60 
61 
62  Gaudi::Property<std::string>
64  "expectedMultsFileName",
65  {},
66  "name of file with the expected multiplicity values from HW Sim"};
67 
68  Gaudi::Property<std::vector<std::string>>
70  this,
71  "test_vecs",
72  {},
73  "test vectors for manual tests. Hex"};
74 
75  Gaudi::Property<std::string>
77  "expectedTobsFileName",
78  {},
79  "name of file with the expected Generic TOB values from HW Sim"};
80 
81  Gaudi::Property<std::string>
83  this,
84  "expMults",
85  {},
86  "expected counts for manual tests. Hex"};
87 
88 
89  Gaudi::Property<std::string>
91  this,
92  "expTobs",
93  {},
94  "expected output generic TOBs for manual tests. Hex"};
95 
96  // choose int rather than unsigned someting to avoid unpleasantness
97  // if initialised with a negative value
98  Gaudi::Property<int>
100  this,
101  "testRepeat",
102  {1},
103  "number of times to repeat manual test values"};
104 
105  // test vectors after repeat has been applied to testVecs_in
106  std::vector<std::string> m_testVecs{};
107 
108  // One elenement of the following vector is written out each event.
109  std::vector<std::unique_ptr<GepAlgoHypothesisFIFO>> m_fifos;
110  std::size_t m_fifo_ptr{0};
111 
112  // expected values for counts coorespoinding to the FIFO data.
113  std::vector<std::string> m_expected_mults{};
114  std::vector<std::string> m_expected_tobs{};
115 
116 
117  // m_fifo fillers, called from init()
123  StatusCode init_expected_from_file(std::vector<std::string>&,
124  const std::string&);
125 
126 
127  StatusCode
128  hexTOB2bitsetTOB(std::string, std::bitset<72>&) const;
129 
130  };
131 }
132 #endif
GlobalSim::HypoTestBenchAlg
Definition: HypoTestBenchAlg.h:29
GlobalSim::HypoTestBenchAlg::init_expected_mults_from_file
StatusCode init_expected_mults_from_file()
Definition: HypoTestBenchAlg.cxx:228
GlobalSim::HypoTestBenchAlg::HypoTestBenchAlg
HypoTestBenchAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HypoTestBenchAlg.cxx:33
GlobalSim::HypoTestBenchAlg::m_expectedMults_FileName
Gaudi::Property< std::string > m_expectedMults_FileName
Definition: HypoTestBenchAlg.h:63
GlobalSim::HypoTestBenchAlg::init_expected_from_file
StatusCode init_expected_from_file(std::vector< std::string > &, const std::string &)
Definition: HypoTestBenchAlg.cxx:245
GlobalSim::HypoTestBenchAlg::m_testVecs_in
Gaudi::Property< std::vector< std::string > > m_testVecs_in
Definition: HypoTestBenchAlg.h:69
GlobalSim::HypoTestBenchAlg::initialize
virtual StatusCode initialize() override
Definition: HypoTestBenchAlg.cxx:38
eEmSortSelectCountExpectations.h
GlobalSim::HypoTestBenchAlg::m_fifos
std::vector< std::unique_ptr< GepAlgoHypothesisFIFO > > m_fifos
Definition: HypoTestBenchAlg.h:109
GlobalSim::HypoTestBenchAlg::m_expTobs_in
Gaudi::Property< std::string > m_expTobs_in
Definition: HypoTestBenchAlg.h:90
AthAlgorithm.h
GlobalSim::HypoTestBenchAlg::init_expected_tobs_from_file
StatusCode init_expected_tobs_from_file()
Definition: HypoTestBenchAlg.cxx:236
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
SG::WriteHandleKey< GepAlgoHypothesisFIFO >
GepAlgoHypothesisPortsIn.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GlobalSim::HypoTestBenchAlg::m_testRepeat
Gaudi::Property< int > m_testRepeat
Definition: HypoTestBenchAlg.h:99
GlobalSim::HypoTestBenchAlg::init_tests_from_file
StatusCode init_tests_from_file()
Definition: HypoTestBenchAlg.cxx:183
AthAlgorithm
Definition: AthAlgorithm.h:47
GlobalSim::HypoTestBenchAlg::m_expected_tobs
std::vector< std::string > m_expected_tobs
Definition: HypoTestBenchAlg.h:114
GlobalSim::HypoTestBenchAlg::m_hypothesisFIFO_WriteKey
SG::WriteHandleKey< GepAlgoHypothesisFIFO > m_hypothesisFIFO_WriteKey
Definition: HypoTestBenchAlg.h:41
GlobalSim::HypoTestBenchAlg::m_fifo_ptr
std::size_t m_fifo_ptr
Definition: HypoTestBenchAlg.h:110
GlobalSim::HypoTestBenchAlg::m_testsFileName
Gaudi::Property< std::string > m_testsFileName
Definition: HypoTestBenchAlg.h:56
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
GlobalSim::HypoTestBenchAlg::m_testVecs
std::vector< std::string > m_testVecs
Definition: HypoTestBenchAlg.h:106
GlobalSim::HypoTestBenchAlg::execute
virtual StatusCode execute() override
Definition: HypoTestBenchAlg.cxx:64
GlobalSim::HypoTestBenchAlg::m_eEmSortSelectCountExpectations_WriteKey
SG::WriteHandleKey< eEmSortSelectCountExpectations > m_eEmSortSelectCountExpectations_WriteKey
Definition: HypoTestBenchAlg.h:48
GlobalSim::HypoTestBenchAlg::m_expected_mults
std::vector< std::string > m_expected_mults
Definition: HypoTestBenchAlg.h:113
GlobalSim::HypoTestBenchAlg::init_from_file
StatusCode init_from_file()
Definition: HypoTestBenchAlg.cxx:149
GlobalSim::HypoTestBenchAlg::m_expectedTobs_FileName
Gaudi::Property< std::string > m_expectedTobs_FileName
Definition: HypoTestBenchAlg.h:76
GlobalSim::HypoTestBenchAlg::hexTOB2bitsetTOB
StatusCode hexTOB2bitsetTOB(std::string, std::bitset< 72 > &) const
Definition: HypoTestBenchAlg.cxx:11
GlobalSim::HypoTestBenchAlg::m_expMults_in
Gaudi::Property< std::string > m_expMults_in
Definition: HypoTestBenchAlg.h:82
GlobalSim::HypoTestBenchAlg::init_manual
StatusCode init_manual()
Definition: HypoTestBenchAlg.cxx:95