Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:20:17

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   const auto original_precision = (*fout).precision();
0022   TowerInfoContainer *towerinfocontainer = nullptr;
0023   MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);  // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
0024   if (thisNode)
0025   {
0026     towerinfocontainer = thisNode->getData();
0027   }
0028   if (towerinfocontainer)
0029   {
0030     (*fout).precision(std::numeric_limits<float>::max_digits10);
0031     unsigned int nchannels = towerinfocontainer->size();
0032     *fout << "size: " << towerinfocontainer->size() << std::endl;
0033     for (unsigned int channel = 0; channel < nchannels; channel++)
0034     {
0035       TowerInfo *rawtwr = towerinfocontainer->get_tower_at_channel(channel);
0036       *fout << "time: " << rawtwr->get_time() << std::endl;
0037 //      (*fout).precision(std::numeric_limits<decltype(rawtwr->get_energy())>::max_digits10);
0038       *fout << "energy: " << rawtwr->get_energy() << std::endl;
0039 //      (*fout).precision(std::numeric_limits<decltype(rawtwr->get_time_float())>::max_digits10);
0040       *fout << "time: " << rawtwr->get_time() << std::endl;
0041       *fout << "chi2: " << rawtwr->get_chi2() << std::endl;
0042       *fout << "pedestal: " << rawtwr->get_pedestal() << std::endl;
0043       *fout << "isHot: " << rawtwr->get_isHot() << std::endl;
0044       *fout << "isBadTime: " << rawtwr->get_isBadTime() << std::endl;
0045       *fout << "isNotInstr: " << rawtwr->get_isNotInstr() << std::endl;
0046       *fout << "isGood: " << rawtwr->get_isGood() << std::endl;
0047       *fout << "status: " << static_cast<unsigned int>(rawtwr->get_status()) << std::endl;
0048       *fout << "nsample: " << rawtwr->get_nsample() << std::endl;
0049       for (int j = 0; j < rawtwr->get_nsample(); j++)
0050       {
0051         *fout << "waveform_value[" << j << "]: " << rawtwr->get_waveform_value(j) << std::endl;
0052       }
0053     }
0054     (*fout).precision(original_precision);
0055   }
0056   return 0;
0057 }