Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpRawTowerContainer.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpRawTowerContainer.cc
2 
3 #include <phool/PHIODataNode.h>
4 
5 #include <calobase/RawTower.h>
6 #include <calobase/RawTowerContainer.h>
7 
8 #include <map>
9 #include <ostream>
10 #include <string>
11 #include <utility>
12 
14 
16  : DumpObject(NodeName)
17 {
18  return;
19 }
20 
22 {
23  RawTowerContainer *rawtowercontainer = nullptr;
24  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
25  if (thisNode)
26  {
27  rawtowercontainer = thisNode->getData();
28  }
29  if (rawtowercontainer)
30  {
32  RawTowerContainer::ConstRange begin_end = rawtowercontainer->getTowers();
33  *fout << "size: " << rawtowercontainer->size() << std::endl;
34  for (hiter = begin_end.first; hiter != begin_end.second; ++hiter)
35  {
36  RawTower *rawtwr = hiter->second;
37  *fout << "bineta: " << rawtwr->get_bineta() << std::endl;
38  *fout << "binphi: " << rawtwr->get_binphi() << std::endl;
39  *fout << "energy: " << rawtwr->get_energy() << std::endl;
40  RawTower::CellConstRange cbegin_end = rawtwr->get_g4cells();
41  for (RawTower::CellConstIterator iter = cbegin_end.first; iter != cbegin_end.second; ++iter)
42  {
43  *fout << "cell key: 0x" << std::hex << iter->first
44  << std::dec << " edep: " << iter->second << std::endl;
45  }
46  RawTower::ShowerConstRange sbegin_end = rawtwr->get_g4showers();
47  for (RawTower::ShowerConstIterator iter = sbegin_end.first; iter != sbegin_end.second; ++iter)
48  {
49  *fout << "shower id: " << iter->first
50  << " edep: " << iter->second << std::endl;
51  }
52  }
53  }
54  return 0;
55 }