ECCE @ EIC 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 
13 using namespace std;
14 
16 
18  : DumpObject(NodeName)
19 {
20  return;
21 }
22 
24 {
25  RawTowerContainer *rawtowercontainer = nullptr;
26  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
27  if (thisNode)
28  {
29  rawtowercontainer = thisNode->getData();
30  }
31  if (rawtowercontainer)
32  {
34  RawTowerContainer::ConstRange begin_end = rawtowercontainer->getTowers();
35  *fout << "size: " << rawtowercontainer->size() << endl;
36  for (hiter = begin_end.first; hiter != begin_end.second; ++hiter)
37  {
38  RawTower *rawtwr = hiter->second;
39  *fout << "bineta: " << rawtwr->get_bineta() << endl;
40  *fout << "binphi: " << rawtwr->get_binphi() << endl;
41  *fout << "energy: " << rawtwr->get_energy() << endl;
42  RawTower::CellConstRange cbegin_end = rawtwr->get_g4cells();
43  for (RawTower::CellConstIterator iter = cbegin_end.first; iter != cbegin_end.second; ++iter)
44  {
45  *fout << "cell key: 0x" << hex << iter->first
46  << dec << " edep: " << iter->second << endl;
47  }
48  RawTower::ShowerConstRange sbegin_end = rawtwr->get_g4showers();
49  for (RawTower::ShowerConstIterator iter = sbegin_end.first; iter != sbegin_end.second; ++iter)
50  {
51  *fout << "shower id: " << iter->first
52  << " edep: " << iter->second << endl;
53  }
54  }
55  }
56  return 0;
57 }