ATLAS Offline Software
Loading...
Searching...
No Matches
TrigT2ZdcSignals.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include <iostream>
7
11
20
29
32
33// Simple debug method using MsgStream
34void TrigT2ZdcSignals::print(void) const {
35 std::vector<float>::const_iterator itr;
36 std::vector<float>::const_iterator itr_end;
37
38 itr=m_triggerEnergies.begin();
39 itr_end=m_triggerEnergies.end();
40 std::cout << "m_triggerEnergies = {";
41 for(;itr != itr_end; ++itr) {
42 std::cout << (*itr) << ",";
43 }
44 std::cout << "}" << std::endl;
45
46 itr = m_triggerTimes.begin();
47 itr_end = m_triggerTimes.end();
48 std::cout << "m_triggerTimes = {";
49 for(;itr != itr_end; ++itr) {
50 std::cout << (*itr) << ",";
51 }
52 std::cout << "}" << std::endl;
53}
54
55// Simple debug method using MsgStream
56void TrigT2ZdcSignals::print(MsgStream& log) const {
57 std::vector<float>::const_iterator itr;
58 std::vector<float>::const_iterator itr_end;
59
60 itr=m_triggerEnergies.begin();
61 itr_end=m_triggerEnergies.end();
62 log << MSG::DEBUG << "m_triggerEnergies = {";
63 for(;itr != itr_end; ++itr) {
64 log << MSG::DEBUG << (*itr) << ",";
65 }
66 log << MSG::DEBUG << "}" << endmsg;
67
68 itr = m_triggerTimes.begin();
69 itr_end = m_triggerTimes.end();
70 log << MSG::DEBUG << "m_triggerTimes = {";
71 for(;itr != itr_end; ++itr) {
72 log << MSG::DEBUG << (*itr) << ",";
73 }
74 log << MSG::DEBUG << "}" << endmsg;
75}
76
77// Simple string conversion method.
78std::string str(const TrigT2ZdcSignals& trigT2ZdcSignals) {
79 std::stringstream sstream;
80 std::vector<float> counterValues;
81 std::vector<float>::const_iterator itr;
82 std::vector<float>::const_iterator itr_end;
83
84 counterValues = trigT2ZdcSignals.triggerEnergies();
85 itr = counterValues.begin();
86 itr_end = counterValues.end();
87 sstream << "m_triggerEnergies = {";
88 for(;itr != itr_end; ++itr) {
89 sstream << (*itr) << ",";
90 }
91 sstream << "}" << std::endl;
92
93 counterValues = trigT2ZdcSignals.triggerTimes();
94 itr = counterValues.begin();
95 itr_end = counterValues.end();
96 sstream << "m_triggerTimes = {";
97 for(;itr != itr_end; ++itr) {
98 sstream << (*itr) << ", ";
99 }
100 sstream << "}";
101
102 return sstream.str();
103}
104
105MsgStream& operator<< (MsgStream& m, const TrigT2ZdcSignals& trigT2ZdcSignals) {
106 return (m << str(trigT2ZdcSignals));
107}
#define endmsg
MsgStream & operator<<(MsgStream &m, const TrigT2ZdcSignals &trigT2ZdcSignals)
Helper operator for printing the object.
static const int NUM_ZDC
A data member to contain the number of ZDC signals.
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.
void print(void) const
Prints out data members to std::cout.
STL namespace.