ATLAS Offline Software
Loading...
Searching...
No Matches
TrigT2MbtsBits.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
23
24// Simple debug method using MsgStream
25void TrigT2MbtsBits::print(void) const {
26 std::vector<float>::const_iterator itr;
27 std::vector<float>::const_iterator itr_end;
28
29 itr=m_triggerEnergies.begin();
30 itr_end=m_triggerEnergies.end();
31 std::cout << "m_triggerEnergies = {";
32 for(;itr != itr_end; ++itr) {
33 std::cout << (*itr) << ",";
34 }
35 std::cout << "}" << std::endl;
36
37 itr = m_triggerTimes.begin();
38 itr_end = m_triggerTimes.end();
39 std::cout << "m_triggerTimes = {";
40 for(;itr != itr_end; ++itr) {
41 std::cout << (*itr) << ",";
42 }
43 std::cout << "}" << std::endl;
44}
45
46// Simple debug method using MsgStream
47void TrigT2MbtsBits::print(MsgStream& log) const {
48 std::vector<float>::const_iterator itr;
49 std::vector<float>::const_iterator itr_end;
50
51 itr=m_triggerEnergies.begin();
52 itr_end=m_triggerEnergies.end();
53 log << MSG::DEBUG << "m_triggerEnergies = {";
54 for(;itr != itr_end; ++itr) {
55 log << MSG::DEBUG << (*itr) << ",";
56 }
57 log << MSG::DEBUG << "}" << endmsg;
58
59 itr = m_triggerTimes.begin();
60 itr_end = m_triggerTimes.end();
61 log << MSG::DEBUG << "m_triggerTimes = {";
62 for(;itr != itr_end; ++itr) {
63 log << MSG::DEBUG << (*itr) << ",";
64 }
65 log << MSG::DEBUG << "}" << endmsg;
66}
67
68// Simple string conversion method.
69std::string str(const TrigT2MbtsBits& trigT2MbtsBits) {
70 std::stringstream sstream;
71 std::vector<float> counterValues;
72 std::vector<float>::const_iterator itr;
73 std::vector<float>::const_iterator itr_end;
74
75 counterValues = trigT2MbtsBits.triggerEnergies();
76 itr = counterValues.begin();
77 itr_end = counterValues.end();
78 sstream << "m_triggerEnergies = {";
79 for(;itr != itr_end; ++itr) {
80 sstream << (*itr) << ",";
81 }
82 sstream << "}" << std::endl;
83
84 counterValues = trigT2MbtsBits.triggerTimes();
85 itr = counterValues.begin();
86 itr_end = counterValues.end();
87 sstream << "m_triggerTimes = {";
88 for(;itr != itr_end; ++itr) {
89 sstream << (*itr) << ", ";
90 }
91 sstream << "}";
92
93 return sstream.str();
94}
95
96MsgStream& operator<< (MsgStream& m, const TrigT2MbtsBits& trigT2MbtsBits) {
97 return (m << str(trigT2MbtsBits));
98}
#define endmsg
MsgStream & operator<<(MsgStream &m, const TrigT2MbtsBits &trigT2MbtsBits)
Helper operator for printing the object.
static const int NUM_MBTS
A data member to contain the number of MBTS counters.
void print(void) 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.