Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpcCheck.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TpcCheck.cc
1 #include "TpcCheck.h"
2 
5 #include <fun4all/SubsysReco.h> // for SubsysReco
6 
9 
10 #include <phool/PHCompositeNode.h>
11 #include <phool/PHDataNode.h>
12 #include <phool/PHNode.h> // for PHNode
13 #include <phool/PHNodeIterator.h> // for PHNodeIterator
14 #include <phool/getClass.h>
15 
16 #include <Event/packet.h>
17 
18 #include <TSystem.h>
19 
20 #include <iostream> // for operator<<, endl, basic_ost...
21 #include <set>
22 #include <utility> // for pair
23 #include <vector> // for vector
24 
25 //____________________________________________________________________________..
27 : SubsysReco(name)
28 {
29 }
30 
31 //____________________________________________________________________________..
33 {
35 }
36 
37 //____________________________________________________________________________..
39 {
40  TpcRawHitContainer *tpccont = findNode::getClass<TpcRawHitContainer>(topNode,m_EvtNodeName);
41  if (!tpccont)
42  {
43  std::cout << "could not find node " << m_EvtNodeName << std::endl;
44  }
45  else
46  {
47  tpccont->identify();
48  std::set<uint64_t> refbco;
49  bool ifirst = true;
50  for (unsigned int i=0; i<tpccont->get_nhits(); i++)
51  {
52  TpcRawHit *inh = tpccont->get_hit(i);
53  if (ifirst)
54  {
55  refbco.insert(inh->get_bco());
56  if (Verbosity() > 0)
57  {
58  std::cout << "current bco: 0x" << std::hex << *refbco.begin()
59  << std::dec << std::endl;
60  }
61  if (bclk_seen.find(*refbco.begin()) != bclk_seen.end())
62  {
63  std::cout << "bco 0x" << std::hex << *refbco.begin() << std::dec
64  << " seen before" << std::endl;
65  }
66  bclk_seen.insert(*refbco.begin());
67  ifirst = false;
68  }
69  else
70  {
71  if (refbco.find(inh->get_bco()) == refbco.end())
72  {
73  if (*refbco.begin() <= inh->get_bco() + bcorange)
74  {
75  refbco.insert(inh->get_bco());
76  }
77  else
78  {
79  std::cout << "scream, refbco: 0x" << std::hex << *refbco.begin()
80  << " current bco: 0x" << inh->get_bco()
81  << std::dec
82  << ", diff: " << inh->get_bco() - *refbco.begin()
83  << ", allowed diff: " << bcorange
84 << std::endl;
85  }
86  }
87  }
88  }
89  }
91 }