File indexing completed on 2025-08-05 08:16:07
0001 #include "ZdcCheck.h"
0002
0003 #include <fun4all/Fun4AllInputManager.h>
0004 #include <fun4all/Fun4AllReturnCodes.h>
0005 #include <fun4all/SubsysReco.h> // for SubsysReco
0006
0007 #include <ffarawobjects/CaloPacket.h>
0008 #include <ffarawobjects/CaloPacketContainer.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 <TSystem.h>
0017
0018 #include <iostream> // for operator<<, endl, basic_ost...
0019 #include <utility> // for pair
0020 #include <vector> // for vector
0021
0022
0023 ZdcCheck::ZdcCheck(const std::string &name)
0024 : SubsysReco(name)
0025 {
0026 }
0027
0028
0029 int ZdcCheck::Init(PHCompositeNode * )
0030 {
0031 return Fun4AllReturnCodes::EVENT_OK;
0032 }
0033
0034
0035 int ZdcCheck::process_event(PHCompositeNode *topNode)
0036 {
0037 CaloPacketContainer *zdccont = findNode::getClass<CaloPacketContainer>(topNode, "ZDCPackets");
0038 if (!zdccont)
0039 {
0040 std::cout << "could not find ZdcPacket node" << std::endl;
0041 }
0042 else
0043 {
0044 for (unsigned int i = 0; i < zdccont->get_npackets(); i++)
0045 {
0046 if (ddump_enabled())
0047 {
0048 ddumppacket(zdccont->getPacket(i));
0049 }
0050 }
0051 std::cout << "ZDC Evt no: " << zdccont->getEvtSequence() << std::endl;
0052 for (unsigned int i = 0; i < zdccont->get_npackets(); i++)
0053 {
0054 std::cout << "Packet " << zdccont->getPacket(i)->getIdentifier()
0055 << " Evt no: " << zdccont->getPacket(i)->getEvtSequence() << std::endl;
0056 zdccont->identify();
0057 }
0058 }
0059 return Fun4AllReturnCodes::EVENT_OK;
0060 }