ATLAS Offline Software
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 
8 TrigT2MbtsBits::TrigT2MbtsBits(): m_triggerEnergies(TrigT2MbtsBits::NUM_MBTS,0.),
9  m_triggerTimes(TrigT2MbtsBits::NUM_MBTS,0) {
10 }
11 
12 TrigT2MbtsBits::TrigT2MbtsBits(const std::vector<float>& triggerEnergies,
13  const std::vector<float>& triggerTimes):
14  m_triggerEnergies(triggerEnergies),
15  m_triggerTimes(triggerTimes)
16 {
19 }
20 
22 }
23 
24 // Simple debug method using MsgStream
25 void 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
47 void 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.
69 std::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 
96 MsgStream& operator<< (MsgStream& m, const TrigT2MbtsBits& trigT2MbtsBits) {
97  return (m << str(trigT2MbtsBits));
98 }
str
std::string str(const TrigT2MbtsBits &trigT2MbtsBits)
Helper function for printing the object.
Definition: TrigT2MbtsBits.cxx:69
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigT2MbtsBits::TrigT2MbtsBits
TrigT2MbtsBits(void)
Definition: TrigT2MbtsBits.cxx:8
TrigT2MbtsBits
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2MbtsBits.h:19
TrigT2MbtsBits::NUM_MBTS
static const int NUM_MBTS
A data member to contain the number of MBTS counters.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2MbtsBits.h:40
TrigT2MbtsBits::m_triggerTimes
std::vector< float > m_triggerTimes
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2MbtsBits.h:44
operator<<
MsgStream & operator<<(MsgStream &m, const TrigT2MbtsBits &trigT2MbtsBits)
Helper operator for printing the object.
Definition: TrigT2MbtsBits.cxx:96
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigT2MbtsBits::triggerEnergies
const std::vector< float > & triggerEnergies(void) const
Return the trigger energies of each counter.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2MbtsBits.h:28
TrigT2MbtsBits::~TrigT2MbtsBits
~TrigT2MbtsBits(void)
Definition: TrigT2MbtsBits.cxx:21
TrigT2MbtsBits::print
void print(void) const
Prints out data members to std::cout.
Definition: TrigT2MbtsBits.cxx:25
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigT2MbtsBits::m_triggerEnergies
std::vector< float > m_triggerEnergies
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2MbtsBits.h:43
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigT2MbtsBits.h
TrigT2MbtsBits::triggerTimes
const std::vector< float > & triggerTimes(void) const
Return the relative times of the triggers.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2MbtsBits.h:31