Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zdcLG
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chad Lantz
zdcLG
Commits
5af19d7b
Commit
5af19d7b
authored
4 years ago
by
Chad Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Made things mostly functional
parent
4d5dedd8
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Segmented lg
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/DetectorConstruction.cc
+4
-25
4 additions, 25 deletions
src/DetectorConstruction.cc
src/DetectorMessenger.cc
+15
-1
15 additions, 1 deletion
src/DetectorMessenger.cc
with
19 additions
and
26 deletions
src/DetectorConstruction.cc
+
4
−
25
View file @
5af19d7b
...
...
@@ -88,8 +88,11 @@ DetectorConstruction::DetectorConstruction()
//Set default values
G4double
PhotonEnergy
[
2
]
=
{
0.5
*
eV
,
8.0
*
eV
};
G4double
RefractiveIndexAir
[
2
]
=
{
1.0
,
1.0
};
m_filler
=
G4NistManager
::
Instance
()
->
FindOrBuildMaterial
(
"G4_AIR"
);
m_GasMPT
=
new
G4MaterialPropertiesTable
();
m_GasMPT
->
AddProperty
(
"RINDEX"
,
PhotonEnergy
,
RefractiveIndexAir
,
2
);
m_filler
->
SetMaterialPropertiesTable
(
m_GasMPT
);
#ifdef CADMESH
...
...
@@ -120,6 +123,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct(){
}
else
{
G4UImanager
*
UImanager
=
G4UImanager
::
GetUIpointer
();
UImanager
->
ApplyCommand
(
"/control/execute geometry.mac"
);
BuildPMT
();
}
if
(
!
m_logicWorld
)
BuildWorld
();
...
...
@@ -199,24 +203,11 @@ void DetectorConstruction::BuildWorld(){
* Make the trapezoidal light guide logical volume
*/
void
DetectorConstruction
::
BuildTrapezoidLG
(
){
if
(
m_inner
)
delete
m_inner
;
if
(
m_outter
)
delete
m_outter
;
if
(
m_LightGuide
)
delete
m_LightGuide
;
if
(
m_logicLightGuide
)
delete
m_logicLightGuide
;
//Divide the light guide envelope (cumulative) by the number
//of light guides that will occupy it
G4double
xSize
=
(
m_LGenvelope
->
x
()
/
2.
)
/
m_nSegmentsX
;
G4double
zSize
=
(
m_LGenvelope
->
z
()
/
2.
)
/
m_nSegmentsZ
;
std
::
cout
<<
"envelope z = "
<<
m_LGenvelope
->
x
()
<<
std
::
endl
;
std
::
cout
<<
"xSize = "
<<
xSize
<<
std
::
endl
;
std
::
cout
<<
"x segments = "
<<
m_nSegmentsX
<<
std
::
endl
;
std
::
cout
<<
"envelope z = "
<<
m_LGenvelope
->
z
()
<<
std
::
endl
;
std
::
cout
<<
"zSize = "
<<
zSize
<<
std
::
endl
;
std
::
cout
<<
"z segments = "
<<
m_nSegmentsZ
<<
std
::
endl
;
//Determine the size of the top of the trapezoid so the
//square opening will be inscribed in the window of the PMT
G4double
PMTwindow
=
.707
*
m_pmtDia
/
2.
;
...
...
@@ -250,10 +241,6 @@ void DetectorConstruction::BuildTrapezoidLG( ){
materials
->
Al
,
"BasicLightGuide"
);
//Build the PMT to go along with this light guide
BuildPMT
();
}
...
...
@@ -261,8 +248,6 @@ void DetectorConstruction::BuildTrapezoidLG( ){
* Make the PMT logical volume and Sensitvie Detector
*/
void
DetectorConstruction
::
BuildPMT
(){
if
(
m_solidPMT
)
delete
m_solidPMT
;
if
(
m_logicPMT
)
delete
m_logicPMT
;
G4SDManager
*
SDman
=
G4SDManager
::
GetSDMpointer
();
PMTSD
*
PMT
=
new
PMTSD
(
"MyPMT"
);
...
...
@@ -295,10 +280,6 @@ void DetectorConstruction::PlaceGeometry(){
G4double
yPos
=
m_LGenvelope
->
y
()
/
2.
+
m_LGpos
->
y
()
-
m_worldDim
->
y
()
/
2.
;
G4double
zPos
=
0.
;
std
::
cout
<<
"envelope y = "
<<
m_LGenvelope
->
y
()
<<
std
::
endl
;
std
::
cout
<<
"yPos = "
<<
yPos
<<
std
::
endl
;
std
::
cout
<<
"world y = "
<<
m_worldDim
->
y
()
<<
std
::
endl
;
G4double
PMTx
=
0.
;
G4double
PMTy
=
m_LGenvelope
->
y
()
+
m_pmtPos
->
y
()
+
m_PMTthickness
-
m_worldDim
->
y
()
/
2.
;
G4double
PMTz
=
0.
;
...
...
@@ -546,8 +527,6 @@ void DetectorConstruction::UseCADModel(G4String fileName){
}
//----------------- Build one PMT -----------------//
BuildPMT
();
if
(
m_pmtPos
==
0
)
m_pmtPos
=
new
G4ThreeVector
();
if
(
m_ConstructionHasBeenDone
){
...
...
This diff is collapsed.
Click to expand it.
src/DetectorMessenger.cc
+
15
−
1
View file @
5af19d7b
...
...
@@ -121,6 +121,15 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
fPMTDiameterCmd
->
SetDefaultValue
(
65.0
*
mm
);
fPMTDiameterCmd
->
SetDefaultUnit
(
"mm"
);
fLGThicknessCmd
=
new
G4UIcmdWithADoubleAndUnit
(
"/lightGuide/model/SkinThickness"
,
this
);
fLGThicknessCmd
->
SetGuidance
(
"Set thickness of the light guide skin"
);
fLGThicknessCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Init
,
G4State_Idle
);
fLGThicknessCmd
->
SetToBeBroadcasted
(
false
);
fLGThicknessCmd
->
SetParameterName
(
"thickness"
,
true
);
fLGThicknessCmd
->
SetDefaultValue
(
1.0
*
mm
);
fLGThicknessCmd
->
SetDefaultUnit
(
"mm"
);
fOutputModelCmd
=
new
G4UIcmdWithAString
(
"/lightGuide/model/OutputModel"
,
this
);
fOutputModelCmd
->
SetGuidance
(
"Creates a .gdml file of the light guide with the given name"
);
fOutputModelCmd
->
AvailableForStates
(
G4State_PreInit
,
G4State_Init
,
G4State_Idle
);
...
...
@@ -193,6 +202,7 @@ DetectorMessenger::~DetectorMessenger(){
delete
fModelTranslationCmd
;
delete
fPMTTranslationCmd
;
delete
fPMTDiameterCmd
;
delete
fLGThicknessCmd
;
delete
fOutputModelCmd
;
delete
fNsegmentsXCmd
;
delete
fNsegmentsZCmd
;
...
...
@@ -237,8 +247,12 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
else
if
(
command
==
fPMTDiameterCmd
){
fDetector
->
SetPMTDiameter
(
fPMTDiameterCmd
->
GetNewDoubleValue
(
newValue
));
}
// PMT DIAMETER
else
if
(
command
==
fLGThicknessCmd
){
fDetector
->
SetLGthickness
(
fLGThicknessCmd
->
GetNewDoubleValue
(
newValue
));
}
// OUTPUT GEOMETRY TO GDML
else
if
(
command
==
f
NsegmentsX
Cmd
){
else
if
(
command
==
f
OutputModel
Cmd
){
fDetector
->
OutputToGDML
(
newValue
);
}
// X SEGMENTATION
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment