Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PHG4MicromegasDisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4MicromegasDisplayAction.cc
1
#include "
PHG4MicromegasDisplayAction.h
"
2
3
#include <
g4main/PHG4DisplayAction.h
>
// for PHG4DisplayAction
4
5
#include <Geant4/G4Color.hh>
6
#include <Geant4/G4LogicalVolume.hh>
7
#include <Geant4/G4VisAttributes.hh>
8
9
#include <iostream>
// for operator<<, basic_ostream, endl
10
#include <string>
11
#include <utility>
// for pair
12
13
PHG4MicromegasDisplayAction::PHG4MicromegasDisplayAction
(
const
std::string
&
name
)
14
:
PHG4DisplayAction
(name)
15
{
16
}
17
18
PHG4MicromegasDisplayAction::~PHG4MicromegasDisplayAction
()
19
{
20
for
(
auto
&
it
:
m_VisAttVec
)
21
{
22
delete
it
;
23
}
24
m_VisAttVec.clear();
25
}
26
27
void
PHG4MicromegasDisplayAction::ApplyDisplayAction
(
G4VPhysicalVolume
*
/*physvol*/
)
28
{
29
for
(
auto
it
:
m_LogicalVolumeMap
)
30
{
31
G4LogicalVolume *logvol =
it
.first;
32
if
(logvol->GetVisAttributes())
33
{
34
continue
;
35
}
36
G4VisAttributes *visatt =
new
G4VisAttributes();
37
visatt->SetVisibility(
true
);
38
visatt->SetForceSolid(
true
);
39
m_VisAttVec
.push_back(visatt);
// for later deletion
40
if
(
it
.first->GetName().find(
"invisible"
) != std::string::npos)
41
{
42
visatt->SetColour(
it
.second);
43
visatt->SetVisibility(
false
);
44
}
45
else
46
{
47
visatt->SetColour(
it
.second);
48
}
49
logvol->SetVisAttributes(visatt);
50
}
51
return
;
52
}
coresoftware
blob
master
simulation
g4simulation
g4micromegas
PHG4MicromegasDisplayAction.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:15
using
1.8.2 with
sPHENIX GitHub integration