Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:18

0001 #include "PHG4TpcPadPlane.h"
0002 
0003 #include <phparameter/PHParameterInterface.h>  // for PHParameterInterface
0004 
0005 #include <fun4all/Fun4AllReturnCodes.h>
0006 #include <fun4all/SubsysReco.h>  // for SubsysReco
0007 
0008 #include <phool/PHCompositeNode.h>
0009 #include <phool/PHNode.h>  // for PHNode
0010 #include <phool/PHNodeIterator.h>
0011 
0012 #include <string>
0013 
0014 PHG4TpcPadPlane::PHG4TpcPadPlane(const std::string &name)
0015   : SubsysReco(name)
0016   , PHParameterInterface(name)
0017   , detector("TPC")
0018 {
0019 }
0020 
0021 int PHG4TpcPadPlane::InitRun(PHCompositeNode *topNode)
0022 {
0023   PHNodeIterator iter(topNode);
0024   PHCompositeNode *runNode = dynamic_cast<PHCompositeNode *>(iter.findFirst("PHCompositeNode", "RUN"));
0025   PHCompositeNode *parNode = dynamic_cast<PHCompositeNode *>(iter.findFirst("PHCompositeNode", "PAR"));
0026   std::string paramnodename = "G4TPCPADPLANE";
0027   std::string geonodename = "G4TPCPADPLANEPAR";
0028   UpdateParametersWithMacro();
0029   PHNodeIterator runIter(runNode);
0030   PHCompositeNode *RunDetNode = dynamic_cast<PHCompositeNode *>(runIter.findFirst("PHCompositeNode", detector));
0031   if (!RunDetNode)
0032   {
0033     RunDetNode = new PHCompositeNode(detector);
0034     runNode->addNode(RunDetNode);
0035   }
0036   SaveToNodeTree(RunDetNode, paramnodename);
0037 
0038   // save this to the parNode for use
0039   PHNodeIterator parIter(parNode);
0040   PHCompositeNode *ParDetNode = dynamic_cast<PHCompositeNode *>(parIter.findFirst("PHCompositeNode", detector));
0041   if (!ParDetNode)
0042   {
0043     ParDetNode = new PHCompositeNode(detector);
0044     parNode->addNode(ParDetNode);
0045   }
0046   PutOnParNode(ParDetNode, geonodename);
0047   UpdateInternalParameters();
0048   return Fun4AllReturnCodes::EVENT_OK;
0049 }