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
BeastMagnetDisplayAction.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file BeastMagnetDisplayAction.cc
1
#include "
BeastMagnetDisplayAction.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/G4VisAttributes.hh>
9
10
#include <cmath>
// for isfinite
11
12
using namespace
std;
13
14
BeastMagnetDisplayAction::BeastMagnetDisplayAction
(
const
std::string &
name
)
15
:
PHG4DisplayAction
(name)
16
, m_MyVolume(nullptr)
17
{
18
}
19
20
BeastMagnetDisplayAction::~BeastMagnetDisplayAction
()
21
{
22
for
(
auto
&
it
:
m_VisAttVec
)
23
{
24
delete
it
;
25
}
26
m_VisAttVec.clear();
27
m_LogVolSet
.clear();
28
}
29
30
void
BeastMagnetDisplayAction::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_LogVolSet
)
34
{
35
if
(
it
->GetVisAttributes())
36
{
37
continue
;
38
}
39
G4VisAttributes
*VisAtt =
new
G4VisAttributes
();
40
m_VisAttVec
.push_back(VisAtt);
41
VisAtt->
SetVisibility
(
true
);
42
VisAtt->
SetForceSolid
(
true
);
43
if
(
it
->GetName().find(
"Coil"
) != string::npos)
44
{
45
VisAtt->
SetColour
(
G4Colour::Cyan
());
46
}
47
else
if
(
it
->GetName().find(
"CryostatHe"
) != string::npos)
48
{
49
VisAtt->
SetColour
(
G4Colour::Blue
());
50
}
51
else
if
(
it
->GetName().find(
"CryostatAl"
) != string::npos)
52
{
53
VisAtt->
SetColour
(
G4Colour::Green
());
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
g4beastmagnet
BeastMagnetDisplayAction.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:46
using
1.8.2 with
ECCE GitHub integration