ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
1
#include "
PHG4EnvelopeSubsystem.h
"
2
3
#include "
PHG4EnvelopeDetector.h
"
4
#include "
PHG4EnvelopeSteppingAction.h
"
5
6
#include <
g4main/PHG4HitContainer.h
>
7
#include <
g4main/PHG4Subsystem.h
>
// for PHG4Subsystem
8
9
#include <
phool/PHCompositeNode.h
>
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
18
using namespace
std;
19
20
PHG4EnvelopeSubsystem::PHG4EnvelopeSubsystem
(
const
std::string&
name
,
const
int
/*lyr*/
)
21
:
PHG4Subsystem
(name)
22
, detector_(nullptr)
23
, steppingAction_(nullptr)
24
,
material
(
"G4_PbWO4"
)
25
,
// default - lead tungstate crystal
26
active
(1)
27
, detector_type(name)
28
{
29
}
30
31
int
PHG4EnvelopeSubsystem::Init
(
PHCompositeNode
* topNode)
32
{
33
PHNodeIterator
iter(topNode);
34
PHCompositeNode
* dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
35
36
// create detector
37
detector_
=
new
PHG4EnvelopeDetector
(
this
, topNode,
Name
());
38
detector_
->
SetActive
(
active
);
39
detector_
->
OverlapCheck
(
CheckOverlap
());
40
41
if
(
active
)
42
{
43
// create hit output node
44
ostringstream nodename;
45
nodename <<
"G4HIT_ENVELOPE_"
<<
detector_type
;
46
47
PHG4HitContainer
* crystal_hits = findNode::getClass<PHG4HitContainer>(topNode, nodename.str().c_str());
48
if
(!crystal_hits)
49
{
50
crystal_hits =
new
PHG4HitContainer
(nodename.str());
51
PHIODataNode<PHObject>
* hitNode =
new
PHIODataNode<PHObject>
(crystal_hits, nodename.str().c_str(),
"PHObject"
);
52
dstNode->
addNode
(hitNode);
53
}
54
55
// create stepping action
56
steppingAction_
=
new
PHG4EnvelopeSteppingAction
(
detector_
);
57
}
58
return
0;
59
}
60
61
//_______________________________________________________________________
62
int
PHG4EnvelopeSubsystem::process_event
(
PHCompositeNode
* topNode)
63
{
64
// pass top node to stepping action so that it gets
65
// relevant nodes needed internally
66
if
(
steppingAction_
)
67
{
68
steppingAction_
->
SetInterfacePointers
(topNode);
69
}
70
return
0;
71
}
72
73
//_______________________________________________________________________
74
PHG4Detector
*
PHG4EnvelopeSubsystem::GetDetector
(
void
)
const
75
{
76
return
detector_
;
77
}
78
79
//_______________________________________________________________________
80
PHG4SteppingAction
*
PHG4EnvelopeSubsystem::GetSteppingAction
(
void
)
const
81
{
82
return
steppingAction_
;
83
}
coresoftware
blob
master
simulation
g4simulation
g4detectors
PHG4EnvelopeSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:41
using
1.8.2 with
ECCE GitHub integration