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
PHG4TpcEndCapDisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4TpcEndCapDisplayAction.cc
1
#include "
PHG4TpcEndCapDisplayAction.h
"
2
3
#include <
g4main/PHG4DisplayAction.h
>
// for PHG4DisplayAction
4
#include <
g4main/PHG4Utils.h
>
5
6
#include <Geant4/G4Colour.hh>
7
#include <Geant4/G4LogicalVolume.hh>
8
#include <Geant4/G4Material.hh>
9
#include <Geant4/G4String.hh>
// for G4String
10
#include <Geant4/G4VisAttributes.hh>
11
12
#include <utility>
// for pair
13
14
PHG4TpcEndCapDisplayAction::PHG4TpcEndCapDisplayAction
(
const
std::string &
name
)
15
:
PHG4DisplayAction
(name)
16
{
17
}
18
19
PHG4TpcEndCapDisplayAction::~PHG4TpcEndCapDisplayAction
()
20
{
21
for
(
auto
&
it
:
m_VisAttVec
)
22
{
23
delete
it
;
24
}
25
m_VisAttVec.clear();
26
}
27
28
void
PHG4TpcEndCapDisplayAction::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
39
G4VisAttributes
*visatt =
new
G4VisAttributes
();
40
visatt->
SetVisibility
(
true
);
41
visatt->
SetForceSolid
(
true
);
42
m_VisAttVec
.push_back(visatt);
// for later deletion
43
44
if
(
it
.second ==
"G10"
or
it
.second ==
"FR4"
)
45
{
46
visatt->
SetColour
(
G4Colour
(0.0, .5, 0.0));
47
}
48
else
if
(
it
.second ==
"wagon_wheel"
)
49
{
50
visatt->
SetColour
(
G4Colour
(.8, 0.0, 0.0));
51
visatt->
SetForceLineSegmentsPerCircle
(100);
52
}
53
else
if
(
it
.second ==
"cooling_block"
)
54
{
55
visatt->
SetColour
(
G4Colour
(.8, .8, .8));
56
visatt->
SetForceLineSegmentsPerCircle
(100);
57
}
58
else
59
{
60
PHG4Utils::SetColour
(visatt,
it
.first->GetMaterial()->GetName());
61
}
62
logvol->
SetVisAttributes
(visatt);
63
}
64
return
;
65
}
coresoftware
blob
master
simulation
g4simulation
g4tpc
PHG4TpcEndCapDisplayAction.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:45
using
1.8.2 with
ECCE GitHub integration