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
PHG4TTLSubsystem.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4TTLSubsystem.cc
1
#include "
PHG4TTLSubsystem.h
"
2
#include "
PHG4TTLDetector.h
"
3
4
#include <phparameter/PHParameters.h>
5
6
#include <
g4main/PHG4DisplayAction.h
>
// for PHG4DisplayAction
7
#include <
g4main/PHG4HitContainer.h
>
8
#include <
g4main/PHG4SteppingAction.h
>
// for PHG4SteppingAction
9
#include <
g4main/PHG4Subsystem.h
>
// for PHG4Subsystem
10
#include "
PHG4TTLDisplayAction.h
"
11
#include "
PHG4TTLSteppingAction.h
"
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 <sstream>
21
22
#include <set>
// for set
23
#include <sstream>
24
class
PHG4Detector
;
25
26
using namespace
std;
27
28
//_______________________________________________________________________
29
PHG4TTLSubsystem::PHG4TTLSubsystem
(
const
std::string&
name
)
30
:
PHG4DetectorSubsystem
(name)
31
, m_Detector(nullptr)
32
, m_SteppingAction(nullptr)
33
, m_DisplayAction(nullptr)
34
, superdetector(
"NONE"
)
35
{
36
InitializeParameters
();
37
}
38
39
//_______________________________________________________________________
40
PHG4TTLSubsystem::~PHG4TTLSubsystem
()
41
{
42
delete
m_DisplayAction
;
43
}
44
45
//_______________________________________________________________________
46
int
PHG4TTLSubsystem::InitRunSubsystem
(
PHCompositeNode
*
topNode
)
47
{
48
PHNodeIterator
iter(topNode);
49
PHCompositeNode
* dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
50
"PHCompositeNode"
,
"DST"
));
51
52
// create display settings before detector
53
m_DisplayAction
=
new
PHG4TTLDisplayAction
(
Name
(),
showdetailed
);
54
// create detector
55
m_Detector
=
new
PHG4TTLDetector
(
this
, topNode,
GetParams
(),
Name
());
56
// m_Detector->geom = geom;
57
m_Detector
->
SuperDetector
(
superdetector
);
58
m_Detector
->
OverlapCheck
(
CheckOverlap
());
59
60
// if (geom.GetNumActiveLayers())
61
// {
62
std::ostringstream nodename;
63
if
(
superdetector
!=
"NONE"
)
64
{
65
nodename <<
"G4HIT_"
<<
superdetector
;
66
}
67
else
68
{
69
nodename <<
"G4HIT_"
<<
Name
();
70
}
71
// create hit list
72
PHG4HitContainer
* block_hits = findNode::getClass<PHG4HitContainer>(
73
topNode
, nodename.str().c_str());
74
if
(!block_hits)
75
{
76
dstNode->
addNode
(
new
PHIODataNode<PHObject>
(
new
PHG4HitContainer
(nodename.str()), nodename.str(),
"PHObject"
));
77
}
78
// create stepping action
79
m_SteppingAction
=
new
PHG4TTLSteppingAction
(
m_Detector
);
80
m_Detector
->
SetSteppingAction
(dynamic_cast<PHG4TTLSteppingAction*>(
m_SteppingAction
));
81
// }
82
return
0;
83
}
84
85
//_______________________________________________________________________
86
int
PHG4TTLSubsystem::process_event
(
PHCompositeNode
*
topNode
)
87
{
88
// pass top node to stepping action so that it gets
89
// relevant nodes needed internally
90
if
(
m_SteppingAction
)
91
{
92
m_SteppingAction
->
SetInterfacePointers
(topNode);
93
}
94
return
0;
95
}
96
97
//_______________________________________________________________________
98
PHG4Detector
*
99
PHG4TTLSubsystem::GetDetector
(
void
)
const
100
{
101
return
m_Detector
;
102
}
103
104
void
PHG4TTLSubsystem::SetDefaultParameters
()
105
{
106
set_default_int_param
(
"isForward"
, 1);
107
set_default_double_param
(
"length"
, 100. *
cm
);
108
set_default_double_param
(
"place_x"
, 0.);
109
set_default_double_param
(
"place_y"
, 0.);
110
set_default_double_param
(
"place_z"
, 375. *
cm
);
111
set_default_double_param
(
"offset_x"
, 150. *
cm
);
112
set_default_double_param
(
"rMin"
, 20. *
cm
);
113
set_default_double_param
(
"rMax"
, 220. *
cm
);
114
set_default_double_param
(
"etaMin"
, 1.);
115
set_default_double_param
(
"etaMax"
, 4.);
116
set_default_double_param
(
"polar_angle"
, 0.);
117
set_default_double_param
(
"total_thickness"
, 1. *
cm
);
118
set_default_double_param
(
"tSilicon"
, 1. *
um
);
119
set_default_double_param
(
"resLGAD"
, 500
e
-4 / sqrt(12));
120
// set_default_double_param("wls_dw", 0.3);
121
// set_default_double_param("support_dw", 0.2);
122
set_default_double_param
(
"rot_x"
, 0.);
123
set_default_double_param
(
"rot_y"
, 0.);
124
set_default_double_param
(
"rot_z"
, 0.);
125
// set_default_double_param("thickness_absorber", 2.);
126
// set_default_double_param("thickness_scintillator", 0.231);
127
// set_default_string_param("scintillator", "G4_POLYSTYRENE");
128
// set_default_string_param("absorber", "G4_Fe");
129
// set_default_string_param("support", "G4_Fe");
130
return
;
131
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4ttl
PHG4TTLSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:48
using
1.8.2 with
ECCE GitHub integration