ATLAS Offline Software
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 
8 TrigT2ZdcSignals::TrigT2ZdcSignals(): m_triggerEnergies(TrigT2ZdcSignals::NUM_ZDC,0.),
9  m_triggerTimes(TrigT2ZdcSignals::NUM_ZDC,0) {
10 }
11 
12 TrigT2ZdcSignals::TrigT2ZdcSignals(const std::vector<float>& triggerEnergies,
13  const std::vector<float>& triggerTimes)
14  : m_triggerEnergies(triggerEnergies),
15  m_triggerTimes(triggerTimes)
16 {
19 }
20 
21 TrigT2ZdcSignals::TrigT2ZdcSignals(std::vector<float>&& triggerEnergies,
22  std::vector<float>&& triggerTimes)
23  : m_triggerEnergies(std::move(triggerEnergies)),
24  m_triggerTimes(std::move(triggerTimes))
25 {
28 }
29 
31 }
32 
33 // Simple debug method using MsgStream
34 void 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
56 void 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.
78 std::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 
105 MsgStream& operator<< (MsgStream& m, const TrigT2ZdcSignals& trigT2ZdcSignals) {
106  return (m << str(trigT2ZdcSignals));
107 }
TrigT2ZdcSignals::~TrigT2ZdcSignals
~TrigT2ZdcSignals(void)
Definition: TrigT2ZdcSignals.cxx:30
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigT2ZdcSignals::m_triggerTimes
std::vector< float > m_triggerTimes
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2ZdcSignals.h:47
str
std::string str(const TrigT2ZdcSignals &trigT2ZdcSignals)
Helper function for printing the object.
Definition: TrigT2ZdcSignals.cxx:78
TrigT2ZdcSignals::print
void print(void) const
Prints out data members to std::cout.
Definition: TrigT2ZdcSignals.cxx:34
TrigT2ZdcSignals::triggerTimes
const std::vector< float > & triggerTimes(void) const
Return the relative times of the triggers.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2ZdcSignals.h:34
TrigT2ZdcSignals::NUM_ZDC
static const int NUM_ZDC
A data member to contain the number of ZDC signals.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2ZdcSignals.h:43
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
operator<<
MsgStream & operator<<(MsgStream &m, const TrigT2ZdcSignals &trigT2ZdcSignals)
Helper operator for printing the object.
Definition: TrigT2ZdcSignals.cxx:105
TrigT2ZdcSignals::triggerEnergies
const std::vector< float > & triggerEnergies(void) const
Return the trigger energies of each counter.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2ZdcSignals.h:31
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigT2ZdcSignals
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2ZdcSignals.h:20
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigT2ZdcSignals.h
TrigT2ZdcSignals::m_triggerEnergies
std::vector< float > m_triggerEnergies
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigT2ZdcSignals.h:46
TrigT2ZdcSignals::TrigT2ZdcSignals
TrigT2ZdcSignals(void)
Definition: TrigT2ZdcSignals.cxx:8