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
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
using namespace
std;
23
24
//_______________________________________________________________________
25
PHG4SectorSubsystem::PHG4SectorSubsystem
(
const
std::string&
name
)
26
:
PHG4Subsystem
(name)
27
, m_Detector(nullptr)
28
, m_SteppingAction(nullptr)
29
, m_DisplayAction(nullptr)
30
, superdetector(
"NONE"
)
31
{
32
}
33
34
//_______________________________________________________________________
35
PHG4SectorSubsystem::~PHG4SectorSubsystem
()
36
{
37
delete
m_DisplayAction
;
38
}
39
40
//_______________________________________________________________________
41
int
PHG4SectorSubsystem::Init
(
PHCompositeNode
*
topNode
)
42
{
43
PHNodeIterator
iter(topNode);
44
PHCompositeNode
* dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
45
"PHCompositeNode"
,
"DST"
));
46
47
// create display settings before detector
48
m_DisplayAction
=
new
PHG4SectorDisplayAction
(
Name
());
49
// create detector
50
m_Detector
=
new
PHG4SectorDetector
(
this
, topNode,
Name
());
51
m_Detector
->
geom
=
geom
;
52
m_Detector
->
SuperDetector
(
superdetector
);
53
m_Detector
->
OverlapCheck
(
CheckOverlap
());
54
55
if
(
geom
.
GetNumActiveLayers
())
56
{
57
ostringstream nodename;
58
if
(
superdetector
!=
"NONE"
)
59
{
60
nodename <<
"G4HIT_"
<<
superdetector
;
61
}
62
else
63
{
64
nodename <<
"G4HIT_"
<<
Name
();
65
}
66
// create hit list
67
PHG4HitContainer
* block_hits = findNode::getClass<PHG4HitContainer>(
68
topNode
, nodename.str().c_str());
69
if
(!block_hits)
70
{
71
dstNode->
addNode
(
new
PHIODataNode<PHObject>
(
new
PHG4HitContainer
(nodename.str()), nodename.str(),
"PHObject"
));
72
}
73
// create stepping action
74
m_SteppingAction
=
new
PHG4SectorSteppingAction
(
m_Detector
);
75
}
76
return
0;
77
}
78
79
//_______________________________________________________________________
80
int
PHG4SectorSubsystem::process_event
(
PHCompositeNode
*
topNode
)
81
{
82
// pass top node to stepping action so that it gets
83
// relevant nodes needed internally
84
if
(
m_SteppingAction
)
85
{
86
m_SteppingAction
->
SetInterfacePointers
(topNode);
87
}
88
return
0;
89
}
90
91
//_______________________________________________________________________
92
PHG4Detector
*
93
PHG4SectorSubsystem::GetDetector
(
void
)
const
94
{
95
return
m_Detector
;
96
}
coresoftware
blob
master
simulation
g4simulation
g4detectors
PHG4SectorSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:42
using
1.8.2 with
ECCE GitHub integration