ATLAS Offline Software
TileRawChannel.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //*****************************************************************************
6 // Filename : TileRawChannel.cxx
7 // Author : Ed Frank, Ambreesh Gupta, Frank Merritt
8 // Created : Jan, 2001
9 //
10 // DESCRIPTION:
11 // Implementation comments only. Class level comments go in .h file.
12 //
13 // HISTORY:
14 // 02Mar02: Created to replace TileRawCell
15 //
16 // BUGS:
17 //
18 //
19 //
20 //*****************************************************************************
21 
23 
24 #include <iostream>
25 #include <sstream>
26 #include <iomanip>
27 #include <algorithm>
28 
30  float amplitude, float time, float quality, float ped )
31  : TileRawData( id )
32  , m_amplitude(1,amplitude)
33  , m_time(1,time)
34  , m_quality(1,quality)
35  , m_pedestal(ped)
36 {
37 }
38 
40  float amplitude, float time, float quality, float ped )
41  : TileRawData( HWid )
42  , m_amplitude(1,amplitude)
43  , m_time(1,time)
44  , m_quality(1,quality)
45  , m_pedestal(ped)
46 {
47 }
48 
50  std::vector<float>&& amplitude,
51  std::vector<float>&& time,
52  std::vector<float>&& quality,
53  float ped /*= 0.0*/)
54  : TileRawData( HWid ),
55  m_amplitude (std::move(amplitude)),
56  m_time (std::move(time)),
57  m_quality (std::move(quality)),
58  m_pedestal (ped)
59 {
60 }
61 
62 int TileRawChannel::add(float amplitude, float time, float quality) {
63  m_amplitude.push_back(amplitude);
64  m_time.push_back(time);
65  m_quality.push_back(quality);
66  return m_amplitude.size();
67 }
68 
70  using std::placeholders::_1;
71  std::transform(m_amplitude.begin(), m_amplitude.end(),
72  m_amplitude.begin(),
73  std::bind(std::multiplies<float>(),scale,_1));
74 }
75 
77  m_time.insert(m_time.begin(), time); // put new time in front
78 }
79 
80 int TileRawChannel::insert(float amplitude, float time, float quality) {
81  m_amplitude.insert(m_amplitude.begin(), amplitude);
82  m_time.insert(m_time.begin(), time);
83  m_quality.insert(m_quality.begin(), quality);
84  return m_amplitude.size();
85 }
86 
87 void TileRawChannel::print() const {
88  std::cout << (std::string) (*this) << std::endl;
89 }
90 
91 TileRawChannel::operator std::string() const {
92  std::ostringstream text(std::ostringstream::out);
93 
94  text << TileRawData::operator std::string();
95  print_to_stream(m_amplitude, " ampl =", text);
96  print_to_stream(m_time, " time =", text);
97  print_to_stream(m_quality, " qual =", text);
98 
99  return text.str();
100 }
TileRawChannel::insert
int insert(float amplitude, float time, float quality)
Definition: TileRawChannel.cxx:80
TileRawChannel.h
TileRawChannel::TileRawChannel
TileRawChannel()
Definition: TileRawChannel.h:40
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
HWIdentifier
Definition: HWIdentifier.h:13
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
TileRawChannel::time
float time(int ind=0) const
Definition: TileRawChannel.h:103
TileRawChannel::quality
float quality(int ind=0) const
Definition: TileRawChannel.h:105
TileRawChannel::amplitude
float amplitude(int ind=0) const
Definition: TileRawChannel.h:101
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
TileRawChannel::print
void print(void) const
Definition: TileRawChannel.cxx:87
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
TileRawChannel::insertTime
void insertTime(float time)
Definition: TileRawChannel.cxx:76
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
TileRawChannel::add
int add(float amplitude, float time, float quality)
Definition: TileRawChannel.cxx:62
TileRawData
Definition: TileRawData.h:34
TileRawChannel::m_time
std::vector< float > m_time
Definition: TileRawChannel.h:121
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
TileRawChannel::scaleAmplitude
void scaleAmplitude(float scale)
Definition: TileRawChannel.cxx:69
TileRawChannel::m_quality
std::vector< float > m_quality
Definition: TileRawChannel.h:122
TileRawChannel::m_amplitude
std::vector< float > m_amplitude
Definition: TileRawChannel.h:120
Identifier
Definition: IdentifierFieldParser.cxx:14