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
g4bwd
g4drcalo
g4drich
g4eiccalos
g4eicdirc
g4etof
g4jleic
g4lblvtx
g4lumi
g4mrich
g4rich
ePHENIXRICHConstruction.cc
ePHENIXRICHConstruction.h
PHG4RICHDetector.cc
PHG4RICHDetector.h
PHG4RICHDisplayAction.cc
PHG4RICHDisplayAction.h
PHG4RICHSteppingAction.cc
PHG4RICHSteppingAction.h
PHG4RICHSubsystem.cc
PHG4RICHSubsystem.h
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
PHG4RICHDisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4RICHDisplayAction.cc
1
#include "
PHG4RICHDisplayAction.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
using namespace
std;
15
16
PHG4RICHDisplayAction::PHG4RICHDisplayAction
(
const
std::string &
name
)
17
:
PHG4DisplayAction
(name)
18
{
19
}
20
21
PHG4RICHDisplayAction::~PHG4RICHDisplayAction
()
22
{
23
for
(
auto
&
it
:
m_VisAttVec
)
24
{
25
delete
it
;
26
}
27
m_VisAttVec.clear();
28
}
29
30
void
PHG4RICHDisplayAction::ApplyDisplayAction
(
G4VPhysicalVolume
*physvol)
31
{
32
// check if vis attributes exist, if so someone else has set them and we do nothing
33
for
(
auto
it
:
m_LogicalVolumeMap
)
34
{
35
G4LogicalVolume
*logvol =
it
.first;
36
if
(logvol->
GetVisAttributes
())
37
{
38
continue
;
39
}
40
G4VisAttributes
*visatt =
new
G4VisAttributes
();
41
visatt->
SetVisibility
(
true
);
42
visatt->
SetForceSolid
(
true
);
43
m_VisAttVec
.push_back(visatt);
// for later deletion
44
if
(
it
.second ==
"HBD"
)
45
{
46
visatt->
SetColour
(
G4Colour::Red
());
47
}
48
else
if
(
it
.second ==
"Mirror"
)
49
{
50
visatt->
SetColour
(
G4Colour::Green
());
51
visatt->
SetForceLineSegmentsPerCircle
(50);
52
}
53
else
if
(
it
.second ==
"Sector"
)
54
{
55
visatt->
SetColour
(
G4Colour::White
());
56
visatt->
SetForceWireframe
(
true
);
57
visatt->
SetForceLineSegmentsPerCircle
(50);
58
}
59
else
if
(
it
.second ==
"Window"
)
60
{
61
visatt->
SetColour
(
G4Colour::Yellow
());
62
visatt->
SetForceLineSegmentsPerCircle
(50);
63
}
64
else
65
{
66
cout <<
"unknown logical volume "
<<
it
.second << endl;
67
gSystem->Exit(1);
68
}
69
logvol->
SetVisAttributes
(visatt);
70
}
71
return
;
72
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4rich
PHG4RICHDisplayAction.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:48
using
1.8.2 with
ECCE GitHub integration