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
PHG4FCalSubsystem.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4FCalSubsystem.cc
1
#include "
PHG4FCalSubsystem.h
"
2
3
#include "
PHG4FCalDetector.h
"
4
#include "
PHG4FCalSteppingAction.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 <Geant4/G4UserSteppingAction.hh>
// for G4UserSteppingAction
17
18
class
PHG4Detector
;
19
20
//_______________________________________________________________________
21
PHG4FCalSubsystem::PHG4FCalSubsystem
(
const
char
*
name
)
22
:
PHG4Subsystem
(name)
23
, detector_(nullptr)
24
{
25
}
26
27
//_______________________________________________________________________
28
int
PHG4FCalSubsystem::Init
(
PHCompositeNode
*
topNode
)
29
{
30
// create hit list
31
PHG4HitContainer
* fcal_hits = findNode::getClass<PHG4HitContainer>(
topNode
,
"G4HIT_FCAL"
);
32
if
(!fcal_hits)
33
{
34
PHNodeIterator
iter(topNode);
35
PHCompositeNode
* dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
36
dstNode->
addNode
(
new
PHIODataNode<PHObject>
(fcal_hits =
new
PHG4HitContainer
(
"G4HIT_FCAL"
),
"G4HIT_FCAL"
,
"PHObject"
));
37
}
38
39
// create detector
40
detector_
=
new
PHG4FCalDetector
(
this
, topNode,
Name
());
41
detector_
->
Verbosity
(
Verbosity
());
42
43
// create stepping action
44
45
return
9;
46
}
47
48
//_______________________________________________________________________
49
int
PHG4FCalSubsystem::process_event
(
PHCompositeNode
*
topNode
)
50
{
51
if
(
PHG4FCalSteppingAction
*
p
= dynamic_cast<PHG4FCalSteppingAction*>(
detector_
->
GetSteppingAction
()))
52
p
->SetInterfacePointers(topNode);
53
54
return
0;
55
}
56
57
//_______________________________________________________________________
58
PHG4Detector
*
PHG4FCalSubsystem::GetDetector
(
void
)
const
59
{
60
return
detector_
;
61
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4eiccalos
PHG4FCalSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:47
using
1.8.2 with
ECCE GitHub integration