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
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
analysis
coresoftware
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
blob
master
analysis
reconstruction
simulation
g4simulation
g4b0
g4b0ecal
g4barrelmmg
g4beastmagnet
BeastMagnetDetector.cc
BeastMagnetDetector.h
BeastMagnetDisplayAction.cc
BeastMagnetDisplayAction.h
BeastMagnetSteppingAction.cc
BeastMagnetSteppingAction.h
BeastMagnetSubsystem.cc
BeastMagnetSubsystem.h
g4bwd
g4drcalo
g4drich
g4eiccalos
g4eicdirc
g4etof
g4jleic
g4lblvtx
g4lumi
g4mrich
g4rich
g4rp
g4trd
g4ttl
g4zdc
geant4
macros
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
BeastMagnetSubsystem.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file BeastMagnetSubsystem.cc
1
//____________________________________________________________________________..
2
//
3
// This is the interface to the framework. You only need to define the parameters
4
// you use for your detector in the SetDefaultParameters() method here
5
// The place to do this is marked by //implement your own here//
6
// The parameters have no units, they need to be converted in the
7
// BeastMagnetDetector::ConstructMe() method
8
// but the convention is as mentioned cm and deg
9
//____________________________________________________________________________..
10
//
11
#include "
BeastMagnetSubsystem.h
"
12
13
#include "
BeastMagnetDetector.h
"
14
#include "
BeastMagnetDisplayAction.h
"
15
#include "
BeastMagnetSteppingAction.h
"
16
17
#include <phparameter/PHParameters.h>
18
19
#include <
g4main/PHG4HitContainer.h
>
20
#include <
g4main/PHG4SteppingAction.h
>
21
22
#include <
phool/PHCompositeNode.h
>
23
#include <
phool/PHIODataNode.h
>
24
#include <
phool/PHNode.h
>
25
#include <
phool/PHNodeIterator.h
>
26
#include <
phool/PHObject.h
>
27
#include <
phool/getClass.h
>
28
29
using namespace
std;
30
31
//_______________________________________________________________________
32
BeastMagnetSubsystem::BeastMagnetSubsystem
(
const
std::string &
name
)
33
:
PHG4DetectorSubsystem
(name)
34
, m_Detector(nullptr)
35
, m_SteppingAction(nullptr)
36
, m_DisplayAction(nullptr)
37
{
38
// call base class method which will set up parameter infrastructure
39
// and call our SetDefaultParameters() method
40
InitializeParameters
();
41
}
42
43
//_______________________________________________________________________
44
BeastMagnetSubsystem::~BeastMagnetSubsystem
()
45
{
46
delete
m_DisplayAction
;
47
}
48
49
//_______________________________________________________________________
50
int
BeastMagnetSubsystem::InitRunSubsystem
(
PHCompositeNode
*topNode)
51
{
52
PHNodeIterator
iter(topNode);
53
PHCompositeNode
*dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
54
// create display settings before detector
55
m_DisplayAction
=
new
BeastMagnetDisplayAction
(
Name
());
56
57
// create detector
58
m_Detector
=
new
BeastMagnetDetector
(
this
, topNode,
GetParams
(),
Name
());
59
m_Detector
->
OverlapCheck
(
CheckOverlap
());
60
m_Detector
->
SuperDetector
(
SuperDetector
());
61
62
PHNodeIterator
dstIter(dstNode);
63
if
(
GetParams
()->
get_int_param
(
"active"
))
64
{
65
string
name
;
66
if
(
SuperDetector
() !=
"NONE"
)
67
{
68
name =
SuperDetector
();
69
}
70
else
71
{
72
name =
Name
();
73
}
74
PHCompositeNode
*DetNode =
dynamic_cast<
PHCompositeNode
*
>
(dstIter.
findFirst
(
"PHCompositeNode"
, name));
75
if
(!DetNode)
76
{
77
DetNode =
new
PHCompositeNode
(name);
78
dstNode->
addNode
(DetNode);
79
}
80
string
g4hitnodename =
"G4HIT_"
+
name
;
81
PHG4HitContainer
*g4_hits = findNode::getClass<PHG4HitContainer>(DetNode, g4hitnodename);
82
if
(!g4_hits)
83
{
84
g4_hits =
new
PHG4HitContainer
(g4hitnodename);
85
DetNode->addNode(
new
PHIODataNode<PHObject>
(g4_hits, g4hitnodename,
"PHObject"
));
86
}
87
m_SteppingAction
=
new
BeastMagnetSteppingAction
(
m_Detector
,
GetParams
());
88
}
89
return
0;
90
}
91
//_______________________________________________________________________
92
int
BeastMagnetSubsystem::process_event
(
PHCompositeNode
*topNode)
93
{
94
// pass top node to stepping action so that it gets
95
// relevant nodes needed internally
96
if
(
m_SteppingAction
)
97
{
98
m_SteppingAction
->
SetInterfacePointers
(topNode);
99
}
100
return
0;
101
}
102
//_______________________________________________________________________
103
void
BeastMagnetSubsystem::Print
(
const
string
&what)
const
104
{
105
if
(
m_Detector
)
106
{
107
m_Detector
->
Print
(what);
108
}
109
return
;
110
}
111
112
//_______________________________________________________________________
113
PHG4Detector
*
BeastMagnetSubsystem::GetDetector
(
void
)
const
114
{
115
return
m_Detector
;
116
}
117
118
//_______________________________________________________________________
119
void
BeastMagnetSubsystem::SetDefaultParameters
()
120
{
121
// sizes are in cm
122
// angles are in deg
123
// units should be converted to G4 units when used
124
//implement your own here//
125
set_default_double_param
(
"place_x"
, 0.);
126
set_default_double_param
(
"place_y"
, 0.);
127
set_default_double_param
(
"place_z"
, 0.);
128
set_default_double_param
(
"rot_x"
, 0.);
129
set_default_double_param
(
"rot_y"
, 0.);
130
set_default_double_param
(
"rot_z"
, 0.);
131
set_default_double_param
(
"size_x"
, 20.);
132
set_default_double_param
(
"size_y"
, 20.);
133
set_default_double_param
(
"size_z"
, 20.);
134
135
set_default_string_param
(
"GDMPath"
,
"DefaultParameters-InvalidPath"
);
136
set_default_string_param
(
"TopVolName"
,
"DefaultParameters-InvalidVol"
);
137
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4beastmagnet
BeastMagnetSubsystem.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:46
using
1.8.2 with
ECCE GitHub integration