ATLAS Offline Software
ZdcDigits.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //*****************************************************************************
6 // Filename : ZdcDigit.cxx
7 // Author : Steinberg
8 // Created : March 2009
9 //
10 // DESCRIPTION:
11 // Implementation comments only. Class level comments go in .h file.
12 //
13 // HISTORY:
14 //
15 // BUGS:
16 //
17 //
18 //
19 //*****************************************************************************
20 
21 #include "ZdcEvent/ZdcDigits.h"
22 
23 #include <iostream>
24 #include <sstream>
25 #include <iomanip>
26 
28 
29  : ZdcRawData( id )
30 {
31  m_nSamples = 0;
32 }
33 
34 /*
35 ZdcDigits::ZdcDigits( const HWIdentifier& HWid,
36  const std::vector<int>& digits )
37 
38  : ZdcRawData( HWid )
39  , m_digits ( digits )
40 {
41 }
42 
43 ZdcDigits::ZdcDigits( const HWIdentifier& HWid,
44  const std::vector<short>& digits )
45 
46  : ZdcRawData( HWid )
47 {
48  m_digits.reserve(digits.size());
49 
50  std::vector<short>::const_iterator it1=digits.begin();
51  std::vector<short>::const_iterator it2=digits.end();
52 
53  double dig;
54  for ( ; it1!=it2; ++it1) {
55  dig = (*it1);
56  m_digits.push_back(dig);
57  }
58 }
59 */
60 
61 void ZdcDigits::print() const
62 {
63 
64  std::cout << "Trying to print() ZdcDigits" << std::endl;
65 
66  //std::cout << (std::string) (*(ZdcRawData *)this);
67  //std::cout << "ID=" << identify() << std::endl;
68  //std::cout << std::setiosflags( std::ios::fixed );
69  //std::cout << std::setiosflags( std::ios::showpoint );
70  //std::cout << std::setprecision(2);
71 
72  std::cout << "gain0/delay0 (" << m_digits_gain0_delay0.size() << " elements): ";
73  for (int val : m_digits_gain0_delay0) {
74  std::cout << " " << val;
75  }
76  std::cout << std::endl;
77 
78  std::cout << "gain0/delay1 (" << m_digits_gain0_delay1.size() << " elements): ";
79  for (int val : m_digits_gain0_delay1) {
80  std::cout << " " << val;
81  }
82  std::cout << std::endl;
83 
84  std::cout << "gain1/delay0 (" << m_digits_gain1_delay0.size() << " elements): ";
85  for (int val : m_digits_gain1_delay0) {
86  std::cout << " " << val;
87  }
88  std::cout << std::endl;
89 
90  std::cout << "gain1/delay1 (" << m_digits_gain1_delay1.size() << " elements): ";
91  for (int val : m_digits_gain1_delay1) {
92  std::cout << " " << val;
93  }
94  std::cout << std::endl;
95 
96 
97  return;
98 }
99 
100 ZdcDigits::operator std::string() const
101 {
102  std::cout << "Trying to print ZdcDigits" << std::endl;
103  std::ostringstream text(std::ostringstream::out);
104 
105  text << (std::string) (*(ZdcRawData *)this);
106  //std::cout << "IDo=" << identify() << std::endl;
107 
108  text << std::setiosflags( std::ios::fixed );
109  text << std::setiosflags( std::ios::showpoint );
110  text << std::setprecision(2);
111 
112  ZdcRawData::print_to_stream(m_digits_gain0_delay0," Val:",text);
113  text << std::endl;
114  ZdcRawData::print_to_stream(m_digits_gain0_delay1," Val:",text);
115  text << std::endl;
116  ZdcRawData::print_to_stream(m_digits_gain1_delay0," Val:",text);
117  text << std::endl;
118  ZdcRawData::print_to_stream(m_digits_gain1_delay1," Val:",text);
119  text << std::endl;
120 
121  return text.str();
122 }
123 
124 void ZdcDigits::set_digits_gain0_delay0(const std::vector<int>& v)
125 {
126  m_digits_gain0_delay0 = v; // just copy it
127 }
128 
129 void ZdcDigits::set_digits_gain0_delay1(const std::vector<int>& v)
130 {
131  m_digits_gain0_delay1 = v; // just copy it
132 }
133 
134 void ZdcDigits::set_digits_gain1_delay0(const std::vector<int>& v)
135 {
136  m_digits_gain1_delay0 = v; // just copy it
137 }
138 
139 void ZdcDigits::set_digits_gain1_delay1(const std::vector<int>& v)
140 {
141  m_digits_gain1_delay1 = v; // just copy it
142 }
143 
144 void ZdcDigits::set_digits_gain0_delay0(const std::vector<uint16_t>& v)
145 {
146  m_digits_gain0_delay0.clear();
147  m_digits_gain0_delay0.resize(v.size());
148  for (size_t i=0;i<v.size();i++)
149  {
150  m_digits_gain0_delay0.at(i) = v.at(i); // just copy it
151  }
152 }
153 
154 void ZdcDigits::set_digits_gain0_delay1(const std::vector<uint16_t>& v)
155 {
156  m_digits_gain0_delay1.clear();
157  m_digits_gain0_delay1.resize(v.size());
158  for (size_t i=0;i<v.size();i++)
159  {
160  m_digits_gain0_delay1.at(i) = v.at(i); // just copy it
161  }
162 }
163 
164 void ZdcDigits::set_digits_gain1_delay0(const std::vector<uint16_t>& v)
165 {
166  m_digits_gain1_delay0.clear();
167  m_digits_gain1_delay0.resize(v.size());
168  for (size_t i=0;i<v.size();i++)
169  {
170  m_digits_gain1_delay0.at(i) = v.at(i); // just copy it
171  }
172 }
173 
174 void ZdcDigits::set_digits_gain1_delay1(const std::vector<uint16_t>& v)
175 {
176  m_digits_gain1_delay1.clear();
177  m_digits_gain1_delay1.resize(v.size());
178  for (size_t i=0;i<v.size();i++)
179  {
180  m_digits_gain1_delay1.at(i) = v.at(i); // just copy it
181  }
182 }
183 
ZdcRawData
Definition: ZdcRawData.h:33
ZdcDigits::m_digits_gain1_delay0
std::vector< int > m_digits_gain1_delay0
Definition: ZdcDigits.h:75
ZdcDigits::m_digits_gain0_delay0
std::vector< int > m_digits_gain0_delay0
Definition: ZdcDigits.h:73
ZdcDigits::m_nSamples
unsigned int m_nSamples
Definition: ZdcDigits.h:47
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
ZdcDigits::print
void print(void) const
Definition: ZdcDigits.cxx:61
ZdcDigits::set_digits_gain1_delay1
void set_digits_gain1_delay1(const std::vector< int > &v)
Definition: ZdcDigits.cxx:139
ZdcRawData::print_to_stream
static void print_to_stream(const std::vector< double > &val, const std::string &label, std::ostringstream &text)
Definition: ZdcRawData.cxx:75
ZdcDigits::ZdcDigits
ZdcDigits()
Definition: ZdcDigits.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
ZdcDigits::m_digits_gain1_delay1
std::vector< int > m_digits_gain1_delay1
Definition: ZdcDigits.h:76
ZdcDigits::set_digits_gain1_delay0
void set_digits_gain1_delay0(const std::vector< int > &v)
Definition: ZdcDigits.cxx:134
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
ZdcDigits.h
ZdcDigits::set_digits_gain0_delay1
void set_digits_gain0_delay1(const std::vector< int > &v)
Definition: ZdcDigits.cxx:129
python.PyAthena.v
v
Definition: PyAthena.py:154
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
ZdcDigits::set_digits_gain0_delay0
void set_digits_gain0_delay0(const std::vector< int > &v)
Definition: ZdcDigits.cxx:124
ZdcDigits::m_digits_gain0_delay1
std::vector< int > m_digits_gain0_delay1
Definition: ZdcDigits.h:74
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
Identifier
Definition: IdentifierFieldParser.cxx:14