File indexing completed on 2026-10-15 08:25:51
0001 #include "DumpLaserClusterContainer.h"
0002
0003 #include <phool/PHIODataNode.h>
0004
0005 #include <trackbase/LaserCluster.h>
0006 #include <trackbase/LaserClusterContainer.h>
0007
0008 #include <ostream>
0009 #include <string>
0010
0011 using MyNode_t = PHIODataNode<LaserClusterContainer>;
0012
0013 DumpLaserClusterContainer::DumpLaserClusterContainer(const std::string &NodeName)
0014 : DumpObject(NodeName)
0015 {
0016 }
0017
0018 int DumpLaserClusterContainer::process_Node(PHNode *myNode)
0019 {
0020 LaserClusterContainer *container{nullptr};
0021 MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
0022 if (thisNode)
0023 {
0024 container = thisNode->getData();
0025 }
0026 if (container)
0027 {
0028 *fout << "size: " << container->size() << std::endl;
0029 LaserClusterContainer::ConstRange range = container->getClusters();
0030 for (auto iter = range.first; iter != range.second; ++iter)
0031 {
0032 const TrkrDefs::cluskey key = iter->first;
0033 const LaserCluster *cluster = iter->second;
0034 if (!cluster)
0035 {
0036 continue;
0037 }
0038 *fout << std::hex << "cluster key: 0x" << key << std::dec << std::endl;
0039 *fout << "getFitMode: " << cluster->getFitMode() << std::endl;
0040 *fout << "getX: " << cluster->getX() << std::endl;
0041 *fout << "getY: " << cluster->getY() << std::endl;
0042 *fout << "getZ: " << cluster->getZ() << std::endl;
0043 *fout << "getLayer: " << cluster->getLayer() << std::endl;
0044 *fout << "getIPhi: " << cluster->getIPhi() << std::endl;
0045 *fout << "getIT: " << cluster->getIT() << std::endl;
0046 *fout << "getLayerInt: " << cluster->getLayerInt() << std::endl;
0047 *fout << "getIPhiInt: " << cluster->getIPhiInt() << std::endl;
0048 *fout << "getITInt: " << cluster->getITInt() << std::endl;
0049 *fout << "getAdc: " << cluster->getAdc() << std::endl;
0050 *fout << "getNhits: " << cluster->getNhits() << std::endl;
0051 *fout << "getNLayers: " << cluster->getNLayers() << std::endl;
0052 *fout << "getNIPhi: " << cluster->getNIPhi() << std::endl;
0053 *fout << "getNIT: " << cluster->getNIT() << std::endl;
0054 *fout << "getSDLayer: " << cluster->getSDLayer() << std::endl;
0055 *fout << "getSDIPhi: " << cluster->getSDIPhi() << std::endl;
0056 *fout << "getSDIT: " << cluster->getSDIT() << std::endl;
0057 *fout << "getSDWeightedLayer: " << cluster->getSDWeightedLayer() << std::endl;
0058 *fout << "getSDWeightedIPhi: " << cluster->getSDWeightedIPhi() << std::endl;
0059 *fout << "getSDWeightedIT: " << cluster->getSDWeightedIT() << std::endl;
0060
0061 for (unsigned int i = 0; i < cluster->getNhits(); ++i)
0062 {
0063 const LaserClusterHitInfo &hit = cluster->getHit(i);
0064 *fout << std::hex << "getHit(" << i << ").hitsetkey: 0x" << hit.hitsetkey
0065 << ", hitkey: 0x" << hit.hitkey << std::dec << ", adc: " << hit.adc << std::endl;
0066 }
0067 }
0068 }
0069 return 0;
0070 }