File indexing completed on 2025-08-05 08:16:07
0001 #include "InttCheck.h"
0002
0003 #include <fun4all/Fun4AllInputManager.h>
0004 #include <fun4all/Fun4AllReturnCodes.h>
0005 #include <fun4all/SubsysReco.h> // for SubsysReco
0006
0007 #include <ffarawobjects/InttRawHit.h>
0008 #include <ffarawobjects/InttRawHitContainer.h>
0009
0010 #include <phool/PHCompositeNode.h>
0011 #include <phool/PHDataNode.h>
0012 #include <phool/PHNode.h> // for PHNode
0013 #include <phool/PHNodeIterator.h> // for PHNodeIterator
0014 #include <phool/getClass.h>
0015
0016 #include <Event/packet.h>
0017
0018 #include <TSystem.h>
0019
0020 #include <iostream> // for operator<<, endl, basic_ost...
0021 #include <utility> // for pair
0022 #include <vector> // for vector
0023
0024
0025 InttCheck::InttCheck(const std::string &name)
0026 : SubsysReco(name)
0027 {
0028 }
0029
0030
0031 int InttCheck::Init(PHCompositeNode * )
0032 {
0033 return Fun4AllReturnCodes::EVENT_OK;
0034 }
0035
0036
0037 int InttCheck::process_event(PHCompositeNode *topNode)
0038 {
0039 InttRawHitContainer *inttcont = findNode::getClass<InttRawHitContainer>(topNode, m_EvtNodeName);
0040 if (!inttcont)
0041 {
0042 std::cout << "could not find node " << m_EvtNodeName << std::endl;
0043 }
0044 else
0045 {
0046
0047 uint64_t refbco = std::numeric_limits<uint64_t>::max();
0048 bool ifirst = true;
0049 for (unsigned int i = 0; i < inttcont->get_nhits(); i++)
0050 {
0051 InttRawHit *inh = inttcont->get_hit(i);
0052 if (ifirst)
0053 {
0054 refbco = inh->get_bco();
0055 if (Verbosity() > 0)
0056 {
0057 std::cout << "current bco: 0x" << std::hex << refbco
0058 << std::dec << std::endl;
0059 }
0060 if (bclk_seen.find(refbco) != bclk_seen.end())
0061 {
0062 std::cout << "bco 0x" << std::hex << refbco << std::dec
0063 << " seen before" << std::endl;
0064 }
0065 bclk_seen.insert(refbco);
0066 ifirst = false;
0067 }
0068 else
0069 {
0070 if (refbco != inh->get_bco())
0071 {
0072 std::cout << "scream, refbco: 0x" << std::hex << refbco
0073 << " current bco: 0x" << inh->get_bco()
0074 << std::dec << std::endl;
0075 }
0076 }
0077 }
0078 }
0079 return Fun4AllReturnCodes::EVENT_OK;
0080 }