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
AllSi_Al_support_DisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file AllSi_Al_support_DisplayAction.cc
1
#include "
AllSi_Al_support_DisplayAction.h
"
2
3
#include <
g4main/PHG4DisplayAction.h
>
4
#include <
g4main/PHG4Utils.h
>
5
6
#include <Geant4/G4Colour.hh>
// for G4Colour
7
#include <Geant4/G4LogicalVolume.hh>
8
#include <Geant4/G4Material.hh>
9
#include <Geant4/G4VisAttributes.hh>
10
11
#include <cmath>
// for isfinite
12
13
using namespace
std;
14
15
AllSi_Al_support_DisplayAction::AllSi_Al_support_DisplayAction
(
const
std::string &
name
)
16
:
PHG4DisplayAction
(name)
17
, m_MyVolume(nullptr)
18
{
19
}
20
21
AllSi_Al_support_DisplayAction::~AllSi_Al_support_DisplayAction
()
22
{
23
for
(
auto
&
it
:
m_VisAttVec
)
24
{
25
delete
it
;
26
}
27
m_VisAttVec.clear();
28
m_LogVolSet
.clear();
29
}
30
31
void
AllSi_Al_support_DisplayAction::ApplyDisplayAction
(
G4VPhysicalVolume
*physvol)
32
{
33
// check if vis attributes exist, if so someone else has set them and we do nothing
34
for
(
auto
&
it
:
m_LogVolSet
)
35
{
36
if
(
it
->GetVisAttributes())
37
{
38
continue
;
39
}
40
41
// cout << "mat: " << it->GetMaterial()->GetName() << endl;
42
G4VisAttributes
*VisAtt =
new
G4VisAttributes
();
43
m_VisAttVec
.push_back(VisAtt);
44
VisAtt->
SetVisibility
(
true
);
45
VisAtt->
SetForceSolid
(
true
);
46
if
(
it
->GetMaterial()->GetName().find(
"air"
) != string::npos)
47
{
48
VisAtt->
SetVisibility
(
false
);
49
VisAtt->
SetForceSolid
(
false
);
50
}
51
else
if
(
it
->GetMaterial()->GetName().find(
"aluminum"
) != string::npos)
52
{
53
VisAtt->
SetColour
(
G4Colour::Yellow
());
54
}
55
else
56
{
57
VisAtt->
SetColour
(
G4Colour::Red
());
58
}
59
60
it
->SetVisAttributes(VisAtt);
61
}
62
return
;
63
}
fun4all_eicdetectors
blob
master
simulation
g4simulation
g4lblvtx
AllSi_Al_support_DisplayAction.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:47
using
1.8.2 with
ECCE GitHub integration