File indexing completed on 2025-08-06 08:17:56
0001 #include "DumpTowerInfoContainer.h"
0002
0003 #include <phool/PHIODataNode.h>
0004
0005 #include <calobase/TowerInfo.h>
0006 #include <calobase/TowerInfoContainer.h>
0007
0008 #include <ostream>
0009 #include <string>
0010
0011 using MyNode_t = PHIODataNode<TowerInfoContainer>;
0012
0013 DumpTowerInfoContainer::DumpTowerInfoContainer(const std::string &NodeName)
0014 : DumpObject(NodeName)
0015 {
0016 return;
0017 }
0018
0019 int DumpTowerInfoContainer::process_Node(PHNode *myNode)
0020 {
0021 TowerInfoContainer *towerinfocontainer = nullptr;
0022 MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
0023 if (thisNode)
0024 {
0025 towerinfocontainer = thisNode->getData();
0026 }
0027 if (towerinfocontainer)
0028 {
0029 unsigned int nchannels = towerinfocontainer->size();
0030 *fout << "size: " << towerinfocontainer->size() << std::endl;
0031 for (unsigned int channel = 0; channel < nchannels; channel++)
0032 {
0033 TowerInfo *rawtwr = towerinfocontainer->get_tower_at_channel(channel);
0034 *fout << "time: " << rawtwr->get_time() << std::endl;
0035 *fout << "energy: " << rawtwr->get_energy() << std::endl;
0036 *fout << "time_float: " << rawtwr->get_time_float() << std::endl;
0037 *fout << "chi2: " << rawtwr->get_chi2() << std::endl;
0038 *fout << "pedestal: " << rawtwr->get_pedestal() << std::endl;
0039 *fout << "isHot: " << rawtwr->get_isHot() << std::endl;
0040 *fout << "isBadTime: " << rawtwr->get_isBadTime() << std::endl;
0041 *fout << "isNotInstr: " << rawtwr->get_isNotInstr() << std::endl;
0042 *fout << "isGood: " << rawtwr->get_isGood() << std::endl;
0043 *fout << "status: " << static_cast<unsigned int>(rawtwr->get_status()) << std::endl;
0044 *fout << "nsample: " << rawtwr->get_nsample() << std::endl;
0045 for (int j = 0; j < rawtwr->get_nsample(); j++)
0046 {
0047 *fout << "waveform_value[" << j << "]: " << rawtwr->get_waveform_value(j) << std::endl;
0048 }
0049 }
0050 }
0051 return 0;
0052 }