ATLAS Offline Software
TileTTL1.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 : TileDigit.cxx
7 // Author : Chicago( Merritt)
8 // Created : February 2003
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 #include "TileEvent/TileTTL1.h"
22 
24 
25 #include <iostream>
26 #include <sstream>
27 #include <iomanip>
28 
29 // get cabling
30 namespace {
31 const TileCablingService * const s_cabling = TileCablingService::getInstance();
32 }
33 
35  const std::vector<float>& digits ) :
36  m_ID (id),
37  m_TTL1digits (digits)
38  { }
39 
40 
42  std::vector<float>&& digits ) :
43  m_ID (id),
44  m_TTL1digits (std::move(digits))
45  { }
46 
47 
49  const std::vector<double>& digits ) :
50  m_ID (id)
51  {
52 
53  m_TTL1digits.reserve(digits.size());
54 
55  std::vector<double>::const_iterator it1=digits.begin();
56  std::vector<double>::const_iterator it2=digits.end();
57 
58  float dig;
59  for ( ; it1!=it2; ++it1) {
60  dig = (*it1);
61  m_TTL1digits.push_back(dig);
62  }
63  }
64 
65 /* return Identifier */
66 const Identifier & TileTTL1::TTL1_ID() const {
67  return m_ID;
68 }
69 
70 /* return number of time slices (dim of vector)*/
71 short TileTTL1::nsamples() const {
72  return m_TTL1digits.size();
73 }
74 
75 
76 /* return reference to the vector of digits (float, not int) */
77 const std::vector<float>& TileTTL1::fsamples() const {
78  return m_TTL1digits;
79 }
80 
81 
82 /* return vector of digits (double, not int) */
83 const std::vector<double> TileTTL1::samples() const {
84  std::vector<double> dTTL1digits(m_TTL1digits.size());
85  for (unsigned int i=0; i<m_TTL1digits.size(); ++i) dTTL1digits[i] = m_TTL1digits[i];
86  return dTTL1digits;
87 }
88 
89 void TileTTL1::print() const
90 {
91  std::cout << (std::string) (*this) << std::endl;
92 }
93 
94 TileTTL1::operator std::string() const
95 {
96  std::ostringstream text(std::ostringstream::out);
97 
98  text << whoami();
99 
100  if (s_cabling->getTileTBID()->is_tiletb(m_ID)) {
101  text << "MBTS Id = " << s_cabling->getTileTBID()->to_string(m_ID);
102  } else {
103  text << " Id = " << s_cabling->getCaloLVL1_ID()->show_to_string(m_ID);
104  }
105 
106  text << " Val:";
107  text << std::setiosflags( std::ios::fixed );
108  text << std::setiosflags( std::ios::showpoint );
109  text << std::setprecision(2);
110 
111  std::vector<float>::const_iterator it1=m_TTL1digits.begin();
112  std::vector<float>::const_iterator it2=m_TTL1digits.end();
113 
114  for ( ; it1!=it2; ++it1) text << " " << (*it1);
115 
116  return text.str();
117 }
118 
TileTTL1::TTL1_ID
const Identifier & TTL1_ID() const
Definition: TileTTL1.cxx:66
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition: TileCablingService.cxx:24
TileTTL1::m_TTL1digits
std::vector< float > m_TTL1digits
Definition: TileTTL1.h:68
TileTTL1::samples
const std::vector< double > samples() const
Definition: TileTTL1.cxx:83
TileTTL1::fsamples
const std::vector< float > & fsamples() const
Definition: TileTTL1.cxx:77
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
TileTTL1::TileTTL1
TileTTL1()
Definition: TileTTL1.h:32
TileCablingService.h
TileTTL1.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
DetDescrDictionaryDict::it1
std::vector< HWIdentifier >::iterator it1
Definition: DetDescrDictionaryDict.h:17
TileCablingService
Definition: TileCablingService.h:23
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
TileTTL1::print
void print(void) const
Definition: TileTTL1.cxx:89
CaloLVL1_ID.h
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
TileTTL1::m_ID
Identifier m_ID
Definition: TileTTL1.h:67
TileTTL1::nsamples
short nsamples() const
Definition: TileTTL1.cxx:71
Identifier
Definition: IdentifierFieldParser.cxx:14