Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4SectorSubsystem.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4SectorSubsystem.cc
1 #include "PHG4SectorSubsystem.h"
2 #include "PHG4SectorDetector.h"
5 
6 #include <g4main/PHG4DisplayAction.h> // for PHG4DisplayAction
8 #include <g4main/PHG4SteppingAction.h> // for PHG4SteppingAction
9 #include <g4main/PHG4Subsystem.h> // for PHG4Subsystem
10 
11 #include <phool/PHCompositeNode.h>
12 #include <phool/PHIODataNode.h> // for PHIODataNode
13 #include <phool/PHNode.h> // for PHNode
14 #include <phool/PHNodeIterator.h> // for PHNodeIterator
15 #include <phool/PHObject.h> // for PHObject
16 #include <phool/getClass.h>
17 
18 #include <sstream>
19 
20 class PHG4Detector;
21 
22 //_______________________________________________________________________
24  : PHG4Subsystem(name)
25 {
26 }
27 
28 //_______________________________________________________________________
30 {
31  delete m_DisplayAction;
32 }
33 
34 //_______________________________________________________________________
36 {
37  PHNodeIterator iter(topNode);
38  PHCompositeNode* dstNode = dynamic_cast<PHCompositeNode*>(iter.findFirst("PHCompositeNode", "DST"));
39 
40  // create display settings before detector
42  // create detector
43  m_Detector = new PHG4SectorDetector(this, topNode, Name());
44  m_Detector->geom = geom;
47 
49  {
50  std::ostringstream nodename;
51  if (superdetector != "NONE")
52  {
53  nodename << "G4HIT_" << superdetector;
54  }
55  else
56  {
57  nodename << "G4HIT_" << Name();
58  }
59  // create hit list
60  PHG4HitContainer* block_hits = findNode::getClass<PHG4HitContainer>(topNode, nodename.str());
61  if (!block_hits)
62  {
63  dstNode->addNode(new PHIODataNode<PHObject>(new PHG4HitContainer(nodename.str()), nodename.str(), "PHObject"));
64  }
65  // create stepping action
67  }
68  return 0;
69 }
70 
71 //_______________________________________________________________________
73 {
74  // pass top node to stepping action so that it gets
75  // relevant nodes needed internally
76  if (m_SteppingAction)
77  {
79  }
80  return 0;
81 }
82 
83 //_______________________________________________________________________
86 {
87  return m_Detector;
88 }