EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4TpcPadPlane.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4TpcPadPlane.cc
1 #include "PHG4TpcPadPlane.h"
2 
3 #include <phparameter/PHParameterInterface.h> // for PHParameterInterface
4 
6 #include <fun4all/SubsysReco.h> // for SubsysReco
7 
9 #include <phool/PHNode.h> // for PHNode
10 #include <phool/PHNodeIterator.h>
11 
12 #include <string>
13 
15  : SubsysReco(name)
16  , PHParameterInterface(name)
17  , detector("TPC")
18 {
19 }
20 
22 {
23  PHNodeIterator iter(topNode);
24  PHCompositeNode *runNode = dynamic_cast<PHCompositeNode *>(iter.findFirst("PHCompositeNode", "RUN"));
25  PHCompositeNode *parNode = dynamic_cast<PHCompositeNode *>(iter.findFirst("PHCompositeNode", "PAR"));
26  std::string paramnodename = "G4TPCPADPLANE";
27  std::string geonodename = "G4TPCPADPLANEPAR";
29  PHNodeIterator runIter(runNode);
30  PHCompositeNode *RunDetNode = dynamic_cast<PHCompositeNode *>(runIter.findFirst("PHCompositeNode", detector));
31  if (!RunDetNode)
32  {
33  RunDetNode = new PHCompositeNode(detector);
34  runNode->addNode(RunDetNode);
35  }
36  SaveToNodeTree(RunDetNode, paramnodename);
37 
38  // save this to the parNode for use
39  PHNodeIterator parIter(parNode);
40  PHCompositeNode *ParDetNode = dynamic_cast<PHCompositeNode *>(parIter.findFirst("PHCompositeNode", detector));
41  if (!ParDetNode)
42  {
43  ParDetNode = new PHCompositeNode(detector);
44  parNode->addNode(ParDetNode);
45  }
46  PutOnParNode(ParDetNode, geonodename);
49 }