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
G4JLeicDIRCSubsystem.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4JLeicDIRCSubsystem.cc
1
#include "
G4JLeicDIRCSubsystem.h
"
2
#include "
G4JLeicDIRCDetector.h
"
3
#include "
G4JLeicDIRCSteppingAction.h
"
4
5
#include <phparameter/PHParameters.h>
6
7
#include <
g4main/PHG4HitContainer.h
>
8
#include <
g4main/PHG4SteppingAction.h
>
// for PHG4SteppingAction
9
10
#include <
phool/PHCompositeNode.h
>
11
#include <
phool/PHIODataNode.h
>
// for PHIODataNode
12
#include <
phool/PHNode.h
>
// for PHNode
13
#include <
phool/PHNodeIterator.h
>
// for PHNodeIterator
14
#include <
phool/PHObject.h
>
// for PHObject
15
#include <
phool/getClass.h
>
16
17
#include <boost/foreach.hpp>
18
19
#include <set>
// for set
20
#include <sstream>
21
22
using namespace
std;
23
24
//_______________________________________________________________________
25
G4JLeicDIRCSubsystem::G4JLeicDIRCSubsystem
(
const
std::string &
name
)
26
:
PHG4DetectorSubsystem
(name, 0)
27
, detector_(nullptr)
28
, steppingAction_(nullptr)
29
{
30
InitializeParameters
();
31
Name
(name);
32
SuperDetector
(name);
33
}
34
35
//_______________________________________________________________________
36
int
G4JLeicDIRCSubsystem::InitRunSubsystem
(
PHCompositeNode
*topNode)
37
{
38
PHNodeIterator
iter(topNode);
39
PHCompositeNode
*dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
40
41
// create detector
42
detector_
=
new
G4JLeicDIRCDetector
(
this
, topNode,
GetParams
(),
Name
());
43
detector_
->
SuperDetector
(
SuperDetector
());
44
detector_
->
OverlapCheck
(
CheckOverlap
());
45
46
set<string> nodes;
47
if
(
GetParams
()->
get_int_param
(
"active"
))
48
{
49
PHNodeIterator
dstIter(dstNode);
50
PHCompositeNode
*DetNode =
dynamic_cast<
PHCompositeNode
*
>
(dstIter.
findFirst
(
"PHCompositeNode"
,
SuperDetector
()));
51
if
(!DetNode)
52
{
53
DetNode =
new
PHCompositeNode
(
SuperDetector
());
54
dstNode->
addNode
(DetNode);
55
}
56
ostringstream nodename;
57
if
(
SuperDetector
() !=
"NONE"
)
58
{
59
nodename <<
"G4HIT_"
<<
SuperDetector
();
60
}
61
else
62
{
63
nodename <<
"G4HIT_"
<<
Name
();
64
}
65
nodes.insert(nodename.str());
66
BOOST_FOREACH (
string
node, nodes)
67
{
68
PHG4HitContainer
*g4_hits = findNode::getClass<PHG4HitContainer>(topNode, node.c_str());
69
if
(!g4_hits)
70
{
71
g4_hits =
new
PHG4HitContainer
(node);
72
DetNode->
addNode
(
new
PHIODataNode<PHObject>
(g4_hits, node.c_str(),
"PHObject"
));
73
}
74
}
75
// create stepping action
76
steppingAction_
=
new
G4JLeicDIRCSteppingAction
(
detector_
,
GetParams
());
77
}
78
79
return
0;
80
}
81
82
//_______________________________________________________________________
83
int
G4JLeicDIRCSubsystem::process_event
(
PHCompositeNode
*topNode)
84
{
85
// pass top node to stepping action so that it gets
86
// relevant nodes needed internally
87
if
(
steppingAction_
)
88
{
89
steppingAction_
->
SetInterfacePointers
(topNode);
90
}
91
return
0;
92
}
93
94
void
G4JLeicDIRCSubsystem::Print
(
const
string
&what)
const
95
{
96
//cout << "PSTOF Parameters: " << endl;
97
if
(
detector_
)
98
{
99
detector_
->
Print
(what);
100
}
101
return
;
102
}
103
104
//_______________________________________________________________________
105
PHG4Detector
*
G4JLeicDIRCSubsystem::GetDetector
(
void
)
const
106
{
107
return
detector_
;
108
}
109
110
//_______________________________________________________________________
111
PHG4SteppingAction
*
G4JLeicDIRCSubsystem::GetSteppingAction
(
void
)
const
112
{
113
return
steppingAction_
;
114
}
115
116
void
G4JLeicDIRCSubsystem::SetDefaultParameters
()
117
{
118
// all units are in cm
119
set_default_double_param
(
"PixelDy"
, 4. / 10.);
// dy/10
120
121
set_default_int_param
(
"layers"
, 6);
122
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4jleic
G4JLeicDIRCSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:47
using
1.8.2 with
ECCE GitHub integration