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
blob
master
calibrations
generators
offline
simulation
g4simulation
EICPhysicsList
g4bbc
g4calo
g4centrality
g4decayer
g4detectors
g4epd
g4eval
g4gdml
g4histos
g4intt
g4jets
g4main
g4micromegas
g4mvtx
PHG4EICMvtxDetector.cc
PHG4EICMvtxDetector.h
PHG4EICMvtxSteppingAction.cc
PHG4EICMvtxSteppingAction.h
PHG4EICMvtxSubsystem.cc
PHG4EICMvtxSubsystem.h
PHG4MvtxDefs.h
PHG4MvtxDetector.cc
PHG4MvtxDetector.h
PHG4MvtxDigitizer.cc
PHG4MvtxDigitizer.h
PHG4MvtxDisplayAction.cc
PHG4MvtxDisplayAction.h
PHG4MvtxHitReco.cc
PHG4MvtxHitReco.h
PHG4MvtxSteppingAction.cc
PHG4MvtxSteppingAction.h
PHG4MvtxSubsystem.cc
PHG4MvtxSubsystem.h
g4tpc
g4trackfastsim
g4vertex
tpcresponse
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
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
PHG4MvtxDisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4MvtxDisplayAction.cc
1
#include "
PHG4MvtxDisplayAction.h
"
2
3
#include "
g4main/PHG4DisplayAction.h
"
// for PHG4DisplayAction
4
#include <
g4main/PHG4Utils.h
>
5
6
#include <Geant4/G4LogicalVolume.hh>
7
#include <Geant4/G4VisAttributes.hh>
8
9
#include <utility>
// for pair
10
11
using namespace
std;
12
13
PHG4MvtxDisplayAction::PHG4MvtxDisplayAction
(
const
std::string &
name
)
14
:
PHG4DisplayAction
(name)
15
{
16
}
17
18
PHG4MvtxDisplayAction::~PHG4MvtxDisplayAction
()
19
{
20
for
(
auto
&
it
:
m_VisAttVec
)
21
{
22
delete
it
;
23
}
24
m_VisAttVec.clear();
25
}
26
27
void
PHG4MvtxDisplayAction::ApplyDisplayAction
(
G4VPhysicalVolume
*
/*physvol*/
)
28
{
29
// check if vis attributes exist, if so someone else has set them and we do nothing
30
for
(
auto
it
:
m_LogicalVolumeMap
)
31
{
32
G4LogicalVolume
*logvol =
it
.first;
33
if
(logvol->
GetVisAttributes
())
34
{
35
continue
;
36
}
37
G4VisAttributes
*visatt =
new
G4VisAttributes
();
38
m_VisAttVec
.push_back(visatt);
// for later deletion
39
if
(
it
.second ==
"Carbon"
)
40
{
41
visatt->
SetColour
(0.5, 0.5, 0.5, .25);
42
}
43
else
if
(
it
.second ==
"M60J3K"
)
44
{
45
visatt->
SetColour
(0.25, 0.25, 0.25, .25);
46
}
47
else
if
(
it
.second ==
"WATER"
)
48
{
49
visatt->
SetColour
(0.0, 0.5, 0.0, .25);
50
}
51
else
if
(
it
.second ==
"SI"
)
52
{
53
PHG4Utils::SetColour
(visatt,
"G4_Si"
);
54
}
55
else
if
(
it
.second ==
"KAPTON"
)
56
{
57
PHG4Utils::SetColour
(visatt,
"G4_KAPTON"
);
58
}
59
else
if
(
it
.second ==
"ALUMINUM"
)
60
{
61
PHG4Utils::SetColour
(visatt,
"G4_Al"
);
62
}
63
else
64
{
65
visatt->
SetColour
(.2, .2, .7, .25);
66
}
67
visatt->
SetVisibility
(
true
);
68
visatt->
SetForceSolid
(
true
);
69
logvol->
SetVisAttributes
(visatt);
70
}
71
return
;
72
}
coresoftware
blob
master
simulation
g4simulation
g4mvtx
PHG4MvtxDisplayAction.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:44
using
1.8.2 with
ECCE GitHub integration