ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4HitReadBack.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4HitReadBack.cc
1 #include "PHG4HitReadBack.h"
2 
3 #include "PHG4Hit.h"
4 #include "PHG4HitContainer.h"
5 
7 
8 #include <phool/getClass.h>
9 
10 #include <iostream>
11 #include <map> // for _Rb_tree_const_iterator
12 #include <utility> // for pair
13 
14 class PHCompositeNode;
15 
16 using namespace std;
17 
19 {
20  return;
21 }
22 
23 int
25 {
26  return 0;
27 }
28 
29 int
31 {
32  PHG4HitContainer *phc = findNode::getClass<PHG4HitContainer>(topNode,"PHG4Hit");
33  if (!phc)
34  {
35  cout << "No PHG4Hit found" << endl;
37  }
38  phc->identify();
39  std::pair<PHG4HitContainer::ConstIterator,PHG4HitContainer::ConstIterator> hititer = phc->getHits(1);
41  begin = hititer.first;
42  end = hititer.second;
43  for (it=begin; it != end; ++it)
44  {
45  cout << "key: 0x" << hex << it->first << dec << endl;
46  cout << "x: " << it->second->get_x(0) << endl;
47  }
48  cout << "detid: 2" << endl;
49  hititer = phc->getHits(2);
50  begin = hititer.first;
51  end = hititer.second;
52  for (it=begin; it != end; ++it)
53  {
54  cout << "key: 0x" << hex << it->first << dec << endl;
55  cout << "x: " << it->second->get_x(0) << endl;
56  }
57  cout << "detid: 3" << endl;
58  hititer = phc->getHits(3);
59  begin = hititer.first;
60  end = hititer.second;
61  for (it=begin; it != end; ++it)
62  {
63  cout << "key: 0x" << hex << it->first << dec << endl;
64  cout << "x: " << it->second->get_x(0) << endl;
65  }
66  // phc = findNode::getClass<PHG4HitContainer>(topNode,"PHG4Hit2");
67  // if (!phc)
68  // {
69  // cout << "No PHG4Hit found" << endl;
70  // return ABORTEVENT;
71  // }
72  // phc->identify();
74 }