ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpPHG4CylinderCellContainer.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpPHG4CylinderCellContainer.cc
2 
3 #include <phool/PHIODataNode.h>
4 
5 #include <g4detectors/PHG4Cell.h> // for PHG4Cell::EdepCon...
8 
9 #include <cmath>
10 #include <map>
11 #include <ostream>
12 #include <string>
13 #include <utility>
14 
15 using namespace std;
16 
18 
20  : DumpObject(NodeName)
21 {
22  return;
23 }
24 
26 {
27  PHG4CylinderCellContainer *phg4cellcontainer = nullptr;
28  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
29  if (thisNode)
30  {
31  phg4cellcontainer = thisNode->getData();
32  }
33  if (phg4cellcontainer)
34  {
36  PHG4CylinderCellContainer::ConstRange cell_begin_end = phg4cellcontainer->getCylinderCells();
37  *fout << "size: " << phg4cellcontainer->size() << endl;
38  for (hiter = cell_begin_end.first; hiter != cell_begin_end.second; hiter++)
39  {
40  *fout << "id: 0x" << hex << hiter->second->get_cell_id() << dec << endl;
41  *fout << "layer: " << hiter->second->get_layer() << endl;
42  *fout << "edep: " << hiter->second->get_edep() << endl;
43  int tmp = hiter->second->get_binz();
44  if (tmp != -1)
45  {
46  *fout << "binz: " << tmp << endl;
47  }
48  tmp = hiter->second->get_binphi();
49  if (tmp != -1)
50  {
51  *fout << "binphi: " << tmp << endl;
52  }
53  tmp = hiter->second->get_bineta();
54  if (tmp != -1)
55  {
56  *fout << "bineta: " << tmp << endl;
57  }
58  float dtmp = hiter->second->get_light_yield();
59  if (isfinite(dtmp))
60  {
61  *fout << "get_light_yield(): " << dtmp << endl;
62  }
63  tmp = hiter->second->get_fiber_ID();
64  if (tmp != -1)
65  {
66  *fout << "get_fiber_ID(): " << hiter->second->get_fiber_ID() << endl;
67  }
68  string tmpstr = hiter->second->get_sensor_index();
69  if (!tmpstr.empty())
70  {
71  *fout << "get_sensor_index(): " << hiter->second->get_sensor_index() << endl;
72  }
73  tmp = hiter->second->get_ladder_phi_index();
74  if (tmp != -9999)
75  {
76  *fout << "get_ladder_phi_index(): " << hiter->second->get_ladder_phi_index() << endl;
77  }
78  tmp = hiter->second->get_ladder_z_index();
79  if (tmp != -9999)
80  {
81  *fout << "get_ladder_z_index(): " << hiter->second->get_ladder_z_index() << endl;
82  }
83  tmp = hiter->second->get_j_index();
84  if (tmp != -9999)
85  {
86  *fout << "get_j_index(): " << hiter->second->get_j_index() << endl;
87  }
88  tmp = hiter->second->get_k_index();
89  if (tmp != -9999)
90  {
91  *fout << "get_k_index(): " << hiter->second->get_k_index() << endl;
92  }
93  tmp = hiter->second->get_l_index();
94  if (tmp != -9999)
95  {
96  *fout << "get_l_index(): " << hiter->second->get_l_index() << endl;
97  }
98  tmp = hiter->second->get_pixel_index();
99  if (tmp != -9999)
100  {
101  *fout << "get_pixel_index(): " << hiter->second->get_pixel_index() << endl;
102  }
103  tmp = hiter->second->get_chip_index();
104  if (tmp != -9999)
105  {
106  *fout << "get_chip_index(): " << hiter->second->get_chip_index() << endl;
107  }
108  tmp = hiter->second->get_module_index();
109  if (tmp != -9999)
110  {
111  *fout << "get_module_index(): " << hiter->second->get_module_index() << endl;
112  }
113  tmp = hiter->second->get_half_stave_index();
114  if (tmp != -9999)
115  {
116  *fout << "get_half_stave_index(): " << hiter->second->get_half_stave_index() << endl;
117  }
118  tmp = hiter->second->get_stave_index();
119  if (tmp != -9999)
120  {
121  *fout << "get_stave_index(): " << hiter->second->get_stave_index() << endl;
122  }
123 
124  PHG4CylinderCell::EdepConstRange hitedep_begin_end = hiter->second->get_g4hits();
125  for (PHG4CylinderCell::EdepConstIterator iter = hitedep_begin_end.first; iter != hitedep_begin_end.second; ++iter)
126  {
127  *fout << "hit 0x" << hex << iter->first << dec << " edep: " << iter->second << endl;
128  }
129  PHG4CylinderCell::ShowerEdepConstRange shower_begin_end = hiter->second->get_g4showers();
130  for (PHG4CylinderCell::ShowerEdepConstIterator iter = shower_begin_end.first; iter != shower_begin_end.second; ++iter)
131  {
132  *fout << "shower " << iter->first << " edep: " << iter->second << endl;
133  }
134  }
135  }
136  return 0;
137 }