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
BeamLineMagnetDetector.cc
BeamLineMagnetDetector.h
BeamLineMagnetDisplayAction.cc
BeamLineMagnetDisplayAction.h
BeamLineMagnetSteppingAction.cc
BeamLineMagnetSteppingAction.h
BeamLineMagnetSubsystem.cc
BeamLineMagnetSubsystem.h
PHG4BbcDetector.cc
PHG4BbcDetector.h
PHG4BbcDisplayAction.cc
PHG4BbcDisplayAction.h
PHG4BbcSteppingAction.cc
PHG4BbcSteppingAction.h
PHG4BbcSubsystem.cc
PHG4BbcSubsystem.h
PHG4BeamlineMagnetDetector.cc
PHG4BeamlineMagnetDetector.h
PHG4BeamlineMagnetSubsystem.cc
PHG4BeamlineMagnetSubsystem.h
PHG4BlockCellGeom.cc
PHG4BlockCellGeom.h
PHG4BlockCellGeomContainer.cc
PHG4BlockCellGeomContainer.h
PHG4BlockCellGeomContainerLinkDef.h
PHG4BlockCellGeomLinkDef.h
PHG4BlockCellGeomv1LinkDef.h
PHG4BlockCellReco.cc
PHG4BlockCellReco.h
PHG4BlockDetector.cc
PHG4BlockDetector.h
PHG4BlockDisplayAction.cc
PHG4BlockDisplayAction.h
PHG4BlockGeom.cc
PHG4BlockGeom.h
PHG4BlockGeomContainer.cc
PHG4BlockGeomContainer.h
PHG4BlockGeomContainerLinkDef.h
PHG4BlockGeomLinkDef.h
PHG4BlockGeomv1.cc
PHG4BlockGeomv1.h
PHG4BlockGeomv1LinkDef.h
PHG4BlockSteppingAction.cc
PHG4BlockSteppingAction.h
PHG4BlockSubsystem.cc
PHG4BlockSubsystem.h
PHG4Cell.cc
PHG4Cell.h
PHG4CellContainer.cc
PHG4CellContainer.h
PHG4CellContainerLinkDef.h
PHG4CellDefs.cc
PHG4CellDefs.h
PHG4CellLinkDef.h
PHG4Cellv1.cc
PHG4Cellv1.h
PHG4Cellv1LinkDef.h
PHG4Cellv2LinkDef.h
PHG4CEmcTestBeamDetector.cc
PHG4CEmcTestBeamDetector.h
PHG4CEmcTestBeamSteppingAction.cc
PHG4CEmcTestBeamSteppingAction.h
PHG4CEmcTestBeamSubsystem.cc
PHG4CEmcTestBeamSubsystem.h
PHG4ConeDetector.cc
PHG4ConeDetector.h
PHG4ConeDisplayAction.cc
PHG4ConeDisplayAction.h
PHG4ConeSteppingAction.cc
PHG4ConeSteppingAction.h
PHG4ConeSubsystem.cc
PHG4ConeSubsystem.h
PHG4CylinderCell.h
PHG4CylinderCellContainer.cc
PHG4CylinderCellContainer.h
PHG4CylinderCellContainerLinkDef.h
PHG4CylinderCellDefs.h
PHG4CylinderCellGeom.cc
PHG4CylinderCellGeom.h
PHG4CylinderCellGeom_Spacalv1.cc
PHG4CylinderCellGeom_Spacalv1.h
PHG4CylinderCellGeom_Spacalv1LinkDef.h
PHG4CylinderCellGeomContainer.cc
PHG4CylinderCellGeomContainer.h
PHG4CylinderCellGeomContainerLinkDef.h
PHG4CylinderCellGeomLinkDef.h
PHG4CylinderCellLinkDef.h
PHG4CylinderCellReco.cc
PHG4CylinderCellReco.h
PHG4CylinderCellv1.cc
PHG4CylinderCellv1.h
PHG4CylinderCellv1LinkDef.h
PHG4CylinderCellv2.cc
PHG4CylinderCellv2.h
PHG4CylinderCellv2LinkDef.h
PHG4CylinderCellv3.cc
PHG4CylinderCellv3.h
PHG4CylinderCellv3LinkDef.h
PHG4CylinderDetector.cc
PHG4CylinderDetector.h
PHG4CylinderDisplayAction.cc
PHG4CylinderDisplayAction.h
PHG4CylinderGeom.cc
PHG4CylinderGeom.h
PHG4CylinderGeom_Spacalv1.cc
PHG4CylinderGeom_Spacalv1.h
PHG4CylinderGeom_Spacalv1LinkDef.h
PHG4CylinderGeom_Spacalv2.cc
PHG4CylinderGeom_Spacalv2.h
PHG4CylinderGeom_Spacalv2LinkDef.h
PHG4CylinderGeom_Spacalv3.cc
PHG4CylinderGeom_Spacalv3.h
PHG4CylinderGeom_Spacalv3LinkDef.h
PHG4CylinderGeomContainer.cc
PHG4CylinderGeomContainer.h
PHG4CylinderGeomContainerLinkDef.h
PHG4CylinderGeomLinkDef.h
PHG4CylinderGeomv1.cc
PHG4CylinderGeomv1.h
PHG4CylinderGeomv1LinkDef.h
PHG4CylinderGeomv2.cc
PHG4CylinderGeomv2.h
PHG4CylinderGeomv2LinkDef.h
PHG4CylinderGeomv3.cc
PHG4CylinderGeomv3.h
PHG4CylinderGeomv3LinkDef.h
PHG4CylinderGeomv4.cc
PHG4CylinderGeomv4.h
PHG4CylinderGeomv4LinkDef.h
PHG4CylinderSteppingAction.cc
PHG4CylinderSteppingAction.h
PHG4CylinderSubsystem.cc
PHG4CylinderSubsystem.h
PHG4DetectorGroupSubsystem.cc
PHG4DetectorGroupSubsystem.h
PHG4DetectorSubsystem.cc
PHG4DetectorSubsystem.h
PHG4EnvelopeDetector.cc
PHG4EnvelopeDetector.h
PHG4EnvelopeSteppingAction.cc
PHG4EnvelopeSteppingAction.h
PHG4EnvelopeSubsystem.cc
PHG4EnvelopeSubsystem.h
PHG4EventActionClearZeroEdep.cc
PHG4EventActionClearZeroEdep.h
PHG4FullProjSpacalCellReco.cc
PHG4FullProjSpacalCellReco.h
PHG4FullProjSpacalDetector.cc
PHG4FullProjSpacalDetector.h
PHG4FullProjTiltedSpacalDetector.cc
PHG4FullProjTiltedSpacalDetector.h
PHG4GDMLDetector.cc
PHG4GDMLDetector.h
PHG4GDMLSubsystem.cc
PHG4GDMLSubsystem.h
PHG4GenHit.cc
PHG4GenHit.h
PHG4HcalCellReco.cc
PHG4HcalCellReco.h
PHG4HcalDefs.h
PHG4HcalDetector.cc
PHG4HcalDetector.h
PHG4HcalSteppingAction.cc
PHG4HcalSteppingAction.h
PHG4HcalSubsystem.cc
PHG4HcalSubsystem.h
PHG4InnerHcalDetector.cc
PHG4InnerHcalDetector.h
PHG4InnerHcalDisplayAction.cc
PHG4InnerHcalDisplayAction.h
PHG4InnerHcalSteppingAction.cc
PHG4InnerHcalSteppingAction.h
PHG4InnerHcalSubsystem.cc
PHG4InnerHcalSubsystem.h
PHG4OuterHcalDetector.cc
PHG4OuterHcalDetector.h
PHG4OuterHcalDisplayAction.cc
PHG4OuterHcalDisplayAction.h
PHG4OuterHcalField.cc
PHG4OuterHcalField.h
PHG4OuterHcalFieldSetup.cc
PHG4OuterHcalFieldSetup.h
PHG4OuterHcalSteppingAction.cc
PHG4OuterHcalSteppingAction.h
PHG4OuterHcalSubsystem.cc
PHG4OuterHcalSubsystem.h
PHG4PSTOFDetector.cc
PHG4PSTOFDetector.h
PHG4PSTOFSteppingAction.cc
PHG4PSTOFSteppingAction.h
PHG4PSTOFSubsystem.cc
PHG4PSTOFSubsystem.h
PHG4ScintillatorSlat.h
PHG4ScintillatorSlatContainer.cc
PHG4ScintillatorSlatContainer.h
PHG4ScintillatorSlatContainerLinkDef.h
PHG4ScintillatorSlatDefs.cc
PHG4ScintillatorSlatDefs.h
PHG4ScintillatorSlatDefsLinkDef.h
PHG4ScintillatorSlatLinkDef.h
PHG4ScintillatorSlatv1.cc
PHG4ScintillatorSlatv1.h
PHG4ScintillatorSlatv1LinkDef.h
PHG4SectorConstructor.cc
PHG4SectorConstructor.h
PHG4SectorDetector.cc
PHG4SectorDetector.h
PHG4SectorDisplayAction.cc
PHG4SectorDisplayAction.h
PHG4SectorSteppingAction.cc
PHG4SectorSteppingAction.h
PHG4SectorSubsystem.cc
PHG4SectorSubsystem.h
PHG4SpacalDetector.cc
PHG4SpacalDetector.h
PHG4SpacalDisplayAction.cc
PHG4SpacalDisplayAction.h
PHG4SpacalSteppingAction.cc
PHG4SpacalSteppingAction.h
PHG4SpacalSubsystem.cc
PHG4SpacalSubsystem.h
PHG4StepStatusDecode.cc
PHG4StepStatusDecode.h
PHG4TrackStatusDecode.cc
PHG4TrackStatusDecode.h
PHG4ZDCDefs.h
PHG4ZDCDetector.cc
PHG4ZDCDetector.h
PHG4ZDCDisplayAction.cc
PHG4ZDCDisplayAction.h
PHG4ZDCSteppingAction.cc
PHG4ZDCSteppingAction.h
PHG4ZDCSubsystem.cc
PHG4ZDCSubsystem.h
g4epd
g4eval
g4gdml
g4histos
g4intt
g4jets
g4main
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
PHG4BlockDetector.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4BlockDetector.cc
1
#include "
PHG4BlockDetector.h
"
2
3
#include "
PHG4BlockDisplayAction.h
"
4
5
#include <phparameter/PHParameters.h>
6
7
#include <
g4main/PHG4Detector.h
>
// for PHG4Detector
8
#include <
g4main/PHG4DisplayAction.h
>
// for PHG4DisplayAction
9
#include <
g4main/PHG4Subsystem.h
>
10
11
#include <Geant4/G4Box.hh>
12
#include <Geant4/G4LogicalVolume.hh>
13
#include <Geant4/G4PVPlacement.hh>
14
#include <Geant4/G4RotationMatrix.hh>
// for G4RotationMatrix
15
#include <Geant4/G4String.hh>
// for G4String
16
#include <Geant4/G4SystemOfUnits.hh>
17
#include <Geant4/G4ThreeVector.hh>
// for G4ThreeVector
18
#include <Geant4/G4UserLimits.hh>
19
20
#include <
CLHEP/Units/SystemOfUnits.h
>
// for cm, deg
21
22
#include <cmath>
// for isfinite
23
#include <iostream>
// for operator<<, endl, basic_ostream
24
#include <sstream>
25
26
class
G4Material
;
27
class
G4VSolid
;
28
class
PHCompositeNode
;
29
30
using namespace
std;
31
32
//_______________________________________________________________
33
PHG4BlockDetector::PHG4BlockDetector
(
PHG4Subsystem
*subsys,
PHCompositeNode
*Node,
PHParameters
*
parameters
,
const
std::string &dnam,
const
int
lyr)
34
:
PHG4Detector
(subsys, Node, dnam)
35
, m_Params(parameters)
36
, m_BlockPhysi(nullptr)
37
, m_DisplayAction(dynamic_cast<
PHG4BlockDisplayAction
*>(subsys->GetDisplayAction()))
38
, m_Layer(lyr)
39
{
40
}
41
42
//_______________________________________________________________
43
bool
PHG4BlockDetector::IsInBlock
(
G4VPhysicalVolume
*
volume
)
const
44
{
45
if
(volume ==
m_BlockPhysi
)
46
{
47
return
true
;
48
}
49
return
false
;
50
}
51
52
//_______________________________________________________________
53
void
PHG4BlockDetector::ConstructMe
(
G4LogicalVolume
*logicWorld)
54
{
55
G4Material
*TrackerMaterial =
GetDetectorMaterial
(
m_Params
->
get_string_param
(
"material"
));
56
57
G4VSolid
*block_solid =
new
G4Box
(
G4String
(
GetName
()),
58
m_Params
->
get_double_param
(
"size_x"
) / 2. *
cm
,
59
m_Params
->
get_double_param
(
"size_y"
) / 2. *
cm
,
60
m_Params
->
get_double_param
(
"size_z"
) / 2. *
cm
);
61
62
double
steplimits =
m_Params
->
get_double_param
(
"steplimits"
) *
cm
;
63
G4UserLimits
*g4userlimits =
nullptr
;
64
if
(
isfinite
(steplimits))
65
{
66
g4userlimits =
new
G4UserLimits
(steplimits);
67
}
68
69
G4LogicalVolume
*block_logic =
new
G4LogicalVolume
(block_solid,
70
TrackerMaterial,
71
G4String
(
GetName
()),
72
nullptr
,
nullptr
, g4userlimits);
73
74
PHG4Subsystem
*mysys =
GetMySubsystem
();
75
mysys->
SetLogicalVolume
(block_logic);
76
77
G4RotationMatrix
*rotm =
new
G4RotationMatrix
();
78
int
nRotation(0);
79
if
(
m_Params
->
get_double_param
(
"rot_x"
) !=0 )
80
{
81
++ nRotation;
82
rotm->
rotateX
(
m_Params
->
get_double_param
(
"rot_x"
) *
deg
);
83
}
84
if
(
m_Params
->
get_double_param
(
"rot_y"
) !=0 )
85
{
86
++ nRotation;
87
rotm->
rotateY
(
m_Params
->
get_double_param
(
"rot_y"
) *
deg
);
88
}
89
if
(
m_Params
->
get_double_param
(
"rot_z"
) !=0 )
90
{
91
++ nRotation;
92
rotm->
rotateZ
(
m_Params
->
get_double_param
(
"rot_z"
) *
deg
);
93
}
94
95
if
(nRotation>=2)
96
{
97
cout <<__PRETTY_FUNCTION__<<
": Warning : "
<<
GetName
()<<
" is configured with more than one of the x-y-z rotations of "
98
<<
"("
<<
m_Params
->
get_double_param
(
"rot_x"
)<<
", "
99
<<
m_Params
->
get_double_param
(
"rot_x"
)<<
", "
100
<<
m_Params
->
get_double_param
(
"rot_x"
)<<
") degrees. "
101
<<
"The rotation is instruction is ambiguous and they are performed in the order of X->Y->Z rotations with result rotation matrix of:"
;
102
rotm->
print
(cout);
103
}
104
105
m_BlockPhysi
=
new
G4PVPlacement
(rotm,
G4ThreeVector
(
m_Params
->
get_double_param
(
"place_x"
) *
cm
,
m_Params
->
get_double_param
(
"place_y"
) *
cm
,
m_Params
->
get_double_param
(
"place_z"
) *
cm
),
106
block_logic,
107
G4String
(
GetName
()),
108
logicWorld, 0,
false
,
OverlapCheck
());
109
m_DisplayAction
->
SetMyVolume
(block_logic);
110
}
coresoftware
blob
master
simulation
g4simulation
g4detectors
PHG4BlockDetector.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:40
using
1.8.2 with
ECCE GitHub integration