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
PHG4SectorDisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4SectorDisplayAction.cc
1
#include "
PHG4SectorDisplayAction.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 <TSystem.h>
13
14
#include <iostream>
15
#include <utility>
// for pair
16
17
using namespace
std;
18
19
PHG4SectorDisplayAction::PHG4SectorDisplayAction
(
const
std::string &
name
)
20
:
PHG4DisplayAction
(name)
21
{
22
}
23
24
PHG4SectorDisplayAction::~PHG4SectorDisplayAction
()
25
{
26
for
(
auto
&
it
:
m_VisAttVec
)
27
{
28
delete
it
;
29
}
30
m_VisAttVec.clear();
31
}
32
33
void
PHG4SectorDisplayAction::ApplyDisplayAction
(
G4VPhysicalVolume
*
/*physvol*/
)
34
{
35
// check if vis attributes exist, if so someone else has set them and we do nothing
36
for
(
auto
it
:
m_LogicalVolumeMap
)
37
{
38
G4LogicalVolume
*logvol =
it
.first;
39
if
(logvol->
GetVisAttributes
())
40
{
41
continue
;
42
}
43
G4VisAttributes
*visatt =
new
G4VisAttributes
();
44
visatt->
SetVisibility
(
true
);
45
visatt->
SetForceSolid
(
true
);
46
m_VisAttVec
.push_back(visatt);
// for later deletion
47
if
(
it
.second ==
"SectorDetector"
)
48
{
49
PHG4Utils::SetColour
(visatt,
it
.first->GetMaterial()->GetName());
50
}
51
else
if
(
it
.second ==
"DetectorBox"
)
52
{
53
visatt->
SetColour
(
G4Colour::White
());
54
visatt->
SetForceWireframe
(
true
);
55
visatt->
SetForceLineSegmentsPerCircle
(50);
56
}
57
else
58
{
59
cout <<
"unknown logical volume "
<<
it
.second << endl;
60
gSystem->Exit(1);
61
}
62
logvol->
SetVisAttributes
(visatt);
63
}
64
return
;
65
}
coresoftware
blob
master
simulation
g4simulation
g4detectors
PHG4SectorDisplayAction.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:41
using
1.8.2 with
ECCE GitHub integration