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
PHG4PhenixDisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4PhenixDisplayAction.cc
1
#include "
PHG4PhenixDisplayAction.h
"
2
3
#include <Geant4/G4LogicalVolume.hh>
4
#include <Geant4/G4VisAttributes.hh>
5
6
#include <TSystem.h>
7
8
#include <iostream>
9
#include <utility>
// for pair
10
11
using namespace
std;
12
13
PHG4PhenixDisplayAction::PHG4PhenixDisplayAction
(
const
std::string &
name
)
14
:
PHG4DisplayAction
(name)
15
{
16
}
17
18
PHG4PhenixDisplayAction::~PHG4PhenixDisplayAction
()
19
{
20
for
(
auto
&
it
:
m_VisAttVec
)
21
{
22
delete
it
;
23
}
24
m_VisAttVec.clear();
25
}
26
27
void
PHG4PhenixDisplayAction::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 ==
"World"
)
40
{
41
visatt->
SetVisibility
(
false
);
42
}
43
else
44
{
45
cout <<
"unknown logical volume "
<<
it
.second << endl;
46
gSystem->Exit(1);
47
}
48
logvol->
SetVisAttributes
(visatt);
49
}
50
return
;
51
}
coresoftware
blob
master
simulation
g4simulation
g4main
PHG4PhenixDisplayAction.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:44
using
1.8.2 with
ECCE GitHub integration