ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawTowerDeadMapv1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawTowerDeadMapv1.cc
1 #include "RawTowerDeadMapv1.h"
2 
3 #include <cstdlib>
4 #include <iostream>
5 #include <map>
6 
7 using namespace std;
8 
11 {
12  return m_DeadTowers;
13 }
14 
17 {
18  return m_DeadTowers;
19 }
20 
21 void RawTowerDeadMapv1::addDeadTower(const unsigned int ieta, const int unsigned iphi)
22 {
23  RawTowerDefs::keytype key = RawTowerDefs::encode_towerid(_caloid, ieta, iphi);
24  m_DeadTowers.insert(key);
25 }
26 
28 {
29  if (RawTowerDefs::decode_caloid(key) != _caloid)
30  {
31  cout << "RawTowerDeadMapv1::addDeadTower - Error - adding tower to wrong container! Container CaloID = "
32  << _caloid << ", requested CaloID = " << RawTowerDefs::decode_caloid(key) << " based on key " << key << endl;
33  exit(2);
34  }
35  m_DeadTowers.insert(key);
36 }
37 
39 {
40  auto it = m_DeadTowers.find(key);
41  if (it != m_DeadTowers.end())
42  {
43  return true;
44  }
45  return false;
46 }
47 
48 bool RawTowerDeadMapv1::isDeadTower(const unsigned int ieta, const unsigned int iphi)
49 {
50  RawTowerDefs::keytype key = RawTowerDefs::encode_towerid(_caloid, ieta, iphi);
51  return isDeadTower(key);
52 }
53 
55 {
56  return size() > 0;
57 }
58 
60 {
61  m_DeadTowers.clear();
62 }
63 
64 void RawTowerDeadMapv1::identify(std::ostream& os) const
65 {
66  os << "RawTowerDeadMapv1, number of towers: " << size() << std::endl;
67 }