Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RunTowerInfo.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RunTowerInfo.cc
1 #include "RunTowerInfo.h"
2 
3 #include <calobase/TowerInfoContainerv1.h>
4 #include <calobase/TowerInfov1.h>
5 
6 #include <phool/getClass.h>
8 #include <phool/phool.h>
9 
12 
14 #include <cassert>
15 #include <sstream>
16 #include <string>
17 
18 using namespace std;
19 
30  : SubsysReco(name)
31  , m_EMCalTowerContainer(0)
32 {
35 }
36 
41 {
42 
43 }
44 
49 {
50  if (Verbosity() > 5)
51  {
52  cout << "Beginning Init in RunTowerInfo" << endl;
53  }
54 
55  return 0;
56 }
57 
63 {
64  if (Verbosity() > 5)
65  {
66  cout << "Beginning process_event in AnaTutorial" << endl;
67  }
68 
69  m_EMCalTowerContainer = findNode::getClass<TowerInfoContainerv1>(topNode, "TOWERS_CEMC");
70 
72  {
74  }
75 
76  std::cout << "********************" << std::endl;
77 
78  TowerInfoContainerv1::Range tower_range = m_EMCalTowerContainer->getTowers();
79  for (TowerInfoContainerv1::ConstIterator citer = tower_range.first; citer != tower_range.second; citer++)
80  {
81  //You can get the TowerInfo object from the map and use it to get time and amplitude
82  TowerInfov1 *towerInfo = (TowerInfov1*)citer->second;
83  std::cout << "Time: " << towerInfo->get_time() << std::endl;
84  std::cout << "Energy (Amplitude): " << towerInfo->get_energy() << std::endl;
85  //Or just directly get time and amplitude from the object in the map
86  std::cout << "Time: " << citer->second->get_time() << std::endl;
87  std::cout << "Energy (Amplitude): " << citer->second->get_energy() << std::endl;
88  //The encripted key can be use to get the tower eta-phi bin form the TowerInfoContainer
89  std::cout << "PhiBin: " << m_EMCalTowerContainer->getTowerPhiBin(citer->first) << std::endl;
90  std::cout << "EtaBin: " << m_EMCalTowerContainer->getTowerEtaBin(citer->first) << std::endl;
91  }
92 
94 }
95 
101 {
102  if (Verbosity() > 1)
103  {
104  cout << "Ending RunTowerInfo analysis package" << endl;
105  }
106 
107 
108  if (Verbosity() > 1)
109  {
110  cout << "Finished RunTowerInfo analysis package" << endl;
111  }
112 
113  return 0;
114 }