Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "DumpEpdGeom.h"
0002 
0003 #include <phool/PHIODataNode.h>
0004 
0005 #include <calobase/TowerInfoDefs.h>
0006 #include <epd/EpdGeom.h>
0007 
0008 #include <iomanip>
0009 #include <ostream>
0010 #include <string>
0011 #include <utility>
0012 
0013 using MyNode_t = PHIODataNode<EpdGeom>;
0014 
0015 DumpEpdGeom::DumpEpdGeom(const std::string &NodeName)
0016   : DumpObject(NodeName)
0017 {
0018   return;
0019 }
0020 
0021 int DumpEpdGeom::process_Node(PHNode *myNode)
0022 {
0023   const auto original_precision = (*fout).precision();
0024   EpdGeom *epdgeom = nullptr;
0025   MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);  // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
0026   if (thisNode)
0027   {
0028     epdgeom = thisNode->getData();
0029   }
0030   if (epdgeom)
0031   {
0032     (*fout).precision(std::numeric_limits<float>::max_digits10);
0033     for (int iarm = 0; iarm < 2; iarm++)
0034     {
0035       for (int irad = 0; irad < 16; irad++)
0036       {
0037         for (int iphi = 0; iphi < 24; iphi++)
0038         {
0039           if (irad == 0 && iphi > 11)
0040           {
0041             continue;
0042           }
0043           unsigned int key = TowerInfoDefs::encode_epd(iarm, irad, iphi);
0044           *fout << "tile key: 0x" << std::hex << key << std::dec << std::endl;
0045           *fout << "get_r: " << epdgeom->get_r(key) << std::endl;
0046           *fout << "get_phi: " << epdgeom->get_phi(key) << std::endl;
0047           *fout << "get_z: " << epdgeom->get_z(key) << std::endl;
0048         }
0049       }
0050       (*fout).precision(original_precision);
0051     }
0052   }
0053   return 0;
0054 }