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
G4JLeicVTXSubsystem.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4JLeicVTXSubsystem.cc
1
#include "
G4JLeicVTXSubsystem.h
"
2
#include "
G4JLeicVTXDetector.h
"
3
#include "
G4JLeicVTXSteppingAction.h
"
4
5
#include <phparameter/PHParameters.h>
6
#include <phparameter/PHParametersContainer.h>
7
8
#include <
g4detectors/PHG4DetectorGroupSubsystem.h
>
// for PHG4DetectorGrou...
9
10
#include <
g4main/PHG4HitContainer.h
>
11
#include <
g4main/PHG4SteppingAction.h
>
// for PHG4SteppingAction
12
13
#include <
phool/PHCompositeNode.h
>
14
#include <
phool/PHIODataNode.h
>
// for PHIODataNode
15
#include <
phool/PHNode.h
>
// for PHNode
16
#include <
phool/PHNodeIterator.h
>
// for PHNodeIterator
17
#include <
phool/PHObject.h
>
// for PHObject
18
#include <
phool/getClass.h
>
19
20
#include <boost/foreach.hpp>
21
22
#include <set>
// for set
23
#include <sstream>
24
25
using namespace
std;
26
27
//_______________________________________________________________________
28
G4JLeicVTXSubsystem::G4JLeicVTXSubsystem
(
const
std::string &
name
)
29
:
PHG4DetectorGroupSubsystem
(name)
30
, detector_(nullptr)
31
, steppingAction_(nullptr)
32
{
33
InitializeParameters
();
34
Name
(name);
35
SuperDetector
(name);
36
}
37
38
//_______________________________________________________________________
39
int
G4JLeicVTXSubsystem::InitRunSubsystem
(
PHCompositeNode
*topNode)
40
{
41
PHNodeIterator
iter(topNode);
42
PHCompositeNode
*dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
43
44
// create detector
45
detector_
=
new
G4JLeicVTXDetector
(
this
, topNode,
GetParamsContainer
(),
Name
());
46
detector_
->
SuperDetector
(
SuperDetector
());
47
detector_
->
OverlapCheck
(
CheckOverlap
());
48
49
set<string> nodes;
50
if
(
GetParamsContainer
()->GetParameters(-1)->
get_int_param
(
"active"
))
51
{
52
PHNodeIterator
dstIter(dstNode);
53
PHCompositeNode
*DetNode =
dynamic_cast<
PHCompositeNode
*
>
(dstIter.
findFirst
(
"PHCompositeNode"
,
SuperDetector
()));
54
if
(!DetNode)
55
{
56
DetNode =
new
PHCompositeNode
(
SuperDetector
());
57
dstNode->
addNode
(DetNode);
58
}
59
ostringstream nodename;
60
if
(
SuperDetector
() !=
"NONE"
)
61
{
62
nodename <<
"G4HIT_"
<<
SuperDetector
();
63
}
64
else
65
{
66
nodename <<
"G4HIT_"
<<
Name
();
67
}
68
nodes.insert(nodename.str());
69
BOOST_FOREACH (
string
node, nodes)
70
{
71
PHG4HitContainer
*g4_hits = findNode::getClass<PHG4HitContainer>(topNode, node.c_str());
72
if
(!g4_hits)
73
{
74
g4_hits =
new
PHG4HitContainer
(node);
75
DetNode->
addNode
(
new
PHIODataNode<PHObject>
(g4_hits, node.c_str(),
"PHObject"
));
76
}
77
}
78
// create stepping action
79
steppingAction_
=
new
G4JLeicVTXSteppingAction
(
detector_
,
GetParamsContainer
());
80
steppingAction_
->
Init
();
81
}
82
83
return
0;
84
}
85
86
//_______________________________________________________________________
87
int
G4JLeicVTXSubsystem::process_event
(
PHCompositeNode
*topNode)
88
{
89
// pass top node to stepping action so that it gets
90
// relevant nodes needed internally
91
if
(
steppingAction_
)
92
{
93
steppingAction_
->
SetInterfacePointers
(topNode);
94
}
95
return
0;
96
}
97
98
void
G4JLeicVTXSubsystem::Print
(
const
string
&what)
const
99
{
100
PrintDefaultParams
();
101
PrintMacroParams
();
102
GetParamsContainer
()->
Print
();
103
if
(
detector_
)
104
{
105
detector_
->
Print
(what);
106
}
107
return
;
108
}
109
110
//_______________________________________________________________________
111
PHG4Detector
*
G4JLeicVTXSubsystem::GetDetector
(
void
)
const
112
{
113
return
detector_
;
114
}
115
116
//_______________________________________________________________________
117
PHG4SteppingAction
*
G4JLeicVTXSubsystem::GetSteppingAction
(
void
)
const
118
{
119
return
steppingAction_
;
120
}
121
122
void
G4JLeicVTXSubsystem::SetDefaultParameters
()
123
{
124
// all units are in cm
125
set_default_double_param
(0,
"Dx"
, 0.005);
126
set_default_double_param
(0,
"Dy"
, 2.);
127
set_default_double_param
(0,
"Dz"
, 10.);
128
set_default_double_param
(0,
"Rin"
, 3.5);
129
set_default_double_param
(0,
"PixelDx"
, 1.);
// dz/10. = 1.
130
set_default_double_param
(0,
"PixelDy"
, 2. / 50.);
// dy/50
131
132
set_default_double_param
(1,
"Dx"
, 0.005);
133
set_default_double_param
(1,
"Dy"
, 2.);
134
set_default_double_param
(1,
"Dz"
, 11.);
135
set_default_double_param
(1,
"Rin"
, 4.5);
136
set_default_double_param
(1,
"PixelDx"
, 11. / 10.);
// dz/10
137
set_default_double_param
(1,
"PixelDy"
, 2. / 50.);
// dy/50
138
139
set_default_double_param
(2,
"Dx"
, 0.005);
140
set_default_double_param
(2,
"Dy"
, 4.);
141
set_default_double_param
(2,
"Dz"
, 18.);
142
set_default_double_param
(2,
"Rin"
, 6.5);
143
set_default_double_param
(2,
"PixelDx"
, 18. / 50.);
// dz/50
144
set_default_double_param
(2,
"PixelDy"
, 4. / 10.);
// dy/10
145
146
set_default_double_param
(3,
"Dx"
, 0.005);
147
set_default_double_param
(3,
"Dy"
, 4.);
148
set_default_double_param
(3,
"Dz"
, 24.);
149
set_default_double_param
(3,
"Rin"
, 10.5);
150
set_default_double_param
(3,
"PixelDx"
, 24. / 50.);
// dz/50
151
set_default_double_param
(3,
"PixelDy"
, 4. / 10.);
// dy/10
152
153
set_default_double_param
(4,
"Dx"
, 0.005);
154
set_default_double_param
(4,
"Dy"
, 4.);
155
set_default_double_param
(4,
"Dz"
, 36.);
156
set_default_double_param
(4,
"Rin"
, 13.5);
157
set_default_double_param
(4,
"PixelDx"
, 36. / 50.);
// dz/50
158
set_default_double_param
(4,
"PixelDy"
, 4. / 10.);
// dy/10
159
160
set_default_double_param
(5,
"Dx"
, 0.005);
161
set_default_double_param
(5,
"Dy"
, 4.);
162
set_default_double_param
(5,
"Dz"
, 48.);
163
set_default_double_param
(5,
"Rin"
, 15.5);
164
set_default_double_param
(5,
"PixelDx"
, 48. / 50.);
// dz/50
165
set_default_double_param
(5,
"PixelDy"
, 4. / 10.);
// dy/10
166
167
// global parameters are stored under -1
168
set_default_int_param
(-1,
"layers"
, 6);
169
set_default_int_param
(-1,
"rows"
, 56);
170
set_default_double_param
(-1,
"shift_z"
, 40);
171
set_default_double_param
(-1,
"xsize"
, 0.8);
172
set_default_double_param
(-1,
"ysize"
, 6.);
173
set_default_double_param
(-1,
"zsize"
, 5.);
174
set_default_int_param
(-1,
"active"
, 1);
175
set_default_int_param
(-1,
"absorberactive"
, 0);
176
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4jleic
G4JLeicVTXSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:47
using
1.8.2 with
ECCE GitHub integration