ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODForward
Root
ZdcModuleToString.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
xAODForward/ZdcModuleToString.h
"
6
#include "
AthContainers/ConstAccessor.h
"
7
#include <sstream>
8
#include <cstdint>
9
10
11
std::string
ZdcModuleToString
(
const
xAOD::ZdcModule
& zm)
12
{
13
std::stringstream o;
14
o <<
" ID="
<< zm.
zdcId
();
15
o <<
" S/M/T/C="
<< zm.
zdcSide
();
16
o <<
"/"
<< zm.
zdcModule
();
17
o <<
"/"
<< zm.
zdcType
();
18
o <<
"/"
<< zm.
zdcChannel
();
19
o <<
"\n"
;
20
using namespace
std::string_literals;
21
for
(
const
auto
& s : {
"g0data"
s,
"g1data"
s,
"g0d0data"
s,
"g0d1data"
s,
"g1d0data"
s,
"g1d1data"
s} )
22
{
23
SG::ConstAccessor<std::vector<uint16_t>
>acc(s);
24
if
(acc.isAvailable(zm))
25
{
26
o << s <<
": "
;
27
const
std::vector<uint16_t>& v = zm.
getWaveform
(s);
28
for
(uint16_t d : v)
29
{
30
o <<
" "
<< d;
31
}
32
o <<
"\n"
;
33
}
34
35
}
36
static
const
SG::ConstAccessor<uint16_t>
LucrodTriggerAmpAcc(
"LucrodTriggerAmp"
);
37
if
(LucrodTriggerAmpAcc.
isAvailable
(zm))
38
{
39
o <<
"Trigger amp:"
<< LucrodTriggerAmpAcc(zm) <<
"\n"
;
40
}
41
static
const
SG::ConstAccessor<uint16_t>
LucrodTriggerSideAmpAcc(
"LucrodTriggerSideAmp"
);
42
if
(LucrodTriggerSideAmpAcc.
isAvailable
(zm))
43
{
44
o <<
"Trigger side amp:"
<< LucrodTriggerSideAmpAcc(zm) <<
"\n"
;
45
}
46
return
o.str();
47
}
48
49
std::string
ZdcModuleToString
(
const
xAOD::ZdcModuleContainer
& zc)
50
{
51
std::stringstream o;
52
for
(
auto
z
: zc) { o <<
ZdcModuleToString
(*
z
); }
53
return
o.str();
54
}
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
z
#define z
ZdcModuleToString
std::string ZdcModuleToString(const xAOD::ZdcModule &zm)
Definition
ZdcModuleToString.cxx:11
ZdcModuleToString.h
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
xAOD::ZdcModule_v1::zdcSide
int zdcSide() const
xAOD::ZdcModule_v1::zdcId
uint32_t zdcId() const
xAOD::ZdcModule_v1::zdcType
int zdcType() const
xAOD::ZdcModule_v1::zdcModule
int zdcModule() const
xAOD::ZdcModule_v1::zdcChannel
int zdcChannel() const
xAOD::ZdcModule_v1::getWaveform
const std::vector< uint16_t > & getWaveform(const std::string &) const
Definition
ZdcModule_v1.cxx:28
xAOD::ZdcModuleContainer
ZdcModuleContainer_v1 ZdcModuleContainer
Definition
ZdcModuleContainer.h:18
xAOD::ZdcModule
ZdcModule_v1 ZdcModule
Definition
ZdcModule.h:15
Generated on
for ATLAS Offline Software by
1.17.0