Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
+41 -16
View File
@@ -74,7 +74,7 @@ $ ./OpNovice2
- Execute OpNovice2 in 'batch' mode from macro files
\verbatim
% OpNovice2 surface.mac
% OpNovice2 electron.mac
\endverbatim
- Execute OpNovice2 in 'interactive mode' with visualization
@@ -93,28 +93,37 @@ Idle> exit
\section OpNovice2_s7 HISTOGRAMS
OpNovice2 has several predefined 1D histograms :
- 1 : Cerenkov spectrum
- 2 : scintillation spectrum
- 3 : boundary process status
- 4 : X momentum dir of scattered photons with px < 0
- 5 : Y momentum dir of scattered photons with px < 0
- 6 : Z momentum dir of scattered photons with px < 0
- 7 : X momentum dir of scattered photons with px >= 0
- 8 : Y momentum dir of scattered photons with px >= 0
- 9 : Z momentum dir of scattered photons with px >= 0
- 10 : X momentum dir of Fresnel-refracted photons
- 11 : Y momentum dir of Fresnel-refracted photons
- 12 : Z momentum dir of Fresnel-refracted photons
- 1 : Cerenkov spectrum
- 2 : scintillation spectrum
- 3 : scintillation time (global time)
- 4 : WLS absorption spectrum
- 5 : WLS emission spectrum
- 6 : WLS emission time
- 7 : WLS2 absorption spectrum
- 8 : WLS2 emission spectrum
- 9 : WLS2 emission time
- 10 : boundary process status
- 11 : X momentum dir of scattered photons with px < 0
- 12 : Y momentum dir of scattered photons with px < 0
- 13 : Z momentum dir of scattered photons with px < 0
- 14 : X momentum dir of scattered photons with px >= 0
- 15 : Y momentum dir of scattered photons with px >= 0
- 16 : Z momentum dir of scattered photons with px >= 0
- 17 : X momentum dir of Fresnel-refracted photons
- 18 : Y momentum dir of Fresnel-refracted photons
- 19 : Z momentum dir of Fresnel-refracted photons
- 20 : fraction of photons transmitted at surface
- 21 : fraction of photons reflected at surface
Histograms 4-12 are recorded for photons scattered from the +X
Histograms 11-19 are recorded for photons scattered from the +X
surface of the cube. Only the first interaction is recorded.
The histograms are managed by G4Analysis classes.
The histos can be individually activated with the command :
\verbatim
/analysis/h1/set id nbBins valMin valMax unit
/analysis/h1/set id nbBins valMin valMax
\endverbatim
where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
The unit is hardcoded to be eV for energy and ns for time.
One can control the name of the histograms file with the command:
\verbatim
@@ -130,4 +139,20 @@ Idle> exit
\endverbatim
All selected histos will be written on a file name.ascii (default opnovice2)
\section OpNovice2_s8 MACROS
Several macros are included.
boundary.mac: Set the surface to the various types and configurations of
model, type, etc., shoot optical photons, and record statistics
electron.mac: Shoot electrons and observe Cerenkov and scintillation radiation
fresnel.mac: Shoot optical photons of fixed polarization and random direction
at a surface, and plot reflectance/transmittance vs incident
angle.
OpNovice2.mac: Shoot an optical photon inside a box.
scint_by_particle.mac: Configure scintillation to have particle-specific
yields and yield ratios. Shoot different types of particles.
vis.mac: Configure visualization.
wls.mac: Configure two wavelength-shifting processes, and shoot optical
photons.
*/
@@ -1,6 +1,9 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.18)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
project(OpNovice2)
#----------------------------------------------------------------------------
@@ -23,7 +26,7 @@ include(${Geant4_USE_FILE})
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
@@ -41,12 +44,12 @@ target_link_libraries(OpNovice2 ${Geant4_LIBRARIES} )
#
set(OpNovice2_SCRIPTS
OpNovice2.out
OpNovice2.in
vis.mac
unified.mac
glisur.mac
OpNovice2.mac
boundary.mac
electron.mac
fresnel.mac
scint_by_particle.mac
vis.mac
wls.mac
)
@@ -13,6 +13,26 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
October 30, 2020 D.Sawkey (OpNovice2-V10-06-07)
- migration to G4RunManagerFactory, and don't set number of threads in main
- print histogram statistics at end of run
- remove G4Timer
- update macro verbosity, ignore threads except 0
- apply clang-format style
October 5, 2020 D.Sawkey (OpNovice2-V10-06-06)
- new macro boundary.mac, exercising all 4 boundary models. Remove
glisur.mac and unified.mac.
- rename OpNovice2.in to OpNovice2.mac
August 4, 2020 D.Sawkey (OpNovice2-V10-06-05)
- Add material properties using new interface with std::vectors
July 10, 2020 D.Sawkey (OpNovice2-V10-06-04)
- calculate reflection/transmission probabilities vs. angle
(new macro fresnel.mac)
- histos: add axis labels, id's; refer to them by id in some places
May 29, 2020 D.Sawkey (OpNovice2-V10-06-03)
- add code to generate statistics for wavelength shifting
- add wls.mac to test WLS and new process WLS2
@@ -29,46 +29,29 @@
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Types.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
#include "G4RunManager.hh"
#endif
#include "G4UImanager.hh"
#include "G4String.hh"
#include "FTFP_BERT.hh"
#include "G4OpticalPhysics.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "ActionInitialization.hh"
#include "G4VisExecutive.hh"
#include "FTFP_BERT.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "G4OpticalPhysics.hh"
#include "G4RunManagerFactory.hh"
#include "G4String.hh"
#include "G4Types.hh"
#include "G4UIExecutive.hh"
#include "G4UImanager.hh"
#include "G4VisExecutive.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc, char** argv)
{
//detect interactive mode (if no arguments) and define UI session
// detect interactive mode (if no arguments) and define UI session
G4UIExecutive* ui = nullptr;
if (argc == 1) ui = new G4UIExecutive(argc,argv);
if(argc == 1)
ui = new G4UIExecutive(argc, argv);
#ifdef G4MULTITHREADED
G4MTRunManager * runManager = new G4MTRunManager;
G4int nThreads = std::min(G4Threading::G4GetNumberOfCores(), 4);
runManager->SetNumberOfThreads(nThreads);
G4cout << "===== OpNovice2 is started with "
<< runManager->GetNumberOfThreads() << " threads =====" << G4endl;
#else
G4RunManager * runManager = new G4RunManager;
#endif
auto runManager = G4RunManagerFactory::CreateRunManager();
DetectorConstruction* detector = new DetectorConstruction();
runManager->SetUserInitialization(detector);
@@ -82,24 +65,26 @@ int main(int argc, char** argv)
runManager->SetUserInitialization(new ActionInitialization());
//initialize visualization
// initialize visualization
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
//get the pointer to the User Interface manager
// get the pointer to the User Interface manager
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (ui) {
//interactive mode
if(ui)
{
// interactive mode
UImanager->ApplyCommand("/control/execute vis.mac");
ui->SessionStart();
delete ui;
}
else {
//batch mode
G4String command = "/control/execute ";
else
{
// batch mode
G4String command = "/control/execute ";
G4String fileName = argv[1];
UImanager->ApplyCommand(command+fileName);
UImanager->ApplyCommand(command + fileName);
}
// job termination
@@ -1,5 +1,8 @@
/control/verbose 2
/tracking/verbose 0
/run/verbose 1
/process/optical/verbose 1
/control/cout/ignoreThreadsExcept 0
/opnovice2/boxProperty RINDEX 0.000002 1.3 0.000008 1.4
/opnovice2/boxProperty ABSLENGTH 0.000002 1000000 0.000005 2000000 0.000008 3000000
File diff suppressed because it is too large Load Diff
+43 -19
View File
@@ -64,7 +64,7 @@
5- HOW TO START ?
- Execute OpNovice2 in 'batch' mode from macro files
% OpNovice2 surface.mac
% OpNovice2 electron.mac
- Execute OpNovice2 in 'interactive mode' with visualization
% OpNovice2
@@ -79,28 +79,36 @@
7- HISTOGRAMS
OpNovice2 has several predefined 1D histograms :
1 : Cerenkov spectrum
2 : scintillation spectrum
3 : boundary process status
4 : X momentum dir of scattered photons with px < 0
5 : Y momentum dir of scattered photons with px < 0
6 : Z momentum dir of scattered photons with px < 0
7 : X momentum dir of scattered photons with px >= 0
8 : Y momentum dir of scattered photons with px >= 0
9 : Z momentum dir of scattered photons with px >= 0
10 : X momentum dir of Fresnel-refracted photons
11 : Y momentum dir of Fresnel-refracted photons
12 : Z momentum dir of Fresnel-refracted photons
13 : creation time of scintillation photons
OpNovice2 has several predefined 1D histograms :
1 : Cerenkov spectrum
2 : scintillation spectrum
3 : scintillation time (global time)
4 : WLS absorption spectrum
5 : WLS emission spectrum
6 : WLS emission time
7 : WLS2 absorption spectrum
8 : WLS2 emission spectrum
9 : WLS2 emission time
10 : boundary process status
11 : X momentum dir of scattered photons with px < 0
12 : Y momentum dir of scattered photons with px < 0
13 : Z momentum dir of scattered photons with px < 0
14 : X momentum dir of scattered photons with px >= 0
15 : Y momentum dir of scattered photons with px >= 0
16 : Z momentum dir of scattered photons with px >= 0
17 : X momentum dir of Fresnel-refracted photons
18 : Y momentum dir of Fresnel-refracted photons
19 : Z momentum dir of Fresnel-refracted photons
20 : fraction of photons transmitted at surface
21 : fraction of photons reflected at surface
Histograms 4-12 are recorded for photons scattered from the +X
Histograms 11-19 are recorded for photons scattered from the +X
surface of the cube. Only the first interaction is recorded.
The histograms are managed by G4Analysis classes.
The histos can be individually activated with the command:
/analysis/h1/set id nbBins valMin valMax unit
where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
/analysis/h1/set id nbBins valMin valMax
The unit is hardcoded to be eV for energy and ns for time.
One can control the name of the histograms file with the command:
/analysis/setFileName name (default opnovice2)
@@ -110,4 +118,20 @@
It is also possible to print selected histograms on an ascii file:
/analysis/h1/setAscii id
All selected histos will be written on a file name.ascii (default opnovice2)
All selected histos will be written on a file name.ascii (default opnovice2)
8- MACROS
Several macros are included.
boundary.mac: Set the surface to the various types and configurations of
model, type, etc., shoot optical photons, and record statistics
electron.mac: Shoot electrons and observe Cerenkov and scintillation radiation
fresnel.mac: Shoot optical photons of fixed polarization and random direction
at a surface, and plot reflectance/transmittance vs incident
angle.
OpNovice2.mac: Shoot an optical photon inside a box.
scint_by_particle.mac: Configure scintillation to have particle-specific
yields and yield ratios. Shoot different types of particles.
vis.mac: Configure visualization.
wls.mac: Configure two wavelength-shifting processes, and shoot optical
photons.
@@ -0,0 +1,211 @@
/control/verbose 2
/tracking/verbose 0
/run/verbose 1
/process/optical/verbose 1
/control/cout/ignoreThreadsExcept 0
/opnovice2/boxProperty RINDEX 0.000002 1.3 0.000008 1.4
/opnovice2/boxProperty ABSLENGTH 0.000002 1000000 0.000005 2000000 0.000008 3000000
/opnovice2/worldProperty RINDEX 0.000002 1.01 0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 1000000 0.000005 2000000 0.000008 3000000
/opnovice2/surfaceProperty SPECULARLOBECONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty SPECULARSPIKECONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty BACKSCATTERCONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty TRANSMITTANCE 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty REFLECTIVITY 0.000002 0.8 0.000008 0.8
/opnovice2/surfaceProperty EFFICIENCY 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty RINDEX 0.000002 1.4 0.000008 1.5
/opnovice2/surfaceSigmaAlpha 0.2
/run/initialize
#
/gun/particle opticalphoton
/gun/energy 3 eV
/gun/position 0 0 0 cm
# will be normalized
/gun/direction .9 .44 0
/opnovice2/gun/optPhotonPolar
#
/analysis/setFileName unified
/analysis/h1/set 10 40 -1 39
/analysis/h1/set 11 100 -1.1 1.1
/analysis/h1/set 12 100 -1.1 1.1
/analysis/h1/set 13 100 -1.1 1.1
/analysis/h1/set 14 100 -1.1 1.1
/analysis/h1/set 15 100 -1.1 1.1
/analysis/h1/set 16 100 -1.1 1.1
/analysis/h1/set 17 100 -1.1 1.1
/analysis/h1/set 18 100 -1.1 1.1
/analysis/h1/set 19 100 -1.1 1.1
###############################################################################
################################# UNIFIED #####################################
###############################################################################
/opnovice2/surfaceModel unified
/opnovice2/surfaceType dielectric_dielectric
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ground ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
/opnovice2/surfaceFinish ground
## unified, davis, lut use sigma_alpha; glisur uses polish
/run/beamOn 10000
# restore default
#/opnovice2/surfaceSigmaAlpha 0.0
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ polished ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
/opnovice2/surfaceFinish polished
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceConstProperty SURFACEROUGHNESS 0.01
/run/initialize
/run/beamOn 10000
# restore default
/opnovice2/surfaceConstProperty SURFACEROUGHNESS 0.0
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ painted ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
/opnovice2/surfaceFinish polishedfrontpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish groundfrontpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish polishedbackpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish groundbackpainted
/run/initialize
/run/beamOn 10000
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dielectric_metal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
/opnovice2/surfaceType dielectric_metal
/opnovice2/surfaceFinish polished
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish ground
/run/initialize
/run/beamOn 10000
###############################################################################
################################# GLISUR ######################################
###############################################################################
/opnovice2/surfaceModel glisur
/opnovice2/surfaceType dielectric_dielectric
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ polished ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
/opnovice2/surfaceFinish polished
/analysis/setFileName glisur
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceConstProperty SURFACEROUGHNESS 0.01
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceConstProperty SURFACEROUGHNESS 0.0
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ground ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
/opnovice2/surfaceFinish ground
/run/initialize
/opnovice2/surfacePolish 0.2
/run/beamOn 10000
# restore default
/opnovice2/surfacePolish 1.0
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ painted ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
/opnovice2/surfaceFinish polishedfrontpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish polishedbackpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish groundfrontpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish groundbackpainted
/opnovice2/surfacePolish 0.2
/run/initialize
/run/beamOn 10000
/opnovice2/surfacePolish 1.0
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dielectric_metal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
/opnovice2/surfaceType dielectric_metal
/opnovice2/surfaceFinish polished
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish ground
/run/initialize
/opnovice2/surfacePolish 0.2
/run/beamOn 10000
/opnovice2/surfacePolish 1.0
###############################################################################
################################# DAVIS LUT ###################################
###############################################################################
/opnovice2/surfaceModel DAVIS
/opnovice2/surfaceType dielectric_LUTDAVIS
/opnovice2/surfaceFinish RoughTeflon_LUT
/run/initialize
/analysis/setFileName davis_roughTeflon
/run/beamOn 10000
/opnovice2/surfaceFinish Detector_LUT
/analysis/setFileName davis_detector
/run/beamOn 10000
###############################################################################
################################# LUT (LBNL) ##################################
###############################################################################
/opnovice2/surfaceModel LUT
/opnovice2/surfaceType dielectric_LUT
/opnovice2/surfaceFinish polishedlumirrorair
/analysis/setFileName lbnl_polishedLumirrorAir
/run/beamOn 1000
@@ -1,5 +1,7 @@
/control/verbose 2
/tracking/verbose 0
/run/verbose 1
/process/optical/verbose 1
/control/cout/ignoreThreadsExcept 0
/opnovice2/boxMaterial G4_BGO
@@ -38,9 +40,6 @@
/opnovice2/surfaceProperty REFLECTIVITY 0.000002 0.8 0.000008 0.8
/opnovice2/surfaceProperty EFFICIENCY 0.000002 0.1 0.000008 0.1
/process/optical/verbose 0
/process/optical/cerenkov/setMaxPhotons 3
/process/optical/cerenkov/setMaxBetaChange 10
@@ -53,15 +52,9 @@
/run/initialize
/analysis/setFileName electron
/analysis/h1/set 1 100 0 10
/analysis/h1/setXaxis 1 "Energy [eV]"
/analysis/h1/setYaxis 1 "Number of photons"
/analysis/h1/set 2 100 0 10
/analysis/h1/setXaxis 2 "Energy [eV]"
/analysis/h1/setYaxis 2 "Number of photons"
/analysis/h1/set 3 400 0 200
/analysis/h1/setXaxis 3 "Creation time [ns]"
/analysis/h1/setYaxis 3 "Number of photons"
/analysis/h1/set 1 100 0 10 # eV
/analysis/h1/set 2 100 0 10 # eV
/analysis/h1/set 3 400 0 200 # ns
/gun/particle e-
@@ -0,0 +1,37 @@
/control/verbose 2
/tracking/verbose 0
/run/verbose 1
/process/optical/verbose 1
/control/cout/ignoreThreadsExcept 0
/opnovice2/boxProperty RINDEX 0.000002 1.4 0.000008 1.41
/opnovice2/boxProperty ABSLENGTH 0.000002 100 0.000005 200 0.000008 300
/opnovice2/worldProperty RINDEX 0.000002 1.01 0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 1000000 0.000005 2000000 0.000008 3000000
/opnovice2/surfaceModel unified
/opnovice2/surfaceType dielectric_dielectric
/opnovice2/surfaceFinish polished
/opnovice2/surfaceProperty REFLECTIVITY 0.000002 1.0 0.000008 1.0
/run/initialize
#
/gun/particle opticalphoton
/gun/energy 5 eV
/gun/position 99.99 0 0 cm
/gun/direction 1 0 0
/opnovice2/gun/optPhotonPolar 0. deg
/opnovice2/gun/randomDirection true
#
/analysis/setFileName fresnel_0
/analysis/h1/set 20 90 0 90 # deg
/analysis/h1/set 21 90 0 90 # deg
/run/printProgress 100000
/run/beamOn 500000
/analysis/setFileName fresnel_90
/opnovice2/gun/optPhotonPolar 90. deg
/run/beamOn 500000
@@ -1,94 +0,0 @@
/control/verbose 2
/tracking/verbose 0
/control/cout/ignoreThreadsExcept 0
/opnovice2/boxProperty RINDEX 0.000002 1.3 0.000008 1.4
/opnovice2/boxProperty ABSLENGTH 0.000002 10000 0.000005 20000 0.000008 30000
/opnovice2/worldProperty RINDEX 0.000002 1.01 0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 1000 0.000005 2000 0.000008 3000
/opnovice2/surfaceModel glisur
/opnovice2/surfaceType dielectric_dielectric
/opnovice2/surfaceProperty SPECULARLOBECONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty SPECULARSPIKECONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty BACKSCATTERCONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty TRANSMITTANCE 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty REFLECTIVITY 0.000002 0.8 0.000008 0.8
/opnovice2/surfaceProperty EFFICIENCY 0.000002 0.05 0.000008 0.05
/run/initialize
#
/gun/particle opticalphoton
/gun/energy 3 eV
/gun/position 0 0 0 cm
/gun/direction .9 0.1 0.1
/opnovice2/gun/optPhotonPolar
#
/analysis/setFileName glisur
/analysis/h1/set 10 40 -1 39
/analysis/h1/set 11 100 -1.1 1.1
/analysis/h1/set 12 100 -1.1 1.1
/analysis/h1/set 13 100 -1.1 1.1
/analysis/h1/set 14 100 -1.1 1.1
/analysis/h1/set 15 100 -1.1 1.1
/analysis/h1/set 16 100 -1.1 1.1
/analysis/h1/set 17 100 -1.1 1.1
/analysis/h1/set 18 100 -1.1 1.1
/analysis/h1/set 19 100 -1.1 1.1
############################# polished ########################################
/opnovice2/surfaceFinish polished
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceConstProperty SURFACEROUGHNESS 0.01
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceConstProperty SURFACEROUGHNESS 0.0
############################# ground ##########################################
/opnovice2/surfaceFinish ground
/run/initialize
/opnovice2/surfacePolish 0.2
/run/beamOn 10000
/opnovice2/surfacePolish 1.0
############################# painted #########################################
/opnovice2/surfaceFinish polishedfrontpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish polishedbackpainted
/opnovice2/surfaceProperty RINDEX 0.000002 1.4 0.000008 1.5
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish groundfrontpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish groundbackpainted
/opnovice2/surfacePolish 0.2
/run/initialize
/run/beamOn 10000
/opnovice2/surfacePolish 1.0
############################# dielectric_metal ################################
/opnovice2/surfaceType dielectric_metal
/opnovice2/surfaceFinish polished
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish ground
/run/initialize
/opnovice2/surfacePolish 0.2
/run/beamOn 10000
@@ -35,13 +35,12 @@
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization();
virtual ~ActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
public:
ActionInitialization();
virtual ~ActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
};
#endif
@@ -34,12 +34,10 @@
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4OpticalSurface.hh"
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
#include "G4OpticalSurface.hh"
#include "G4RunManager.hh"
#include "G4VUserDetectorConstruction.hh"
class DetectorMessenger;
@@ -47,83 +45,93 @@ class DetectorMessenger;
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
virtual ~DetectorConstruction();
public:
DetectorConstruction();
virtual ~DetectorConstruction();
G4VPhysicalVolume* GetTank() {return fTank;}
G4double GetTankXSize() {return fTank_x;}
G4VPhysicalVolume* GetTank() { return fTank; }
G4double GetTankXSize() { return fTank_x; }
G4OpticalSurface* GetSurface(void) {return fSurface;}
G4OpticalSurface* GetSurface(void) { return fSurface; }
void SetSurfaceFinish(const G4OpticalSurfaceFinish finish) {
fSurface->SetFinish(finish);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
}
G4OpticalSurfaceFinish GetSurfaceFinish(void)
{return fSurface->GetFinish();}
void SetSurfaceFinish(const G4OpticalSurfaceFinish finish)
{
fSurface->SetFinish(finish);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
}
G4OpticalSurfaceFinish GetSurfaceFinish(void)
{
return fSurface->GetFinish();
}
void SetSurfaceType(const G4SurfaceType type) {
fSurface->SetType(type);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
}
void SetSurfaceType(const G4SurfaceType type)
{
fSurface->SetType(type);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
}
void SetSurfaceModel(const G4OpticalSurfaceModel model) {
fSurface->SetModel(model);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
}
G4OpticalSurfaceModel GetSurfaceModel(void)
{return fSurface->GetModel();}
void SetSurfaceModel(const G4OpticalSurfaceModel model)
{
fSurface->SetModel(model);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
}
G4OpticalSurfaceModel GetSurfaceModel(void) { return fSurface->GetModel(); }
void SetSurfaceSigmaAlpha(G4double v);
void SetSurfacePolish(G4double v);
void SetSurfaceSigmaAlpha(G4double v);
void SetSurfacePolish(G4double v);
void AddTankMPV(const char* c, G4MaterialPropertyVector* mpv);
void AddTankMPC(const char* c, G4double v);
G4MaterialPropertiesTable* GetTankMaterialPropertiesTable()
{return fTankMPT;}
void AddTankMPV(const G4String& prop, G4MaterialPropertyVector* mpv);
void AddTankMPC(const G4String& prop, G4double v);
G4MaterialPropertiesTable* GetTankMaterialPropertiesTable()
{
return fTankMPT;
}
void AddWorldMPV(const char* c, G4MaterialPropertyVector* mpv);
void AddWorldMPC(const char* c, G4double v);
G4MaterialPropertiesTable* GetWorldMaterialPropertiesTable()
{return fWorldMPT;}
void AddWorldMPV(const G4String& prop, G4MaterialPropertyVector* mpv);
void AddWorldMPC(const G4String& prop, G4double v);
G4MaterialPropertiesTable* GetWorldMaterialPropertiesTable()
{
return fWorldMPT;
}
void AddSurfaceMPV(const char* c, G4MaterialPropertyVector* mpv);
void AddSurfaceMPC(const char* c, G4double v);
G4MaterialPropertiesTable* GetSurfaceMaterialPropertiesTable()
{return fSurfaceMPT;}
void AddSurfaceMPV(const G4String& prop, G4MaterialPropertyVector* mpv);
void AddSurfaceMPC(const G4String& prop, G4double v);
G4MaterialPropertiesTable* GetSurfaceMaterialPropertiesTable()
{
return fSurfaceMPT;
}
void SetWorldMaterial(const G4String&);
G4Material* GetWorldMaterial() const {return fWorldMaterial;}
void SetTankMaterial(const G4String&);
G4Material* GetTankMaterial() const {return fTankMaterial;}
void SetWorldMaterial(const G4String&);
G4Material* GetWorldMaterial() const { return fWorldMaterial; }
void SetTankMaterial(const G4String&);
G4Material* GetTankMaterial() const { return fTankMaterial; }
virtual G4VPhysicalVolume* Construct();
virtual G4VPhysicalVolume* Construct();
private:
G4double fExpHall_x;
G4double fExpHall_y;
G4double fExpHall_z;
private:
G4double fExpHall_x;
G4double fExpHall_y;
G4double fExpHall_z;
G4VPhysicalVolume* fTank;
G4VPhysicalVolume* fTank;
G4double fTank_x;
G4double fTank_y;
G4double fTank_z;
G4double fTank_x;
G4double fTank_y;
G4double fTank_z;
G4LogicalVolume* fWorld_LV;
G4LogicalVolume* fTank_LV;
G4LogicalVolume* fWorld_LV;
G4LogicalVolume* fTank_LV;
G4Material* fWorldMaterial;
G4Material* fTankMaterial;
G4Material* fWorldMaterial;
G4Material* fTankMaterial;
G4OpticalSurface* fSurface;
G4OpticalSurface* fSurface;
DetectorMessenger* fDetectorMessenger;
DetectorMessenger* fDetectorMessenger;
G4MaterialPropertiesTable* fTankMPT;
G4MaterialPropertiesTable* fWorldMPT;
G4MaterialPropertiesTable* fSurfaceMPT;
G4MaterialPropertiesTable* fTankMPT;
G4MaterialPropertiesTable* fWorldMPT;
G4MaterialPropertiesTable* fSurfaceMPT;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -47,43 +47,39 @@ class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorMessenger: public G4UImessenger
class DetectorMessenger : public G4UImessenger
{
public:
public:
DetectorMessenger(DetectorConstruction*);
~DetectorMessenger();
DetectorMessenger(DetectorConstruction* );
~DetectorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
virtual void SetNewValue(G4UIcommand*, G4String);
private:
DetectorConstruction* fDetector;
private:
G4UIdirectory* fOpticalDir;
DetectorConstruction* fDetector;
// the surface
G4UIcmdWithAString* fSurfaceTypeCmd;
G4UIcmdWithAString* fSurfaceFinishCmd;
G4UIcmdWithAString* fSurfaceModelCmd;
G4UIcmdWithADouble* fSurfaceSigmaAlphaCmd;
G4UIcmdWithADouble* fSurfacePolishCmd;
G4UIcmdWithAString* fSurfaceMatPropVectorCmd;
G4UIcmdWithAString* fSurfaceMatPropConstCmd;
G4UIdirectory* fOpticalDir;
// the surface
G4UIcmdWithAString* fSurfaceTypeCmd;
G4UIcmdWithAString* fSurfaceFinishCmd;
G4UIcmdWithAString* fSurfaceModelCmd;
G4UIcmdWithADouble* fSurfaceSigmaAlphaCmd;
G4UIcmdWithADouble* fSurfacePolishCmd;
G4UIcmdWithAString* fSurfaceMatPropVectorCmd;
G4UIcmdWithAString* fSurfaceMatPropConstCmd;
// the box
G4UIcmdWithAString* fTankMatPropVectorCmd;
G4UIcmdWithAString* fTankMatPropConstCmd;
G4UIcmdWithAString* fTankMaterialCmd;
// the world
G4UIcmdWithAString* fWorldMatPropVectorCmd;
G4UIcmdWithAString* fWorldMatPropConstCmd;
G4UIcmdWithAString* fWorldMaterialCmd;
// the box
G4UIcmdWithAString* fTankMatPropVectorCmd;
G4UIcmdWithAString* fTankMatPropConstCmd;
G4UIcmdWithAString* fTankMaterialCmd;
// the world
G4UIcmdWithAString* fWorldMatPropVectorCmd;
G4UIcmdWithAString* fWorldMatPropConstCmd;
G4UIcmdWithAString* fWorldMaterialCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -27,7 +27,7 @@
/// \brief Definition of the HistoManager class
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,16 +44,15 @@
class HistoManager
{
public:
HistoManager();
~HistoManager();
public:
HistoManager();
~HistoManager();
private:
void Book();
G4String fFileName;
private:
void Book();
G4String fFileName;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -29,14 +29,13 @@
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
#include "globals.hh"
#include "G4ParticleGun.hh"
#include "G4VUserPrimaryGeneratorAction.hh"
class G4Event;
class PrimaryGeneratorMessenger;
@@ -45,20 +44,26 @@ class PrimaryGeneratorMessenger;
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction();
virtual ~PrimaryGeneratorAction();
public:
PrimaryGeneratorAction();
virtual ~PrimaryGeneratorAction();
virtual void GeneratePrimaries(G4Event*);
virtual void GeneratePrimaries(G4Event*);
G4ParticleGun* GetParticleGun() {return fParticleGun;};
G4ParticleGun* GetParticleGun() { return fParticleGun; };
void SetOptPhotonPolar();
void SetOptPhotonPolar(G4double);
void SetOptPhotonPolar();
void SetOptPhotonPolar(G4double);
void SetRandomDirection(G4bool val = true);
G4bool GetPolarized() { return fPolarized; };
G4double GetPolarization() { return fPolarization; }
private:
G4ParticleGun* fParticleGun;
PrimaryGeneratorMessenger* fGunMessenger;
private:
G4ParticleGun* fParticleGun;
PrimaryGeneratorMessenger* fGunMessenger;
G4bool fRandomDirection;
G4bool fPolarized;
G4double fPolarization;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -28,7 +28,7 @@
//
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,27 +36,29 @@
#ifndef PrimaryGeneratorMessenger_h
#define PrimaryGeneratorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
#include "G4UImessenger.hh"
class PrimaryGeneratorAction;
class G4UIdirectory;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithABool;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PrimaryGeneratorMessenger: public G4UImessenger
class PrimaryGeneratorMessenger : public G4UImessenger
{
public:
PrimaryGeneratorMessenger(PrimaryGeneratorAction* );
virtual ~PrimaryGeneratorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
PrimaryGeneratorAction* fPrimaryAction;
G4UIdirectory* fGunDir;
G4UIcmdWithADoubleAndUnit* fPolarCmd;
public:
PrimaryGeneratorMessenger(PrimaryGeneratorAction*);
virtual ~PrimaryGeneratorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
PrimaryGeneratorAction* fPrimaryAction;
G4UIdirectory* fGunDir;
G4UIcmdWithADoubleAndUnit* fPolarCmd;
G4UIcmdWithABool* fRandomDirectionCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+171 -123
View File
@@ -29,7 +29,6 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef Run_h
#define Run_h 1
@@ -41,145 +40,194 @@ class G4ParticleDefinition;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class Run : public G4Run
{
public:
Run();
~Run();
public:
Run();
~Run();
void SetPrimary(G4ParticleDefinition* particle, G4double energy);
void SetPrimary(G4ParticleDefinition* particle, G4double energy,
G4bool polarized, G4double polarization);
// particle energy
void AddCerenkovEnergy(G4double en) {fCerenkovEnergy += en;}
void AddScintillationEnergy(G4double en) {fScintEnergy += en;}
void AddWLSAbsorptionEnergy(G4double en) {fWLSAbsorptionEnergy += en;}
void AddWLSEmissionEnergy(G4double en) {fWLSEmissionEnergy += en;}
void AddWLS2AbsorptionEnergy(G4double en) {fWLS2AbsorptionEnergy += en;}
void AddWLS2EmissionEnergy(G4double en) {fWLS2EmissionEnergy += en;}
// particle energy
void AddCerenkovEnergy(G4double en) { fCerenkovEnergy += en; }
void AddScintillationEnergy(G4double en) { fScintEnergy += en; }
void AddWLSAbsorptionEnergy(G4double en) { fWLSAbsorptionEnergy += en; }
void AddWLSEmissionEnergy(G4double en) { fWLSEmissionEnergy += en; }
void AddWLS2AbsorptionEnergy(G4double en) { fWLS2AbsorptionEnergy += en; }
void AddWLS2EmissionEnergy(G4double en) { fWLS2EmissionEnergy += en; }
// number of particles
void AddCerenkov(void) {fCerenkovCount += 1;}
void AddScintillation(void) {fScintCount += 1;}
void AddRayleigh(void) {fRayleighCount += 1;}
void AddWLSAbsorption(void) {fWLSAbsorptionCount += 1;}
void AddWLSEmission(void) {fWLSEmissionCount += 1;}
void AddWLS2Absorption(void) {fWLS2AbsorptionCount += 1;}
void AddWLS2Emission(void) {fWLS2EmissionCount += 1;}
void AddOpAbsorption(void) {fOpAbsorption += 1;}
void AddOpAbsorptionPrior(void) {fOpAbsorptionPrior += 1;}
// number of particles
void AddCerenkov(void) { fCerenkovCount += 1; }
void AddScintillation(void) { fScintCount += 1; }
void AddRayleigh(void) { fRayleighCount += 1; }
void AddWLSAbsorption(void) { fWLSAbsorptionCount += 1; }
void AddWLSEmission(void) { fWLSEmissionCount += 1; }
void AddWLS2Absorption(void) { fWLS2AbsorptionCount += 1; }
void AddWLS2Emission(void) { fWLS2EmissionCount += 1; }
void AddFresnelRefraction(void) {
fBoundaryProcs[FresnelRefraction] += 1;
}
void AddFresnelReflection(void) {
fBoundaryProcs[FresnelReflection] += 1;
}
void AddTransmission(void) {fBoundaryProcs[Transmission] += 1;}
void AddTotalInternalReflection(void)
{fBoundaryProcs[TotalInternalReflection] += 1;}
void AddLambertianReflection(void)
{fBoundaryProcs[LambertianReflection] += 1;}
void AddLobeReflection(void) {fBoundaryProcs[LobeReflection] += 1;}
void AddSpikeReflection(void) {fBoundaryProcs[SpikeReflection] += 1;}
void AddBackScattering(void) {fBoundaryProcs[BackScattering] += 1;}
void AddAbsorption(void) {fBoundaryProcs[Absorption] += 1;}
void AddDetection(void) {fBoundaryProcs[Detection] += 1;}
void AddNotAtBoundary(void) {fBoundaryProcs[NotAtBoundary] += 1;}
void AddSameMaterial(void) {fBoundaryProcs[SameMaterial] += 1;}
void AddStepTooSmall(void) {fBoundaryProcs[StepTooSmall] += 1;}
void AddNoRINDEX(void) {fBoundaryProcs[NoRINDEX] += 1;}
void AddOpAbsorption(void) { fOpAbsorption += 1; }
void AddOpAbsorptionPrior(void) { fOpAbsorptionPrior += 1; }
void AddTotalSurface(void) {fTotalSurface += 1;}
void AddPolishedLumirrorAirReflection(void)
{fBoundaryProcs[PolishedLumirrorAirReflection] += 1;}
void AddPolishedLumirrorGlueReflection(void)
{fBoundaryProcs[PolishedLumirrorGlueReflection] += 1;}
void AddPolishedAirReflection(void)
{fBoundaryProcs[PolishedAirReflection] += 1;}
void AddPolishedTeflonAirReflection(void)
{fBoundaryProcs[PolishedTeflonAirReflection] += 1;}
void AddPolishedTiOAirReflection(void)
{fBoundaryProcs[PolishedTiOAirReflection] += 1;}
void AddPolishedTyvekAirReflection(void)
{fBoundaryProcs[PolishedTyvekAirReflection] += 1;}
void AddPolishedVM2000AirReflection(void)
{fBoundaryProcs[PolishedVM2000AirReflection] += 1;}
void AddPolishedVM2000GlueReflection(void)
{fBoundaryProcs[PolishedVM2000GlueReflection] += 1;}
void AddFresnelRefraction(void) { fBoundaryProcs[FresnelRefraction] += 1; }
void AddFresnelReflection(void) { fBoundaryProcs[FresnelReflection] += 1; }
void AddTransmission(void) { fBoundaryProcs[Transmission] += 1; }
void AddTotalInternalReflection(void)
{
fBoundaryProcs[TotalInternalReflection] += 1;
}
void AddLambertianReflection(void)
{
fBoundaryProcs[LambertianReflection] += 1;
}
void AddLobeReflection(void) { fBoundaryProcs[LobeReflection] += 1; }
void AddSpikeReflection(void) { fBoundaryProcs[SpikeReflection] += 1; }
void AddBackScattering(void) { fBoundaryProcs[BackScattering] += 1; }
void AddAbsorption(void) { fBoundaryProcs[Absorption] += 1; }
void AddDetection(void) { fBoundaryProcs[Detection] += 1; }
void AddNotAtBoundary(void) { fBoundaryProcs[NotAtBoundary] += 1; }
void AddSameMaterial(void) { fBoundaryProcs[SameMaterial] += 1; }
void AddStepTooSmall(void) { fBoundaryProcs[StepTooSmall] += 1; }
void AddNoRINDEX(void) { fBoundaryProcs[NoRINDEX] += 1; }
void AddEtchedLumirrorAirReflection(void)
{fBoundaryProcs[EtchedLumirrorAirReflection] += 1;}
void AddEtchedLumirrorGlueReflection(void)
{fBoundaryProcs[EtchedLumirrorGlueReflection] += 1;}
void AddEtchedAirReflection(void)
{fBoundaryProcs[EtchedAirReflection] += 1;}
void AddEtchedTeflonAirReflection(void)
{fBoundaryProcs[EtchedTeflonAirReflection] += 1;}
void AddEtchedTiOAirReflection(void)
{fBoundaryProcs[EtchedTiOAirReflection] += 1;}
void AddEtchedTyvekAirReflection(void)
{fBoundaryProcs[EtchedTyvekAirReflection] += 1;}
void AddEtchedVM2000AirReflection(void)
{fBoundaryProcs[EtchedVM2000AirReflection] += 1;}
void AddEtchedVM2000GlueReflection(void)
{fBoundaryProcs[EtchedVM2000GlueReflection] += 1;}
void AddTotalSurface(void) { fTotalSurface += 1; }
void AddPolishedLumirrorAirReflection(void)
{
fBoundaryProcs[PolishedLumirrorAirReflection] += 1;
}
void AddPolishedLumirrorGlueReflection(void)
{
fBoundaryProcs[PolishedLumirrorGlueReflection] += 1;
}
void AddPolishedAirReflection(void)
{
fBoundaryProcs[PolishedAirReflection] += 1;
}
void AddPolishedTeflonAirReflection(void)
{
fBoundaryProcs[PolishedTeflonAirReflection] += 1;
}
void AddPolishedTiOAirReflection(void)
{
fBoundaryProcs[PolishedTiOAirReflection] += 1;
}
void AddPolishedTyvekAirReflection(void)
{
fBoundaryProcs[PolishedTyvekAirReflection] += 1;
}
void AddPolishedVM2000AirReflection(void)
{
fBoundaryProcs[PolishedVM2000AirReflection] += 1;
}
void AddPolishedVM2000GlueReflection(void)
{
fBoundaryProcs[PolishedVM2000GlueReflection] += 1;
}
void AddGroundLumirrorAirReflection(void)
{fBoundaryProcs[GroundLumirrorAirReflection] += 1;}
void AddGroundLumirrorGlueReflection(void)
{fBoundaryProcs[GroundLumirrorGlueReflection] += 1;}
void AddGroundAirReflection(void)
{fBoundaryProcs[GroundAirReflection] += 1;}
void AddGroundTeflonAirReflection(void)
{fBoundaryProcs[GroundTeflonAirReflection] += 1;}
void AddGroundTiOAirReflection(void)
{fBoundaryProcs[GroundTiOAirReflection] += 1;}
void AddGroundTyvekAirReflection(void)
{fBoundaryProcs[GroundTyvekAirReflection] += 1;}
void AddGroundVM2000AirReflection(void)
{fBoundaryProcs[GroundVM2000AirReflection] += 1;}
void AddGroundVM2000GlueReflection(void)
{fBoundaryProcs[GroundVM2000GlueReflection] += 1;}
void AddEtchedLumirrorAirReflection(void)
{
fBoundaryProcs[EtchedLumirrorAirReflection] += 1;
}
void AddEtchedLumirrorGlueReflection(void)
{
fBoundaryProcs[EtchedLumirrorGlueReflection] += 1;
}
void AddEtchedAirReflection(void)
{
fBoundaryProcs[EtchedAirReflection] += 1;
}
void AddEtchedTeflonAirReflection(void)
{
fBoundaryProcs[EtchedTeflonAirReflection] += 1;
}
void AddEtchedTiOAirReflection(void)
{
fBoundaryProcs[EtchedTiOAirReflection] += 1;
}
void AddEtchedTyvekAirReflection(void)
{
fBoundaryProcs[EtchedTyvekAirReflection] += 1;
}
void AddEtchedVM2000AirReflection(void)
{
fBoundaryProcs[EtchedVM2000AirReflection] += 1;
}
void AddEtchedVM2000GlueReflection(void)
{
fBoundaryProcs[EtchedVM2000GlueReflection] += 1;
}
void AddDichroic(void) {fBoundaryProcs[Dichroic] += 1;}
void AddGroundLumirrorAirReflection(void)
{
fBoundaryProcs[GroundLumirrorAirReflection] += 1;
}
void AddGroundLumirrorGlueReflection(void)
{
fBoundaryProcs[GroundLumirrorGlueReflection] += 1;
}
void AddGroundAirReflection(void)
{
fBoundaryProcs[GroundAirReflection] += 1;
}
void AddGroundTeflonAirReflection(void)
{
fBoundaryProcs[GroundTeflonAirReflection] += 1;
}
void AddGroundTiOAirReflection(void)
{
fBoundaryProcs[GroundTiOAirReflection] += 1;
}
void AddGroundTyvekAirReflection(void)
{
fBoundaryProcs[GroundTyvekAirReflection] += 1;
}
void AddGroundVM2000AirReflection(void)
{
fBoundaryProcs[GroundVM2000AirReflection] += 1;
}
void AddGroundVM2000GlueReflection(void)
{
fBoundaryProcs[GroundVM2000GlueReflection] += 1;
}
virtual void Merge(const G4Run*);
void AddDichroic(void) { fBoundaryProcs[Dichroic] += 1; }
void EndOfRun();
virtual void Merge(const G4Run*);
private:
// primary particle
G4ParticleDefinition* fParticle;
G4double fEkin;
void EndOfRun();
G4double fCerenkovEnergy;
G4double fScintEnergy;
G4double fWLSAbsorptionEnergy;
G4double fWLSEmissionEnergy;
G4double fWLS2AbsorptionEnergy;
G4double fWLS2EmissionEnergy;
private:
// primary particle
G4ParticleDefinition* fParticle;
G4double fEkin;
G4bool fPolarized;
G4double fPolarization;
// number of particles
G4int fCerenkovCount;
G4int fScintCount;
G4int fWLSAbsorptionCount;
G4int fWLSEmissionCount;
G4int fWLS2AbsorptionCount;
G4int fWLS2EmissionCount;
// number of events
G4int fRayleighCount;
// non-boundary processes
G4int fOpAbsorption;
G4double fCerenkovEnergy;
G4double fScintEnergy;
G4double fWLSAbsorptionEnergy;
G4double fWLSEmissionEnergy;
G4double fWLS2AbsorptionEnergy;
G4double fWLS2EmissionEnergy;
// prior to boundary:
G4int fOpAbsorptionPrior;
// number of particles
G4int fCerenkovCount;
G4int fScintCount;
G4int fWLSAbsorptionCount;
G4int fWLSEmissionCount;
G4int fWLS2AbsorptionCount;
G4int fWLS2EmissionCount;
// number of events
G4int fRayleighCount;
// boundary proc
std::vector<G4int> fBoundaryProcs;
// non-boundary processes
G4int fOpAbsorption;
G4int fTotalSurface;
// prior to boundary:
G4int fOpAbsorptionPrior;
// boundary proc
std::vector<G4int> fBoundaryProcs;
G4int fTotalSurface;
};
#endif /* Run_h */
@@ -27,7 +27,7 @@
/// \brief Definition of the RunAction class
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,31 +36,27 @@
#include "globals.hh"
#include "G4UserRunAction.hh"
// #include "Run.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Timer;
class Run;
class HistoManager;
class PrimaryGeneratorAction;
class RunAction : public G4UserRunAction
{
public:
RunAction(PrimaryGeneratorAction* = nullptr);
virtual ~RunAction();
public:
RunAction(PrimaryGeneratorAction* = nullptr);
virtual ~RunAction();
virtual G4Run* GenerateRun();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
virtual G4Run* GenerateRun();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
private:
G4Timer* fTimer;
Run* fRun;
HistoManager* fHistoManager;
PrimaryGeneratorAction* fPrimary;
private:
Run* fRun;
HistoManager* fHistoManager;
PrimaryGeneratorAction* fPrimary;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -32,21 +32,20 @@
#ifndef SteppingAction_h
#define SteppingAction_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
#include "G4UserSteppingAction.hh"
class SteppingAction : public G4UserSteppingAction
{
public:
SteppingAction();
virtual ~SteppingAction();
public:
SteppingAction();
virtual ~SteppingAction();
// method from the base class
virtual void UserSteppingAction(const G4Step*);
// method from the base class
virtual void UserSteppingAction(const G4Step*);
private:
G4int fVerbose;
private:
G4int fVerbose;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -33,48 +33,47 @@
#define TrackInformation_h 1
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4ParticleDefinition.hh"
#include "G4Track.hh"
#include "G4Allocator.hh"
#include "G4VUserTrackInformation.hh"
class TrackInformation : public G4VUserTrackInformation
class G4Track;
class TrackInformation : public G4VUserTrackInformation
{
public:
public:
TrackInformation();
TrackInformation(const G4Track* aTrack);
TrackInformation(const TrackInformation* aTrackInfo);
virtual ~TrackInformation();
inline void *operator new(size_t);
inline void operator delete(void *aTrackInfo);
TrackInformation& operator =(const TrackInformation& right);
inline void* operator new(size_t);
inline void operator delete(void* aTrackInfo);
TrackInformation& operator=(const TrackInformation& right);
void SetSourceTrackInformation(const G4Track* aTrack);
virtual void Print() const;
public:
inline G4bool GetIsFirstTankX() const {return fFirstTankX;}
inline void SetIsFirstTankX(G4bool b) {fFirstTankX = b;}
public:
inline G4bool GetIsFirstTankX() const { return fFirstTankX; }
inline void SetIsFirstTankX(G4bool b) { fFirstTankX = b; }
private:
G4bool fFirstTankX;
private:
G4bool fFirstTankX;
};
extern G4ThreadLocal
G4Allocator<TrackInformation> * aTrackInformationAllocator;
extern G4ThreadLocal G4Allocator<TrackInformation>* aTrackInformationAllocator;
inline void* TrackInformation::operator new(size_t)
{
if(!aTrackInformationAllocator)
aTrackInformationAllocator = new G4Allocator<TrackInformation>;
return (void*)aTrackInformationAllocator->MallocSingle();
return (void*) aTrackInformationAllocator->MallocSingle();
}
inline void TrackInformation::operator delete(void *aTrackInfo)
{ aTrackInformationAllocator->FreeSingle((TrackInformation*)aTrackInfo);}
inline void TrackInformation::operator delete(void* aTrackInfo)
{
aTrackInformationAllocator->FreeSingle((TrackInformation*) aTrackInfo);
}
#endif
@@ -26,7 +26,7 @@
/// \file optical/OpNovice2/include/TrackingAction.hh
/// \brief Definition of the TrackingAction class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
@@ -35,15 +35,14 @@
#include "G4UserTrackingAction.hh"
class TrackingAction : public G4UserTrackingAction
class TrackingAction : public G4UserTrackingAction
{
public:
public:
TrackingAction();
virtual ~TrackingAction(){};
virtual void PreUserTrackingAction(const G4Track*);
virtual void PostUserTrackingAction(const G4Track*);
};
#endif
@@ -1,5 +1,7 @@
/control/verbose 2
/tracking/verbose 0
/process/optical/verbose 1
/run/verbose 1
/control/cout/ignoreThreadsExcept 0
/opnovice2/boxMaterial G4_BGO
@@ -36,6 +38,9 @@
/opnovice2/worldProperty RINDEX 0.000002 1.01 0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 100 0.000005 100 0.000008 100
## no scintillation in the world, but we want to exercise
## this macro command
/opnovice2/worldConstProperty SCINTILLATIONTIMECONSTANT1 1
/process/optical/processActivation Cerenkov false
/process/optical/processActivation OpAbsorption true
@@ -45,8 +50,6 @@
/process/optical/processActivation OpMieHG false
/process/optical/processActivation OpWLS false
/process/optical/verbose 0
/process/optical/scintillation/setEnhancedTimeConstants true
/process/optical/scintillation/setYieldFactor 10
#/process/optical/scintillation/setExcitationRatio .5
@@ -62,12 +65,8 @@
/process/optical/scintillation/verbose 0
/analysis/setFileName scint_by_particle
/analysis/h1/set 2 100 0 10
/analysis/h1/setXaxis 2 "Energy [eV]"
/analysis/h1/setYaxis 2 "Number of photons"
/analysis/h1/set 3 400 0 200
/analysis/h1/setXaxis 3 "Creation time [ns]"
/analysis/h1/setYaxis 3 "Number of photons"
/analysis/h1/set 2 100 0 10 # eV
/analysis/h1/set 3 400 0 200 # ns
#
/gun/particle e-
@@ -28,6 +28,7 @@
/// \brief Implementation of the ActionInitialization class
#include "ActionInitialization.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "SteppingAction.hh"
@@ -36,13 +37,12 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ActionInitialization::ActionInitialization()
: G4VUserActionInitialization()
: G4VUserActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ActionInitialization::~ActionInitialization()
{}
ActionInitialization::~ActionInitialization() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -63,4 +63,3 @@ void ActionInitialization::Build() const
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -32,6 +32,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
#include "G4NistManager.hh"
@@ -49,11 +50,11 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction(),
fDetectorMessenger(nullptr)
: G4VUserDetectorConstruction()
, fDetectorMessenger(nullptr)
{
fExpHall_x = fExpHall_y = fExpHall_z = 10.0*m;
fTank_x = fTank_y = fTank_z = 1.0*m;
fExpHall_x = fExpHall_y = fExpHall_z = 10.0 * m;
fTank_x = fTank_y = fTank_z = 1.0 * m;
fTank = nullptr;
@@ -78,8 +79,11 @@ DetectorConstruction::DetectorConstruction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::~DetectorConstruction()
{
DetectorConstruction::~DetectorConstruction() {
delete fTankMPT;
delete fWorldMPT;
delete fSurfaceMPT;
delete fSurface;
delete fDetectorMessenger;
}
@@ -88,7 +92,7 @@ DetectorConstruction::~DetectorConstruction()
G4VPhysicalVolume* DetectorConstruction::Construct()
{
fTankMaterial->SetMaterialPropertiesTable(fTankMPT);
fTankMaterial->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
fTankMaterial->GetIonisation()->SetBirksConstant(0.126 * mm / MeV);
fWorldMaterial->SetMaterialPropertiesTable(fWorldMPT);
@@ -96,39 +100,39 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
// The experimental Hall
G4Box* world_box = new G4Box("World", fExpHall_x, fExpHall_y, fExpHall_z);
fWorld_LV
= new G4LogicalVolume(world_box, fWorldMaterial, "World", 0, 0, 0);
fWorld_LV = new G4LogicalVolume(world_box, fWorldMaterial, "World", 0, 0, 0);
G4VPhysicalVolume* world_PV
= new G4PVPlacement(0, G4ThreeVector(), fWorld_LV, "World", 0, false, 0);
G4VPhysicalVolume* world_PV =
new G4PVPlacement(0, G4ThreeVector(), fWorld_LV, "World", 0, false, 0);
// The tank
G4Box* tank_box = new G4Box("Tank", fTank_x, fTank_y, fTank_z);
fTank_LV
= new G4LogicalVolume(tank_box, fTankMaterial, "Tank", 0, 0, 0);
fTank_LV = new G4LogicalVolume(tank_box, fTankMaterial, "Tank", 0, 0, 0);
fTank
= new G4PVPlacement(0, G4ThreeVector(), fTank_LV, "Tank",
fWorld_LV, false, 0);
fTank = new G4PVPlacement(0, G4ThreeVector(), fTank_LV, "Tank", fWorld_LV,
false, 0);
// ------------- Surface --------------
G4LogicalBorderSurface* surface =
new G4LogicalBorderSurface("Surface",
fTank, world_PV, fSurface);
new G4LogicalBorderSurface("Surface", fTank, world_PV, fSurface);
G4OpticalSurface* opticalSurface = dynamic_cast <G4OpticalSurface*>
(surface->GetSurface(fTank,world_PV)->GetSurfaceProperty());
G4OpticalSurface* opticalSurface = dynamic_cast<G4OpticalSurface*>(
surface->GetSurface(fTank, world_PV)->GetSurfaceProperty());
G4cout << "****** opticalSurface->DumpInfo:" << G4endl;
if (opticalSurface) { opticalSurface->DumpInfo(); }
if(opticalSurface)
{
opticalSurface->DumpInfo();
}
G4cout << "****** end of opticalSurface->DumpInfo" << G4endl;
return world_PV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetSurfaceSigmaAlpha(G4double v) {
void DetectorConstruction::SetSurfaceSigmaAlpha(G4double v)
{
fSurface->SetSigmaAlpha(v);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
@@ -137,91 +141,101 @@ void DetectorConstruction::SetSurfaceSigmaAlpha(G4double v) {
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetSurfacePolish(G4double v) {
void DetectorConstruction::SetSurfacePolish(G4double v)
{
fSurface->SetPolish(v);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
G4cout << "Surface polish set to: " << fSurface->GetPolish()
<< G4endl;
G4cout << "Surface polish set to: " << fSurface->GetPolish() << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddTankMPV(const char* c,
G4MaterialPropertyVector* mpv) {
fTankMPT->AddProperty(c, mpv);
void DetectorConstruction::AddTankMPV(const G4String& prop,
G4MaterialPropertyVector* mpv)
{
fTankMPT->AddProperty(prop, mpv);
G4cout << "The MPT for the box is now: " << G4endl;
fTankMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddWorldMPV(const char* c,
G4MaterialPropertyVector* mpv) {
fWorldMPT->AddProperty(c, mpv);
void DetectorConstruction::AddWorldMPV(const G4String& prop,
G4MaterialPropertyVector* mpv)
{
fWorldMPT->AddProperty(prop, mpv);
G4cout << "The MPT for the world is now: " << G4endl;
fWorldMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddSurfaceMPV(const char* c,
G4MaterialPropertyVector* mpv) {
fSurfaceMPT->AddProperty(c, mpv);
void DetectorConstruction::AddSurfaceMPV(const G4String& prop,
G4MaterialPropertyVector* mpv)
{
fSurfaceMPT->AddProperty(prop, mpv);
G4cout << "The MPT for the surface is now: " << G4endl;
fSurfaceMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddTankMPC(const char* c, G4double v) {
fTankMPT->AddConstProperty(c, v);
void DetectorConstruction::AddTankMPC(const G4String& prop, G4double v)
{
fTankMPT->AddConstProperty(prop, v);
G4cout << "The MPT for the box is now: " << G4endl;
fTankMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddWorldMPC(const char* c, G4double v) {
fWorldMPT->AddConstProperty(c, v);
void DetectorConstruction::AddWorldMPC(const G4String& prop, G4double v)
{
fWorldMPT->AddConstProperty(prop, v);
G4cout << "The MPT for the world is now: " << G4endl;
fWorldMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddSurfaceMPC(const char* c, G4double v) {
fSurfaceMPT->AddConstProperty(c, v);
void DetectorConstruction::AddSurfaceMPC(const G4String& prop, G4double v)
{
fSurfaceMPT->AddConstProperty(prop, v);
G4cout << "The MPT for the surface is now: " << G4endl;
fSurfaceMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetWorldMaterial(const G4String& mat) {
void DetectorConstruction::SetWorldMaterial(const G4String& mat)
{
G4Material* pmat = G4NistManager::Instance()->FindOrBuildMaterial(mat);
if (pmat && fWorldMaterial != pmat) {
if(pmat && fWorldMaterial != pmat)
{
fWorldMaterial = pmat;
if (fWorld_LV) {
if(fWorld_LV)
{
fWorld_LV->SetMaterial(fWorldMaterial);
fWorldMaterial->SetMaterialPropertiesTable(fWorldMPT);
}
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
G4cout << "World material set to " << fWorldMaterial->GetName()
<< G4endl;
G4cout << "World material set to " << fWorldMaterial->GetName() << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetTankMaterial(const G4String& mat) {
void DetectorConstruction::SetTankMaterial(const G4String& mat)
{
G4Material* pmat = G4NistManager::Instance()->FindOrBuildMaterial(mat);
if (pmat && fTankMaterial != pmat) {
if(pmat && fTankMaterial != pmat)
{
fTankMaterial = pmat;
if (fTank_LV) {
if(fTank_LV)
{
fTank_LV->SetMaterial(fTankMaterial);
fTankMaterial->SetMaterialPropertiesTable(fTankMPT);
fTankMaterial->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
fTankMaterial->GetIonisation()->SetBirksConstant(0.126 * mm / MeV);
}
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
G4cout << "Tank material set to " << fTankMaterial->GetName()
<< G4endl;
G4cout << "Tank material set to " << fTankMaterial->GetName() << G4endl;
}
}
@@ -32,25 +32,26 @@
#include "DetectorMessenger.hh"
#include "DetectorConstruction.hh"
#include "G4OpticalSurface.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcommand.hh"
#include "G4UIdirectory.hh"
#include "G4UIparameter.hh"
#include <sstream>
#include <iostream>
#include "G4OpticalSurface.hh"
#include "DetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcommand.hh"
#include "G4UIparameter.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
:G4UImessenger(),fDetector(Det)
DetectorMessenger::DetectorMessenger(DetectorConstruction* Det)
: G4UImessenger()
, fDetector(Det)
{
fOpticalDir = new G4UIdirectory("/opnovice2/");
fOpticalDir->SetGuidance("Parameters for optical simulation.");
@@ -65,8 +66,7 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
fSurfaceFinishCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
fSurfaceFinishCmd->SetToBeBroadcasted(false);
fSurfaceModelCmd =
new G4UIcmdWithAString("/opnovice2/surfaceModel", this);
fSurfaceModelCmd = new G4UIcmdWithAString("/opnovice2/surfaceModel", this);
fSurfaceModelCmd->SetGuidance("surface model.");
fSurfaceModelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
fSurfaceModelCmd->SetToBeBroadcasted(false);
@@ -78,8 +78,7 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
fSurfaceSigmaAlphaCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
fSurfaceSigmaAlphaCmd->SetToBeBroadcasted(false);
fSurfacePolishCmd =
new G4UIcmdWithADouble("/opnovice2/surfacePolish", this);
fSurfacePolishCmd = new G4UIcmdWithADouble("/opnovice2/surfacePolish", this);
fSurfacePolishCmd->SetGuidance("surface polish");
fSurfacePolishCmd->SetGuidance(" parameter (for Glisur model).");
fSurfacePolishCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
@@ -129,21 +128,20 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
new G4UIcmdWithAString("/opnovice2/worldConstProperty", this);
fWorldMatPropConstCmd->SetGuidance("Set material constant property");
fWorldMatPropConstCmd->SetGuidance(" for the world.");
fWorldMatPropConstCmd->
AvailableForStates(G4State_PreInit, G4State_Idle);
fWorldMatPropConstCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
fWorldMatPropConstCmd->SetToBeBroadcasted(false);
fWorldMaterialCmd = new G4UIcmdWithAString("/opnovice2/worldMaterial", this);
fWorldMaterialCmd->SetGuidance("Set material of world.");
fWorldMaterialCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
fWorldMaterialCmd->SetToBeBroadcasted(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::~DetectorMessenger()
{
delete fOpticalDir;
delete fSurfaceFinishCmd;
delete fSurfaceTypeCmd;
delete fSurfaceModelCmd;
@@ -161,189 +159,245 @@ DetectorMessenger::~DetectorMessenger()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
// FINISH
if (command == fSurfaceFinishCmd) {
if (newValue == "polished") {
void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
// FINISH
if(command == fSurfaceFinishCmd)
{
if(newValue == "polished")
{
fDetector->SetSurfaceFinish(polished);
}
else if (newValue == "polishedfrontpainted") {
else if(newValue == "polishedfrontpainted")
{
fDetector->SetSurfaceFinish(polishedfrontpainted);
}
else if (newValue == "polishedbackpainted") {
else if(newValue == "polishedbackpainted")
{
fDetector->SetSurfaceFinish(polishedbackpainted);
}
else if (newValue == "ground") {
else if(newValue == "ground")
{
fDetector->SetSurfaceFinish(ground);
}
else if (newValue == "groundfrontpainted") {
else if(newValue == "groundfrontpainted")
{
fDetector->SetSurfaceFinish(groundfrontpainted);
}
else if (newValue == "groundbackpainted") {
else if(newValue == "groundbackpainted")
{
fDetector->SetSurfaceFinish(groundbackpainted);
}
else if (newValue == "polishedlumirrorair") {
else if(newValue == "polishedlumirrorair")
{
fDetector->SetSurfaceFinish(polishedlumirrorair);
}
else if (newValue == "polishedlumirrorglue") {
else if(newValue == "polishedlumirrorglue")
{
fDetector->SetSurfaceFinish(polishedlumirrorglue);
}
else if (newValue == "polishedair") {
else if(newValue == "polishedair")
{
fDetector->SetSurfaceFinish(polishedair);
}
else if (newValue == "polishedteflonair") {
else if(newValue == "polishedteflonair")
{
fDetector->SetSurfaceFinish(polishedteflonair);
}
else if (newValue == "polishedtioair") {
else if(newValue == "polishedtioair")
{
fDetector->SetSurfaceFinish(polishedtioair);
}
else if (newValue == "polishedtyvekair") {
else if(newValue == "polishedtyvekair")
{
fDetector->SetSurfaceFinish(polishedtyvekair);
}
else if (newValue == "polishedvm2000air") {
else if(newValue == "polishedvm2000air")
{
fDetector->SetSurfaceFinish(polishedvm2000air);
}
else if (newValue == "polishedvm2000glue") {
else if(newValue == "polishedvm2000glue")
{
fDetector->SetSurfaceFinish(polishedvm2000glue);
}
else if (newValue == "etchedlumirrorair") {
else if(newValue == "etchedlumirrorair")
{
fDetector->SetSurfaceFinish(etchedlumirrorair);
}
else if (newValue == "etchedlumirrorglue") {
else if(newValue == "etchedlumirrorglue")
{
fDetector->SetSurfaceFinish(etchedlumirrorglue);
}
else if (newValue == "etchedair") {
else if(newValue == "etchedair")
{
fDetector->SetSurfaceFinish(etchedair);
}
else if (newValue == "etchedteflonair") {
else if(newValue == "etchedteflonair")
{
fDetector->SetSurfaceFinish(etchedteflonair);
}
else if (newValue == "etchedtioair") {
else if(newValue == "etchedtioair")
{
fDetector->SetSurfaceFinish(etchedtioair);
}
else if (newValue == "etchedtyvekair") {
else if(newValue == "etchedtyvekair")
{
fDetector->SetSurfaceFinish(etchedtyvekair);
}
else if (newValue == "etchedvm2000air") {
else if(newValue == "etchedvm2000air")
{
fDetector->SetSurfaceFinish(etchedvm2000air);
}
else if (newValue == "etchedvm2000glue") {
else if(newValue == "etchedvm2000glue")
{
fDetector->SetSurfaceFinish(etchedvm2000glue);
}
else if (newValue == "groundlumirrorair") {
else if(newValue == "groundlumirrorair")
{
fDetector->SetSurfaceFinish(groundlumirrorair);
}
else if (newValue == "groundlumirrorglue") {
else if(newValue == "groundlumirrorglue")
{
fDetector->SetSurfaceFinish(groundlumirrorglue);
}
else if (newValue == "groundair") {
else if(newValue == "groundair")
{
fDetector->SetSurfaceFinish(groundair);
}
else if (newValue == "groundteflonair") {
else if(newValue == "groundteflonair")
{
fDetector->SetSurfaceFinish(groundteflonair);
}
else if (newValue == "groundtioair") {
else if(newValue == "groundtioair")
{
fDetector->SetSurfaceFinish(groundtioair);
}
else if (newValue == "groundtyvekair") {
else if(newValue == "groundtyvekair")
{
fDetector->SetSurfaceFinish(groundtyvekair);
}
else if (newValue == "groundvm2000air") {
else if(newValue == "groundvm2000air")
{
fDetector->SetSurfaceFinish(groundvm2000air);
}
else if (newValue == "groundvm2000glue") {
else if(newValue == "groundvm2000glue")
{
fDetector->SetSurfaceFinish(groundvm2000glue);
}
// for Davis model
else if (newValue == "Rough_LUT") {
else if(newValue == "Rough_LUT")
{
fDetector->SetSurfaceFinish(Rough_LUT);
}
else if (newValue == "RoughTeflon_LUT") {
else if(newValue == "RoughTeflon_LUT")
{
fDetector->SetSurfaceFinish(RoughTeflon_LUT);
}
else if (newValue == "RoughESR_LUT") {
else if(newValue == "RoughESR_LUT")
{
fDetector->SetSurfaceFinish(RoughESR_LUT);
}
else if (newValue == "RoughESRGrease_LUT") {
else if(newValue == "RoughESRGrease_LUT")
{
fDetector->SetSurfaceFinish(RoughESRGrease_LUT);
}
else if (newValue == "Polished_LUT") {
else if(newValue == "Polished_LUT")
{
fDetector->SetSurfaceFinish(Polished_LUT);
}
else if (newValue == "PolishedTeflon_LUT") {
else if(newValue == "PolishedTeflon_LUT")
{
fDetector->SetSurfaceFinish(PolishedTeflon_LUT);
}
else if (newValue == "PolishedESR_LUT") {
else if(newValue == "PolishedESR_LUT")
{
fDetector->SetSurfaceFinish(PolishedESR_LUT);
}
else if (newValue == "PolishedESRGrease_LUT") {
else if(newValue == "PolishedESRGrease_LUT")
{
fDetector->SetSurfaceFinish(PolishedESRGrease_LUT);
}
else if (newValue == "Detector_LUT") {
else if(newValue == "Detector_LUT")
{
fDetector->SetSurfaceFinish(Detector_LUT);
}
else {
else
{
G4ExceptionDescription ed;
ed << "Invalid surface finish: " << newValue;
G4Exception("DetectorMessenger", "OpNovice2_003", FatalException,ed);
G4Exception("DetectorMessenger", "OpNovice2_003", FatalException, ed);
}
}
// MODEL
else if (command == fSurfaceModelCmd) {
if (newValue == "glisur") {
else if(command == fSurfaceModelCmd)
{
if(newValue == "glisur")
{
fDetector->SetSurfaceModel(glisur);
}
else if (newValue == "unified") {
else if(newValue == "unified")
{
fDetector->SetSurfaceModel(unified);
}
else if (newValue == "LUT") {
else if(newValue == "LUT")
{
fDetector->SetSurfaceModel(LUT);
}
else if (newValue == "DAVIS") {
else if(newValue == "DAVIS")
{
fDetector->SetSurfaceModel(DAVIS);
}
else if (newValue == "dichroic") {
else if(newValue == "dichroic")
{
fDetector->SetSurfaceModel(dichroic);
}
else {
else
{
G4ExceptionDescription ed;
ed << "Invalid surface model: " << newValue;
G4Exception("DetectorMessenger", "ONovice2_001",
FatalException,ed);
G4Exception("DetectorMessenger", "ONovice2_001", FatalException, ed);
}
}
// TYPE
else if (command == fSurfaceTypeCmd) {
if (newValue == "dielectric_metal") {
else if(command == fSurfaceTypeCmd)
{
if(newValue == "dielectric_metal")
{
fDetector->SetSurfaceType(dielectric_metal);
}
else if (newValue == "dielectric_dielectric") {
else if(newValue == "dielectric_dielectric")
{
fDetector->SetSurfaceType(dielectric_dielectric);
}
else if (newValue == "dielectric_LUT") {
else if(newValue == "dielectric_LUT")
{
fDetector->SetSurfaceType(dielectric_LUT);
}
else if (newValue == "dielectric_LUTDAVIS") {
else if(newValue == "dielectric_LUTDAVIS")
{
fDetector->SetSurfaceType(dielectric_LUTDAVIS);
}
else {
else
{
G4ExceptionDescription ed;
ed << "Invalid surface type: " << newValue;
G4Exception("DetectorMessenger", "OpNovice2_002", FatalException,ed);
G4Exception("DetectorMessenger", "OpNovice2_002", FatalException, ed);
}
}
else if (command == fSurfaceSigmaAlphaCmd) {
else if(command == fSurfaceSigmaAlphaCmd)
{
fDetector->SetSurfaceSigmaAlpha(
G4UIcmdWithADouble::GetNewDoubleValue(newValue));
}
else if (command == fSurfacePolishCmd) {
else if(command == fSurfacePolishCmd)
{
fDetector->SetSurfacePolish(
G4UIcmdWithADouble::GetNewDoubleValue(newValue));
}
else if (command == fTankMatPropVectorCmd) {
else if(command == fTankMatPropVectorCmd)
{
// got a string. need to convert it to physics vector.
// string format is property name, then pairs of energy, value
// specify units for each value, eg 3.0*eV
@@ -352,64 +406,73 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
std::istringstream instring(newValue);
G4String prop;
instring >> prop;
while (instring) {
while(instring)
{
G4String tmp;
instring >> tmp;
if (tmp == "") { break; }
if(tmp == "")
{
break;
}
G4double en = G4UIcommand::ConvertToDouble(tmp);
instring >> tmp;
G4double val;
val = G4UIcommand::ConvertToDouble(tmp);
G4double val = G4UIcommand::ConvertToDouble(tmp);
mpv->InsertValues(en, val);
}
const char* c = prop.c_str();
fDetector->AddTankMPV(c, mpv);
fDetector->AddTankMPV(prop, mpv);
}
else if (command == fWorldMatPropVectorCmd) {
else if(command == fWorldMatPropVectorCmd)
{
// Convert string to physics vector
// string format is property name, then pairs of energy, value
G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector();
std::istringstream instring(newValue);
G4String prop;
instring >> prop;
while (instring) {
while(instring)
{
G4String tmp;
instring >> tmp;
if (tmp == "") { break; }
if(tmp == "")
{
break;
}
G4double en = G4UIcommand::ConvertToDouble(tmp);
instring >> tmp;
G4double val;
val = G4UIcommand::ConvertToDouble(tmp);
G4double val = G4UIcommand::ConvertToDouble(tmp);
mpv->InsertValues(en, val);
}
const char* c = prop.c_str();
fDetector->AddWorldMPV(c, mpv);
}
fDetector->AddWorldMPV(prop, mpv);
}
else if (command == fSurfaceMatPropVectorCmd) {
else if(command == fSurfaceMatPropVectorCmd)
{
// Convert string to physics vector
// string format is property name, then pairs of energy, value
// string format is property name, then pairs of energy, value
// space delimited
G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector();
G4cout << newValue << G4endl;
std::istringstream instring(newValue);
G4String prop;
instring >> prop;
while (instring) {
while(instring)
{
G4String tmp;
instring >> tmp;
if (tmp == "") { break; }
if(tmp == "")
{
break;
}
G4double en = G4UIcommand::ConvertToDouble(tmp);
instring >> tmp;
G4double val;
val = G4UIcommand::ConvertToDouble(tmp);
G4double val = G4UIcommand::ConvertToDouble(tmp);
mpv->InsertValues(en, val);
}
const char* c = prop.c_str();
fDetector->AddSurfaceMPV(c, mpv);
}
fDetector->AddSurfaceMPV(prop, mpv);
}
else if (command == fTankMatPropConstCmd) {
else if(command == fTankMatPropConstCmd)
{
// Convert string to physics vector
// string format is property name, then value
// space delimited
@@ -419,10 +482,10 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
instring >> prop;
instring >> tmp;
G4double val = G4UIcommand::ConvertToDouble(tmp);
const char* c = prop.c_str();
fDetector->AddTankMPC(c, val);
fDetector->AddTankMPC(prop, val);
}
else if (command == fWorldMatPropConstCmd) {
else if(command == fWorldMatPropConstCmd)
{
// Convert string to physics vector
// string format is property name, then value
// space delimited
@@ -432,10 +495,10 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
instring >> prop;
instring >> tmp;
G4double val = G4UIcommand::ConvertToDouble(tmp);
const char* c = prop.c_str();
fDetector->AddTankMPC(c, val);
fDetector->AddWorldMPC(prop, val);
}
else if (command == fSurfaceMatPropConstCmd) {
else if(command == fSurfaceMatPropConstCmd)
{
// Convert string to physics vector
// string format is property name, then value
// space delimited
@@ -445,13 +508,14 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
instring >> prop;
instring >> tmp;
G4double val = G4UIcommand::ConvertToDouble(tmp);
const char* c = prop.c_str();
fDetector->AddSurfaceMPC(c, val);
fDetector->AddSurfaceMPC(prop, val);
}
else if (command == fWorldMaterialCmd) {
else if(command == fWorldMaterialCmd)
{
fDetector->SetWorldMaterial(newValue);
}
else if (command == fTankMaterialCmd) {
else if(command == fTankMaterialCmd)
{
fDetector->SetTankMaterial(newValue);
}
}
@@ -27,11 +27,12 @@
/// \brief Implementation of the HistoManager class
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "HistoManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,10 +45,7 @@ HistoManager::HistoManager()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::~HistoManager()
{
delete G4AnalysisManager::Instance();
}
HistoManager::~HistoManager() { delete G4AnalysisManager::Instance(); }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,48 +54,75 @@ void HistoManager::Book()
// Create or get analysis manager
// The choice of analysis technology is done via selection of a namespace
// in HistoManager.hh
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->SetFileName(fFileName);
analysisManager->SetVerboseLevel(1);
analysisManager->SetActivation(true); // enable inactivation of histograms
G4AnalysisManager* analysisMan = G4AnalysisManager::Instance();
analysisMan->SetFileName(fFileName);
analysisMan->SetVerboseLevel(1);
analysisMan->SetActivation(true); // enable inactivation of histograms
// Define histogram indices, titles
G4int maxHisto = 15;
G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"10","11","12","13","14","15","16","17","18","19" };
// TODO change throughout code
G4String title[] = {
"dummy", // 0
"Cerenkov spectrum", // 1
"scintillation spectrum", // 2
"scintillation photons creation time", // 3
"WLS absorption spectrum", // 4
"WLS emission spectrum", // 5
"WLS emission time", // 6
"WLS2 absorption spectrum", // 7
"WLS2 emission spectrum", // 8
"WLS2 emission time", // 9
"boundary process status", //10
"X momentum dir of backward-going photons", //11
"Y momentum dir of backward-going photons", //12
"Z momentum dir of backward-going photons", //13
"X momentum dir of forward-going photons", //14
"Y momentum dir of forward-going photons", //15
"Z momentum dir of forward-going photons", //16
"X momentum dir of Fresnel-refracted photons", //17
"Y momentum dir of Fresnel-refracted photons", //18
"Z momentum dir of Fresnel-refracted photons", //19
};
// Default values (to be reset via /analysis/h1/set command)
G4int nbins = 100;
G4double vmin = 0.;
G4double vmax = 100.;
// Define histograms
// Default values (to be reset via /analysis/h1/set command)
G4int n = 100;
G4double xmn = 0.;
G4double xmx = 100.;
// Create all histograms as inactivated
for (G4int k=0; k <= maxHisto; ++k) {
G4int ih = analysisManager->CreateH1(id[k], title[k], nbins, vmin, vmax);
analysisManager->SetH1Activation(ih, false);
// 0
analysisMan->CreateH1("0", "dummy", n, xmn, xmx);
// 1
analysisMan->CreateH1("Cerenkov spectrum", "Cerenkov spectrum", n, xmn, xmx);
// 2
analysisMan->CreateH1("Scintillation spectrum", "Scintillation spectrum", n,
xmn, xmx);
// 3
analysisMan->CreateH1("Scintillation time",
"scintillation photons creation time", n, xmn, xmx);
// 4
analysisMan->CreateH1("WLS abs", "WLS absorption spectrum", n, xmn, xmx);
// 5
analysisMan->CreateH1("WLS em", "WLS emission spectrum", n, xmn, xmx);
// 6
analysisMan->CreateH1("WLS time", "WLS emission time", n, xmn, xmx);
// 7
analysisMan->CreateH1("WLS2 abs", "WLS2 absorption spectrum", n, xmn, xmx);
// 8
analysisMan->CreateH1("WLS2 em", "WLS2 emission spectrum", n, xmn, xmx);
// 9
analysisMan->CreateH1("WLS2 time", "WLS2 emission time", n, xmn, xmx);
// 10
analysisMan->CreateH1("bdry status", "boundary process status", n, xmn, xmx);
// 11
analysisMan->CreateH1(
"x_backward", "X momentum dir of backward-going photons", n, xmn, xmx);
// 12
analysisMan->CreateH1(
"y_backward", "Y momentum dir of backward-going photons", n, xmn, xmx);
// 13
analysisMan->CreateH1(
"z_backward", "Z momentum dir of backward-going photons", n, xmn, xmx);
// 14
analysisMan->CreateH1("x_forward", "X momentum dir of forward-going photons",
n, xmn, xmx);
// 15
analysisMan->CreateH1("y_forward", "Y momentum dir of forward-going photons",
n, xmn, xmx);
// 16
analysisMan->CreateH1("z_forward", "Z momentum dir of forward-going photons",
n, xmn, xmx);
// 17
analysisMan->CreateH1(
"x_fresnel", "X momentum dir of Fresnel-refracted photons", n, xmn, xmx);
// 18
analysisMan->CreateH1(
"y_fresnel", "Y momentum dir of Fresnel-refracted photons", n, xmn, xmx);
// 19
analysisMan->CreateH1(
"z_fresnel", "Z momentum dir of Fresnel-refracted photons", n, xmn, xmx);
// 20
analysisMan->CreateH1("Transmitted", "Transmitted photons", n, xmn, xmx);
// 21
analysisMan->CreateH1("Reflected", "Reflected photons", n, xmn, xmx);
for(G4int i = 0; i < analysisMan->GetNofH1s(); ++i)
{
analysisMan->SetH1Activation(i, false);
}
}
@@ -32,38 +32,43 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PrimaryGeneratorAction.hh"
#include "PrimaryGeneratorMessenger.hh"
#include "Randomize.hh"
#include "G4Event.hh"
#include "G4OpticalPhoton.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4SystemOfUnits.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::PrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
fParticleGun(0)
: G4VUserPrimaryGeneratorAction()
, fParticleGun(0)
{
G4int n_particle = 1;
fParticleGun = new G4ParticleGun(n_particle);
fParticleGun = new G4ParticleGun(n_particle);
//create a messenger for this class
// create a messenger for this class
fGunMessenger = new PrimaryGeneratorMessenger(this);
//default kinematic
fRandomDirection = false;
fPolarized = false;
fPolarization = 0.;
// default kinematic
//
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4ParticleDefinition* particle = particleTable->FindParticle("e+");
fParticleGun->SetParticleDefinition(particle);
fParticleGun->SetParticleTime(0.0*ns);
fParticleGun->SetParticlePosition(G4ThreeVector(0.0*cm,0.0*cm,0.0*cm));
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
fParticleGun->SetParticleEnergy(500.0*keV);
fParticleGun->SetParticleTime(0.0 * ns);
fParticleGun->SetParticlePosition(
G4ThreeVector(0.0 * cm, 0.0 * cm, 0.0 * cm));
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1., 0., 0.));
fParticleGun->SetParticleEnergy(500.0 * keV);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -78,6 +83,24 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction()
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
if(fRandomDirection)
{
G4double theta = CLHEP::halfpi * G4UniformRand();
G4double phi = CLHEP::twopi * G4UniformRand();
G4double x = std::cos(theta);
G4double y = std::sin(theta) * std::sin(phi);
G4double z = std::sin(theta) * std::cos(phi);
G4ThreeVector dir(x, y, z);
fParticleGun->SetParticleMomentumDirection(dir);
}
if(fParticleGun->GetParticleDefinition() ==
G4OpticalPhoton::OpticalPhotonDefinition())
{
if(fPolarized)
SetOptPhotonPolar(fPolarization);
else
SetOptPhotonPolar();
}
fParticleGun->GeneratePrimaryVertex(anEvent);
}
@@ -85,32 +108,44 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
void PrimaryGeneratorAction::SetOptPhotonPolar()
{
G4double angle = G4UniformRand() * 360.0*deg;
SetOptPhotonPolar(angle);
G4double angle = G4UniformRand() * 360.0 * deg;
SetOptPhotonPolar(angle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorAction::SetOptPhotonPolar(G4double angle)
{
if (fParticleGun->GetParticleDefinition()->GetParticleName()!="opticalphoton")
{
G4cout << "--> warning from PrimaryGeneratorAction::SetOptPhotonPolar() :"
"the particleGun is not an opticalphoton" << G4endl;
return;
}
if(fParticleGun->GetParticleDefinition() !=
G4OpticalPhoton::OpticalPhotonDefinition())
{
G4ExceptionDescription ed;
ed << "The particleGun is not an opticalphoton.";
G4Exception("PrimaryGeneratorAction::SetOptPhotonPolar", "OpNovice2_004",
JustWarning, ed);
return;
}
G4ThreeVector normal (1., 0., 0.);
G4ThreeVector kphoton = fParticleGun->GetParticleMomentumDirection();
G4ThreeVector product = normal.cross(kphoton);
G4double modul2 = product*product;
G4ThreeVector e_perpend (0., 0., 1.);
if (modul2 > 0.) e_perpend = (1./std::sqrt(modul2))*product;
G4ThreeVector e_paralle = e_perpend.cross(kphoton);
G4ThreeVector polar = std::cos(angle)*e_paralle + std::sin(angle)*e_perpend;
fParticleGun->SetParticlePolarization(polar);
fPolarized = true;
fPolarization = angle;
G4ThreeVector normal(1., 0., 0.);
G4ThreeVector kphoton = fParticleGun->GetParticleMomentumDirection();
G4ThreeVector product = normal.cross(kphoton);
G4double modul2 = product * product;
G4ThreeVector e_perpend(0., 0., 1.);
if(modul2 > 0.)
e_perpend = (1. / std::sqrt(modul2)) * product;
G4ThreeVector e_paralle = e_perpend.cross(kphoton);
G4ThreeVector polar =
std::cos(angle) * e_paralle + std::sin(angle) * e_perpend;
fParticleGun->SetParticlePolarization(polar);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorAction::SetRandomDirection(G4bool val)
{
fRandomDirection = val;
}
@@ -35,27 +35,32 @@
#include "PrimaryGeneratorAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithABool.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorMessenger::
PrimaryGeneratorMessenger(PrimaryGeneratorAction* Gun)
: G4UImessenger(),
fPrimaryAction(Gun)
PrimaryGeneratorMessenger::PrimaryGeneratorMessenger(
PrimaryGeneratorAction* Gun)
: G4UImessenger()
, fPrimaryAction(Gun)
{
fGunDir = new G4UIdirectory("/opnovice2/gun/");
fGunDir->SetGuidance("PrimaryGenerator control");
fPolarCmd =
new G4UIcmdWithADoubleAndUnit("/opnovice2/gun/optPhotonPolar",this);
new G4UIcmdWithADoubleAndUnit("/opnovice2/gun/optPhotonPolar", this);
fPolarCmd->SetGuidance("Set linear polarization");
fPolarCmd->SetGuidance(" angle w.r.t. (k,n) plane");
fPolarCmd->SetParameterName("angle",true);
fPolarCmd->SetParameterName("angle", true);
fPolarCmd->SetUnitCategory("Angle");
fPolarCmd->SetDefaultValue(-360.0);
fPolarCmd->SetDefaultUnit("deg");
fPolarCmd->AvailableForStates(G4State_Idle);
fRandomDirectionCmd =
new G4UIcmdWithABool("/opnovice2/gun/randomDirection", this);
fRandomDirectionCmd->AvailableForStates(G4State_Idle, G4State_PreInit);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -64,20 +69,29 @@ PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger()
{
delete fPolarCmd;
delete fGunDir;
delete fRandomDirectionCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorMessenger::SetNewValue(
G4UIcommand* command, G4String newValue)
void PrimaryGeneratorMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if (command == fPolarCmd) {
G4double angle = fPolarCmd->GetNewDoubleValue(newValue);
if (angle == -360.0*deg) {
fPrimaryAction->SetOptPhotonPolar();
} else {
fPrimaryAction->SetOptPhotonPolar(angle);
}
if(command == fPolarCmd)
{
G4double angle = fPolarCmd->GetNewDoubleValue(newValue);
if(angle == -360.0 * deg)
{
fPrimaryAction->SetOptPhotonPolar();
}
else
{
fPrimaryAction->SetOptPhotonPolar(angle);
}
}
else if(command == fRandomDirectionCmd)
{
fPrimaryAction->SetRandomDirection(true);
}
}
+404 -134
View File
@@ -26,62 +26,69 @@
/// \file optical/OpNovice2/src/Run.cc
/// \brief Implementation of the Run class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include <numeric>
#include "Run.hh"
#include "DetectorConstruction.hh"
#include "HistoManager.hh"
#include "G4OpBoundaryProcess.hh"
#include "G4SystemOfUnits.hh"
#include "G4UnitsTable.hh"
#include <numeric>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Run::Run()
: G4Run()
Run::Run()
: G4Run()
{
fParticle = nullptr;
fEkin = -1.;
fCerenkovEnergy = 0.0;
fScintEnergy = 0.0;
fParticle = nullptr;
fEkin = -1.;
fPolarized = false;
fPolarization = 0.;
fCerenkovEnergy = 0.0;
fScintEnergy = 0.0;
fWLSAbsorptionEnergy = 0.0;
fWLSEmissionEnergy = 0.0;
fWLS2AbsorptionEnergy = 0.0;
fWLS2EmissionEnergy = 0.0;
fCerenkovCount = 0;
fScintCount = 0;
fCerenkovCount = 0;
fScintCount = 0;
fWLSAbsorptionCount = 0;
fWLSEmissionCount = 0;
fWLS2AbsorptionCount = 0;
fWLS2EmissionCount = 0;
fRayleighCount = 0;
fRayleighCount = 0;
fOpAbsorption = 0;
fOpAbsorption = 0;
fOpAbsorptionPrior = 0;
fTotalSurface = 0;
fBoundaryProcs.clear();
fBoundaryProcs.resize(40);
for (G4int i = 0; i < 40; ++i) {
for(G4int i = 0; i < 40; ++i)
{
fBoundaryProcs[i] = 0;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Run::~Run()
{}
Run::~Run() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::SetPrimary(G4ParticleDefinition* particle, G4double energy)
void Run::SetPrimary(G4ParticleDefinition* particle, G4double energy,
G4bool polarized, G4double polarization)
{
fParticle = particle;
fEkin = energy;
fParticle = particle;
fEkin = energy;
fPolarized = polarized;
fPolarization = polarization;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -90,30 +97,33 @@ void Run::Merge(const G4Run* run)
const Run* localRun = static_cast<const Run*>(run);
// pass information about primary particle
fParticle = localRun->fParticle;
fEkin = localRun->fEkin;
fParticle = localRun->fParticle;
fEkin = localRun->fEkin;
fPolarized = localRun->fPolarized;
fPolarization = localRun->fPolarization;
fCerenkovEnergy += localRun->fCerenkovEnergy;
fScintEnergy += localRun->fScintEnergy;
fWLSAbsorptionEnergy += localRun->fWLSAbsorptionEnergy;
fWLSEmissionEnergy += localRun->fWLSEmissionEnergy;
fScintEnergy += localRun->fScintEnergy;
fWLSAbsorptionEnergy += localRun->fWLSAbsorptionEnergy;
fWLSEmissionEnergy += localRun->fWLSEmissionEnergy;
fWLS2AbsorptionEnergy += localRun->fWLS2AbsorptionEnergy;
fWLS2EmissionEnergy += localRun->fWLS2EmissionEnergy;
fWLS2EmissionEnergy += localRun->fWLS2EmissionEnergy;
fCerenkovCount += localRun->fCerenkovCount;
fScintCount += localRun->fScintCount;
fWLSAbsorptionCount += localRun->fWLSAbsorptionCount;
fWLSEmissionCount += localRun->fWLSEmissionCount;
fCerenkovCount += localRun->fCerenkovCount;
fScintCount += localRun->fScintCount;
fWLSAbsorptionCount += localRun->fWLSAbsorptionCount;
fWLSEmissionCount += localRun->fWLSEmissionCount;
fWLS2AbsorptionCount += localRun->fWLS2AbsorptionCount;
fWLS2EmissionCount += localRun->fWLS2EmissionCount;
fRayleighCount += localRun->fRayleighCount;
fTotalSurface += localRun->fTotalSurface;
fOpAbsorption += localRun->fOpAbsorption;
fWLS2EmissionCount += localRun->fWLS2EmissionCount;
fRayleighCount += localRun->fRayleighCount;
fTotalSurface += localRun->fTotalSurface;
fOpAbsorption += localRun->fOpAbsorption;
fOpAbsorptionPrior += localRun->fOpAbsorptionPrior;
for (size_t i = 0; i < fBoundaryProcs.size(); ++i) {
for(size_t i = 0; i < fBoundaryProcs.size(); ++i)
{
fBoundaryProcs[i] += localRun->fBoundaryProcs[i];
}
@@ -123,82 +133,177 @@ void Run::Merge(const G4Run* run)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::EndOfRun()
{
if (numberOfEvent == 0) return;
G4double TotNbofEvents = (G4double)numberOfEvent;
if(numberOfEvent == 0)
return;
G4double TotNbofEvents = (G4double) numberOfEvent;
const DetectorConstruction* det = (const DetectorConstruction*)
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
G4AnalysisManager* analysisMan = G4AnalysisManager::Instance();
G4int id = analysisMan->GetH1Id("Cerenkov spectrum");
analysisMan->SetH1XAxisTitle(id, "Energy [eV]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("Scintillation spectrum");
analysisMan->SetH1XAxisTitle(id, "Energy [eV]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("Scintillation time");
analysisMan->SetH1XAxisTitle(id, "Creation time [ns]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("WLS abs");
analysisMan->SetH1XAxisTitle(id, "Energy [eV]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("WLS em");
analysisMan->SetH1XAxisTitle(id, "Energy [eV]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("WLS time");
analysisMan->SetH1XAxisTitle(id, "Creation time [ns]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("WLS2 abs");
analysisMan->SetH1XAxisTitle(id, "Energy [eV]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("WLS2 em");
analysisMan->SetH1XAxisTitle(id, "Energy [eV]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("WLS2 time");
analysisMan->SetH1XAxisTitle(id, "Creation time [ns]");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("bdry status");
analysisMan->SetH1XAxisTitle(id, "Status code");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("x_backward");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("y_backward");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("z_backward");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("x_forward");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("y_forward");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("z_forward");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("x_fresnel");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("y_fresnel");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("z_fresnel");
analysisMan->SetH1XAxisTitle(id, "Direction cosine");
analysisMan->SetH1YAxisTitle(id, "Number of photons");
id = analysisMan->GetH1Id("Transmitted");
analysisMan->SetH1XAxisTitle(id, "Angle [deg]");
analysisMan->SetH1YAxisTitle(id, "Fraction of photons");
id = analysisMan->GetH1Id("Reflected");
analysisMan->SetH1XAxisTitle(id, "Angle [deg]");
analysisMan->SetH1YAxisTitle(id, "Fraction of photons");
const DetectorConstruction* det =
(const DetectorConstruction*) (G4RunManager::GetRunManager()
->GetUserDetectorConstruction());
std::ios::fmtflags mode = G4cout.flags();
G4int prec = G4cout.precision(2);
G4int prec = G4cout.precision(2);
G4cout << "\n Run Summary\n";
G4cout << "---------------------------------\n";
G4cout << "Primary particle was: " << fParticle->GetParticleName()
G4cout << "---------------------------------\n";
G4cout << "Primary particle was: " << fParticle->GetParticleName()
<< " with energy " << G4BestUnit(fEkin, "Energy") << "." << G4endl;
G4cout << "Number of events: " << numberOfEvent << G4endl;
G4cout << "Material of world: " << det->GetWorldMaterial()->GetName()
<< G4endl;
G4cout << "Material of tank: " << det->GetTankMaterial()->GetName()
<< G4endl << G4endl;
G4cout << "Material of tank: " << det->GetTankMaterial()->GetName() << G4endl
<< G4endl;
if (fParticle->GetParticleName() != "opticalphoton") {
G4cout << "Average energy of Cerenkov photons created per event: "
<< (fCerenkovEnergy/eV)/TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of Cerenkov photons created per event: "
<< fCerenkovCount/TotNbofEvents << G4endl;
if (fCerenkovCount > 0) {
G4cout << " Average energy per photon: "
<< (fCerenkovEnergy/eV)/fCerenkovCount << " eV." << G4endl;
if(fParticle->GetParticleName() != "opticalphoton")
{
G4cout << "Average energy of Cerenkov photons created per event: "
<< (fCerenkovEnergy / eV) / TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of Cerenkov photons created per event: "
<< fCerenkovCount / TotNbofEvents << G4endl;
if(fCerenkovCount > 0)
{
G4cout << " Average energy per photon: "
<< (fCerenkovEnergy / eV) / fCerenkovCount << " eV." << G4endl;
}
G4cout << "Average energy of scintillation photons created per event: "
<< (fScintEnergy/eV)/TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of scintillation photons created per event: "
<< fScintCount/TotNbofEvents << G4endl;
if (fScintCount > 0) {
G4cout << " Average energy per photon: "
<< (fScintEnergy/eV)/fScintCount << " eV." << G4endl;
G4cout << "Average energy of scintillation photons created per event: "
<< (fScintEnergy / eV) / TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of scintillation photons created per event: "
<< fScintCount / TotNbofEvents << G4endl;
if(fScintCount > 0)
{
G4cout << " Average energy per photon: "
<< (fScintEnergy / eV) / fScintCount << " eV." << G4endl;
}
}
G4cout << "Average number of photons absorbed by WLS per event: "
<< fWLSAbsorptionCount/G4double(TotNbofEvents) << " " << G4endl;
if (fWLSAbsorptionCount > 0) {
G4cout << " Average energy per photon: "
<< (fWLSAbsorptionEnergy/eV)/fWLSAbsorptionCount << " eV." <<G4endl;
G4cout << "Average number of photons absorbed by WLS per event: "
<< fWLSAbsorptionCount / G4double(TotNbofEvents) << " " << G4endl;
if(fWLSAbsorptionCount > 0)
{
G4cout << " Average energy per photon: "
<< (fWLSAbsorptionEnergy / eV) / fWLSAbsorptionCount << " eV."
<< G4endl;
}
G4cout << "Average number of photons created by WLS per event: "
<< fWLSEmissionCount/TotNbofEvents << G4endl;
if (fWLSEmissionCount > 0) {
G4cout << " Average energy per photon: "
<< (fWLSEmissionEnergy/eV)/fWLSEmissionCount << " eV." << G4endl;
G4cout << "Average number of photons created by WLS per event: "
<< fWLSEmissionCount / TotNbofEvents << G4endl;
if(fWLSEmissionCount > 0)
{
G4cout << " Average energy per photon: "
<< (fWLSEmissionEnergy / eV) / fWLSEmissionCount << " eV." << G4endl;
}
G4cout << "Average energy of WLS photons created per event: "
<< (fWLSEmissionEnergy/eV)/TotNbofEvents << " eV." << G4endl;
G4cout << "Average energy of WLS photons created per event: "
<< (fWLSEmissionEnergy / eV) / TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of photons absorbed by WLS2 per event: "
<< fWLS2AbsorptionCount/G4double(TotNbofEvents) << " " << G4endl;
if (fWLS2AbsorptionCount > 0) {
G4cout << " Average energy per photon: "
<< (fWLS2AbsorptionEnergy/eV)/fWLS2AbsorptionCount << " eV." <<G4endl;
G4cout << "Average number of photons absorbed by WLS2 per event: "
<< fWLS2AbsorptionCount / G4double(TotNbofEvents) << " " << G4endl;
if(fWLS2AbsorptionCount > 0)
{
G4cout << " Average energy per photon: "
<< (fWLS2AbsorptionEnergy / eV) / fWLS2AbsorptionCount << " eV."
<< G4endl;
}
G4cout << "Average number of photons created by WLS2 per event: "
<< fWLS2EmissionCount/TotNbofEvents << G4endl;
if (fWLS2EmissionCount > 0) {
G4cout << " Average energy per photon: "
<< (fWLS2EmissionEnergy/eV)/fWLS2EmissionCount << " eV." << G4endl;
G4cout << "Average number of photons created by WLS2 per event: "
<< fWLS2EmissionCount / TotNbofEvents << G4endl;
if(fWLS2EmissionCount > 0)
{
G4cout << " Average energy per photon: "
<< (fWLS2EmissionEnergy / eV) / fWLS2EmissionCount << " eV."
<< G4endl;
}
G4cout << "Average energy of WLS2 photons created per event: "
<< (fWLS2EmissionEnergy/eV)/TotNbofEvents << " eV." << G4endl;
G4cout << "Average energy of WLS2 photons created per event: "
<< (fWLS2EmissionEnergy / eV) / TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of OpRayleigh per event: "
<< fRayleighCount/TotNbofEvents << G4endl;
<< fRayleighCount / TotNbofEvents << G4endl;
G4cout << "Average number of OpAbsorption per event: "
<< fOpAbsorption/TotNbofEvents << G4endl;
G4cout <<
"\nSurface events (on +X surface, maximum one per photon) this run:"
<< fOpAbsorption / TotNbofEvents << G4endl;
G4cout << "\nSurface events (on +X surface, maximum one per photon) this run:"
<< G4endl;
G4cout << "# of primary particles: " << std::setw(8) << TotNbofEvents
<< G4endl;
@@ -206,163 +311,202 @@ void Run::EndOfRun()
<< fOpAbsorptionPrior << G4endl;
G4cout << "Total # of surface events: " << std::setw(8) << fTotalSurface
<< G4endl;
if (fParticle->GetParticleName() == "opticalphoton") {
if(fParticle->GetParticleName() == "opticalphoton")
{
G4cout << "Unaccounted for: " << std::setw(8)
<< fTotalSurface + fOpAbsorptionPrior - TotNbofEvents << G4endl;
<< fTotalSurface + fOpAbsorptionPrior - TotNbofEvents << G4endl;
}
G4cout << "\nSurface events by process:" << G4endl;
if (fBoundaryProcs[Transmission] > 0) {
if(fBoundaryProcs[Transmission] > 0)
{
G4cout << " Transmission: " << std::setw(8)
<< fBoundaryProcs[Transmission] << G4endl;
}
if (fBoundaryProcs[FresnelRefraction] > 0) {
if(fBoundaryProcs[FresnelRefraction] > 0)
{
G4cout << " Fresnel refraction: " << std::setw(8)
<< fBoundaryProcs[FresnelRefraction] << G4endl;
}
if (fBoundaryProcs[FresnelReflection] > 0) {
if(fBoundaryProcs[FresnelReflection] > 0)
{
G4cout << " Fresnel reflection: " << std::setw(8)
<< fBoundaryProcs[FresnelReflection] << G4endl;
<< fBoundaryProcs[FresnelReflection] << G4endl;
}
if (fBoundaryProcs[TotalInternalReflection] > 0) {
if(fBoundaryProcs[TotalInternalReflection] > 0)
{
G4cout << " Total internal reflection: " << std::setw(8)
<< fBoundaryProcs[TotalInternalReflection] << G4endl;
}
if (fBoundaryProcs[LambertianReflection] > 0) {
if(fBoundaryProcs[LambertianReflection] > 0)
{
G4cout << " Lambertian reflection: " << std::setw(8)
<< fBoundaryProcs[LambertianReflection] << G4endl;
}
if (fBoundaryProcs[LobeReflection] > 0) {
if(fBoundaryProcs[LobeReflection] > 0)
{
G4cout << " Lobe reflection: " << std::setw(8)
<< fBoundaryProcs[LobeReflection] << G4endl;
}
if (fBoundaryProcs[SpikeReflection] > 0) {
if(fBoundaryProcs[SpikeReflection] > 0)
{
G4cout << " Spike reflection: " << std::setw(8)
<< fBoundaryProcs[SpikeReflection] << G4endl;
}
if (fBoundaryProcs[BackScattering] > 0) {
if(fBoundaryProcs[BackScattering] > 0)
{
G4cout << " Backscattering: " << std::setw(8)
<< fBoundaryProcs[BackScattering] << G4endl;
}
if (fBoundaryProcs[Absorption] > 0) {
if(fBoundaryProcs[Absorption] > 0)
{
G4cout << " Absorption: " << std::setw(8)
<< fBoundaryProcs[Absorption] << G4endl;
}
if (fBoundaryProcs[Detection] > 0) {
if(fBoundaryProcs[Detection] > 0)
{
G4cout << " Detection: " << std::setw(8)
<< fBoundaryProcs[Detection] << G4endl;
}
if (fBoundaryProcs[NotAtBoundary] > 0) {
if(fBoundaryProcs[NotAtBoundary] > 0)
{
G4cout << " Not at boundary: " << std::setw(8)
<< fBoundaryProcs[NotAtBoundary] << G4endl;
}
if (fBoundaryProcs[SameMaterial] > 0) {
if(fBoundaryProcs[SameMaterial] > 0)
{
G4cout << " Same material: " << std::setw(8)
<< fBoundaryProcs[SameMaterial] << G4endl;
}
if (fBoundaryProcs[StepTooSmall] > 0) {
if(fBoundaryProcs[StepTooSmall] > 0)
{
G4cout << " Step too small: " << std::setw(8)
<< fBoundaryProcs[StepTooSmall] << G4endl;
}
if (fBoundaryProcs[NoRINDEX] > 0) {
if(fBoundaryProcs[NoRINDEX] > 0)
{
G4cout << " No RINDEX: " << std::setw(8)
<< fBoundaryProcs[NoRINDEX] << G4endl;
}
// LBNL polished
if (fBoundaryProcs[PolishedLumirrorAirReflection] > 0) {
if(fBoundaryProcs[PolishedLumirrorAirReflection] > 0)
{
G4cout << " Polished Lumirror Air reflection: " << std::setw(8)
<< fBoundaryProcs[PolishedLumirrorAirReflection] << G4endl;
}
if (fBoundaryProcs[PolishedLumirrorGlueReflection] > 0) {
if(fBoundaryProcs[PolishedLumirrorGlueReflection] > 0)
{
G4cout << " Polished Lumirror Glue reflection: " << std::setw(8)
<< fBoundaryProcs[PolishedLumirrorGlueReflection] << G4endl;
}
if (fBoundaryProcs[PolishedAirReflection] > 0) {
if(fBoundaryProcs[PolishedAirReflection] > 0)
{
G4cout << " Polished Air reflection: " << std::setw(8)
<< fBoundaryProcs[PolishedAirReflection] << G4endl;
}
if (fBoundaryProcs[PolishedTeflonAirReflection] > 0) {
if(fBoundaryProcs[PolishedTeflonAirReflection] > 0)
{
G4cout << " Polished Teflon Air reflection: " << std::setw(8)
<< fBoundaryProcs[PolishedTeflonAirReflection] << G4endl;
}
if (fBoundaryProcs[PolishedTiOAirReflection] > 0) {
if(fBoundaryProcs[PolishedTiOAirReflection] > 0)
{
G4cout << " Polished TiO Air reflection: " << std::setw(8)
<< fBoundaryProcs[PolishedTiOAirReflection] << G4endl;
}
if (fBoundaryProcs[PolishedTyvekAirReflection] > 0) {
if(fBoundaryProcs[PolishedTyvekAirReflection] > 0)
{
G4cout << " Polished Tyvek Air reflection: " << std::setw(8)
<< fBoundaryProcs[PolishedTyvekAirReflection] << G4endl;
}
if (fBoundaryProcs[PolishedVM2000AirReflection] > 0) {
if(fBoundaryProcs[PolishedVM2000AirReflection] > 0)
{
G4cout << " Polished VM2000 Air reflection: " << std::setw(8)
<< fBoundaryProcs[PolishedVM2000AirReflection] << G4endl;
}
if (fBoundaryProcs[PolishedVM2000GlueReflection] > 0) {
if(fBoundaryProcs[PolishedVM2000GlueReflection] > 0)
{
G4cout << " Polished VM2000 Glue reflection: " << std::setw(8)
<< fBoundaryProcs[PolishedVM2000GlueReflection] << G4endl;
}
// LBNL etched
if (fBoundaryProcs[EtchedLumirrorAirReflection] > 0) {
if(fBoundaryProcs[EtchedLumirrorAirReflection] > 0)
{
G4cout << " Etched Lumirror Air reflection: " << std::setw(8)
<< fBoundaryProcs[EtchedLumirrorAirReflection] << G4endl;
}
if (fBoundaryProcs[EtchedLumirrorGlueReflection] > 0) {
if(fBoundaryProcs[EtchedLumirrorGlueReflection] > 0)
{
G4cout << " Etched Lumirror Glue reflection: " << std::setw(8)
<< fBoundaryProcs[EtchedLumirrorGlueReflection] << G4endl;
}
if (fBoundaryProcs[EtchedAirReflection] > 0) {
if(fBoundaryProcs[EtchedAirReflection] > 0)
{
G4cout << " Etched Air reflection: " << std::setw(8)
<< fBoundaryProcs[EtchedAirReflection] << G4endl;
}
if (fBoundaryProcs[EtchedTeflonAirReflection] > 0) {
if(fBoundaryProcs[EtchedTeflonAirReflection] > 0)
{
G4cout << " Etched Teflon Air reflection: " << std::setw(8)
<< fBoundaryProcs[EtchedTeflonAirReflection] << G4endl;
}
if (fBoundaryProcs[EtchedTiOAirReflection] > 0) {
if(fBoundaryProcs[EtchedTiOAirReflection] > 0)
{
G4cout << " Etched TiO Air reflection: " << std::setw(8)
<< fBoundaryProcs[EtchedTiOAirReflection] << G4endl;
}
if (fBoundaryProcs[EtchedTyvekAirReflection] > 0) {
if(fBoundaryProcs[EtchedTyvekAirReflection] > 0)
{
G4cout << " Etched Tyvek Air reflection: " << std::setw(8)
<< fBoundaryProcs[EtchedTyvekAirReflection] << G4endl;
}
if (fBoundaryProcs[EtchedVM2000AirReflection] > 0) {
if(fBoundaryProcs[EtchedVM2000AirReflection] > 0)
{
G4cout << " Etched VM2000 Air reflection: " << std::setw(8)
<< fBoundaryProcs[EtchedVM2000AirReflection] << G4endl;
}
if (fBoundaryProcs[EtchedVM2000GlueReflection] > 0) {
if(fBoundaryProcs[EtchedVM2000GlueReflection] > 0)
{
G4cout << " Etched VM2000 Glue reflection: " << std::setw(8)
<< fBoundaryProcs[EtchedVM2000GlueReflection] << G4endl;
}
// LBNL ground
if (fBoundaryProcs[GroundLumirrorAirReflection] > 0) {
if(fBoundaryProcs[GroundLumirrorAirReflection] > 0)
{
G4cout << " Ground Lumirror Air reflection: " << std::setw(8)
<< fBoundaryProcs[GroundLumirrorAirReflection] << G4endl;
}
if (fBoundaryProcs[GroundLumirrorGlueReflection] > 0) {
if(fBoundaryProcs[GroundLumirrorGlueReflection] > 0)
{
G4cout << " Ground Lumirror Glue reflection: " << std::setw(8)
<< fBoundaryProcs[GroundLumirrorGlueReflection] << G4endl;
}
if (fBoundaryProcs[GroundAirReflection] > 0) {
if(fBoundaryProcs[GroundAirReflection] > 0)
{
G4cout << " Ground Air reflection: " << std::setw(8)
<< fBoundaryProcs[GroundAirReflection] << G4endl;
}
if (fBoundaryProcs[GroundTeflonAirReflection] > 0) {
if(fBoundaryProcs[GroundTeflonAirReflection] > 0)
{
G4cout << " Ground Teflon Air reflection: " << std::setw(8)
<< fBoundaryProcs[GroundTeflonAirReflection] << G4endl;
}
if (fBoundaryProcs[GroundTiOAirReflection] > 0) {
if(fBoundaryProcs[GroundTiOAirReflection] > 0)
{
G4cout << " Ground TiO Air reflection: " << std::setw(8)
<< fBoundaryProcs[GroundTiOAirReflection] << G4endl;
}
if (fBoundaryProcs[GroundTyvekAirReflection] > 0) {
if(fBoundaryProcs[GroundTyvekAirReflection] > 0)
{
G4cout << " Ground Tyvek Air reflection: " << std::setw(8)
<< fBoundaryProcs[GroundTyvekAirReflection] << G4endl;
}
if (fBoundaryProcs[GroundVM2000AirReflection] > 0) {
if(fBoundaryProcs[GroundVM2000AirReflection] > 0)
{
G4cout << " Ground VM2000 Air reflection: " << std::setw(8)
<< fBoundaryProcs[GroundVM2000AirReflection] << G4endl;
}
if (fBoundaryProcs[GroundVM2000GlueReflection] > 0) {
if(fBoundaryProcs[GroundVM2000GlueReflection] > 0)
{
G4cout << " Ground VM2000 Glue reflection: " << std::setw(8)
<< fBoundaryProcs[GroundVM2000GlueReflection] << G4endl;
}
@@ -372,8 +516,134 @@ void Run::EndOfRun()
G4cout << " Unaccounted for: " << std::setw(8)
<< fTotalSurface - sum << G4endl;
G4cout << "---------------------------------\n";
G4cout << "---------------------------------\n";
G4cout.setf(mode, std::ios::floatfield);
G4cout.precision(prec);
G4int histo_id_trans = analysisMan->GetH1Id("Transmitted");
G4int histo_id_refl = analysisMan->GetH1Id("Reflected");
if(analysisMan->GetH1Activation(histo_id_trans))
{
if(fPolarized)
{
G4double rindex1 = det->GetTankMaterial()
->GetMaterialPropertiesTable()
->GetProperty(kRINDEX)
->Value(fEkin);
G4double rindex2 = det->GetWorldMaterial()
->GetMaterialPropertiesTable()
->GetProperty(kRINDEX)
->Value(fEkin);
G4H1* histo_trans = analysisMan->GetH1(histo_id_trans);
G4H1* histo_refl = analysisMan->GetH1(histo_id_refl);
std::vector<G4double> trans;
std::vector<G4double> refl;
std::vector<G4double> tot;
for(size_t i = 0; i < histo_trans->axis().bins(); ++i)
{
trans.push_back(histo_trans->bin_height(i));
refl.push_back(histo_refl->bin_height(i));
tot.push_back(histo_trans->bin_height(i) + histo_refl->bin_height(i));
}
// find Brewster angle: Rp = 0
// need enough statistics for this method to work
G4double min_angle = -1.;
G4double min_val = DBL_MAX;
G4double bin_width = 0.;
for(size_t i = 0; i < refl.size(); ++i)
{
if(refl[i] < min_val)
{
min_val = refl[i];
min_angle = histo_refl->axis().bin_lower_edge(i);
bin_width = histo_refl->axis().bin_upper_edge(i) -
histo_refl->axis().bin_lower_edge(i);
min_angle += bin_width / 2.;
}
}
G4cout << "Polarization of primary optical photons: "
<< fPolarization / deg << " deg." << G4endl;
if(fPolarization == 0.0)
{
G4cout << "Reflectance shows a minimum at: " << min_angle << " +/- "
<< bin_width / 2;
G4cout << " deg. Expected Brewster angle: "
<< (360. / CLHEP::twopi) * std::atan(rindex2 / rindex1)
<< " deg. " << G4endl;
}
// find angle of total internal reflection: T -> 0
// last bin for T > 0
min_angle = -1.;
min_val = DBL_MAX;
for(size_t i = 0; i < histo_trans->axis().bins() - 1; ++i)
{
if(histo_trans->bin_height(i) > 0. &&
histo_trans->bin_height(i + 1) == 0.)
{
min_angle = histo_trans->axis().bin_lower_edge(i);
bin_width = histo_refl->axis().bin_upper_edge(i) -
histo_refl->axis().bin_lower_edge(i);
min_angle += bin_width / 2.;
break;
}
}
G4cout << "Transmission goes to 0 at: " << min_angle << " +/- "
<< bin_width / 2. << " deg."
<< " Expected: "
<< (360. / CLHEP::twopi) * std::asin(rindex2 / rindex1) << " deg."
<< G4endl;
// Normalize the transmission/reflection histos so that max is 1.
// Only if x values are the same
if((analysisMan->GetH1Nbins(histo_id_trans) ==
analysisMan->GetH1Nbins(histo_id_refl)) &&
(analysisMan->GetH1Xmin(histo_id_trans) ==
analysisMan->GetH1Xmin(histo_id_refl)) &&
(analysisMan->GetH1Xmax(histo_id_trans) ==
analysisMan->GetH1Xmax(histo_id_refl)))
{
unsigned int ent;
G4double sw;
G4double sw2;
G4double sx2;
G4double sx2w;
for(size_t bin = 0; bin < histo_trans->axis().bins(); ++bin)
{
// "bin+1" below because bin 0 is underflow bin
// NB. We are ignoring underflow/overflow bins
histo_trans->get_bin_content(bin + 1, ent, sw, sw2, sx2, sx2w);
if(tot[bin] > 0)
{
sw /= tot[bin];
// bin error is sqrt(sw2)
sw2 /= (tot[bin] * tot[bin]);
sx2 /= (tot[bin] * tot[bin]);
sx2w /= (tot[bin] * tot[bin]);
histo_trans->set_bin_content(bin + 1, ent, sw, sw2, sx2, sx2w);
}
}
for(size_t bin = 0; bin < histo_refl->axis().bins(); ++bin)
{
histo_refl->get_bin_content(bin + 1, ent, sw, sw2, sx2, sx2w);
if(tot[bin] > 0)
{
sw /= tot[bin];
// bin error is sqrt(sw2)
sw2 /= (tot[bin] * tot[bin]);
sx2 /= (tot[bin] * tot[bin]);
sx2w /= (tot[bin] * tot[bin]);
histo_refl->set_bin_content(bin + 1, ent, sw, sw2, sx2, sx2w);
}
}
}
else
{
G4cout << "Not going to normalize transmission and reflection "
<< "histograms because bins are not the same." << G4endl;
}
}
}
}
@@ -26,40 +26,33 @@
/// \file optical/OpNovice2/src/RunAction.cc
/// \brief Implementation of the RunAction class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Make this appear first!
#include "G4Timer.hh"
#include "RunAction.hh"
#include "HistoManager.hh"
#include "PrimaryGeneratorAction.hh"
#include "Run.hh"
#include "G4Run.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::RunAction(PrimaryGeneratorAction* prim)
: G4UserRunAction(),
fTimer(nullptr),
fRun(nullptr),
fHistoManager(nullptr),
fPrimary(prim)
: G4UserRunAction()
, fRun(nullptr)
, fHistoManager(nullptr)
, fPrimary(prim)
{
fTimer = new G4Timer;
fHistoManager = new HistoManager();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::~RunAction()
{
delete fTimer;
delete fHistoManager;
}
RunAction::~RunAction() { delete fHistoManager; }
G4Run* RunAction::GenerateRun()
{
@@ -69,39 +62,198 @@ G4Run* RunAction::GenerateRun()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::BeginOfRunAction(const G4Run* aRun)
void RunAction::BeginOfRunAction(const G4Run*)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
if (fPrimary) {
G4ParticleDefinition* particle =
if(fPrimary)
{
G4ParticleDefinition* particle =
fPrimary->GetParticleGun()->GetParticleDefinition();
G4double energy = fPrimary->GetParticleGun()->GetParticleEnergy();
fRun->SetPrimary(particle, energy);
G4double energy = fPrimary->GetParticleGun()->GetParticleEnergy();
G4bool polarized = fPrimary->GetPolarized();
G4double polarization = fPrimary->GetPolarization();
fRun->SetPrimary(particle, energy, polarized, polarization);
}
//histograms
// histograms
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
if (analysisManager->IsActive()) {
if(analysisManager->IsActive())
{
analysisManager->OpenFile();
}
fTimer->Start();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::EndOfRunAction(const G4Run* aRun)
void RunAction::EndOfRunAction(const G4Run*)
{
fTimer->Stop();
G4cout << "number of event = " << aRun->GetNumberOfEvent()
<< " " << *fTimer << G4endl;
if(isMaster)
fRun->EndOfRun();
if (isMaster) fRun->EndOfRun();
// save histograms
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
if (analysisManager->IsActive()) {
G4cout << G4endl << " Histogram statistics for the ";
if(isMaster)
{
G4cout << "entire run:" << G4endl << G4endl;
}
else
{
G4cout << "local thread:" << G4endl << G4endl;
}
G4int id = analysisManager->GetH1Id("Cerenkov spectrum");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Cerenkov spectrum: mean = "
<< analysisManager->GetH1(id)->mean()
<< " eV; rms = " << analysisManager->GetH1(id)->rms() << " eV."
<< G4endl;
}
id = analysisManager->GetH1Id("Scintillation spectrum");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Scintillation spectrum: mean = "
<< analysisManager->GetH1(id)->mean()
<< " eV; rms = " << analysisManager->GetH1(id)->rms() << " eV."
<< G4endl;
}
id = analysisManager->GetH1Id("Scintillation time");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Scintillation time: mean = "
<< analysisManager->GetH1(id)->mean()
<< " ns; rms = " << analysisManager->GetH1(id)->rms() << " ns."
<< G4endl;
}
id = analysisManager->GetH1Id("WLS abs");
if(analysisManager->GetH1Activation(id))
{
G4cout << " WLS absorption spectrum: mean = "
<< analysisManager->GetH1(id)->mean()
<< " eV; rms = " << analysisManager->GetH1(id)->rms() << " eV."
<< G4endl;
}
id = analysisManager->GetH1Id("WLS em");
if(analysisManager->GetH1Activation(id))
{
G4cout << " WLS emission spectrum: mean = "
<< analysisManager->GetH1(id)->mean()
<< " eV; rms = " << analysisManager->GetH1(id)->rms() << " eV."
<< G4endl;
}
id = analysisManager->GetH1Id("WLS time");
if(analysisManager->GetH1Activation(id))
{
G4cout << " WLS emission time: mean = "
<< analysisManager->GetH1(id)->mean()
<< " ns; rms = " << analysisManager->GetH1(id)->rms() << " ns."
<< G4endl;
}
id = analysisManager->GetH1Id("WLS2 abs");
if(analysisManager->GetH1Activation(id))
{
G4cout << " WLS emission time: mean = "
<< analysisManager->GetH1(id)->mean()
<< " ns; rms = " << analysisManager->GetH1(id)->rms() << " ns."
<< G4endl;
}
id = analysisManager->GetH1Id("WLS2 em");
if(analysisManager->GetH1Activation(id))
{
G4cout << " WLS2 emission spectrum: mean = "
<< analysisManager->GetH1(id)->mean()
<< " eV; rms = " << analysisManager->GetH1(id)->rms() << " eV."
<< G4endl;
}
id = analysisManager->GetH1Id("WLS2 time");
if(analysisManager->GetH1Activation(id))
{
G4cout << " WLS2 emission time: mean = "
<< analysisManager->GetH1(id)->mean()
<< " ns; rms = " << analysisManager->GetH1(id)->rms() << " ns."
<< G4endl;
}
id = analysisManager->GetH1Id("x_backward");
if(analysisManager->GetH1Activation(id))
{
G4cout << " X momentum dir of backward-going photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("y_backward");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Y momentum dir of backward-going photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("z_backward");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Z momentum dir of backward-going photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("x_forward");
if(analysisManager->GetH1Activation(id))
{
G4cout << " X momentum dir of forward-going photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("y_forward");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Y momentum dir of forward-going photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("z_forward");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Z momentum dir of forward-going photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("x_fresnel");
if(analysisManager->GetH1Activation(id))
{
G4cout << " X momentum dir of Fresnel-refracted photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("y_fresnel");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Y momentum dir of Fresnel-refracted photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("z_fresnel");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Z momentum dir of Fresnel-refracted photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("Transmitted");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Angle of transmitted photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
id = analysisManager->GetH1Id("Reflected");
if(analysisManager->GetH1Activation(id))
{
G4cout << " Angle of reflected photons: mean = "
<< analysisManager->GetH1(id)->mean()
<< "; rms = " << analysisManager->GetH1(id)->rms() << G4endl;
}
G4cout << G4endl;
if(analysisManager->IsActive())
{
analysisManager->Write();
analysisManager->CloseFile();
}
@@ -30,333 +30,358 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "SteppingAction.hh"
//#include "EventAction.hh"
#include "HistoManager.hh"
#include "TrackInformation.hh"
#include "Run.hh"
#include "TrackInformation.hh"
#include "G4Cerenkov.hh"
#include "G4Scintillation.hh"
#include "G4OpBoundaryProcess.hh"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4OpticalPhoton.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4SteppingManager.hh"
#include "G4RunManager.hh"
#include "G4Scintillation.hh"
#include "G4OpBoundaryProcess.hh"
#include "G4OpticalPhoton.hh"
#include "G4ProcessManager.hh"
#include "G4Step.hh"
#include "G4SteppingManager.hh"
#include "G4SystemOfUnits.hh"
#include "G4Track.hh"
#include "G4RunManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::SteppingAction()
: G4UserSteppingAction(),
fVerbose(0)
: G4UserSteppingAction()
, fVerbose(0)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::~SteppingAction()
{}
SteppingAction::~SteppingAction() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingAction::UserSteppingAction(const G4Step* step)
{
static G4ParticleDefinition* opticalphoton =
G4OpticalPhoton::OpticalPhotonDefinition();
G4OpticalPhoton::OpticalPhotonDefinition();
G4AnalysisManager* analysisMan = G4AnalysisManager::Instance();
Run* run = static_cast<Run*>(
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
Run* run =
static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
G4Track* track = step->GetTrack();
G4Track* track = step->GetTrack();
G4StepPoint* endPoint = step->GetPostStepPoint();
G4StepPoint* startPoint = step->GetPreStepPoint();
const G4DynamicParticle* theParticle = track->GetDynamicParticle();
const G4ParticleDefinition* particleDef = theParticle->
GetParticleDefinition();
const G4ParticleDefinition* particleDef =
theParticle->GetParticleDefinition();
TrackInformation* trackInfo =
(TrackInformation*)(track->GetUserInformation());
(TrackInformation*) (track->GetUserInformation());
if (particleDef == opticalphoton) {
if(particleDef == opticalphoton)
{
const G4VProcess* pds = endPoint->GetProcessDefinedStep();
G4String procname = pds->GetProcessName();
if (procname.compare("OpAbsorption") == 0) {
G4String procname = pds->GetProcessName();
if(procname.compare("OpAbsorption") == 0)
{
run->AddOpAbsorption();
if (trackInfo->GetIsFirstTankX()) {
if(trackInfo->GetIsFirstTankX())
{
run->AddOpAbsorptionPrior();
}
}
else if (procname.compare("OpRayleigh") == 0) {
}
else if(procname.compare("OpRayleigh") == 0)
{
run->AddRayleigh();
}
else if (procname.compare("OpWLS") == 0) {
else if(procname.compare("OpWLS") == 0)
{
G4double en = track->GetKineticEnergy();
run->AddWLSAbsorption();
run->AddWLSAbsorptionEnergy(en);
analysisMan->FillH1(4, en/eV); //absorption energy
analysisMan->FillH1(4, en / eV); // absorption energy
// loop over secondaries, create statistics
//const std::vector<const G4Track*>* secondaries =
// const std::vector<const G4Track*>* secondaries =
auto secondaries = step->GetSecondaryInCurrentStep();
for (auto sec : *secondaries) {
for(auto sec : *secondaries)
{
en = sec->GetKineticEnergy();
run->AddWLSEmission();
run->AddWLSEmissionEnergy(en);
analysisMan->FillH1(5, en/eV); // emission energy
analysisMan->FillH1(5, en / eV); // emission energy
G4double time = sec->GetGlobalTime();
analysisMan->FillH1(6, time/ns);
analysisMan->FillH1(6, time / ns);
}
}
else if (procname.compare("OpWLS2") == 0) {
else if(procname.compare("OpWLS2") == 0)
{
G4double en = track->GetKineticEnergy();
run->AddWLS2Absorption();
run->AddWLS2AbsorptionEnergy(en);
analysisMan->FillH1(7, en/eV); //absorption energy
analysisMan->FillH1(7, en / eV); // absorption energy
// loop over secondaries, create statistics
//const std::vector<const G4Track*>* secondaries =
// const std::vector<const G4Track*>* secondaries =
auto secondaries = step->GetSecondaryInCurrentStep();
for (auto sec : *secondaries) {
for(auto sec : *secondaries)
{
en = sec->GetKineticEnergy();
run->AddWLS2Emission();
run->AddWLS2EmissionEnergy(en);
analysisMan->FillH1(8, en/eV); // emission energy
analysisMan->FillH1(8, en / eV); // emission energy
G4double time = sec->GetGlobalTime();
analysisMan->FillH1(9, time/ns);
analysisMan->FillH1(9, time / ns);
}
}
// optical process has endpt on bdry,
if (endPoint->GetStepStatus() == fGeomBoundary) {
// optical process has endpt on bdry,
if(endPoint->GetStepStatus() == fGeomBoundary)
{
G4ThreeVector m0 = startPoint->GetMomentumDirection();
G4ThreeVector m1 = endPoint->GetMomentumDirection();
G4OpBoundaryProcessStatus theStatus = Undefined;
G4ProcessManager* OpManager = opticalphoton->GetProcessManager();
G4int MAXofPostStepLoops =
OpManager->GetPostStepProcessVector()->entries();
G4ProcessVector* postStepDoItVector =
G4ProcessVector* postStepDoItVector =
OpManager->GetPostStepProcessVector(typeDoIt);
G4int n_proc = postStepDoItVector->entries();
if (trackInfo->GetIsFirstTankX()) {
if(trackInfo->GetIsFirstTankX())
{
G4ThreeVector momdir = endPoint->GetMomentumDirection();
G4double px1 = momdir.x();
G4double py1 = momdir.y();
G4double pz1 = momdir.z();
if (px1 < 0.) {
G4double px1 = momdir.x();
G4double py1 = momdir.y();
G4double pz1 = momdir.z();
if(px1 < 0.)
{
analysisMan->FillH1(11, px1);
analysisMan->FillH1(12, py1);
analysisMan->FillH1(13, pz1);
} else {
}
else
{
analysisMan->FillH1(14, px1);
analysisMan->FillH1(15, py1);
analysisMan->FillH1(16, pz1);
}
trackInfo->SetIsFirstTankX(false);
run->AddTotalSurface();
run->AddTotalSurface();
for (G4int i=0; i<MAXofPostStepLoops; ++i) {
for(G4int i = 0; i < n_proc; ++i)
{
G4VProcess* currentProcess = (*postStepDoItVector)[i];
G4OpBoundaryProcess* opProc =
G4OpBoundaryProcess* opProc =
dynamic_cast<G4OpBoundaryProcess*>(currentProcess);
if (opProc) {
theStatus = opProc->GetStatus();
if(opProc)
{
G4double angle = std::acos(startPoint->GetMomentumDirection().x());
theStatus = opProc->GetStatus();
analysisMan->FillH1(10, theStatus);
if (theStatus == Transmission) {
run->AddTransmission();
}
else if (theStatus == FresnelRefraction) {
run->AddFresnelRefraction();
analysisMan->FillH1(17, px1);
analysisMan->FillH1(18, py1);
analysisMan->FillH1(19, pz1);
}
else if (theStatus == FresnelReflection) {
run->AddFresnelReflection();
}
else if (theStatus == TotalInternalReflection) {
run->AddTotalInternalReflection();
}
else if (theStatus == LambertianReflection) {
run->AddLambertianReflection();
}
else if (theStatus == LobeReflection) {
run->AddLobeReflection();
}
else if (theStatus == SpikeReflection) {
run->AddSpikeReflection();
}
else if (theStatus == BackScattering) {
run->AddBackScattering();
}
else if (theStatus == Absorption) {
run->AddAbsorption();
}
else if (theStatus == Detection) {
run->AddDetection();
}
else if (theStatus == NotAtBoundary) {
run->AddNotAtBoundary();
}
else if (theStatus == SameMaterial) {
run->AddSameMaterial();
}
else if (theStatus == StepTooSmall) {
run->AddStepTooSmall();
}
else if (theStatus == NoRINDEX) {
run->AddNoRINDEX();
}
else if (theStatus == PolishedLumirrorAirReflection) {
run->AddPolishedLumirrorAirReflection();
}
else if (theStatus == PolishedLumirrorGlueReflection) {
run->AddPolishedLumirrorGlueReflection();
}
else if (theStatus == PolishedAirReflection) {
run->AddPolishedAirReflection();
}
else if (theStatus == PolishedTeflonAirReflection) {
run->AddPolishedTeflonAirReflection();
}
else if (theStatus == PolishedTiOAirReflection) {
run->AddPolishedTiOAirReflection();
}
else if (theStatus == PolishedTyvekAirReflection) {
run->AddPolishedTyvekAirReflection();
}
else if (theStatus == PolishedVM2000AirReflection) {
run->AddPolishedVM2000AirReflection();
}
else if (theStatus == PolishedVM2000GlueReflection) {
run->AddPolishedVM2000AirReflection();
}
else if (theStatus == EtchedLumirrorAirReflection) {
run->AddEtchedLumirrorAirReflection();
}
else if (theStatus == EtchedLumirrorGlueReflection) {
run->AddEtchedLumirrorGlueReflection();
}
else if (theStatus == EtchedAirReflection) {
run->AddEtchedAirReflection();
}
else if (theStatus == EtchedTeflonAirReflection) {
run->AddEtchedTeflonAirReflection();
}
else if (theStatus == EtchedTiOAirReflection) {
run->AddEtchedTiOAirReflection();
}
else if (theStatus == EtchedTyvekAirReflection) {
run->AddEtchedTyvekAirReflection();
}
else if (theStatus == EtchedVM2000AirReflection) {
run->AddEtchedVM2000AirReflection();
}
else if (theStatus == EtchedVM2000GlueReflection) {
run->AddEtchedVM2000AirReflection();
}
else if (theStatus == GroundLumirrorAirReflection) {
run->AddGroundLumirrorAirReflection();
}
else if (theStatus == GroundLumirrorGlueReflection) {
run->AddGroundLumirrorGlueReflection();
}
else if (theStatus == GroundAirReflection) {
run->AddGroundAirReflection();
}
else if (theStatus == GroundTeflonAirReflection) {
run->AddGroundTeflonAirReflection();
}
else if (theStatus == GroundTiOAirReflection) {
run->AddGroundTiOAirReflection();
}
else if (theStatus == GroundTyvekAirReflection) {
run->AddGroundTyvekAirReflection();
}
else if (theStatus == GroundVM2000AirReflection) {
run->AddGroundVM2000AirReflection();
}
else if (theStatus == GroundVM2000GlueReflection) {
run->AddGroundVM2000AirReflection();
}
else if (theStatus == Dichroic) {
run->AddDichroic();
}
else {
G4cout << "theStatus: " << theStatus
<< " was none of the above." << G4endl;
}
switch(theStatus)
{
case Transmission:
run->AddTransmission();
break;
case FresnelRefraction:
run->AddFresnelRefraction();
analysisMan->FillH1(17, px1);
analysisMan->FillH1(18, py1);
analysisMan->FillH1(19, pz1);
// transmission
analysisMan->FillH1(20, angle / deg);
break;
case FresnelReflection:
run->AddFresnelReflection();
analysisMan->FillH1(21, angle / deg);
break;
case TotalInternalReflection:
run->AddTotalInternalReflection();
analysisMan->FillH1(21, angle / deg);
break;
case LambertianReflection:
run->AddLambertianReflection();
break;
case LobeReflection:
run->AddLobeReflection();
break;
case SpikeReflection:
run->AddSpikeReflection();
break;
case BackScattering:
run->AddBackScattering();
break;
case Absorption:
run->AddAbsorption();
break;
case Detection:
run->AddDetection();
break;
case NotAtBoundary:
run->AddNotAtBoundary();
break;
case SameMaterial:
run->AddSameMaterial();
break;
case StepTooSmall:
run->AddStepTooSmall();
break;
case NoRINDEX:
run->AddNoRINDEX();
break;
case PolishedLumirrorAirReflection:
run->AddPolishedLumirrorAirReflection();
break;
case PolishedLumirrorGlueReflection:
run->AddPolishedLumirrorGlueReflection();
break;
case PolishedAirReflection:
run->AddPolishedAirReflection();
break;
case PolishedTeflonAirReflection:
run->AddPolishedTeflonAirReflection();
break;
case PolishedTiOAirReflection:
run->AddPolishedTiOAirReflection();
break;
case PolishedTyvekAirReflection:
run->AddPolishedTyvekAirReflection();
break;
case PolishedVM2000AirReflection:
run->AddPolishedVM2000AirReflection();
break;
case PolishedVM2000GlueReflection:
run->AddPolishedVM2000AirReflection();
break;
case EtchedLumirrorAirReflection:
run->AddEtchedLumirrorAirReflection();
break;
case EtchedLumirrorGlueReflection:
run->AddEtchedLumirrorGlueReflection();
break;
case EtchedAirReflection:
run->AddEtchedAirReflection();
break;
case EtchedTeflonAirReflection:
run->AddEtchedTeflonAirReflection();
break;
case EtchedTiOAirReflection:
run->AddEtchedTiOAirReflection();
break;
case EtchedTyvekAirReflection:
run->AddEtchedTyvekAirReflection();
break;
case EtchedVM2000AirReflection:
run->AddEtchedVM2000AirReflection();
break;
case EtchedVM2000GlueReflection:
run->AddEtchedVM2000AirReflection();
break;
case GroundLumirrorAirReflection:
run->AddGroundLumirrorAirReflection();
break;
case GroundLumirrorGlueReflection:
run->AddGroundLumirrorGlueReflection();
break;
case GroundAirReflection:
run->AddGroundAirReflection();
break;
case GroundTeflonAirReflection:
run->AddGroundTeflonAirReflection();
break;
case GroundTiOAirReflection:
run->AddGroundTiOAirReflection();
break;
case GroundTyvekAirReflection:
run->AddGroundTyvekAirReflection();
break;
case GroundVM2000AirReflection:
run->AddGroundVM2000AirReflection();
break;
case GroundVM2000GlueReflection:
run->AddGroundVM2000AirReflection();
break;
case Dichroic:
run->AddDichroic();
break;
default:
G4cout << "theStatus: " << theStatus
<< " was none of the above." << G4endl;
break;
}
}
}
}
}
}
else { // particle != opticalphoton
else
{ // particle != opticalphoton
// print how many Cerenkov and scint photons produced this step
// this demonstrates use of GetNumPhotons()
auto proc_man = track->GetDynamicParticle()->GetParticleDefinition()
->GetProcessManager();
G4int n_proc = proc_man->GetPostStepProcessVector()->entries();
auto proc_man =
track->GetDynamicParticle()->GetParticleDefinition()->GetProcessManager();
G4ProcessVector* proc_vec = proc_man->GetPostStepProcessVector(typeDoIt);
G4int n_proc = proc_vec->entries();
G4int n_scint = 0;
G4int n_cer = 0;
for (G4int i = 0; i < n_proc; ++i) {
for(G4int i = 0; i < n_proc; ++i)
{
G4String proc_name = (*proc_vec)[i]->GetProcessName();
if (proc_name.compare("Cerenkov") == 0) {
auto cer = (G4Cerenkov*)(*proc_vec)[i];
n_cer = cer->GetNumPhotons();
if(proc_name.compare("Cerenkov") == 0)
{
auto cer = (G4Cerenkov*) (*proc_vec)[i];
n_cer = cer->GetNumPhotons();
}
else if (proc_name.compare("Scintillation") == 0) {
auto scint = (G4Scintillation*)(*proc_vec)[i];
n_scint = scint->GetNumPhotons();
else if(proc_name.compare("Scintillation") == 0)
{
auto scint = (G4Scintillation*) (*proc_vec)[i];
n_scint = scint->GetNumPhotons();
}
}
if (fVerbose > 0) {
if (n_cer > 0 || n_scint > 0) {
G4cout << "In this step, " << n_cer
<< " Cerenkov and " << n_scint
if(fVerbose > 0)
{
if(n_cer > 0 || n_scint > 0)
{
G4cout << "In this step, " << n_cer << " Cerenkov and " << n_scint
<< " scintillation photons were produced." << G4endl;
}
}
// loop over secondaries, create statistics
const std::vector<const G4Track*>* secondaries =
step->GetSecondaryInCurrentStep();
step->GetSecondaryInCurrentStep();
for (auto sec : *secondaries) {
if (sec->GetDynamicParticle()->GetParticleDefinition() == opticalphoton){
for(auto sec : *secondaries)
{
if(sec->GetDynamicParticle()->GetParticleDefinition() == opticalphoton)
{
G4String creator_process = sec->GetCreatorProcess()->GetProcessName();
if (creator_process.compare("Cerenkov") == 0){
if(creator_process.compare("Cerenkov") == 0)
{
G4double en = sec->GetKineticEnergy();
run->AddCerenkovEnergy(en);
run->AddCerenkov();
analysisMan->FillH1(1, en/eV);
analysisMan->FillH1(1, en / eV);
}
else if (creator_process.compare("Scintillation") == 0) {
else if(creator_process.compare("Scintillation") == 0)
{
G4double en = sec->GetKineticEnergy();
run->AddScintillationEnergy(en);
run->AddScintillation();
analysisMan->FillH1(2, en/eV);
analysisMan->FillH1(2, en / eV);
G4double time = sec->GetGlobalTime();
analysisMan->FillH1(3, time/ns);
analysisMan->FillH1(3, time / ns);
}
}
}
}
}
return;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -30,11 +30,13 @@
//
#include "TrackInformation.hh"
#include "G4ios.hh"
#include "G4SystemOfUnits.hh"
G4ThreadLocal G4Allocator<TrackInformation> *
aTrackInformationAllocator = 0;
#include "G4ios.hh"
#include "G4SystemOfUnits.hh"
#include "G4Track.hh"
G4ThreadLocal G4Allocator<TrackInformation>* aTrackInformationAllocator =
nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackInformation::TrackInformation()
@@ -51,19 +53,18 @@ TrackInformation::TrackInformation(const G4Track*)
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackInformation ::TrackInformation(const TrackInformation* aTrackInfo)
TrackInformation::TrackInformation(const TrackInformation* aTrackInfo)
: G4VUserTrackInformation()
{
fFirstTankX = aTrackInfo->fFirstTankX;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackInformation::~TrackInformation()
{;}
TrackInformation::~TrackInformation() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackInformation& TrackInformation::operator=
(const TrackInformation& aTrackInfo)
TrackInformation& TrackInformation::operator=(
const TrackInformation& aTrackInfo)
{
fFirstTankX = aTrackInfo.fFirstTankX;
@@ -79,8 +80,7 @@ void TrackInformation::SetSourceTrackInformation(const G4Track*)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TrackInformation::Print() const
{
G4cout
<< "first time track incident on X: " << fFirstTankX << G4endl;
G4cout << "first time track incident on X: " << fFirstTankX << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -29,45 +29,45 @@
//
#include "TrackingAction.hh"
#include "TrackInformation.hh"
#include "G4TrackingManager.hh"
#include "G4Track.hh"
#include "G4TrackingManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackingAction::TrackingAction()
:G4UserTrackingAction()
{;}
: G4UserTrackingAction()
{}
void TrackingAction::PreUserTrackingAction(const G4Track* aTrack)
{
// Create trajectory only for track in tracking region
TrackInformation* trackInfo =
(TrackInformation*)(aTrack->GetUserInformation());
TrackInformation* trackInfo =
(TrackInformation*) (aTrack->GetUserInformation());
if (!trackInfo) {
trackInfo = new TrackInformation(aTrack);
if(!trackInfo)
{
trackInfo = new TrackInformation(aTrack);
trackInfo->SetIsFirstTankX(true);
aTrack->SetUserInformation(trackInfo);
}
trackInfo->SetIsFirstTankX(true);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
{
G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries();
if (secondaries)
if(secondaries)
{
TrackInformation* info =
(TrackInformation*)(aTrack->GetUserInformation());
size_t nSeco = secondaries->size();
if (nSeco > 0)
TrackInformation* info = (TrackInformation*) (aTrack->GetUserInformation());
size_t nSeco = secondaries->size();
if(nSeco > 0)
{
for(size_t i=0; i < nSeco; i++)
{
for(size_t i = 0; i < nSeco; ++i)
{
TrackInformation* infoNew = new TrackInformation(info);
(*secondaries)[i]->SetUserInformation(infoNew);
}
@@ -1,86 +0,0 @@
/control/verbose 2
/tracking/verbose 0
/opnovice2/boxProperty RINDEX 0.000002 1.3 0.000008 1.4
/opnovice2/boxProperty ABSLENGTH 0.000002 1000000 0.000005 2000000 0.000008 3000000
/opnovice2/worldProperty RINDEX 0.000002 1.01 0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 1000000 0.000005 2000000 0.000008 3000000
/opnovice2/surfaceModel unified
/opnovice2/surfaceType dielectric_dielectric
############################# ground ################################
/opnovice2/surfaceFinish ground
/opnovice2/surfaceSigmaAlpha 0.2
/opnovice2/surfaceProperty SPECULARLOBECONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty SPECULARSPIKECONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty BACKSCATTERCONSTANT 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty TRANSMITTANCE 0.000002 0.1 0.000008 0.1
/opnovice2/surfaceProperty REFLECTIVITY 0.000002 0.8 0.000008 0.8
/opnovice2/surfaceProperty EFFICIENCY 0.000002 0.1 0.000008 0.1
/run/initialize
#
/gun/particle opticalphoton
/gun/energy 3 eV
/gun/position 0 0 0 cm
/gun/direction 1 0 0
/opnovice2/gun/optPhotonPolar
#
/analysis/setFileName unified
/analysis/h1/set 10 40 -1 39
/analysis/h1/set 11 100 -1.1 1.1
/analysis/h1/set 12 100 -1.1 1.1
/analysis/h1/set 13 100 -1.1 1.1
/analysis/h1/set 14 100 -1.1 1.1
/analysis/h1/set 15 100 -1.1 1.1
/analysis/h1/set 16 100 -1.1 1.1
/analysis/h1/set 17 100 -1.1 1.1
/analysis/h1/set 18 100 -1.1 1.1
/analysis/h1/set 19 100 -1.1 1.1
/run/beamOn 10000
############################# polished ########################################
/opnovice2/surfaceFinish polished
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceConstProperty SURFACEROUGHNESS 0.01
/run/initialize
/run/beamOn 10000
############################# painted #########################################
/opnovice2/surfaceFinish polishedfrontpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish polishedbackpainted
/opnovice2/surfaceSigmaAlpha 0.0
/opnovice2/surfaceProperty RINDEX 0.000002 1.4 0.000008 1.5
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish groundfrontpainted
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish groundbackpainted
/run/initialize
/run/beamOn 10000
############################# dielectric_metal ################################
/opnovice2/surfaceType dielectric_metal
/opnovice2/surfaceFinish polished
/run/initialize
/run/beamOn 10000
/opnovice2/surfaceFinish ground
/run/initialize
/run/beamOn 10000
+8 -19
View File
@@ -1,6 +1,7 @@
/control/verbose 2
/tracking/verbose 0
/process/optical/verbose 0
/run/verbose 1
/process/optical/verbose 1
/control/cout/ignoreThreadsExcept 0
/opnovice2/boxMaterial G4_BGO
@@ -28,25 +29,13 @@
/analysis/setFileName wls
## WLS process
/analysis/h1/set 4 100 0 10
/analysis/h1/setXaxis 4 "Energy [eV]"
/analysis/h1/setYaxis 4 "Number of photons"
/analysis/h1/set 5 100 0 10
/analysis/h1/setXaxis 5 "Energy [eV]"
/analysis/h1/setYaxis 5 "Number of photons"
/analysis/h1/set 6 100 0 10
/analysis/h1/setXaxis 6 "Creation time [ns]"
/analysis/h1/setYaxis 6 "Number of photons"
/analysis/h1/set 4 100 0 10 # eV
/analysis/h1/set 5 100 0 10 # eV
/analysis/h1/set 6 100 0 10 # ns
## WLS2 process
/analysis/h1/set 7 100 0 10
/analysis/h1/setXaxis 7 "Energy [eV]"
/analysis/h1/setYaxis 7 "Number of photons"
/analysis/h1/set 8 100 0 10
/analysis/h1/setXaxis 8 "Energy [eV]"
/analysis/h1/setYaxis 8 "Number of photons"
/analysis/h1/set 9 100 0 50
/analysis/h1/setXaxis 9 "Creation time [ns]"
/analysis/h1/setYaxis 9 "Number of photons"
/analysis/h1/set 7 100 0 10 # eV
/analysis/h1/set 8 100 0 10 # eV
/analysis/h1/set 9 100 0 50 # ns
/gun/particle opticalphoton