ATLAS Offline Software
Loading...
Searching...
No Matches
TrigT2ZdcSignals.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "GaudiKernel/MsgStream.h"
7
8#include <iostream>
9#include <sstream>
10
19
28
29// Simple debug method using MsgStream
31 std::cout << str(*this) << std::endl;
32}
33
34// Simple debug method using MsgStream
35void TrigT2ZdcSignals::print(MsgStream& log) const {
36 std::vector<float>::const_iterator itr;
37 std::vector<float>::const_iterator itr_end;
38
39 itr=m_triggerEnergies.begin();
40 itr_end=m_triggerEnergies.end();
41 log << MSG::DEBUG << "m_triggerEnergies = {";
42 for(;itr != itr_end; ++itr) {
43 log << MSG::DEBUG << (*itr) << ",";
44 }
45 log << MSG::DEBUG << "}" << endmsg;
46
47 itr = m_triggerTimes.begin();
48 itr_end = m_triggerTimes.end();
49 log << MSG::DEBUG << "m_triggerTimes = {";
50 for(;itr != itr_end; ++itr) {
51 log << MSG::DEBUG << (*itr) << ",";
52 }
53 log << MSG::DEBUG << "}" << endmsg;
54}
55
56// Simple string conversion method.
57std::string str(const TrigT2ZdcSignals& trigT2ZdcSignals) {
58 std::stringstream sstream;
59 std::vector<float> counterValues;
60 std::vector<float>::const_iterator itr;
61 std::vector<float>::const_iterator itr_end;
62
63 counterValues = trigT2ZdcSignals.triggerEnergies();
64 itr = counterValues.begin();
65 itr_end = counterValues.end();
66 sstream << "m_triggerEnergies = {";
67 for(;itr != itr_end; ++itr) {
68 sstream << (*itr) << ",";
69 }
70 sstream << "}\n";
71
72 counterValues = trigT2ZdcSignals.triggerTimes();
73 itr = counterValues.begin();
74 itr_end = counterValues.end();
75 sstream << "m_triggerTimes = {";
76 for(;itr != itr_end; ++itr) {
77 sstream << (*itr) << ", ";
78 }
79 sstream << "}";
80
81 return sstream.str();
82}
83
84MsgStream& operator<< (MsgStream& m, const TrigT2ZdcSignals& trigT2ZdcSignals) {
85 return (m << str(trigT2ZdcSignals));
86}
#define endmsg
MsgStream & operator<<(MsgStream &m, const TrigT2ZdcSignals &trigT2ZdcSignals)
Helper operator for printing the object.
TrigT2ZdcSignals()=default
static constexpr int NUM_ZDC
A data member to contain the number of ZDC signals.
void print() const
Prints out data members to std::cout.
const std::vector< float > & triggerTimes(void) const
Return the relative times of the triggers.
const std::vector< float > & triggerEnergies(void) const
Return the trigger energies of each counter.
STL namespace.