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
PHG4RICHSubsystem.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4RICHSubsystem.cc
1
// $$Id: PHG4RICHSubsystem.cc,v 1.1 2013/10/01 00:33:01 jinhuang Exp $$
2
11
#include "
PHG4RICHSubsystem.h
"
12
#include "
PHG4RICHDetector.h
"
13
#include "
PHG4RICHDisplayAction.h
"
14
#include "
PHG4RICHSteppingAction.h
"
15
16
#include <
g4main/PHG4DisplayAction.h
>
// for PHG4DisplayAction
17
#include <
g4main/PHG4HitContainer.h
>
18
#include <
g4main/PHG4Subsystem.h
>
// for PHG4Subsystem
19
20
#include <
phool/PHCompositeNode.h
>
21
#include <
phool/PHIODataNode.h
>
// for PHIODataNode
22
#include <
phool/PHNode.h
>
// for PHNode
23
#include <
phool/PHNodeIterator.h
>
// for PHNodeIterator
24
#include <
phool/PHObject.h
>
// for PHObject
25
#include <
phool/getClass.h
>
26
27
#include <Geant4/G4UserSteppingAction.hh>
// for G4UserSteppingAction
28
29
class
PHG4Detector
;
30
31
using namespace
ePHENIXRICH;
32
using namespace
std;
33
34
//_______________________________________________________________________
35
PHG4RICHSubsystem::PHG4RICHSubsystem
(
const
string
&
name
)
36
:
PHG4Subsystem
(name)
37
, m_Detector(nullptr)
38
, m_DisplayAction(nullptr)
39
{
40
}
41
42
//_______________________________________________________________________
43
PHG4RICHSubsystem::~PHG4RICHSubsystem
()
44
{
45
delete
m_DisplayAction
;
46
}
47
48
//_______________________________________________________________________
49
int
PHG4RICHSubsystem::Init
(
PHCompositeNode
*
topNode
)
50
{
51
// create hit list
52
PHG4HitContainer
* rich_hits = findNode::getClass<PHG4HitContainer>(
topNode
,
"G4HIT_RICH"
);
53
if
(!rich_hits)
54
{
55
PHNodeIterator
iter(topNode);
56
PHCompositeNode
* dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
57
dstNode->
addNode
(
new
PHIODataNode<PHObject>
(
new
PHG4HitContainer
(
"G4HIT_RICH"
),
"G4HIT_RICH"
,
"PHObject"
));
58
}
59
60
// create display settings before detector
61
m_DisplayAction
=
new
PHG4RICHDisplayAction
(
Name
());
62
// create detector
63
m_Detector
=
new
PHG4RICHDetector
(
this
, topNode,
Name
(),
geom
);
64
m_Detector
->
Verbosity
(
Verbosity
());
65
m_Detector
->
OverlapCheck
(
CheckOverlap
());
66
67
// create stepping action
68
69
return
0;
70
}
71
72
//_______________________________________________________________________
73
int
PHG4RICHSubsystem::process_event
(
PHCompositeNode
*
topNode
)
74
{
75
if
(
PHG4RICHSteppingAction
*
p
= dynamic_cast<PHG4RICHSteppingAction*>(
m_Detector
->
GetSteppingAction
()))
76
p
->SetInterfacePointers(topNode);
77
78
return
0;
79
}
80
81
//_______________________________________________________________________
82
PHG4Detector
*
PHG4RICHSubsystem::GetDetector
(
void
)
const
83
{
84
return
m_Detector
;
85
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4rich
PHG4RICHSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:48
using
1.8.2 with
ECCE GitHub integration