Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
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
"
3
#include "
PHG4SectorDisplayAction.h
"
4
#include "
PHG4SectorSteppingAction.h
"
5
6
#include <
g4main/PHG4DisplayAction.h
>
// for PHG4DisplayAction
7
#include <
g4main/PHG4HitContainer.h
>
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
//_______________________________________________________________________
23
PHG4SectorSubsystem::PHG4SectorSubsystem
(
const
std::string
&
name
)
24
:
PHG4Subsystem
(name)
25
{
26
}
27
28
//_______________________________________________________________________
29
PHG4SectorSubsystem::~PHG4SectorSubsystem
()
30
{
31
delete
m_DisplayAction
;
32
}
33
34
//_______________________________________________________________________
35
int
PHG4SectorSubsystem::Init
(
PHCompositeNode
*
topNode
)
36
{
37
PHNodeIterator
iter(topNode);
38
PHCompositeNode
* dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
39
40
// create display settings before detector
41
m_DisplayAction
=
new
PHG4SectorDisplayAction
(
Name
());
42
// create detector
43
m_Detector
=
new
PHG4SectorDetector
(
this
, topNode,
Name
());
44
m_Detector
->
geom
=
geom
;
45
m_Detector
->
SuperDetector
(
superdetector
);
46
m_Detector
->
OverlapCheck
(
CheckOverlap
());
47
48
if
(
geom
.
GetNumActiveLayers
())
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
66
m_SteppingAction
=
new
PHG4SectorSteppingAction
(
m_Detector
);
67
}
68
return
0;
69
}
70
71
//_______________________________________________________________________
72
int
PHG4SectorSubsystem::process_event
(
PHCompositeNode
*
topNode
)
73
{
74
// pass top node to stepping action so that it gets
75
// relevant nodes needed internally
76
if
(
m_SteppingAction
)
77
{
78
m_SteppingAction
->
SetInterfacePointers
(topNode);
79
}
80
return
0;
81
}
82
83
//_______________________________________________________________________
84
PHG4Detector
*
85
PHG4SectorSubsystem::GetDetector
()
const
86
{
87
return
m_Detector
;
88
}
coresoftware
blob
master
simulation
g4simulation
g4detectors
PHG4SectorSubsystem.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:13
using
1.8.2 with
sPHENIX GitHub integration