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
PHG4BarrelEcalDisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4BarrelEcalDisplayAction.cc
1
#include "
PHG4BarrelEcalDisplayAction.h
"
2
3
#include <
g4main/PHG4DisplayAction.h
>
// for PHG4DisplayAction
4
5
#include <Geant4/G4Colour.hh>
6
#include <Geant4/G4LogicalVolume.hh>
7
#include <Geant4/G4VisAttributes.hh>
8
9
#include <TSystem.h>
10
11
#include <iostream>
12
#include <utility>
// for pair
13
14
PHG4BarrelEcalDisplayAction::PHG4BarrelEcalDisplayAction
(
const
std::string &
name
)
15
:
PHG4DisplayAction
(name)
16
{
17
}
18
19
PHG4BarrelEcalDisplayAction::~PHG4BarrelEcalDisplayAction
()
20
{
21
for
(
auto
&
it
:
m_VisAttVec
)
22
{
23
delete
it
;
24
}
25
m_VisAttVec.clear();
26
}
27
28
void
PHG4BarrelEcalDisplayAction::ApplyDisplayAction
(
G4VPhysicalVolume
*physvol)
29
{
30
// check if vis attributes exist, if so someone else has set them and we do nothing
31
for
(
auto
it
:
m_LogicalVolumeMap
)
32
{
33
G4LogicalVolume
*logvol =
it
.first;
34
if
(logvol->
GetVisAttributes
())
35
{
36
continue
;
37
}
38
G4VisAttributes
*visatt =
new
G4VisAttributes
();
39
visatt->
SetVisibility
(
true
);
40
visatt->
SetForceSolid
(
true
);
41
m_VisAttVec
.push_back(visatt);
// for later deletion
42
if
(
it
.second ==
"BCalCylinder"
)
43
{
44
visatt->
SetColour
(
G4Colour::White
());
45
visatt->
SetForceWireframe
(
true
);
46
visatt->
SetVisibility
(
false
);
47
}
48
else
if
(
it
.second ==
"Block1"
)
49
{
50
visatt->
SetColour
(
G4Colour
(1., 0.5, 0.));
51
}
52
else
if
(
it
.second ==
"Block2"
)
53
{
54
visatt->
SetColour
(
G4Colour::Blue
());
55
}
56
else
if
(
it
.second ==
"Glass"
)
57
{
58
visatt->
SetColour
(
G4Colour::White
());
59
//visatt->SetForceWireframe(true);
60
}
61
else
if
(
it
.second ==
"Si"
)
62
{
63
visatt->
SetColour
(
G4Colour::Green
());
64
}
65
else
if
(
it
.second ==
"Kapton"
)
66
{
67
visatt->
SetColour
(
G4Colour::Brown
());
68
}
69
else
if
(
it
.second ==
"SIO2"
)
70
{
71
visatt->
SetColour
(
G4Colour::Gray
());
72
}
73
else
if
(
it
.second ==
"Carbon"
)
74
{
75
visatt->
SetColour
(
G4Colour::Black
());
76
}
77
else
78
{
79
std::cout <<
"unknown logical volume "
<<
it
.second << std::endl;
80
gSystem->Exit(1);
81
}
82
logvol->
SetVisAttributes
(visatt);
83
}
84
return
;
85
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4eiccalos
PHG4BarrelEcalDisplayAction.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:46
using
1.8.2 with
ECCE GitHub integration