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
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
analysis
coresoftware
blob
master
calibrations
generators
offline
simulation
g4simulation
EICPhysicsList
g4bbc
g4calo
g4centrality
g4decayer
g4detectors
g4epd
g4eval
g4gdml
g4histos
g4intt
g4jets
g4main
EicEventHeader.cc
EicEventHeader.h
EicEventHeaderLinkDef.h
EicEventHeaderv1.cc
EicEventHeaderv1.h
EicEventHeaderv1LinkDef.h
Fun4AllDstPileupInputManager.cc
Fun4AllDstPileupInputManager.h
Fun4AllDstPileupMerger.cc
Fun4AllDstPileupMerger.h
Fun4AllMessenger.cc
Fun4AllMessenger.h
Fun4AllSingleDstPileupInputManager.cc
Fun4AllSingleDstPileupInputManager.h
G4TBFieldMessenger.cc
G4TBFieldMessenger.hh
G4TBMagneticFieldSetup.cc
G4TBMagneticFieldSetup.hh
HepMCCompress.cc
HepMCCompress.h
HepMCNodeReader.cc
HepMCNodeReader.h
PHBBox.h
PHG4ColorDefs.h
PHG4ConsistencyCheck.cc
PHG4ConsistencyCheck.h
PHG4Detector.cc
PHG4Detector.h
PHG4DisplayAction.cc
PHG4DisplayAction.h
PHG4EtaParameterization.cc
PHG4EtaParameterization.h
PHG4EtaPhiParameterization.cc
PHG4EtaPhiParameterization.h
PHG4EventAction.h
PHG4EventHeader.h
PHG4EventHeaderLinkDef.h
PHG4EventHeaderv1.cc
PHG4EventHeaderv1.h
PHG4EventHeaderv1LinkDef.h
PHG4HeadReco.cc
PHG4HeadReco.h
PHG4Hit.cc
PHG4Hit.h
PHG4HitContainer.cc
PHG4HitContainer.h
PHG4HitContainerLinkDef.h
PHG4HitDefs.cc
PHG4HitDefs.h
PHG4HitEval.cc
PHG4HitEval.h
PHG4HitEvalLinkDef.h
PHG4HitLinkDef.h
PHG4HitReadBack.cc
PHG4HitReadBack.h
PHG4Hitv1.cc
PHG4Hitv1.h
PHG4Hitv1LinkDef.h
PHG4InEvent.cc
PHG4InEvent.h
PHG4InEventCompress.cc
PHG4InEventCompress.h
PHG4InEventLinkDef.h
PHG4InEventReadBack.cc
PHG4InEventReadBack.h
PHG4InputFilter.cc
PHG4InputFilter.h
PHG4IonGun.cc
PHG4IonGun.h
PHG4MagneticField.cc
PHG4MagneticField.h
PHG4Particle.cc
PHG4Particle.h
PHG4ParticleGenerator.cc
PHG4ParticleGenerator.h
PHG4ParticleGeneratorBase.cc
PHG4ParticleGeneratorBase.h
PHG4ParticleGeneratorD0.cc
PHG4ParticleGeneratorD0.h
PHG4ParticleGeneratorVectorMeson.cc
PHG4ParticleGeneratorVectorMeson.h
PHG4ParticleGun.cc
PHG4ParticleGun.h
PHG4ParticleLinkDef.h
PHG4Particlev1.cc
PHG4Particlev1.h
PHG4Particlev1LinkDef.h
PHG4Particlev2.cc
PHG4Particlev2.h
PHG4Particlev2LinkDef.h
PHG4Particlev3.cc
PHG4Particlev3.h
PHG4Particlev3LinkDef.h
PHG4PhenixDetector.cc
PHG4PhenixDetector.h
PHG4PhenixDisplayAction.cc
PHG4PhenixDisplayAction.h
PHG4PhenixEventAction.cc
PHG4PhenixEventAction.h
PHG4PhenixStackingAction.cc
PHG4PhenixStackingAction.h
PHG4PhenixSteppingAction.cc
PHG4PhenixSteppingAction.h
PHG4PhenixTrackingAction.cc
PHG4PhenixTrackingAction.h
PHG4PileupGenerator.cc
PHG4PileupGenerator.h
PHG4PrimaryGeneratorAction.cc
PHG4PrimaryGeneratorAction.h
PHG4Reco.cc
PHG4Reco.h
PHG4RegionInformation.cc
PHG4RegionInformation.h
PHG4ScoringManager.cc
PHG4ScoringManager.h
PHG4Shower.cc
PHG4Shower.h
PHG4ShowerLinkDef.h
PHG4Showerv1.cc
PHG4Showerv1.h
PHG4Showerv1LinkDef.h
PHG4SimpleEventGenerator.cc
PHG4SimpleEventGenerator.h
PHG4StackingAction.cc
PHG4StackingAction.h
PHG4SteppingAction.cc
PHG4SteppingAction.h
PHG4Subsystem.cc
PHG4Subsystem.h
PHG4TrackingAction.h
PHG4TrackUserInfoV1.cc
PHG4TrackUserInfoV1.h
PHG4TruthEventAction.cc
PHG4TruthEventAction.h
PHG4TruthInfoContainer.cc
PHG4TruthInfoContainer.h
PHG4TruthInfoContainerLinkDef.h
PHG4TruthSubsystem.cc
PHG4TruthSubsystem.h
PHG4TruthTrackingAction.cc
PHG4TruthTrackingAction.h
PHG4UIsession.cc
PHG4UIsession.h
PHG4Units.h
PHG4UserPrimaryParticleInformation.h
PHG4Utils.cc
PHG4Utils.h
PHG4VertexSelection.cc
PHG4VertexSelection.h
PHG4VtxPoint.cc
PHG4VtxPoint.h
PHG4VtxPointLinkDef.h
PHG4VtxPointv1.cc
PHG4VtxPointv1.h
PHG4VtxPointv1LinkDef.h
ReadEICFiles.cc
ReadEICFiles.h
g4micromegas
g4mvtx
g4tpc
g4trackfastsim
g4vertex
tpcresponse
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
macros
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PHG4Detector.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4Detector.cc
1
#include "
PHG4Detector.h
"
2
3
#include "
PHG4Subsystem.h
"
4
5
#include <TSystem.h>
6
7
#include <Geant4/G4Colour.hh>
// for G4Colour
8
#include <Geant4/G4LogicalVolume.hh>
9
#include <Geant4/G4Material.hh>
10
#include <Geant4/G4NistManager.hh>
11
#include <Geant4/G4PVPlacement.hh>
12
#include <Geant4/G4RotationMatrix.hh>
// for G4RotationMatrix
13
#include <Geant4/G4ThreeVector.hh>
// for G4ThreeVector
14
#include <Geant4/G4VisAttributes.hh>
15
16
#include <boost/stacktrace.hpp>
17
18
PHG4Detector::PHG4Detector
(
PHG4Subsystem
*subsys,
PHCompositeNode
*Node,
const
std::string &nam)
19
: m_topNode(Node)
20
, m_MySubsystem(subsys)
21
, m_Name(nam)
22
{
23
}
24
25
void
PHG4Detector::Construct
(
G4LogicalVolume
*
world
)
26
{
27
PHG4Subsystem
*MyMotherSubsystem =
m_MySubsystem
->
GetMotherSubsystem
();
28
if
(MyMotherSubsystem)
29
{
30
ConstructMe
(MyMotherSubsystem->
GetLogicalVolume
());
31
}
32
else
33
{
34
ConstructMe
(world);
35
}
36
return
;
37
}
38
39
int
PHG4Detector::DisplayVolume
(
G4VSolid
*
volume
,
G4LogicalVolume
*logvol,
G4RotationMatrix
*rotm)
40
{
41
G4LogicalVolume
*checksolid =
new
G4LogicalVolume
(volume,
G4Material::GetMaterial
(
"G4_POLYSTYRENE"
),
"DISPLAYLOGICAL"
, 0, 0, 0);
42
int
iret =
DisplayVolume
(checksolid, logvol, rotm);
43
return
iret;
44
}
45
46
int
PHG4Detector::DisplayVolume
(
G4LogicalVolume
*checksolid,
G4LogicalVolume
*logvol,
G4RotationMatrix
*rotm)
47
{
48
G4VisAttributes
*visattchk =
new
G4VisAttributes
();
49
visattchk->
SetVisibility
(
true
);
50
visattchk->
SetForceSolid
(
false
);
51
switch
(
m_ColorIndex
)
52
{
53
case
0:
54
visattchk->
SetColour
(
G4Colour::Red
());
55
m_ColorIndex
++;
56
break
;
57
case
1:
58
visattchk->
SetColour
(
G4Colour::Magenta
());
59
m_ColorIndex
++;
60
break
;
61
case
2:
62
visattchk->
SetColour
(
G4Colour::Yellow
());
63
m_ColorIndex
++;
64
break
;
65
case
3:
66
visattchk->
SetColour
(
G4Colour::Blue
());
67
m_ColorIndex
++;
68
break
;
69
case
4:
70
visattchk->
SetColour
(
G4Colour::Cyan
());
71
m_ColorIndex
++;
72
break
;
73
default
:
74
visattchk->
SetColour
(
G4Colour::Green
());
75
m_ColorIndex
= 0;
76
break
;
77
}
78
79
checksolid->
SetVisAttributes
(visattchk);
80
new
G4PVPlacement
(rotm,
G4ThreeVector
(0, 0, 0), checksolid,
"DISPLAYVOL"
, logvol, 0,
false
,
true
);
81
return
0;
82
}
83
84
G4Material
*
PHG4Detector::GetDetectorMaterial
(
const
std::string &
name
,
const
bool
quit)
85
{
86
G4Material
*thismaterial =
G4Material::GetMaterial
(name,
false
);
87
if
(thismaterial)
88
{
89
return
thismaterial;
90
}
91
thismaterial =
G4NistManager::Instance
()->
FindOrBuildMaterial
(name);
92
if
(!thismaterial)
93
{
94
if
(!quit)
95
{
96
return
nullptr
;
97
}
98
std::cout <<
"PHG4Detector::GetDetectorMaterial: Could not locate "
<< name <<
" in NIST DB or create it"
<< std::endl;
99
std::cout << boost::stacktrace::stacktrace();
100
std::cout << std::endl;
101
std::cout <<
"read the above stack trace who is calling this material"
<< std::endl;
102
gSystem->Exit(1);
103
exit
(1);
// so coverity gets it
104
}
105
return
thismaterial;
106
}
107
108
109
G4Element
*
PHG4Detector::GetDetectorElement
(
const
std::string &
name
,
const
bool
quit)
110
{
111
G4Element
*thiselement =
G4Element::GetElement
(name,
false
);
112
if
(thiselement)
113
{
114
return
thiselement;
115
}
116
thiselement =
G4NistManager::Instance
()->
FindOrBuildElement
(name);
117
if
(!thiselement)
118
{
119
if
(!quit)
120
{
121
return
nullptr
;
122
}
123
std::cout <<
"PHG4Detector::GetDetectorElement: Could not locate "
<< name <<
" in NIST DB or create it"
<< std::endl;
124
std::cout << boost::stacktrace::stacktrace();
125
std::cout << std::endl;
126
std::cout <<
"read the above stack trace who is calling this material"
<< std::endl;
127
gSystem->Exit(1);
128
exit
(1);
// so coverity gets it
129
}
130
return
thiselement;
131
}
coresoftware
blob
master
simulation
g4simulation
g4main
PHG4Detector.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:43
using
1.8.2 with
ECCE GitHub integration