Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# $Id: GNUmakefile,v 1.2 2004/06/01 07:05:03 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for LXe example.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := LXe
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
@@ -0,0 +1,20 @@
|
||||
$Id: History,v 1.1 2004/06/01 07:02:16 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
LXe History file
|
||||
----------------
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
May 31st, 2004 Trevor MacPhail (LXe-V06-01-00)
|
||||
------------------------------
|
||||
- First release of LXe setup for optical processes.
|
||||
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4String.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
#include "LXePhysicsList.hh"
|
||||
#include "LXePrimaryGeneratorAction.hh"
|
||||
#include "LXeEventAction.hh"
|
||||
#include "LXeStackingAction.hh"
|
||||
#include "LXeSteppingAction.hh"
|
||||
#include "LXeTrackingAction.hh"
|
||||
#include "LXeRunAction.hh"
|
||||
#include "LXeSteppingVerbose.hh"
|
||||
|
||||
#include "RecorderBase.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "LXeVisManager.hh"
|
||||
#endif
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
G4VSteppingVerbose::SetInstance(new LXeSteppingVerbose);
|
||||
|
||||
G4RunManager* runManager = new G4RunManager;
|
||||
|
||||
runManager->SetUserInitialization(new LXeDetectorConstruction);
|
||||
runManager->SetUserInitialization(new LXePhysicsList);
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
G4VisManager* visManager = new LXeVisManager;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
RecorderBase* 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));
|
||||
runManager->SetUserAction(new LXeSteppingAction(recorder));
|
||||
|
||||
runManager->Initialize();
|
||||
|
||||
// get the pointer to the UI manager and set verbosities
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if(argc==1){
|
||||
G4UIsession* session=0;
|
||||
#ifdef G4UI_USE_TCSH
|
||||
session = new G4UIterminal(new G4UItcsh);
|
||||
#else
|
||||
session = new G4UIterminal();
|
||||
#endif
|
||||
|
||||
//execute vis.mac
|
||||
UI->ApplyCommand("/control/execute vis.mac");
|
||||
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
|
||||
}
|
||||
else{
|
||||
G4String command = "/control/execute ";
|
||||
G4String filename = argv[1];
|
||||
UI->ApplyCommand(command+filename);
|
||||
}
|
||||
|
||||
if(recorder)delete recorder;
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
|
||||
// job termination
|
||||
delete runManager;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#**************
|
||||
#**
|
||||
#** Demonstrates the basic functionality of this example by running a
|
||||
#** a single event with the default configuration
|
||||
#**
|
||||
#**************
|
||||
#/LXe/detector/MainScintYield 100
|
||||
/LXe/eventVerbose 1
|
||||
#/tracking/verbose 1
|
||||
/run/beamOn 3
|
||||
@@ -0,0 +1,125 @@
|
||||
**********************************************
|
||||
Geant4 version $Name: geant4-06-02 $
|
||||
(12-December-2003)
|
||||
Copyright : Geant4 Collaboration
|
||||
**********************************************
|
||||
Visualization Manager instantiating...
|
||||
Visualization Manager initialising...
|
||||
Registering graphics systems...
|
||||
|
||||
You have successfully chosen to use the following graphics systems.
|
||||
Current available graphics systems are:
|
||||
ASCIITree (ATree)
|
||||
DAWNFILE (DAWNFILE)
|
||||
GAGTree (GAGTree)
|
||||
G4HepRepFile (HepRepFile)
|
||||
G4HepRep (HepRepXML)
|
||||
RayTracer (RayTracer)
|
||||
VRML1FILE (VRML1FILE)
|
||||
VRML2FILE (VRML2FILE)
|
||||
OpenGLImmediateX (OGLIX)
|
||||
OpenGLStoredX (OGLSX)
|
||||
OpenGLImmediateXm (OGLIXm)
|
||||
OpenGLStoredXm (OGLSXm)
|
||||
|
||||
phot: Total cross sections from Sandia parametrisation.
|
||||
MuonMinusCaptureAtRest is created
|
||||
|
||||
compt: Total cross sections from a parametrisation. Good description from 10 KeV to (100/Z) GeV.
|
||||
Scattered gamma energy according Klein-Nishina.
|
||||
PhysicsTables from 1 keV to 100 GeV in 80 bins.
|
||||
|
||||
conv: Total cross sections from a parametrisation. Good description from 1.5 MeV to 100 GeV for all Z.
|
||||
e+e- energies according Bethe-Heitler
|
||||
PhysicsTables from 1.022 MeV to 100 GeV in 100 bins.
|
||||
|
||||
msc: Model variant of multiple scattering for e-
|
||||
Lambda tables from 100 eV to 100 TeV in 120 bins.
|
||||
Boundary algorithm is active with facrange= 0.199
|
||||
|
||||
eIoni: tables are built for e-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 1, integral: 1
|
||||
Delta cross sections from Moller+Bhabha, good description from 1 KeV to 100 GeV.
|
||||
|
||||
eBrem: tables are built for e-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Total cross sections from a parametrisation based on the EEDL data library.
|
||||
Good description from 1 KeV to 100 GeV, log scale extrapolation above 100 GeV.
|
||||
|
||||
eIoni: tables are built for e+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 1, integral: 1
|
||||
Delta cross sections from Moller+Bhabha, good description from 1 KeV to 100 GeV.
|
||||
|
||||
eBrem: tables are built for e+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Total cross sections from a parametrisation based on the EEDL data library.
|
||||
Good description from 1 KeV to 100 GeV, log scale extrapolation above 100 GeV.
|
||||
|
||||
annihil: Total cross section from Heilter formula(annihilation into 2 photons).
|
||||
gamma energies sampled according Heitler
|
||||
PhysicsTables from 10 keV to 10 TeV in 100 bins.
|
||||
|
||||
msc: Model variant of multiple scattering for mu+
|
||||
Lambda tables from 100 eV to 100 TeV in 120 bins.
|
||||
Boundary algorithm is active with facrange= 0.199
|
||||
|
||||
MuIoni: tables are built for mu+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 0
|
||||
Bether-Bloch model for E > 0.2 MeV parametrisation of Bragg peak below.
|
||||
|
||||
MuBrems: tables are built for mu+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Parametrised model
|
||||
|
||||
MuPairProd: tables are built for mu+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Parametrised model
|
||||
### All dEdx and Range tables are built #####
|
||||
|
||||
MuIoni: tables are built for mu-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 0
|
||||
Bether-Bloch model for E > 0.2 MeV parametrisation of Bragg peak below.
|
||||
Energy weighted position of hits in LXe : (5.18102,30.2388,-98.8831)
|
||||
Total energy deposition in scintillator : 511 (keV)
|
||||
Reconstructed position of hits in LXe : (3.87256,8.56373,-27.017)
|
||||
Number of photons that hit PMTs in this event : 2160
|
||||
Number of PMTs above threshold(1) : 32
|
||||
Number of photons produced by scintillation in this event : 6040
|
||||
Number of photons produced by cerenkov in this event : 1
|
||||
Number of photons absorbed (OpAbsorption) in this event : 3881
|
||||
Number of photons absorbed at boundaries (OpBoundary) in this event : 0
|
||||
Unacounted for photons in this event : 0
|
||||
Energy weighted position of hits in LXe : (-28.7618,-1.33268,-9.54847)
|
||||
Total energy deposition in scintillator : 511 (keV)
|
||||
Reconstructed position of hits in LXe : (-5.96696,-2.2751,-2.77019)
|
||||
Number of photons that hit PMTs in this event : 2176
|
||||
Number of PMTs above threshold(1) : 32
|
||||
Number of photons produced by scintillation in this event : 6167
|
||||
Number of photons produced by cerenkov in this event : 1
|
||||
Number of photons absorbed (OpAbsorption) in this event : 3992
|
||||
Number of photons absorbed at boundaries (OpBoundary) in this event : 0
|
||||
Unacounted for photons in this event : 0
|
||||
Energy weighted position of hits in LXe : (1.6474,-12.2959,-71.5899)
|
||||
Total energy deposition in scintillator : 511 (keV)
|
||||
Reconstructed position of hits in LXe : (1.21798,-3.59905,-26.1855)
|
||||
Number of photons that hit PMTs in this event : 2230
|
||||
Number of PMTs above threshold(1) : 32
|
||||
Number of photons produced by scintillation in this event : 6217
|
||||
Number of photons produced by cerenkov in this event : 1
|
||||
Number of photons absorbed (OpAbsorption) in this event : 3988
|
||||
Number of photons absorbed at boundaries (OpBoundary) in this event : 0
|
||||
Unacounted for photons in this event : 0
|
||||
Graphics systems deleted.
|
||||
Visualization Manager deleting...
|
||||
@@ -0,0 +1,553 @@
|
||||
|
||||
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*
|
||||
**********
|
||||
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.
|
||||
|
||||
-------
|
||||
LXeMainVolume(G4RotationMatrix *pRot,
|
||||
const G4ThreeVector &tlate,
|
||||
G4LogicalVolume *pMotherLogical,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo,
|
||||
LXeDetectorConstruction* c);
|
||||
-------
|
||||
|
||||
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.
|
||||
|
||||
------
|
||||
if(!housing_log || updated){
|
||||
//...
|
||||
//Define logical volume
|
||||
//...
|
||||
}
|
||||
SetLogicalVolume(housing_log);
|
||||
------
|
||||
|
||||
The updated variable is to signal that the volume needs to be updated and a new
|
||||
logical volume made.
|
||||
|
||||
***********************************
|
||||
*Modifying the geometry at runtime*
|
||||
***********************************
|
||||
This example allows the user to modify the geometry definition at runtime. This
|
||||
is accomplished through LXeDetecotrMessenger, 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.
|
||||
|
||||
------
|
||||
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();
|
||||
}
|
||||
|
||||
************************
|
||||
*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.
|
||||
|
||||
------
|
||||
|
||||
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);
|
||||
|
||||
------
|
||||
|
||||
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.
|
||||
|
||||
------
|
||||
|
||||
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;
|
||||
}
|
||||
//...
|
||||
}
|
||||
|
||||
**********************
|
||||
*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.
|
||||
|
||||
RegisterPhysics( new LXeGeneralPhysics("general") );
|
||||
|
||||
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.
|
||||
|
||||
**********************************************************
|
||||
*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:
|
||||
|
||||
fpTrackingManager->SetTrajectory(new LXeTrajectory(aTrack));
|
||||
|
||||
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.
|
||||
|
||||
------
|
||||
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
|
||||
------
|
||||
|
||||
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.
|
||||
|
||||
****************************
|
||||
*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.
|
||||
|
||||
G4RunManager::SetRandomNumberStore(G4bool)
|
||||
|
||||
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.
|
||||
|
||||
G4RunManager::rndmSaveThisEvent()
|
||||
|
||||
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.
|
||||
|
||||
G4RunManager::SetRandomNumberStoreDir(G4String)
|
||||
|
||||
**************
|
||||
*RecorderBase*
|
||||
**************
|
||||
RecorderBase 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:
|
||||
|
||||
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()
|
||||
|
||||
For the reasoning behind why it is done this way see RecorderBase.hh
|
||||
|
||||
*************
|
||||
*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:
|
||||
/LXe/saveThreshold <int, default = 4500>
|
||||
-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".
|
||||
|
||||
/LXe/eventVerbose <int, default = 1>
|
||||
-Enables end of event verbose data to be printed. This includes information
|
||||
counted and calculated by the user action classes.
|
||||
|
||||
/LXe/pmtThreshold <int, default = 1>
|
||||
-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.
|
||||
|
||||
/LXe/oneStepPrimaries <bool>
|
||||
-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.
|
||||
|
||||
/LXe/forceDrawPhotons <bool>
|
||||
-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.
|
||||
|
||||
/LXe/forceDrawNoPhotons <bool>
|
||||
-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.
|
||||
|
||||
/LXe/detector/dimensions <double x y z> <unit, default = cm>
|
||||
-Sets the dimensions of the main scintillator volume.
|
||||
|
||||
/LXe/detector/housingThickness <double>
|
||||
-Sets the thickness of the housing surrounding the main detector volume.
|
||||
|
||||
/LXe/detector/pmtRadius <double> <unit, default = cm>
|
||||
-Sets the radius of the PMTs
|
||||
|
||||
/LXe/detector/nx
|
||||
/LXe/detector/ny
|
||||
/LXe/detector/nz
|
||||
-Sets the number of PMTs placed in a row along each axis.
|
||||
|
||||
/LXe/detector/reflectivity <double>
|
||||
-Sets the reflectivity of the inside of the aluminum housing. The geometry
|
||||
uses a default value of 1.00 for a fully reflective surface.
|
||||
|
||||
/LXe/detector/nfibers <int>
|
||||
-Sets the number of WLS fibers placed in the WLS scintillator slab. The
|
||||
geometry uses a default value of 15 fibers.
|
||||
|
||||
/LXe/detector/scintYieldFactor <double>
|
||||
-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.
|
||||
|
||||
/LXe/detector/update
|
||||
-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***
|
||||
|
||||
/LXe/detector/defaults
|
||||
-Resets all detector values customizable with commands above to their defaults.
|
||||
|
||||
/LXe/detector/volumes/sphere <bool>
|
||||
-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.
|
||||
|
||||
/LXe/detector/volumes/wls <bool>
|
||||
-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.
|
||||
|
||||
/LXe/detector/volumes/lxe <bool>
|
||||
-Enables/disables the main LXe scintillator volume. By default this is part of
|
||||
the geometry.
|
||||
|
||||
*************
|
||||
*Macro files*
|
||||
*************
|
||||
The following are the macro files included in this example and what they do.
|
||||
|
||||
LXe.in
|
||||
-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
|
||||
-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
|
||||
-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
|
||||
-This is a standard vis.mac file to tell the vis manager how to visualize the
|
||||
simulation.
|
||||
|
||||
photon.mac
|
||||
-A very simple test in which the gun is set to produce a single photon inside
|
||||
the main scintillator volume.
|
||||
|
||||
reviewEvent.mac
|
||||
-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
|
||||
-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
|
||||
@@ -0,0 +1,73 @@
|
||||
#LXe Example Walkthrough
|
||||
#-----------------------
|
||||
#
|
||||
#Follow these steps to see what this example can do.
|
||||
#
|
||||
#You can also execute steps 3-7 of this walkthrough as a macro file
|
||||
#/control/execute WALKTHROUGH
|
||||
|
||||
#1) Compile
|
||||
#>cd LXe/
|
||||
#>gmake
|
||||
|
||||
#2) Launch the program
|
||||
#>$G4WORKDIR/bin/$G4SYSTEM/LXe
|
||||
|
||||
#3) Run a basic event
|
||||
|
||||
#3a)Turn on verbose output at end of event
|
||||
# We'll leave it on for the rest of the events in the walkthrough too
|
||||
/LXe/eventVerbose 1
|
||||
|
||||
#3b)Run
|
||||
/run/beamOn
|
||||
|
||||
#You will see a blue trajectory representing the gamma and some green
|
||||
#trajectories representing the optical photons that hit the sphere and
|
||||
#went into a pmt. Any pmt that had a trajectory drawn and is above it's
|
||||
#threshold(1) will be redrawn red.
|
||||
|
||||
#4) Run a cerenkov cone event
|
||||
/control/execute cerenkov.mac
|
||||
/run/beamOn
|
||||
|
||||
#You will see a circle of PMTs that have lit up from the optical photons
|
||||
#produced by the cerenkov process. The cone does not fill in because the
|
||||
#primary particle was killed after one step in the scintillator.
|
||||
|
||||
#5) Run a wls event
|
||||
/control/execute wls.mac
|
||||
/run/beamOn
|
||||
|
||||
#You will see a number of green and red trajectories drawn. The green ones
|
||||
#are the optical photons produced by scintillation. The red ones are created
|
||||
#by the wavelength shifting(WLS) fibers which absorbed the scintillation
|
||||
#photons and re-emited them at a different wavelength. Most of the WLS photons
|
||||
#then travel down the fibers to the edge of the slab.
|
||||
|
||||
#6) Modify the geometry yourself
|
||||
|
||||
#6a)Turning the sphere off
|
||||
/LXe/detector/defaults
|
||||
/LXe/detector/volumes/sphere 0
|
||||
/LXe/detector/update
|
||||
|
||||
#6b)Changing the dimensions
|
||||
/LXe/detector/dimensions 15 15 50 cm
|
||||
/LXe/detector/update
|
||||
|
||||
#6c)Changing the PMTs
|
||||
/LXe/detector/pmtRadius 0.5 cm
|
||||
/LXe/detector/nx 15
|
||||
/LXe/detector/ny 15
|
||||
/LXe/detector/nz 50
|
||||
/LXe/detector/update
|
||||
|
||||
#7) Test your new geometry
|
||||
/gun/particle gamma
|
||||
/run/beamOn
|
||||
|
||||
#Done
|
||||
#
|
||||
#For more specific information
|
||||
/random/setDirectoryName random2
|
||||
@@ -0,0 +1,35 @@
|
||||
#################
|
||||
##
|
||||
## This example demonstrates the cerenkov process by using a 200 MeV mu+
|
||||
## particle in a geometry configuration that shows the cerenkov cone
|
||||
## and pmts hit by it.
|
||||
##
|
||||
#################
|
||||
|
||||
/control/execute defaults.mac
|
||||
|
||||
#This currently causes the program to crash due to a bug in geant4
|
||||
#Uncomment it once that bug has been fixed. Until then, to use this,
|
||||
#modify LXePhysicsList to disable scintillation.
|
||||
#/process/inactivate Scintillation
|
||||
|
||||
/LXe/detector/MainScintYield 0
|
||||
|
||||
/LXe/detector/nx 20
|
||||
/LXe/detector/ny 20
|
||||
/LXe/detector/nz 0
|
||||
/LXe/detector/dimensions 60 60 25 cm
|
||||
/LXe/detector/pmtRadius 1.5 cm
|
||||
/LXe/detector/volumes/sphere 0
|
||||
/LXe/detector/reflectivity 0.0
|
||||
/LXe/detector/update
|
||||
|
||||
/gun/particle mu+
|
||||
/gun/energy 200 MeV
|
||||
|
||||
#This causes the primary particle to be killed after its first step in the
|
||||
#scintillator volume. Thus preventing the cerenkov cone to fill in.
|
||||
/LXe/oneStepPrimaries true
|
||||
|
||||
#reset from a random seed that shows a good cone
|
||||
/random/resetEngineFrom random/goodCerenkov.rndm
|
||||
@@ -0,0 +1,6 @@
|
||||
#Resets all defaults
|
||||
/LXe/detector/defaults
|
||||
/LXe/detector/update
|
||||
/LXe/oneStepPrimaries false
|
||||
/gun/particle gamma
|
||||
/gun/energy 511 keV
|
||||
@@ -0,0 +1,146 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeDetectorConstruction_H
|
||||
#define LXeDetectorConstruction_H 1
|
||||
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4Box;
|
||||
class G4Tubs;
|
||||
class LXePMTSD;
|
||||
class LXeScintSD;
|
||||
class G4Sphere;
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "LXeDetectorMessenger.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
class LXeDetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
LXeDetectorConstruction();
|
||||
~LXeDetectorConstruction();
|
||||
|
||||
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();
|
||||
|
||||
//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;}
|
||||
|
||||
void SetSphereOn(G4bool b){sphereOn=b;updated=true;}
|
||||
static G4bool GetSphereOn(){return sphereOn;}
|
||||
|
||||
void SetHousingReflectivity(G4double r){refl=r;updated=true;}
|
||||
G4double GetHousingReflectivity(){return refl;}
|
||||
|
||||
void SetWLSSlabOn(G4bool b){WLSslab=b;updated=true;}
|
||||
G4bool GetWLSSlabOn(){return WLSslab;}
|
||||
|
||||
void SetMainVolumeOn(G4bool b){mainVolume=b;updated=true;}
|
||||
G4bool GetMainVolumeOn(){return mainVolume;}
|
||||
|
||||
void SetNFibers(G4int n){nfibers=n;updated=true;}
|
||||
G4int GetNFibers(){return nfibers;}
|
||||
|
||||
void SetMainScintYield(G4double y);
|
||||
void SetWLSScintYield(G4double y);
|
||||
|
||||
private:
|
||||
|
||||
void DefineMaterials();
|
||||
G4VPhysicalVolume* ConstructDetector();
|
||||
|
||||
LXeDetectorMessenger* detectorMessenger;
|
||||
|
||||
G4bool updated;
|
||||
|
||||
G4Box* experimentalHall_box;
|
||||
G4LogicalVolume* experimentalHall_log;
|
||||
G4VPhysicalVolume* experimentalHall_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;
|
||||
|
||||
|
||||
|
||||
//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;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeDetectorMessenger_h
|
||||
#define LXeDetectorMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class LXeDetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWith3VectorAndUnit;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcommand;
|
||||
class G4UIcmdWithABool;
|
||||
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;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeEMPhysics_h
|
||||
#define LXeEMPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4MultipleScattering.hh"
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
class LXeEMPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
LXeEMPhysics(const G4String& name ="EM");
|
||||
virtual ~LXeEMPhysics();
|
||||
|
||||
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
|
||||
virtual void ConstructProcess();
|
||||
|
||||
protected:
|
||||
// Gamma physics
|
||||
G4PhotoElectricEffect* thePhotoEffect;
|
||||
G4ComptonScattering* theComptonEffect;
|
||||
G4GammaConversion* thePairProduction;
|
||||
|
||||
// Electron physics
|
||||
G4MultipleScattering* theElectronMultipleScattering;
|
||||
G4eIonisation* theElectronIonisation;
|
||||
G4eBremsstrahlung* theElectronBremsStrahlung;
|
||||
|
||||
//Positron physics
|
||||
G4MultipleScattering* thePositronMultipleScattering;
|
||||
G4eIonisation* thePositronIonisation;
|
||||
G4eBremsstrahlung* thePositronBremsStrahlung;
|
||||
G4eplusAnnihilation* theAnnihilation;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeEventAction_h
|
||||
#define LXeEventAction_h 1
|
||||
|
||||
#include "LXeEventMessenger.hh"
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4Event;
|
||||
class RecorderBase;
|
||||
|
||||
class LXeEventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
LXeEventAction(RecorderBase*);
|
||||
~LXeEventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
|
||||
void SetSaveThreshold(G4int save);
|
||||
|
||||
void SetEventVerbose(G4int v){verbose=v;}
|
||||
|
||||
void SetPMTThreshold(G4int t){pmtThreshold=t;}
|
||||
|
||||
void SetForceDrawPhotons(G4bool b){forcedrawphotons=b;}
|
||||
void SetForceDrawNoPhotons(G4bool b){forcenophotons=b;}
|
||||
|
||||
private:
|
||||
RecorderBase* recorder;
|
||||
LXeEventMessenger* eventMessenger;
|
||||
|
||||
G4int saveThreshold;
|
||||
|
||||
G4int scintCollID;
|
||||
G4int pmtCollID;
|
||||
|
||||
G4int verbose;
|
||||
|
||||
G4int pmtThreshold;
|
||||
|
||||
G4bool forcedrawphotons;
|
||||
G4bool forcenophotons;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeEventMessenger_h
|
||||
#define LXeEventMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class LXeEventAction;
|
||||
class G4UIcmdWithAnInteger;
|
||||
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;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeGeneralPhysics_h
|
||||
#define LXeGeneralPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
|
||||
#include "G4Decay.hh"
|
||||
|
||||
class LXeGeneralPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
LXeGeneralPhysics(const G4String& name = "general");
|
||||
virtual ~LXeGeneralPhysics();
|
||||
|
||||
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
|
||||
virtual void ConstructProcess();
|
||||
|
||||
protected:
|
||||
G4Decay* fDecayProcess;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeMainVolume_H
|
||||
#define LXeMainVolume_H 1
|
||||
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4Sphere.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4OpticalSurface.hh"
|
||||
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
|
||||
class LXeMainVolume : public G4PVPlacement
|
||||
{
|
||||
public:
|
||||
LXeMainVolume(G4RotationMatrix *pRot,
|
||||
const G4ThreeVector &tlate,
|
||||
G4LogicalVolume *pMotherLogical,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo,
|
||||
LXeDetectorConstruction* c);
|
||||
private:
|
||||
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 updated;
|
||||
|
||||
LXeDetectorConstruction* constructor;
|
||||
|
||||
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;
|
||||
|
||||
//Basic Volumes
|
||||
//
|
||||
G4Box* scint_box;
|
||||
G4Box* housing_box;
|
||||
G4Tubs* pmt;
|
||||
G4Tubs* photocath;
|
||||
G4Sphere* sphere;
|
||||
|
||||
|
||||
// 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;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeMuonPhysics_h
|
||||
#define LXeMuonPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
#include "G4MultipleScattering.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4hIonisation.hh"
|
||||
|
||||
#include "G4MuonMinusCaptureAtRest.hh"
|
||||
|
||||
class LXeMuonPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
LXeMuonPhysics(const G4String& name="muon");
|
||||
virtual ~LXeMuonPhysics();
|
||||
|
||||
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
|
||||
virtual void ConstructProcess();
|
||||
|
||||
protected:
|
||||
// Muon physics
|
||||
G4MuIonisation* fMuPlusIonisation;
|
||||
G4MultipleScattering* fMuPlusMultipleScattering;
|
||||
G4MuBremsstrahlung* fMuPlusBremsstrahlung ;
|
||||
G4MuPairProduction* fMuPlusPairProduction;
|
||||
|
||||
G4MuIonisation* fMuMinusIonisation;
|
||||
G4MultipleScattering* fMuMinusMultipleScattering;
|
||||
G4MuBremsstrahlung* fMuMinusBremsstrahlung ;
|
||||
G4MuPairProduction* fMuMinusPairProduction;
|
||||
|
||||
G4MuonMinusCaptureAtRest* fMuMinusCaptureAtRest;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeOpPhysMessenger_h
|
||||
#define LXeOpPhysMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class LXeOpticalPhysics;
|
||||
class G4UIcmdWithADouble;
|
||||
|
||||
class LXeOpPhysMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
LXeOpPhysMessenger(LXeOpticalPhysics*);
|
||||
~LXeOpPhysMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
|
||||
LXeOpticalPhysics* OpPhys;
|
||||
|
||||
G4UIcmdWithADouble* yieldCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeOpticalPhysics_h
|
||||
#define LXeOpticalPhysics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
#include "G4Scintillation.hh"
|
||||
#include "G4Cerenkov.hh"
|
||||
#include "G4OpAbsorption.hh"
|
||||
#include "G4OpRayleigh.hh"
|
||||
#include "G4OpBoundaryProcess.hh"
|
||||
#include "G4OpWLS.hh"
|
||||
|
||||
class LXeOpticalPhysics : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
LXeOpticalPhysics(const G4String& name ="optical");
|
||||
virtual ~LXeOpticalPhysics();
|
||||
|
||||
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
|
||||
virtual void ConstructProcess();
|
||||
|
||||
void SetScintYieldFactor(G4double yf);
|
||||
|
||||
protected:
|
||||
|
||||
G4Scintillation* theScintProcess;
|
||||
G4Cerenkov* theCerenkovProcess;
|
||||
G4OpAbsorption* theAbsorptionProcess;
|
||||
G4OpRayleigh* theRayleighScattering;
|
||||
G4OpBoundaryProcess* theBoundaryProcess;
|
||||
G4OpWLS* theWLSProcess;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXePMTHit_h
|
||||
#define LXePMTHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
class G4VTouchable;
|
||||
|
||||
class LXePMTHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
LXePMTHit();
|
||||
~LXePMTHit();
|
||||
LXePMTHit(const LXePMTHit &right);
|
||||
|
||||
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 SetDrawit(G4bool b){drawit=b;}
|
||||
inline G4bool GetDrawit(){return drawit;}
|
||||
|
||||
inline void IncPhotonCount(){photons++;}
|
||||
inline G4int GetPhotonCount(){return photons;}
|
||||
|
||||
inline void SetPMTNumber(G4int n) { pmtNumber = n; }
|
||||
inline G4int GetPMTNumber() { return pmtNumber; }
|
||||
|
||||
inline void SetPMTPhysVol(G4VPhysicalVolume* physVol){this->physVol=physVol;}
|
||||
inline G4VPhysicalVolume* GetPMTPhysVol(){return physVol;}
|
||||
|
||||
inline void SetPMTPos(G4double x,G4double y,G4double z){
|
||||
pos=G4ThreeVector(x,y,z);
|
||||
}
|
||||
|
||||
inline G4ThreeVector GetPMTPos(){return pos;}
|
||||
|
||||
private:
|
||||
G4int pmtNumber;
|
||||
G4int photons;
|
||||
G4ThreeVector pos;
|
||||
G4VPhysicalVolume* physVol;
|
||||
G4bool drawit;
|
||||
|
||||
};
|
||||
|
||||
typedef G4THitsCollection<LXePMTHit> LXePMTHitsCollection;
|
||||
|
||||
extern G4Allocator<LXePMTHit> LXePMTHitAllocator;
|
||||
|
||||
inline void* LXePMTHit::operator new(size_t){
|
||||
void *aHit;
|
||||
aHit = (void *) LXePMTHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
inline void LXePMTHit::operator delete(void *aHit){
|
||||
LXePMTHitAllocator.FreeSingle((LXePMTHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#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);
|
||||
}
|
||||
|
||||
//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;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXePhysicsList_h
|
||||
#define LXePhysicsList_h 1
|
||||
|
||||
#include "G4VModularPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class LXePhysicsList: public G4VModularPhysicsList
|
||||
{
|
||||
public:
|
||||
LXePhysicsList();
|
||||
virtual ~LXePhysicsList();
|
||||
|
||||
public:
|
||||
// SetCuts()
|
||||
virtual void SetCuts();
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXePrimaryGeneratorAction_h
|
||||
#define LXePrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4GeneralParticleSource.hh"
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
|
||||
class LXePrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
LXePrimaryGeneratorAction();
|
||||
~LXePrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event* anEvent);
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4UserRunAction.hh"
|
||||
|
||||
#ifndef LXeRunAction_h
|
||||
#define LXeRunAction_h 1
|
||||
|
||||
class RecorderBase;
|
||||
|
||||
class LXeRunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
LXeRunAction(RecorderBase*);
|
||||
~LXeRunAction();
|
||||
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
void EndOfRunAction(const G4Run*);
|
||||
|
||||
private:
|
||||
RecorderBase* recorder;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeScintHit_h
|
||||
#define LXeScintHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
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;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
void Draw();
|
||||
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 const G4VPhysicalVolume * GetPhysV() { return physVol; }
|
||||
|
||||
private:
|
||||
G4double edep;
|
||||
G4ThreeVector pos;
|
||||
const G4VPhysicalVolume* physVol;
|
||||
|
||||
};
|
||||
|
||||
typedef G4THitsCollection<LXeScintHit> LXeScintHitsCollection;
|
||||
|
||||
extern G4Allocator<LXeScintHit> LXeScintHitAllocator;
|
||||
|
||||
inline void* LXeScintHit::operator new(size_t)
|
||||
{
|
||||
void *aHit;
|
||||
aHit = (void *) LXeScintHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
inline void LXeScintHit::operator delete(void *aHit)
|
||||
{
|
||||
LXeScintHitAllocator.FreeSingle((LXeScintHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeScintSD_h
|
||||
#define LXeScintSD_h 1
|
||||
|
||||
#include "LXeScintHit.hh"
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
|
||||
class G4Step;
|
||||
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;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeStackingAction_H
|
||||
#define LXeStackingAction_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UserStackingAction.hh"
|
||||
|
||||
class LXeStackingAction : public G4UserStackingAction
|
||||
{
|
||||
public:
|
||||
LXeStackingAction();
|
||||
~LXeStackingAction();
|
||||
|
||||
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
|
||||
virtual void NewStage();
|
||||
virtual void PrepareNewEvent();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeSteppingAction_H
|
||||
#define LXeSteppingACtion_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UserSteppingAction.hh"
|
||||
|
||||
class RecorderBase;
|
||||
class LXeEventAction;
|
||||
class LXeTrackingAction;
|
||||
class LXeSteppingMessenger;
|
||||
|
||||
class LXeSteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
LXeSteppingAction(RecorderBase*);
|
||||
~LXeSteppingAction();
|
||||
virtual void UserSteppingAction(const G4Step*);
|
||||
|
||||
void SetOneStepPrimaries(G4bool b){oneStepPrimaries=b;}
|
||||
G4bool GetOneStepPrimaries(){return oneStepPrimaries;}
|
||||
|
||||
private:
|
||||
RecorderBase* recorder;
|
||||
G4bool oneStepPrimaries;
|
||||
LXeSteppingMessenger* steppingMessenger;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeSteppingMessenger_h
|
||||
#define LXeSteppingMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class LXeSteppingAction;
|
||||
class G4UIcmdWithABool;
|
||||
|
||||
class LXeSteppingMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
LXeSteppingMessenger(LXeSteppingAction*);
|
||||
~LXeSteppingMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
LXeSteppingAction* stepping;
|
||||
G4UIcmdWithABool* oneStepPrimariesCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
class LXeSteppingVerbose;
|
||||
|
||||
#ifndef LXeSteppingVerbose_h
|
||||
#define LXeSteppingVerbose_h 1
|
||||
|
||||
#include "G4SteppingVerbose.hh"
|
||||
|
||||
|
||||
class LXeSteppingVerbose : public G4SteppingVerbose
|
||||
{
|
||||
public:
|
||||
|
||||
LXeSteppingVerbose();
|
||||
~LXeSteppingVerbose();
|
||||
|
||||
void StepInfo();
|
||||
void TrackingStarted();
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeTrackingAction_h
|
||||
#define LXeTrackingAction_h 1
|
||||
|
||||
#include "G4UserTrackingAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class RecorderBase;
|
||||
|
||||
class LXeTrackingAction : public G4UserTrackingAction {
|
||||
|
||||
public:
|
||||
LXeTrackingAction(RecorderBase*);
|
||||
~LXeTrackingAction() {};
|
||||
|
||||
void PreUserTrackingAction(const G4Track*);
|
||||
void PostUserTrackingAction(const G4Track*);
|
||||
|
||||
private:
|
||||
RecorderBase* recorder;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeTrajectory_h
|
||||
#define LXeTrajectory_h 1
|
||||
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4TrajectoryPoint.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
class G4Polyline; // Forward declaration.
|
||||
|
||||
class LXeTrajectory : public G4Trajectory
|
||||
{
|
||||
public:
|
||||
LXeTrajectory();
|
||||
LXeTrajectory(const G4Track* aTrack);
|
||||
LXeTrajectory(LXeTrajectory &);
|
||||
virtual ~LXeTrajectory();
|
||||
|
||||
virtual void DrawTrajectory(G4int i_mode=0) const;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
extern G4Allocator<LXeTrajectory> LXeTrajectoryAllocator;
|
||||
|
||||
inline void* LXeTrajectory::operator new(size_t)
|
||||
{
|
||||
void* aTrajectory;
|
||||
aTrajectory = (void*)LXeTrajectoryAllocator.MallocSingle();
|
||||
return aTrajectory;
|
||||
}
|
||||
|
||||
inline void LXeTrajectory::operator delete(void* aTrajectory)
|
||||
{
|
||||
LXeTrajectoryAllocator.FreeSingle((LXeTrajectory*)aTrajectory);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4VUserEventInformation.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#ifndef LXeUserEventInformation_h
|
||||
#define LXeUserEventInformation_h 1
|
||||
|
||||
class LXeUserEventInformation : public G4VUserEventInformation
|
||||
{
|
||||
public:
|
||||
LXeUserEventInformation();
|
||||
~LXeUserEventInformation();
|
||||
|
||||
inline void Print()const{};
|
||||
|
||||
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;}
|
||||
|
||||
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;}
|
||||
|
||||
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;}
|
||||
|
||||
//Gets the total photon count produced
|
||||
G4int GetPhotonCount(){return photonCount_Scint+photonCount_Ceren;}
|
||||
|
||||
void IncPMTSAboveThreshold(){pmtsAboveThreshold++;}
|
||||
G4int GetPMTSAboveThreshold(){return pmtsAboveThreshold;}
|
||||
|
||||
private:
|
||||
|
||||
G4int hitCount;
|
||||
G4int photonCount_Scint;
|
||||
G4int photonCount_Ceren;
|
||||
G4int absorptionCount;
|
||||
G4int boundaryAbsorptionCount;
|
||||
|
||||
G4double totE;
|
||||
|
||||
//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;
|
||||
|
||||
G4int pmtsAboveThreshold;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4VUserTrackInformation.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#ifndef LXeUserTrackInformation_h
|
||||
#define LXeUserTrackInformation_h 1
|
||||
|
||||
enum LXeTrackStatus { active=1, hitPMT=2, absorbed=4, boundaryAbsorbed=8,
|
||||
hitSphere=16, inactive=14};
|
||||
|
||||
/*LXeTrackStatus:
|
||||
active: still being tracked
|
||||
hitPMT: stopped by being detected in a PMT
|
||||
absorbed: stopped by being absorbed with G4OpAbsorbtion
|
||||
boundaryAbsorbed: stopped by being aborbed with G4OpAbsorbtion
|
||||
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;}
|
||||
|
||||
void SetForceDrawTrajectory(G4bool b){forcedraw=b;}
|
||||
G4bool GetForceDrawTrajectory(){return forcedraw;}
|
||||
|
||||
inline void Print()const{};
|
||||
private:
|
||||
int status;
|
||||
G4int reflections;
|
||||
G4bool forcedraw;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef LXeVisManager_h
|
||||
#define LXeVisManager_h 1
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
|
||||
class LXeVisManager: public G4VisManager
|
||||
{
|
||||
public:
|
||||
|
||||
LXeVisManager ();
|
||||
|
||||
private:
|
||||
|
||||
void RegisterGraphicsSystems ();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeMainVolume_H
|
||||
#define LXeMainVolume_H 1
|
||||
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4Sphere.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4OpticalSurface.hh"
|
||||
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
|
||||
class LXeWLSFiber : public G4PVPlacement
|
||||
{
|
||||
public:
|
||||
LXeWLSFiber(G4RotationMatrix *pRot,
|
||||
const G4ThreeVector &tlate,
|
||||
G4LogicalVolume *pMotherLogical,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo,
|
||||
LXeDetectorConstruction* c);
|
||||
private:
|
||||
|
||||
void CopyValues();
|
||||
|
||||
static G4LogicalVolume* clad2_log;
|
||||
|
||||
G4bool updated; //does the fiber need to be rebuilt
|
||||
|
||||
G4double fiber_rmin;
|
||||
G4double fiber_rmax;
|
||||
G4double fiber_z;
|
||||
G4double fiber_sphi;
|
||||
G4double fiber_ephi;
|
||||
|
||||
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;
|
||||
|
||||
LXeDetectorConstruction* constructor;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef LXeWLSSlab_H
|
||||
#define LXeWLSSlab_H 1
|
||||
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4OpticalSurface.hh"
|
||||
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
|
||||
class LXeWLSSlab : public G4PVPlacement
|
||||
{
|
||||
public:
|
||||
LXeWLSSlab(G4RotationMatrix *pRot,
|
||||
const G4ThreeVector &tlate,
|
||||
G4LogicalVolume *pMotherLogical,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo,
|
||||
LXeDetectorConstruction* c);
|
||||
private:
|
||||
void CopyValues();
|
||||
|
||||
LXeDetectorConstruction* constructor;
|
||||
|
||||
G4bool updated;
|
||||
|
||||
static G4LogicalVolume* ScintSlab_log;
|
||||
|
||||
G4int nfibers;
|
||||
G4double scint_x;
|
||||
G4double scint_y;
|
||||
G4double scint_z;
|
||||
G4double slab_z;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// RecorderBase.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).
|
||||
|
||||
// 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
|
||||
// takes the form of histograms, or ntuples, or entries in an Objectivity
|
||||
// database. This class does not care HOW the information is recorded; it
|
||||
// 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
|
||||
// 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:
|
||||
// the class that inherits Recorder. The original Geant documentation suggests
|
||||
// that recording activities should be split among many different classes
|
||||
// (initialization in G4UserRunAction, recording in G4UserSteppingAction, etc.).
|
||||
// If you use a Recorder class, than all the record-keeping details are kept in
|
||||
// a single class instead of being spread out among many different classes.
|
||||
|
||||
// Secondly, by using an abstract Recorder class, you hide the implementation
|
||||
// details from the rest of Geant. If you change a couple of histograms, only
|
||||
// the Recorder-derived class and main() re-compile. No other class knows or
|
||||
// cares what or how you record.
|
||||
|
||||
// The only time this class (i.e., this header file) changes is if new
|
||||
// user action classes are added to Geant.
|
||||
|
||||
#ifndef RECORDER_BASE_H_
|
||||
#define RECORDER_BASE_H_
|
||||
|
||||
// The following objects are the arguments to the methods
|
||||
// invoked in the user action classes. In other words, they
|
||||
// contain the variables that we are normally able to record
|
||||
// in Geant.
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
|
||||
class RecorderBase {
|
||||
|
||||
public:
|
||||
|
||||
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.
|
||||
|
||||
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*) {};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#This sets the gun up to shoot an optical photon
|
||||
|
||||
/gun/particle opticalphoton
|
||||
/gun/energy 7.07 eV
|
||||
/gun/position 5 5 -5
|
||||
/gun/direction 0 0 1
|
||||
/gun/polarization 0 1 0
|
||||
/tracking/verbose 1
|
||||
@@ -0,0 +1,4 @@
|
||||
9876
|
||||
0.56681203842163085938 0.8818575739860534668 0.1730893254280090332 0.14319986104965209961 0.035721004009246826172 0.34925764799118041992 0.28501272201538085938 0.38132303953170776367 0.62201237678527832031 0.20565438270568847656 0.51734459400177001953 0.0018442273139953613281 0.83568513393402099609 0.67255008220672607422 0.022201955318450927734 0.31370401382446289062 0.65152716636657714844 0.51525962352752685547 0.13611382246017456055 0.39237362146377563477 0.17890757322311401367 0.018748521804809570312 0.74669891595840454102 0.63569098711013793945 0.073960602283477783203 0.33233171701431274414 0.69413357973098754883 0.82883942127227783203 0.59673321247100830078 0.41404730081558227539 0.89632904529571533203 0.4291197657585144043 0.70435327291488647461 0.37617194652557373047 0.4301236271858215332 0.99019861221313476562 0.5244274139404296875 0.8363087773323059082 0.8305816650390625 0.57788676023483276367 0.91085344552993774414 0.21985799074172973633 0.54762703180313110352 0.11778682470321655273 0.9188111424446105957 0.72943127155303955078 0.46844464540481567383 0.2827618718147277832 0.99514055252075195312 0.72067165374755859375 0.12396198511123657227 0.080310046672821044922 0.70882409811019897461 0.52431392669677734375 0.88081890344619750977 0.99685639142990112305 0.94265908002853393555 0.33713871240615844727 0.74416977167129516602 0.22824853658676147461 0.082926869392395019531 0.18564522266387939453 0.34945064783096313477 0.60222530364990234375 0.017525255680084228516 0.43096917867660522461 0.48324662446975708008 0.39256495237350463867 0.0072730183601379394531 0.63571560382843017578 0.17306280136108398438 0.97272169589996337891 0.7579097747802734375 0.55440682172775268555 0.14758986234664916992 0.41869682073593139648 0.79592418670654296875 0.86972385644912719727 0.54268193244934082031 0.997844696044921875 0.86584252119064331055 0.43902021646499633789 0.78208905458450317383 0.88179171085357666016 0.87943494319915771484 0.90155231952667236328 0.087386727333068847656 0.61781984567642211914 0.30473810434341430664 0.47076767683029174805 0.73844110965728759766 0.14166754484176635742 0.30390328168869018555 0.46929192543029785156 0.55683130025863647461 0.28227478265762329102 0.95229834318161010742
|
||||
0.76775765419006347656 0.45623308420181274414 0.99999982118606567383
|
||||
23
|
||||
@@ -0,0 +1,4 @@
|
||||
9876
|
||||
0.92125302553176879883 0.51544678211212158203 0.67267376184463500977 0.99960952997207641602 0.73500490188598632812 0.14663052558898925781 0.327220916748046875 0.28244459629058837891 0.78949397802352905273 0.093892931938171386719 0.096919715404510498047 0.25809901952743530273 0.30182248353958129883 0.10896265506744384766 0.90281927585601806641 0.14277166128158569336 0.56514334678649902344 0.19390600919723510742 0.34528815746307373047 0.6997076869010925293 0.16365110874176025391 0.2057622075080871582 0.66192162036895751953 0.77415615320205688477 0.47197580337524414062 0.39650458097457885742 0.20748364925384521484 0.29045593738555908203 0.84009760618209838867 0.29163771867752075195 0.59290927648544311523 0.31230205297470092773 0.56357717514038085938 0.65972506999969482422 0.42169034481048583984 0.8014284968376159668 0.37207293510437011719 0.38072133064270019531 0.12004232406616210938 0.067275762557983398438 0.66892981529235839844 0.40911883115768432617 0.28658241033554077148 0.83672672510147094727 0.063057541847229003906 0.75380331277847290039 0.94101244211196899414 0.96997821331024169922 0.94666111469268798828 0.85202765464782714844 0.27402770519256591797 0.29762184619903564453 0.74813288450241088867 0.80445879697799682617 0.92037785053253173828 0.41038811206817626953 0.96435499191284179688 0.18090295791625976562 0.48866999149322509766 0.25927275419235229492 0.0071230530738830566406 0.92619866132736206055 0.45841747522354125977 0.47095978260040283203 0.65414857864379882812 0.59665590524673461914 0.28430700302124023438 0.14905124902725219727 0.33299231529235839844 0.83767873048782348633 0.87545442581176757812 0.99776959419250488281 0.89845907688140869141 0.17407262325286865234 0.3612766265869140625 0.35344660282135009766 0.39899152517318725586 0.875675201416015625 0.68153816461563110352 0.70409196615219116211 0.11360943317413330078 0.31014680862426757812 0.60188585519790649414 0.33334380388259887695 0.69083064794540405273 0.20584398508071899414 0.3993466496467590332 0.49265468120574951172 0.099120676517486572266 0.66696119308471679688 0.79467463493347167969 0.4049422144889831543 0.45345091819763183594 0.21245485544204711914 0.28231561183929443359 0.76128053665161132812 0.3698933720588684082
|
||||
0.55329096317291259766 0.45623308420181274414 0.99999982118606567383
|
||||
58
|
||||
@@ -0,0 +1,6 @@
|
||||
#quickly review a particular event
|
||||
#replace file name with that of the correct event
|
||||
|
||||
/random/resetEngineFrom random/run0.rndm
|
||||
/tracking/verbose 1
|
||||
/run/beamOn
|
||||
@@ -0,0 +1,359 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
#include "LXePMTSD.hh"
|
||||
#include "LXeScintSD.hh"
|
||||
#include "LXeDetectorMessenger.hh"
|
||||
#include "LXeMainVolume.hh"
|
||||
#include "LXeWLSSlab.hh"
|
||||
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4LogicalBorderSurface.hh"
|
||||
#include "G4LogicalSkinSurface.hh"
|
||||
#include "G4OpticalSurface.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4Sphere.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4SolidStore.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4PhysicalVolumeStore.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
G4bool LXeDetectorConstruction::sphereOn = true;
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeDetectorConstruction::LXeDetectorConstruction(){
|
||||
SetDefaults();
|
||||
detectorMessenger = new LXeDetectorMessenger(this);
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeDetectorConstruction::~LXeDetectorConstruction(){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorConstruction::DefineMaterials(){
|
||||
G4double a; // atomic mass
|
||||
G4double z; // atomic number
|
||||
G4double density;
|
||||
|
||||
G4int polyPMMA = 1;
|
||||
G4int nC_PMMA = 3+2*polyPMMA;
|
||||
G4int nH_PMMA = 6+2*polyPMMA;
|
||||
|
||||
G4int polyeth = 1;
|
||||
G4int nC_eth = 2*polyeth;
|
||||
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);
|
||||
|
||||
//***Materials
|
||||
//Liquid Xenon
|
||||
LXe = 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);
|
||||
//Vacuum
|
||||
Vacuum = 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);
|
||||
//Glass
|
||||
Glass = new G4Material("Glass", density=1.032*g/cm3,2);
|
||||
Glass->AddElement(C,91.533*perCent);
|
||||
Glass->AddElement(H,8.467*perCent);
|
||||
//Polystyrene
|
||||
Pstyrene = new G4Material("Polystyrene", density= 1.03*g/cm3, 2);
|
||||
Pstyrene->AddElement(C, 8);
|
||||
Pstyrene->AddElement(H, 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);
|
||||
//Cladding(polyethylene)
|
||||
Pethylene = new G4Material("Pethylene", density=1200*kg/m3,2);
|
||||
Pethylene->AddElement(H,nH_eth);
|
||||
Pethylene->AddElement(C,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);
|
||||
|
||||
//***Material properties tables
|
||||
|
||||
const G4int LXe_NUMENTRIES = 3;
|
||||
G4double LXe_Energy[LXe_NUMENTRIES] = { 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 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);
|
||||
|
||||
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
|
||||
|
||||
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]={1.00, 1.00, 0.00, 0.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);
|
||||
|
||||
G4double RefractiveIndexFiber[WLS_NUMENTRIES]={ 1.60, 1.60, 1.60, 1.60};
|
||||
G4double AbsFiber[WLS_NUMENTRIES]={0.1*mm,0.1*mm,9.00*m,9.00*m};
|
||||
G4double EmissionFib[WLS_NUMENTRIES]={0.0, 0.0,1.0, 1.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 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 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);
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
G4VPhysicalVolume* LXeDetectorConstruction::Construct(){
|
||||
DefineMaterials();
|
||||
return ConstructDetector();
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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;
|
||||
|
||||
//Create experimental hall
|
||||
experimentalHall_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);
|
||||
|
||||
experimentalHall_log->SetVisAttributes(G4VisAttributes::Invisible);
|
||||
|
||||
//Place the main volume
|
||||
if(mainVolume){
|
||||
new LXeMainVolume(0,G4ThreeVector(),experimentalHall_log,false,0,this);
|
||||
}
|
||||
|
||||
//Place the WLS slab
|
||||
if(WLSslab){
|
||||
G4VPhysicalVolume* slab = new LXeWLSSlab(0,G4ThreeVector(0.,0.,
|
||||
-scint_z/2.-slab_z-1.*cm),
|
||||
experimentalHall_log,false,0,
|
||||
this);
|
||||
|
||||
//Surface properties for the WLS slab
|
||||
G4OpticalSurface* ScintWrap = new G4OpticalSurface("ScintWrap");
|
||||
|
||||
new G4LogicalBorderSurface("ScintWrap", slab,
|
||||
experimentalHall_phys,
|
||||
ScintWrap);
|
||||
|
||||
ScintWrap->SetType(dielectric_metal);
|
||||
ScintWrap->SetFinish(polished);
|
||||
ScintWrap->SetModel(glisur);
|
||||
|
||||
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};
|
||||
|
||||
G4MaterialPropertiesTable* ScintWrapProperty
|
||||
= new G4MaterialPropertiesTable();
|
||||
|
||||
ScintWrapProperty->AddProperty("REFLECTIVITY",pp,reflectivity,NUM);
|
||||
ScintWrapProperty->AddProperty("EFFICIENCY",pp,efficiency,NUM);
|
||||
ScintWrap->SetMaterialPropertiesTable(ScintWrapProperty);
|
||||
}
|
||||
|
||||
return experimentalHall_phys;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorConstruction::SetDimensions(G4ThreeVector dims){
|
||||
this->scint_x=dims[0];
|
||||
this->scint_y=dims[1];
|
||||
this->scint_z=dims[2];
|
||||
updated=true;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorConstruction::SetHousingThickness(G4double d_mtl){
|
||||
this->d_mtl=d_mtl;
|
||||
updated=true;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorConstruction::SetNX(G4int nx){
|
||||
this->nx=nx;
|
||||
updated=true;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorConstruction::SetNY(G4int ny){
|
||||
this->ny=ny;
|
||||
updated=true;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorConstruction::SetNZ(G4int nz){
|
||||
this->nz=nz;
|
||||
updated=true;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorConstruction::SetPMTRadius(G4double outerRadius_pmt){
|
||||
this->outerRadius_pmt=outerRadius_pmt;
|
||||
updated=true;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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;
|
||||
|
||||
nx = 2;
|
||||
ny = 2;
|
||||
nz = 3;
|
||||
|
||||
outerRadius_pmt = 2.3*cm;
|
||||
|
||||
sphereOn = true;
|
||||
refl=1.0;
|
||||
|
||||
nfibers=15;
|
||||
WLSslab=false;
|
||||
mainVolume=true;
|
||||
slab_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;
|
||||
}
|
||||
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorConstruction::UpdateGeometry(){
|
||||
|
||||
// clean-up previous geometry
|
||||
G4GeometryManager::GetInstance()->OpenGeometry();
|
||||
|
||||
G4PhysicalVolumeStore::GetInstance()->Clean();
|
||||
G4LogicalVolumeStore::GetInstance()->Clean();
|
||||
G4SolidStore::GetInstance()->Clean();
|
||||
G4LogicalSkinSurface::CleanSurfaceTable();
|
||||
G4LogicalBorderSurface::CleanSurfaceTable();
|
||||
|
||||
//define new one
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector());
|
||||
G4RunManager::GetRunManager()->GeometryHasBeenModified();
|
||||
|
||||
updated=false;
|
||||
}
|
||||
|
||||
void LXeDetectorConstruction::SetMainScintYield(G4double y){
|
||||
LXe_mt->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
|
||||
}
|
||||
|
||||
void LXeDetectorConstruction::SetWLSScintYield(G4double y){
|
||||
MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeDetectorMessenger.hh"
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWith3VectorAndUnit.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4Scintillation.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeDetectorMessenger::LXeDetectorMessenger(LXeDetectorConstruction* LXeDetect)
|
||||
:LXeDetector(LXeDetect)
|
||||
{
|
||||
//Setup a command directory for detector controls with guidance
|
||||
detectorDir = new G4UIdirectory("/LXe/detector/");
|
||||
detectorDir->SetGuidance("Detector geometry control");
|
||||
|
||||
volumesDir = new G4UIdirectory("/LXe/detector/volumes/");
|
||||
volumesDir->SetGuidance("Enable/disable volumes");
|
||||
|
||||
//Various commands for modifying detector geometry
|
||||
dimensionsCmd =
|
||||
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");
|
||||
|
||||
housingThicknessCmd = new G4UIcmdWithADoubleAndUnit
|
||||
("/LXe/detector/housingThickness",this);
|
||||
housingThicknessCmd->SetGuidance("Set the thickness of the housing.");
|
||||
housingThicknessCmd->SetParameterName("d_mtl",false);
|
||||
housingThicknessCmd->SetDefaultUnit("cm");
|
||||
|
||||
pmtRadiusCmd = new G4UIcmdWithADoubleAndUnit
|
||||
("/LXe/detector/pmtRadius",this);
|
||||
pmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
|
||||
pmtRadiusCmd->SetParameterName("radius",false);
|
||||
pmtRadiusCmd->SetDefaultUnit("cm");
|
||||
|
||||
nxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
|
||||
nxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
|
||||
nxCmd->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);
|
||||
|
||||
sphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
|
||||
sphereCmd->SetGuidance("Enable/Disable the sphere.");
|
||||
|
||||
reflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
|
||||
reflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
|
||||
|
||||
wlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
|
||||
wlsCmd->SetGuidance("Enable/Disable the WLS slab");
|
||||
|
||||
lxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
|
||||
wlsCmd->SetGuidance("Enable/Disable the main detector volume.");
|
||||
|
||||
nFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
|
||||
nFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
|
||||
|
||||
updateCmd = new G4UIcommand("/LXe/detector/update",this);
|
||||
updateCmd->SetGuidance("Update the detector geometry with changed values.");
|
||||
updateCmd->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");
|
||||
|
||||
WLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
|
||||
WLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
|
||||
WLSScintYield->SetGuidance("Specified in photons/MeV");
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == dimensionsCmd ){
|
||||
LXeDetector->SetDimensions(dimensionsCmd->GetNew3VectorValue(newValue));
|
||||
}
|
||||
else if (command == housingThicknessCmd){
|
||||
LXeDetector->SetHousingThickness(housingThicknessCmd
|
||||
->GetNewDoubleValue(newValue));
|
||||
}
|
||||
else if (command == pmtRadiusCmd){
|
||||
LXeDetector->SetPMTRadius(pmtRadiusCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
else if (command == nxCmd){
|
||||
LXeDetector->SetNX(nxCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if (command == nyCmd){
|
||||
LXeDetector->SetNY(nyCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if (command == nzCmd){
|
||||
LXeDetector->SetNZ(nzCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if (command == updateCmd){
|
||||
LXeDetector->UpdateGeometry();
|
||||
}
|
||||
else if (command == defaultsCmd){
|
||||
LXeDetector->SetDefaults();
|
||||
}
|
||||
else if (command == sphereCmd){
|
||||
LXeDetector->SetSphereOn(sphereCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
else if (command == reflectivityCmd){
|
||||
LXeDetector
|
||||
->SetHousingReflectivity(reflectivityCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
else if (command == wlsCmd){
|
||||
LXeDetector->SetWLSSlabOn(wlsCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
else if (command == lxeCmd){
|
||||
LXeDetector->SetMainVolumeOn(lxeCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
else if (command == nFibersCmd){
|
||||
LXeDetector->SetNFibers(nFibersCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if (command == MainScintYield){
|
||||
LXeDetector->SetMainScintYield(MainScintYield->GetNewDoubleValue(newValue));
|
||||
}
|
||||
else if (command == WLSScintYield){
|
||||
LXeDetector->SetWLSScintYield(WLSScintYield->GetNewDoubleValue(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeEMPhysics.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
LXeEMPhysics::LXeEMPhysics(const G4String& name)
|
||||
: G4VPhysicsConstructor(name)
|
||||
{
|
||||
}
|
||||
|
||||
LXeEMPhysics::~LXeEMPhysics()
|
||||
{
|
||||
}
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
#include "G4Gamma.hh"
|
||||
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
|
||||
#include "G4NeutrinoE.hh"
|
||||
#include "G4AntiNeutrinoE.hh"
|
||||
|
||||
void LXeEMPhysics::ConstructParticle()
|
||||
{
|
||||
// gamma
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
// electron
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
}
|
||||
|
||||
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
|
||||
void LXeEMPhysics::ConstructProcess()
|
||||
{
|
||||
thePhotoEffect = new G4PhotoElectricEffect();
|
||||
theComptonEffect = new G4ComptonScattering();
|
||||
thePairProduction = new G4GammaConversion();
|
||||
|
||||
// Electron physics
|
||||
theElectronMultipleScattering = new G4MultipleScattering();
|
||||
theElectronIonisation = new G4eIonisation();
|
||||
theElectronBremsStrahlung = new G4eBremsstrahlung();
|
||||
|
||||
//Positron physics
|
||||
thePositronMultipleScattering = new G4MultipleScattering();
|
||||
thePositronIonisation = new G4eIonisation();
|
||||
thePositronBremsStrahlung = new G4eBremsstrahlung();
|
||||
theAnnihilation = new G4eplusAnnihilation();
|
||||
|
||||
|
||||
G4ProcessManager * pManager = 0;
|
||||
|
||||
// Gamma Physics
|
||||
pManager = G4Gamma::Gamma()->GetProcessManager();
|
||||
pManager->AddDiscreteProcess(thePhotoEffect);
|
||||
pManager->AddDiscreteProcess(theComptonEffect);
|
||||
pManager->AddDiscreteProcess(thePairProduction);
|
||||
|
||||
// Electron Physics
|
||||
pManager = G4Electron::Electron()->GetProcessManager();
|
||||
|
||||
pManager->AddProcess(theElectronMultipleScattering, -1, 1, 1);
|
||||
pManager->AddProcess(theElectronIonisation, -1, 2, 2);
|
||||
pManager->AddProcess(theElectronBremsStrahlung, -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeEventAction.hh"
|
||||
#include "LXeScintHit.hh"
|
||||
#include "LXePMTHit.hh"
|
||||
#include "LXeUserEventInformation.hh"
|
||||
#include "LXeTrajectory.hh"
|
||||
#include "RecorderBase.hh"
|
||||
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeEventAction::LXeEventAction(RecorderBase* r)
|
||||
:recorder(r),saveThreshold(0),scintCollID(-1),pmtCollID(-1),verbose(0),
|
||||
pmtThreshold(1),forcedrawphotons(false),forcenophotons(false)
|
||||
{
|
||||
eventMessenger=new LXeEventMessenger(this);
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeEventAction::~LXeEventAction(){}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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);
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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++){
|
||||
LXeTrajectory* trj = (LXeTrajectory*)
|
||||
((*(anEvent->GetTrajectoryContainer()))[i]);
|
||||
if(trj->GetParticleName()=="opticalphoton"){
|
||||
trj->SetForceDrawTrajectory(forcedrawphotons);
|
||||
trj->SetForceNoDrawTrajectory(forcenophotons);
|
||||
}
|
||||
trj->DrawTrajectory(50);
|
||||
}
|
||||
}
|
||||
|
||||
LXeScintHitsCollection* SHC = 0;
|
||||
LXePMTHitsCollection* PHC = 0;
|
||||
G4HCofThisEvent* HCE = anEvent->GetHCofThisEvent();
|
||||
|
||||
//Get the hit collections
|
||||
if(HCE){
|
||||
if(scintCollID>=0)SHC = (LXeScintHitsCollection*)(HCE->GetHC(scintCollID));
|
||||
if(pmtCollID>=0)PHC = (LXePMTHitsCollection*)(HCE->GetHC(pmtCollID));
|
||||
}
|
||||
|
||||
//Hits in scintillator
|
||||
if(SHC){
|
||||
int n_hit = SHC->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();
|
||||
eventInformation->IncEDep(edep); //sum up the edep
|
||||
eWeightPos += (*SHC)[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);
|
||||
}
|
||||
}
|
||||
if(eventInformation->GetEDep()==0.){
|
||||
if(verbose>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(verbose>0){
|
||||
G4cout << "\tTotal energy deposition in scintillator : "
|
||||
<< eventInformation->GetEDep() / keV << " (keV)" << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
if(PHC){
|
||||
G4ThreeVector reconPos=0.;
|
||||
G4int pmts=PHC->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();
|
||||
}
|
||||
else{//wasnt above the threshold, turn it back off
|
||||
(*PHC)[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;
|
||||
}
|
||||
eventInformation->SetReconPos(reconPos);
|
||||
}
|
||||
PHC->DrawAllHits();
|
||||
}
|
||||
|
||||
if(verbose>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;
|
||||
G4cout << "\tNumber of photons produced by scintillation in this event : "
|
||||
<< eventInformation->GetPhotonCount_Scint() << G4endl;
|
||||
G4cout << "\tNumber of photons produced by cerenkov in this event : "
|
||||
<< eventInformation->GetPhotonCount_Ceren() << G4endl;
|
||||
G4cout << "\tNumber of photons absorbed (OpAbsorption) in this event : "
|
||||
<< 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;
|
||||
}
|
||||
//If we have set the flag to save 'special' events, save here
|
||||
if(saveThreshold&&eventInformation->GetPhotonCount() <= saveThreshold)
|
||||
G4RunManager::GetRunManager()->rndmSaveThisEvent();
|
||||
|
||||
if(recorder)recorder->RecordEndOfEvent(anEvent);
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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;
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStoreDir("random/");
|
||||
// G4UImanager::GetUIpointer()->ApplyCommand("/random/setSavingFlag 1");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeEventMessenger.hh"
|
||||
#include "LXeEventAction.hh"
|
||||
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeEventMessenger::LXeEventMessenger(LXeEventAction* event)
|
||||
:LXeEvent(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);
|
||||
|
||||
verboseCmd = new G4UIcmdWithAnInteger("/LXe/eventVerbose",this);
|
||||
verboseCmd->SetGuidance("Set the verbosity of event data.");
|
||||
verboseCmd->SetParameterName("verbose",true);
|
||||
verboseCmd->SetDefaultValue(1);
|
||||
|
||||
pmtThresholdCmd = new G4UIcmdWithAnInteger("/LXe/pmtThreshold",this);
|
||||
pmtThresholdCmd->SetGuidance("Set the pmtThreshold (in # of photons)");
|
||||
|
||||
forceDrawPhotonsCmd=new G4UIcmdWithABool("/LXe/forceDrawPhotons",this);
|
||||
forceDrawPhotonsCmd->SetGuidance("Force drawing of photons.");
|
||||
forceDrawPhotonsCmd
|
||||
->SetGuidance("(Higher priority than /LXe/forceDrawNoPhotons)");
|
||||
|
||||
forceDrawNoPhotonsCmd=new G4UIcmdWithABool("/LXe/forceDrawNoPhotons",this);
|
||||
forceDrawNoPhotonsCmd->SetGuidance("Force no drawing of photons.");
|
||||
forceDrawNoPhotonsCmd
|
||||
->SetGuidance("(Lower priority than /LXe/forceDrawPhotons)");
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeEventMessenger::~LXeEventMessenger(){
|
||||
delete saveThresholdCmd;
|
||||
delete verboseCmd;
|
||||
delete pmtThresholdCmd;
|
||||
delete forceDrawPhotonsCmd;
|
||||
delete forceDrawNoPhotonsCmd;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeEventMessenger::SetNewValue(G4UIcommand* command, G4String newValue){
|
||||
if( command == saveThresholdCmd ){
|
||||
LXeEvent->SetSaveThreshold(saveThresholdCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if( command == verboseCmd ){
|
||||
LXeEvent->SetEventVerbose(verboseCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if( command == pmtThresholdCmd ){
|
||||
LXeEvent->SetPMTThreshold(pmtThresholdCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
else if(command == forceDrawPhotonsCmd){
|
||||
LXeEvent->SetForceDrawPhotons(forceDrawPhotonsCmd
|
||||
->GetNewBoolValue(newValue));
|
||||
}
|
||||
else if(command == forceDrawNoPhotonsCmd){
|
||||
LXeEvent->SetForceDrawNoPhotons(forceDrawNoPhotonsCmd
|
||||
->GetNewBoolValue(newValue));
|
||||
G4cout<<"TEST"<<G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeGeneralPhysics.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip>
|
||||
|
||||
LXeGeneralPhysics::LXeGeneralPhysics(const G4String& name)
|
||||
: G4VPhysicsConstructor(name)
|
||||
{
|
||||
}
|
||||
|
||||
LXeGeneralPhysics::~LXeGeneralPhysics()
|
||||
{
|
||||
}
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
// Bosons
|
||||
#include "G4ChargedGeantino.hh"
|
||||
#include "G4Geantino.hh"
|
||||
|
||||
void LXeGeneralPhysics::ConstructParticle()
|
||||
{
|
||||
// pseudo-particles
|
||||
G4Geantino::GeantinoDefinition();
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
}
|
||||
|
||||
void LXeGeneralPhysics::ConstructProcess()
|
||||
{
|
||||
fDecayProcess = new G4Decay();
|
||||
|
||||
// Add Decay Process
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (fDecayProcess->IsApplicable(*particle)) {
|
||||
pmanager ->AddProcess(fDecayProcess);
|
||||
// set ordering for PostStepDoIt and AtRestDoIt
|
||||
pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
|
||||
pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,283 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeMainVolume.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4LogicalSkinSurface.hh"
|
||||
#include "G4LogicalBorderSurface.hh"
|
||||
#include "LXePMTSD.hh"
|
||||
#include "LXeScintSD.hh"
|
||||
|
||||
LXeScintSD* LXeMainVolume::scint_SD;
|
||||
LXePMTSD* LXeMainVolume::pmt_SD;
|
||||
|
||||
G4LogicalVolume* LXeMainVolume::housing_log=NULL;
|
||||
|
||||
LXeMainVolume::LXeMainVolume(G4RotationMatrix *pRot,
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
||||
//*************************** 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);
|
||||
|
||||
//*************** 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);
|
||||
|
||||
|
||||
//****************** Build PMTs
|
||||
G4double innerRadius_pmt = 0.*cm;
|
||||
G4double height_pmt = d_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);
|
||||
|
||||
//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);
|
||||
|
||||
|
||||
|
||||
//***********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);
|
||||
//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
|
||||
//-------
|
||||
|
||||
G4double dx = scint_x/nx;
|
||||
G4double dy = scint_y/ny;
|
||||
G4double dz = scint_z/nz;
|
||||
|
||||
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.;
|
||||
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);
|
||||
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);
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
//**********Setup Sensitive Detectors***************
|
||||
if(!scint_SD){//determine if it has already been created
|
||||
scint_SD = new LXeScintSD("/LXeDet/scintSD");
|
||||
SDman->AddNewDetector(scint_SD);
|
||||
}
|
||||
scint_log->SetSensitiveDetector(scint_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
|
||||
//boundary to the photocathode (which doesnt get done by attaching it to a
|
||||
//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);
|
||||
|
||||
VisAttributes();
|
||||
SurfaceProperties();
|
||||
}
|
||||
|
||||
SetLogicalVolume(housing_log);
|
||||
}
|
||||
|
||||
void LXeMainVolume::CopyValues(){
|
||||
updated=constructor->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();
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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){
|
||||
/*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)
|
||||
da,db = value to increment a,b by
|
||||
amin,bmin = start values for a,b
|
||||
na,nb = number of repitions in a and b
|
||||
x,y,z = just pass x,y, and z by reference (the same ones passed for a,b)
|
||||
k = copy number to start with
|
||||
sd = sensitive detector for pmts
|
||||
*/
|
||||
a=amin;
|
||||
for(G4int j=1;j<=na;j++){
|
||||
a+=da;
|
||||
b=bmin;
|
||||
for(G4int i=1;i<=nb;i++){
|
||||
b+=db;
|
||||
new G4PVPlacement(rot,G4ThreeVector(x,y,z),pmt_log,"pmt",
|
||||
housing_log,false,k);
|
||||
sd->SetPMTPos(k,x,y,z);
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LXeMainVolume::VisAttributes(){
|
||||
G4VisAttributes* housing_va = new G4VisAttributes(G4Colour(0.8,0.8,0.8));
|
||||
housing_log->SetVisAttributes(housing_va);
|
||||
|
||||
G4VisAttributes* sphere_va = new G4VisAttributes();
|
||||
sphere_va->SetForceSolid(true);
|
||||
sphere_log->SetVisAttributes(sphere_va);
|
||||
}
|
||||
|
||||
void LXeMainVolume::SurfaceProperties(){
|
||||
const G4int num = 2;
|
||||
G4double Ephoton[num] = {7.0*eV, 7.14*eV};
|
||||
|
||||
//**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);
|
||||
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};
|
||||
G4MaterialPropertiesTable* spherePT = new G4MaterialPropertiesTable();
|
||||
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_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);
|
||||
G4OpticalSurface* photocath_opsurf=
|
||||
new G4OpticalSurface("photocath_opsurf",glisur,polished,
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeMuonPhysics.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
LXeMuonPhysics::LXeMuonPhysics(const G4String& name)
|
||||
: G4VPhysicsConstructor(name)
|
||||
{
|
||||
}
|
||||
|
||||
LXeMuonPhysics::~LXeMuonPhysics()
|
||||
{
|
||||
}
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
#include "G4MuonPlus.hh"
|
||||
#include "G4MuonMinus.hh"
|
||||
#include "G4NeutrinoMu.hh"
|
||||
#include "G4AntiNeutrinoMu.hh"
|
||||
|
||||
void LXeMuonPhysics::ConstructParticle()
|
||||
{
|
||||
// Mu
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
}
|
||||
|
||||
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
void LXeMuonPhysics::ConstructProcess()
|
||||
{
|
||||
fMuPlusIonisation = new G4MuIonisation();
|
||||
fMuPlusMultipleScattering = new G4MultipleScattering();
|
||||
fMuPlusBremsstrahlung=new G4MuBremsstrahlung();
|
||||
fMuPlusPairProduction= new G4MuPairProduction();
|
||||
|
||||
fMuMinusIonisation = new G4MuIonisation();
|
||||
fMuMinusMultipleScattering = new G4MultipleScattering;
|
||||
fMuMinusBremsstrahlung = new G4MuBremsstrahlung();
|
||||
fMuMinusPairProduction = new G4MuPairProduction();
|
||||
|
||||
fMuMinusCaptureAtRest = new G4MuonMinusCaptureAtRest();
|
||||
|
||||
G4ProcessManager * pManager = 0;
|
||||
|
||||
// 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);
|
||||
pManager->AddProcess(fMuPlusPairProduction, -1, 4, 4);
|
||||
|
||||
// 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);
|
||||
pManager->AddProcess(fMuMinusPairProduction, -1, 4, 4);
|
||||
|
||||
pManager->AddRestProcess(fMuMinusCaptureAtRest);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeOpPhysMessenger.hh"
|
||||
#include "LXeOpticalPhysics.hh"
|
||||
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWith3VectorAndUnit.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4Scintillation.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeOpPhysMessenger::LXeOpPhysMessenger(LXeOpticalPhysics* LXeOpPhys)
|
||||
:OpPhys(LXeOpPhys)
|
||||
{
|
||||
yieldCmd = new G4UIcmdWithADouble("/LXe/detector/scintYieldFactor",this);
|
||||
yieldCmd->SetGuidance("Sets the yield factor for scintillation in all volumes");
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeOpPhysMessenger::~LXeOpPhysMessenger()
|
||||
{
|
||||
delete yieldCmd;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeOpPhysMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if (command == yieldCmd){
|
||||
OpPhys->SetScintYieldFactor(yieldCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeOpticalPhysics.hh"
|
||||
#include "LXeOpPhysMessenger.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip>
|
||||
|
||||
#include "G4OpAbsorption.hh"
|
||||
#include "G4OpRayleigh.hh"
|
||||
#include "G4OpBoundaryProcess.hh"
|
||||
#include "G4OpWLS.hh"
|
||||
|
||||
LXeOpticalPhysics::LXeOpticalPhysics(const G4String& name)
|
||||
: G4VPhysicsConstructor(name)
|
||||
{
|
||||
// new LXeOpPhysMessenger(this);
|
||||
}
|
||||
|
||||
LXeOpticalPhysics::~LXeOpticalPhysics()
|
||||
{
|
||||
}
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
#include "G4OpticalPhoton.hh"
|
||||
|
||||
void LXeOpticalPhysics::ConstructParticle()
|
||||
{
|
||||
G4OpticalPhoton::OpticalPhotonDefinition();
|
||||
}
|
||||
|
||||
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
void LXeOpticalPhysics::ConstructProcess()
|
||||
{
|
||||
theScintProcess = new G4Scintillation();
|
||||
theCerenkovProcess=new G4Cerenkov();
|
||||
theAbsorptionProcess=new G4OpAbsorption();
|
||||
theRayleighScattering=new G4OpRayleigh();
|
||||
theBoundaryProcess=new G4OpBoundaryProcess();
|
||||
theWLSProcess=new G4OpWLS();
|
||||
|
||||
G4ProcessManager * pManager = 0;
|
||||
|
||||
pManager = G4OpticalPhoton::OpticalPhoton()->GetProcessManager();
|
||||
pManager->AddDiscreteProcess(theAbsorptionProcess);
|
||||
pManager->AddDiscreteProcess(theRayleighScattering);
|
||||
theBoundaryProcess->SetModel(unified);
|
||||
pManager->AddDiscreteProcess(theBoundaryProcess);
|
||||
pManager->AddDiscreteProcess(theWLSProcess);
|
||||
|
||||
theScintProcess->SetScintillationYieldFactor(1.);
|
||||
theScintProcess->SetScintillationExcitationRatio(0.0);
|
||||
theScintProcess->SetTrackSecondariesFirst(true);
|
||||
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
pManager = particle->GetProcessManager();
|
||||
if(theCerenkovProcess->IsApplicable(*particle)){
|
||||
pManager->AddContinuousProcess(theCerenkovProcess);
|
||||
}
|
||||
if(theScintProcess->IsApplicable(*particle)){
|
||||
pManager->AddProcess(theScintProcess);
|
||||
pManager->SetProcessOrderingToLast(theScintProcess,idxAtRest);
|
||||
pManager->SetProcessOrderingToLast(theScintProcess,idxPostStep);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void LXeOpticalPhysics::SetScintYieldFactor(G4double yf){
|
||||
if(theScintProcess)
|
||||
theScintProcess->SetScintillationYieldFactor(yf);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXePMTHit.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
G4Allocator<LXePMTHit> LXePMTHitAllocator;
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXePMTHit::LXePMTHit()
|
||||
:pmtNumber(-1),photons(0),physVol(0),drawit(false)
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXePMTHit::~LXePMTHit()
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXePMTHit::LXePMTHit(const LXePMTHit &right)
|
||||
: G4VHit()
|
||||
{
|
||||
pmtNumber=right.pmtNumber;
|
||||
photons=right.photons;
|
||||
physVol=right.physVol;
|
||||
drawit=right.drawit;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
const LXePMTHit& LXePMTHit::operator=(const LXePMTHit &right){
|
||||
pmtNumber = right.pmtNumber;
|
||||
photons=right.photons;
|
||||
physVol=right.physVol;
|
||||
drawit=right.drawit;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
G4int LXePMTHit::operator==(const LXePMTHit &right) const{
|
||||
return (pmtNumber==right.pmtNumber);
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXePMTHit::Draw(){
|
||||
if(drawit&&physVol){ //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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXePMTHit::Print(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXePMTSD.hh"
|
||||
#include "LXePMTHit.hh"
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
#include "LXeUserTrackInformation.hh"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#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"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXePMTSD::LXePMTSD(G4String name)
|
||||
:G4VSensitiveDetector(name),pmtHitCollection(0),pmtPositionsX(0)
|
||||
,pmtPositionsY(0),pmtPositionsZ(0)
|
||||
{
|
||||
collectionName.insert("pmtHitCollection");
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXePMTSD::~LXePMTSD()
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXePMTSD::Initialize(G4HCofThisEvent* HCE){
|
||||
pmtHitCollection = new LXePMTHitsCollection
|
||||
(SensitiveDetectorName,collectionName[0]);
|
||||
//Store collection with event and keep ID
|
||||
static G4int HCID = -1;
|
||||
if(HCID<0){
|
||||
HCID = GetCollectionID(0);
|
||||
}
|
||||
HCE->AddHitsCollection( HCID, pmtHitCollection );
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
G4bool LXePMTSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist){
|
||||
return ProcessHits_constStep(aStep,ROhist);
|
||||
}
|
||||
|
||||
//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* ROhist){
|
||||
|
||||
//need to know if this is an optical photon
|
||||
if(aStep->GetTrack()->GetDefinition()
|
||||
!= G4OpticalPhoton::OpticalPhotonDefinition()) return false;
|
||||
|
||||
//User replica number 1 since photocathode is a daughter volume
|
||||
//to the pmt which was replicated
|
||||
G4int pmtNumber=
|
||||
aStep->GetPostStepPoint()->GetTouchable()->GetReplicaNumber(1);
|
||||
G4VPhysicalVolume* physVol=
|
||||
aStep->GetPostStepPoint()->GetTouchable()->GetVolume(1);
|
||||
|
||||
//Find the correct hit collection
|
||||
G4int n=pmtHitCollection->entries();
|
||||
LXePMTHit* hit=NULL;
|
||||
for(G4int i=0;i<n;i++){
|
||||
if((*pmtHitCollection)[i]->GetPMTNumber()==pmtNumber){
|
||||
hit=(*pmtHitCollection)[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]);
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
else{//sphere enabled
|
||||
LXeUserTrackInformation* trackInfo=
|
||||
(LXeUserTrackInformation*)aStep->GetTrack()->GetUserInformation();
|
||||
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* HCE){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXePMTSD::clear(){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXePMTSD::DrawAll(){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXePMTSD::PrintAll(){
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXePhysicsList.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip>
|
||||
|
||||
#include "LXeGeneralPhysics.hh"
|
||||
#include "LXeEMPhysics.hh"
|
||||
#include "LXeMuonPhysics.hh"
|
||||
#include "LXeOpticalPhysics.hh"
|
||||
|
||||
LXePhysicsList::LXePhysicsList(): G4VModularPhysicsList()
|
||||
{
|
||||
// default cut value (1.0mm)
|
||||
defaultCutValue = 1.0*mm;
|
||||
// SetVerboseLevel(1);
|
||||
|
||||
// General Physics
|
||||
RegisterPhysics( new LXeGeneralPhysics("general") );
|
||||
|
||||
// EM Physics
|
||||
RegisterPhysics( new LXeEMPhysics("standard EM"));
|
||||
|
||||
// Muon Physics
|
||||
RegisterPhysics( new LXeMuonPhysics("muon"));
|
||||
|
||||
// Optical Physics
|
||||
RegisterPhysics( new LXeOpticalPhysics("optical"));
|
||||
|
||||
}
|
||||
|
||||
LXePhysicsList::~LXePhysicsList()
|
||||
{
|
||||
}
|
||||
|
||||
void LXePhysicsList::SetCuts(){
|
||||
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
|
||||
// the default cut value for all particle types
|
||||
SetCutsWithDefault();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXePrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXePrimaryGeneratorAction::LXePrimaryGeneratorAction(){
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
|
||||
G4String particleName;
|
||||
particleGun->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.));
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXePrimaryGeneratorAction::~LXePrimaryGeneratorAction(){
|
||||
delete particleGun;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXePrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent){
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeRunAction.hh"
|
||||
#include "RecorderBase.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeRunAction::LXeRunAction(RecorderBase* r)
|
||||
:recorder(r)
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeRunAction::~LXeRunAction()
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeRunAction::BeginOfRunAction(const G4Run* aRun){
|
||||
if(recorder)recorder->RecordBeginOfRun(aRun);
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeRunAction::EndOfRunAction(const G4Run* aRun){
|
||||
if(recorder)recorder->RecordEndOfRun(aRun);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeScintHit.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
G4Allocator<LXeScintHit> LXeScintHitAllocator;
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeScintHit::LXeScintHit()
|
||||
:physVol(0)
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeScintHit::LXeScintHit(G4VPhysicalVolume* pVol)
|
||||
:physVol(pVol)
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeScintHit::~LXeScintHit()
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeScintHit::LXeScintHit(const LXeScintHit &right)
|
||||
: G4VHit()
|
||||
{
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
physVol = right.physVol;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
const LXeScintHit& LXeScintHit::operator=(const LXeScintHit &right){
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
physVol = right.physVol;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
G4int LXeScintHit::operator==(const LXeScintHit &right) const{
|
||||
return false;
|
||||
//returns false because there currently isnt need to check for equality yet
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeScintHit::Draw(){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeScintHit::Print(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeScintSD.hh"
|
||||
#include "LXeScintHit.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeScintSD::LXeScintSD(G4String name)
|
||||
:G4VSensitiveDetector(name)
|
||||
{
|
||||
collectionName.insert("scintCollection");
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeScintSD::~LXeScintSD()
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeScintSD::Initialize(G4HCofThisEvent* HCE){
|
||||
scintCollection = 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);
|
||||
}
|
||||
HCE->AddHitsCollection( HCID, scintCollection );
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
G4bool LXeScintSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist){
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
if(edep==0.) return false; //No edep so dont count as hit
|
||||
|
||||
G4StepPoint* thePrePoint = aStep->GetPreStepPoint();
|
||||
G4TouchableHistory* theTouchable =
|
||||
(G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
|
||||
G4VPhysicalVolume* thePrePV = theTouchable->GetVolume();
|
||||
|
||||
G4StepPoint* thePostPoint = aStep->GetPostStepPoint();
|
||||
|
||||
//Get the average position of the hit
|
||||
G4ThreeVector pos = thePrePoint->GetPosition() + thePostPoint->GetPosition();
|
||||
pos/=2.;
|
||||
|
||||
LXeScintHit* scintHit = new LXeScintHit(thePrePV);
|
||||
|
||||
scintHit->SetEdep(edep);
|
||||
scintHit->SetPos(pos);
|
||||
|
||||
scintCollection->insert(scintHit);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeScintSD::EndOfEvent(G4HCofThisEvent* HCE){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeScintSD::clear(){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeScintSD::DrawAll(){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeScintSD::PrintAll(){
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeStackingAction.hh"
|
||||
#include "LXeUserEventInformation.hh"
|
||||
#include "LXeSteppingAction.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeStackingAction::LXeStackingAction()
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeStackingAction::~LXeStackingAction()
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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()){
|
||||
// particle is optical photon
|
||||
if(aTrack->GetParentID()>0){
|
||||
// particle is secondary
|
||||
if(aTrack->GetCreatorProcess()->GetProcessName()=="Scintillation")
|
||||
eventInformation->IncPhotonCount_Scint();
|
||||
else if(aTrack->GetCreatorProcess()->GetProcessName()=="Cerenkov")
|
||||
eventInformation->IncPhotonCount_Ceren();
|
||||
}
|
||||
}
|
||||
else{
|
||||
}
|
||||
return fUrgent;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeStackingAction::NewStage(){
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeStackingAction::PrepareNewEvent(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeSteppingAction.hh"
|
||||
#include "LXeEventAction.hh"
|
||||
#include "LXeTrackingAction.hh"
|
||||
#include "LXeTrajectory.hh"
|
||||
#include "LXePMTSD.hh"
|
||||
#include "LXeUserTrackInformation.hh"
|
||||
#include "LXeUserEventInformation.hh"
|
||||
#include "LXeSteppingMessenger.hh"
|
||||
#include "RecorderBase.hh"
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4StepPoint.hh"
|
||||
#include "G4TrackStatus.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4OpBoundaryProcess.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeSteppingAction::LXeSteppingAction(RecorderBase* r)
|
||||
:recorder(r),oneStepPrimaries(false)
|
||||
{
|
||||
steppingMessenger = new LXeSteppingMessenger(this);
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeSteppingAction::~LXeSteppingAction()
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
|
||||
G4Track* theTrack = theStep->GetTrack();
|
||||
|
||||
LXeUserTrackInformation* trackInformation
|
||||
=(LXeUserTrackInformation*)theTrack->GetUserInformation();
|
||||
LXeUserEventInformation* eventInformation
|
||||
=(LXeUserEventInformation*)G4EventManager::GetEventManager()
|
||||
->GetConstCurrentEvent()->GetUserInformation();
|
||||
|
||||
G4StepPoint* thePrePoint = theStep->GetPreStepPoint();
|
||||
G4VPhysicalVolume* thePrePV = thePrePoint->GetPhysicalVolume();
|
||||
|
||||
G4StepPoint* thePostPoint = theStep->GetPostStepPoint();
|
||||
G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
|
||||
|
||||
G4OpBoundaryProcessStatus boundaryStatus=Undefined;
|
||||
static G4OpBoundaryProcess* boundary=NULL;
|
||||
|
||||
//find the boundary process only once
|
||||
if(!boundary){
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(theTrack->GetParentID()==0){
|
||||
//This is a primary track
|
||||
|
||||
G4TrackVector* fSecondary=fpSteppingManager->GetfSecondary();
|
||||
G4int tN2ndariesTot = fpSteppingManager->GetfN2ndariesAtRestDoIt()
|
||||
+ fpSteppingManager->GetfN2ndariesAlongStepDoIt()
|
||||
+ fpSteppingManager->GetfN2ndariesPostStepDoIt();
|
||||
|
||||
//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(oneStepPrimaries&&thePrePV->GetName()=="scintillator")
|
||||
theTrack->SetTrackStatus(fStopAndKill);
|
||||
}
|
||||
|
||||
if(!thePostPV){//out of world
|
||||
return;
|
||||
}
|
||||
|
||||
G4ParticleDefinition* particleType = theTrack->GetDefinition();
|
||||
if(particleType==G4OpticalPhoton::OpticalPhotonDefinition()){
|
||||
//Optical photon only
|
||||
|
||||
if(thePrePV->GetName()=="Slab")
|
||||
//force drawing of photons in WLS slab
|
||||
trackInformation->SetForceDrawTrajectory(true);
|
||||
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){
|
||||
switch(boundaryStatus){
|
||||
case Absorption:
|
||||
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;
|
||||
}
|
||||
case FresnelReflection:
|
||||
case TotalInternalReflection:
|
||||
case SpikeReflection:
|
||||
trackInformation->IncReflections();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(thePostPV->GetName()=="sphere")
|
||||
trackInformation->AddTrackStatusFlag(hitSphere);
|
||||
}
|
||||
}
|
||||
|
||||
if(recorder)recorder->RecordStep(theStep);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeSteppingMessenger.hh"
|
||||
#include "LXeSteppingAction.hh"
|
||||
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeSteppingMessenger::LXeSteppingMessenger(LXeSteppingAction* step)
|
||||
:stepping(step)
|
||||
{
|
||||
oneStepPrimariesCmd = new G4UIcmdWithABool("/LXe/oneStepPrimaries",this);
|
||||
oneStepPrimariesCmd->SetGuidance("Only allows primaries to go one step in the scintillator volume before being killed.");
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeSteppingMessenger::~LXeSteppingMessenger(){
|
||||
delete oneStepPrimariesCmd;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void
|
||||
LXeSteppingMessenger::SetNewValue(G4UIcommand* command,G4String newValue){
|
||||
if( command == oneStepPrimariesCmd ){
|
||||
stepping->SetOneStepPrimaries(oneStepPrimariesCmd
|
||||
->GetNewBoolValue(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeSteppingVerbose.hh"
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include<strstream>
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
LXeSteppingVerbose::LXeSteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
LXeSteppingVerbose::~LXeSteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void LXeSteppingVerbose::StepInfo()
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
if( verboseLevel >= 1 ){
|
||||
G4int lengthLen=+G4UnitDefinition::GetUnitsTable()[G4BestUnit(0,"Length").GetIndexOfCategory()]->GetSymbMxLen();
|
||||
G4int energyLen=+G4UnitDefinition::GetUnitsTable()[G4BestUnit(0,"Energy").GetIndexOfCategory()]->GetSymbMxLen();
|
||||
|
||||
if( verboseLevel >= 4 ) VerboseTrack();
|
||||
if( verboseLevel >= 3 ){
|
||||
G4cout << G4endl;
|
||||
G4cout << std::setw( 5) << "Step#"
|
||||
<< std::setw( 6) << "X" << std::setw(lengthLen+1)<<" "
|
||||
<< std::setw( 6) << "Y" << std::setw(lengthLen+1)<<" "
|
||||
<< std::setw( 6) << "Z" << std::setw(lengthLen+1)<<" "
|
||||
<< std::setw( 7) << "KineE" << std::setw(energyLen+1)<<" "
|
||||
<< std::setw( 7) << "dEStep"<< std::setw(energyLen+1)<<" "
|
||||
<< std::setw(10) << "StepLeng"<< std::setw(lengthLen+1)<<" "
|
||||
<< std::setw(10) << "TrakLeng"<< std::setw(lengthLen+1)<<" "
|
||||
<< std::setw(10) << "Volume"
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
}
|
||||
|
||||
//This is a less clean way of outputing the data than normal but it
|
||||
//produces nicer colums since G4BestUnit doesnt cooperate too well with
|
||||
//field widths.
|
||||
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber();
|
||||
strstream out;
|
||||
out.precision(3);
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetPosition().x(),"Length")<<'\0';
|
||||
G4cout<<std::setw(7+lengthLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetPosition().y(),"Length")<<'\0';
|
||||
G4cout<<std::setw(7+lengthLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetPosition().z(),"Length")<<'\0';
|
||||
G4cout<<std::setw(7+lengthLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetKineticEnergy(),"Energy")<<'\0';
|
||||
G4cout<<std::setw(7+energyLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")<<'\0';
|
||||
G4cout<<std::setw(7+energyLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fStep->GetStepLength(),"Length")<<'\0';
|
||||
G4cout<<std::setw(10+lengthLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetTrackLength(),"Length")<<'\0';
|
||||
G4cout<<std::setw(10+lengthLen)<<out.str();
|
||||
|
||||
// if( fStepStatus != fWorldBoundary){
|
||||
if( fTrack->GetNextVolume() != 0 ) {
|
||||
G4cout << " "<<fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << " OutOfWorld";
|
||||
}
|
||||
|
||||
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
|
||||
G4cout << " "
|
||||
<< std::setw(10)
|
||||
<< fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName();
|
||||
} else {
|
||||
G4cout << " UserLimit";
|
||||
}
|
||||
|
||||
G4cout << G4endl;
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
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;
|
||||
|
||||
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.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void LXeSteppingVerbose::TrackingStarted()
|
||||
{
|
||||
|
||||
CopyState();
|
||||
G4int prec = G4cout.precision(3);
|
||||
if( verboseLevel > 0 ){
|
||||
G4int lengthLen=+G4UnitDefinition::GetUnitsTable()[G4BestUnit(0,"Length").GetIndexOfCategory()]->GetSymbMxLen();
|
||||
G4int energyLen=+G4UnitDefinition::GetUnitsTable()[G4BestUnit(0,"Energy").GetIndexOfCategory()]->GetSymbMxLen();
|
||||
|
||||
G4cout << std::setw( 5) << "Step#"
|
||||
<< std::setw( 6) << "X" << std::setw(lengthLen+1)<<" "
|
||||
<< std::setw( 6) << "Y" << std::setw(lengthLen+1)<<" "
|
||||
<< std::setw( 6) << "Z" << std::setw(lengthLen+1)<<" "
|
||||
<< std::setw( 7) << "KineE" << std::setw(energyLen+1)<<" "
|
||||
<< std::setw( 7) << "dEStep"<< std::setw(energyLen+1)<<" "
|
||||
<< std::setw(10) << "StepLeng"<< std::setw(lengthLen+1)<<" "
|
||||
<< std::setw(10) << "TrakLeng"<< std::setw(lengthLen+1)<<" "
|
||||
<< std::setw(10) << "Volume"
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
|
||||
//This is a less clean way of outputing the data than normal but it
|
||||
//produces nicer colums since G4BestUnit doesnt cooperate too well with
|
||||
//field widths.
|
||||
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber();
|
||||
strstream out;
|
||||
out.precision(3);
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetPosition().x(),"Length")<<'\0';
|
||||
G4cout<<std::setw(7+lengthLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetPosition().y(),"Length")<<'\0';
|
||||
G4cout<<std::setw(7+lengthLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetPosition().z(),"Length")<<'\0';
|
||||
G4cout<<std::setw(7+lengthLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetKineticEnergy(),"Energy")<<'\0';
|
||||
G4cout<<std::setw(7+energyLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")<<'\0';
|
||||
G4cout<<std::setw(7+energyLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fStep->GetStepLength(),"Length")<<'\0';
|
||||
G4cout<<std::setw(10+lengthLen)<<out.str();
|
||||
out.rdbuf()->seekpos(0);
|
||||
out<<G4BestUnit(fTrack->GetTrackLength(),"Length")<<'\0';
|
||||
G4cout<<std::setw(10+lengthLen)<<out.str();
|
||||
|
||||
|
||||
if(fTrack->GetNextVolume()){
|
||||
G4cout << " "<< fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << std::setw(11+lengthLen)<< "OutOfWorld";
|
||||
}
|
||||
G4cout << " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeTrajectory.hh"
|
||||
#include "LXeTrackingAction.hh"
|
||||
#include "LXeUserTrackInformation.hh"
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
#include "RecorderBase.hh"
|
||||
|
||||
#include "G4TrackingManager.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeTrackingAction::LXeTrackingAction(RecorderBase* r)
|
||||
:recorder(r)
|
||||
{}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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));
|
||||
|
||||
//This user track information is only relevant to the photons
|
||||
fpTrackingManager->SetUserTrackInformation(new LXeUserTrackInformation);
|
||||
|
||||
/* const G4VProcess* creator = aTrack->GetCreatorProcess();
|
||||
if(creator)
|
||||
G4cout<<creator->GetProcessName()<<G4endl;
|
||||
*/
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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()){
|
||||
|
||||
const G4VProcess* creator=aTrack->GetCreatorProcess();
|
||||
if(creator && creator->GetProcessName()=="OpWLS"){
|
||||
trajectory->WLS();
|
||||
trajectory->SetDrawTrajectory(true);
|
||||
}
|
||||
|
||||
if(LXeDetectorConstruction::GetSphereOn()){
|
||||
if((trackInformation->GetTrackStatus()&hitPMT)&&
|
||||
(trackInformation->GetTrackStatus()&hitSphere)){
|
||||
trajectory->SetDrawTrajectory(true);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(trackInformation->GetTrackStatus()&hitPMT)
|
||||
trajectory->SetDrawTrajectory(true);
|
||||
}
|
||||
}
|
||||
else //draw all other trajectories
|
||||
trajectory->SetDrawTrajectory(true);
|
||||
|
||||
if(trackInformation->GetForceDrawTrajectory())
|
||||
trajectory->SetDrawTrajectory(true);
|
||||
|
||||
if(recorder)recorder->RecordTrack(aTrack);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeTrajectory.hh"
|
||||
#include "G4TrajectoryPoint.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4Polyline.hh"
|
||||
#include "G4Circle.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Polymarker.hh"
|
||||
|
||||
G4Allocator<LXeTrajectory> LXeTrajectoryAllocator;
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeTrajectory::LXeTrajectory()
|
||||
:G4Trajectory(),wls(false),drawit(false),forceNoDraw(false),forceDraw(false)
|
||||
{
|
||||
particleDefinition=0;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeTrajectory::LXeTrajectory(const G4Track* aTrack)
|
||||
:G4Trajectory(aTrack),wls(false),drawit(false)
|
||||
{
|
||||
particleDefinition=aTrack->GetDefinition();
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeTrajectory::LXeTrajectory(LXeTrajectory &right)
|
||||
:G4Trajectory(right),wls(right.wls),drawit(right.drawit)
|
||||
{
|
||||
particleDefinition=right.particleDefinition;
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeTrajectory::~LXeTrajectory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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))
|
||||
return;
|
||||
|
||||
// If i_mode>=0, draws a trajectory as a polyline and, if i_mode!=0,
|
||||
// adds markers - yellow circles for step points and magenta squares
|
||||
// for auxiliary points, if any - whose screen size in pixels is
|
||||
// given by abs(i_mode)/1000. E.g: i_mode = 5000 gives easily
|
||||
// visible markers.
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if (!pVVisManager) return;
|
||||
|
||||
const G4double markerSize = 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(aTrajectoryPoint->GetPosition());
|
||||
if (lineRequired) {
|
||||
trajectoryLine.push_back(pos);
|
||||
}
|
||||
if (markersRequired) {
|
||||
stepPoints.push_back(pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (lineRequired) {
|
||||
G4Colour colour;
|
||||
|
||||
if(particleDefinition==G4OpticalPhoton::OpticalPhotonDefinition()){
|
||||
if(wls) //WLS photons are red
|
||||
colour = G4Colour(1.,0.,0.);
|
||||
else{ //Scintillation and Cerenkov photons are green
|
||||
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);
|
||||
}
|
||||
if (markersRequired) {
|
||||
auxiliaryPoints.SetMarkerType(G4Polymarker::squares);
|
||||
auxiliaryPoints.SetScreenSize(markerSize);
|
||||
auxiliaryPoints.SetFillStyle(G4VMarker::filled);
|
||||
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.
|
||||
stepPoints.SetVisAttributes(&stepPointsAttribs);
|
||||
pVVisManager->Draw(stepPoints);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeUserEventInformation.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeUserEventInformation::~LXeUserEventInformation()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeUserTrackInformation.hh"
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeUserTrackInformation::LXeUserTrackInformation()
|
||||
:status(active),reflections(0),forcedraw(false)
|
||||
{
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeUserTrackInformation::~LXeUserTrackInformation()
|
||||
{
|
||||
}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeUserTrackInformation::AddTrackStatusFlag(int s)
|
||||
{
|
||||
if(s&active) //track is now active
|
||||
status&=~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
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "LXeVisManager.hh"
|
||||
|
||||
// Supported drivers...
|
||||
|
||||
// Not needing external packages or libraries...
|
||||
#include "G4ASCIITree.hh"
|
||||
#include "G4DAWNFILE.hh"
|
||||
#include "G4GAGTree.hh"
|
||||
#include "G4HepRepFile.hh"
|
||||
#include "G4HepRep.hh"
|
||||
#include "G4RayTracer.hh"
|
||||
#include "G4VRML1File.hh"
|
||||
#include "G4VRML2File.hh"
|
||||
|
||||
// Needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
#include "G4OpenGLImmediateX.hh"
|
||||
#include "G4OpenGLStoredX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
#include "G4OpenGLImmediateWin32.hh"
|
||||
#include "G4OpenGLStoredWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
#include "G4OpenGLImmediateXm.hh"
|
||||
#include "G4OpenGLStoredXm.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
#include "G4OpenInventorX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
#include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
LXeVisManager::LXeVisManager () {}
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
void LXeVisManager::RegisterGraphicsSystems () {
|
||||
|
||||
// Graphics Systems not needing external packages or libraries...
|
||||
RegisterGraphicsSystem (new G4ASCIITree);
|
||||
RegisterGraphicsSystem (new G4DAWNFILE);
|
||||
RegisterGraphicsSystem (new G4GAGTree);
|
||||
RegisterGraphicsSystem (new G4HepRepFile);
|
||||
RegisterGraphicsSystem (new G4HepRep);
|
||||
RegisterGraphicsSystem (new G4RayTracer);
|
||||
RegisterGraphicsSystem (new G4VRML1File);
|
||||
RegisterGraphicsSystem (new G4VRML2File);
|
||||
|
||||
// Graphics systems needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
RegisterGraphicsSystem (new G4FukuiRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateX);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredXm);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
RegisterGraphicsSystem (new G4OpenInventorX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
RegisterGraphicsSystem (new G4OpenInventorWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
|
||||
if (fVerbose > 0) {
|
||||
G4cout <<
|
||||
"\nYou have successfully chosen to use the following graphics systems."
|
||||
<< G4endl;
|
||||
PrintAvailableGraphicsSystems ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeWLSFiber.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4LogicalSkinSurface.hh"
|
||||
#include "G4LogicalBorderSurface.hh"
|
||||
|
||||
G4LogicalVolume* LXeWLSFiber::clad2_log=NULL;
|
||||
|
||||
LXeWLSFiber::LXeWLSFiber(G4RotationMatrix *pRot,
|
||||
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)
|
||||
{
|
||||
CopyValues();
|
||||
|
||||
if(!clad2_log || updated){
|
||||
// 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);
|
||||
|
||||
// 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);
|
||||
|
||||
// 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);
|
||||
new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),clad1_log,
|
||||
"Cladding1",clad2_log,false,0);
|
||||
}
|
||||
|
||||
SetLogicalVolume(clad2_log);
|
||||
}
|
||||
|
||||
void LXeWLSFiber::CopyValues(){
|
||||
updated=constructor->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;
|
||||
|
||||
clad2_z = fiber_z;
|
||||
clad2_sphi = fiber_sphi;
|
||||
clad2_ephi = fiber_ephi;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "LXeWLSSlab.hh"
|
||||
#include "LXeWLSFiber.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4LogicalSkinSurface.hh"
|
||||
#include "G4LogicalBorderSurface.hh"
|
||||
|
||||
G4LogicalVolume* LXeWLSSlab::ScintSlab_log=NULL;
|
||||
|
||||
LXeWLSSlab::LXeWLSSlab(G4RotationMatrix *pRot,
|
||||
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)
|
||||
{
|
||||
CopyValues();
|
||||
|
||||
if(!ScintSlab_log || updated){
|
||||
|
||||
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
|
||||
= new G4LogicalVolume(ScintSlab_box,
|
||||
G4Material::GetMaterial("Polystyrene"),
|
||||
"Slab",0,0,0);
|
||||
|
||||
G4double spacing = 2*slab_y/nfibers;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SetLogicalVolume(ScintSlab_log);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# Macro file for the initialization phase of "LXe.cc"
|
||||
# when runing in interactive mode
|
||||
#
|
||||
# Sets some default verbose
|
||||
#
|
||||
/run/verbose 2
|
||||
/control/verbose 2
|
||||
#
|
||||
# Create a scene handler/viewer for a specific graphics system
|
||||
# The compound command "/vis/open <vis-driver-name>"
|
||||
# is equivalent to the following set of commands:
|
||||
#
|
||||
# /vis/sceneHandler/create
|
||||
# /vis/viewer/create
|
||||
#
|
||||
# Create a scene handler and a viewer for the OGLIX driver
|
||||
/vis/open OGLIX
|
||||
#
|
||||
/vis/viewer/set/style wireframe
|
||||
# Set direction from target to camera.
|
||||
/vis/viewer/set/viewpointVector 1 1.5 1.1
|
||||
#/vis/viewer/set/viewpointThetaPhi 90 180 deg
|
||||
#/vis/viewer/zoom 1.4
|
||||
#
|
||||
# The compound command "/vis/drawVolume"
|
||||
# is equivalent to the following set of commands:
|
||||
#
|
||||
# /vis/scene/create
|
||||
# /vis/scene/add/volume
|
||||
# /vis/sceneHandler/attach
|
||||
# Create an empty scene and add the detector geometry to it
|
||||
/vis/drawVolume
|
||||
#
|
||||
# Store particle trajectories for visualization
|
||||
# (if too many tracks cause core dump => storeTrajectory 0)
|
||||
/tracking/storeTrajectory 1
|
||||
#
|
||||
# Add trajectories to the current scene
|
||||
# Note: This command is not necessary since the C++ method DrawTrajectory()
|
||||
# is called in LXeEventAction::EndOfEventAction
|
||||
#/vis/scene/add/trajectories
|
||||
#
|
||||
# Requests viewer to accumulate hits, tracks, etc. at end of event.
|
||||
# detector remains or is redrawn.
|
||||
/vis/scene/endOfEventAction accumulate
|
||||
@@ -0,0 +1,7 @@
|
||||
/control/execute defaults.mac
|
||||
/LXe/detector/volumes/wls 1
|
||||
/LXe/detector/volumes/lxe 0
|
||||
/LXe/detector/update
|
||||
/gun/particle e-
|
||||
/gun/energy 511 keV
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
Optical processes
|
||||
-----------------
|
||||
|
||||
This directory includes examples demonstrating the use of optical processes
|
||||
in the simulation.
|
||||
|
||||
LXe
|
||||
----
|
||||
Multi-purpose detector setup implementing:
|
||||
(1) scintillation inside a bulk scintillator with PMTs
|
||||
(2) large wall of small PMTs opposite a Cerenkov slab to show the cone
|
||||
(3) plastic scintillator with wave-length-shifting fiber readout.
|
||||
Reference in New Issue
Block a user