Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4EnvelopeSubsystem.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4EnvelopeSubsystem.cc
2 
3 #include "PHG4EnvelopeDetector.h"
5 
7 #include <g4main/PHG4Subsystem.h> // for PHG4Subsystem
8 
10 #include <phool/PHIODataNode.h> // for PHIODataNode
11 #include <phool/PHNode.h> // for PHNode
12 #include <phool/PHNodeIterator.h> // for PHNodeIterator
13 #include <phool/PHObject.h> // for PHObject
14 #include <phool/getClass.h>
15 
16 #include <sstream>
17 
19  : PHG4Subsystem(name)
20  , detector_(nullptr)
21  , steppingAction_(nullptr)
22  , material("G4_PbWO4")
23  , // default - lead tungstate crystal
24  active(1)
25  , detector_type(name)
26 {
27 }
28 
30 {
31  PHNodeIterator iter(topNode);
32  PHCompositeNode* dstNode = dynamic_cast<PHCompositeNode*>(iter.findFirst("PHCompositeNode", "DST"));
33 
34  // create detector
35  detector_ = new PHG4EnvelopeDetector(this, topNode, Name());
38 
39  if (active)
40  {
41  // create hit output node
42  std::string nodename;
43  nodename = "G4HIT_ENVELOPE_" + detector_type;
44 
45  PHG4HitContainer* crystal_hits = findNode::getClass<PHG4HitContainer>(topNode, nodename);
46  if (!crystal_hits)
47  {
48  crystal_hits = new PHG4HitContainer(nodename);
49  PHIODataNode<PHObject>* hitNode = new PHIODataNode<PHObject>(crystal_hits, nodename, "PHObject");
50  dstNode->addNode(hitNode);
51  }
52 
53  // create stepping action
55  }
56  return 0;
57 }
58 
59 //_______________________________________________________________________
61 {
62  // pass top node to stepping action so that it gets
63  // relevant nodes needed internally
64  if (steppingAction_)
65  {
67  }
68  return 0;
69 }
70 
71 //_______________________________________________________________________
73 {
74  return detector_;
75 }
76 
77 //_______________________________________________________________________
79 {
80  return steppingAction_;
81 }