ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
SpecRegistry.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
SpecRegistry.h
"
5
6
#include "
GlobalSimulation/Object.h
"
7
#include "
GlobalSimulation/main_output.h
"
8
#include "
GlobalSimulation/topoc_pu_type.h
"
9
10
#include "
Utilities/binStrToHexStr.h
"
11
#include "
Utilities/hexStrToBinStr.h
"
12
13
namespace
GlobalSim
{
14
15
namespace
{
16
17
// Both directions for one spec. This is the only templated code left in
18
// the text I/O: everything above it works through SpecEntry.
19
template
<
class
Spec>
20
SpecEntry
entryFor() {
21
return
{
22
Spec::width,
23
24
[](
const
SG::AuxElement
& tob) {
25
return
binStrToHexStr
(
Object<Spec>
(tob).bits().
to_string
());
26
},
27
28
[](
SG::AuxElement
& tob,
const
std::string& token) {
29
Object<Spec>
obj
(tob);
30
obj
=
typename
Spec::bitset_type(
hexStrToBinStr
(token));
31
}};
32
}
33
34
}
// anonymous namespace
35
36
const
std::map<std::string, SpecEntry>&
specRegistry
() {
37
// Function-local so that it is built on first use, rather than during
38
// static initialisation where the order across translation units is
39
// not defined.
40
//
41
// ---- Adding a TOB type: one line here, and nothing else. ----
42
static
const
std::map<std::string, SpecEntry> specs = {
43
{
"topoc_pu_type"
, entryFor<topoc_pu_type>()},
44
{
"main_output_type"
, entryFor<main_output_type>()},
45
};
46
return
specs;
47
}
48
49
std::string
knownSpecNames
() {
50
std::string names;
51
for
(
const
auto
& spec :
specRegistry
()) {
52
if
(not names.empty()) { names +=
", "
; }
53
names += spec.first;
54
}
55
return
names;
56
}
57
58
}
to_string
static std::string to_string(const std::vector< T > &v)
Definition
FPGATrackSimGenScanTool.cxx:44
Object.h
SpecRegistry.h
binStrToHexStr.h
GlobalSim::Object
Definition
Object.h:14
hexStrToBinStr.h
main_output.h
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
BitSpec.h:23
GlobalSim::hexStrToBinStr
std::string hexStrToBinStr(std::string s)
Definition
hexStrToBinStr.cxx:12
GlobalSim::knownSpecNames
std::string knownSpecNames()
Comma-separated list of the known names, for error messages.
Definition
SpecRegistry.cxx:49
GlobalSim::specRegistry
const std::map< std::string, SpecEntry > & specRegistry()
The known specs, by name. Built on first use.
Definition
SpecRegistry.cxx:36
GlobalSim::binStrToHexStr
std::string binStrToHexStr(std::string_view s)
Definition
binStrToHexStr.h:26
SG::AuxElement
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
python.PyAthena.obj
obj
Definition
PyAthena.py:131
GlobalSim::SpecEntry
Definition
SpecRegistry.h:28
topoc_pu_type.h
Generated on
for ATLAS Offline Software by
1.17.0