Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TowerInfoDeadHotMask.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TowerInfoDeadHotMask.cc
1 #include "TowerInfoDeadHotMask.h"
2 
3 #include <calobase/TowerInfo.h>
4 #include <calobase/TowerInfoContainer.h>
5 #include <calobase/TowerInfoDefs.h>
6 #include <calobase/RawTowerDeadMap.h>
7 #include <calobase/RawTowerGeomContainer.h>
8 #include <calobase/RawTowerGeom.h>
9 
10 #include <fun4all/Fun4AllBase.h>
12 #include <fun4all/SubsysReco.h>
13 
14 #include <phool/getClass.h>
15 
16 #include <fstream>
17 #include <iostream>
18 #include <set> // for _Rb_tree_const_iterator
19 #include <sstream>
20 #include <stdexcept>
21 #include <string>
22 
24  : SubsysReco(name)
25  , m_detector("NONE")
26  , m_deadMap(nullptr)
27  , m_calibTowerInfos(nullptr)
28  , m_geometry(nullptr)
29 {
30 }
31 
33 {
34  CreateNodeTree(topNode);
35 
37 }
38 
40 {
41  if (Verbosity() >= VERBOSITY_SOME)
42  {
43  std::cout << Name() << "::" << m_detector << "::process_event - Entry" << std::endl;
44  }
45 
47 
48  RawTowerDeadMap::Map::iterator itr;
49 
50  for(itr = map.begin(); itr != map.end(); ++itr)
51  {
52  int iphi = m_geometry->get_tower_geometry(*itr)->get_binphi();
53  int ieta = m_geometry->get_tower_geometry(*itr)->get_bineta();
54  unsigned int key = TowerInfoDefs::encode_emcal(ieta, iphi);
57  }
58 
60 }
61 
63 {
64  m_calibTowerInfos = findNode::getClass<TowerInfoContainer>(topNode, "TOWERINFO_CALIB_" + m_detector);
65  if (!m_calibTowerInfos)
66  {
67  std::cout << Name() << "::" << m_detector << "::" << "CreateNodeTree " << "No calibrated " << m_detector << " tower info found while in TowerInfoDeadHotMask, can't proceed!!!" << std::endl;
68  throw std::runtime_error("failed to find TOWERINFO_CALIB node in TowerInfoDeadHotMask::CreateNodeTree");
69  }
70 
71  std::string towergeomnodename = "TOWERGEOM_" + m_detector;
72  m_geometry = findNode::getClass<RawTowerGeomContainer>(topNode, towergeomnodename);
73  if (!m_geometry)
74  {
75  std::cout << Name() << "::" << m_detector << "::" << "CreateNodeTree" << ": Could not find node " << towergeomnodename << std::endl;
76  throw std::runtime_error("failed to find TOWERGEOM node in TowerInfoDeadHotMask::CreateNodeTree");
77  }
78 
79  const std::string deadMapName = "DEADMAP_" + m_detector;
80  m_deadMap = findNode::getClass<RawTowerDeadMap>(topNode, deadMapName);
81  if (m_deadMap)
82  {
83  std::cout << Name() << "::" << m_detector << "::" << "CreateNodeTree" << " use dead map: ";
85  }
86 }
87 
89 {
91 }