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
PHG4FPbScSubsystem.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4FPbScSubsystem.cc
1
#include "
PHG4FPbScSubsystem.h
"
2
3
#include <
g4detectors/PHG4EventActionClearZeroEdep.h
>
4
#include "
PHG4FPbScDetector.h
"
5
#include "
PHG4FPbScRegionSteppingAction.h
"
6
#include "
PHG4FPbScSteppingAction.h
"
7
8
#include <
g4main/PHG4HitContainer.h
>
9
#include <
g4main/PHG4SteppingAction.h
>
// for PHG4SteppingAction
10
#include <
g4main/PHG4Subsystem.h
>
// for PHG4Subsystem
11
12
#include <
phool/PHCompositeNode.h
>
13
#include <
phool/PHIODataNode.h
>
// for PHIODataNode
14
#include <
phool/PHNode.h
>
// for PHNode
15
#include <
phool/PHNodeIterator.h
>
// for PHNodeIterator
16
#include <
phool/PHObject.h
>
// for PHObject
17
#include <
phool/getClass.h
>
18
19
#include <Geant4/G4UserSteppingAction.hh>
// for G4UserSteppingAction
20
21
#include <sstream>
22
23
class
PHG4Detector
;
24
25
using namespace
std;
26
27
//_______________________________________________________________________
28
PHG4FPbScSubsystem::PHG4FPbScSubsystem
(
const
string
&
name
)
29
:
PHG4Subsystem
(name)
30
, detector_(nullptr)
31
, steppingAction_(nullptr)
32
, eventAction_(nullptr)
33
, x_position(0)
34
, y_position(0)
35
, z_position(0)
36
{
37
}
38
39
//_______________________________________________________________________
40
int
PHG4FPbScSubsystem::Init
(
PHCompositeNode
*
topNode
)
41
{
42
std::ostringstream hitnodename;
43
hitnodename <<
"G4HIT_"
<<
Name
();
44
45
// create hit list
46
PHG4HitContainer
* fcal_hits = findNode::getClass<PHG4HitContainer>(
topNode
, (
"G4HIT_"
+
Name
()).c_str());
47
if
(!fcal_hits)
48
{
49
PHNodeIterator
iter(topNode);
50
PHCompositeNode
* dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
51
dstNode->
addNode
(
new
PHIODataNode<PHObject>
(fcal_hits =
new
PHG4HitContainer
((
"G4HIT_"
+
Name
())), (
"G4HIT_"
+
Name
()),
"PHObject"
));
52
}
53
54
// create detector
55
detector_
=
new
PHG4FPbScDetector
(
this
, topNode,
Name
());
56
detector_
->
set_Place
(
x_position
,
y_position
,
z_position
);
57
detector_
->
Verbosity
(
Verbosity
());
58
59
// create stepping action
60
steppingAction_
=
new
PHG4FPbScSteppingAction
(
detector_
);
61
62
eventAction_
=
new
PHG4EventActionClearZeroEdep
(topNode, hitnodename.str());
63
64
return
0;
65
}
66
67
//_______________________________________________________________________
68
int
PHG4FPbScSubsystem::process_event
(
PHCompositeNode
*
topNode
)
69
{
70
if
(
PHG4FPbScRegionSteppingAction
*
p
= dynamic_cast<PHG4FPbScRegionSteppingAction*>(
detector_
->
GetSteppingAction
()))
71
p
->SetInterfacePointers(topNode);
72
else
73
steppingAction_
->
SetInterfacePointers
(topNode);
74
75
return
0;
76
}
77
78
//_______________________________________________________________________
79
PHG4Detector
*
PHG4FPbScSubsystem::GetDetector
(
void
)
const
80
{
81
return
detector_
;
82
}
83
84
//_______________________________________________________________________
85
PHG4SteppingAction
*
PHG4FPbScSubsystem::GetSteppingAction
(
void
)
const
86
{
87
return
steppingAction_
;
88
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4eiccalos
PHG4FPbScSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:47
using
1.8.2 with
ECCE GitHub integration