ATLAS Offline Software
TileTrigger.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 : TileTrigger.cxx
7 // Author : Jose Maneira
8 // Created : March 2007
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/TileTrigger.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 
34 TileTrigger::TileTrigger(int id, const Identifier& mtid, double mtsum,
35  std::vector<Identifier>& boardtid, std::vector<double>& boardtsum,
36  std::vector<Identifier>& backtid, std::vector<double>& backtsum) :
37  m_ID(id),
38  m_maxTowerID (mtid),
39  m_maxTowerSum (mtsum),
40  m_boardTowerID (boardtid),
41  m_boardTowerSum (boardtsum),
42  m_backTowerID (backtid),
43  m_backTowerSum (backtsum)
44  { }
45 
46 TileTrigger::TileTrigger(const Identifier& mtid, double mtsum,
47  std::vector<Identifier>& boardtid, std::vector<double>& boardtsum,
48  std::vector<Identifier>& backtid, std::vector<double>& backtsum) :
49  m_ID(0),
50  m_maxTowerID (mtid),
51  m_maxTowerSum (mtsum),
52  m_boardTowerID (boardtid),
53  m_boardTowerSum (boardtsum),
54  m_backTowerID (backtid),
55  m_backTowerSum (backtsum)
56  { }
57 
58 void TileTrigger::Set(int id, const Identifier& mtid, double mtsum,
59  std::vector<Identifier>& boardtid, std::vector<double>& boardtsum,
60  std::vector<Identifier>& backtid, std::vector<double>& backtsum)
61 {
62  SetID(id);
63  SetMaxTowerID(mtid);
64  SetMaxTowerSum(mtsum);
65  SetBoardTowerID(boardtid);
66  SetBoardTowerSum(boardtsum);
67  SetBackTowerID(backtid);
68  SetBackTowerSum(backtsum);
69 }
70 
71 void TileTrigger::Set(const Identifier& mtid, double mtsum,
72  std::vector<Identifier>& boardtid, std::vector<double>& boardtsum,
73  std::vector<Identifier>& backtid, std::vector<double>& backtsum)
74 {
75  SetMaxTowerID(mtid);
76  SetMaxTowerSum(mtsum);
77  SetBoardTowerID(boardtid);
78  SetBoardTowerSum(boardtsum);
79  SetBackTowerID(backtid);
80  SetBackTowerSum(backtsum);
81 }
82 
83 void TileTrigger::print() const
84 {
85  std::cout << (std::string) (*this) << std::endl;
86 }
87 
88 TileTrigger::operator std::string() const
89 {
90  std::ostringstream text(std::ostringstream::out);
91 
92  text << whoami();
93  text << " Id = " << s_cabling->getCaloLVL1_ID()->show_to_string(m_maxTowerID);
94  text << " maxTowerSum = " << m_maxTowerSum << std::endl;
95 
96  std::vector<Identifier>::const_iterator ii1=m_boardTowerID.begin();
97  std::vector<Identifier>::const_iterator ii2=m_boardTowerID.end();
98 
99  std::vector<double>::const_iterator iv1=m_boardTowerSum.begin();
100  std::vector<double>::const_iterator iv2=m_boardTowerSum.end();
101 
102  text << " nTriggerBoards = " << m_boardTowerSum.size();
103  for ( ; ii1!=ii2 && iv1!=iv2 ; ++ii1, ++iv1)
104  text << " (" << s_cabling->getCaloLVL1_ID()->show_to_string(*ii1) << ", " << (*iv1) << ")";
105  text<<std::endl;
106 
107  ii1=m_backTowerID.begin();
108  ii2=m_backTowerID.end();
109 
110  iv1=m_backTowerSum.begin();
111  iv2=m_backTowerSum.end();
112 
113  text << " nBack2BackTowers = " << m_backTowerSum.size();
114  for ( ; ii1!=ii2 && iv1!=iv2 ; ++ii1, ++iv1)
115  text << " (" << s_cabling->getCaloLVL1_ID()->show_to_string(*ii1) << ", " << (*iv1) << ")";
116  text<<std::endl;
117 
118  return text.str();
119 }
TileTrigger::SetID
void SetID(int id)
Definition: TileTrigger.h:66
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition: TileCablingService.cxx:24
TileTrigger::print
void print(void) const
Definition: TileTrigger.cxx:83
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
TileTrigger::SetBoardTowerID
void SetBoardTowerID(std::vector< Identifier > &boardtid)
Definition: TileTrigger.h:69
TileCablingService.h
TileTrigger.h
TileTrigger::SetBackTowerSum
void SetBackTowerSum(std::vector< double > &backtsum)
Definition: TileTrigger.h:72
TileCablingService
Definition: TileCablingService.h:23
TileTrigger::TileTrigger
TileTrigger()
Definition: TileTrigger.h:45
TileTrigger::Set
void Set(int id, const Identifier &mtid, double mtsum, std::vector< Identifier > &boardtid, std::vector< double > &boardtsum, std::vector< Identifier > &backtid, std::vector< double > &backtsum)
Definition: TileTrigger.cxx:58
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
CaloLVL1_ID.h
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
TileTrigger::SetMaxTowerSum
void SetMaxTowerSum(double mtsum)
Definition: TileTrigger.h:68
TileTrigger::SetBoardTowerSum
void SetBoardTowerSum(std::vector< double > &boardtsum)
Definition: TileTrigger.h:70
TileTrigger::SetBackTowerID
void SetBackTowerID(std::vector< Identifier > &backtid)
Definition: TileTrigger.h:71
TileTrigger::SetMaxTowerID
void SetMaxTowerID(const Identifier &mtid)
Definition: TileTrigger.h:67
Identifier
Definition: IdentifierFieldParser.cxx:14