ATLAS Offline Software
Loading...
Searching...
No Matches
ZdcModuleToString.cxx File Reference
#include "xAODForward/ZdcModuleToString.h"
#include "AthContainers/ConstAccessor.h"
#include <sstream>
#include <cstdint>
Include dependency graph for ZdcModuleToString.cxx:

Go to the source code of this file.

Functions

std::string ZdcModuleToString (const xAOD::ZdcModule &zm)
std::string ZdcModuleToString (const xAOD::ZdcModuleContainer &zc)

Function Documentation

◆ ZdcModuleToString() [1/2]

std::string ZdcModuleToString ( const xAOD::ZdcModule & zm)

Definition at line 11 of file ZdcModuleToString.cxx.

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 {
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}
Helper class to provide constant type-safe access to aux data.
int zdcSide() const
uint32_t zdcId() const
int zdcType() const
int zdcModule() const
int zdcChannel() const
const std::vector< uint16_t > & getWaveform(const std::string &) const

◆ ZdcModuleToString() [2/2]

std::string ZdcModuleToString ( const xAOD::ZdcModuleContainer & zc)

Definition at line 49 of file ZdcModuleToString.cxx.

50{
51 std::stringstream o;
52 for (auto z: zc) { o << ZdcModuleToString(*z); }
53 return o.str();
54}
#define z
std::string ZdcModuleToString(const xAOD::ZdcModule &zm)