Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpTpcRawHitContainer.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpTpcRawHitContainer.cc
2 
3 #include <phool/PHIODataNode.h>
4 
7 
8 #include <ostream>
9 #include <string>
10 
12 
14  : DumpObject(NodeName)
15 {
16  return;
17 }
18 
20 {
21  TpcRawHitContainer *tpcrawhitcontainer = nullptr;
22  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
23  if (thisNode)
24  {
25  tpcrawhitcontainer = thisNode->getData();
26  }
27  if (tpcrawhitcontainer)
28  {
29  unsigned int nhits = tpcrawhitcontainer->get_nhits();
30  *fout << "size: " << tpcrawhitcontainer->get_nhits() << std::endl;
31  for (unsigned int ihit = 0; ihit < nhits; ihit++)
32  {
33  TpcRawHit *rawhit = tpcrawhitcontainer->get_hit(ihit);
34  *fout << "bco: " << rawhit->get_bco() << std::endl;
35  *fout << "gtm_bco: " << rawhit->get_gtm_bco() << std::endl;
36  *fout << "packetid: " << rawhit->get_packetid() << std::endl;
37  *fout << "fee: " << rawhit->get_fee() << std::endl;
38  *fout << "sampaaddress: " << rawhit->get_sampaaddress() << std::endl;
39  *fout << "sampachannel: " << rawhit->get_sampachannel() << std::endl;
40  auto nsamples = rawhit->get_samples();
41  *fout << "samples: " << rawhit->get_samples() << std::endl;
42  for (auto isamp = 0; isamp < nsamples; isamp++)
43  {
44  *fout << "adc[" << isamp << "] = " << rawhit->get_adc(isamp) << std::endl;
45  }
46  }
47  }
48  return 0;
49 }