ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
TOBTextReader.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef GLOBALSIM_TOBTEXTREADER_H
5
#define GLOBALSIM_TOBTEXTREADER_H
6
7
/*
8
Reads a hex text file of TOB test vectors and produces a container of
9
objects carrying the decoded fields: one line per event, one token per TOB,
10
each token the whole word in hex.
11
12
The mirror of TOBTextWriter, and it works the same way: the bit layout is
13
chosen by name through the BitSpec property and looked up in SpecRegistry, so
14
the reader holds no knowledge of field positions and adding a TOB type needs
15
no change here at all.
16
17
Tokens are kept as text until they are used, rather than being parsed into
18
integers up front, so that the reader is not limited to words that fit in
19
64 bits.
20
*/
21
22
#include "
AthenaBaseComps/AthReentrantAlgorithm.h
"
23
#include "
StoreGate/WriteHandleKey.h
"
24
#include "
xAODCore/BaseContainer.h
"
25
26
#include <cstddef>
27
#include <functional>
28
#include <string>
29
#include <vector>
30
31
namespace
GlobalSim
{
32
33
class
TOBTextReader
:
public
AthReentrantAlgorithm
{
34
public
:
35
using
AthReentrantAlgorithm::AthReentrantAlgorithm;
36
37
virtual
StatusCode
initialize
()
override
;
38
virtual
StatusCode
execute
(
const
EventContext& ctx)
const override
;
39
40
private
:
41
Gaudi::Property<std::string>
m_inputFile
{
42
this
,
"InputFile"
,
""
,
43
"Test-vector file: one event per line, space-separated hex words"
};
44
45
Gaudi::Property<std::string>
m_specName
{
46
this
,
"BitSpec"
,
""
,
47
"Name of the BitSpec giving the bit layout, e.g. topoc_pu_type"
};
48
49
SG::WriteHandleKey<xAOD::BaseContainer>
m_outKey
{
50
this
,
"Output"
,
""
,
51
"Container of decoded TOBs to write to StoreGate"
};
52
53
// Taken from the registry in initialize().
54
std::function<void(
SG::AuxElement
&,
const
std::string&)>
m_unpack
;
55
std::size_t
m_width
{0};
56
57
// The whole file, read once: one entry per event, each a list of tokens.
58
// Read-only after initialize(), which is what lets execute() stay const.
59
std::vector<std::vector<std::string>>
m_events
;
60
};
61
62
}
// namespace GlobalSim
63
64
#endif
// GLOBALSIM_TOBTEXTREADER_H
AthReentrantAlgorithm.h
BaseContainer.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
GlobalSim::TOBTextReader
Definition
TOBTextReader.h:33
GlobalSim::TOBTextReader::m_outKey
SG::WriteHandleKey< xAOD::BaseContainer > m_outKey
Definition
TOBTextReader.h:49
GlobalSim::TOBTextReader::m_events
std::vector< std::vector< std::string > > m_events
Definition
TOBTextReader.h:59
GlobalSim::TOBTextReader::m_width
std::size_t m_width
Definition
TOBTextReader.h:55
GlobalSim::TOBTextReader::m_specName
Gaudi::Property< std::string > m_specName
Definition
TOBTextReader.h:45
GlobalSim::TOBTextReader::initialize
virtual StatusCode initialize() override
Definition
TOBTextReader.cxx:16
GlobalSim::TOBTextReader::m_inputFile
Gaudi::Property< std::string > m_inputFile
Definition
TOBTextReader.h:41
GlobalSim::TOBTextReader::m_unpack
std::function< void(SG::AuxElement &, const std::string &)> m_unpack
Definition
TOBTextReader.h:54
GlobalSim::TOBTextReader::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
TOBTextReader.cxx:73
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition
StoreGate/StoreGate/WriteHandleKey.h:40
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
BitSpec.h:23
SG::AuxElement
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
Generated on
for ATLAS Offline Software by
1.17.0