ATLAS Offline Software
Loading...
Searching...
No Matches
TrigT2MbtsBits.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#include <iostream>
8#include <sstream>
9
10
11
20
21
22// Simple debug method using cout
23void TrigT2MbtsBits::print(void) const {
24 std::cout << str(*this) << std::endl;
25}
26
27// Simple debug method using MsgStream
28void TrigT2MbtsBits::print(MsgStream& log) const {
29 std::vector<float>::const_iterator itr;
30 std::vector<float>::const_iterator itr_end;
31
32 itr=m_triggerEnergies.begin();
33 itr_end=m_triggerEnergies.end();
34 log << MSG::DEBUG << "m_triggerEnergies = {";
35 for(;itr != itr_end; ++itr) {
36 log << MSG::DEBUG << (*itr) << ",";
37 }
38 log << MSG::DEBUG << "}\n";
39
40 itr = m_triggerTimes.begin();
41 itr_end = m_triggerTimes.end();
42 log << MSG::DEBUG << "m_triggerTimes = {";
43 for(;itr != itr_end; ++itr) {
44 log << MSG::DEBUG << (*itr) << ",";
45 }
46 log << MSG::DEBUG << "}" << endmsg;
47}
48
49// Simple string conversion method.
50std::string str(const TrigT2MbtsBits& trigT2MbtsBits) {
51 std::stringstream sstream;
52 std::vector<float> counterValues;
53 std::vector<float>::const_iterator itr;
54 std::vector<float>::const_iterator itr_end;
55
56 counterValues = trigT2MbtsBits.triggerEnergies();
57 itr = counterValues.begin();
58 itr_end = counterValues.end();
59 sstream << "m_triggerEnergies = {";
60 for(;itr != itr_end; ++itr) {
61 sstream << (*itr) << ",";
62 }
63 sstream << "}\n";
64
65 counterValues = trigT2MbtsBits.triggerTimes();
66 itr = counterValues.begin();
67 itr_end = counterValues.end();
68 sstream << "m_triggerTimes = {";
69 for(;itr != itr_end; ++itr) {
70 sstream << (*itr) << ", ";
71 }
72 sstream << "}";
73
74 return sstream.str();
75}
76
77MsgStream& operator<< (MsgStream& m, const TrigT2MbtsBits& trigT2MbtsBits) {
78 return (m << str(trigT2MbtsBits));
79}
#define endmsg
MsgStream & operator<<(MsgStream &m, const TrigT2MbtsBits &trigT2MbtsBits)
Helper operator for printing the object.
void print(void) const
Prints out data members to std::cout.
TrigT2MbtsBits()=default
static constexpr int NUM_MBTS
A data member to contain the number of MBTS counters.
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.