Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
+602
View File
@@ -0,0 +1,602 @@
//$Id$
///\file "optical/LXe/.README"
///\brief Example LXe README page
/*! \page ExampleLXe Example LXe
\section LXe_s1 Geometry
The way the geometry is constructed is an experiment for a new, more object
oriented, way to construct geometry. It seperates the concept of how a volume
is built from where it is placed. Each major volume in the geometry is defined
as a class derived from G4PVPlacement. In this example, just the main LXe
volume, the WLS scintillator slab, and the WLS fibers were chosen. To place
one of these volumes, simply create an instance of it with the appropriate
rotation, translation, and mother volumes.
\verbatim
LXeMainVolume(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c);
\endverbatim
Also necessary are the pMany and pCopyNo variables with the same usage as in
G4PVPlacement. Additionally, the detector construction must be passed to the
main volume as a way to communicate the many parameters to the volume and its
sub-volumes. The communication is done from the CopyValues() function which
retrieves the information from the detector constructor.
Notably, the name and logical volume parameters are no longer part of the
constructor. This is because they are both to be decided by the volume itself.
The volume must specify its own name and a temporary logical volume. The
constructor will then procede to define its logical volume in the normal way.
Once complete, the logical volume can be assigned to the physical volume using
the SetLogicalVolume() function.
To handle instances of the same type of volume, a new logical volume should not
be defined for each one. Instead, the logical volume is kept as a static member
and defined only once.
\verbatim
if(!fHousing_log || fUpdated){
//...
//Define logical volume
//...
}
SetLogicalVolume(fHousing_log);
\endverbatim
\subsection LXe_subs11 Modifying the geometry at runtime
This example allows the user to modify the geometry definition at runtime. This
is accomplished through LXeDetectorMessenger, a derived class of G4UImessenger.
The commands it adds change variables stored in LXeDetectorConstructor that
are used when constructing the geometry. After changing these variables
the /LXe/detector/update command must be issued to reconstruct the geometry
with the new values.
\verbatim
void LXeDetectorConstruction::UpdateGeometry(){
// clean-up previous geometry
G4SolidStore::GetInstance()->Clean();
G4LogicalVolumeStore::GetInstance()->Clean();
G4PhysicalVolumeStore::GetInstance()->Clean();
//define new one
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector());
G4RunManager::GetRunManager()->GeometryHasBeenModified();
}
\endverbatim
\section LXe_s2 PMT sensitive detector
The PMT sensitive detector cannot be triggered like a normal sensitive detector
because the sensitive volume does not allow photons to pass through it. Rather,
it detects them in the OpBoundary process based on an efficiency set on the
skin of the volume.
\verbatim
G4OpticalSurface* photocath_opsurf=
new G4OpticalSurface("photocath_opsurf",glisur,polished,
dielectric_metal);
G4double photocath_EFF[num]={1.,1.};
G4double photocath_REFL[num]={0.,0.};
G4MaterialPropertiesTable* photocath_mt = new G4MaterialPropertiesTable();
photocath_mt->AddProperty("EFFICIENCY",Ephoton,photocath_EFF,num);
photocath_mt->AddProperty("REFLECTIVITY",Ephoton,photocath_REFL,num);
photocath_opsurf->SetMaterialPropertiesTable(photocath_mt);
new G4LogicalSkinSurface("photocath_surf",photocath_log,photocath_opsurf);
\endverbatim
A normal sensitive detector would have its ProcessHits
function called for each step by a particle inside the volume. So, to record
these hits with a sensitive detector we watched the status of the OpBoundary
process from the stepping manager whenever a photon hit the sensitive volume
of the pmt. If the status was 'Detection', we retrieve the sensitive detector
from G4SDManager and call its ProcessHits function.
\verbatim
boundaryStatus=boundary->GetStatus();
//Check to see if the particle was actually at a boundary
//Otherwise the boundary status may not be valid
//Prior to Geant4.6.0-p1 this would not have been enough to check
if(thePostPoint->GetStepStatus()==fGeomBoundary){
switch(boundaryStatus){
//...
case Detection: //Note, this assumes that the volume causing detection
//is the photocathode because it is the only one with
//non-zero efficiency
{
//Trigger sensitive detector manually since photon is
//absorbed but status was Detection
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4String sdName="/LXeDet/pmtSD";
LXePMTSD* pmtSD = (LXePMTSD*)SDman
->FindSensitiveDetector(sdName);
if(pmtSD)
pmtSD->ProcessHits_constStep(theStep,NULL);
break;
}
//...
}
\endverbatim
\section LXe_s3 Modular Physics List
Using a modular physics list is an easy way to organize the physics list into
categories for easier maintenance. It can also assist with testing code
by making it easy to disable an entire category of physics at once if
necessary. The physics list instantiated in main() is a derived class of
G4VModularPhysics list rather than the usual G4VUserPhysicsList. The only
function aside from the constructor that is necessary in this class is
SetCuts(). The constructor must register the other physics lists individually.
\verbatim
RegisterPhysics( new LXeGeneralPhysics("general") );
\endverbatim
The other physics lists (the modules) are derived from G4VPhysicsConstructor
and it is necessary to write the ConstructParticle() and ConstructProcess()
functions for each list. They work in the same way as in G4VUserPhysicsList.
Do not create instances of the individual physics processes as members of the
modules. Instead, use pointers to the processes and create the instances
in the ConstructProcess() function. The reason for this is that the materials
needed to build physics tables for the processes will not have been created
at the time that the modules are created but will have been created before the
ConstructProcess() function is called.
\section LXe_s4 Selectively drawing trajectories or highlighting volumes
In a simulation such as this one, where an average of 6000 trajectories are
generated in a small space, there is little use in drawing all of them. There
are two ways to select which ones to draw. The first of which is to decide
while looping through the trajectory container which ones to draw and only call
DrawTrajectory on the important ones. However, trajectories only contain a
small portion of the information from the track it represents. This may not
be enough to decide if a trajectory is worth drawing.
The alternative is to define your own trajectory class to store additional
information to help decide if it should be drawn. To use your custom trajectory
you must create it in the PreUserTrackingAction:
\verbatim
fpTrackingManager->SetTrajectory(new LXeTrajectory(aTrack));
\endverbatim
Then at any point you can get access to the trajectory you can update the extra
information within it. When it comes to drawing, you can then use this to
decide if you want to call DrawTrajectory. Or you can call DrawTrajectory for
all trajectories and have the logic decide how and if a trajectory should
be drawn inside the DrawTrajectory function itself.
Selectively highlighting volumes is useful to show which volumes were hit. To
do this, you simply need a pointer to the physical volume. With that, you can
modify its vis attributes and instruct the vis manager to redraw the volume
with the new vis attributes.
\verbatim
G4VisAttributes attribs(G4Colour(1.,0.,0.));
attribs.SetForceSolid(true);
G4RotationMatrix rot;
if(physVol->GetRotation())//If a rotation is defined use it
rot=*(physVol->GetRotation());
G4Transform3D trans(rot,physVol->GetTranslation());//Create transform
pVVisManager->Draw(*fPhysVol,attribs,trans);//Draw it
\endverbatim
In this case, it is done in Draw function of a PMT hit but it can be placed
anywhere. The logic to decide if it should be drawn or not may be similar to
the logic used in choosing which trajectories to draw.
See /LXe/detector/volumes/sphere in "UI commands" below for info on what
trajectories are drawn in this simulation.
\section LXe_s5 Saving random engine seeds
At times it may be necessary to review a particular event of interest. To do
this without redoing an entire run, which may take a long time, you must store
the random engine seed from the beginning of the event. The run manager
has some functions that help in this task.
\verbatim
G4RunManager::SetRandomNumberStore(G4bool)
\endverbatim
When set to true, this causes the run manager to write the seed for the
beginning of the current run to CurrentRun.rndm and the current event to
CurrentEvent.rndm. However, at the beginning of each event this file will be
overwritten with the new event. To keep a copy for a particular event there is
a function to copy this file to run###evt###.rndm.
\verbatim
G4RunManager::rndmSaveThisEvent()
\endverbatim
This can be done for every event so you can review any event you like but this
may be awkward for runs with very large numbers of events. Instead, implement
some form of logic in EndOfEventAction to decide if the event is worth saving.
If it is, then call rndmSaveThisEvent(). By default, these files are stored in
the current working directory. There is a function to change this as well.
Typically you would call that at the same time SetRandomNumberStore. The
directory to save in must exist first. GEANT4 will not create it for you.
\verbatim
G4RunManager::SetRandomNumberStoreDir(G4String)
\endverbatim
\section LXe_s6 LXeRecorderBase
LXeRecorderBase is a virtual class to serve as a template for how to add
histogram functionality to a GEANT4 application. To use it, derive a
class from it and instantiate that in main(). Each of your user action classes
to do any recording must have a pointer to this instance. Then at the end of
the critical functions in each user action, call the appropriate recorder
function. The recorder functions and the functions to call them from are listed
here:
\verbatim
RecordBeginOfRun(const G4Run*)
-Call from BeginOfRunAction()
RecordEndOfRun(const G4Run*)
-Call from EndOfRunAction()
RecordBeginOfEvent(const G4Event*)
-Call from BeginOfEventAction()
RecordEndOfEvent(const G4Event*)
-Call from EndOfEventAction()
RecordTrack(const G4Track*)
-Call from PostUserTrackingAction()
RecordStep(const G4Step*)
-Call from UserSteppingAction()
\endverbatim
For the reasoning behind why it is done this way see LXeRecorderBase.hh
\section LXe_s7 UI commands
The method to define UI commands is well documented in the GEANT4 documentation
so will not be discussed here. This is a description of the commands added to
this example.
Directories:
- /LXe/ - All custom commands belong below this directory
- /LXe/detector/ - Geometry related commands
- /LXe/detector/volumes/ - Commands to enable/disable volumes in the geometry
Commands:
\verbatim
/LXe/saveThreshold <int, default = 4500>
\endverbatim
- Specifies a threshold for saving the random seed for an event. If the number
of photons generated in an event is below this number then the random seed is
saved to ./random/run###evt###.rndm. See "Saving random engine seeds".
\verbatim
/LXe/eventVerbose <int, default = 1>
\endverbatim
- Enables end of event verbose data to be printed. This includes information
counted and calculated by the user action classes.
\verbatim
/LXe/pmtThreshold <int, default = 1>
\endverbatim
- Sets the PMT threshold in # of photons being detected by the PMT. PMTs below
with fewer hits than the threshold will not count as being hit and will also
not be highlighted at the end of the event.
\verbatim
/LXe/oneStepPrimaries <bool>
\endverbatim
- This causes primary particles to be killed after going only one step inside
the scintillator volume. This is useful to view the photons generated during
the initial conversion of the primary particle.
\verbatim
/LXe/forceDrawPhotons <bool>
\endverbatim
- Forces all optical photon trajectories to be drawn at the end of the event
regardless of the scheme mentioned in /LXe/detector/volumes/sphere below.
\verbatim
/LXe/forceDrawNoPhotons <bool>
\endverbatim
- Forces all optical photon trajectories to NOT be drawn at the end of the
event regardless of the scheme mentioned in /LXe/detector/volumes/sphere below.
- If /LXe/forceDrawPhotons is set to true, this has no effect.
\verbatim
/LXe/detector/dimensions <double x y z> <unit, default = cm>
\endverbatim
- Sets the dimensions of the main scintillator volume.
\verbatim
/LXe/detector/housingThickness <double>
\endverbatim
- Sets the thickness of the housing surrounding the main detector volume.
\verbatim
/LXe/detector/pmtRadius <double> <unit, default = cm>
\endverbatim
- Sets the radius of the PMTs
\verbatim
/LXe/detector/nx
/LXe/detector/ny
/LXe/detector/nz
\endverbatim
- Sets the number of PMTs placed in a row along each axis.
\verbatim
/LXe/detector/reflectivity <double>
\endverbatim
- Sets the reflectivity of the inside of the aluminum housing. The geometry
uses a default value of 1.00 for a fully reflective surface.
\verbatim
/LXe/detector/nfibers <int>
\endverbatim
- Sets the number of WLS fibers placed in the WLS scintillator slab. The
geometry uses a default value of 15 fibers.
\verbatim
/LXe/detector/scintYieldFactor <double>
\endverbatim
- Sets the yield factor for the scintillation process. This is cumulative with
the yield factor set on individual materials. Set to 0 to produce no
scintillation photons.
\verbatim
/LXe/detector/update
\endverbatim
- Builds the new geometry based on any parameters that have been updated with
the other UI commands. ***This must be called for the changes to take effect***
\verbatim
/LXe/detector/defaults
\endverbatim
- Resets all detector values customizable with commands above to their defaults.
\verbatim
/LXe/detector/volumes/sphere <bool>
\endverbatim
- Enables/disables the sphere placed inside the main scintillator volume. When
the sphere is enabled, only photons that hit the sphere and hit a PMT are
drawn. If it is disabled, then all photons that hit PMTs are drawn.
\verbatim
/LXe/detector/volumes/wls <bool>
\endverbatim
- Enables/disables the WLS scintillator slab containing WLS fibers. By default
this is not part of the geometry. Enabling it will place it behind the LXe
scintillator volume.
\verbatim
/LXe/detector/volumes/lxe <bool>
\endverbatim
- Enables/disables the main LXe scintillator volume. By default this is part of
the geometry.
\section LXe_s8 Macro files
The following are the macro files included in this example and what they do.
- LXe.in \n
This produces a standard event with a 511 keV gamma fired into the LXe volume.
All values are left at their default states but verbose output has been
enabled.
- cerenkov.mac \n
This is to demonstrate the cerenkov process. It disables the scintillation
process and uses a 200MeV mu+ to produce cerenkov photons. The volume has
been resized and the number of pmts has been increased to more accurately
show the cone. OneStepPrimaries has been enabled so that the cone does not fill
itself in as the muon slows down.
- wls.mac \n
This disables the main volume and enables the WLS slab volume. It sets the
particle gun to use an e- to produce scintillation in the slab which will be
absorbed by the WLS fibers and re-emited at a different wavelength.
- vis.mac \n
This is a standard vis.mac file to tell the vis manager how to visualize the
simulation.
- photon.mac \n
A very simple test in which the gun is set to produce a single photon inside
the main scintillator volume.
- reviewEvent.mac \n
This is to review an event by loading in a random seed and running the event
with verbose output. Modify the file to specify the filename of the random
seed.
- defaults.mac \n
This resets all values that can be changed with the /LXe/ commands back to
their initial configuration including those that are not reset with
\verbatim
/LXe/detector/defaults
\endverbatim
<hr>
\section LXe_s9 Classes Used
\subsection LXe_subs11 main ()
See LXe.cc.
- Use G4UItcsh if available
- Provide interactive and macro mode
\subsection LXe_subs12 G4VModularPhysicsList
Class: LXePhysicsList
- Registers General, EM, Muon, and Optical physics lists
- define particles; including
- G4OpticalPhoton
- define processes; including
- G4Cerenkov
- G4Scintillation
- G4OpAbsorption
- G4OpRayleigh
- G4OpBoundaryProcess
- G4OpWLS
\subsection LXe_subs13 G4VUserDetectorConstruction
Class: LXeDetectorConstruction
- define material: LXe (liquid xenon), Aluminum, Air, Vacuum, Glass,...
- define G4Box geometry with aluminum housing and LXe volume inside
- define G4Tubs placed around the housing walls
- define G4Sphere to demonstrate skin surfaces inside volumes:
- add G4MaterialPropertiesTable to G4Material
- define G4OpticalSurface(s)
- define G4LogicalBorderSurface(s)
- define G4LogicalSkinSurface(s)
- add G4MaterialPropertiesTable to G4OpticalSurface(s)
- Mesenger to change many of the dectector geometry properties
- Uses a alternative style of geometry definition. See "Geometry" section.
\subsection LXe_subs14 G4VUserPrimaryGeneratorAction
Class: LXePrimaryGeneratorAction
- Use G4ParticleGun to shoot a 511 keV gamma through the housing into
liquid xenon scintillator
\subsection LXe_subs15 G4UserStackingAction
Class: LXeStackingAction
- show how to count the number of secondary particles in an event
differentiates between different creator processes
\subsection LXe_subs16 G4UserRunAction
Class: LXeRunAction
- Call recorder class for begin and end of run
\subsection LXe_subs17 G4UserSteppingAction
Class: LXeSteppingAction
- Identify which secondaries were generated during a particular step
- Count reflections/absorptions/detections due to G4OpBoundaryProcess \n
Count absorptions due to G4OpAbsorption \n
Manually trigger a sensitive detector when a boundary process detects
- Call recorder class at end of step
\subsection LXe_subs18 G4UserTrackingAction
Class: LXeTrackingAction
- Determine if the trajectory should be drawn by checking if it hit the
sphere(if enabled) and a pmt.
- Call recorder class at end of track
\subsection LXe_subs19 G4UserEventAction
Class: LXeEventAction
- Triggers drawing of trajectories
- Calculates and stores data in a G4VUserEventInformation object
- Outputs basic event data at end of event
- Decides if the random seed should be saved for this event
- Call recorder class at begin and end of event
\subsection LXe_subs110 G4VSensitiveDetector
Classes: LXePMTSD, LXeScintSD
- Basic sensitive detectors keeping hit collections
- Keep one G4VHit object per hit \n
or \n
Keep one G4VHit object per volume containing hits
- LXePMTSD decides if the hits it is creating should be redrawn
\subsection LXe_subs111 G4VHit
Classes: LXePMTHit, LXeScintHIT
- Store individual hit positions \n
or \n
Store a count of hits in a particular volume
- Selectively redraw volumes containing hits at the end of event
\subsection LXe_subs112 G4VUserEventInformation & G4VUserTrackInformation
Classes: LXeUserEventInformation, LXeUserTrackInformation
- Store aditional information along with the G4Event/G4Track objects
\subsection LXe_subs113 G4VSteppingVerbose
Classes: LXeSteppingVerbose
- Custom verbose stepping output to use G4BestUnit and print current volume
rather than next volume
- Same as ExN03SteppingVerbose but output reformated to fit nicer into
tables.
\subsection LXe_subs114 G4UImessenger
Classes: LXeDetectorMessenger, LXeEventMessenger, LXeSteppingMessenger
- Create /LXe and /LXe/detector interactive command folders
- Create new commands
- See interactive help when running the example for descriptions of commands
\subsection LXe_subs115 G4Trajectory
Class: LXeTrajectory
- Derived from G4Trajectory to use most of the basic trajectory functions
already defined
- Uses a coppied and modified version of DrawTrajectory from G4VTrajectory
to enable/disable drawing of individual trajectories and to redefine
the colours used
\subsection LXe_subs116 LXeRecorderBase
Class LXeRecorderBase
- Virtual class provided for recording of simulation data
- Derive your own implementation from it and instantiate the recorder
object in main () (see LXe.cc)
- For full description see LXeRecorderBase.hh
*/
+53 -7
View File
@@ -1,12 +1,58 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(LXe)
set(name LXe)
project(${name})
find_package(Geant4 REQUIRED)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${Geant4_INCLUDE_DIR})
file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(LXe LXe.cc ${sources} ${headers})
target_link_libraries(LXe ${Geant4_LIBRARIES} )
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build LXe. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
set(LXe_SCRIPTS
cerenkov.mac defaults.mac LXe.in LXe.out photon.mac reviewEvent.mac vis.mac wls.mac
)
foreach(_script ${LXe_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/${_script}
COPYONLY
)
endforeach()
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS LXe DESTINATION bin)
add_executable(${name} EXCLUDE_FROM_ALL ${name}.cc ${sources})
target_link_libraries(${name} ${Geant4_LIBRARIES})
+14
View File
@@ -15,6 +15,20 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
16 November 2012 Gunter Folger (LXe-V09-05-02)
- reduce size of LXe.out, and remove tracking/verbose 1, responsible for the
size of the output
14 November 2012 Ivana Hrivnacova (LXe-V09-05-01)
- In vis.mac: OGLIX replaced with OGL
18 September 2012 Ivana Hrivnacova
- RecorderBase renamed to LXeRecorderBase (by P. Gumplinger)
See also ../History for general changes
20 June 2012 Peter Gumplinger (LXe-V09-05-00)
- add debugging which will help spot when a wrong normal may have been returned
08 November 2011 Peter Gumplinger (LXe-V09-04-00)
- exercise the optics_engine in LXe.in
+8 -8
View File
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/LXe.cc
/// \brief Main program of the optical/LXe example
//
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4String.hh"
@@ -37,7 +40,7 @@
#include "LXeRunAction.hh"
#include "LXeSteppingVerbose.hh"
#include "RecorderBase.hh"
#include "LXeRecorderBase.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
@@ -47,7 +50,6 @@
#include "G4UIExecutive.hh"
#endif
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
int main(int argc, char** argv)
{
G4VSteppingVerbose::SetInstance(new LXeSteppingVerbose);
@@ -62,11 +64,11 @@ int main(int argc, char** argv)
visManager->Initialize();
#endif
RecorderBase* recorder = NULL;//No recording is done in this example
LXeRecorderBase* recorder = NULL;//No recording is done in this example
runManager->SetUserAction(new LXePrimaryGeneratorAction);
runManager->SetUserAction(new LXeStackingAction);
runManager->SetUserAction(new LXeRunAction(recorder));
runManager->SetUserAction(new LXeEventAction(recorder));
runManager->SetUserAction(new LXeTrackingAction(recorder));
@@ -76,12 +78,12 @@ int main(int argc, char** argv)
// get the pointer to the UI manager and set verbosities
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if(argc==1){
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
#ifdef G4VIS_USE
UImanager->ApplyCommand("/control/execute vis.mac");
UImanager->ApplyCommand("/control/execute vis.mac");
#endif
ui->SessionStart();
delete ui;
@@ -103,5 +105,3 @@ int main(int argc, char** argv)
delete runManager;
return 0;
}
+5 -1
View File
@@ -6,8 +6,12 @@
#**************
/run/verbose 1
#/LXe/detector/MainScintYield 100
/LXe/saveThreshold 1000
/LXe/pmtThreshold 2
#/LXe/forceDrawPhotons true
#/LXe/forceDrawNoPhotons false
/LXe/eventVerbose 1
/tracking/verbose 1
#/tracking/verbose 1
#/optics_engine/selectOpProcess Scintillation
#/optics_engine/setOpProcessUse false
#/optics_engine/setOpProcessVerbose 1
File diff suppressed because it is too large Load Diff
+175 -171
View File
@@ -2,177 +2,6 @@
LXe Example
-----------
**************
*Classes Used*
**************
main()
------
==> Use G4UItcsh if available
==> Provide interactive and macro mode
G4VModularPhysicsList
------------------
(class: LXePhysicsList)
==> Registers General, EM, Muon, and Optical physics lists
==> define particles; including *** G4OpticalPhoton ***
define processes; including *** G4Cerenkov ***
*** G4Scintillation ***
*** G4OpAbsorption ***
*** G4OpRayleigh ***
*** G4OpBoundaryProcess ***
*** G4OpWLS ***
G4VUserDetectorConstruction
---------------------------
(class: LXeDetectorConstruction)
==> define material: LXe (liquid xenon), Aluminum, Air, Vacuum, Glass,...
define G4Box geometry with aluminum housing and LXe volume inside
define G4Tubs placed around the housing walls
define G4Sphere to demonstrate skin surfaces inside volumes
*** add G4MaterialPropertiesTable to G4Material ***
*** define G4OpticalSurface(s) ***
*** define G4LogicalBorderSurface(s) ***
*** define G4LogicalSkinSurface(s) ***
*** add G4MaterialPropertiesTable to G4OpticalSurface(s)***
==> Mesenger to change many of the dectector geometry properties
==> Uses a alternative style of geometry definition. See "Geometry" section.
G4VUserPrimaryGeneratorAction
-----------------------------
(class: LXePrimaryGeneratorAction)
==> Use G4ParticleGun to shoot a 511 keV gamma through the housing into
liquid xenon scintillator
G4UserStackingAction
--------------------
(class: LXeStackingAction)
==> show how to count the number of secondary particles in an event
differentiates between different creator processes
G4UserRunAction
---------------
(class: LXeRunAction)
==> Call recorder class for begin and end of run
G4UserSteppingAction
--------------------
(class: LXeSteppingAction)
==> Identify which secondaries were generated during a particular step
==> ***Count reflections/absorptions/detections due to G4OpBoundaryProcess***
***Count absorptions due to G4OpAbsorption ***
Manually trigger a sensitive detector when a boundary process detects
==> Call recorder class at end of step
G4UserTrackingAction
____________________
(class: LXeTrackingAction)
==> Determine if the trajectory should be drawn by checking if it hit the
sphere(if enabled) and a pmt.
==> Call recorder class at end of track
G4UserEventAction
-----------------
(class: LXeEventAction)
==> Triggers drawing of trajectories
==> Calculates and stores data in a G4VUserEventInformation object
==> Outputs basic event data at end of event
==> Decides if the random seed should be saved for this event
==> Call recorder class at begin and end of event
G4VSensitiveDetector
--------------------
(classes: LXePMTSD, LXeScintSD)
==> Basic sensitive detectors keeping hit collections
Keep one G4VHit object per hit
or
Keep one G4VHit object per volume containing hits
==> LXePMTSD decides if the hits it is creating should be redrawn
G4VHit
------
(classes: LXePMTHit, LXeScintHIT)
==> Store individual hit positions
or
Store a count of hits in a particular volume
==> Selectively redraw volumes containing hits at the end of event
G4VUserEventInformation & G4VUserTrackInformation
-------------------------------------------------
(classes: LXeUserEventInformation, LXeUserTrackInformation)
==> Store aditional information along with the G4Event/G4Track objects
G4VSteppingVerbose
------------------
(classes: LXeSteppingVerbose)
==> Custom verbose stepping output to use G4BestUnit and print current volume
rather than next volume
==> Same as ExN03SteppingVerbose but output reformated to fit nicer into
tables.
G4UImessenger
-------------
(classes: LXeDetectorMessenger, LXeEventMessenger, LXeSteppingMessenger)
==> Create /LXe and /LXe/detector interactive command folders
==> Create new commands
==> See interactive help when running the example for descriptions of commands
G4Trajectory
------------
(class: LXeTrajectory)
==> Derived from G4Trajectory to use most of the basic trajectory functions
already defined
==> Uses a coppied and modified version of DrawTrajectory from G4VTrajectory
to enable/disable drawing of individual trajectories and to redefine
the colours used
G4VisManager
------------
(class: LXeVisManager)
==> Initialize graphics systems geant4 is configured for
RecorderBase
------------
==> Virtual class provided for recording of simulation data
==> Derive your own implementation from it and instantiate the recorder
object in main()
==> For full description see RecorderBase.hh
**********
*Geometry*
**********
@@ -551,3 +380,178 @@ defaults.mac
-This resets all values that can be changed with the /LXe/ commands back to
their initial configuration including those that are not reset with
/LXe/detector/defaults
**************
*Classes Used*
**************
main()
------
See LXe.cc.
==> Use G4UItcsh if available
==> Provide interactive and macro mode
G4VModularPhysicsList
------------------
(class: LXePhysicsList)
==> Registers General, EM, Muon, and Optical physics lists
==> define particles; including *** G4OpticalPhoton ***
define processes; including *** G4Cerenkov ***
*** G4Scintillation ***
*** G4OpAbsorption ***
*** G4OpRayleigh ***
*** G4OpBoundaryProcess ***
*** G4OpWLS ***
G4VUserDetectorConstruction
---------------------------
(class: LXeDetectorConstruction)
==> define material: LXe (liquid xenon), Aluminum, Air, Vacuum, Glass,...
define G4Box geometry with aluminum housing and LXe volume inside
define G4Tubs placed around the housing walls
define G4Sphere to demonstrate skin surfaces inside volumes
*** add G4MaterialPropertiesTable to G4Material ***
*** define G4OpticalSurface(s) ***
*** define G4LogicalBorderSurface(s) ***
*** define G4LogicalSkinSurface(s) ***
*** add G4MaterialPropertiesTable to G4OpticalSurface(s)***
==> Mesenger to change many of the dectector geometry properties
==> Uses a alternative style of geometry definition. See "Geometry" section.
G4VUserPrimaryGeneratorAction
-----------------------------
(class: LXePrimaryGeneratorAction)
==> Use G4ParticleGun to shoot a 511 keV gamma through the housing into
liquid xenon scintillator
G4UserStackingAction
--------------------
(class: LXeStackingAction)
==> show how to count the number of secondary particles in an event
differentiates between different creator processes
G4UserRunAction
---------------
(class: LXeRunAction)
==> Call recorder class for begin and end of run
G4UserSteppingAction
--------------------
(class: LXeSteppingAction)
==> Identify which secondaries were generated during a particular step
==> ***Count reflections/absorptions/detections due to G4OpBoundaryProcess***
***Count absorptions due to G4OpAbsorption ***
Manually trigger a sensitive detector when a boundary process detects
==> Call recorder class at end of step
G4UserTrackingAction
____________________
(class: LXeTrackingAction)
==> Determine if the trajectory should be drawn by checking if it hit the
sphere(if enabled) and a pmt.
==> Call recorder class at end of track
G4UserEventAction
-----------------
(class: LXeEventAction)
==> Triggers drawing of trajectories
==> Calculates and stores data in a G4VUserEventInformation object
==> Outputs basic event data at end of event
==> Decides if the random seed should be saved for this event
==> Call recorder class at begin and end of event
G4VSensitiveDetector
--------------------
(classes: LXePMTSD, LXeScintSD)
==> Basic sensitive detectors keeping hit collections
Keep one G4VHit object per hit
or
Keep one G4VHit object per volume containing hits
==> LXePMTSD decides if the hits it is creating should be redrawn
G4VHit
------
(classes: LXePMTHit, LXeScintHIT)
==> Store individual hit positions
or
Store a count of hits in a particular volume
==> Selectively redraw volumes containing hits at the end of event
G4VUserEventInformation & G4VUserTrackInformation
-------------------------------------------------
(classes: LXeUserEventInformation, LXeUserTrackInformation)
==> Store aditional information along with the G4Event/G4Track objects
G4VSteppingVerbose
------------------
(classes: LXeSteppingVerbose)
==> Custom verbose stepping output to use G4BestUnit and print current volume
rather than next volume
==> Same as ExN03SteppingVerbose but output reformated to fit nicer into
tables.
G4UImessenger
-------------
(classes: LXeDetectorMessenger, LXeEventMessenger, LXeSteppingMessenger)
==> Create /LXe and /LXe/detector interactive command folders
==> Create new commands
==> See interactive help when running the example for descriptions of commands
G4Trajectory
------------
(class: LXeTrajectory)
==> Derived from G4Trajectory to use most of the basic trajectory functions
already defined
==> Uses a coppied and modified version of DrawTrajectory from G4VTrajectory
to enable/disable drawing of individual trajectories and to redefine
the colours used
G4VisManager
------------
(class: LXeVisManager)
==> Initialize graphics systems geant4 is configured for
RecorderBase
------------
==> Virtual class provided for recording of simulation data
==> Derive your own implementation from it and instantiate the recorder
object in main()
==> For full description see RecorderBase.hh
@@ -19,6 +19,7 @@
/LXe/detector/ny 20
/LXe/detector/nz 0
/LXe/detector/dimensions 60 60 25 cm
/LXe/detector/housingThickness 0.0635 cm
/LXe/detector/pmtRadius 1.5 cm
/LXe/detector/volumes/sphere 0
/LXe/detector/reflectivity 0.0
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeDetectorConstruction.hh
/// \brief Definition of the LXeDetectorConstruction class
//
//
#ifndef LXeDetectorConstruction_H
#define LXeDetectorConstruction_H 1
@@ -45,105 +49,99 @@ class LXeDetectorConstruction : public G4VUserDetectorConstruction
public:
LXeDetectorConstruction();
~LXeDetectorConstruction();
virtual ~LXeDetectorConstruction();
G4VPhysicalVolume* Construct();
virtual G4VPhysicalVolume* Construct();
//Functions to modify the geometry
void SetDimensions(G4ThreeVector dims);
void SetHousingThickness(G4double d_mtl);
void SetNX(G4int nx);
void SetNY(G4int ny);
void SetNZ(G4int nz);
void SetPMTRadius(G4double outerRadius_pmt);
void SetDefaults();
//Functions to modify the geometry
void SetDimensions(G4ThreeVector );
void SetHousingThickness(G4double );
void SetNX(G4int );
void SetNY(G4int );
void SetNZ(G4int );
void SetPMTRadius(G4double );
void SetDefaults();
//Get values
G4double GetScintX(){return scint_x;}
G4double GetScintY(){return scint_y;}
G4double GetScintZ(){return scint_z;}
G4double GetHousingThickness(){return d_mtl;}
G4int GetNX(){return nx;}
G4int GetNY(){return ny;}
G4int GetNZ(){return nz;}
G4double GetPMTRadius(){return outerRadius_pmt;}
G4double GetSlabZ(){return slab_z;}
//rebuild the geometry based on changes. must be called
void UpdateGeometry();
G4bool GetUpdated(){return updated;}
//Get values
G4double GetScintX(){return fScint_x;}
G4double GetScintY(){return fScint_y;}
G4double GetScintZ(){return fScint_z;}
G4double GetHousingThickness(){return fD_mtl;}
G4int GetNX(){return fNx;}
G4int GetNY(){return fNy;}
G4int GetNZ(){return fNz;}
G4double GetPMTRadius(){return fOuterRadius_pmt;}
G4double GetSlabZ(){return fSlab_z;}
//rebuild the geometry based on changes. must be called
void UpdateGeometry();
G4bool GetUpdated(){return fUpdated;}
void SetSphereOn(G4bool b){sphereOn=b;updated=true;}
static G4bool GetSphereOn(){return sphereOn;}
void SetSphereOn(G4bool b){fSphereOn=b; fUpdated=true;}
static G4bool GetSphereOn(){return fSphereOn;}
void SetHousingReflectivity(G4double r){refl=r;updated=true;}
G4double GetHousingReflectivity(){return refl;}
void SetHousingReflectivity(G4double r){fRefl=r; fUpdated=true;}
G4double GetHousingReflectivity(){return fRefl;}
void SetWLSSlabOn(G4bool b){WLSslab=b;updated=true;}
G4bool GetWLSSlabOn(){return WLSslab;}
void SetWLSSlabOn(G4bool b){fWLSslab=b; fUpdated=true;}
G4bool GetWLSSlabOn(){return fWLSslab;}
void SetMainVolumeOn(G4bool b){mainVolume=b;updated=true;}
G4bool GetMainVolumeOn(){return mainVolume;}
void SetMainVolumeOn(G4bool b){fMainVolume=b; fUpdated=true;}
G4bool GetMainVolumeOn(){return fMainVolume;}
void SetNFibers(G4int n){nfibers=n;updated=true;}
G4int GetNFibers(){return nfibers;}
void SetNFibers(G4int n){fNfibers=n; fUpdated=true;}
G4int GetNFibers(){return fNfibers;}
void SetMainScintYield(G4double y);
void SetWLSScintYield(G4double y);
void SetMainScintYield(G4double );
void SetWLSScintYield(G4double );
private:
private:
void DefineMaterials();
G4VPhysicalVolume* ConstructDetector();
void DefineMaterials();
G4VPhysicalVolume* ConstructDetector();
LXeDetectorMessenger* detectorMessenger;
LXeDetectorMessenger* fDetectorMessenger;
G4bool updated;
G4Box* experimentalHall_box;
G4LogicalVolume* experimentalHall_log;
G4VPhysicalVolume* experimentalHall_phys;
G4bool fUpdated;
G4Box* fExperimentalHall_box;
G4LogicalVolume* fExperimentalHall_log;
G4VPhysicalVolume* fExperimentalHall_phys;
//Materials & Elements
G4Material* LXe;
G4Material* Al;
G4Element* N;
G4Element* O;
G4Material* Air;
G4Material* Vacuum;
G4Element* C;
G4Element* H;
G4Material* Glass;
G4Material* Pstyrene;
G4Material* PMMA;
G4Material* Pethylene;
G4Material* fPethylene;
//Materials & Elements
G4Material* fLXe;
G4Material* fAl;
G4Element* fN;
G4Element* fO;
G4Material* fAir;
G4Material* fVacuum;
G4Element* fC;
G4Element* fH;
G4Material* fGlass;
G4Material* fPstyrene;
G4Material* fPMMA;
G4Material* fPethylene1;
G4Material* fPethylene2;
//Geometry
G4double fScint_x;
G4double fScint_y;
G4double fScint_z;
G4double fD_mtl;
G4int fNx;
G4int fNy;
G4int fNz;
G4double fOuterRadius_pmt;
G4int fNfibers;
static G4bool fSphereOn;
G4double fRefl;
G4bool fWLSslab;
G4bool fMainVolume;
G4double fSlab_z;
//Geometry
G4double scint_x;
G4double scint_y;
G4double scint_z;
G4double d_mtl;
G4int nx;
G4int ny;
G4int nz;
G4double outerRadius_pmt;
G4int nfibers;
static G4bool sphereOn;
G4double refl;
G4bool WLSslab;
G4bool mainVolume;
G4double slab_z;
G4MaterialPropertiesTable* LXe_mt;
G4MaterialPropertiesTable* MPTPStyrene;
G4MaterialPropertiesTable* fLXe_mt;
G4MaterialPropertiesTable* fMPTPStyrene;
};
#endif
@@ -23,7 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeDetectorMessenger.hh
/// \brief Definition of the LXeDetectorMessenger class
//
//
#ifndef LXeDetectorMessenger_h
#define LXeDetectorMessenger_h 1
@@ -41,32 +44,33 @@ class G4UIcmdWithADouble;
class LXeDetectorMessenger: public G4UImessenger
{
public:
LXeDetectorMessenger(LXeDetectorConstruction*);
~LXeDetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
LXeDetectorConstruction* LXeDetector;
G4UIdirectory* detectorDir;
G4UIdirectory* volumesDir;
G4UIcmdWith3VectorAndUnit* dimensionsCmd;
G4UIcmdWithADoubleAndUnit* housingThicknessCmd;
G4UIcmdWithADoubleAndUnit* pmtRadiusCmd;
G4UIcmdWithAnInteger* nxCmd;
G4UIcmdWithAnInteger* nyCmd;
G4UIcmdWithAnInteger* nzCmd;
G4UIcmdWithABool* sphereCmd;
G4UIcmdWithADouble* reflectivityCmd;
G4UIcmdWithABool* wlsCmd;
G4UIcmdWithABool* lxeCmd;
G4UIcmdWithAnInteger* nFibersCmd;
G4UIcommand* updateCmd;
G4UIcommand* defaultsCmd;
G4UIcmdWithADouble* MainScintYield;
G4UIcmdWithADouble* WLSScintYield;
public:
LXeDetectorMessenger(LXeDetectorConstruction*);
virtual ~LXeDetectorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
LXeDetectorConstruction* fLXeDetector;
G4UIdirectory* fDetectorDir;
G4UIdirectory* fVolumesDir;
G4UIcmdWith3VectorAndUnit* fDimensionsCmd;
G4UIcmdWithADoubleAndUnit* fHousingThicknessCmd;
G4UIcmdWithADoubleAndUnit* fPmtRadiusCmd;
G4UIcmdWithAnInteger* fNxCmd;
G4UIcmdWithAnInteger* fNyCmd;
G4UIcmdWithAnInteger* fNzCmd;
G4UIcmdWithABool* fSphereCmd;
G4UIcmdWithADouble* fReflectivityCmd;
G4UIcmdWithABool* fWlsCmd;
G4UIcmdWithABool* fLxeCmd;
G4UIcmdWithAnInteger* fNFibersCmd;
G4UIcommand* fUpdateCmd;
G4UIcommand* fDefaultsCmd;
G4UIcmdWithADouble* fMainScintYield;
G4UIcmdWithADouble* fWLSScintYield;
};
#endif
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeEMPhysics.hh
/// \brief Definition of the LXeEMPhysics class
//
//
#ifndef LXeEMPhysics_h
#define LXeEMPhysics_h 1
@@ -41,42 +45,39 @@
class LXeEMPhysics : public G4VPhysicsConstructor
{
public:
public:
LXeEMPhysics(const G4String& name ="EM");
virtual ~LXeEMPhysics();
public:
// This method will be invoked in the Construct() method.
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
// Gamma physics
G4PhotoElectricEffect* thePhotoEffect;
G4ComptonScattering* theComptonEffect;
G4GammaConversion* thePairProduction;
G4PhotoElectricEffect* fPhotoEffect;
G4ComptonScattering* fComptonEffect;
G4GammaConversion* fPairProduction;
// Electron physics
G4eMultipleScattering* theElectronMultipleScattering;
G4eIonisation* theElectronIonisation;
G4eBremsstrahlung* theElectronBremsStrahlung;
G4eMultipleScattering* fElectronMultipleScattering;
G4eIonisation* fElectronIonisation;
G4eBremsstrahlung* fElectronBremsStrahlung;
//Positron physics
G4eMultipleScattering* thePositronMultipleScattering;
G4eIonisation* thePositronIonisation;
G4eBremsstrahlung* thePositronBremsStrahlung;
G4eplusAnnihilation* theAnnihilation;
G4eMultipleScattering* fPositronMultipleScattering;
G4eIonisation* fPositronIonisation;
G4eBremsstrahlung* fPositronBremsStrahlung;
G4eplusAnnihilation* fAnnihilation;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeEventAction.hh
/// \brief Definition of the LXeEventAction class
//
#ifndef LXeEventAction_h
#define LXeEventAction_h 1
@@ -33,45 +36,46 @@
#include "G4ThreeVector.hh"
class G4Event;
class RecorderBase;
class LXeRecorderBase;
class LXeEventAction : public G4UserEventAction
{
public:
LXeEventAction(RecorderBase*);
~LXeEventAction();
public:
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
void SetSaveThreshold(G4int save);
public:
void SetEventVerbose(G4int v){verbose=v;}
LXeEventAction(LXeRecorderBase*);
virtual ~LXeEventAction();
void SetPMTThreshold(G4int t){pmtThreshold=t;}
public:
void SetForceDrawPhotons(G4bool b){forcedrawphotons=b;}
void SetForceDrawNoPhotons(G4bool b){forcenophotons=b;}
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
private:
RecorderBase* recorder;
LXeEventMessenger* eventMessenger;
void SetSaveThreshold(G4int );
G4int saveThreshold;
void SetEventVerbose(G4int v){fVerbose=v;}
G4int scintCollID;
G4int pmtCollID;
void SetPMTThreshold(G4int t){fPMTThreshold=t;}
G4int verbose;
G4int pmtThreshold;
G4bool forcedrawphotons;
G4bool forcenophotons;
void SetForceDrawPhotons(G4bool b){fForcedrawphotons=b;}
void SetForceDrawNoPhotons(G4bool b){fForcenophotons=b;}
private:
LXeRecorderBase* fRecorder;
LXeEventMessenger* fEventMessenger;
G4int fSaveThreshold;
G4int fScintCollID;
G4int fPMTCollID;
G4int fVerbose;
G4int fPMTThreshold;
G4bool fForcedrawphotons;
G4bool fForcenophotons;
};
#endif
@@ -23,7 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeEventMessenger.hh
/// \brief Definition of the LXeEventMessenger class
//
//
#ifndef LXeEventMessenger_h
#define LXeEventMessenger_h 1
@@ -36,20 +39,21 @@ class G4UIcmdWithABool;
class LXeEventMessenger: public G4UImessenger
{
public:
LXeEventMessenger(LXeEventAction*);
~LXeEventMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
LXeEventAction* LXeEvent;
G4UIcmdWithAnInteger* saveThresholdCmd;
G4UIcmdWithAnInteger* verboseCmd;
G4UIcmdWithAnInteger* pmtThresholdCmd;
G4UIcmdWithABool* forceDrawPhotonsCmd;
G4UIcmdWithABool* forceDrawNoPhotonsCmd;
public:
LXeEventMessenger(LXeEventAction*);
virtual ~LXeEventMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
LXeEventAction* fLXeEvent;
G4UIcmdWithAnInteger* fSaveThresholdCmd;
G4UIcmdWithAnInteger* fVerboseCmd;
G4UIcmdWithAnInteger* fPmtThresholdCmd;
G4UIcmdWithABool* fForceDrawPhotonsCmd;
G4UIcmdWithABool* fForceDrawNoPhotonsCmd;
};
#endif
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeGeneralPhysics.hh
/// \brief Definition of the LXeGeneralPhysics class
//
//
#ifndef LXeGeneralPhysics_h
#define LXeGeneralPhysics_h 1
@@ -31,36 +35,27 @@
#include "G4VPhysicsConstructor.hh"
#include "G4Decay.hh"
class LXeGeneralPhysics : public G4VPhysicsConstructor
{
public:
public:
LXeGeneralPhysics(const G4String& name = "general");
virtual ~LXeGeneralPhysics();
public:
// This method will be invoked in the Construct() method.
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
G4Decay* fDecayProcess;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeMainVolume.hh
/// \brief Definition of the LXeMainVolume class
//
#ifndef LXeMainVolume_H
#define LXeMainVolume_H 1
@@ -38,68 +41,61 @@
class LXeMainVolume : public G4PVPlacement
{
public:
LXeMainVolume(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c);
private:
void VisAttributes();
void SurfaceProperties();
public:
void PlacePMTs(G4LogicalVolume* pmt_Log,
G4RotationMatrix* rot, G4double &a, G4double &b, G4double da,
G4double db, G4double amin, G4double bmin, G4int na, G4int nb,
G4double &x, G4double &y, G4double &z, G4int &k,LXePMTSD* sd);
LXeMainVolume(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c);
void CopyValues();
private:
G4bool updated;
void VisAttributes();
void SurfaceProperties();
void PlacePMTs(G4LogicalVolume* pmt_Log,
G4RotationMatrix* rot, G4double &a, G4double &b, G4double da,
G4double db, G4double amin, G4double bmin, G4int na, G4int nb,
G4double &x, G4double &y, G4double &z, G4int &k,LXePMTSD* sd);
void CopyValues();
G4bool fUpdated;
LXeDetectorConstruction* constructor;
LXeDetectorConstruction* fConstructor;
G4double scint_x;
G4double scint_y;
G4double scint_z;
G4double d_mtl;
G4int nx;
G4int ny;
G4int nz;
G4double outerRadius_pmt;
G4bool sphereOn;
G4double refl;
G4double fScint_x;
G4double fScint_y;
G4double fScint_z;
G4double fD_mtl;
G4int fNx;
G4int fNy;
G4int fNz;
G4double fOuterRadius_pmt;
G4bool fSphereOn;
G4double fRefl;
//Basic Volumes
//
G4Box* scint_box;
G4Box* housing_box;
G4Tubs* pmt;
G4Tubs* photocath;
G4Sphere* sphere;
//Basic Volumes
//
G4Box* fScint_box;
G4Box* fHousing_box;
G4Tubs* fPmt;
G4Tubs* fPhotocath;
G4Sphere* fSphere;
// Logical volumes
//
G4LogicalVolume* fScint_log;
static G4LogicalVolume* fHousing_log;
G4LogicalVolume* fPmt_log;
G4LogicalVolume* fPhotocath_log;
G4LogicalVolume* fSphere_log;
// Logical volumes
//
G4LogicalVolume* scint_log;
static G4LogicalVolume* housing_log;
G4LogicalVolume* pmt_log;
G4LogicalVolume* photocath_log;
G4LogicalVolume* sphere_log;
// Physical volumes
//
G4VPhysicalVolume* scint_phys;
//keeping pointers to these is pointless really since there are many of them
//but I'm doing it to be consistent
G4VPhysicalVolume* pmt_phys;
G4VPhysicalVolume* photocath_phys;
G4VPhysicalVolume* sphere_phys;
//Sensitive Detectors
static LXeScintSD* scint_SD;
static LXePMTSD* pmt_SD;
//Sensitive Detectors
static LXeScintSD* fScint_SD;
static LXePMTSD* fPmt_SD;
};
#endif
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeMuonPhysics.hh
/// \brief Definition of the LXeMuonPhysics class
//
//
#ifndef LXeMuonPhysics_h
#define LXeMuonPhysics_h 1
@@ -40,36 +44,35 @@
class LXeMuonPhysics : public G4VPhysicsConstructor
{
public:
public:
LXeMuonPhysics(const G4String& name="muon");
virtual ~LXeMuonPhysics();
public:
// This method will be invoked in the Construct() method.
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
// Muon physics
G4MuIonisation* fMuPlusIonisation;
G4MuMultipleScattering* fMuPlusMultipleScattering;
G4MuBremsstrahlung* fMuPlusBremsstrahlung ;
G4MuBremsstrahlung* fMuPlusBremsstrahlung;
G4MuPairProduction* fMuPlusPairProduction;
G4MuIonisation* fMuMinusIonisation;
G4MuMultipleScattering* fMuMinusMultipleScattering;
G4MuBremsstrahlung* fMuMinusBremsstrahlung ;
G4MuBremsstrahlung* fMuMinusBremsstrahlung;
G4MuPairProduction* fMuMinusPairProduction;
G4MuonMinusCaptureAtRest* fMuMinusCaptureAtRest;
};
#endif
@@ -23,7 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXePMTHit.hh
/// \brief Definition of the LXePMTHit class
//
//
#ifndef LXePMTHit_h
#define LXePMTHit_h 1
@@ -40,45 +43,46 @@ class G4VTouchable;
class LXePMTHit : public G4VHit
{
public:
LXePMTHit();
~LXePMTHit();
LXePMTHit(const LXePMTHit &right);
public:
LXePMTHit();
virtual ~LXePMTHit();
LXePMTHit(const LXePMTHit &right);
const LXePMTHit& operator=(const LXePMTHit &right);
G4int operator==(const LXePMTHit &right) const;
const LXePMTHit& operator=(const LXePMTHit &right);
G4int operator==(const LXePMTHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
void Draw();
void Print();
inline void *operator new(size_t);
inline void operator delete(void *aHit);
virtual void Draw();
virtual void Print();
inline void SetDrawit(G4bool b){drawit=b;}
inline G4bool GetDrawit(){return drawit;}
inline void SetDrawit(G4bool b){fDrawit=b;}
inline G4bool GetDrawit(){return fDrawit;}
inline void IncPhotonCount(){photons++;}
inline G4int GetPhotonCount(){return photons;}
inline void IncPhotonCount(){fPhotons++;}
inline G4int GetPhotonCount(){return fPhotons;}
inline void SetPMTNumber(G4int n) { pmtNumber = n; }
inline G4int GetPMTNumber() { return pmtNumber; }
inline void SetPMTNumber(G4int n) { fPmtNumber = n; }
inline G4int GetPMTNumber() { return fPmtNumber; }
inline void SetPMTPhysVol(G4VPhysicalVolume* physVol){this->physVol=physVol;}
inline G4VPhysicalVolume* GetPMTPhysVol(){return physVol;}
inline void SetPMTPhysVol(G4VPhysicalVolume* physVol){this->fPhysVol=physVol;}
inline G4VPhysicalVolume* GetPMTPhysVol(){return fPhysVol;}
inline void SetPMTPos(G4double x,G4double y,G4double z){
pos=G4ThreeVector(x,y,z);
}
inline G4ThreeVector GetPMTPos(){return pos;}
inline void SetPMTPos(G4double x,G4double y,G4double z){
fPos=G4ThreeVector(x,y,z);
}
inline G4ThreeVector GetPMTPos(){return fPos;}
private:
G4int pmtNumber;
G4int photons;
G4ThreeVector pos;
G4VPhysicalVolume* physVol;
G4bool drawit;
private:
G4int fPmtNumber;
G4int fPhotons;
G4ThreeVector fPos;
G4VPhysicalVolume* fPhysVol;
G4bool fDrawit;
};
@@ -97,5 +101,3 @@ inline void LXePMTHit::operator delete(void *aHit){
}
#endif
@@ -23,57 +23,63 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXePMTSD.hh
/// \brief Definition of the LXePMTSD class
//
//
#ifndef LXePMTSD_h
#define LXePMTSD_h 1
#include "G4DataVector.hh"
#include "G4VSensitiveDetector.hh"
#include "LXePMTHit.hh"
class G4Step;
class G4HCofThisEvent;
class LXePMTSD : public G4VSensitiveDetector
{
public:
LXePMTSD(G4String name);
~LXePMTSD();
void Initialize(G4HCofThisEvent* HCE);
G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist);
//A version of processHits that keeps aStep constant
G4bool ProcessHits_constStep(const G4Step* aStep,
G4TouchableHistory* ROhist);
void EndOfEvent(G4HCofThisEvent* HCE);
void clear();
void DrawAll();
void PrintAll();
//Initialize the arrays to store pmt possitions
inline void InitPMTs(G4int nPMTs){
if(pmtPositionsX)delete pmtPositionsX;
if(pmtPositionsY)delete pmtPositionsY;
if(pmtPositionsZ)delete pmtPositionsZ;
pmtPositionsX=new G4DataVector(nPMTs);
pmtPositionsY=new G4DataVector(nPMTs);
pmtPositionsZ=new G4DataVector(nPMTs);
}
public:
//Store a pmt position
inline void SetPMTPos(G4int n,G4double x,G4double y,G4double z){
if(pmtPositionsX)pmtPositionsX->insertAt(n,x);
if(pmtPositionsY)pmtPositionsY->insertAt(n,y);
if(pmtPositionsZ)pmtPositionsZ->insertAt(n,z);
}
private:
LXePMTHitsCollection* pmtHitCollection;
G4DataVector* pmtPositionsX;
G4DataVector* pmtPositionsY;
G4DataVector* pmtPositionsZ;
LXePMTSD(G4String name);
virtual ~LXePMTSD();
virtual void Initialize(G4HCofThisEvent* );
virtual G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* );
//A version of processHits that keeps aStep constant
G4bool ProcessHits_constStep(const G4Step* ,
G4TouchableHistory* );
virtual void EndOfEvent(G4HCofThisEvent* );
virtual void clear();
void DrawAll();
void PrintAll();
//Initialize the arrays to store pmt possitions
inline void InitPMTs(G4int nPMTs){
if(fPMTPositionsX)delete fPMTPositionsX;
if(fPMTPositionsY)delete fPMTPositionsY;
if(fPMTPositionsZ)delete fPMTPositionsZ;
fPMTPositionsX=new G4DataVector(nPMTs);
fPMTPositionsY=new G4DataVector(nPMTs);
fPMTPositionsZ=new G4DataVector(nPMTs);
}
//Store a pmt position
inline void SetPMTPos(G4int n,G4double x,G4double y,G4double z){
if(fPMTPositionsX)fPMTPositionsX->insertAt(n,x);
if(fPMTPositionsY)fPMTPositionsY->insertAt(n,y);
if(fPMTPositionsZ)fPMTPositionsZ->insertAt(n,z);
}
private:
LXePMTHitsCollection* fPMTHitCollection;
G4DataVector* fPMTPositionsX;
G4DataVector* fPMTPositionsY;
G4DataVector* fPMTPositionsZ;
};
#endif
@@ -23,7 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXePhysicsList.hh
/// \brief Definition of the LXePhysicsList class
//
//
#ifndef LXePhysicsList_h
#define LXePhysicsList_h 1
@@ -32,19 +35,16 @@
class LXePhysicsList: public G4VModularPhysicsList
{
public:
LXePhysicsList();
virtual ~LXePhysicsList();
public:
// SetCuts()
virtual void SetCuts();
public:
LXePhysicsList();
virtual ~LXePhysicsList();
public:
// SetCuts()
virtual void SetCuts();
};
#endif
@@ -23,7 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXePrimaryGeneratorAction.hh
/// \brief Definition of the LXePrimaryGeneratorAction class
//
//
#ifndef LXePrimaryGeneratorAction_h
#define LXePrimaryGeneratorAction_h 1
@@ -34,17 +37,18 @@ class G4Event;
class LXePrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
LXePrimaryGeneratorAction();
~LXePrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event* anEvent);
private:
G4ParticleGun* particleGun;
public:
LXePrimaryGeneratorAction();
virtual ~LXePrimaryGeneratorAction();
public:
virtual void GeneratePrimaries(G4Event* anEvent);
private:
G4ParticleGun* fParticleGun;
};
#endif
@@ -23,11 +23,14 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// RecorderBase.hh
/// \file optical/LXe/include/LXeRecorderBase.hh
/// \brief Definition of the LXeRecorderBase class
//
// LXeRecorderBase.hh
// 1-Sep-1999 Bill Seligman
// This is an abstract base class to be used with Geant 4.0.1 (and
// possibly higher, if the User classes don't change).
// possibly higher, if the User classes don't change).
// The concept of a Recorder object is that it records the activities of
// Geant in a manner that is useful to a physicist. Perhaps this record
@@ -36,7 +39,7 @@
// abstracts the behavior of a generalized recorder of Geant variables.
// No object should be instantiated from the Recorder class (in fact, any such
// object won't do anything). The user must define a new class (say, a class
// object won't do anything). The user must define a new class (say, a class
// that creates histograms) and overload the methods of this class.
// Why do this? First of all, it keeps all record-keeping in a single class:
@@ -67,23 +70,22 @@
#include "G4Track.hh"
#include "G4Step.hh"
class LXeRecorderBase {
class RecorderBase {
public:
public:
virtual ~LXeRecorderBase() {};
virtual ~RecorderBase() {};
// The following a list of methods that correspond to the available
// user action classes in Geant 4.0.1. In this base class, the
// methods are defined to do nothing.
// The following a list of methods that correspond to the available
// user action classes in Geant 4.0.1. In this base class, the
// methods are defined to do nothing.
virtual void RecordBeginOfRun(const G4Run*) = 0;
virtual void RecordEndOfRun(const G4Run*) = 0;
virtual void RecordBeginOfEvent(const G4Event*) {};
virtual void RecordEndOfEvent(const G4Event*) {};
virtual void RecordTrack(const G4Track*) {};
virtual void RecordStep(const G4Step*) {};
virtual void RecordBeginOfRun(const G4Run*) = 0;
virtual void RecordEndOfRun(const G4Run*) = 0;
virtual void RecordBeginOfEvent(const G4Event*) {};
virtual void RecordEndOfEvent(const G4Event*) {};
virtual void RecordTrack(const G4Track*) {};
virtual void RecordStep(const G4Step*) {};
};
@@ -23,24 +23,30 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeRunAction.hh
/// \brief Definition of the LXeRunAction class
//
//
#include "G4UserRunAction.hh"
#ifndef LXeRunAction_h
#define LXeRunAction_h 1
class RecorderBase;
class LXeRecorderBase;
class LXeRunAction : public G4UserRunAction
{
public:
LXeRunAction(RecorderBase*);
~LXeRunAction();
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
public:
private:
RecorderBase* recorder;
LXeRunAction(LXeRecorderBase*);
virtual ~LXeRunAction();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
private:
LXeRecorderBase* fRecorder;
};
#endif
@@ -23,7 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeScintHit.hh
/// \brief Definition of the LXeScintHit class
//
//
#ifndef LXeScintHit_h
#define LXeScintHit_h 1
@@ -38,34 +41,34 @@
class LXeScintHit : public G4VHit
{
public:
LXeScintHit();
LXeScintHit(G4VPhysicalVolume* pVol);
~LXeScintHit();
LXeScintHit(const LXeScintHit &right);
const LXeScintHit& operator=(const LXeScintHit &right);
G4int operator==(const LXeScintHit &right) const;
public:
LXeScintHit();
LXeScintHit(G4VPhysicalVolume* pVol);
virtual ~LXeScintHit();
LXeScintHit(const LXeScintHit &right);
const LXeScintHit& operator=(const LXeScintHit &right);
G4int operator==(const LXeScintHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
void Draw();
void Print();
inline void *operator new(size_t);
inline void operator delete(void *aHit);
virtual void Draw();
virtual void Print();
inline void SetEdep(G4double de) { edep = de; }
inline void AddEdep(G4double de) { edep += de; }
inline G4double GetEdep() { return edep; }
inline void SetPos(G4ThreeVector xyz) { pos = xyz; }
inline G4ThreeVector GetPos() { return pos; }
inline void SetEdep(G4double de) { fEdep = de; }
inline void AddEdep(G4double de) { fEdep += de; }
inline G4double GetEdep() { return fEdep; }
inline const G4VPhysicalVolume * GetPhysV() { return physVol; }
inline void SetPos(G4ThreeVector xyz) { fPos = xyz; }
inline G4ThreeVector GetPos() { return fPos; }
private:
G4double edep;
G4ThreeVector pos;
const G4VPhysicalVolume* physVol;
inline const G4VPhysicalVolume * GetPhysV() { return fPhysVol; }
private:
G4double fEdep;
G4ThreeVector fPos;
const G4VPhysicalVolume* fPhysVol;
};
@@ -86,5 +89,3 @@ inline void LXeScintHit::operator delete(void *aHit)
}
#endif
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeScintSD.hh
/// \brief Definition of the LXeScintSD class
//
//
#ifndef LXeScintSD_h
#define LXeScintSD_h 1
@@ -35,21 +39,22 @@ class G4HCofThisEvent;
class LXeScintSD : public G4VSensitiveDetector
{
public:
LXeScintSD(G4String name);
~LXeScintSD();
void Initialize(G4HCofThisEvent* HCE);
G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist);
void EndOfEvent(G4HCofThisEvent* HCE);
void clear();
void DrawAll();
void PrintAll();
private:
LXeScintHitsCollection* scintCollection;
public:
LXeScintSD(G4String name);
virtual ~LXeScintSD();
virtual void Initialize(G4HCofThisEvent* );
virtual G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* );
virtual void EndOfEvent(G4HCofThisEvent* );
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
LXeScintHitsCollection* fScintCollection;
};
#endif
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeStackingAction.hh
/// \brief Definition of the LXeStackingAction class
//
//
#ifndef LXeStackingAction_H
#define LXeStackingAction_H 1
@@ -31,15 +35,16 @@
class LXeStackingAction : public G4UserStackingAction
{
public:
LXeStackingAction();
~LXeStackingAction();
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
virtual void NewStage();
virtual void PrepareNewEvent();
private:
public:
LXeStackingAction();
virtual ~LXeStackingAction();
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
virtual void NewStage();
virtual void PrepareNewEvent();
private:
};
#endif
@@ -23,31 +23,40 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeSteppingAction.hh
/// \brief Definition of the LXeSteppingAction class
//
#ifndef LXeSteppingAction_H
#define LXeSteppingACtion_H 1
#include "globals.hh"
#include "G4UserSteppingAction.hh"
class RecorderBase;
#include "G4OpBoundaryProcess.hh"
class LXeRecorderBase;
class LXeEventAction;
class LXeTrackingAction;
class LXeSteppingMessenger;
class LXeSteppingAction : public G4UserSteppingAction
{
public:
LXeSteppingAction(RecorderBase*);
~LXeSteppingAction();
virtual void UserSteppingAction(const G4Step*);
public:
void SetOneStepPrimaries(G4bool b){oneStepPrimaries=b;}
G4bool GetOneStepPrimaries(){return oneStepPrimaries;}
private:
RecorderBase* recorder;
G4bool oneStepPrimaries;
LXeSteppingMessenger* steppingMessenger;
LXeSteppingAction(LXeRecorderBase*);
virtual ~LXeSteppingAction();
virtual void UserSteppingAction(const G4Step*);
void SetOneStepPrimaries(G4bool b){fOneStepPrimaries=b;}
G4bool GetOneStepPrimaries(){return fOneStepPrimaries;}
private:
LXeRecorderBase* fRecorder;
G4bool fOneStepPrimaries;
LXeSteppingMessenger* fSteppingMessenger;
G4OpBoundaryProcessStatus fExpectedNextStatus;
};
#endif
@@ -23,7 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeSteppingMessenger.hh
/// \brief Definition of the LXeSteppingMessenger class
//
//
#ifndef LXeSteppingMessenger_h
#define LXeSteppingMessenger_h 1
@@ -35,17 +38,17 @@ class G4UIcmdWithABool;
class LXeSteppingMessenger: public G4UImessenger
{
public:
LXeSteppingMessenger(LXeSteppingAction*);
~LXeSteppingMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
LXeSteppingAction* stepping;
G4UIcmdWithABool* oneStepPrimariesCmd;
public:
LXeSteppingMessenger(LXeSteppingAction*);
virtual ~LXeSteppingMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
LXeSteppingAction* fStepping;
G4UIcmdWithABool* fOneStepPrimariesCmd;
};
#endif
@@ -23,24 +23,24 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
class LXeSteppingVerbose;
/// \file optical/LXe/include/LXeSteppingVerbose.hh
/// \brief Definition of the LXeSteppingVerbose class
//
//
#ifndef LXeSteppingVerbose_h
#define LXeSteppingVerbose_h 1
#include "G4SteppingVerbose.hh"
class LXeSteppingVerbose : public G4SteppingVerbose
{
public:
public:
LXeSteppingVerbose();
~LXeSteppingVerbose();
LXeSteppingVerbose();
virtual ~LXeSteppingVerbose();
void StepInfo();
void TrackingStarted();
virtual void StepInfo();
virtual void TrackingStarted();
};
@@ -23,27 +23,32 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeTrackingAction.hh
/// \brief Definition of the LXeTrackingAction class
//
//
#ifndef LXeTrackingAction_h
#define LXeTrackingAction_h 1
#include "G4UserTrackingAction.hh"
#include "globals.hh"
class RecorderBase;
class LXeRecorderBase;
class LXeTrackingAction : public G4UserTrackingAction {
public:
LXeTrackingAction(RecorderBase*);
~LXeTrackingAction() {};
void PreUserTrackingAction(const G4Track*);
void PostUserTrackingAction(const G4Track*);
private:
RecorderBase* recorder;
public:
LXeTrackingAction(LXeRecorderBase*);
virtual ~LXeTrackingAction() {};
virtual void PreUserTrackingAction(const G4Track*);
virtual void PostUserTrackingAction(const G4Track*);
private:
LXeRecorderBase* fRecorder;
};
#endif
@@ -23,14 +23,17 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeTrajectory.hh
/// \brief Definition of the LXeTrajectory class
//
#ifndef LXeTrajectory_h
#define LXeTrajectory_h 1
#include "G4Trajectory.hh"
#include "G4Allocator.hh"
#include "G4ios.hh"
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#include "G4ios.hh"
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#include "G4TrajectoryPoint.hh"
#include "G4Track.hh"
#include "G4Step.hh"
@@ -39,28 +42,31 @@ class G4Polyline; // Forward declaration.
class LXeTrajectory : public G4Trajectory
{
public:
LXeTrajectory();
LXeTrajectory(const G4Track* aTrack);
LXeTrajectory(LXeTrajectory &);
virtual ~LXeTrajectory();
virtual void DrawTrajectory() const;
virtual void DrawTrajectory(G4int i_mode=0) const;
inline void* operator new(size_t);
inline void operator delete(void*);
public:
void SetDrawTrajectory(G4bool b){drawit=b;}
void WLS(){wls=true;}
void SetForceDrawTrajectory(G4bool b){forceDraw=b;}
void SetForceNoDrawTrajectory(G4bool b){forceNoDraw=b;}
private:
G4bool wls;
G4bool drawit;
G4bool forceNoDraw;
G4bool forceDraw;
G4ParticleDefinition* particleDefinition;
LXeTrajectory();
LXeTrajectory(const G4Track* aTrack);
LXeTrajectory(LXeTrajectory &);
virtual ~LXeTrajectory();
virtual void DrawTrajectory() const;
virtual void DrawTrajectory(G4int i_mode=0) const;
inline void* operator new(size_t);
inline void operator delete(void*);
void SetDrawTrajectory(G4bool b){fDrawit=b;}
void WLS(){fWls=true;}
void SetForceDrawTrajectory(G4bool b){fForceDraw=b;}
void SetForceNoDrawTrajectory(G4bool b){fForceNoDraw=b;}
private:
G4bool fWls;
G4bool fDrawit;
G4bool fForceNoDraw;
G4bool fForceDraw;
G4ParticleDefinition* fParticleDefinition;
};
extern G4Allocator<LXeTrajectory> LXeTrajectoryAllocator;
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeUserEventInformation.hh
/// \brief Definition of the LXeUserEventInformation class
//
#include "G4VUserEventInformation.hh"
#include "G4ThreeVector.hh"
#include "globals.hh"
@@ -32,70 +35,66 @@
class LXeUserEventInformation : public G4VUserEventInformation
{
public:
LXeUserEventInformation();
~LXeUserEventInformation();
inline void Print()const{};
public:
void IncPhotonCount_Scint(){photonCount_Scint++;}
void IncPhotonCount_Ceren(){photonCount_Ceren++;}
void IncEDep(G4double dep){totE+=dep;}
void IncAbsorption(){absorptionCount++;}
void IncBoundaryAbsorption(){boundaryAbsorptionCount++;}
void IncHitCount(G4int i=1){hitCount+=i;}
LXeUserEventInformation();
virtual ~LXeUserEventInformation();
void SetEWeightPos(const G4ThreeVector& p){eWeightPos=p;}
void SetReconPos(const G4ThreeVector& p){reconPos=p;}
void SetConvPos(const G4ThreeVector& p){convPos=p;convPosSet=true;}
void SetPosMax(const G4ThreeVector& p,G4double edep){posMax=p;edepMax=edep;}
inline virtual void Print()const{};
G4int GetPhotonCount_Scint()const {return photonCount_Scint;}
G4int GetPhotonCount_Ceren()const {return photonCount_Ceren;}
G4int GetHitCount()const {return hitCount;}
G4double GetEDep()const {return totE;}
G4int GetAbsorptionCount()const {return absorptionCount;}
G4int GetBoundaryAbsorptionCount() const {return boundaryAbsorptionCount;}
G4ThreeVector GetEWeightPos(){return eWeightPos;}
G4ThreeVector GetReconPos(){return reconPos;}
G4ThreeVector GetConvPos(){return convPos;}
G4ThreeVector GetPosMax(){return posMax;}
G4double GetEDepMax(){return edepMax;}
G4double IsConvPosSet(){return convPosSet;}
void IncPhotonCount_Scint(){fPhotonCount_Scint++;}
void IncPhotonCount_Ceren(){fPhotonCount_Ceren++;}
void IncEDep(G4double dep){fTotE+=dep;}
void IncAbsorption(){fAbsorptionCount++;}
void IncBoundaryAbsorption(){fBoundaryAbsorptionCount++;}
void IncHitCount(G4int i=1){fHitCount+=i;}
//Gets the total photon count produced
G4int GetPhotonCount(){return photonCount_Scint+photonCount_Ceren;}
void SetEWeightPos(const G4ThreeVector& p){fEWeightPos=p;}
void SetReconPos(const G4ThreeVector& p){fReconPos=p;}
void SetConvPos(const G4ThreeVector& p){fConvPos=p;fConvPosSet=true;}
void SetPosMax(const G4ThreeVector& p,G4double edep){fPosMax=p;fEdepMax=edep;}
void IncPMTSAboveThreshold(){pmtsAboveThreshold++;}
G4int GetPMTSAboveThreshold(){return pmtsAboveThreshold;}
G4int GetPhotonCount_Scint()const {return fPhotonCount_Scint;}
G4int GetPhotonCount_Ceren()const {return fPhotonCount_Ceren;}
G4int GetHitCount()const {return fHitCount;}
G4double GetEDep()const {return fTotE;}
G4int GetAbsorptionCount()const {return fAbsorptionCount;}
G4int GetBoundaryAbsorptionCount() const {return fBoundaryAbsorptionCount;}
private:
G4ThreeVector GetEWeightPos(){return fEWeightPos;}
G4ThreeVector GetReconPos(){return fReconPos;}
G4ThreeVector GetConvPos(){return fConvPos;}
G4ThreeVector GetPosMax(){return fPosMax;}
G4double GetEDepMax(){return fEdepMax;}
G4double IsConvPosSet(){return fConvPosSet;}
G4int hitCount;
G4int photonCount_Scint;
G4int photonCount_Ceren;
G4int absorptionCount;
G4int boundaryAbsorptionCount;
//Gets the total photon count produced
G4int GetPhotonCount(){return fPhotonCount_Scint+fPhotonCount_Ceren;}
G4double totE;
void IncPMTSAboveThreshold(){fPMTsAboveThreshold++;}
G4int GetPMTSAboveThreshold(){return fPMTsAboveThreshold;}
//These only have meaning if totE > 0
//If totE = 0 then these wont be set by EndOfEventAction
G4ThreeVector eWeightPos;
G4ThreeVector reconPos; //Also relies on hitCount>0
G4ThreeVector convPos;//true (initial) converstion position
G4bool convPosSet;
G4ThreeVector posMax;
G4double edepMax;
private:
G4int pmtsAboveThreshold;
G4int fHitCount;
G4int fPhotonCount_Scint;
G4int fPhotonCount_Ceren;
G4int fAbsorptionCount;
G4int fBoundaryAbsorptionCount;
G4double fTotE;
//These only have meaning if totE > 0
//If totE = 0 then these wont be set by EndOfEventAction
G4ThreeVector fEWeightPos;
G4ThreeVector fReconPos; //Also relies on hitCount>0
G4ThreeVector fConvPos;//true (initial) converstion position
G4bool fConvPosSet;
G4ThreeVector fPosMax;
G4double fEdepMax;
G4int fPMTsAboveThreshold;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeUserTrackInformation.hh
/// \brief Definition of the LXeUserTrackInformation class
//
#include "G4VUserTrackInformation.hh"
#include "globals.hh"
@@ -40,34 +43,37 @@ enum LXeTrackStatus { active=1, hitPMT=2, absorbed=4, boundaryAbsorbed=8,
hitSphere: track hit the sphere at some point
inactive: track is stopped for some reason
-This is the sum of all stopped flags so can be used to remove stopped flags
*/
*/
class LXeUserTrackInformation : public G4VUserTrackInformation
{
public:
LXeUserTrackInformation();
~LXeUserTrackInformation();
//Sets the track status to s (does not check validity of flags)
void SetTrackStatusFlags(int s){status=s;}
//Does a smart add of track status flags (disabling old flags that conflict)
//If s conflicts with itself it will not be detected
void AddTrackStatusFlag(int s);
int GetTrackStatus()const {return status;}
void IncReflections(){reflections++;}
G4int GetReflectionCount()const {return reflections;}
public:
void SetForceDrawTrajectory(G4bool b){forcedraw=b;}
G4bool GetForceDrawTrajectory(){return forcedraw;}
LXeUserTrackInformation();
virtual ~LXeUserTrackInformation();
inline void Print()const{};
private:
int status;
G4int reflections;
G4bool forcedraw;
//Sets the track status to s (does not check validity of flags)
void SetTrackStatusFlags(int s){fStatus=s;}
//Does a smart add of track status flags (disabling old flags that conflict)
//If s conflicts with itself it will not be detected
void AddTrackStatusFlag(int s);
int GetTrackStatus()const {return fStatus;}
void IncReflections(){fReflections++;}
G4int GetReflectionCount()const {return fReflections;}
void SetForceDrawTrajectory(G4bool b){fForcedraw=b;}
G4bool GetForceDrawTrajectory(){return fForcedraw;}
inline virtual void Print() const{};
private:
int fStatus;
G4int fReflections;
G4bool fForcedraw;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeWLSFiber.hh
/// \brief Definition of the LXeWLSFiber class
//
#ifndef LXeMainVolume_H
#define LXeMainVolume_H 1
@@ -38,40 +41,42 @@
class LXeWLSFiber : public G4PVPlacement
{
public:
LXeWLSFiber(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c);
private:
public:
void CopyValues();
LXeWLSFiber(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c);
static G4LogicalVolume* clad2_log;
private:
G4bool updated; //does the fiber need to be rebuilt
G4double fiber_rmin;
G4double fiber_rmax;
G4double fiber_z;
G4double fiber_sphi;
G4double fiber_ephi;
void CopyValues();
G4double clad1_rmin;
G4double clad1_rmax;
G4double clad1_z;
G4double clad1_sphi;
G4double clad1_ephi;
G4double clad2_rmin;
G4double clad2_rmax;
G4double clad2_z;
G4double clad2_sphi;
G4double clad2_ephi;
static G4LogicalVolume* fClad2_log;
LXeDetectorConstruction* constructor;
G4bool fUpdated; //does the fiber need to be rebuilt
G4double fFiber_rmin;
G4double fFiber_rmax;
G4double fFiber_z;
G4double fFiber_sphi;
G4double fFiber_ephi;
G4double fClad1_rmin;
G4double fClad1_rmax;
G4double fClad1_z;
G4double fClad1_sphi;
G4double fClad1_ephi;
G4double fClad2_rmin;
G4double fClad2_rmax;
G4double fClad2_z;
G4double fClad2_sphi;
G4double fClad2_ephi;
LXeDetectorConstruction* fConstructor;
};
#endif
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/include/LXeWLSSlab.hh
/// \brief Definition of the LXeWLSSlab class
//
//
#ifndef LXeWLSSlab_H
#define LXeWLSSlab_H 1
@@ -37,27 +41,30 @@
class LXeWLSSlab : public G4PVPlacement
{
public:
LXeWLSSlab(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c);
private:
void CopyValues();
LXeDetectorConstruction* constructor;
public:
G4bool updated;
LXeWLSSlab(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c);
static G4LogicalVolume* ScintSlab_log;
private:
G4int nfibers;
G4double scint_x;
G4double scint_y;
G4double scint_z;
G4double slab_z;
void CopyValues();
LXeDetectorConstruction* fConstructor;
G4bool fUpdated;
static G4LogicalVolume* fScintSlab_log;
G4int fNfibers;
G4double fScint_x;
G4double fScint_y;
G4double fScint_z;
G4double fSlab_z;
};
#endif
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeDetectorConstruction.cc
/// \brief Implementation of the LXeDetectorConstruction class
//
//
#include "LXeDetectorConstruction.hh"
#include "LXePMTSD.hh"
#include "LXeScintSD.hh"
@@ -50,22 +54,38 @@
#include "G4PhysicalVolumeStore.hh"
#include "G4GeometryManager.hh"
#include "G4UImanager.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
G4bool LXeDetectorConstruction::sphereOn = true;
G4bool LXeDetectorConstruction::fSphereOn = true;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeDetectorConstruction::LXeDetectorConstruction()
: LXe_mt(NULL), MPTPStyrene(NULL)
: fLXe_mt(NULL), fMPTPStyrene(NULL)
{
fExperimentalHall_box = NULL;
fExperimentalHall_log = NULL;
fExperimentalHall_phys = NULL;
fLXe = fAl = fAir = fVacuum = fGlass = NULL;
fPstyrene = fPMMA = fPethylene1 = fPethylene2 = NULL;
fN = fO = fC = fH = NULL;
fUpdated = false;
SetDefaults();
detectorMessenger = new LXeDetectorMessenger(this);
fDetectorMessenger = new LXeDetectorMessenger(this);
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeDetectorConstruction::~LXeDetectorConstruction(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeDetectorConstruction::~LXeDetectorConstruction() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeDetectorConstruction::DefineMaterials(){
G4double a; // atomic mass
G4double z; // atomic number
@@ -80,266 +100,271 @@ void LXeDetectorConstruction::DefineMaterials(){
G4int nH_eth = 4*polyeth;
//***Elements
H = new G4Element("H", "H", z=1., a=1.01*g/mole);
C = new G4Element("C", "C", z=6., a=12.01*g/mole);
N = new G4Element("N", "N", z=7., a= 14.01*g/mole);
O = new G4Element("O" , "O", z=8., a= 16.00*g/mole);
fH = new G4Element("H", "H", z=1., a=1.01*g/mole);
fC = new G4Element("C", "C", z=6., a=12.01*g/mole);
fN = new G4Element("N", "N", z=7., a= 14.01*g/mole);
fO = new G4Element("O" , "O", z=8., a= 16.00*g/mole);
//***Materials
//Liquid Xenon
LXe = new G4Material("LXe",z=54.,a=131.29*g/mole,density=3.020*g/cm3);
fLXe = new G4Material("LXe",z=54.,a=131.29*g/mole,density=3.020*g/cm3);
//Aluminum
Al = new G4Material("Al",z=13.,a=26.98*g/mole,density=2.7*g/cm3);
fAl = new G4Material("Al",z=13.,a=26.98*g/mole,density=2.7*g/cm3);
//Vacuum
Vacuum = new G4Material("Vacuum",z=1.,a=1.01*g/mole,
density=universe_mean_density,kStateGas,0.1*kelvin,
1.e-19*pascal);
fVacuum = new G4Material("Vacuum",z=1.,a=1.01*g/mole,
density=universe_mean_density,kStateGas,0.1*kelvin,
1.e-19*pascal);
//Air
Air = new G4Material("Air", density= 1.29*mg/cm3, 2);
Air->AddElement(N, 70*perCent);
Air->AddElement(O, 30*perCent);
fAir = new G4Material("Air", density= 1.29*mg/cm3, 2);
fAir->AddElement(fN, 70*perCent);
fAir->AddElement(fO, 30*perCent);
//Glass
Glass = new G4Material("Glass", density=1.032*g/cm3,2);
Glass->AddElement(C,91.533*perCent);
Glass->AddElement(H,8.467*perCent);
fGlass = new G4Material("Glass", density=1.032*g/cm3,2);
fGlass->AddElement(fC,91.533*perCent);
fGlass->AddElement(fH,8.467*perCent);
//Polystyrene
Pstyrene = new G4Material("Polystyrene", density= 1.03*g/cm3, 2);
Pstyrene->AddElement(C, 8);
Pstyrene->AddElement(H, 8);
fPstyrene = new G4Material("Polystyrene", density= 1.03*g/cm3, 2);
fPstyrene->AddElement(fC, 8);
fPstyrene->AddElement(fH, 8);
//Fiber(PMMA)
PMMA = new G4Material("PMMA", density=1190*kg/m3,3);
PMMA->AddElement(H,nH_PMMA);
PMMA->AddElement(C,nC_PMMA);
PMMA->AddElement(O,2);
fPMMA = new G4Material("PMMA", density=1190*kg/m3,3);
fPMMA->AddElement(fH,nH_PMMA);
fPMMA->AddElement(fC,nC_PMMA);
fPMMA->AddElement(fO,2);
//Cladding(polyethylene)
Pethylene = new G4Material("Pethylene", density=1200*kg/m3,2);
Pethylene->AddElement(H,nH_eth);
Pethylene->AddElement(C,nC_eth);
fPethylene1 = new G4Material("Pethylene1", density=1200*kg/m3,2);
fPethylene1->AddElement(fH,nH_eth);
fPethylene1->AddElement(fC,nC_eth);
//Double cladding(flourinated polyethylene)
fPethylene = new G4Material("fPethylene", density=1400*kg/m3,2);
fPethylene->AddElement(H,nH_eth);
fPethylene->AddElement(C,nC_eth);
fPethylene2 = new G4Material("Pethylene2", density=1400*kg/m3,2);
fPethylene2->AddElement(fH,nH_eth);
fPethylene2->AddElement(fC,nC_eth);
//***Material properties tables
const G4int LXe_NUMENTRIES = 3;
G4double LXe_Energy[LXe_NUMENTRIES] = { 7.0*eV , 7.07*eV, 7.14*eV };
const G4int lxenum = 3;
G4double lxe_Energy[lxenum] = { 7.0*eV , 7.07*eV, 7.14*eV };
G4double LXe_SCINT[LXe_NUMENTRIES] = { 0.1, 1.0, 0.1 };
G4double LXe_RIND[LXe_NUMENTRIES] = { 1.59 , 1.57, 1.54 };
G4double LXe_ABSL[LXe_NUMENTRIES] = { 35.*cm, 35.*cm, 35.*cm};
LXe_mt = new G4MaterialPropertiesTable();
LXe_mt->AddProperty("FASTCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);
LXe_mt->AddProperty("SLOWCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);
LXe_mt->AddProperty("RINDEX", LXe_Energy, LXe_RIND, LXe_NUMENTRIES);
LXe_mt->AddProperty("ABSLENGTH", LXe_Energy, LXe_ABSL, LXe_NUMENTRIES);
LXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
LXe_mt->AddConstProperty("RESOLUTIONSCALE",1.0);
LXe_mt->AddConstProperty("FASTTIMECONSTANT",20.*ns);
LXe_mt->AddConstProperty("SLOWTIMECONSTANT",45.*ns);
LXe_mt->AddConstProperty("YIELDRATIO",1.0);
LXe->SetMaterialPropertiesTable(LXe_mt);
G4double lxe_SCINT[lxenum] = { 0.1, 1.0, 0.1 };
G4double lxe_RIND[lxenum] = { 1.59 , 1.57, 1.54 };
G4double lxe_ABSL[lxenum] = { 35.*cm, 35.*cm, 35.*cm};
fLXe_mt = new G4MaterialPropertiesTable();
fLXe_mt->AddProperty("FASTCOMPONENT", lxe_Energy, lxe_SCINT, lxenum);
fLXe_mt->AddProperty("SLOWCOMPONENT", lxe_Energy, lxe_SCINT, lxenum);
fLXe_mt->AddProperty("RINDEX", lxe_Energy, lxe_RIND, lxenum);
fLXe_mt->AddProperty("ABSLENGTH", lxe_Energy, lxe_ABSL, lxenum);
fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
fLXe_mt->AddConstProperty("RESOLUTIONSCALE",1.0);
fLXe_mt->AddConstProperty("FASTTIMECONSTANT",20.*ns);
fLXe_mt->AddConstProperty("SLOWTIMECONSTANT",45.*ns);
fLXe_mt->AddConstProperty("YIELDRATIO",1.0);
fLXe->SetMaterialPropertiesTable(fLXe_mt);
// Set the Birks Constant for the LXe scintillator
LXe->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
G4double Glass_RIND[LXe_NUMENTRIES]={1.49,1.49,1.49};
G4double Glass_AbsLength[LXe_NUMENTRIES]={420.*cm,420.*cm,420.*cm};
G4MaterialPropertiesTable *Glass_mt = new G4MaterialPropertiesTable();
Glass_mt->AddProperty("ABSLENGTH",LXe_Energy,Glass_AbsLength,LXe_NUMENTRIES);
Glass_mt->AddProperty("RINDEX",LXe_Energy,Glass_RIND,LXe_NUMENTRIES);
Glass->SetMaterialPropertiesTable(Glass_mt);
fLXe->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
G4double glass_RIND[lxenum]={1.49,1.49,1.49};
G4double glass_AbsLength[lxenum]={420.*cm,420.*cm,420.*cm};
G4MaterialPropertiesTable *glass_mt = new G4MaterialPropertiesTable();
glass_mt->AddProperty("ABSLENGTH",lxe_Energy,glass_AbsLength,lxenum);
glass_mt->AddProperty("RINDEX",lxe_Energy,glass_RIND,lxenum);
fGlass->SetMaterialPropertiesTable(glass_mt);
G4double Vacuum_Energy[LXe_NUMENTRIES]={2.0*eV,7.0*eV,7.14*eV};
G4double Vacuum_RIND[LXe_NUMENTRIES]={1.,1.,1.};
G4MaterialPropertiesTable *Vacuum_mt = new G4MaterialPropertiesTable();
Vacuum_mt->AddProperty("RINDEX", Vacuum_Energy, Vacuum_RIND,LXe_NUMENTRIES);
Vacuum->SetMaterialPropertiesTable(Vacuum_mt);
Air->SetMaterialPropertiesTable(Vacuum_mt);//Give air the same rindex
G4double vacuum_Energy[lxenum]={2.0*eV,7.0*eV,7.14*eV};
G4double vacuum_RIND[lxenum]={1.,1.,1.};
G4MaterialPropertiesTable *vacuum_mt = new G4MaterialPropertiesTable();
vacuum_mt->AddProperty("RINDEX", vacuum_Energy, vacuum_RIND,lxenum);
fVacuum->SetMaterialPropertiesTable(vacuum_mt);
fAir->SetMaterialPropertiesTable(vacuum_mt);//Give air the same rindex
const G4int WLS_NUMENTRIES = 4;
G4double WLS_Energy[] = {2.00*eV,2.87*eV,2.90*eV,3.47*eV};
G4double RIndexPstyrene[WLS_NUMENTRIES]={ 1.5, 1.5, 1.5, 1.5};
G4double Absorption1[WLS_NUMENTRIES]={2.*cm, 2.*cm, 2.*cm, 2.*cm};
G4double ScintilFast[WLS_NUMENTRIES]={0.00, 0.00, 1.00, 1.00};
MPTPStyrene = new G4MaterialPropertiesTable();
MPTPStyrene->AddProperty("RINDEX",WLS_Energy,RIndexPstyrene,WLS_NUMENTRIES);
MPTPStyrene->AddProperty("ABSLENGTH",WLS_Energy,Absorption1,WLS_NUMENTRIES);
MPTPStyrene->AddProperty("FASTCOMPONENT",WLS_Energy, ScintilFast,
WLS_NUMENTRIES);
MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
MPTPStyrene->AddConstProperty("RESOLUTIONSCALE",1.0);
MPTPStyrene->AddConstProperty("FASTTIMECONSTANT", 10.*ns);
Pstyrene->SetMaterialPropertiesTable(MPTPStyrene);
const G4int wlsnum = 4;
G4double wls_Energy[] = {2.00*eV,2.87*eV,2.90*eV,3.47*eV};
G4double rIndexPstyrene[wlsnum]={ 1.5, 1.5, 1.5, 1.5};
G4double absorption1[wlsnum]={2.*cm, 2.*cm, 2.*cm, 2.*cm};
G4double scintilFast[wlsnum]={0.00, 0.00, 1.00, 1.00};
fMPTPStyrene = new G4MaterialPropertiesTable();
fMPTPStyrene->AddProperty("RINDEX",wls_Energy,rIndexPstyrene,wlsnum);
fMPTPStyrene->AddProperty("ABSLENGTH",wls_Energy,absorption1,wlsnum);
fMPTPStyrene->AddProperty("FASTCOMPONENT",wls_Energy, scintilFast,wlsnum);
fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
fMPTPStyrene->AddConstProperty("RESOLUTIONSCALE",1.0);
fMPTPStyrene->AddConstProperty("FASTTIMECONSTANT", 10.*ns);
fPstyrene->SetMaterialPropertiesTable(fMPTPStyrene);
// Set the Birks Constant for the Polystyrene scintillator
Pstyrene->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
fPstyrene->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
G4double RefractiveIndexFiber[WLS_NUMENTRIES]={ 1.60, 1.60, 1.60, 1.60};
G4double AbsFiber[WLS_NUMENTRIES]={9.00*m,9.00*m,0.1*mm,0.1*mm};
G4double EmissionFib[WLS_NUMENTRIES]={1.0, 1.0, 0.0, 0.0};
G4MaterialPropertiesTable* MPTFiber = new G4MaterialPropertiesTable();
MPTFiber->AddProperty("RINDEX",WLS_Energy,RefractiveIndexFiber,
WLS_NUMENTRIES);
MPTFiber->AddProperty("WLSABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
MPTFiber->AddProperty("WLSCOMPONENT",WLS_Energy,EmissionFib,WLS_NUMENTRIES);
MPTFiber->AddConstProperty("WLSTIMECONSTANT", 0.5*ns);
PMMA->SetMaterialPropertiesTable(MPTFiber);
G4double RefractiveIndexFiber[wlsnum]={ 1.60, 1.60, 1.60, 1.60};
G4double AbsFiber[wlsnum]={9.00*m,9.00*m,0.1*mm,0.1*mm};
G4double EmissionFib[wlsnum]={1.0, 1.0, 0.0, 0.0};
G4MaterialPropertiesTable* fiberProperty = new G4MaterialPropertiesTable();
fiberProperty->AddProperty("RINDEX",wls_Energy,RefractiveIndexFiber,wlsnum);
fiberProperty->AddProperty("WLSABSLENGTH",wls_Energy,AbsFiber,wlsnum);
fiberProperty->AddProperty("WLSCOMPONENT",wls_Energy,EmissionFib,wlsnum);
fiberProperty->AddConstProperty("WLSTIMECONSTANT", 0.5*ns);
fPMMA->SetMaterialPropertiesTable(fiberProperty);
G4double RefractiveIndexClad1[WLS_NUMENTRIES]={ 1.49, 1.49, 1.49, 1.49};
G4MaterialPropertiesTable* MPTClad1 = new G4MaterialPropertiesTable();
MPTClad1->AddProperty("RINDEX",WLS_Energy,RefractiveIndexClad1,
WLS_NUMENTRIES);
MPTClad1->AddProperty("ABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
Pethylene->SetMaterialPropertiesTable(MPTClad1);
G4double RefractiveIndexClad1[wlsnum]={ 1.49, 1.49, 1.49, 1.49};
G4MaterialPropertiesTable* clad1Property = new G4MaterialPropertiesTable();
clad1Property->AddProperty("RINDEX",wls_Energy,RefractiveIndexClad1,wlsnum);
clad1Property->AddProperty("ABSLENGTH",wls_Energy,AbsFiber,wlsnum);
fPethylene1->SetMaterialPropertiesTable(clad1Property);
G4double RefractiveIndexClad2[WLS_NUMENTRIES]={ 1.42, 1.42, 1.42, 1.42};
G4MaterialPropertiesTable* MPTClad2 = new G4MaterialPropertiesTable();
MPTClad2->AddProperty("RINDEX",WLS_Energy,RefractiveIndexClad2,
WLS_NUMENTRIES);
MPTClad2->AddProperty("ABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
fPethylene->SetMaterialPropertiesTable(MPTClad2);
G4double RefractiveIndexClad2[wlsnum]={ 1.42, 1.42, 1.42, 1.42};
G4MaterialPropertiesTable* clad2Property = new G4MaterialPropertiesTable();
clad2Property->AddProperty("RINDEX",wls_Energy,RefractiveIndexClad2,wlsnum);
clad2Property->AddProperty("ABSLENGTH",wls_Energy,AbsFiber,wlsnum);
fPethylene2->SetMaterialPropertiesTable(clad2Property);
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* LXeDetectorConstruction::Construct(){
DefineMaterials();
return ConstructDetector();
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* LXeDetectorConstruction::ConstructDetector()
{
//The experimental hall walls are all 1m away from housing walls
G4double expHall_x = scint_x+d_mtl+1.*m;
G4double expHall_y = scint_y+d_mtl+1.*m;
G4double expHall_z = scint_z+d_mtl+1.*m;
G4double expHall_x = fScint_x+fD_mtl+1.*m;
G4double expHall_y = fScint_y+fD_mtl+1.*m;
G4double expHall_z = fScint_z+fD_mtl+1.*m;
//Create experimental hall
experimentalHall_box
fExperimentalHall_box
= new G4Box("expHall_box",expHall_x,expHall_y,expHall_z);
experimentalHall_log = new G4LogicalVolume(experimentalHall_box,
Vacuum,"expHall_log",0,0,0);
experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),
experimentalHall_log,"expHall",0,false,0);
fExperimentalHall_log = new G4LogicalVolume(fExperimentalHall_box,
fVacuum,"expHall_log",0,0,0);
fExperimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),
fExperimentalHall_log,"expHall",0,false,0);
fExperimentalHall_log->SetVisAttributes(G4VisAttributes::Invisible);
experimentalHall_log->SetVisAttributes(G4VisAttributes::Invisible);
//Place the main volume
if(mainVolume){
new LXeMainVolume(0,G4ThreeVector(),experimentalHall_log,false,0,this);
if(fMainVolume){
new LXeMainVolume(0,G4ThreeVector(),fExperimentalHall_log,false,0,this);
}
//Place the WLS slab
if(WLSslab){
if(fWLSslab){
G4VPhysicalVolume* slab = new LXeWLSSlab(0,G4ThreeVector(0.,0.,
-scint_z/2.-slab_z-1.*cm),
experimentalHall_log,false,0,
this);
-fScint_z/2.-fSlab_z-1.*cm),
fExperimentalHall_log,false,0,
this);
//Surface properties for the WLS slab
G4OpticalSurface* ScintWrap = new G4OpticalSurface("ScintWrap");
G4OpticalSurface* scintWrap = new G4OpticalSurface("ScintWrap");
new G4LogicalBorderSurface("ScintWrap", slab,
experimentalHall_phys,
ScintWrap);
ScintWrap->SetType(dielectric_metal);
ScintWrap->SetFinish(polished);
ScintWrap->SetModel(glisur);
fExperimentalHall_phys,
scintWrap);
scintWrap->SetType(dielectric_metal);
scintWrap->SetFinish(polished);
scintWrap->SetModel(glisur);
const G4int NUM = 2;
const G4int num = 2;
G4double pp[num] = {2.0*eV, 3.5*eV};
G4double reflectivity[num] = {1., 1.};
G4double efficiency[num] = {0.0, 0.0};
G4double pp[NUM] = {2.0*eV, 3.5*eV};
G4double reflectivity[NUM] = {1., 1.};
G4double efficiency[NUM] = {0.0, 0.0};
G4MaterialPropertiesTable* ScintWrapProperty
G4MaterialPropertiesTable* scintWrapProperty
= new G4MaterialPropertiesTable();
ScintWrapProperty->AddProperty("REFLECTIVITY",pp,reflectivity,NUM);
ScintWrapProperty->AddProperty("EFFICIENCY",pp,efficiency,NUM);
ScintWrap->SetMaterialPropertiesTable(ScintWrapProperty);
scintWrapProperty->AddProperty("REFLECTIVITY",pp,reflectivity,num);
scintWrapProperty->AddProperty("EFFICIENCY",pp,efficiency,num);
scintWrap->SetMaterialPropertiesTable(scintWrapProperty);
}
return experimentalHall_phys;
return fExperimentalHall_phys;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetDimensions(G4ThreeVector dims){
this->scint_x=dims[0];
this->scint_y=dims[1];
this->scint_z=dims[2];
updated=true;
this->fScint_x=dims[0];
this->fScint_y=dims[1];
this->fScint_z=dims[2];
fUpdated=true;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetHousingThickness(G4double d_mtl){
this->d_mtl=d_mtl;
updated=true;
this->fD_mtl=d_mtl;
fUpdated=true;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNX(G4int nx){
this->nx=nx;
updated=true;
this->fNx=nx;
fUpdated=true;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNY(G4int ny){
this->ny=ny;
updated=true;
this->fNy=ny;
fUpdated=true;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNZ(G4int nz){
this->nz=nz;
updated=true;
this->fNz=nz;
fUpdated=true;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetPMTRadius(G4double outerRadius_pmt){
this->outerRadius_pmt=outerRadius_pmt;
updated=true;
this->fOuterRadius_pmt=outerRadius_pmt;
fUpdated=true;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetDefaults(){
//Resets to default values
d_mtl=0.0635*cm;
scint_x = 17.8*cm;
scint_y = 17.8*cm;
scint_z = 22.6*cm;
fD_mtl=0.0635*cm;
nx = 2;
ny = 2;
nz = 3;
fScint_x = 17.8*cm;
fScint_y = 17.8*cm;
fScint_z = 22.6*cm;
outerRadius_pmt = 2.3*cm;
fNx = 2;
fNy = 2;
fNz = 3;
sphereOn = true;
refl=1.0;
nfibers=15;
WLSslab=false;
mainVolume=true;
slab_z=2.5*mm;
fOuterRadius_pmt = 2.3*cm;
fSphereOn = true;
fRefl=1.0;
fNfibers=15;
fWLSslab=false;
fMainVolume=true;
fSlab_z=2.5*mm;
G4UImanager::GetUIpointer()
->ApplyCommand("/LXe/detector/scintYieldFactor 1.");
if(LXe_mt)LXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
if(MPTPStyrene)MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
updated=true;
if(fLXe_mt)fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
if(fMPTPStyrene)fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
fUpdated=true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeDetectorConstruction::UpdateGeometry(){
// clean-up previous geometry
@@ -356,18 +381,17 @@ void LXeDetectorConstruction::UpdateGeometry(){
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector());
G4RunManager::GetRunManager()->GeometryHasBeenModified();
updated=false;
fUpdated=false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetMainScintYield(G4double y){
LXe_mt->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetWLSScintYield(G4double y){
MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
}
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeDetectorMessenger.cc
/// \brief Implementation of the LXeDetectorMessenger class
//
//
#include "LXeDetectorMessenger.hh"
#include "LXeDetectorConstruction.hh"
@@ -35,154 +39,154 @@
#include "G4UIcmdWithADouble.hh"
#include "G4Scintillation.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeDetectorMessenger::LXeDetectorMessenger(LXeDetectorConstruction* LXeDetect)
:LXeDetector(LXeDetect)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeDetectorMessenger::LXeDetectorMessenger(LXeDetectorConstruction* detector)
: fLXeDetector(detector)
{
//Setup a command directory for detector controls with guidance
detectorDir = new G4UIdirectory("/LXe/detector/");
detectorDir->SetGuidance("Detector geometry control");
fDetectorDir = new G4UIdirectory("/LXe/detector/");
fDetectorDir->SetGuidance("Detector geometry control");
volumesDir = new G4UIdirectory("/LXe/detector/volumes/");
volumesDir->SetGuidance("Enable/disable volumes");
fVolumesDir = new G4UIdirectory("/LXe/detector/volumes/");
fVolumesDir->SetGuidance("Enable/disable volumes");
//Various commands for modifying detector geometry
dimensionsCmd =
fDimensionsCmd =
new G4UIcmdWith3VectorAndUnit("/LXe/detector/dimensions",this);
dimensionsCmd->SetGuidance("Set the dimensions of the detector volume.");
dimensionsCmd->SetParameterName("scint_x","scint_y","scint_z",false);
dimensionsCmd->SetDefaultUnit("cm");
fDimensionsCmd->SetGuidance("Set the dimensions of the detector volume.");
fDimensionsCmd->SetParameterName("scint_x","scint_y","scint_z",false);
fDimensionsCmd->SetDefaultUnit("cm");
housingThicknessCmd = new G4UIcmdWithADoubleAndUnit
fHousingThicknessCmd = new G4UIcmdWithADoubleAndUnit
("/LXe/detector/housingThickness",this);
housingThicknessCmd->SetGuidance("Set the thickness of the housing.");
housingThicknessCmd->SetParameterName("d_mtl",false);
housingThicknessCmd->SetDefaultUnit("cm");
fHousingThicknessCmd->SetGuidance("Set the thickness of the housing.");
fHousingThicknessCmd->SetParameterName("d_mtl",false);
fHousingThicknessCmd->SetDefaultUnit("cm");
pmtRadiusCmd = new G4UIcmdWithADoubleAndUnit
fPmtRadiusCmd = new G4UIcmdWithADoubleAndUnit
("/LXe/detector/pmtRadius",this);
pmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
pmtRadiusCmd->SetParameterName("radius",false);
pmtRadiusCmd->SetDefaultUnit("cm");
fPmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
fPmtRadiusCmd->SetParameterName("radius",false);
fPmtRadiusCmd->SetDefaultUnit("cm");
nxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
nxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
nxCmd->SetParameterName("nx",false);
fNxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
fNxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
fNxCmd->SetParameterName("nx",false);
nyCmd = new G4UIcmdWithAnInteger("/LXe/detector/ny",this);
nyCmd->SetGuidance("Set the number of PMTs along the y-dimension.");
nyCmd->SetParameterName("ny",false);
nzCmd = new G4UIcmdWithAnInteger("/LXe/detector/nz",this);
nzCmd->SetGuidance("Set the number of PMTs along the z-dimension.");
nzCmd->SetParameterName("nz",false);
fNyCmd = new G4UIcmdWithAnInteger("/LXe/detector/ny",this);
fNyCmd->SetGuidance("Set the number of PMTs along the y-dimension.");
fNyCmd->SetParameterName("ny",false);
sphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
sphereCmd->SetGuidance("Enable/Disable the sphere.");
fNzCmd = new G4UIcmdWithAnInteger("/LXe/detector/nz",this);
fNzCmd->SetGuidance("Set the number of PMTs along the z-dimension.");
fNzCmd->SetParameterName("nz",false);
reflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
reflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
fSphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
fSphereCmd->SetGuidance("Enable/Disable the sphere.");
wlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
wlsCmd->SetGuidance("Enable/Disable the WLS slab");
fReflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
fReflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
lxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
wlsCmd->SetGuidance("Enable/Disable the main detector volume.");
fWlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
fWlsCmd->SetGuidance("Enable/Disable the WLS slab");
nFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
nFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
fLxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
fLxeCmd->SetGuidance("Enable/Disable the main detector volume.");
updateCmd = new G4UIcommand("/LXe/detector/update",this);
updateCmd->SetGuidance("Update the detector geometry with changed values.");
updateCmd->SetGuidance
fNFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
fNFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
fUpdateCmd = new G4UIcommand("/LXe/detector/update",this);
fUpdateCmd->SetGuidance("Update the detector geometry with changed values.");
fUpdateCmd->SetGuidance
("Must be run before beamOn if detector has been changed.");
defaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
defaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
defaultsCmd->SetGuidance("(Update still required)");
MainScintYield=new G4UIcmdWithADouble("/LXe/detector/MainScintYield",this);
MainScintYield->SetGuidance("Set scinitillation yield of main volume.");
MainScintYield->SetGuidance("Specified in photons/MeV");
fDefaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
fDefaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
fDefaultsCmd->SetGuidance("(Update still required)");
WLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
WLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
WLSScintYield->SetGuidance("Specified in photons/MeV");
fMainScintYield=new G4UIcmdWithADouble("/LXe/detector/MainScintYield",this);
fMainScintYield->SetGuidance("Set scinitillation yield of main volume.");
fMainScintYield->SetGuidance("Specified in photons/MeV");
fWLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
fWLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
fWLSScintYield->SetGuidance("Specified in photons/MeV");
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeDetectorMessenger::~LXeDetectorMessenger()
{
delete dimensionsCmd;
delete housingThicknessCmd;
delete pmtRadiusCmd;
delete nxCmd;
delete nyCmd;
delete nzCmd;
delete updateCmd;
delete detectorDir;
delete volumesDir;
delete defaultsCmd;
delete sphereCmd;
delete wlsCmd;
delete lxeCmd;
delete nFibersCmd;
delete reflectivityCmd;
delete MainScintYield;
delete WLSScintYield;
delete fDimensionsCmd;
delete fHousingThicknessCmd;
delete fPmtRadiusCmd;
delete fNxCmd;
delete fNyCmd;
delete fNzCmd;
delete fUpdateCmd;
delete fDetectorDir;
delete fVolumesDir;
delete fDefaultsCmd;
delete fSphereCmd;
delete fWlsCmd;
delete fLxeCmd;
delete fNFibersCmd;
delete fReflectivityCmd;
delete fMainScintYield;
delete fWLSScintYield;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if( command == dimensionsCmd ){
LXeDetector->SetDimensions(dimensionsCmd->GetNew3VectorValue(newValue));
{
if( command == fDimensionsCmd ){
fLXeDetector->SetDimensions(fDimensionsCmd->GetNew3VectorValue(newValue));
}
else if (command == housingThicknessCmd){
LXeDetector->SetHousingThickness(housingThicknessCmd
->GetNewDoubleValue(newValue));
else if (command == fHousingThicknessCmd){
fLXeDetector->SetHousingThickness(fHousingThicknessCmd
->GetNewDoubleValue(newValue));
}
else if (command == pmtRadiusCmd){
LXeDetector->SetPMTRadius(pmtRadiusCmd->GetNewDoubleValue(newValue));
else if (command == fPmtRadiusCmd){
fLXeDetector->SetPMTRadius(fPmtRadiusCmd->GetNewDoubleValue(newValue));
}
else if (command == nxCmd){
LXeDetector->SetNX(nxCmd->GetNewIntValue(newValue));
else if (command == fNxCmd){
fLXeDetector->SetNX(fNxCmd->GetNewIntValue(newValue));
}
else if (command == nyCmd){
LXeDetector->SetNY(nyCmd->GetNewIntValue(newValue));
else if (command == fNyCmd){
fLXeDetector->SetNY(fNyCmd->GetNewIntValue(newValue));
}
else if (command == nzCmd){
LXeDetector->SetNZ(nzCmd->GetNewIntValue(newValue));
else if (command == fNzCmd){
fLXeDetector->SetNZ(fNzCmd->GetNewIntValue(newValue));
}
else if (command == updateCmd){
LXeDetector->UpdateGeometry();
else if (command == fUpdateCmd){
fLXeDetector->UpdateGeometry();
}
else if (command == defaultsCmd){
LXeDetector->SetDefaults();
else if (command == fDefaultsCmd){
fLXeDetector->SetDefaults();
}
else if (command == sphereCmd){
LXeDetector->SetSphereOn(sphereCmd->GetNewBoolValue(newValue));
else if (command == fSphereCmd){
fLXeDetector->SetSphereOn(fSphereCmd->GetNewBoolValue(newValue));
}
else if (command == reflectivityCmd){
LXeDetector
->SetHousingReflectivity(reflectivityCmd->GetNewDoubleValue(newValue));
else if (command == fReflectivityCmd){
fLXeDetector
->SetHousingReflectivity(fReflectivityCmd->GetNewDoubleValue(newValue));
}
else if (command == wlsCmd){
LXeDetector->SetWLSSlabOn(wlsCmd->GetNewBoolValue(newValue));
else if (command == fWlsCmd){
fLXeDetector->SetWLSSlabOn(fWlsCmd->GetNewBoolValue(newValue));
}
else if (command == lxeCmd){
LXeDetector->SetMainVolumeOn(lxeCmd->GetNewBoolValue(newValue));
else if (command == fLxeCmd){
fLXeDetector->SetMainVolumeOn(fLxeCmd->GetNewBoolValue(newValue));
}
else if (command == nFibersCmd){
LXeDetector->SetNFibers(nFibersCmd->GetNewIntValue(newValue));
else if (command == fNFibersCmd){
fLXeDetector->SetNFibers(fNFibersCmd->GetNewIntValue(newValue));
}
else if (command == MainScintYield){
LXeDetector->SetMainScintYield(MainScintYield->GetNewDoubleValue(newValue));
else if (command == fMainScintYield){
fLXeDetector->SetMainScintYield(fMainScintYield->GetNewDoubleValue(newValue));
}
else if (command == WLSScintYield){
LXeDetector->SetWLSScintYield(WLSScintYield->GetNewDoubleValue(newValue));
else if (command == fWLSScintYield){
fLXeDetector->SetWLSScintYield(fWLSScintYield->GetNewDoubleValue(newValue));
}
}
@@ -23,21 +23,38 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeEMPhysics.cc
/// \brief Implementation of the LXeEMPhysics class
//
//
#include "LXeEMPhysics.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip>
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEMPhysics::LXeEMPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{
fPhotoEffect = NULL;
fComptonEffect = NULL;
fPairProduction = NULL;
fElectronMultipleScattering = NULL;
fElectronIonisation = NULL;
fElectronBremsStrahlung = NULL;
fPositronMultipleScattering = NULL;
fPositronIonisation = NULL;
fPositronBremsStrahlung = NULL;
fAnnihilation = NULL;
}
LXeEMPhysics::~LXeEMPhysics()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEMPhysics::~LXeEMPhysics() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
@@ -62,53 +79,48 @@ void LXeEMPhysics::ConstructParticle()
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ProcessManager.hh"
void LXeEMPhysics::ConstructProcess()
{
thePhotoEffect = new G4PhotoElectricEffect();
theComptonEffect = new G4ComptonScattering();
thePairProduction = new G4GammaConversion();
fPhotoEffect = new G4PhotoElectricEffect();
fComptonEffect = new G4ComptonScattering();
fPairProduction = new G4GammaConversion();
// Electron physics
theElectronMultipleScattering = new G4eMultipleScattering();
theElectronIonisation = new G4eIonisation();
theElectronBremsStrahlung = new G4eBremsstrahlung();
fElectronMultipleScattering = new G4eMultipleScattering();
fElectronIonisation = new G4eIonisation();
fElectronBremsStrahlung = new G4eBremsstrahlung();
//Positron physics
thePositronMultipleScattering = new G4eMultipleScattering();
thePositronIonisation = new G4eIonisation();
thePositronBremsStrahlung = new G4eBremsstrahlung();
theAnnihilation = new G4eplusAnnihilation();
fPositronMultipleScattering = new G4eMultipleScattering();
fPositronIonisation = new G4eIonisation();
fPositronBremsStrahlung = new G4eBremsstrahlung();
fAnnihilation = new G4eplusAnnihilation();
G4ProcessManager* pManager = 0;
G4ProcessManager * pManager = 0;
// Gamma Physics
pManager = G4Gamma::Gamma()->GetProcessManager();
pManager->AddDiscreteProcess(thePhotoEffect);
pManager->AddDiscreteProcess(theComptonEffect);
pManager->AddDiscreteProcess(thePairProduction);
pManager->AddDiscreteProcess(fPhotoEffect);
pManager->AddDiscreteProcess(fComptonEffect);
pManager->AddDiscreteProcess(fPairProduction);
// Electron Physics
pManager = G4Electron::Electron()->GetProcessManager();
pManager->AddProcess(theElectronMultipleScattering, -1, 1, 1);
pManager->AddProcess(theElectronIonisation, -1, 2, 2);
pManager->AddProcess(theElectronBremsStrahlung, -1, 3, 3);
pManager->AddProcess(fElectronMultipleScattering, -1, 1, 1);
pManager->AddProcess(fElectronIonisation, -1, 2, 2);
pManager->AddProcess(fElectronBremsStrahlung, -1, 3, 3);
//Positron Physics
pManager = G4Positron::Positron()->GetProcessManager();
pManager->AddProcess(thePositronMultipleScattering, -1, 1, 1);
pManager->AddProcess(thePositronIonisation, -1, 2, 2);
pManager->AddProcess(thePositronBremsStrahlung, -1, 3, 3);
pManager->AddProcess(theAnnihilation, 0,-1, 4);
pManager->AddProcess(fPositronMultipleScattering, -1, 1, 1);
pManager->AddProcess(fPositronIonisation, -1, 2, 2);
pManager->AddProcess(fPositronBremsStrahlung, -1, 3, 3);
pManager->AddProcess(fAnnihilation, 0,-1, 4);
}
@@ -23,12 +23,16 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeEventAction.cc
/// \brief Implementation of the LXeEventAction class
//
//
#include "LXeEventAction.hh"
#include "LXeScintHit.hh"
#include "LXePMTHit.hh"
#include "LXeUserEventInformation.hh"
#include "LXeTrajectory.hh"
#include "RecorderBase.hh"
#include "LXeRecorderBase.hh"
#include "G4EventManager.hh"
#include "G4SDManager.hh"
@@ -40,171 +44,173 @@
#include "G4VVisManager.hh"
#include "G4ios.hh"
#include "G4UImanager.hh"
#include "G4SystemOfUnits.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeEventAction::LXeEventAction(RecorderBase* r)
:recorder(r),saveThreshold(0),scintCollID(-1),pmtCollID(-1),verbose(0),
pmtThreshold(1),forcedrawphotons(false),forcenophotons(false)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEventAction::LXeEventAction(LXeRecorderBase* r)
: fRecorder(r),fSaveThreshold(0),fScintCollID(-1),fPMTCollID(-1),fVerbose(0),
fPMTThreshold(1),fForcedrawphotons(false),fForcenophotons(false)
{
eventMessenger=new LXeEventMessenger(this);
fEventMessenger = new LXeEventMessenger(this);
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEventAction::~LXeEventAction(){}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeEventAction::BeginOfEventAction(const G4Event* anEvent){
//New event, add the user information object
G4EventManager::
GetEventManager()->SetUserInformation(new LXeUserEventInformation);
G4SDManager* SDman = G4SDManager::GetSDMpointer();
if(scintCollID<0)
scintCollID=SDman->GetCollectionID("scintCollection");
if(pmtCollID<0)
pmtCollID=SDman->GetCollectionID("pmtHitCollection");
if(recorder)recorder->RecordBeginOfEvent(anEvent);
G4SDManager* SDman = G4SDManager::GetSDMpointer();
if(fScintCollID<0)
fScintCollID=SDman->GetCollectionID("scintCollection");
if(fPMTCollID<0)
fPMTCollID=SDman->GetCollectionID("pmtHitCollection");
if(fRecorder)fRecorder->RecordBeginOfEvent(anEvent);
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeEventAction::EndOfEventAction(const G4Event* anEvent){
LXeUserEventInformation* eventInformation
=(LXeUserEventInformation*)anEvent->GetUserInformation();
G4TrajectoryContainer* trajectoryContainer=anEvent->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
// extract the trajectories and draw them
if (G4VVisManager::GetConcreteInstance()){
for (G4int i=0; i<n_trajectories; i++){
for (G4int i=0; i<n_trajectories; i++){
LXeTrajectory* trj = (LXeTrajectory*)
((*(anEvent->GetTrajectoryContainer()))[i]);
((*(anEvent->GetTrajectoryContainer()))[i]);
if(trj->GetParticleName()=="opticalphoton"){
trj->SetForceDrawTrajectory(forcedrawphotons);
trj->SetForceNoDrawTrajectory(forcenophotons);
trj->SetForceDrawTrajectory(fForcedrawphotons);
trj->SetForceNoDrawTrajectory(fForcenophotons);
}
trj->DrawTrajectory(50);
}
}
LXeScintHitsCollection* SHC = 0;
LXePMTHitsCollection* PHC = 0;
G4HCofThisEvent* HCE = anEvent->GetHCofThisEvent();
LXeScintHitsCollection* scintHC = 0;
LXePMTHitsCollection* pmtHC = 0;
G4HCofThisEvent* hitsCE = anEvent->GetHCofThisEvent();
//Get the hit collections
if(HCE){
if(scintCollID>=0)SHC = (LXeScintHitsCollection*)(HCE->GetHC(scintCollID));
if(pmtCollID>=0)PHC = (LXePMTHitsCollection*)(HCE->GetHC(pmtCollID));
if(hitsCE){
if(fScintCollID>=0)scintHC = (LXeScintHitsCollection*)(hitsCE->GetHC(fScintCollID));
if(fPMTCollID>=0)pmtHC = (LXePMTHitsCollection*)(hitsCE->GetHC(fPMTCollID));
}
//Hits in scintillator
if(SHC){
int n_hit = SHC->entries();
G4ThreeVector eWeightPos(0.);
if(scintHC){
int n_hit = scintHC->entries();
G4ThreeVector eWeightPos(0.);
G4double edep;
G4double edepMax=0;
for(int i=0;i<n_hit;i++){ //gather info on hits in scintillator
edep=(*SHC)[i]->GetEdep();
edep=(*scintHC)[i]->GetEdep();
eventInformation->IncEDep(edep); //sum up the edep
eWeightPos += (*SHC)[i]->GetPos()*edep;//calculate energy weighted pos
eWeightPos += (*scintHC)[i]->GetPos()*edep;//calculate energy weighted pos
if(edep>edepMax){
edepMax=edep;//store max energy deposit
G4ThreeVector posMax=(*SHC)[i]->GetPos();
eventInformation->SetPosMax(posMax,edep);
edepMax=edep;//store max energy deposit
G4ThreeVector posMax=(*scintHC)[i]->GetPos();
eventInformation->SetPosMax(posMax,edep);
}
}
if(eventInformation->GetEDep()==0.){
if(verbose>0)G4cout<<"No hits in the scintillator this event."<<G4endl;
}
if(fVerbose>0)G4cout<<"No hits in the scintillator this event."<<G4endl;
}
else{
//Finish calculation of energy weighted position
eWeightPos/=eventInformation->GetEDep();
eventInformation->SetEWeightPos(eWeightPos);
if(verbose>0){
G4cout << "\tEnergy weighted position of hits in LXe : "
<< eWeightPos/mm << G4endl;
if(fVerbose>0){
G4cout << "\tEnergy weighted position of hits in LXe : "
<< eWeightPos/mm << G4endl;
}
}
if(verbose>0){
if(fVerbose>0){
G4cout << "\tTotal energy deposition in scintillator : "
<< eventInformation->GetEDep() / keV << " (keV)" << G4endl;
<< eventInformation->GetEDep() / keV << " (keV)" << G4endl;
}
}
if(PHC){
if(pmtHC){
G4ThreeVector reconPos(0.,0.,0.);
G4int pmts=PHC->entries();
G4int pmts=pmtHC->entries();
//Gather info from all PMTs
for(G4int i=0;i<pmts;i++){
eventInformation->IncHitCount((*PHC)[i]->GetPhotonCount());
reconPos+=(*PHC)[i]->GetPMTPos()*(*PHC)[i]->GetPhotonCount();
if((*PHC)[i]->GetPhotonCount()>=pmtThreshold){
eventInformation->IncPMTSAboveThreshold();
eventInformation->IncHitCount((*pmtHC)[i]->GetPhotonCount());
reconPos+=(*pmtHC)[i]->GetPMTPos()*(*pmtHC)[i]->GetPhotonCount();
if((*pmtHC)[i]->GetPhotonCount()>=fPMTThreshold){
eventInformation->IncPMTSAboveThreshold();
}
else{//wasnt above the threshold, turn it back off
(*PHC)[i]->SetDrawit(false);
(*pmtHC)[i]->SetDrawit(false);
}
}
if(eventInformation->GetHitCount()>0){//dont bother unless there were hits
reconPos/=eventInformation->GetHitCount();
if(verbose>0){
G4cout << "\tReconstructed position of hits in LXe : "
<< reconPos/mm << G4endl;
if(fVerbose>0){
G4cout << "\tReconstructed position of hits in LXe : "
<< reconPos/mm << G4endl;
}
eventInformation->SetReconPos(reconPos);
}
PHC->DrawAllHits();
pmtHC->DrawAllHits();
}
if(verbose>0){
if(fVerbose>0){
//End of event output. later to be controlled by a verbose level
G4cout << "\tNumber of photons that hit PMTs in this event : "
<< eventInformation->GetHitCount() << G4endl;
G4cout << "\tNumber of PMTs above threshold("<<pmtThreshold<<") : "
<< eventInformation->GetPMTSAboveThreshold() << G4endl;
<< eventInformation->GetHitCount() << G4endl;
G4cout << "\tNumber of PMTs above threshold("<<fPMTThreshold<<") : "
<< eventInformation->GetPMTSAboveThreshold() << G4endl;
G4cout << "\tNumber of photons produced by scintillation in this event : "
<< eventInformation->GetPhotonCount_Scint() << G4endl;
<< eventInformation->GetPhotonCount_Scint() << G4endl;
G4cout << "\tNumber of photons produced by cerenkov in this event : "
<< eventInformation->GetPhotonCount_Ceren() << G4endl;
<< eventInformation->GetPhotonCount_Ceren() << G4endl;
G4cout << "\tNumber of photons absorbed (OpAbsorption) in this event : "
<< eventInformation->GetAbsorptionCount() << G4endl;
<< eventInformation->GetAbsorptionCount() << G4endl;
G4cout << "\tNumber of photons absorbed at boundaries (OpBoundary) in "
<< "this event : " << eventInformation->GetBoundaryAbsorptionCount()
<< G4endl;
G4cout << "Unacounted for photons in this event : "
<< (eventInformation->GetPhotonCount_Scint() +
eventInformation->GetPhotonCount_Ceren() -
eventInformation->GetAbsorptionCount() -
eventInformation->GetHitCount() -
eventInformation->GetBoundaryAbsorptionCount())
<< G4endl;
<< "this event : " << eventInformation->GetBoundaryAbsorptionCount()
<< G4endl;
G4cout << "Unacounted for photons in this event : "
<< (eventInformation->GetPhotonCount_Scint() +
eventInformation->GetPhotonCount_Ceren() -
eventInformation->GetAbsorptionCount() -
eventInformation->GetHitCount() -
eventInformation->GetBoundaryAbsorptionCount())
<< G4endl;
}
//If we have set the flag to save 'special' events, save here
if(saveThreshold&&eventInformation->GetPhotonCount() <= saveThreshold)
if(fSaveThreshold&&eventInformation->GetPhotonCount() <= fSaveThreshold)
G4RunManager::GetRunManager()->rndmSaveThisEvent();
if(recorder)recorder->RecordEndOfEvent(anEvent);
if(fRecorder)fRecorder->RecordEndOfEvent(anEvent);
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeEventAction::SetSaveThreshold(G4int save){
/*Sets the save threshold for the random number seed. If the number of photons
generated in an event is lower than this, then save the seed for this event
in a file called run###evt###.rndm
*/
saveThreshold=save;
fSaveThreshold=save;
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
G4RunManager::GetRunManager()->SetRandomNumberStoreDir("random/");
// G4UImanager::GetUIpointer()->ApplyCommand("/random/setSavingFlag 1");
}
@@ -23,73 +23,75 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeEventMessenger.cc
/// \brief Implementation of the LXeEventMessenger class
//
//
#include "LXeEventMessenger.hh"
#include "LXeEventAction.hh"
#include "G4UIcmdWithABool.hh"
#include "G4UIcmdWithAnInteger.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEventMessenger::LXeEventMessenger(LXeEventAction* event)
:LXeEvent(event)
: fLXeEvent(event)
{
saveThresholdCmd = new G4UIcmdWithAnInteger("/LXe/saveThreshold",this);
saveThresholdCmd->SetGuidance("Set the photon count threshold for saving the random number seed for an event.");
saveThresholdCmd->SetParameterName("photons",true);
saveThresholdCmd->SetDefaultValue(4500);
saveThresholdCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fSaveThresholdCmd = new G4UIcmdWithAnInteger("/LXe/saveThreshold",this);
fSaveThresholdCmd->SetGuidance("Set the photon count threshold for saving the random number seed for an event.");
fSaveThresholdCmd->SetParameterName("photons",true);
fSaveThresholdCmd->SetDefaultValue(4500);
fSaveThresholdCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
verboseCmd = new G4UIcmdWithAnInteger("/LXe/eventVerbose",this);
verboseCmd->SetGuidance("Set the verbosity of event data.");
verboseCmd->SetParameterName("verbose",true);
verboseCmd->SetDefaultValue(1);
fVerboseCmd = new G4UIcmdWithAnInteger("/LXe/eventVerbose",this);
fVerboseCmd->SetGuidance("Set the verbosity of event data.");
fVerboseCmd->SetParameterName("verbose",true);
fVerboseCmd->SetDefaultValue(1);
pmtThresholdCmd = new G4UIcmdWithAnInteger("/LXe/pmtThreshold",this);
pmtThresholdCmd->SetGuidance("Set the pmtThreshold (in # of photons)");
fPmtThresholdCmd = new G4UIcmdWithAnInteger("/LXe/pmtThreshold",this);
fPmtThresholdCmd->SetGuidance("Set the pmtThreshold (in # of photons)");
forceDrawPhotonsCmd=new G4UIcmdWithABool("/LXe/forceDrawPhotons",this);
forceDrawPhotonsCmd->SetGuidance("Force drawing of photons.");
forceDrawPhotonsCmd
fForceDrawPhotonsCmd=new G4UIcmdWithABool("/LXe/forceDrawPhotons",this);
fForceDrawPhotonsCmd->SetGuidance("Force drawing of photons.");
fForceDrawPhotonsCmd
->SetGuidance("(Higher priority than /LXe/forceDrawNoPhotons)");
forceDrawNoPhotonsCmd=new G4UIcmdWithABool("/LXe/forceDrawNoPhotons",this);
forceDrawNoPhotonsCmd->SetGuidance("Force no drawing of photons.");
forceDrawNoPhotonsCmd
fForceDrawNoPhotonsCmd=new G4UIcmdWithABool("/LXe/forceDrawNoPhotons",this);
fForceDrawNoPhotonsCmd->SetGuidance("Force no drawing of photons.");
fForceDrawNoPhotonsCmd
->SetGuidance("(Lower priority than /LXe/forceDrawPhotons)");
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEventMessenger::~LXeEventMessenger(){
delete saveThresholdCmd;
delete verboseCmd;
delete pmtThresholdCmd;
delete forceDrawPhotonsCmd;
delete forceDrawNoPhotonsCmd;
delete fSaveThresholdCmd;
delete fVerboseCmd;
delete fPmtThresholdCmd;
delete fForceDrawPhotonsCmd;
delete fForceDrawNoPhotonsCmd;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeEventMessenger::SetNewValue(G4UIcommand* command, G4String newValue){
if( command == saveThresholdCmd ){
LXeEvent->SetSaveThreshold(saveThresholdCmd->GetNewIntValue(newValue));
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeEventMessenger::SetNewValue(G4UIcommand* command, G4String newValue){
if( command == fSaveThresholdCmd ){
fLXeEvent->SetSaveThreshold(fSaveThresholdCmd->GetNewIntValue(newValue));
}
else if( command == verboseCmd ){
LXeEvent->SetEventVerbose(verboseCmd->GetNewIntValue(newValue));
else if( command == fVerboseCmd ){
fLXeEvent->SetEventVerbose(fVerboseCmd->GetNewIntValue(newValue));
}
else if( command == pmtThresholdCmd ){
LXeEvent->SetPMTThreshold(pmtThresholdCmd->GetNewIntValue(newValue));
else if( command == fPmtThresholdCmd ){
fLXeEvent->SetPMTThreshold(fPmtThresholdCmd->GetNewIntValue(newValue));
}
else if(command == forceDrawPhotonsCmd){
LXeEvent->SetForceDrawPhotons(forceDrawPhotonsCmd
->GetNewBoolValue(newValue));
else if(command == fForceDrawPhotonsCmd){
fLXeEvent->SetForceDrawPhotons(fForceDrawPhotonsCmd
->GetNewBoolValue(newValue));
}
else if(command == forceDrawNoPhotonsCmd){
LXeEvent->SetForceDrawNoPhotons(forceDrawNoPhotonsCmd
->GetNewBoolValue(newValue));
else if(command == fForceDrawNoPhotonsCmd){
fLXeEvent->SetForceDrawNoPhotons(fForceDrawNoPhotonsCmd
->GetNewBoolValue(newValue));
G4cout<<"TEST"<<G4endl;
}
}
@@ -23,20 +23,28 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeGeneralPhysics.cc
/// \brief Implementation of the LXeGeneralPhysics class
//
//
#include "LXeGeneralPhysics.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip>
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeGeneralPhysics::LXeGeneralPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{
: G4VPhysicsConstructor(name) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeGeneralPhysics::~LXeGeneralPhysics() {
fDecayProcess = NULL;
}
LXeGeneralPhysics::~LXeGeneralPhysics()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
@@ -48,9 +56,11 @@ void LXeGeneralPhysics::ConstructParticle()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeGeneralPhysics::ConstructProcess()
{
fDecayProcess = new G4Decay();
@@ -60,7 +70,7 @@ void LXeGeneralPhysics::ConstructProcess()
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fDecayProcess->IsApplicable(*particle)) {
if (fDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(fDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
@@ -68,5 +78,3 @@ void LXeGeneralPhysics::ConstructProcess()
}
}
}
+154 -148
View File
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeMainVolume.cc
/// \brief Implementation of the LXeMainVolume class
//
//
#include "LXeMainVolume.hh"
#include "globals.hh"
#include "G4SDManager.hh"
@@ -30,140 +34,139 @@
#include "G4LogicalBorderSurface.hh"
#include "LXePMTSD.hh"
#include "LXeScintSD.hh"
#include "G4SystemOfUnits.hh"
LXeScintSD* LXeMainVolume::scint_SD;
LXePMTSD* LXeMainVolume::pmt_SD;
LXeScintSD* LXeMainVolume::fScint_SD=NULL;
LXePMTSD* LXeMainVolume::fPmt_SD=NULL;
G4LogicalVolume* LXeMainVolume::housing_log=NULL;
G4LogicalVolume* LXeMainVolume::fHousing_log=NULL;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeMainVolume::LXeMainVolume(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c)
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c)
//Pass info to the G4PVPlacement constructor
:G4PVPlacement(pRot,tlate,
//Temp logical volume must be created here
new G4LogicalVolume(new G4Box("temp",1,1,1),
G4Material::GetMaterial("Vacuum"),
"temp",0,0,0),
"housing",pMotherLogical,pMany,pCopyNo),constructor(c)
//Temp logical volume must be created here
new G4LogicalVolume(new G4Box("temp",1,1,1),
G4Material::GetMaterial("Vacuum"),
"temp",0,0,0),
"housing",pMotherLogical,pMany,pCopyNo),fConstructor(c)
{
CopyValues();
if(!housing_log || updated){
G4double housing_x=scint_x+d_mtl;
G4double housing_y=scint_y+d_mtl;
G4double housing_z=scint_z+d_mtl;
if(!fHousing_log || fUpdated){
G4double housing_x=fScint_x+fD_mtl;
G4double housing_y=fScint_y+fD_mtl;
G4double housing_z=fScint_z+fD_mtl;
//*************************** housing and scintillator
scint_box = new G4Box("scint_box",scint_x/2.,scint_y/2.,scint_z/2.);
housing_box = new G4Box("housing_box",housing_x/2.,housing_y/2.,
housing_z/2.);
scint_log = new G4LogicalVolume(scint_box,G4Material::GetMaterial("LXe"),
"scint_log",0,0,0);
housing_log = new G4LogicalVolume(housing_box,
G4Material::GetMaterial("Al"),
"housing_log",0,0,0);
scint_phys = new G4PVPlacement(0,G4ThreeVector(),scint_log,"scintillator",
housing_log,false,0);
fScint_box = new G4Box("scint_box",fScint_x/2.,fScint_y/2.,fScint_z/2.);
fHousing_box = new G4Box("housing_box",housing_x/2.,housing_y/2.,
housing_z/2.);
fScint_log = new G4LogicalVolume(fScint_box,G4Material::GetMaterial("LXe"),
"scint_log",0,0,0);
fHousing_log = new G4LogicalVolume(fHousing_box,
G4Material::GetMaterial("Al"),
"housing_log",0,0,0);
new G4PVPlacement(0,G4ThreeVector(),fScint_log,"scintillator",
fHousing_log,false,0);
//*************** Miscellaneous sphere to demonstrate skin surfaces
sphere = new G4Sphere("sphere",0.*mm,2.*cm,0.*deg,360.*deg,0.*deg,
360.*deg);
sphere_log = new G4LogicalVolume(sphere,G4Material::GetMaterial("Al"),
"sphere_log");
if(sphereOn)
sphere_phys = new G4PVPlacement(0,G4ThreeVector(5.*cm,5.*cm,5.*cm),
sphere_log,"sphere",scint_log,false,0);
fSphere = new G4Sphere("sphere",0.*mm,2.*cm,0.*deg,360.*deg,0.*deg,
360.*deg);
fSphere_log = new G4LogicalVolume(fSphere,G4Material::GetMaterial("Al"),
"sphere_log");
if(fSphereOn)
new G4PVPlacement(0,G4ThreeVector(5.*cm,5.*cm,5.*cm),
fSphere_log,"sphere",fScint_log,false,0);
//****************** Build PMTs
G4double innerRadius_pmt = 0.*cm;
G4double height_pmt = d_mtl/2.;
G4double height_pmt = fD_mtl/2.;
G4double startAngle_pmt = 0.*deg;
G4double spanningAngle_pmt = 360.*deg;
pmt = new G4Tubs("pmt_tube",innerRadius_pmt,outerRadius_pmt,
height_pmt,startAngle_pmt,spanningAngle_pmt);
fPmt = new G4Tubs("pmt_tube",innerRadius_pmt,fOuterRadius_pmt,
height_pmt,startAngle_pmt,spanningAngle_pmt);
//the "photocathode" is a metal slab at the back of the glass that
//is only a very rough approximation of the real thing since it only
//absorbs or detects the photons based on the efficiency set below
photocath = new G4Tubs("photocath_tube",innerRadius_pmt,outerRadius_pmt,
height_pmt/2,startAngle_pmt,spanningAngle_pmt);
pmt_log = new G4LogicalVolume(pmt,G4Material::GetMaterial("Glass"),
"pmt_log");
photocath_log = new G4LogicalVolume(photocath,
G4Material::GetMaterial("Al"),
"photocath_log");
photocath_phys = new G4PVPlacement(0,G4ThreeVector(0,0,-height_pmt/2),
photocath_log,"photocath",
pmt_log,false,0);
fPhotocath = new G4Tubs("photocath_tube",innerRadius_pmt,fOuterRadius_pmt,
height_pmt/2,startAngle_pmt,spanningAngle_pmt);
fPmt_log = new G4LogicalVolume(fPmt,G4Material::GetMaterial("Glass"),
"pmt_log");
fPhotocath_log = new G4LogicalVolume(fPhotocath,
G4Material::GetMaterial("Al"),
"photocath_log");
new G4PVPlacement(0,G4ThreeVector(0,0,-height_pmt/2),
fPhotocath_log,"photocath",
fPmt_log,false,0);
//***********Arrange pmts around the outside of housing**********
//---pmt sensitive detector
G4SDManager* SDman = G4SDManager::GetSDMpointer();
if(!pmt_SD){
pmt_SD = new LXePMTSD("/LXeDet/pmtSD");
SDman->AddNewDetector(pmt_SD);
if(!fPmt_SD){
fPmt_SD = new LXePMTSD("/LXeDet/pmtSD");
SDman->AddNewDetector(fPmt_SD);
//Created here so it exists as pmts are being placed
}
pmt_SD->InitPMTs((nx*ny+nx*nz+ny*nz)*2); //let pmtSD know # of pmts
fPmt_SD->InitPMTs((fNx*fNy+fNx*fNz+fNy*fNz)*2); //let pmtSD know # of pmts
//-------
G4double dx = scint_x/nx;
G4double dy = scint_y/ny;
G4double dz = scint_z/nz;
G4double dx = fScint_x/fNx;
G4double dy = fScint_y/fNy;
G4double dz = fScint_z/fNz;
G4double x,y,z;
G4double xmin = -scint_x/2. - dx/2.;
G4double ymin = -scint_y/2. - dy/2.;
G4double zmin = -scint_z/2. - dz/2.;
G4double xmin = -fScint_x/2. - dx/2.;
G4double ymin = -fScint_y/2. - dy/2.;
G4double zmin = -fScint_z/2. - dz/2.;
G4int k=0;
z = -scint_z/2. - height_pmt; //front
PlacePMTs(pmt_log,0,x,y,dx,dy,xmin,ymin,nx,ny,x,y,z,k,pmt_SD);
z = -fScint_z/2. - height_pmt; //front
PlacePMTs(fPmt_log,0,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_z = new G4RotationMatrix();
rm_z->rotateY(180*deg);
z = scint_z/2. + height_pmt; //back
PlacePMTs(pmt_log,rm_z,x,y,dx,dy,xmin,ymin,nx,ny,x,y,z,k,pmt_SD);
z = fScint_z/2. + height_pmt; //back
PlacePMTs(fPmt_log,rm_z,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_y1 = new G4RotationMatrix();
rm_y1->rotateY(-90*deg);
x = -scint_x/2. - height_pmt; //left
PlacePMTs(pmt_log,rm_y1,y,z,dy,dz,ymin,zmin,ny,nz,x,y,z,k,pmt_SD);
x = -fScint_x/2. - height_pmt; //left
PlacePMTs(fPmt_log,rm_y1,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_y2 = new G4RotationMatrix();
rm_y2->rotateY(90*deg);
x = scint_x/2. + height_pmt; //right
PlacePMTs(pmt_log,rm_y2,y,z,dy,dz,ymin,zmin,ny,nz,x,y,z,k,pmt_SD);
x = fScint_x/2. + height_pmt; //right
PlacePMTs(fPmt_log,rm_y2,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_x1 = new G4RotationMatrix();
rm_x1->rotateX(90*deg);
y = -scint_y/2. - height_pmt; //bottom
PlacePMTs(pmt_log,rm_x1,x,z,dx,dz,xmin,zmin,nx,nz,x,y,z,k,pmt_SD);
y = -fScint_y/2. - height_pmt; //bottom
PlacePMTs(fPmt_log,rm_x1,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_x2 = new G4RotationMatrix();
rm_x2->rotateX(-90*deg);
y = scint_y/2. + height_pmt; //top
PlacePMTs(pmt_log,rm_x2,x,z,dx,dz,xmin,zmin,nx,nz,x,y,z,k,pmt_SD);
y = fScint_y/2. + height_pmt; //top
PlacePMTs(fPmt_log,rm_x2,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k,fPmt_SD);
//**********Setup Sensitive Detectors***************
if(!scint_SD){//determine if it has already been created
scint_SD = new LXeScintSD("/LXeDet/scintSD");
SDman->AddNewDetector(scint_SD);
if(!fScint_SD){//determine if it has already been created
fScint_SD = new LXeScintSD("/LXeDet/scintSD");
SDman->AddNewDetector(fScint_SD);
}
scint_log->SetSensitiveDetector(scint_SD);
fScint_log->SetSensitiveDetector(fScint_SD);
//sensitive detector is not actually on the photocathode.
//processHits gets done manually by the stepping action.
//It is used to detect when photons hit and get absorbed&detected at the
@@ -171,41 +174,44 @@ LXeMainVolume::LXeMainVolume(G4RotationMatrix *pRot,
//logical volume.
//It does however need to be attached to something or else it doesnt get
//reset at the begining of events
photocath_log->SetSensitiveDetector(pmt_SD);
fPhotocath_log->SetSensitiveDetector(fPmt_SD);
VisAttributes();
SurfaceProperties();
}
SetLogicalVolume(housing_log);
SetLogicalVolume(fHousing_log);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeMainVolume::CopyValues(){
updated=constructor->GetUpdated();
fUpdated=fConstructor->GetUpdated();
scint_x=constructor->GetScintX();
scint_y=constructor->GetScintY();
scint_z=constructor->GetScintZ();
d_mtl=constructor->GetHousingThickness();
nx=constructor->GetNX();
ny=constructor->GetNY();
nz=constructor->GetNZ();
outerRadius_pmt=constructor->GetPMTRadius();
sphereOn=constructor->GetSphereOn();
refl=constructor->GetHousingReflectivity();
fScint_x=fConstructor->GetScintX();
fScint_y=fConstructor->GetScintY();
fScint_z=fConstructor->GetScintZ();
fD_mtl=fConstructor->GetHousingThickness();
fNx=fConstructor->GetNX();
fNy=fConstructor->GetNY();
fNz=fConstructor->GetNZ();
fOuterRadius_pmt=fConstructor->GetPMTRadius();
fSphereOn=fConstructor->GetSphereOn();
fRefl=fConstructor->GetHousingReflectivity();
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeMainVolume::PlacePMTs(G4LogicalVolume* pmt_log,
G4RotationMatrix *rot,
G4double &a, G4double &b, G4double da,
G4double db, G4double amin,
G4double bmin, G4int na, G4int nb,
G4double &x, G4double &y, G4double &z,
G4int &k,LXePMTSD* sd){
G4RotationMatrix *rot,
G4double &a, G4double &b, G4double da,
G4double db, G4double amin,
G4double bmin, G4int na, G4int nb,
G4double &x, G4double &y, G4double &z,
G4int &k,LXePMTSD* sd){
/*PlacePMTs : a different way to parameterize placement that does not depend on
calculating the position from the copy number
pmt_log = logical volume for pmts to be placed
rot = rotation matrix to apply
a,b = coordinates to vary(ie. if varying in the xy plane then pass x,y)
@@ -223,66 +229,66 @@ void LXeMainVolume::PlacePMTs(G4LogicalVolume* pmt_log,
for(G4int i=1;i<=nb;i++){
b+=db;
new G4PVPlacement(rot,G4ThreeVector(x,y,z),pmt_log,"pmt",
housing_log,false,k);
fHousing_log,false,k);
sd->SetPMTPos(k,x,y,z);
k++;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeMainVolume::VisAttributes(){
G4VisAttributes* housing_va = new G4VisAttributes(G4Colour(0.8,0.8,0.8));
housing_log->SetVisAttributes(housing_va);
fHousing_log->SetVisAttributes(housing_va);
G4VisAttributes* sphere_va = new G4VisAttributes();
sphere_va->SetForceSolid(true);
sphere_log->SetVisAttributes(sphere_va);
fSphere_log->SetVisAttributes(sphere_va);
}
void LXeMainVolume::SurfaceProperties(){
const G4int num = 2;
G4double Ephoton[num] = {7.0*eV, 7.14*eV};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//**Scintillator housing properties
G4double Reflectivity[num] = {refl, refl};
G4double Efficiency[num] = {0.0, 0.0};
G4MaterialPropertiesTable* scintHsngPT = new G4MaterialPropertiesTable();
scintHsngPT->AddProperty("REFLECTIVITY", Ephoton, Reflectivity, num);
scintHsngPT->AddProperty("EFFICIENCY", Ephoton, Efficiency, num);
void LXeMainVolume::SurfaceProperties(){
const G4int num = 2;
G4double ephoton[num] = {7.0*eV, 7.14*eV};
//**Scintillator housing properties
G4double reflectivity[num] = {fRefl, fRefl};
G4double efficiency[num] = {0.0, 0.0};
G4MaterialPropertiesTable* scintHsngPT = new G4MaterialPropertiesTable();
scintHsngPT->AddProperty("REFLECTIVITY", ephoton, reflectivity, num);
scintHsngPT->AddProperty("EFFICIENCY", ephoton, efficiency, num);
G4OpticalSurface* OpScintHousingSurface =
new G4OpticalSurface("HousingSurface",unified,polished,dielectric_metal);
OpScintHousingSurface->SetMaterialPropertiesTable(scintHsngPT);
//**Sphere surface properties
G4double SphereReflectivity[num] = {1.0, 1.0};
G4double SphereEfficiency[num] = {0.0, 0.0};
G4double sphereReflectivity[num] = {1.0, 1.0};
G4double sphereEfficiency[num] = {0.0, 0.0};
G4MaterialPropertiesTable* spherePT = new G4MaterialPropertiesTable();
spherePT->AddProperty("REFLECTIVITY", Ephoton, SphereReflectivity, num);
spherePT->AddProperty("EFFICIENCY", Ephoton, SphereEfficiency, num);
spherePT->AddProperty("REFLECTIVITY", ephoton, sphereReflectivity, num);
spherePT->AddProperty("EFFICIENCY", ephoton, sphereEfficiency, num);
G4OpticalSurface* OpSphereSurface =
new G4OpticalSurface("SphereSurface",unified,polished,dielectric_metal);
OpSphereSurface->SetMaterialPropertiesTable(spherePT);
//**Photocathode surface properties
G4double photocath_EFF[num]={1.,1.}; //Enables 'detection' of photons
G4double photocath_ReR[num]={1.92,1.92};
G4double photocath_ImR[num]={1.69,1.69};
G4MaterialPropertiesTable* photocath_mt = new G4MaterialPropertiesTable();
photocath_mt->AddProperty("EFFICIENCY",Ephoton,photocath_EFF,num);
photocath_mt->AddProperty("REALRINDEX",Ephoton,photocath_ReR,num);
photocath_mt->AddProperty("IMAGINARYRINDEX",Ephoton,photocath_ImR,num);
G4OpticalSurface* photocath_opsurf=
photocath_mt->AddProperty("EFFICIENCY",ephoton,photocath_EFF,num);
photocath_mt->AddProperty("REALRINDEX",ephoton,photocath_ReR,num);
photocath_mt->AddProperty("IMAGINARYRINDEX",ephoton,photocath_ImR,num);
G4OpticalSurface* photocath_opsurf=
new G4OpticalSurface("photocath_opsurf",glisur,polished,
dielectric_metal);
dielectric_metal);
photocath_opsurf->SetMaterialPropertiesTable(photocath_mt);
//**Create logical skin surfaces
new G4LogicalSkinSurface("photocath_surf",housing_log,
OpScintHousingSurface);
new G4LogicalSkinSurface("sphere_surface",sphere_log,OpSphereSurface);
new G4LogicalSkinSurface("photocath_surf",photocath_log,photocath_opsurf);
new G4LogicalSkinSurface("photocath_surf",fHousing_log,
OpScintHousingSurface);
new G4LogicalSkinSurface("sphere_surface",fSphere_log,OpSphereSurface);
new G4LogicalSkinSurface("photocath_surf",fPhotocath_log,photocath_opsurf);
}
@@ -23,21 +23,39 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeMuonPhysics.cc
/// \brief Implementation of the LXeMuonPhysics class
//
//
#include "LXeMuonPhysics.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip>
#include "G4PhysicalConstants.hh"
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeMuonPhysics::LXeMuonPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{
: G4VPhysicsConstructor(name) {
fMuPlusIonisation = NULL;
fMuPlusMultipleScattering = NULL;
fMuPlusBremsstrahlung = NULL;
fMuPlusPairProduction = NULL;
fMuMinusIonisation = NULL;
fMuMinusMultipleScattering = NULL;
fMuMinusBremsstrahlung = NULL;
fMuMinusPairProduction = NULL;
fMuMinusCaptureAtRest = NULL;
}
LXeMuonPhysics::~LXeMuonPhysics()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeMuonPhysics::~LXeMuonPhysics() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
@@ -56,6 +74,7 @@ void LXeMuonPhysics::ConstructParticle()
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ProcessManager.hh"
@@ -77,7 +96,7 @@ void LXeMuonPhysics::ConstructProcess()
// Muon Plus Physics
pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
pManager->AddProcess(fMuPlusMultipleScattering,-1, 1, 1);
pManager->AddProcess(fMuPlusIonisation, -1, 2, 2);
pManager->AddProcess(fMuPlusBremsstrahlung, -1, 3, 3);
@@ -85,7 +104,7 @@ void LXeMuonPhysics::ConstructProcess()
// Muon Minus Physics
pManager = G4MuonMinus::MuonMinus()->GetProcessManager();
pManager->AddProcess(fMuMinusMultipleScattering,-1, 1, 1);
pManager->AddProcess(fMuMinusIonisation, -1, 2, 2);
pManager->AddProcess(fMuMinusBremsstrahlung, -1, 3, 3);
@@ -94,6 +113,3 @@ void LXeMuonPhysics::ConstructProcess()
pManager->AddRestProcess(fMuMinusCaptureAtRest);
}
+35 -37
View File
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXePMTHit.cc
/// \brief Implementation of the LXePMTHit class
//
//
#include "LXePMTHit.hh"
#include "G4ios.hh"
#include "G4VVisManager.hh"
@@ -33,65 +37,59 @@
G4Allocator<LXePMTHit> LXePMTHitAllocator;
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePMTHit::LXePMTHit()
:pmtNumber(-1),photons(0),physVol(0),drawit(false)
{}
: fPmtNumber(-1),fPhotons(0),fPhysVol(0),fDrawit(false) {}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXePMTHit::~LXePMTHit()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXePMTHit::LXePMTHit(const LXePMTHit &right)
: G4VHit()
LXePMTHit::~LXePMTHit() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePMTHit::LXePMTHit(const LXePMTHit &right) : G4VHit()
{
pmtNumber=right.pmtNumber;
photons=right.photons;
physVol=right.physVol;
drawit=right.drawit;
fPmtNumber=right.fPmtNumber;
fPhotons=right.fPhotons;
fPhysVol=right.fPhysVol;
fDrawit=right.fDrawit;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const LXePMTHit& LXePMTHit::operator=(const LXePMTHit &right){
pmtNumber = right.pmtNumber;
photons=right.photons;
physVol=right.physVol;
drawit=right.drawit;
fPmtNumber = right.fPmtNumber;
fPhotons=right.fPhotons;
fPhysVol=right.fPhysVol;
fDrawit=right.fDrawit;
return *this;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int LXePMTHit::operator==(const LXePMTHit &right) const{
return (pmtNumber==right.pmtNumber);
return (fPmtNumber==right.fPmtNumber);
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePMTHit::Draw(){
if(drawit&&physVol){ //ReDraw only the PMTs that have hit counts > 0
if(fDrawit&&fPhysVol){ //ReDraw only the PMTs that have hit counts > 0
//Also need a physical volume to be able to draw anything
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager){//Make sure that the VisManager exists
G4VisAttributes attribs(G4Colour(1.,0.,0.));
attribs.SetForceSolid(true);
G4RotationMatrix rot;
if(physVol->GetRotation())//If a rotation is defined use it
rot=*(physVol->GetRotation());
G4Transform3D trans(rot,physVol->GetTranslation());//Create transform
pVVisManager->Draw(*physVol,attribs,trans);//Draw it
if(fPhysVol->GetRotation())//If a rotation is defined use it
rot=*(fPhysVol->GetRotation());
G4Transform3D trans(rot,fPhysVol->GetTranslation());//Create transform
pVVisManager->Draw(*fPhysVol,attribs,trans);//Draw it
}
}
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXePMTHit::Print(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePMTHit::Print() {}
+48 -41
View File
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXePMTSD.cc
/// \brief Implementation of the LXePMTSD class
//
//
#include "LXePMTSD.hh"
#include "LXePMTHit.hh"
#include "LXeDetectorConstruction.hh"
@@ -32,51 +36,55 @@
#include "G4LogicalVolume.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4ParticleDefinition.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4ios.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleDefinition.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePMTSD::LXePMTSD(G4String name)
:G4VSensitiveDetector(name),pmtHitCollection(0),pmtPositionsX(0)
,pmtPositionsY(0),pmtPositionsZ(0)
: G4VSensitiveDetector(name),fPMTHitCollection(0),fPMTPositionsX(0)
,fPMTPositionsY(0),fPMTPositionsZ(0)
{
collectionName.insert("pmtHitCollection");
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXePMTSD::~LXePMTSD()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXePMTSD::Initialize(G4HCofThisEvent* HCE){
pmtHitCollection = new LXePMTHitsCollection
(SensitiveDetectorName,collectionName[0]);
LXePMTSD::~LXePMTSD() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePMTSD::Initialize(G4HCofThisEvent* hitsCE){
fPMTHitCollection = new LXePMTHitsCollection
(SensitiveDetectorName,collectionName[0]);
//Store collection with event and keep ID
static G4int HCID = -1;
if(HCID<0){
HCID = GetCollectionID(0);
static G4int hitCID = -1;
if(hitCID<0){
hitCID = GetCollectionID(0);
}
HCE->AddHitsCollection( HCID, pmtHitCollection );
hitsCE->AddHitsCollection( hitCID, fPMTHitCollection );
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool LXePMTSD::ProcessHits(G4Step* ,G4TouchableHistory* ){
return false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//Generates a hit and uses the postStepPoint's mother volume replica number
//PostStepPoint because the hit is generated manually when the photon is
//absorbed by the photocathode
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
G4bool LXePMTSD::ProcessHits_constStep(const G4Step* aStep,
G4TouchableHistory* ){
G4TouchableHistory* ){
//need to know if this is an optical photon
if(aStep->GetTrack()->GetDefinition()
if(aStep->GetTrack()->GetDefinition()
!= G4OpticalPhoton::OpticalPhotonDefinition()) return false;
//User replica number 1 since photocathode is a daughter volume
@@ -87,26 +95,26 @@ G4bool LXePMTSD::ProcessHits_constStep(const G4Step* aStep,
aStep->GetPostStepPoint()->GetTouchable()->GetVolume(1);
//Find the correct hit collection
G4int n=pmtHitCollection->entries();
G4int n=fPMTHitCollection->entries();
LXePMTHit* hit=NULL;
for(G4int i=0;i<n;i++){
if((*pmtHitCollection)[i]->GetPMTNumber()==pmtNumber){
hit=(*pmtHitCollection)[i];
if((*fPMTHitCollection)[i]->GetPMTNumber()==pmtNumber){
hit=(*fPMTHitCollection)[i];
break;
}
}
if(hit==NULL){//this pmt wasnt previously hit in this event
hit = new LXePMTHit(); //so create new hit
hit->SetPMTNumber(pmtNumber);
hit->SetPMTPhysVol(physVol);
pmtHitCollection->insert(hit);
hit->SetPMTPos((*pmtPositionsX)[pmtNumber],(*pmtPositionsY)[pmtNumber],
(*pmtPositionsZ)[pmtNumber]);
fPMTHitCollection->insert(hit);
hit->SetPMTPos((*fPMTPositionsX)[pmtNumber],(*fPMTPositionsY)[pmtNumber],
(*fPMTPositionsZ)[pmtNumber]);
}
hit->IncPhotonCount(); //increment hit for the selected pmt
if(!LXeDetectorConstruction::GetSphereOn()){
hit->SetDrawit(true);
//If the sphere is disabled then this hit is automaticaly drawn
@@ -114,27 +122,26 @@ G4bool LXePMTSD::ProcessHits_constStep(const G4Step* aStep,
else{//sphere enabled
LXeUserTrackInformation* trackInfo=
(LXeUserTrackInformation*)aStep->GetTrack()->GetUserInformation();
if(trackInfo->GetTrackStatus()&hitSphere)
if(trackInfo->GetTrackStatus()&hitSphere)
//only draw this hit if the photon has hit the sphere first
hit->SetDrawit(true);
}
return true;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXePMTSD::EndOfEvent(G4HCofThisEvent* ){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXePMTSD::clear(){
}
void LXePMTSD::EndOfEvent(G4HCofThisEvent* ) {}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXePMTSD::DrawAll(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXePMTSD::PrintAll(){
}
void LXePMTSD::clear() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePMTSD::DrawAll() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePMTSD::PrintAll() {}
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXePhysicsList.cc
/// \brief Implementation of the LXePhysicsList class
//
//
#include "LXePhysicsList.hh"
#include "LXeGeneralPhysics.hh"
@@ -32,9 +36,13 @@
#include "G4OpticalPhysics.hh"
#include "G4OpticalProcessIndex.hh"
LXePhysicsList::LXePhysicsList(): G4VModularPhysicsList()
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePhysicsList::LXePhysicsList() : G4VModularPhysicsList()
{
// default cut value (1.0mm)
// default cut value (1.0mm)
defaultCutValue = 1.0*mm;
// General Physics
@@ -63,16 +71,14 @@ LXePhysicsList::LXePhysicsList(): G4VModularPhysicsList()
}
LXePhysicsList::~LXePhysicsList()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePhysicsList::~LXePhysicsList() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePhysicsList::SetCuts(){
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
SetCutsWithDefault();
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
SetCutsWithDefault();
}
@@ -23,38 +23,44 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXePrimaryGeneratorAction.cc
/// \brief Implementation of the LXePrimaryGeneratorAction class
//
//
#include "LXePrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4SystemOfUnits.hh"
#include "globals.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePrimaryGeneratorAction::LXePrimaryGeneratorAction(){
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
fParticleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
particleGun->SetParticleDefinition(particleTable->
FindParticle(particleName="gamma"));
fParticleGun->SetParticleDefinition(particleTable->
FindParticle(particleName="gamma"));
//Default energy,position,momentum
particleGun->SetParticleEnergy(511.*keV);
particleGun->SetParticlePosition(G4ThreeVector(0.0 , 0.0, -20.0*cm));
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
fParticleGun->SetParticleEnergy(511.*keV);
fParticleGun->SetParticlePosition(G4ThreeVector(0.0 , 0.0, -20.0*cm));
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePrimaryGeneratorAction::~LXePrimaryGeneratorAction(){
delete particleGun;
delete fParticleGun;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent){
particleGun->GeneratePrimaryVertex(anEvent);
fParticleGun->GeneratePrimaryVertex(anEvent);
}
@@ -23,24 +23,29 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeRunAction.cc
/// \brief Implementation of the LXeRunAction class
//
//
#include "LXeRunAction.hh"
#include "RecorderBase.hh"
#include "LXeRecorderBase.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeRunAction::LXeRunAction(RecorderBase* r)
:recorder(r)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeRunAction::~LXeRunAction()
{}
LXeRunAction::LXeRunAction(LXeRecorderBase* r) : fRecorder(r) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeRunAction::~LXeRunAction() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeRunAction::BeginOfRunAction(const G4Run* aRun){
if(recorder)recorder->RecordBeginOfRun(aRun);
if(fRecorder)fRecorder->RecordBeginOfRun(aRun);
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeRunAction::EndOfRunAction(const G4Run* aRun){
if(recorder)recorder->RecordEndOfRun(aRun);
if(fRecorder)fRecorder->RecordEndOfRun(aRun);
}
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeScintHit.cc
/// \brief Implementation of the LXeScintHit class
//
//
#include "LXeScintHit.hh"
#include "G4ios.hh"
#include "G4VVisManager.hh"
@@ -33,56 +37,47 @@
G4Allocator<LXeScintHit> LXeScintHitAllocator;
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeScintHit::LXeScintHit()
:physVol(0)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeScintHit::LXeScintHit(G4VPhysicalVolume* pVol)
:physVol(pVol)
{}
LXeScintHit::LXeScintHit() : fEdep(0.), fPos(0.), fPhysVol(0) {}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeScintHit::~LXeScintHit()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeScintHit::LXeScintHit(const LXeScintHit &right)
: G4VHit()
LXeScintHit::LXeScintHit(G4VPhysicalVolume* pVol) : fPhysVol(pVol) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeScintHit::~LXeScintHit() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeScintHit::LXeScintHit(const LXeScintHit &right) : G4VHit()
{
edep = right.edep;
pos = right.pos;
physVol = right.physVol;
fEdep = right.fEdep;
fPos = right.fPos;
fPhysVol = right.fPhysVol;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const LXeScintHit& LXeScintHit::operator=(const LXeScintHit &right){
edep = right.edep;
pos = right.pos;
physVol = right.physVol;
fEdep = right.fEdep;
fPos = right.fPos;
fPhysVol = right.fPhysVol;
return *this;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int LXeScintHit::operator==(const LXeScintHit&) const{
return false;
//returns false because there currently isnt need to check for equality yet
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeScintHit::Draw(){
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeScintHit::Print(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeScintHit::Draw() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeScintHit::Print() {}
+37 -30
View File
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeScintSD.cc
/// \brief Implementation of the LXeScintSD class
//
//
#include "LXeScintSD.hh"
#include "LXeScintHit.hh"
#include "G4VPhysicalVolume.hh"
@@ -35,39 +39,43 @@
#include "G4ios.hh"
#include "G4VProcess.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeScintSD::LXeScintSD(G4String name)
:G4VSensitiveDetector(name)
: G4VSensitiveDetector(name)
{
fScintCollection = NULL;
collectionName.insert("scintCollection");
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeScintSD::~LXeScintSD()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeScintSD::Initialize(G4HCofThisEvent* HCE){
scintCollection = new LXeScintHitsCollection
(SensitiveDetectorName,collectionName[0]);
LXeScintSD::~LXeScintSD() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeScintSD::Initialize(G4HCofThisEvent* hitsCE){
fScintCollection = new LXeScintHitsCollection
(SensitiveDetectorName,collectionName[0]);
//A way to keep all the hits of this event in one place if needed
static G4int HCID = -1;
if(HCID<0){
HCID = GetCollectionID(0);
static G4int hitsCID = -1;
if(hitsCID<0){
hitsCID = GetCollectionID(0);
}
HCE->AddHitsCollection( HCID, scintCollection );
hitsCE->AddHitsCollection( hitsCID, fScintCollection );
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
G4bool LXeScintSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool LXeScintSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ){
G4double edep = aStep->GetTotalEnergyDeposit();
if(edep==0.) return false; //No edep so dont count as hit
G4StepPoint* thePrePoint = aStep->GetPreStepPoint();
G4TouchableHistory* theTouchable =
G4TouchableHistory* theTouchable =
(G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
G4VPhysicalVolume* thePrePV = theTouchable->GetVolume();
G4StepPoint* thePostPoint = aStep->GetPostStepPoint();
//Get the average position of the hit
@@ -79,24 +87,23 @@ G4bool LXeScintSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ){
scintHit->SetEdep(edep);
scintHit->SetPos(pos);
scintCollection->insert(scintHit);
fScintCollection->insert(scintHit);
return true;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeScintSD::EndOfEvent(G4HCofThisEvent* ){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeScintSD::clear(){
}
void LXeScintSD::EndOfEvent(G4HCofThisEvent* ) {}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeScintSD::DrawAll(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeScintSD::PrintAll(){
}
void LXeScintSD::clear() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeScintSD::DrawAll() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeScintSD::PrintAll() {}
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeStackingAction.cc
/// \brief Implementation of the LXeStackingAction class
//
//
#include "LXeStackingAction.hh"
#include "LXeUserEventInformation.hh"
#include "LXeSteppingAction.hh"
@@ -35,31 +39,32 @@
#include "G4Event.hh"
#include "G4EventManager.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeStackingAction::LXeStackingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeStackingAction::~LXeStackingAction()
{}
LXeStackingAction::LXeStackingAction() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeStackingAction::~LXeStackingAction() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
G4ClassificationOfNewTrack
LXeStackingAction::ClassifyNewTrack(const G4Track * aTrack){
LXeUserEventInformation* eventInformation=
(LXeUserEventInformation*)G4EventManager::GetEventManager()
->GetConstCurrentEvent()->GetUserInformation();
//Count what process generated the optical photons
if(aTrack->GetDefinition()==G4OpticalPhoton::OpticalPhotonDefinition()){
if(aTrack->GetDefinition()==G4OpticalPhoton::OpticalPhotonDefinition()){
// particle is optical photon
if(aTrack->GetParentID()>0){
// particle is secondary
if(aTrack->GetCreatorProcess()->GetProcessName()=="Scintillation")
eventInformation->IncPhotonCount_Scint();
eventInformation->IncPhotonCount_Scint();
else if(aTrack->GetCreatorProcess()->GetProcessName()=="Cerenkov")
eventInformation->IncPhotonCount_Ceren();
eventInformation->IncPhotonCount_Ceren();
}
}
else{
@@ -67,18 +72,10 @@ LXeStackingAction::ClassifyNewTrack(const G4Track * aTrack){
return fUrgent;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeStackingAction::NewStage(){
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeStackingAction::PrepareNewEvent(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeStackingAction::NewStage() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeStackingAction::PrepareNewEvent() {}
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeSteppingAction.cc
/// \brief Implementation of the LXeSteppingAction class
//
//
#include "LXeSteppingAction.hh"
#include "LXeEventAction.hh"
#include "LXeTrackingAction.hh"
@@ -31,7 +35,7 @@
#include "LXeUserTrackInformation.hh"
#include "LXeUserEventInformation.hh"
#include "LXeSteppingMessenger.hh"
#include "RecorderBase.hh"
#include "LXeRecorderBase.hh"
#include "G4SteppingManager.hh"
#include "G4SDManager.hh"
@@ -45,23 +49,26 @@
#include "G4VPhysicalVolume.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4OpBoundaryProcess.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeSteppingAction::LXeSteppingAction(RecorderBase* r)
:recorder(r),oneStepPrimaries(false)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingAction::LXeSteppingAction(LXeRecorderBase* r)
: fRecorder(r),fOneStepPrimaries(false)
{
steppingMessenger = new LXeSteppingMessenger(this);
fSteppingMessenger = new LXeSteppingMessenger(this);
fExpectedNextStatus = Undefined;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeSteppingAction::~LXeSteppingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingAction::~LXeSteppingAction() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
G4Track* theTrack = theStep->GetTrack();
LXeUserTrackInformation* trackInformation
=(LXeUserTrackInformation*)theTrack->GetUserInformation();
LXeUserEventInformation* eventInformation
@@ -76,48 +83,48 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
G4OpBoundaryProcessStatus boundaryStatus=Undefined;
static G4OpBoundaryProcess* boundary=NULL;
//find the boundary process only once
if(!boundary){
G4ProcessManager* pm
G4ProcessManager* pm
= theStep->GetTrack()->GetDefinition()->GetProcessManager();
G4int nprocesses = pm->GetProcessListLength();
G4ProcessVector* pv = pm->GetProcessList();
G4int i;
for( i=0;i<nprocesses;i++){
if((*pv)[i]->GetProcessName()=="OpBoundary"){
boundary = (G4OpBoundaryProcess*)(*pv)[i];
break;
boundary = (G4OpBoundaryProcess*)(*pv)[i];
break;
}
}
}
if(theTrack->GetParentID()==0){
//This is a primary track
G4TrackVector* fSecondary=fpSteppingManager->GetfSecondary();
G4TrackVector* fSecondary=fpSteppingManager->GetfSecondary();
G4int tN2ndariesTot = fpSteppingManager->GetfN2ndariesAtRestDoIt()
+ fpSteppingManager->GetfN2ndariesAlongStepDoIt()
+ fpSteppingManager->GetfN2ndariesPostStepDoIt();
//If we havent already found the conversion position and there were
//If we havent already found the conversion position and there were
//secondaries generated, then search for it
if(!eventInformation->IsConvPosSet() && tN2ndariesTot>0 ){
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
const G4VProcess* creator=(*fSecondary)[lp1]->GetCreatorProcess();
if(creator){
G4String creatorName=creator->GetProcessName();
if(creatorName=="phot"||creatorName=="compt"||creatorName=="conv"){
//since this is happening before the secondary is being tracked
//the Vertex position has not been set yet(set in initial step)
eventInformation->SetConvPos((*fSecondary)[lp1]->GetPosition());
}
}
if(!eventInformation->IsConvPosSet() && tN2ndariesTot>0 ){
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
const G4VProcess* creator=(*fSecondary)[lp1]->GetCreatorProcess();
if(creator){
G4String creatorName=creator->GetProcessName();
if(creatorName=="phot"||creatorName=="compt"||creatorName=="conv"){
//since this is happening before the secondary is being tracked
//the Vertex position has not been set yet(set in initial step)
eventInformation->SetConvPos((*fSecondary)[lp1]->GetPosition());
}
}
}
}
if(oneStepPrimaries&&thePrePV->GetName()=="scintillator")
if(fOneStepPrimaries&&thePrePV->GetName()=="scintillator")
theTrack->SetTrackStatus(fStopAndKill);
}
@@ -135,70 +142,66 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
else if(thePostPV->GetName()=="expHall")
//Kill photons entering expHall from something other than Slab
theTrack->SetTrackStatus(fStopAndKill);
//Was the photon absorbed by the absorption process
if(thePostPoint->GetProcessDefinedStep()->GetProcessName()
=="OpAbsorption"){
eventInformation->IncAbsorption();
trackInformation->AddTrackStatusFlag(absorbed);
}
boundaryStatus=boundary->GetStatus();
//Check to see if the partcile was actually at a boundary
//Otherwise the boundary status may not be valid
//Prior to Geant4.6.0-p1 this would not have been enough to check
if(thePostPoint->GetStepStatus()==fGeomBoundary){
if(fExpectedNextStatus==StepTooSmall){
if(boundaryStatus!=StepTooSmall){
G4ExceptionDescription ed;
ed << "LXeSteppingAction::UserSteppingAction(): "
<< "No reallocation step after reflection!"
<< G4endl;
G4Exception("LXeSteppingAction::UserSteppingAction()", "LXeExpl01",
FatalException,ed,
"Something is wrong with the surface normal or geometry");
}
}
fExpectedNextStatus=Undefined;
switch(boundaryStatus){
case Absorption:
trackInformation->AddTrackStatusFlag(boundaryAbsorbed);
eventInformation->IncBoundaryAbsorption();
break;
trackInformation->AddTrackStatusFlag(boundaryAbsorbed);
eventInformation->IncBoundaryAbsorption();
break;
case Detection: //Note, this assumes that the volume causing detection
//is the photocathode because it is the only one with
//non-zero efficiency
{
//Triger sensitive detector manually since photon is
//absorbed but status was Detection
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4String sdName="/LXeDet/pmtSD";
LXePMTSD* pmtSD = (LXePMTSD*)SDman
->FindSensitiveDetector(sdName);
if(pmtSD)
pmtSD->ProcessHits_constStep(theStep,NULL);
trackInformation->AddTrackStatusFlag(hitPMT);
break;
}
//non-zero efficiency
{
//Triger sensitive detector manually since photon is
//absorbed but status was Detection
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4String sdName="/LXeDet/pmtSD";
LXePMTSD* pmtSD = (LXePMTSD*)SDman->FindSensitiveDetector(sdName);
if(pmtSD)pmtSD->ProcessHits_constStep(theStep,NULL);
trackInformation->AddTrackStatusFlag(hitPMT);
break;
}
case FresnelReflection:
case TotalInternalReflection:
case LambertianReflection:
case LobeReflection:
case SpikeReflection:
trackInformation->IncReflections();
break;
case BackScattering:
trackInformation->IncReflections();
fExpectedNextStatus=StepTooSmall;
break;
default:
break;
break;
}
if(thePostPV->GetName()=="sphere")
trackInformation->AddTrackStatusFlag(hitSphere);
trackInformation->AddTrackStatusFlag(hitSphere);
}
}
if(recorder)recorder->RecordStep(theStep);
if(fRecorder)fRecorder->RecordStep(theStep);
}
@@ -23,32 +23,38 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeSteppingMessenger.cc
/// \brief Implementation of the LXeSteppingMessenger class
//
//
#include "LXeSteppingMessenger.hh"
#include "LXeSteppingAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithABool.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingMessenger::LXeSteppingMessenger(LXeSteppingAction* step)
:stepping(step)
: fStepping(step)
{
oneStepPrimariesCmd = new G4UIcmdWithABool("/LXe/oneStepPrimaries",this);
oneStepPrimariesCmd->SetGuidance("Only allows primaries to go one step in the scintillator volume before being killed.");
fOneStepPrimariesCmd = new G4UIcmdWithABool("/LXe/oneStepPrimaries",this);
fOneStepPrimariesCmd->SetGuidance("Only allows primaries to go one step in the scintillator volume before being killed.");
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingMessenger::~LXeSteppingMessenger(){
delete oneStepPrimariesCmd;
delete fOneStepPrimariesCmd;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void
LXeSteppingMessenger::SetNewValue(G4UIcommand* command,G4String newValue){
if( command == oneStepPrimariesCmd ){
stepping->SetOneStepPrimaries(oneStepPrimariesCmd
->GetNewBoolValue(newValue));
LXeSteppingMessenger::SetNewValue(G4UIcommand* command,G4String newValue){
if( command == fOneStepPrimariesCmd ){
fStepping->SetOneStepPrimaries(fOneStepPrimariesCmd
->GetNewBoolValue(newValue));
}
}
@@ -23,68 +23,68 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeSteppingVerbose.cc
/// \brief Implementation of the LXeSteppingVerbose class
//
//
#include "LXeSteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingVerbose::LXeSteppingVerbose() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingVerbose::LXeSteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingVerbose::~LXeSteppingVerbose()
{}
LXeSteppingVerbose::~LXeSteppingVerbose() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeSteppingVerbose::StepInfo()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel >= 1 ){
if( verboseLevel >= 4 ) VerboseTrack();
if( verboseLevel >= 3 ){
G4cout << G4endl;
G4cout << G4endl;
G4cout << std::setw( 5) << "#Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
}
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< " ";
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< " ";
// if( fStepStatus != fWorldBoundary){
if( fTrack->GetNextVolume() != 0 ) {
// if( fStepStatus != fWorldBoundary){
if( fTrack->GetNextVolume() != 0 ) {
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
} else {
G4cout << std::setw(10) << "OutOfWorld";
}
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
G4cout << " "
G4cout << " "
<< std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName();
->GetProcessName();
} else {
G4cout << " UserLimit";
}
@@ -93,42 +93,41 @@ CopyState();
if( verboseLevel == 2 ){
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
if(tN2ndariesTot>0){
G4cout << " :----- List of 2ndaries - "
<< "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
<< "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
<< ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
<< ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
<< "), "
<< "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
<< " ---------------"
<< G4endl;
G4cout << " :----- List of 2ndaries - "
<< "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
<< "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
<< ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
<< ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
<< "), "
<< "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
<< " ---------------"
<< G4endl;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
G4cout << " : "
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
G4cout << " :-----------------------------"
<< "----------------------------------"
<< "-- EndOf2ndaries Info ---------------"
<< G4endl;
G4cout << " : "
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
G4cout << " :-----------------------------"
<< "----------------------------------"
<< "-- EndOf2ndaries Info ---------------"
<< G4endl;
}
}
}
G4cout.precision(prec);
}
@@ -137,31 +136,30 @@ CopyState();
void LXeSteppingVerbose::TrackingStarted()
{
CopyState();
G4int prec = G4cout.precision(3);
G4int prec = G4cout.precision(3);
if( verboseLevel > 0 ){
G4cout << std::setw( 5) << "Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< " ";
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< " ";
if(fTrack->GetNextVolume()){
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
@@ -174,4 +172,3 @@ G4int prec = G4cout.precision(3);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,27 +23,32 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeTrackingAction.cc
/// \brief Implementation of the LXeTrackingAction class
//
//
#include "LXeTrajectory.hh"
#include "LXeTrackingAction.hh"
#include "LXeUserTrackInformation.hh"
#include "LXeDetectorConstruction.hh"
#include "RecorderBase.hh"
#include "LXeRecorderBase.hh"
#include "G4TrackingManager.hh"
#include "G4Track.hh"
#include "G4ParticleTypes.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeTrackingAction::LXeTrackingAction(RecorderBase* r)
:recorder(r)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeTrackingAction::LXeTrackingAction(LXeRecorderBase* r)
: fRecorder(r) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeTrackingAction::PreUserTrackingAction(const G4Track* aTrack)
{
//Let this be up to the user via vis.mac
// fpTrackingManager->SetStoreTrajectory(true);
//Use custom trajectory class
fpTrackingManager->SetTrajectory(new LXeTrajectory(aTrack));
@@ -56,12 +61,13 @@ void LXeTrackingAction::PreUserTrackingAction(const G4Track* aTrack)
*/
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeTrackingAction::PostUserTrackingAction(const G4Track* aTrack){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeTrackingAction::PostUserTrackingAction(const G4Track* aTrack){
LXeTrajectory* trajectory=(LXeTrajectory*)fpTrackingManager->GimmeTrajectory();
LXeUserTrackInformation*
trackInformation=(LXeUserTrackInformation*)aTrack->GetUserInformation();
//Lets choose to draw only the photons that hit the sphere and a pmt
if(aTrack->GetDefinition()==G4OpticalPhoton::OpticalPhotonDefinition()){
@@ -73,13 +79,13 @@ void LXeTrackingAction::PostUserTrackingAction(const G4Track* aTrack){
if(LXeDetectorConstruction::GetSphereOn()){
if((trackInformation->GetTrackStatus()&hitPMT)&&
(trackInformation->GetTrackStatus()&hitSphere)){
trajectory->SetDrawTrajectory(true);
(trackInformation->GetTrackStatus()&hitSphere)){
trajectory->SetDrawTrajectory(true);
}
}
else{
if(trackInformation->GetTrackStatus()&hitPMT)
trajectory->SetDrawTrajectory(true);
trajectory->SetDrawTrajectory(true);
}
}
else //draw all other trajectories
@@ -88,21 +94,5 @@ void LXeTrackingAction::PostUserTrackingAction(const G4Track* aTrack){
if(trackInformation->GetForceDrawTrajectory())
trajectory->SetDrawTrajectory(true);
if(recorder)recorder->RecordTrack(aTrack);
if(fRecorder)fRecorder->RecordTrack(aTrack);
}
@@ -23,6 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeTrajectory.cc
/// \brief Implementation of the LXeTrajectory class
//
//
#include "LXeTrajectory.hh"
#include "G4TrajectoryPoint.hh"
#include "G4Trajectory.hh"
@@ -38,34 +42,36 @@
G4Allocator<LXeTrajectory> LXeTrajectoryAllocator;
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeTrajectory::LXeTrajectory()
:G4Trajectory(),wls(false),drawit(false),forceNoDraw(false),forceDraw(false)
:G4Trajectory(),fWls(false),fDrawit(false),fForceNoDraw(false),fForceDraw(false)
{
particleDefinition=0;
fParticleDefinition=0;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeTrajectory::LXeTrajectory(const G4Track* aTrack)
:G4Trajectory(aTrack),wls(false),drawit(false)
:G4Trajectory(aTrack),fWls(false),fDrawit(false)
{
particleDefinition=aTrack->GetDefinition();
fParticleDefinition=aTrack->GetDefinition();
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeTrajectory::LXeTrajectory(LXeTrajectory &right)
:G4Trajectory(right),wls(right.wls),drawit(right.drawit)
:G4Trajectory(right),fWls(right.fWls),fDrawit(right.fDrawit)
{
particleDefinition=right.particleDefinition;
fParticleDefinition=right.fParticleDefinition;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeTrajectory::~LXeTrajectory()
{
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
}
LXeTrajectory::~LXeTrajectory() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeTrajectory::DrawTrajectory() const
{
// Invoke the default implementation in G4VTrajectory...
@@ -73,12 +79,13 @@ void LXeTrajectory::DrawTrajectory() const
// ... or override with your own code here.
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeTrajectory::DrawTrajectory(G4int i_mode) const{
//Taken from G4VTrajectory and modified to select colours based on particle
//type and to selectively eliminate drawing of certain trajectories.
if(!forceDraw && (!drawit || forceNoDraw))
if(!fForceDraw && (!fDrawit || fForceNoDraw))
return;
// If i_mode>=0, draws a trajectory as a polyline and, if i_mode!=0,
@@ -86,31 +93,31 @@ void LXeTrajectory::DrawTrajectory(G4int i_mode) const{
// for auxiliary points, if any - whose screen size in pixels is
// given by std::abs(i_mode)/1000. E.g: i_mode = 5000 gives easily
// visible markers.
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if (!pVVisManager) return;
const G4double markerSize = std::abs(i_mode)/1000;
G4bool lineRequired (i_mode >= 0);
G4bool markersRequired (markerSize > 0.);
G4Polyline trajectoryLine;
G4Polymarker stepPoints;
G4Polymarker auxiliaryPoints;
for (G4int i = 0; i < GetPointEntries() ; i++) {
G4VTrajectoryPoint* aTrajectoryPoint = GetPoint(i);
const std::vector<G4ThreeVector>* auxiliaries
= aTrajectoryPoint->GetAuxiliaryPoints();
if (auxiliaries) {
for (size_t iAux = 0; iAux < auxiliaries->size(); ++iAux) {
const G4ThreeVector pos((*auxiliaries)[iAux]);
if (lineRequired) {
trajectoryLine.push_back(pos);
}
if (markersRequired) {
auxiliaryPoints.push_back(pos);
}
const G4ThreeVector pos((*auxiliaries)[iAux]);
if (lineRequired) {
trajectoryLine.push_back(pos);
}
if (markersRequired) {
auxiliaryPoints.push_back(pos);
}
}
}
const G4ThreeVector pos(aTrajectoryPoint->GetPosition());
@@ -121,20 +128,20 @@ void LXeTrajectory::DrawTrajectory(G4int i_mode) const{
stepPoints.push_back(pos);
}
}
if (lineRequired) {
G4Colour colour;
if(particleDefinition==G4OpticalPhoton::OpticalPhotonDefinition()){
if(wls) //WLS photons are red
colour = G4Colour(1.,0.,0.);
if(fParticleDefinition==G4OpticalPhoton::OpticalPhotonDefinition()){
if(fWls) //WLS photons are red
colour = G4Colour(1.,0.,0.);
else{ //Scintillation and Cerenkov photons are green
colour = G4Colour(0.,1.,0.);
colour = G4Colour(0.,1.,0.);
}
}
else //All other particles are blue
colour = G4Colour(0.,0.,1.);
G4VisAttributes trajectoryLineAttribs(colour);
trajectoryLine.SetVisAttributes(&trajectoryLineAttribs);
pVVisManager->Draw(trajectoryLine);
@@ -146,17 +153,12 @@ void LXeTrajectory::DrawTrajectory(G4int i_mode) const{
G4VisAttributes auxiliaryPointsAttribs(G4Colour(0.,1.,1.)); // Magenta
auxiliaryPoints.SetVisAttributes(&auxiliaryPointsAttribs);
pVVisManager->Draw(auxiliaryPoints);
stepPoints.SetMarkerType(G4Polymarker::circles);
stepPoints.SetScreenSize(markerSize);
stepPoints.SetFillStyle(G4VMarker::filled);
G4VisAttributes stepPointsAttribs(G4Colour(1.,1.,0.)); // Yellow.
G4VisAttributes stepPointsAttribs(G4Colour(1.,1.,0.)); // Yellow
stepPoints.SetVisAttributes(&stepPointsAttribs);
pVVisManager->Draw(stepPoints);
}
}
@@ -23,18 +23,19 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeUserEventInformation.cc
/// \brief Implementation of the LXeUserEventInformation class
//
//
#include "LXeUserEventInformation.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeUserEventInformation::LXeUserEventInformation()
:hitCount(0),photonCount_Scint(0),photonCount_Ceren(0),absorptionCount(0),
boundaryAbsorptionCount(0),totE(0.),eWeightPos(0.),reconPos(0.),convPos(0.),
convPosSet(false),posMax(0.),pmtsAboveThreshold(0)
{
}
:fHitCount(0),fPhotonCount_Scint(0),fPhotonCount_Ceren(0),fAbsorptionCount(0),
fBoundaryAbsorptionCount(0),fTotE(0.),fEWeightPos(0.),fReconPos(0.),fConvPos(0.),
fConvPosSet(false),fPosMax(0.),fEdepMax(0.),fPMTsAboveThreshold(0) {}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeUserEventInformation::~LXeUserEventInformation()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeUserEventInformation::~LXeUserEventInformation() {}
@@ -23,25 +23,28 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeUserTrackInformation.cc
/// \brief Implementation of the LXeUserTrackInformation class
//
//
#include "LXeUserTrackInformation.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeUserTrackInformation::LXeUserTrackInformation()
:status(active),reflections(0),forcedraw(false)
{
}
: fStatus(active),fReflections(0),fForcedraw(false) {}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeUserTrackInformation::~LXeUserTrackInformation()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeUserTrackInformation::~LXeUserTrackInformation() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeUserTrackInformation::AddTrackStatusFlag(int s)
{
if(s&active) //track is now active
status&=~inactive; //remove any flags indicating it is inactive
fStatus&=~inactive; //remove any flags indicating it is inactive
else if(s&inactive) //track is now inactive
status&=~active; //remove any flags indicating it is active
status|=s; //add new flags
fStatus&=~active; //remove any flags indicating it is active
fStatus|=s; //add new flags
}
@@ -23,87 +23,96 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeWLSFiber.cc
/// \brief Implementation of the LXeWLSFiber class
//
//
#include "LXeWLSFiber.hh"
#include "globals.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4SystemOfUnits.hh"
G4LogicalVolume* LXeWLSFiber::clad2_log=NULL;
G4LogicalVolume* LXeWLSFiber::fClad2_log=NULL;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeWLSFiber::LXeWLSFiber(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c)
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c)
:G4PVPlacement(pRot,tlate,
new G4LogicalVolume(new G4Box("temp",1,1,1),
G4Material::GetMaterial("Vacuum"),
"temp",0,0,0),
"Cladding2",pMotherLogical,pMany,pCopyNo),constructor(c)
new G4LogicalVolume(new G4Box("temp",1,1,1),
G4Material::GetMaterial("Vacuum"),
"temp",0,0,0),
"Cladding2",pMotherLogical,pMany,pCopyNo),fConstructor(c)
{
CopyValues();
if(!clad2_log || updated){
if(!fClad2_log || fUpdated){
// The Fiber
//
G4Tubs* Fiber_tube =
new G4Tubs("Fiber",fiber_rmin,fiber_rmax,fiber_z,fiber_sphi,fiber_ephi);
G4LogicalVolume* Fiber_log =
new G4LogicalVolume(Fiber_tube,G4Material::GetMaterial("PMMA"),
"Fiber",0,0,0);
G4Tubs* fiber_tube =
new G4Tubs("Fiber",fFiber_rmin,fFiber_rmax,fFiber_z,fFiber_sphi,fFiber_ephi);
G4LogicalVolume* fiber_log =
new G4LogicalVolume(fiber_tube,G4Material::GetMaterial("PMMA"),
"Fiber",0,0,0);
// Cladding (first layer)
//
G4Tubs* clad1_tube =
new G4Tubs("Cladding1",clad1_rmin,clad1_rmax,clad1_z,clad1_sphi,
clad1_ephi);
G4LogicalVolume* clad1_log =
new G4LogicalVolume(clad1_tube,G4Material::GetMaterial("Pethylene"),
"Cladding1",0,0,0);
G4Tubs* clad1_tube =
new G4Tubs("Cladding1",fClad1_rmin,fClad1_rmax,fClad1_z,fClad1_sphi,
fClad1_ephi);
G4LogicalVolume* clad1_log =
new G4LogicalVolume(clad1_tube,G4Material::GetMaterial("Pethylene1"),
"Cladding1",0,0,0);
// Cladding (second layer)
//
G4Tubs* clad2_tube =
new G4Tubs("Cladding2",clad2_rmin,clad2_rmax,clad2_z,clad2_sphi,
clad2_ephi);
clad2_log =
new G4LogicalVolume(clad2_tube,G4Material::GetMaterial("fPethylene"),
"Cladding2",0,0,0);
new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),Fiber_log,
"Fiber", clad1_log,false,0);
//
G4Tubs* clad2_tube =
new G4Tubs("Cladding2",fClad2_rmin,fClad2_rmax,fClad2_z,fClad2_sphi,
fClad2_ephi);
fClad2_log =
new G4LogicalVolume(clad2_tube,G4Material::GetMaterial("Pethylene2"),
"Cladding2",0,0,0);
new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),fiber_log,
"Fiber", clad1_log,false,0);
new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),clad1_log,
"Cladding1",clad2_log,false,0);
"Cladding1",fClad2_log,false,0);
}
SetLogicalVolume(clad2_log);
SetLogicalVolume(fClad2_log);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeWLSFiber::CopyValues(){
updated=constructor->GetUpdated();
fUpdated=fConstructor->GetUpdated();
fiber_rmin = 0.00*cm;
fiber_rmax = 0.10*cm;
fiber_z = constructor->GetScintX()/2;
fiber_sphi = 0.00*deg;
fiber_ephi = 360.*deg;
clad1_rmin = 0.;// fiber_rmax;
clad1_rmax = fiber_rmax + 0.015*fiber_rmax;
clad1_z = fiber_z;
clad1_sphi = fiber_sphi;
clad1_ephi = fiber_ephi;
clad2_rmin = 0.;//clad1_rmax;
clad2_rmax = clad1_rmax + 0.015*fiber_rmax;
fFiber_rmin = 0.00*cm;
fFiber_rmax = 0.10*cm;
fFiber_z = fConstructor->GetScintX()/2;
fFiber_sphi = 0.00*deg;
fFiber_ephi = 360.*deg;
clad2_z = fiber_z;
clad2_sphi = fiber_sphi;
clad2_ephi = fiber_ephi;
fClad1_rmin = 0.;// fFiber_rmax;
fClad1_rmax = fFiber_rmax + 0.015*fFiber_rmax;
fClad1_z = fFiber_z;
fClad1_sphi = fFiber_sphi;
fClad1_ephi = fFiber_ephi;
fClad2_rmin = 0.;//fClad1_rmax;
fClad2_rmax = fClad1_rmax + 0.015*fFiber_rmax;
fClad2_z = fFiber_z;
fClad2_sphi = fFiber_sphi;
fClad2_ephi = fFiber_ephi;
}
+47 -41
View File
@@ -23,67 +23,73 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file optical/LXe/src/LXeWLSSlab.cc
/// \brief Implementation of the LXeWLSSlab class
//
//
#include "LXeWLSSlab.hh"
#include "LXeWLSFiber.hh"
#include "globals.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4SystemOfUnits.hh"
G4LogicalVolume* LXeWLSSlab::ScintSlab_log=NULL;
G4LogicalVolume* LXeWLSSlab::fScintSlab_log=NULL;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeWLSSlab::LXeWLSSlab(G4RotationMatrix *pRot,
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c)
const G4ThreeVector &tlate,
G4LogicalVolume *pMotherLogical,
G4bool pMany,
G4int pCopyNo,
LXeDetectorConstruction* c)
:G4PVPlacement(pRot,tlate,
new G4LogicalVolume(new G4Box("temp",1,1,1),
G4Material::GetMaterial("Vacuum"),
"temp",0,0,0),
"Slab",pMotherLogical,pMany,pCopyNo),constructor(c)
new G4LogicalVolume(new G4Box("temp",1,1,1),
G4Material::GetMaterial("Vacuum"),
"temp",0,0,0),
"Slab",pMotherLogical,pMany,pCopyNo),fConstructor(c)
{
CopyValues();
if(!ScintSlab_log || updated){
if(!fScintSlab_log || fUpdated){
G4double slab_x = scint_x/2.;
G4double slab_y = scint_y/2.;
G4Box* ScintSlab_box = new G4Box("Slab",slab_x,slab_y,slab_z);
ScintSlab_log
G4double slab_x = fScint_x/2.;
G4double slab_y = fScint_y/2.;
G4Box* ScintSlab_box = new G4Box("Slab",slab_x,slab_y,fSlab_z);
fScintSlab_log
= new G4LogicalVolume(ScintSlab_box,
G4Material::GetMaterial("Polystyrene"),
"Slab",0,0,0);
G4double spacing = 2*slab_y/nfibers;
G4Material::GetMaterial("Polystyrene"),
"Slab",0,0,0);
G4double spacing = 2*slab_y/fNfibers;
G4RotationMatrix* rm = new G4RotationMatrix();
rm->rotateY(90*deg);
//Place fibers
for(G4int i=0;i<nfibers;i++){
G4double Y=-(spacing)*(nfibers-1)*0.5 + i*spacing;
new LXeWLSFiber(rm,G4ThreeVector(0.,Y,0.),ScintSlab_log,false,0,
constructor);
for(G4int i=0;i<fNfibers;i++){
G4double Y=-(spacing)*(fNfibers-1)*0.5 + i*spacing;
new LXeWLSFiber(rm,G4ThreeVector(0.,Y,0.),fScintSlab_log,false,0,
fConstructor);
}
}
SetLogicalVolume(ScintSlab_log);
SetLogicalVolume(fScintSlab_log);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeWLSSlab::CopyValues(){
updated=constructor->GetUpdated();
scint_x=constructor->GetScintX();
scint_y=constructor->GetScintY();
scint_z=constructor->GetScintZ();
nfibers=constructor->GetNFibers();
slab_z=constructor->GetSlabZ();
fUpdated=fConstructor->GetUpdated();
fScint_x=fConstructor->GetScintX();
fScint_y=fConstructor->GetScintY();
fScint_z=fConstructor->GetScintZ();
fNfibers=fConstructor->GetNFibers();
fSlab_z=fConstructor->GetSlabZ();
}
+1 -1
View File
@@ -15,7 +15,7 @@
# /vis/viewer/create
#
# Create a scene handler and a viewer for the OGLIX driver
/vis/open OGLIX
/vis/open OGL 600x600-0+0
#
/vis/viewer/set/style wireframe
# Set direction from target to camera.
+2
View File
@@ -1,6 +1,8 @@
/control/execute defaults.mac
/LXe/detector/volumes/wls 1
/LXe/detector/volumes/lxe 0
/LXe/detector/nfibers 15
/LXe/detector/WLSScintYield 10000
/LXe/detector/update
/gun/particle e-
/gun/energy 511 keV