Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
+7
View File
@@ -8,6 +8,13 @@
This directory includes examples demonstrating the use of optical processes
in the simulation.
\link ExampleOpNovice OpNovice \endlink
Simulation of optical photons generation and transport.
Defines optical surfaces and exercises optical physics processes
(Cerenkov, Scintillation, Absorption, Rayleigh, ...). Uses stacking
mechanism to count the secondary particles generated.
\link ExampleLXe LXe \endlink
Multi-purpose detector setup implementing:
+1
View File
@@ -2,5 +2,6 @@
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
add_subdirectory(OpNovice)
add_subdirectory(LXe)
add_subdirectory(wls)
+9
View File
@@ -15,6 +15,15 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
27 May 2013 Peter Gumplinger (exOptical-V09-06-02)
- Collect all coding guideline changes, also those from Ivana Hrivnacova
1 April 2013 Andrea Dotti (exOptical-V09-06-01)
- Grouping changes in examples for new API physics list classes needed for MT
17 December 2012 Peter Gumplinger (exOptical-V09-06-00)
- add OpNovice which is the original /novice/N06 example
15 November 2012 Ivana Hrivnacova (exOptical-V09-05-01)
- Minor fixes in .README files
+12 -2
View File
@@ -40,8 +40,18 @@ target_link_libraries(LXe ${Geant4_LIBRARIES} )
# relies on these scripts being in the current working directory.
#
set(LXe_SCRIPTS
cerenkov.mac defaults.mac LXe.in LXe.out photon.mac reviewEvent.mac vis.mac wls.mac
)
LXe.out
LXe.in
defaults.mac
cerenkov.mac
wls.mac
photon.mac
reviewEvent.mac
gui.mac
icons.mac
run.png
vis.mac
)
foreach(_script ${LXe_SCRIPTS})
configure_file(
+1 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 2004-06-01 07:05:03 gcosmo Exp $
# $Id: GNUmakefile 68752 2013-04-05 10:23:47Z gcosmo $
# --------------------------------------------------------------
# GNUmakefile for LXe example.
# --------------------------------------------------------------
+61 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.15 2010-10-25 15:16:41 gunter Exp $
$Id: History 77882 2013-11-29 08:39:07Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -15,6 +15,66 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
November 28, 2013 P. Gumplinger (LXe-V09-06-17)
- add icons.mac run.png
November 27, 2013 P. Gumplinger (LXe-V09-06-15 and 16)
- Fixed ConstructSDandField():
Moved setting the SD and field manager to logical volume outside the tests
- Put back cleaning volumes and solid stores in Construct()
- add gui.mac
November 25, 2013 P. Gumplinger (LXe-V09-06-14)
- Fixed compilation warnings for data not used in LXeWLSFiber.hh and
LXeWLSSlab.hh.
November 25, 2013 P. Gumplinger (LXe-V09-06-13)
- bug fix a divided by zero
November 22, 2013 P. Gumplinger (LXe-V09-06-12)
- replace Update method and commands with ReinitializeGeometry
October 29, 2013 P. Gumplinger (LXe-V09-06-11)
- remove all reference to LXeWorkerInitialization and SetNumberOfThreads
October 25, 2013 P. Gumplinger (LXe-V09-06-10)
- Instantiate SteppingVerbose in a new method in LXeActionInitialization
and removed LXeWorkerInitialization (not needed anymore)
September 20, 2013 Ivana Hrivnacova (LXe-V09-06-09)
- Fixed setting of sensitive detectors to logical volumes
September 13, 2013 Peter Gumplinger (LXe-V09-06-08)
- apply all of Ivana's modifications to make the code MT ready
July 16, 2013 Ivana Hrivnacova (LXe-V09-06-07)
- Make LXeTrajectoryAllocator thread local (required for MT)
July 11, 2013 Ivana Hrivnacova (LXe-V09-06-06)
- Added missing G4ThreadLocal keyword for the *HitAllocator definition
in LXePMTHit.cc, LXeScintHit.cc
May 27, 2013 P. Gumplinger (LXe-V09-06-05)
- coding guideline - line length < 80 for LXeSteppingMessenger
and LXeEventMessenger
Apr 05, 2013 P. Gumplinger (LXe-V09-06-04)
- properly initialize fExpectedNextStatus at the first step
Apr 05, 2013 P. Gumplinger (LXe-V09-06-03)
- rename to aParticleIterator as per A. Dotti
Apr 05, 2013 P. Gumplinger (LXe-V09-06-02)
- fix geometry overlap
Apr 01, 2013 A. Dotti (LXe-V09-06-01)
- Migrate to new G4VUserPhysicsList interface needed for MT
Dec 02, 2012 J.Allison (LXe-V09-06-00)
Migration to DrawTrajectory() (i_mode argument is no longer available):
o LXeTrajectory.cc: Removed DrawTrajectory(G4int i_mode).
o LXeEventAction.cc: Removed argument from DrawTrajectory().
16 November 2012 Gunter Folger (LXe-V09-05-02)
- reduce size of LXe.out, and remove tracking/verbose 1, responsible for the
size of the output
+31 -23
View File
@@ -23,22 +23,26 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXe.cc 77782 2013-11-28 08:12:12Z gcosmo $
//
/// \file optical/LXe/LXe.cc
/// \brief Main program of the optical/LXe example
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
#include "G4RunManager.hh"
#endif
#include "G4UImanager.hh"
#include "G4String.hh"
#include "LXeDetectorConstruction.hh"
#include "LXePhysicsList.hh"
#include "LXePrimaryGeneratorAction.hh"
#include "LXeEventAction.hh"
#include "LXeStackingAction.hh"
#include "LXeSteppingAction.hh"
#include "LXeTrackingAction.hh"
#include "LXeRunAction.hh"
#include "LXeSteppingVerbose.hh"
#include "LXeDetectorConstruction.hh"
#include "LXeActionInitialization.hh"
#include "LXeRecorderBase.hh"
@@ -50,30 +54,30 @@
#include "G4UIExecutive.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc, char** argv)
{
G4VSteppingVerbose::SetInstance(new LXeSteppingVerbose);
#ifdef G4MULTITHREADED
G4MTRunManager * runManager = new G4MTRunManager;
#else
G4RunManager * runManager = new G4RunManager;
#endif
G4RunManager* runManager = new G4RunManager;
runManager->SetUserInitialization(new LXeDetectorConstruction());
runManager->SetUserInitialization(new LXePhysicsList());
runManager->SetUserInitialization(new LXeDetectorConstruction);
runManager->SetUserInitialization(new LXePhysicsList);
LXeRecorderBase* recorder = NULL; //No recording is done in this example
runManager->SetUserInitialization(new LXeActionInitialization(recorder));
#ifdef G4VIS_USE
G4VisManager* visManager = new G4VisExecutive;
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
// G4VisManager* visManager = new G4VisExecutive("Quiet");
visManager->Initialize();
#endif
LXeRecorderBase* recorder = NULL;//No recording is done in this example
runManager->SetUserAction(new LXePrimaryGeneratorAction);
runManager->SetUserAction(new LXeStackingAction);
runManager->SetUserAction(new LXeRunAction(recorder));
runManager->SetUserAction(new LXeEventAction(recorder));
runManager->SetUserAction(new LXeTrackingAction(recorder));
runManager->SetUserAction(new LXeSteppingAction(recorder));
// runManager->Initialize();
// get the pointer to the UI manager and set verbosities
@@ -85,6 +89,8 @@ int main(int argc, char** argv)
#ifdef G4VIS_USE
UImanager->ApplyCommand("/control/execute vis.mac");
#endif
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute gui.mac");
ui->SessionStart();
delete ui;
#endif
@@ -95,7 +101,7 @@ int main(int argc, char** argv)
UImanager->ApplyCommand(command+filename);
}
if(recorder)delete recorder;
// if(recorder)delete recorder;
#ifdef G4VIS_USE
delete visManager;
@@ -105,3 +111,5 @@ int main(int argc, char** argv)
delete runManager;
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+8 -11
View File
@@ -5,21 +5,18 @@
#**
#**************
/run/verbose 1
/tracking/verbose 1
#/LXe/detector/MainScintYield 100
/LXe/saveThreshold 1000
/LXe/pmtThreshold 2
#/LXe/forceDrawPhotons true
#/LXe/forceDrawNoPhotons false
/LXe/eventVerbose 1
#/tracking/verbose 1
#/optics_engine/selectOpProcess Scintillation
#/optics_engine/setOpProcessUse false
#/optics_engine/setOpProcessVerbose 1
#/optics_engine/setTrackSecondariesFirst false
/run/initialize
/LXe/saveThreshold 1000
/LXe/pmtThreshold 2
/LXe/eventVerbose 1
#/LXe/forceDrawPhotons true #/LXe/forceDrawNoPhotons false
#/optics_engine/selectOpProcess OpBoundary
#/optics_engine/setOpProcessVerbose 0
#/optics_engine/setOpProcessVerbose 1
/optics_engine/selectOpProcess Scintillation
#/optics_engine/setOpProcessVerbose 0
#/optics_engine/setOpProcessVerbose 1
/optics_engine/setTrackSecondariesFirst false
/run/beamOn 3
/run/beamOn 1
File diff suppressed because it is too large Load Diff
@@ -40,6 +40,9 @@
#5) Run a wls event
/control/execute wls.mac
#/optics_engine/selectOpProcess OpBoundary
#/optics_engine/setOpProcessVerbose 1
#/tracking/verbose 1
/run/beamOn
#You will see a number of green and red trajectories drawn. The green ones
+48
View File
@@ -0,0 +1,48 @@
#
# This file permits to customize, with commands,
# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
#
# Add icons of general interest
#
/control/execute icons.mac
#
# File menu :
/gui/addMenu file File
/gui/addButton file Quit exit
#
# Run menu :
/gui/addMenu run Run
/gui/addButton run "beamOn 1" "/run/beamOn 1"
/gui/addButton run run1 "/control/execute run1.mac"
/gui/addButton run run2 "/control/execute run2.mac"
#
# Gun menu :
/gui/addMenu gun Gun
/gui/addButton gun "50 MeV" "/gun/energy 50 MeV"
/gui/addButton gun "1 GeV" "/gun/energy 1 GeV"
/gui/addButton gun "10 GeV" "/gun/energy 10 GeV"
/gui/addButton gun "e-" "/gun/particle e-"
/gui/addButton gun "pi0" "/gun/particle pi0"
/gui/addButton gun "pi+" "/gun/particle pi+"
/gui/addButton gun "neutron" "/gun/particle neutron"
/gui/addButton gun "proton" "/gun/particle proton"
#
# Field menu :
/gui/addMenu field Field
/gui/addButton field "off" "/B2/det/setField 0.2 tesla"
/gui/addButton field "0.2 tesla" "/B2/det/setField 0.2 tesla"
/gui/addButton field "2.0 tesla" "/B2/det/setField 2.0 tesla"
#
# Viewer menu :
/gui/addMenu viewer Viewer
/gui/addButton viewer "Set style surface" "/vis/viewer/set/style surface"
/gui/addButton viewer "Set style wireframe" "/vis/viewer/set/style wire"
/gui/addButton viewer "Refresh viewer" "/vis/viewer/refresh"
/gui/addButton viewer "Update viewer (interaction or end-of-file)" "/vis/viewer/update"
/gui/addButton viewer "Flush viewer (= refresh + update)" "/vis/viewer/flush"
/gui/addButton viewer "Update scene" "/vis/scene/notifyHandlers"
#
# User defined icon :
/gui/addIcon "Run beam on" user_icon "/run/beamOn 1" run.png
+26
View File
@@ -0,0 +1,26 @@
#
# This file permits to customize, with commands,
# the icon menu bar of the G4UIQt sessions not yet implemented other UI drivers (geant4-09-05-ref-09)
# It has no effect with G4UIterminal.
# open/save icons
/gui/addIcon "Open macro file" open /control/execute
/gui/addIcon "Save viewer state" save /vis/viewer/save
# Cursors style icons
/gui/addIcon "Move" move
/gui/addIcon "Pick" pick
/gui/addIcon "Zoom out" zoom_out
/gui/addIcon "Zoom in" zoom_in
/gui/addIcon "Rotate" rotate
# Surface Style icons
# Surface Style icons
/gui/addIcon "Hidden line removal" hidden_line_removal
/gui/addIcon "Hidden line and hidden surface removal" hidden_line_and_surface_removal
/gui/addIcon "Surfaces" solid
/gui/addIcon "Wireframe" wireframe
# Perspective/Ortho icons
/gui/addIcon "Perspective" perspective
/gui/addIcon "Orthographic" ortho
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeActionInitialization.hh 68058 2013-03-13 14:47:43Z gcosmo $
//
/// \file LXeActionInitialization.hh
/// \brief Definition of the LXeActionInitialization class
#ifndef LXeActionInitialization_h
#define LXeActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
class LXeRecorderBase;
class B4DetectorConstruction;
/// Action initialization class.
///
class LXeActionInitialization : public G4VUserActionInitialization
{
public:
LXeActionInitialization(LXeRecorderBase*);
virtual ~LXeActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
virtual G4VSteppingVerbose* InitializeSteppingVerbose() const;
private:
LXeRecorderBase* fRecorder;
};
#endif
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeDetectorConstruction.hh 77486 2013-11-25 10:14:16Z gcosmo $
//
/// \file optical/LXe/include/LXeDetectorConstruction.hh
/// \brief Definition of the LXeDetectorConstruction class
//
@@ -34,15 +36,19 @@ class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Box;
class G4Tubs;
class LXePMTSD;
class LXeScintSD;
class LXeMainVolume;
class G4Sphere;
#include "G4Material.hh"
#include "LXeDetectorMessenger.hh"
#include "G4VisAttributes.hh"
#include "G4RotationMatrix.hh"
#include "LXeScintSD.hh"
#include "LXePMTSD.hh"
#include "G4VUserDetectorConstruction.hh"
#include "G4Cache.hh"
class LXeDetectorConstruction : public G4VUserDetectorConstruction
{
@@ -52,6 +58,7 @@ class LXeDetectorConstruction : public G4VUserDetectorConstruction
virtual ~LXeDetectorConstruction();
virtual G4VPhysicalVolume* Construct();
virtual void ConstructSDandField();
//Functions to modify the geometry
void SetDimensions(G4ThreeVector );
@@ -63,33 +70,29 @@ class LXeDetectorConstruction : public G4VUserDetectorConstruction
void SetDefaults();
//Get values
G4int GetNX(){return fNx;}
G4int GetNY(){return fNy;}
G4int GetNZ(){return fNz;}
G4double GetScintX(){return fScint_x;}
G4double GetScintY(){return fScint_y;}
G4double GetScintZ(){return fScint_z;}
G4double GetHousingThickness(){return fD_mtl;}
G4int GetNX(){return fNx;}
G4int GetNY(){return fNy;}
G4int GetNZ(){return fNz;}
G4double GetPMTRadius(){return fOuterRadius_pmt;}
G4double GetSlabZ(){return fSlab_z;}
//rebuild the geometry based on changes. must be called
void UpdateGeometry();
G4bool GetUpdated(){return fUpdated;}
void SetSphereOn(G4bool b){fSphereOn=b; fUpdated=true;}
void SetSphereOn(G4bool );
static G4bool GetSphereOn(){return fSphereOn;}
void SetHousingReflectivity(G4double r){fRefl=r; fUpdated=true;}
void SetHousingReflectivity(G4double );
G4double GetHousingReflectivity(){return fRefl;}
void SetWLSSlabOn(G4bool b){fWLSslab=b; fUpdated=true;}
void SetWLSSlabOn(G4bool b);
G4bool GetWLSSlabOn(){return fWLSslab;}
void SetMainVolumeOn(G4bool b){fMainVolume=b; fUpdated=true;}
G4bool GetMainVolumeOn(){return fMainVolume;}
void SetMainVolumeOn(G4bool b);
G4bool GetMainVolumeOn(){return fMainVolumeOn;}
void SetNFibers(G4int n){fNfibers=n; fUpdated=true;}
void SetNFibers(G4int n);
G4int GetNFibers(){return fNfibers;}
void SetMainScintYield(G4double );
@@ -102,8 +105,6 @@ class LXeDetectorConstruction : public G4VUserDetectorConstruction
LXeDetectorMessenger* fDetectorMessenger;
G4bool fUpdated;
G4Box* fExperimentalHall_box;
G4LogicalVolume* fExperimentalHall_log;
G4VPhysicalVolume* fExperimentalHall_phys;
@@ -136,12 +137,18 @@ class LXeDetectorConstruction : public G4VUserDetectorConstruction
static G4bool fSphereOn;
G4double fRefl;
G4bool fWLSslab;
G4bool fMainVolume;
G4bool fMainVolumeOn;
G4double fSlab_z;
LXeMainVolume* fMainVolume;
G4MaterialPropertiesTable* fLXe_mt;
G4MaterialPropertiesTable* fMPTPStyrene;
//Sensitive Detectors
G4Cache<LXeScintSD*> fScint_SD;
G4Cache<LXePMTSD*> fPmt_SD;
};
#endif
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeDetectorMessenger.hh 77486 2013-11-25 10:14:16Z gcosmo $
//
/// \file optical/LXe/include/LXeDetectorMessenger.hh
/// \brief Definition of the LXeDetectorMessenger class
//
@@ -67,10 +69,9 @@ class LXeDetectorMessenger: public G4UImessenger
G4UIcmdWithABool* fWlsCmd;
G4UIcmdWithABool* fLxeCmd;
G4UIcmdWithAnInteger* fNFibersCmd;
G4UIcommand* fUpdateCmd;
G4UIcommand* fDefaultsCmd;
G4UIcmdWithADouble* fMainScintYield;
G4UIcmdWithADouble* fWLSScintYield;
G4UIcmdWithADouble* fMainScintYield;
G4UIcmdWithADouble* fWLSScintYield;
};
#endif
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeEMPhysics.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeEMPhysics.hh
/// \brief Definition of the LXeEMPhysics class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeEventAction.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeEventAction.hh
/// \brief Definition of the LXeEventAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeEventMessenger.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeEventMessenger.hh
/// \brief Definition of the LXeEventMessenger class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeGeneralPhysics.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeGeneralPhysics.hh
/// \brief Definition of the LXeGeneralPhysics class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeMainVolume.hh 77486 2013-11-25 10:14:16Z gcosmo $
//
/// \file optical/LXe/include/LXeMainVolume.hh
/// \brief Definition of the LXeMainVolume class
//
@@ -50,20 +52,25 @@ class LXeMainVolume : public G4PVPlacement
G4int pCopyNo,
LXeDetectorConstruction* c);
G4LogicalVolume* GetLogPhotoCath() {return fPhotocath_log;}
G4LogicalVolume* GetLogScint() {return fScint_log;}
std::vector<G4ThreeVector> GetPmtPositions() {return fPmtPositions;}
private:
void VisAttributes();
void SurfaceProperties();
void PlacePMTs(G4LogicalVolume* pmt_Log,
G4RotationMatrix* rot, G4double &a, G4double &b, G4double da,
G4double db, G4double amin, G4double bmin, G4int na, G4int nb,
G4double &x, G4double &y, G4double &z, G4int &k,LXePMTSD* sd);
G4RotationMatrix* rot,
G4double &a, G4double &b, G4double da,
G4double db, G4double amin, G4double bmin,
G4int na, G4int nb,
G4double &x, G4double &y, G4double &z, G4int &k);
void CopyValues();
G4bool fUpdated;
LXeDetectorConstruction* fConstructor;
G4double fScint_x;
@@ -88,14 +95,14 @@ class LXeMainVolume : public G4PVPlacement
// Logical volumes
//
G4LogicalVolume* fScint_log;
static G4LogicalVolume* fHousing_log;
G4LogicalVolume* fHousing_log;
G4LogicalVolume* fPmt_log;
G4LogicalVolume* fPhotocath_log;
G4LogicalVolume* fSphere_log;
//Sensitive Detectors
static LXeScintSD* fScint_SD;
static LXePMTSD* fPmt_SD;
// Sensitive Detectors positions
std::vector<G4ThreeVector> fPmtPositions;
};
#endif
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeMuonPhysics.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeMuonPhysics.hh
/// \brief Definition of the LXeMuonPhysics class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePMTHit.hh 72250 2013-07-12 08:59:26Z gcosmo $
//
/// \file optical/LXe/include/LXePMTHit.hh
/// \brief Definition of the LXePMTHit class
//
@@ -39,6 +41,8 @@
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "tls.hh"
class G4VTouchable;
class LXePMTHit : public G4VHit
@@ -88,16 +92,16 @@ class LXePMTHit : public G4VHit
typedef G4THitsCollection<LXePMTHit> LXePMTHitsCollection;
extern G4Allocator<LXePMTHit> LXePMTHitAllocator;
extern G4ThreadLocal G4Allocator<LXePMTHit>* LXePMTHitAllocator;
inline void* LXePMTHit::operator new(size_t){
void *aHit;
aHit = (void *) LXePMTHitAllocator.MallocSingle();
return aHit;
if(!LXePMTHitAllocator)
LXePMTHitAllocator = new G4Allocator<LXePMTHit>;
return (void *) LXePMTHitAllocator->MallocSingle();
}
inline void LXePMTHit::operator delete(void *aHit){
LXePMTHitAllocator.FreeSingle((LXePMTHit*) aHit);
LXePMTHitAllocator->FreeSingle((LXePMTHit*) aHit);
}
#endif
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePMTSD.hh 73915 2013-09-17 07:32:26Z gcosmo $
//
/// \file optical/LXe/include/LXePMTSD.hh
/// \brief Definition of the LXePMTSD class
//
@@ -34,6 +36,8 @@
#include "G4VSensitiveDetector.hh"
#include "LXePMTHit.hh"
#include <vector>
class G4Step;
class G4HCofThisEvent;
@@ -67,11 +71,7 @@ class LXePMTSD : public G4VSensitiveDetector
}
//Store a pmt position
inline void SetPMTPos(G4int n,G4double x,G4double y,G4double z){
if(fPMTPositionsX)fPMTPositionsX->insertAt(n,x);
if(fPMTPositionsY)fPMTPositionsY->insertAt(n,y);
if(fPMTPositionsZ)fPMTPositionsZ->insertAt(n,z);
}
void SetPmtPositions(const std::vector<G4ThreeVector>& positions);
private:
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePhysicsList.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXePhysicsList.hh
/// \brief Definition of the LXePhysicsList class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePrimaryGeneratorAction.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXePrimaryGeneratorAction.hh
/// \brief Definition of the LXePrimaryGeneratorAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeRecorderBase.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeRecorderBase.hh
/// \brief Definition of the LXeRecorderBase class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeRunAction.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeRunAction.hh
/// \brief Definition of the LXeRunAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeScintHit.hh 72250 2013-07-12 08:59:26Z gcosmo $
//
/// \file optical/LXe/include/LXeScintHit.hh
/// \brief Definition of the LXeScintHit class
//
@@ -39,6 +41,8 @@
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "tls.hh"
class LXeScintHit : public G4VHit
{
public:
@@ -74,18 +78,18 @@ class LXeScintHit : public G4VHit
typedef G4THitsCollection<LXeScintHit> LXeScintHitsCollection;
extern G4Allocator<LXeScintHit> LXeScintHitAllocator;
extern G4ThreadLocal G4Allocator<LXeScintHit>* LXeScintHitAllocator;
inline void* LXeScintHit::operator new(size_t)
{
void *aHit;
aHit = (void *) LXeScintHitAllocator.MallocSingle();
return aHit;
if(!LXeScintHitAllocator)
LXeScintHitAllocator = new G4Allocator<LXeScintHit>;
return (void *) LXeScintHitAllocator->MallocSingle();
}
inline void LXeScintHit::operator delete(void *aHit)
{
LXeScintHitAllocator.FreeSingle((LXeScintHit*) aHit);
LXeScintHitAllocator->FreeSingle((LXeScintHit*) aHit);
}
#endif
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeScintSD.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeScintSD.hh
/// \brief Definition of the LXeScintSD class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeStackingAction.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeStackingAction.hh
/// \brief Definition of the LXeStackingAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeSteppingAction.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeSteppingAction.hh
/// \brief Definition of the LXeSteppingAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeSteppingMessenger.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeSteppingMessenger.hh
/// \brief Definition of the LXeSteppingMessenger class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeSteppingVerbose.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeSteppingVerbose.hh
/// \brief Definition of the LXeSteppingVerbose class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeTrackingAction.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeTrackingAction.hh
/// \brief Definition of the LXeTrackingAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeTrajectory.hh 72349 2013-07-16 12:13:16Z gcosmo $
//
/// \file optical/LXe/include/LXeTrajectory.hh
/// \brief Definition of the LXeTrajectory class
//
@@ -50,7 +52,6 @@ class LXeTrajectory : public G4Trajectory
virtual ~LXeTrajectory();
virtual void DrawTrajectory() const;
virtual void DrawTrajectory(G4int i_mode=0) const;
inline void* operator new(size_t);
inline void operator delete(void*);
@@ -69,18 +70,18 @@ class LXeTrajectory : public G4Trajectory
G4ParticleDefinition* fParticleDefinition;
};
extern G4Allocator<LXeTrajectory> LXeTrajectoryAllocator;
extern G4ThreadLocal G4Allocator<LXeTrajectory>* LXeTrajectoryAllocator;
inline void* LXeTrajectory::operator new(size_t)
{
void* aTrajectory;
aTrajectory = (void*)LXeTrajectoryAllocator.MallocSingle();
return aTrajectory;
if(!LXeTrajectoryAllocator)
LXeTrajectoryAllocator = new G4Allocator<LXeTrajectory>;
return (void*)LXeTrajectoryAllocator->MallocSingle();
}
inline void LXeTrajectory::operator delete(void* aTrajectory)
{
LXeTrajectoryAllocator.FreeSingle((LXeTrajectory*)aTrajectory);
LXeTrajectoryAllocator->FreeSingle((LXeTrajectory*)aTrajectory);
}
#endif
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeUserEventInformation.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeUserEventInformation.hh
/// \brief Definition of the LXeUserEventInformation class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeUserTrackInformation.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/include/LXeUserTrackInformation.hh
/// \brief Definition of the LXeUserTrackInformation class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeWLSFiber.hh 77664 2013-11-27 10:13:53Z gcosmo $
//
/// \file optical/LXe/include/LXeWLSFiber.hh
/// \brief Definition of the LXeWLSFiber class
//
@@ -56,8 +58,6 @@ class LXeWLSFiber : public G4PVPlacement
static G4LogicalVolume* fClad2_log;
G4bool fUpdated; //does the fiber need to be rebuilt
G4double fFiber_rmin;
G4double fFiber_rmax;
G4double fFiber_z;
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeWLSSlab.hh 77664 2013-11-27 10:13:53Z gcosmo $
//
/// \file optical/LXe/include/LXeWLSSlab.hh
/// \brief Definition of the LXeWLSSlab class
//
@@ -56,8 +58,6 @@ class LXeWLSSlab : public G4PVPlacement
LXeDetectorConstruction* fConstructor;
G4bool fUpdated;
static G4LogicalVolume* fScintSlab_log;
G4int fNfibers;
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,83 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeActionInitialization.cc 68058 2013-03-13 14:47:43Z gcosmo $
//
/// \file LXeActionInitialization.cc
/// \brief Implementation of the LXeActionInitialization class
#include "LXeActionInitialization.hh"
#include "LXePrimaryGeneratorAction.hh"
#include "LXeRunAction.hh"
#include "LXeEventAction.hh"
#include "LXeTrackingAction.hh"
#include "LXeSteppingAction.hh"
#include "LXeStackingAction.hh"
#include "LXeSteppingVerbose.hh"
#include "LXeRecorderBase.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeActionInitialization::LXeActionInitialization(LXeRecorderBase* recorder)
: G4VUserActionInitialization(), fRecorder(recorder)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeActionInitialization::~LXeActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeActionInitialization::BuildForMaster() const
{
SetUserAction(new LXeRunAction(fRecorder));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeActionInitialization::Build() const
{
SetUserAction(new LXePrimaryGeneratorAction());
SetUserAction(new LXeStackingAction());
SetUserAction(new LXeRunAction(fRecorder));
SetUserAction(new LXeEventAction(fRecorder));
SetUserAction(new LXeTrackingAction(fRecorder));
SetUserAction(new LXeSteppingAction(fRecorder));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VSteppingVerbose* LXeActionInitialization::InitializeSteppingVerbose() const
{
return new LXeSteppingVerbose();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeDetectorConstruction.cc 77882 2013-11-29 08:39:07Z gcosmo $
//
/// \file optical/LXe/src/LXeDetectorConstruction.cc
/// \brief Implementation of the LXeDetectorConstruction class
//
@@ -36,8 +38,14 @@
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "G4GeometryManager.hh"
#include "G4SolidStore.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4PhysicalVolumeStore.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4OpticalSurface.hh"
#include "G4MaterialTable.hh"
#include "G4VisAttributes.hh"
@@ -49,10 +57,6 @@
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "globals.hh"
#include "G4SolidStore.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4PhysicalVolumeStore.hh"
#include "G4GeometryManager.hh"
#include "G4UImanager.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
@@ -73,8 +77,6 @@ LXeDetectorConstruction::LXeDetectorConstruction()
fN = fO = fC = fH = NULL;
fUpdated = false;
SetDefaults();
fDetectorMessenger = new LXeDetectorMessenger(this);
@@ -223,6 +225,16 @@ void LXeDetectorConstruction::DefineMaterials(){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* LXeDetectorConstruction::Construct(){
if (fExperimentalHall_phys) {
G4GeometryManager::GetInstance()->OpenGeometry();
G4PhysicalVolumeStore::GetInstance()->Clean();
G4LogicalVolumeStore::GetInstance()->Clean();
G4SolidStore::GetInstance()->Clean();
G4LogicalSkinSurface::CleanSurfaceTable();
G4LogicalBorderSurface::CleanSurfaceTable();
}
DefineMaterials();
return ConstructDetector();
}
@@ -247,8 +259,9 @@ G4VPhysicalVolume* LXeDetectorConstruction::ConstructDetector()
fExperimentalHall_log->SetVisAttributes(G4VisAttributes::Invisible);
//Place the main volume
if(fMainVolume){
new LXeMainVolume(0,G4ThreeVector(),fExperimentalHall_log,false,0,this);
if(fMainVolumeOn){
fMainVolume
= new LXeMainVolume(0,G4ThreeVector(),fExperimentalHall_log,false,0,this);
}
//Place the WLS slab
@@ -288,51 +301,90 @@ G4VPhysicalVolume* LXeDetectorConstruction::ConstructDetector()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetDimensions(G4ThreeVector dims){
void LXeDetectorConstruction::ConstructSDandField() {
if (!fMainVolume) return;
// PMT SD
if (!fPmt_SD.Get()) {
//Created here so it exists as pmts are being placed
G4cout << "Construction /LXeDet/pmtSD" << G4endl;
LXePMTSD* pmt_SD = new LXePMTSD("/LXeDet/pmtSD");
fPmt_SD.Put(pmt_SD);
pmt_SD->InitPMTs((fNx*fNy+fNx*fNz+fNy*fNz)*2); //let pmtSD know # of pmts
pmt_SD->SetPmtPositions(fMainVolume->GetPmtPositions());
}
//sensitive detector is not actually on the photocathode.
//processHits gets done manually by the stepping action.
//It is used to detect when photons hit and get absorbed&detected at the
//boundary to the photocathode (which doesnt get done by attaching it to a
//logical volume.
//It does however need to be attached to something or else it doesnt get
//reset at the begining of events
SetSensitiveDetector(fMainVolume->GetLogPhotoCath(), fPmt_SD.Get());
// Scint SD
if (!fScint_SD.Get()) {
G4cout << "Construction /LXeDet/scintSD" << G4endl;
LXeScintSD* scint_SD = new LXeScintSD("/LXeDet/scintSD");
fScint_SD.Put(scint_SD);
}
SetSensitiveDetector(fMainVolume->GetLogScint(), fScint_SD.Get());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetDimensions(G4ThreeVector dims) {
this->fScint_x=dims[0];
this->fScint_y=dims[1];
this->fScint_z=dims[2];
fUpdated=true;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetHousingThickness(G4double d_mtl){
void LXeDetectorConstruction::SetHousingThickness(G4double d_mtl) {
this->fD_mtl=d_mtl;
fUpdated=true;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNX(G4int nx){
void LXeDetectorConstruction::SetNX(G4int nx) {
this->fNx=nx;
fUpdated=true;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNY(G4int ny){
void LXeDetectorConstruction::SetNY(G4int ny) {
this->fNy=ny;
fUpdated=true;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNZ(G4int nz){
void LXeDetectorConstruction::SetNZ(G4int nz) {
this->fNz=nz;
fUpdated=true;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetPMTRadius(G4double outerRadius_pmt){
void LXeDetectorConstruction::SetPMTRadius(G4double outerRadius_pmt) {
this->fOuterRadius_pmt=outerRadius_pmt;
fUpdated=true;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetDefaults(){
void LXeDetectorConstruction::SetDefaults() {
//Resets to default values
fD_mtl=0.0635*cm;
@@ -351,7 +403,8 @@ void LXeDetectorConstruction::SetDefaults(){
fNfibers=15;
fWLSslab=false;
fMainVolume=true;
fMainVolumeOn=true;
fMainVolume=NULL;
fSlab_z=2.5*mm;
G4UImanager::GetUIpointer()
@@ -360,38 +413,52 @@ void LXeDetectorConstruction::SetDefaults(){
if(fLXe_mt)fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
if(fMPTPStyrene)fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
fUpdated=true;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::UpdateGeometry(){
// clean-up previous geometry
G4GeometryManager::GetInstance()->OpenGeometry();
G4PhysicalVolumeStore::GetInstance()->Clean();
G4LogicalVolumeStore::GetInstance()->Clean();
G4SolidStore::GetInstance()->Clean();
G4LogicalSkinSurface::CleanSurfaceTable();
G4LogicalBorderSurface::CleanSurfaceTable();
G4SurfaceProperty::CleanSurfacePropertyTable();
//define new one
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector());
G4RunManager::GetRunManager()->GeometryHasBeenModified();
fUpdated=false;
void LXeDetectorConstruction::SetSphereOn(G4bool b) {
fSphereOn=b;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetMainScintYield(G4double y){
void LXeDetectorConstruction::SetHousingReflectivity(G4double r) {
fRefl=r;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetWLSSlabOn(G4bool b) {
fWLSslab=b;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetMainVolumeOn(G4bool b) {
fMainVolumeOn=b;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNFibers(G4int n) {
fNfibers=n;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetMainScintYield(G4double y) {
fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetWLSScintYield(G4double y){
void LXeDetectorConstruction::SetWLSScintYield(G4double y) {
fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
}
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeDetectorMessenger.cc 77486 2013-11-25 10:14:16Z gcosmo $
//
/// \file optical/LXe/src/LXeDetectorMessenger.cc
/// \brief Implementation of the LXeDetectorMessenger class
//
@@ -57,62 +59,84 @@ LXeDetectorMessenger::LXeDetectorMessenger(LXeDetectorConstruction* detector)
fDimensionsCmd->SetGuidance("Set the dimensions of the detector volume.");
fDimensionsCmd->SetParameterName("scint_x","scint_y","scint_z",false);
fDimensionsCmd->SetDefaultUnit("cm");
fDimensionsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fDimensionsCmd->SetToBeBroadcasted(false);
fHousingThicknessCmd = new G4UIcmdWithADoubleAndUnit
("/LXe/detector/housingThickness",this);
fHousingThicknessCmd->SetGuidance("Set the thickness of the housing.");
fHousingThicknessCmd->SetParameterName("d_mtl",false);
fHousingThicknessCmd->SetDefaultUnit("cm");
fHousingThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fHousingThicknessCmd->SetToBeBroadcasted(false);
fPmtRadiusCmd = new G4UIcmdWithADoubleAndUnit
("/LXe/detector/pmtRadius",this);
fPmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
fPmtRadiusCmd->SetParameterName("radius",false);
fPmtRadiusCmd->SetDefaultUnit("cm");
fPmtRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fPmtRadiusCmd->SetToBeBroadcasted(false);
fNxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
fNxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
fNxCmd->SetParameterName("nx",false);
fNxCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fNxCmd->SetToBeBroadcasted(false);
fNyCmd = new G4UIcmdWithAnInteger("/LXe/detector/ny",this);
fNyCmd->SetGuidance("Set the number of PMTs along the y-dimension.");
fNyCmd->SetParameterName("ny",false);
fNyCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fNyCmd->SetToBeBroadcasted(false);
fNzCmd = new G4UIcmdWithAnInteger("/LXe/detector/nz",this);
fNzCmd->SetGuidance("Set the number of PMTs along the z-dimension.");
fNzCmd->SetParameterName("nz",false);
fNzCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fNzCmd->SetToBeBroadcasted(false);
fSphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
fSphereCmd->SetGuidance("Enable/Disable the sphere.");
fSphereCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fSphereCmd->SetToBeBroadcasted(false);
fReflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
fReflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
fReflectivityCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fReflectivityCmd->SetToBeBroadcasted(false);
fWlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
fWlsCmd->SetGuidance("Enable/Disable the WLS slab");
fWlsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fWlsCmd->SetToBeBroadcasted(false);
fLxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
fLxeCmd->SetGuidance("Enable/Disable the main detector volume.");
fLxeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fLxeCmd->SetToBeBroadcasted(false);
fNFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
fNFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
fUpdateCmd = new G4UIcommand("/LXe/detector/update",this);
fUpdateCmd->SetGuidance("Update the detector geometry with changed values.");
fUpdateCmd->SetGuidance
("Must be run before beamOn if detector has been changed.");
fNFibersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fNFibersCmd->SetToBeBroadcasted(false);
fDefaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
fDefaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
fDefaultsCmd->SetGuidance("(Update still required)");
fDefaultsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fDefaultsCmd->SetToBeBroadcasted(false);
fMainScintYield=new G4UIcmdWithADouble("/LXe/detector/MainScintYield",this);
fMainScintYield->SetGuidance("Set scinitillation yield of main volume.");
fMainScintYield->SetGuidance("Specified in photons/MeV");
fMainScintYield->AvailableForStates(G4State_PreInit,G4State_Idle);
fMainScintYield->SetToBeBroadcasted(false);
fWLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
fWLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
fWLSScintYield->SetGuidance("Specified in photons/MeV");
fWLSScintYield->AvailableForStates(G4State_PreInit,G4State_Idle);
fWLSScintYield->SetToBeBroadcasted(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -125,7 +149,6 @@ LXeDetectorMessenger::~LXeDetectorMessenger()
delete fNxCmd;
delete fNyCmd;
delete fNzCmd;
delete fUpdateCmd;
delete fDetectorDir;
delete fVolumesDir;
delete fDefaultsCmd;
@@ -161,9 +184,6 @@ void LXeDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
else if (command == fNzCmd){
fLXeDetector->SetNZ(fNzCmd->GetNewIntValue(newValue));
}
else if (command == fUpdateCmd){
fLXeDetector->UpdateGeometry();
}
else if (command == fDefaultsCmd){
fLXeDetector->SetDefaults();
}
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeEMPhysics.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeEMPhysics.cc
/// \brief Implementation of the LXeEMPhysics class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeEventAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeEventAction.cc
/// \brief Implementation of the LXeEventAction class
//
@@ -97,7 +99,7 @@ void LXeEventAction::EndOfEventAction(const G4Event* anEvent){
trj->SetForceDrawTrajectory(fForcedrawphotons);
trj->SetForceNoDrawTrajectory(fForcenophotons);
}
trj->DrawTrajectory(50);
trj->DrawTrajectory();
}
}
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeEventMessenger.cc 70256 2013-05-28 07:29:30Z gcosmo $
//
/// \file optical/LXe/src/LXeEventMessenger.cc
/// \brief Implementation of the LXeEventMessenger class
//
@@ -39,7 +41,8 @@ LXeEventMessenger::LXeEventMessenger(LXeEventAction* event)
: fLXeEvent(event)
{
fSaveThresholdCmd = new G4UIcmdWithAnInteger("/LXe/saveThreshold",this);
fSaveThresholdCmd->SetGuidance("Set the photon count threshold for saving the random number seed for an event.");
fSaveThresholdCmd->
SetGuidance("Set the photon count threshold for saving the random number seed");
fSaveThresholdCmd->SetParameterName("photons",true);
fSaveThresholdCmd->SetDefaultValue(4500);
fSaveThresholdCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeGeneralPhysics.cc 72250 2013-07-12 08:59:26Z gcosmo $
//
/// \file optical/LXe/src/LXeGeneralPhysics.cc
/// \brief Implementation of the LXeGeneralPhysics class
//
@@ -48,15 +50,19 @@ LXeGeneralPhysics::~LXeGeneralPhysics() {
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
// Bosons
#include "G4ChargedGeantino.hh"
#include "G4Geantino.hh"
#include "G4ChargedGeantino.hh"
#include "G4GenericIon.hh"
void LXeGeneralPhysics::ConstructParticle()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
G4GenericIon::GenericIonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -66,9 +72,9 @@ void LXeGeneralPhysics::ConstructProcess()
fDecayProcess = new G4Decay();
// Add Decay Process
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
aParticleIterator->reset();
while( (*aParticleIterator)() ){
G4ParticleDefinition* particle = aParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(fDecayProcess);
@@ -23,24 +23,21 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeMainVolume.cc 77561 2013-11-26 09:00:04Z gcosmo $
//
/// \file optical/LXe/src/LXeMainVolume.cc
/// \brief Implementation of the LXeMainVolume class
//
//
#include "LXeMainVolume.hh"
#include "globals.hh"
#include "G4SDManager.hh"
#include "LXeMainVolume.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4LogicalBorderSurface.hh"
#include "LXePMTSD.hh"
#include "LXeScintSD.hh"
#include "G4SystemOfUnits.hh"
LXeScintSD* LXeMainVolume::fScint_SD=NULL;
LXePMTSD* LXeMainVolume::fPmt_SD=NULL;
G4LogicalVolume* LXeMainVolume::fHousing_log=NULL;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeMainVolume::LXeMainVolume(G4RotationMatrix *pRot,
@@ -59,126 +56,99 @@ LXeMainVolume::LXeMainVolume(G4RotationMatrix *pRot,
{
CopyValues();
if(!fHousing_log || fUpdated){
G4double housing_x=fScint_x+2.*fD_mtl;
G4double housing_y=fScint_y+2.*fD_mtl;
G4double housing_z=fScint_z+2.*fD_mtl;
G4double housing_x=fScint_x+fD_mtl;
G4double housing_y=fScint_y+fD_mtl;
G4double housing_z=fScint_z+fD_mtl;
//*************************** housing and scintillator
fScint_box = new G4Box("scint_box",fScint_x/2.,fScint_y/2.,fScint_z/2.);
fHousing_box = new G4Box("housing_box",housing_x/2.,housing_y/2.,
housing_z/2.);
//*************************** housing and scintillator
fScint_box = new G4Box("scint_box",fScint_x/2.,fScint_y/2.,fScint_z/2.);
fHousing_box = new G4Box("housing_box",housing_x/2.,housing_y/2.,
housing_z/2.);
fScint_log = new G4LogicalVolume(fScint_box,G4Material::GetMaterial("LXe"),
"scint_log",0,0,0);
fHousing_log = new G4LogicalVolume(fHousing_box,
G4Material::GetMaterial("Al"),
"housing_log",0,0,0);
fScint_log = new G4LogicalVolume(fScint_box,G4Material::GetMaterial("LXe"),
"scint_log",0,0,0);
fHousing_log = new G4LogicalVolume(fHousing_box,
G4Material::GetMaterial("Al"),
"housing_log",0,0,0);
new G4PVPlacement(0,G4ThreeVector(),fScint_log,"scintillator",
fHousing_log,false,0);
new G4PVPlacement(0,G4ThreeVector(),fScint_log,"scintillator",
fHousing_log,false,0);
//*************** Miscellaneous sphere to demonstrate skin surfaces
fSphere = new G4Sphere("sphere",0.*mm,2.*cm,0.*deg,360.*deg,0.*deg,
360.*deg);
fSphere_log = new G4LogicalVolume(fSphere,G4Material::GetMaterial("Al"),
"sphere_log");
if(fSphereOn)
new G4PVPlacement(0,G4ThreeVector(5.*cm,5.*cm,5.*cm),
//*************** Miscellaneous sphere to demonstrate skin surfaces
fSphere = new G4Sphere("sphere",0.*mm,2.*cm,0.*deg,360.*deg,0.*deg,360.*deg);
fSphere_log = new G4LogicalVolume(fSphere,G4Material::GetMaterial("Al"),
"sphere_log");
if(fSphereOn)
new G4PVPlacement(0,G4ThreeVector(5.*cm,5.*cm,5.*cm),
fSphere_log,"sphere",fScint_log,false,0);
//****************** Build PMTs
G4double innerRadius_pmt = 0.*cm;
G4double height_pmt = fD_mtl/2.;
G4double startAngle_pmt = 0.*deg;
G4double spanningAngle_pmt = 360.*deg;
//****************** Build PMTs
G4double innerRadius_pmt = 0.*cm;
G4double height_pmt = fD_mtl/2.;
G4double startAngle_pmt = 0.*deg;
G4double spanningAngle_pmt = 360.*deg;
fPmt = new G4Tubs("pmt_tube",innerRadius_pmt,fOuterRadius_pmt,
height_pmt,startAngle_pmt,spanningAngle_pmt);
fPmt = new G4Tubs("pmt_tube",innerRadius_pmt,fOuterRadius_pmt,
height_pmt,startAngle_pmt,spanningAngle_pmt);
//the "photocathode" is a metal slab at the back of the glass that
//is only a very rough approximation of the real thing since it only
//absorbs or detects the photons based on the efficiency set below
fPhotocath = new G4Tubs("photocath_tube",innerRadius_pmt,fOuterRadius_pmt,
height_pmt/2,startAngle_pmt,spanningAngle_pmt);
//the "photocathode" is a metal slab at the back of the glass that
//is only a very rough approximation of the real thing since it only
//absorbs or detects the photons based on the efficiency set below
fPhotocath = new G4Tubs("photocath_tube",innerRadius_pmt,fOuterRadius_pmt,
height_pmt/2,startAngle_pmt,spanningAngle_pmt);
fPmt_log = new G4LogicalVolume(fPmt,G4Material::GetMaterial("Glass"),
"pmt_log");
fPhotocath_log = new G4LogicalVolume(fPhotocath,
G4Material::GetMaterial("Al"),
"photocath_log");
fPmt_log = new G4LogicalVolume(fPmt,G4Material::GetMaterial("Glass"),
"pmt_log");
fPhotocath_log = new G4LogicalVolume(fPhotocath,
G4Material::GetMaterial("Al"),
"photocath_log");
new G4PVPlacement(0,G4ThreeVector(0,0,-height_pmt/2),
fPhotocath_log,"photocath",
fPmt_log,false,0);
new G4PVPlacement(0,G4ThreeVector(0,0,-height_pmt/2),
fPhotocath_log,"photocath",
fPmt_log,false,0);
//***********Arrange pmts around the outside of housing**********
//---pmt sensitive detector
G4SDManager* SDman = G4SDManager::GetSDMpointer();
//***********Arrange pmts around the outside of housing**********
if(!fPmt_SD){
fPmt_SD = new LXePMTSD("/LXeDet/pmtSD");
SDman->AddNewDetector(fPmt_SD);
//Created here so it exists as pmts are being placed
}
fPmt_SD->InitPMTs((fNx*fNy+fNx*fNz+fNy*fNz)*2); //let pmtSD know # of pmts
//-------
G4double dx = fScint_x/fNx;
G4double dy = fScint_y/fNy;
G4double dz = fScint_z/fNz;
G4double dx = fScint_x/fNx;
G4double dy = fScint_y/fNy;
G4double dz = fScint_z/fNz;
G4double x,y,z;
G4double xmin = -fScint_x/2. - dx/2.;
G4double ymin = -fScint_y/2. - dy/2.;
G4double zmin = -fScint_z/2. - dz/2.;
G4int k=0;
G4double x,y,z;
G4double xmin = -fScint_x/2. - dx/2.;
G4double ymin = -fScint_y/2. - dy/2.;
G4double zmin = -fScint_z/2. - dz/2.;
G4int k=0;
z = -fScint_z/2. - height_pmt; //front
PlacePMTs(fPmt_log,0,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_z = new G4RotationMatrix();
rm_z->rotateY(180*deg);
z = fScint_z/2. + height_pmt; //back
PlacePMTs(fPmt_log,rm_z,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_y1 = new G4RotationMatrix();
rm_y1->rotateY(-90*deg);
x = -fScint_x/2. - height_pmt; //left
PlacePMTs(fPmt_log,rm_y1,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_y2 = new G4RotationMatrix();
rm_y2->rotateY(90*deg);
x = fScint_x/2. + height_pmt; //right
PlacePMTs(fPmt_log,rm_y2,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_x1 = new G4RotationMatrix();
rm_x1->rotateX(90*deg);
y = -fScint_y/2. - height_pmt; //bottom
PlacePMTs(fPmt_log,rm_x1,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k,fPmt_SD);
G4RotationMatrix* rm_x2 = new G4RotationMatrix();
rm_x2->rotateX(-90*deg);
y = fScint_y/2. + height_pmt; //top
PlacePMTs(fPmt_log,rm_x2,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k,fPmt_SD);
//**********Setup Sensitive Detectors***************
if(!fScint_SD){//determine if it has already been created
fScint_SD = new LXeScintSD("/LXeDet/scintSD");
SDman->AddNewDetector(fScint_SD);
}
fScint_log->SetSensitiveDetector(fScint_SD);
//sensitive detector is not actually on the photocathode.
//processHits gets done manually by the stepping action.
//It is used to detect when photons hit and get absorbed&detected at the
//boundary to the photocathode (which doesnt get done by attaching it to a
//logical volume.
//It does however need to be attached to something or else it doesnt get
//reset at the begining of events
fPhotocath_log->SetSensitiveDetector(fPmt_SD);
z = -fScint_z/2. - height_pmt; //front
PlacePMTs(fPmt_log,0,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k);
VisAttributes();
SurfaceProperties();
}
G4RotationMatrix* rm_z = new G4RotationMatrix();
rm_z->rotateY(180*deg);
z = fScint_z/2. + height_pmt; //back
PlacePMTs(fPmt_log,rm_z,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k);
G4RotationMatrix* rm_y1 = new G4RotationMatrix();
rm_y1->rotateY(-90*deg);
x = -fScint_x/2. - height_pmt; //left
PlacePMTs(fPmt_log,rm_y1,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k);
G4RotationMatrix* rm_y2 = new G4RotationMatrix();
rm_y2->rotateY(90*deg);
x = fScint_x/2. + height_pmt; //right
PlacePMTs(fPmt_log,rm_y2,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k);
G4RotationMatrix* rm_x1 = new G4RotationMatrix();
rm_x1->rotateX(90*deg);
y = -fScint_y/2. - height_pmt; //bottom
PlacePMTs(fPmt_log,rm_x1,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k);
G4RotationMatrix* rm_x2 = new G4RotationMatrix();
rm_x2->rotateX(-90*deg);
y = fScint_y/2. + height_pmt; //top
PlacePMTs(fPmt_log,rm_x2,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k);
VisAttributes();
SurfaceProperties();
SetLogicalVolume(fHousing_log);
}
@@ -186,8 +156,6 @@ LXeMainVolume::LXeMainVolume(G4RotationMatrix *pRot,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeMainVolume::CopyValues(){
fUpdated=fConstructor->GetUpdated();
fScint_x=fConstructor->GetScintX();
fScint_y=fConstructor->GetScintY();
fScint_z=fConstructor->GetScintZ();
@@ -208,7 +176,7 @@ void LXeMainVolume::PlacePMTs(G4LogicalVolume* pmt_log,
G4double db, G4double amin,
G4double bmin, G4int na, G4int nb,
G4double &x, G4double &y, G4double &z,
G4int &k,LXePMTSD* sd){
G4int &k){
/*PlacePMTs : a different way to parameterize placement that does not depend on
calculating the position from the copy number
@@ -230,7 +198,7 @@ void LXeMainVolume::PlacePMTs(G4LogicalVolume* pmt_log,
b+=db;
new G4PVPlacement(rot,G4ThreeVector(x,y,z),pmt_log,"pmt",
fHousing_log,false,k);
sd->SetPMTPos(k,x,y,z);
fPmtPositions.push_back(G4ThreeVector(x,y,z));
k++;
}
}
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeMuonPhysics.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeMuonPhysics.cc
/// \brief Implementation of the LXeMuonPhysics class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePMTHit.cc 72250 2013-07-12 08:59:26Z gcosmo $
//
/// \file optical/LXe/src/LXePMTHit.cc
/// \brief Implementation of the LXePMTHit class
//
@@ -35,7 +37,7 @@
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
G4Allocator<LXePMTHit> LXePMTHitAllocator;
G4ThreadLocal G4Allocator<LXePMTHit>* LXePMTHitAllocator=0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePMTSD.cc 73915 2013-09-17 07:32:26Z gcosmo $
//
/// \file optical/LXe/src/LXePMTSD.cc
/// \brief Implementation of the LXePMTSD class
//
@@ -57,6 +59,17 @@ LXePMTSD::~LXePMTSD() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePMTSD::SetPmtPositions(const std::vector<G4ThreeVector>& positions)
{
for (G4int i=0; i<G4int(positions.size()); ++i) {
if(fPMTPositionsX)fPMTPositionsX->push_back(positions[i].x());
if(fPMTPositionsY)fPMTPositionsY->push_back(positions[i].y());
if(fPMTPositionsZ)fPMTPositionsZ->push_back(positions[i].z());
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePMTSD::Initialize(G4HCofThisEvent* hitsCE){
fPMTHitCollection = new LXePMTHitsCollection
(SensitiveDetectorName,collectionName[0]);
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePhysicsList.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXePhysicsList.cc
/// \brief Implementation of the LXePhysicsList class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePrimaryGeneratorAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXePrimaryGeneratorAction.cc
/// \brief Implementation of the LXePrimaryGeneratorAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeRunAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeRunAction.cc
/// \brief Implementation of the LXeRunAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeScintHit.cc 72250 2013-07-12 08:59:26Z gcosmo $
//
/// \file optical/LXe/src/LXeScintHit.cc
/// \brief Implementation of the LXeScintHit class
//
@@ -35,7 +37,7 @@
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
G4Allocator<LXeScintHit> LXeScintHitAllocator;
G4ThreadLocal G4Allocator<LXeScintHit>* LXeScintHitAllocator=0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeScintSD.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeScintSD.cc
/// \brief Implementation of the LXeScintSD class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeStackingAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeStackingAction.cc
/// \brief Implementation of the LXeStackingAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeSteppingAction.cc 73915 2013-09-17 07:32:26Z gcosmo $
//
/// \file optical/LXe/src/LXeSteppingAction.cc
/// \brief Implementation of the LXeSteppingAction class
//
@@ -67,7 +69,10 @@ LXeSteppingAction::~LXeSteppingAction() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
G4Track* theTrack = theStep->GetTrack();
if ( theTrack->GetCurrentStepNumber() == 1 ) fExpectedNextStatus = Undefined;
LXeUserTrackInformation* trackInformation
=(LXeUserTrackInformation*)theTrack->GetUserInformation();
@@ -82,7 +87,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
G4OpBoundaryProcessStatus boundaryStatus=Undefined;
static G4OpBoundaryProcess* boundary=NULL;
static G4ThreadLocal G4OpBoundaryProcess* boundary=NULL;
//find the boundary process only once
if(!boundary){
@@ -129,6 +134,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
}
if(!thePostPV){//out of world
fExpectedNextStatus=Undefined;
return;
}
@@ -151,7 +157,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
}
boundaryStatus=boundary->GetStatus();
//Check to see if the partcile was actually at a boundary
//Otherwise the boundary status may not be valid
//Prior to Geant4.6.0-p1 this would not have been enough to check
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeSteppingMessenger.cc 70256 2013-05-28 07:29:30Z gcosmo $
//
/// \file optical/LXe/src/LXeSteppingMessenger.cc
/// \brief Implementation of the LXeSteppingMessenger class
//
@@ -39,7 +41,8 @@ LXeSteppingMessenger::LXeSteppingMessenger(LXeSteppingAction* step)
: fStepping(step)
{
fOneStepPrimariesCmd = new G4UIcmdWithABool("/LXe/oneStepPrimaries",this);
fOneStepPrimariesCmd->SetGuidance("Only allows primaries to go one step in the scintillator volume before being killed.");
fOneStepPrimariesCmd->
SetGuidance("Only allows primaries to go one step before being killed.");
}
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeSteppingVerbose.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeSteppingVerbose.cc
/// \brief Implementation of the LXeSteppingVerbose class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeTrackingAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeTrackingAction.cc
/// \brief Implementation of the LXeTrackingAction class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeTrajectory.cc 72349 2013-07-16 12:13:16Z gcosmo $
//
/// \file optical/LXe/src/LXeTrajectory.cc
/// \brief Implementation of the LXeTrajectory class
//
@@ -40,7 +42,7 @@
#include "G4VVisManager.hh"
#include "G4Polymarker.hh"
G4Allocator<LXeTrajectory> LXeTrajectoryAllocator;
G4ThreadLocal G4Allocator<LXeTrajectory>* LXeTrajectoryAllocator = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -74,20 +76,17 @@ LXeTrajectory::~LXeTrajectory() {}
void LXeTrajectory::DrawTrajectory() const
{
// Invoke the default implementation in G4VTrajectory...
G4VTrajectory::DrawTrajectory();
// ... or override with your own code here.
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeTrajectory::DrawTrajectory(G4int i_mode) const{
// i_mode is no longer available as an argument of G4VTrajectory.
// In this exampple it was always called with an argument of 50.
const G4int i_mode = 50;
// Consider using commands /vis/modeling/trajectories.
//Taken from G4VTrajectory and modified to select colours based on particle
//type and to selectively eliminate drawing of certain trajectories.
if(!fForceDraw && (!fDrawit || fForceNoDraw))
return;
// If i_mode>=0, draws a trajectory as a polyline and, if i_mode!=0,
// adds markers - yellow circles for step points and magenta squares
// for auxiliary points, if any - whose screen size in pixels is
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeUserEventInformation.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeUserEventInformation.cc
/// \brief Implementation of the LXeUserEventInformation class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeUserTrackInformation.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeUserTrackInformation.cc
/// \brief Implementation of the LXeUserTrackInformation class
//
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeWLSFiber.cc 77486 2013-11-25 10:14:16Z gcosmo $
//
/// \file optical/LXe/src/LXeWLSFiber.cc
/// \brief Implementation of the LXeWLSFiber class
//
@@ -51,41 +53,39 @@ LXeWLSFiber::LXeWLSFiber(G4RotationMatrix *pRot,
{
CopyValues();
if(!fClad2_log || fUpdated){
// The Fiber
//
G4Tubs* fiber_tube =
new G4Tubs("Fiber",fFiber_rmin,fFiber_rmax,fFiber_z,fFiber_sphi,fFiber_ephi);
// The Fiber
//
G4Tubs* fiber_tube =
new G4Tubs("Fiber",fFiber_rmin,fFiber_rmax,fFiber_z,fFiber_sphi,fFiber_ephi);
G4LogicalVolume* fiber_log =
G4LogicalVolume* fiber_log =
new G4LogicalVolume(fiber_tube,G4Material::GetMaterial("PMMA"),
"Fiber",0,0,0);
// Cladding (first layer)
//
G4Tubs* clad1_tube =
// Cladding (first layer)
//
G4Tubs* clad1_tube =
new G4Tubs("Cladding1",fClad1_rmin,fClad1_rmax,fClad1_z,fClad1_sphi,
fClad1_ephi);
G4LogicalVolume* clad1_log =
G4LogicalVolume* clad1_log =
new G4LogicalVolume(clad1_tube,G4Material::GetMaterial("Pethylene1"),
"Cladding1",0,0,0);
// Cladding (second layer)
//
G4Tubs* clad2_tube =
// Cladding (second layer)
//
G4Tubs* clad2_tube =
new G4Tubs("Cladding2",fClad2_rmin,fClad2_rmax,fClad2_z,fClad2_sphi,
fClad2_ephi);
fClad2_log =
fClad2_log =
new G4LogicalVolume(clad2_tube,G4Material::GetMaterial("Pethylene2"),
"Cladding2",0,0,0);
new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),fiber_log,
"Fiber", clad1_log,false,0);
new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),clad1_log,
"Cladding1",fClad2_log,false,0);
}
new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),fiber_log,
"Fiber", clad1_log,false,0);
new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),clad1_log,
"Cladding1",fClad2_log,false,0);
SetLogicalVolume(fClad2_log);
}
@@ -93,7 +93,6 @@ LXeWLSFiber::LXeWLSFiber(G4RotationMatrix *pRot,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeWLSFiber::CopyValues(){
fUpdated=fConstructor->GetUpdated();
fFiber_rmin = 0.00*cm;
fFiber_rmax = 0.10*cm;
+14 -17
View File
@@ -23,6 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeWLSSlab.cc 77486 2013-11-25 10:14:16Z gcosmo $
//
/// \file optical/LXe/src/LXeWLSSlab.cc
/// \brief Implementation of the LXeWLSSlab class
//
@@ -53,30 +55,26 @@ LXeWLSSlab::LXeWLSSlab(G4RotationMatrix *pRot,
{
CopyValues();
if(!fScintSlab_log || fUpdated){
G4double slab_x = fScint_x/2.;
G4double slab_y = fScint_y/2.;
G4double slab_x = fScint_x/2.;
G4double slab_y = fScint_y/2.;
G4Box* ScintSlab_box = new G4Box("Slab",slab_x,slab_y,fSlab_z);
G4Box* ScintSlab_box = new G4Box("Slab",slab_x,slab_y,fSlab_z);
fScintSlab_log
fScintSlab_log
= new G4LogicalVolume(ScintSlab_box,
G4Material::GetMaterial("Polystyrene"),
"Slab",0,0,0);
G4double spacing = 2*slab_y/fNfibers;
G4double spacing = 2*slab_y/fNfibers;
G4RotationMatrix* rm = new G4RotationMatrix();
rm->rotateY(90*deg);
//Place fibers
for(G4int i=0;i<fNfibers;i++){
G4double Y=-(spacing)*(fNfibers-1)*0.5 + i*spacing;
new LXeWLSFiber(rm,G4ThreeVector(0.,Y,0.),fScintSlab_log,false,0,
fConstructor);
}
G4RotationMatrix* rm = new G4RotationMatrix();
rm->rotateY(90*deg);
//Place fibers
for(G4int i=0;i<fNfibers;i++){
G4double Y=-(spacing)*(fNfibers-1)*0.5 + i*spacing;
new LXeWLSFiber(rm,G4ThreeVector(0.,Y,0.),fScintSlab_log,false,0,
fConstructor);
}
SetLogicalVolume(fScintSlab_log);
@@ -85,7 +83,6 @@ LXeWLSSlab::LXeWLSSlab(G4RotationMatrix *pRot,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeWLSSlab::CopyValues(){
fUpdated=fConstructor->GetUpdated();
fScint_x=fConstructor->GetScintX();
fScint_y=fConstructor->GetScintY();
@@ -0,0 +1,97 @@
$Id$
///\file "optical/OpNovice/.README"
///\brief Example OpNovice README page
/*! \page ExampleOpNovice Example OpNovice
This example presently illustrates the following basic concepts, and in
particular (indicated with ***), how to use G4 for optical photon
generation and transport. Other extended example of what is possible
in Geant4 with optical photons can be found at
examples/extended/optical/LXe and wls
\section ExampleOpNovice_s1 main()
Define Random Number Engine and initial seed
\section ExampleOpNovice_s2 G4VUserPhysicsList
- Define particles; including - *** G4OpticalPhoton ***
- Define processes; including
- *** G4Cerenkov ***
- *** G4Scintillation ***
- *** G4OpAbsorption ***
- *** G4OpRayleigh ***
- *** G4OpBoundaryProcess ***
\section ExampleOpNovice_s3 G4VUserDetectorConstruction
- Define material: Air and Water
- Define simple G4box geometry
- *** add G4MaterialPropertiesTable to G4Material ***
- *** define G4LogicalSurface(s) ***
- *** define G4OpticalSurface ***
- *** add G4MaterialPropertiesTable to G4OpticalSurface ***
\section ExampleOpNovice_s4 G4VUserPrimaryGeneratorAction
Use G4ParticleGun to shoot a charge particle into a Cerenkov radiator
A messenger command allows to define interactivly the polarization of an
primary optical photon (see for instance optPhoton.mac)
\section ExampleOpNovice_s5 G4UserRunAction
- Define G4Timer (start/stop)
- Set verbose levels
\section ExampleOpNovice_s6 G4UserStackingAction
Show how to count the number of secondary particles in an event
\section ExampleOpNovice_s7 Visualisation
The Visualization Manager is set in the main().
The initialisation of the drawing is done via a set of /vis/ commands
in the macro vis.mac. This macro is automatically read from
the main in case of interactive running mode.
The detector has a default view which is a longitudinal view of the tank.
The tracks are drawn at the end of event, and erased at the end of run.
\section ExampleOpNovice_s8 How to start
- compile and link to generate an executable
\verbatim
% cd OpNovice
% gmake
\endverbatim
This example handles the program arguments in a new way.
It can be run with the following optional arguments:
\verbatim
% OpNovice [-m macro ] [-u UIsession] [-t nThreads]
\endverbatim
The -t option is available only in multi-threading mode
and it allows the user to override the Geant4 default number of
threads. The number of threads can be also set via G4FORCENUMBEROFTHREADS
environment variable which has the top priority.
- execute OpNovice in 'batch' mode from macro files
\verbatim
% OpNovice -m OpNovice.in
\endverbatim
- execute OpNovice in 'interactive mode' with visualization
\verbatim
% OpNovice
....
Idle> type your commands. For instance:
Idle> /control/execute optPhoton.mac
....
Idle> exit
\endverbatim
*/
@@ -0,0 +1,64 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(OpNovice)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(OpNovice OpNovice.cc ${sources} ${headers})
target_link_libraries(OpNovice ${Geant4_LIBRARIES} )
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build OpNovice. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
set(OpNovice_SCRIPTS
OpNovice.out
OpNovice.in
optPhoton.mac
gui.mac
icons.mac
run.png
vis.mac
)
foreach(_script ${OpNovice_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/${_script}
COPYONLY
)
endforeach()
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS OpNovice DESTINATION bin)
@@ -0,0 +1,21 @@
# $Id: GNUmakefile 68752 2013-04-05 10:23:47Z gcosmo $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := OpNovice
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
endif
.PHONY: all
all: lib bin
include $(G4INSTALL)/config/binmake.gmk
visclean:
rm -f g4*.prim g4*.eps g4*.wrl
rm -f .DAWN_*
+214
View File
@@ -0,0 +1,214 @@
$Id: History 77883 2013-11-29 08:40:10Z gcosmo $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example OpNovice History file
-----------------------------
This file should be used by the G4 example coordinator to briefly
summarize all major modifications introduced in the code and keep
track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
November 28, 2013 P. Gumplinger (OpNovice-V09-06-11)
- add gui.mac, icons.mac and run.png
November 2, 2013 P. Gumplinger (OpNovice-V09-06-10)
- place G4Random::setTheSeed(myseed) so that it is executed for both
sequential and MT mode
October 31, 2013 P. Gumplinger (OpNovice-V09-06-09)
- to work with ctests-V09-06-19
October 29, 2013 P. Gumplinger (OpNovice-V09-06-08)
- remove all reference to LXeWorkerInitialization and remove SetNumberOfThreads
October 25, 2013 P. Gumplinger (OpNovice-V09-06-07)
- Instantiate SteppingVerbose in a new method in OpNoviceActionInitialization
and removed LXeWorkerInitialization (not needed anymore)
- Add OpNoviceSteppingAction to count secondary optical photons to compare
with OpNoviceStackingAction
11 June 2013, V.Ivanchenko (OpNovice-V09-06-06)
- OpNovicePhysicsList - construct all particles to avoid exception
in execution of ConstructParticle() method; removed unnecessary
methods to construct individual particle types
02 June 2013, P.Gumplinger (OpNovice-V09-06-05)
- make MultiThread (MT) capable
27 May 2013, I.Hrivnacova (OpNovice-V09-06-04)
- Updated .README file
27 May 2013, I.Hrivnacova (OpNovice-V09-06-03)
- Apply Examples Coding Guidelines
(data members/base class initialization)
13 May 2013 P. Gumplinger (OpNovice-V09-06-02)
- Add .README file
06 May 2013 P. Gumplinger (OpNovice-V09-06-01)
- Apply all Examples Coding Guidelines
18 Dec 2012 I. Hrivnacova (OpNovice-V09-06-00)
- Fixed CMake build: removed add_custom_target(..)
17 Dec 2012 P. Gumplinger
- move the example to /extended/optical/novice (from /novice/N06) and
rename N06 to OpNovice
20 June 2012 P. Gumplinger (exampleN06-V09-05-01)
- remove SetModel from ExN06PhysicsList.cc to cowork with op-V09-05-04
24 January 2012 P. Gumplinger (exampleN06-V09-05-00)
- set /tracking/verbose 3 in exampleN06.in and optPhoton.mac
to also test timing of optical photons - see Problem #1275
29 November 2011 Ben Morgan (exampleN06-V09-04-01)
- CMakeLists.txt edited to add standard UI/Vis activation and copying of scripts
to build directory, plus comments and neatification.
14th October 2011 P. Gumplinger (exampleN06-V09-04-00)
- modify to work with materials-V09-04-15 and use spline interpolation
for some of the G4MaterialPropertyVector (e.g. G4PhysicsOrderedFreeVector)
23rd October 2010 P. Gumplinger (exampleN06-V09-03-01)
- add G4OpMieHG scattering process and associated material properties
4th June 2010 Joseph Perl (exampleN06-V09-03-00)
- Updated vis usage
09th November 2009 Peter Gumplinger (exampleN06-V09-02-01)
- use G4eMultipleScattering, G4MuMultipleScattering and
G4hMultipleScattering instead of G4MultipleScattering
30th October 2009 John Allison (exampleN06-V09-02-00)
- Introduced G4UIExecutive.
20th November 2008 P. Gumplinger (exampleN06-V09-01-03)
- add theCerenkovProcess->SetMaxBetaChangePerStep in ExN06PhysicsList
16th July 2008 P. Gumplinger (exampleN06-V09-01-02)
- use dynamic_cast <G4OpticalSurface*> in ExN06DetectorConstruction.cc
12th June 2008 P. Gumplinger (exampleN06-V09-01-01)
- now use G4EmSaturation to implement the Birks Correction
for G4Scintillation
07th May 2008 J.Allison (exampleN06-V09-01-00)
- Protected "/control/execute vis.mac" with G4VIS_USE flag.
30 Sept 2007 Peter Gumplinger (exampleN06-V09-00-00)
- adjust to the G4Cerenkov process now being a G4VDiscreteProcess
October 18th 2006 J.Allison (exampleN06-V08-01-00)
- Migrate to new trajectory modeling commands.
16th June 2006 Gabriele Cosmo (exampleN06-V08-00-02)
- Use coherent allocation scheme for user-classes and
initialisation in main().
15th June 2006 Peter Gumplinger (exampleN06-V08-00-01)
- add new method ExN06PrimaryGeneratorAction::SetOptPhotonPolar()
to set a random linear polarization when the command -
/N06/gun/optPhotonPolar - is given without arguments
15th June 2006 Gabriele Cosmo (exampleN06-V08-00-00)
- Separate instantiation of the user-stepping-verbose class from
initialisation of the G4VSteppingVerbose singleton.
6th December 2005 Gabriele Cosmo
- Trivial changes for support of CLHEP-2.0.X series.
4th December 2005 John Allison (exampleN06-V07-01-00)
- Replaced vis code in EndOfEventAction by suitable vis commands in vis.mac.
16 May 2005 Peter Gumplinger (exampleN06-V07-00-01)
- use SetProcessOrdering for theDecayProces
11 May 2005 Michel Maire (exampleN06-V07-00-00)
- UI command cerenkovMaxPhotons available in Idle state only
3rd May 2005 John Allison (examples-V07-00-03)
- Replaced vis manager with G4VisExecutive.
June 1, 2004 Peter Gunplinger (exampleN06-V06-01-01)
- Updated README file.
April 2, 2004 Michel Maire (exampleN06-V06-01-00)
- PrimaryGenerator: e+ 500 keV
- Removed vis commands from RunAction
March 17, 2004 Peter Gumplinger (exampleN06-V06-00-00)
- DetectorConstruction: change surface model between OpWaterSurface
and OpAirSurface
December 1, 2003 Peter Gumplinger (exampleN06-V05-02-02)
- DetectorConstruction: use G4SurfaceProperty.
November 13, 2003 John Allison
- Removed OPACS from Vis Manager.
October 24, 2003 Michel Maire (exampleN06-V05-02-01)
- PhysicsList: AddProcess(Bremsstrahlung,-1,3,3) ..etc..
October 06, 2003 Michel Maire (exampleN06-V05-02-00)
- Cosmetic cleanup of material definition
April 17, 2003 Peter Gumplinger (exampleN06-V05-00-03)
- Changed OpWaterSurface to dielectric_dielectric in class
ExN06DetectorConstruction
March 26, 2003 Michel Maire (exampleN06-V05-00-02)
- G4PVPlacement in logical mother
Febuary 11, 2003 Michel Maire (exampleN06-V05-00-01)
- Added a blank in steppingVerbose !
January 23, 2003 Michel Maire (exampleN06-V05-00-00)
- Added tools for interactive session : UItcsh, visualisation of tracks.
- Added 2 messenger classes : PhysicsList and PrimaryGenerator
- exampleN06.in changed --> exampleN06.out reduced
November 21, 2002 Peter Gumplinger (exampleN06-V04-01-02)
- exampleN06.out output changed because of small change in G4Scintillation
November 14, 2002 Peter Gumplinger (exampleN06-V04-01-01)
- Reduced the scintillation photon yield to reduce the output size
November 12, 2002 Peter Gumplinger (exampleN06-V04-01-00)
- Added ExN06StackingAction
- Changed user interface to new version of G4Scintillation
May 30, 2002 Gabriele Cosmo (exampleN06-V04-00-02)
- Renamed file ExN06PrimaryGeneratoraction.cc to ExN06PrimaryGeneratorAction.cc
to be consistent with class name.
May 16, 2002 Peter Gumplinger (exampleN06-V04-00-01)
- Added G4Scintillation to the example and update reference output
Oct 19, 2001 Steve O'Neale (examples-V03-02-00)
- Updated reference output
06-02-2001 Update reference output for op-V03-00-05 S.W.O'Neale
June 17, 2000 John Allison (exampleN06-V01-01-00)
- Updated exampleN06.out for geant4-01-01-ref-06.
16th April 1999 Hisaya Kurashige
- Modified ExN06RunAction
- Modified ExN06PhysicsList::SetCuts
21st August 1998 John Allison
- Changed file names from N06* to ExN06*.
9th August 1998 John Allison
- Changed G4UIterminal to G4UIGAG.
April 09, 98 Gabriele Cosmo
- Created.
@@ -0,0 +1,184 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// Description: Test of Continuous Process G4Cerenkov
// and RestDiscrete Process G4Scintillation
// -- Generation Cerenkov Photons --
// -- Generation Scintillation Photons --
// -- Transport of optical Photons --
// Version: 5.0
// Created: 1996-04-30
// Author: Juliet Armstrong
// mail: gum@triumf.ca
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
#include "G4RunManager.hh"
#endif
#include "G4UImanager.hh"
#include "OpNovicePhysicsList.hh"
#include "OpNoviceDetectorConstruction.hh"
#include "OpNoviceActionInitialization.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace {
void PrintUsage() {
G4cerr << " Usage: " << G4endl;
G4cerr << " OpNovice [-m macro ] [-u UIsession] [-t nThreads] [-r seed] "
<< G4endl;
G4cerr << " note: -t option is available only for multi-threaded mode."
<< G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv)
{
// Evaluate arguments
//
if ( argc > 9 ) {
PrintUsage();
return 1;
}
G4String macro;
G4String session;
#ifdef G4MULTITHREADED
G4int nThreads = 0;
#endif
G4long myseed = 345354;
for ( G4int i=1; i<argc; i=i+2 ) {
if ( G4String(argv[i]) == "-m" ) macro = argv[i+1];
else if ( G4String(argv[i]) == "-u" ) session = argv[i+1];
else if ( G4String(argv[i]) == "-r" ) myseed = atoi(argv[i+1]);
#ifdef G4MULTITHREADED
else if ( G4String(argv[i]) == "-t" ) {
nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
}
#endif
else {
PrintUsage();
return 1;
}
}
// Choose the Random engine
//
G4Random::setTheEngine(new CLHEP::RanecuEngine);
// Construct the default run manager
//
#ifdef G4MULTITHREADED
G4MTRunManager * runManager = new G4MTRunManager;
if ( nThreads > 0 ) runManager->SetNumberOfThreads(nThreads);
#else
G4RunManager * runManager = new G4RunManager;
#endif
// Seed the random number generator manually
G4Random::setTheSeed(myseed);
// Set mandatory initialization classes
//
// Detector construction
runManager-> SetUserInitialization(new OpNoviceDetectorConstruction());
// Physics list
runManager-> SetUserInitialization(new OpNovicePhysicsList());
// User action initialization
runManager->SetUserInitialization(new OpNoviceActionInitialization());
// Initialize G4 kernel
//
runManager->Initialize();
#ifdef G4VIS_USE
// Initialize visualization
//
G4VisManager* visManager = new G4VisExecutive;
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
// G4VisManager* visManager = new G4VisExecutive("Quiet");
visManager->Initialize();
#endif
// Get the pointer to the User Interface manager
//
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if ( macro.size() ) {
// Batch mode
G4String command = "/control/execute ";
UImanager->ApplyCommand(command+macro);
}
else // Define UI session for interactive mode
{
#ifdef G4UI_USE
G4UIExecutive * ui = new G4UIExecutive(argc,argv,session);
#ifdef G4VIS_USE
UImanager->ApplyCommand("/control/execute vis.mac");
#else
UImanager->ApplyCommand("/control/execute OpNovice.in");
#endif
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute gui.mac");
ui->SessionStart();
delete ui;
#endif
}
// Job termination
// Free the store: user actions, physics_list and detector_description are
// owned and deleted by the run manager, so they should not
// be deleted in the main() program !
#ifdef G4VIS_USE
delete visManager;
#endif
delete runManager;
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,12 @@
/control/verbose 2
/tracking/verbose 3
#
/gun/particle e+
/gun/energy 500 keV
#
/run/beamOn 1
#
#/process/inactivate Scintillation
#/OpNovice/phys/verbose 0
#
#/run/beamOn 1
File diff suppressed because it is too large Load Diff
+98
View File
@@ -0,0 +1,98 @@
$Id: README 75294 2013-10-30 09:28:35Z gcosmo $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
OpNovice
--------
This example presently illustrates the following basic concepts, and in
particular (indicated with ***), how to use G4 for optical photon
generation and transport. An extended example of what is possible
in Geant4 with optical photons can be found at
examples/extended/optical/LXe.
main()
------
==> define Random Number Engine and initial seed
G4VUserPhysicsList
------------------
==> define particles; including *** G4OpticalPhoton ***
define processes; including *** G4Cerenkov ***
*** G4Scintillation ***
*** G4OpAbsorption ***
*** G4OpRayleigh ***
*** G4OpBoundaryProcess ***
G4VUserDetectorConstruction
---------------------------
==> define material: Air and Water
define simple G4box geometry
*** add G4MaterialPropertiesTable to G4Material ***
*** define G4LogicalSurface(s) ***
*** define G4OpticalSurface ***
*** add G4MaterialPropertiesTable to G4OpticalSurface ***
G4VUserPrimaryGeneratorAction
-----------------------------
==> Use G4ParticleGun to shoot a charge particle into a Cerenkov radiator
==> A messenger command allows to define interactivly the polarization of an
primary optical photon (see for instance optPhoton.mac)
G4UserRunAction
---------------
==> define G4Timer (start/stop)
set verbose levels
G4UserStackingAction
--------------------
==> show how to count the number of secondary particles in an event
Visualisation
-------------
The Visualization Manager is set in the main().
The initialisation of the drawing is done via a set of /vis/ commands
in the macro vis.mac. This macro is automatically read from
the main in case of interactive running mode.
The detector has a default view which is a longitudinal view of the tank.
The tracks are drawn at the end of event, and erased at the end of run.
HOW TO START
------------
- compile and link to generate an executable
% cd OpNovice
% gmake
This example handles the program arguments in a new way.
It can be run with the following optional arguments:
% OpNovice [-m macro ] [-u UIsession] [-t nThreads]
The -t option is available only in multi-threading mode
and it allows the user to override the Geant4 default number of
threads. The number of threads can be also set via G4FORCENUMBEROFTHREADS
environment variable which has the top priority.
- execute OpNovice in 'batch' mode from macro files
% OpNovice -m OpNovice.in
- execute OpNovice in 'interactive mode' with visualization
% OpNovice
....
Idle> type your commands. For instance:
Idle> /control/execute optPhoton.mac
....
Idle> exit
@@ -0,0 +1,48 @@
#
# This file permits to customize, with commands,
# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
#
# Add icons of general interest
#
/control/execute icons.mac
#
# File menu :
/gui/addMenu file File
/gui/addButton file Quit exit
#
# Run menu :
/gui/addMenu run Run
/gui/addButton run "beamOn 1" "/run/beamOn 1"
/gui/addButton run run1 "/control/execute run1.mac"
/gui/addButton run run2 "/control/execute run2.mac"
#
# Gun menu :
/gui/addMenu gun Gun
/gui/addButton gun "50 MeV" "/gun/energy 50 MeV"
/gui/addButton gun "1 GeV" "/gun/energy 1 GeV"
/gui/addButton gun "10 GeV" "/gun/energy 10 GeV"
/gui/addButton gun "e-" "/gun/particle e-"
/gui/addButton gun "pi0" "/gun/particle pi0"
/gui/addButton gun "pi+" "/gun/particle pi+"
/gui/addButton gun "neutron" "/gun/particle neutron"
/gui/addButton gun "proton" "/gun/particle proton"
#
# Field menu :
/gui/addMenu field Field
/gui/addButton field "off" "/B2/det/setField 0.2 tesla"
/gui/addButton field "0.2 tesla" "/B2/det/setField 0.2 tesla"
/gui/addButton field "2.0 tesla" "/B2/det/setField 2.0 tesla"
#
# Viewer menu :
/gui/addMenu viewer Viewer
/gui/addButton viewer "Set style surface" "/vis/viewer/set/style surface"
/gui/addButton viewer "Set style wireframe" "/vis/viewer/set/style wire"
/gui/addButton viewer "Refresh viewer" "/vis/viewer/refresh"
/gui/addButton viewer "Update viewer (interaction or end-of-file)" "/vis/viewer/update"
/gui/addButton viewer "Flush viewer (= refresh + update)" "/vis/viewer/flush"
/gui/addButton viewer "Update scene" "/vis/scene/notifyHandlers"
#
# User defined icon :
/gui/addIcon "Run beam on" user_icon "/run/beamOn 1" run.png
@@ -0,0 +1,26 @@
#
# This file permits to customize, with commands,
# the icon menu bar of the G4UIQt sessions not yet implemented other UI drivers (geant4-09-05-ref-09)
# It has no effect with G4UIterminal.
# open/save icons
/gui/addIcon "Open macro file" open /control/execute
/gui/addIcon "Save viewer state" save /vis/viewer/save
# Cursors style icons
/gui/addIcon "Move" move
/gui/addIcon "Pick" pick
/gui/addIcon "Zoom out" zoom_out
/gui/addIcon "Zoom in" zoom_in
/gui/addIcon "Rotate" rotate
# Surface Style icons
# Surface Style icons
/gui/addIcon "Hidden line removal" hidden_line_removal
/gui/addIcon "Hidden line and hidden surface removal" hidden_line_and_surface_removal
/gui/addIcon "Surfaces" solid
/gui/addIcon "Wireframe" wireframe
# Perspective/Ortho icons
/gui/addIcon "Perspective" perspective
/gui/addIcon "Orthographic" ortho
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: OpNoviceActionInitialization.hh 68058 2013-03-13 14:47:43Z gcosmo $
//
/// \file OpNoviceActionInitialization.hh
/// \brief Definition of the OpNoviceActionInitialization class
#ifndef OpNoviceActionInitialization_h
#define OpNoviceActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
class B4DetectorConstruction;
/// Action initialization class.
///
class OpNoviceActionInitialization : public G4VUserActionInitialization
{
public:
OpNoviceActionInitialization();
virtual ~OpNoviceActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
virtual G4VSteppingVerbose* InitializeSteppingVerbose() const;
};
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef OpNoviceDetectorConstruction_h
#define OpNoviceDetectorConstruction_h 1
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OpNoviceDetectorConstruction : public G4VUserDetectorConstruction
{
public:
OpNoviceDetectorConstruction();
virtual ~OpNoviceDetectorConstruction();
public:
virtual G4VPhysicalVolume* Construct();
private:
G4double fExpHall_x;
G4double fExpHall_y;
G4double fExpHall_z;
G4double fTank_x;
G4double fTank_y;
G4double fTank_z;
G4double fBubble_x;
G4double fBubble_y;
G4double fBubble_z;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif /*OpNoviceDetectorConstruction_h*/
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef OpNovicePhysicsList_h
#define OpNovicePhysicsList_h 1
#include "globals.hh"
#include "G4VUserPhysicsList.hh"
class G4Cerenkov;
class G4Scintillation;
class G4OpAbsorption;
class G4OpRayleigh;
class G4OpMieHG;
class G4OpBoundaryProcess;
class OpNovicePhysicsListMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OpNovicePhysicsList : public G4VUserPhysicsList
{
public:
OpNovicePhysicsList();
virtual ~OpNovicePhysicsList();
public:
virtual void ConstructParticle();
virtual void ConstructProcess();
virtual void SetCuts();
//these methods Construct physics processes and register them
void ConstructDecay();
void ConstructEM();
void ConstructOp();
//for the Messenger
void SetVerbose(G4int);
void SetNbOfPhotonsCerenkov(G4int);
private:
G4Cerenkov* fCerenkovProcess;
G4Scintillation* fScintillationProcess;
G4OpAbsorption* fAbsorptionProcess;
G4OpRayleigh* fRayleighScatteringProcess;
G4OpMieHG* fMieHGScatteringProcess;
G4OpBoundaryProcess* fBoundaryProcess;
OpNovicePhysicsListMessenger* fMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif /* OpNovicePhysicsList_h */
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef OpNovicePhysicsListMessenger_h
#define OpNovicePhysicsListMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class OpNovicePhysicsList;
class G4UIdirectory;
class G4UIcmdWithAnInteger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OpNovicePhysicsListMessenger: public G4UImessenger
{
public:
OpNovicePhysicsListMessenger(OpNovicePhysicsList* );
virtual ~OpNovicePhysicsListMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
OpNovicePhysicsList* fPhysicsList;
G4UIdirectory* fOpNoviceDir;
G4UIdirectory* fPhysDir;
G4UIcmdWithAnInteger* fVerboseCmd;
G4UIcmdWithAnInteger* fCerenkovCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef OpNovicePrimaryGeneratorAction_h
#define OpNovicePrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
class OpNovicePrimaryGeneratorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OpNovicePrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
OpNovicePrimaryGeneratorAction();
virtual ~OpNovicePrimaryGeneratorAction();
public:
virtual void GeneratePrimaries(G4Event*);
void SetOptPhotonPolar();
void SetOptPhotonPolar(G4double);
private:
G4ParticleGun* fParticleGun;
OpNovicePrimaryGeneratorMessenger* fGunMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif /*OpNovicePrimaryGeneratorAction_h*/
@@ -0,0 +1,61 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef OpNovicePrimaryGeneratorMessenger_h
#define OpNovicePrimaryGeneratorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class OpNovicePrimaryGeneratorAction;
class G4UIdirectory;
class G4UIcmdWithADoubleAndUnit;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OpNovicePrimaryGeneratorMessenger: public G4UImessenger
{
public:
OpNovicePrimaryGeneratorMessenger(OpNovicePrimaryGeneratorAction* );
virtual ~OpNovicePrimaryGeneratorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
OpNovicePrimaryGeneratorAction* fOpNoviceAction;
G4UIdirectory* fGunDir;
G4UIcmdWithADoubleAndUnit* fPolarCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef OpNoviceRunAction_h
#define OpNoviceRunAction_h 1
#include "globals.hh"
#include "G4UserRunAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Timer;
class G4Run;
class OpNoviceRunAction : public G4UserRunAction
{
public:
OpNoviceRunAction();
virtual ~OpNoviceRunAction();
public:
virtual void BeginOfRunAction(const G4Run* aRun);
virtual void EndOfRunAction(const G4Run* aRun);
private:
G4Timer* fTimer;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif /*OpNoviceRunAction_h*/
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef OpNoviceStackingAction_H
#define OpNoviceStackingAction_H 1
#include "globals.hh"
#include "G4UserStackingAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OpNoviceStackingAction : public G4UserStackingAction
{
public:
OpNoviceStackingAction();
virtual ~OpNoviceStackingAction();
public:
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
virtual void NewStage();
virtual void PrepareNewEvent();
private:
G4int fScintillationCounter;
G4int fCerenkovCounter;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: OpNoviceSteppingAction.hh 69469 2013-05-05 21:42:35Z ihrivnac $
//
/// \file OpNoviceSteppingAction.hh
/// \brief Definition of the OpNoviceSteppingAction class
#ifndef OpNoviceSteppingAction_h
#define OpNoviceSteppingAction_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
/// Stepping action class
///
class OpNoviceSteppingAction : public G4UserSteppingAction
{
public:
OpNoviceSteppingAction();
virtual ~OpNoviceSteppingAction();
// method from the base class
virtual void UserSteppingAction(const G4Step*);
private:
G4int fScintillationCounter;
G4int fCerenkovCounter;
G4int fEventNumber;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,55 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OpNoviceSteppingVerbose;
#ifndef OpNoviceSteppingVerbose_h
#define OpNoviceSteppingVerbose_h 1
#include "G4SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OpNoviceSteppingVerbose : public G4SteppingVerbose
{
public:
OpNoviceSteppingVerbose();
virtual ~OpNoviceSteppingVerbose();
virtual void StepInfo();
virtual void TrackingStarted();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,14 @@
/control/verbose 2
/tracking/verbose 3
#
/gun/particle opticalphoton
/gun/energy 3 eV
#
/gun/direction 5 -3 0
/OpNovice/gun/optPhotonPolar
/run/beamOn 1
#
/gun/position 30 40 50 cm
/gun/direction 1 1 1
/OpNovice/gun/optPhotonPolar
/run/beamOn 1
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,74 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: OpNoviceActionInitialization.cc 68058 2013-03-13 14:47:43Z gcosmo $
//
/// \file OpNoviceActionInitialization.cc
/// \brief Implementation of the OpNoviceActionInitialization class
#include "OpNoviceActionInitialization.hh"
#include "OpNovicePrimaryGeneratorAction.hh"
#include "OpNoviceRunAction.hh"
#include "OpNoviceSteppingAction.hh"
#include "OpNoviceStackingAction.hh"
#include "OpNoviceSteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceActionInitialization::OpNoviceActionInitialization()
: G4VUserActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceActionInitialization::~OpNoviceActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceActionInitialization::BuildForMaster() const
{
SetUserAction(new OpNoviceRunAction());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceActionInitialization::Build() const
{
SetUserAction(new OpNovicePrimaryGeneratorAction());
SetUserAction(new OpNoviceRunAction());
SetUserAction(new OpNoviceSteppingAction());
SetUserAction(new OpNoviceStackingAction());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VSteppingVerbose*
OpNoviceActionInitialization::InitializeSteppingVerbose() const
{
return new OpNoviceSteppingVerbose();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,321 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "OpNoviceDetectorConstruction.hh"
#include "G4Material.hh"
#include "G4Element.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4OpticalSurface.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceDetectorConstruction::OpNoviceDetectorConstruction()
: G4VUserDetectorConstruction()
{
fExpHall_x = fExpHall_y = fExpHall_z = 10.0*m;
fTank_x = fTank_y = fTank_z = 5.0*m;
fBubble_x = fBubble_y = fBubble_z = 0.5*m;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceDetectorConstruction::~OpNoviceDetectorConstruction(){;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* OpNoviceDetectorConstruction::Construct()
{
// ------------- Materials -------------
G4double a, z, density;
G4int nelements;
// Air
//
G4Element* N = new G4Element("Nitrogen", "N", z=7 , a=14.01*g/mole);
G4Element* O = new G4Element("Oxygen" , "O", z=8 , a=16.00*g/mole);
G4Material* air = new G4Material("Air", density=1.29*mg/cm3, nelements=2);
air->AddElement(N, 70.*perCent);
air->AddElement(O, 30.*perCent);
// Water
//
G4Element* H = new G4Element("Hydrogen", "H", z=1 , a=1.01*g/mole);
G4Material* water = new G4Material("Water", density= 1.0*g/cm3, nelements=2);
water->AddElement(H, 2);
water->AddElement(O, 1);
//
// ------------ Generate & Add Material Properties Table ------------
//
const G4int nEntries = 32;
G4double photonEnergy[nEntries] =
{ 2.034*eV, 2.068*eV, 2.103*eV, 2.139*eV,
2.177*eV, 2.216*eV, 2.256*eV, 2.298*eV,
2.341*eV, 2.386*eV, 2.433*eV, 2.481*eV,
2.532*eV, 2.585*eV, 2.640*eV, 2.697*eV,
2.757*eV, 2.820*eV, 2.885*eV, 2.954*eV,
3.026*eV, 3.102*eV, 3.181*eV, 3.265*eV,
3.353*eV, 3.446*eV, 3.545*eV, 3.649*eV,
3.760*eV, 3.877*eV, 4.002*eV, 4.136*eV };
//
// Water
//
G4double refractiveIndex1[nEntries] =
{ 1.3435, 1.344, 1.3445, 1.345, 1.3455,
1.346, 1.3465, 1.347, 1.3475, 1.348,
1.3485, 1.3492, 1.35, 1.3505, 1.351,
1.3518, 1.3522, 1.3530, 1.3535, 1.354,
1.3545, 1.355, 1.3555, 1.356, 1.3568,
1.3572, 1.358, 1.3585, 1.359, 1.3595,
1.36, 1.3608};
G4double absorption[nEntries] =
{3.448*m, 4.082*m, 6.329*m, 9.174*m, 12.346*m, 13.889*m,
15.152*m, 17.241*m, 18.868*m, 20.000*m, 26.316*m, 35.714*m,
45.455*m, 47.619*m, 52.632*m, 52.632*m, 55.556*m, 52.632*m,
52.632*m, 47.619*m, 45.455*m, 41.667*m, 37.037*m, 33.333*m,
30.000*m, 28.500*m, 27.000*m, 24.500*m, 22.000*m, 19.500*m,
17.500*m, 14.500*m };
G4double scintilFast[nEntries] =
{ 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00 };
G4double scintilSlow[nEntries] =
{ 0.01, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00,
7.00, 8.00, 9.00, 8.00, 7.00, 6.00, 4.00,
3.00, 2.00, 1.00, 0.01, 1.00, 2.00, 3.00,
4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 8.00,
7.00, 6.00, 5.00, 4.00 };
G4MaterialPropertiesTable* myMPT1 = new G4MaterialPropertiesTable();
myMPT1->AddProperty("RINDEX", photonEnergy, refractiveIndex1,nEntries)
->SetSpline(true);
myMPT1->AddProperty("ABSLENGTH", photonEnergy, absorption, nEntries)
->SetSpline(true);
myMPT1->AddProperty("FASTCOMPONENT",photonEnergy, scintilFast, nEntries)
->SetSpline(true);
myMPT1->AddProperty("SLOWCOMPONENT",photonEnergy, scintilSlow, nEntries)
->SetSpline(true);
myMPT1->AddConstProperty("SCINTILLATIONYIELD",50./MeV);
myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
myMPT1->AddConstProperty("FASTTIMECONSTANT", 1.*ns);
myMPT1->AddConstProperty("SLOWTIMECONSTANT",10.*ns);
myMPT1->AddConstProperty("YIELDRATIO",0.8);
const G4int numentries_water = 60;
G4double energy_water[numentries_water] = {
1.56962*eV, 1.58974*eV, 1.61039*eV, 1.63157*eV,
1.65333*eV, 1.67567*eV, 1.69863*eV, 1.72222*eV,
1.74647*eV, 1.77142*eV, 1.7971 *eV, 1.82352*eV,
1.85074*eV, 1.87878*eV, 1.90769*eV, 1.93749*eV,
1.96825*eV, 1.99999*eV, 2.03278*eV, 2.06666*eV,
2.10169*eV, 2.13793*eV, 2.17543*eV, 2.21428*eV,
2.25454*eV, 2.29629*eV, 2.33962*eV, 2.38461*eV,
2.43137*eV, 2.47999*eV, 2.53061*eV, 2.58333*eV,
2.63829*eV, 2.69565*eV, 2.75555*eV, 2.81817*eV,
2.88371*eV, 2.95237*eV, 3.02438*eV, 3.09999*eV,
3.17948*eV, 3.26315*eV, 3.35134*eV, 3.44444*eV,
3.54285*eV, 3.64705*eV, 3.75757*eV, 3.87499*eV,
3.99999*eV, 4.13332*eV, 4.27585*eV, 4.42856*eV,
4.59258*eV, 4.76922*eV, 4.95999*eV, 5.16665*eV,
5.39129*eV, 5.63635*eV, 5.90475*eV, 6.19998*eV
};
//assume 100 times larger than the rayleigh scattering for now.
G4double mie_water[numentries_water] = {
167024.4*m, 158726.7*m, 150742 *m,
143062.5*m, 135680.2*m, 128587.4*m,
121776.3*m, 115239.5*m, 108969.5*m,
102958.8*m, 97200.35*m, 91686.86*m,
86411.33*m, 81366.79*m, 76546.42*m,
71943.46*m, 67551.29*m, 63363.36*m,
59373.25*m, 55574.61*m, 51961.24*m,
48527.00*m, 45265.87*m, 42171.94*m,
39239.39*m, 36462.50*m, 33835.68*m,
31353.41*m, 29010.30*m, 26801.03*m,
24720.42*m, 22763.36*m, 20924.88*m,
19200.07*m, 17584.16*m, 16072.45*m,
14660.38*m, 13343.46*m, 12117.33*m,
10977.70*m, 9920.416*m, 8941.407*m,
8036.711*m, 7202.470*m, 6434.927*m,
5730.429*m, 5085.425*m, 4496.467*m,
3960.210*m, 3473.413*m, 3032.937*m,
2635.746*m, 2278.907*m, 1959.588*m,
1675.064*m, 1422.710*m, 1200.004*m,
1004.528*m, 833.9666*m, 686.1063*m
};
// gforward, gbackward, forward backward ratio
G4double mie_water_const[3]={0.99,0.99,0.8};
myMPT1->AddProperty("MIEHG",energy_water,mie_water,numentries_water)
->SetSpline(true);
myMPT1->AddConstProperty("MIEHG_FORWARD",mie_water_const[0]);
myMPT1->AddConstProperty("MIEHG_BACKWARD",mie_water_const[1]);
myMPT1->AddConstProperty("MIEHG_FORWARD_RATIO",mie_water_const[2]);
water->SetMaterialPropertiesTable(myMPT1);
// Set the Birks Constant for the Water scintillator
water->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
//
// Air
//
G4double refractiveIndex2[nEntries] =
{ 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00 };
G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable();
myMPT2->AddProperty("RINDEX", photonEnergy, refractiveIndex2, nEntries);
air->SetMaterialPropertiesTable(myMPT2);
//
// ------------- Volumes --------------
// The experimental Hall
//
G4Box* expHall_box = new G4Box("World",fExpHall_x,fExpHall_y,fExpHall_z);
G4LogicalVolume* expHall_log
= new G4LogicalVolume(expHall_box,air,"World",0,0,0);
G4VPhysicalVolume* expHall_phys
= new G4PVPlacement(0,G4ThreeVector(),expHall_log,"World",0,false,0);
// The Water Tank
//
G4Box* waterTank_box = new G4Box("Tank",fTank_x,fTank_y,fTank_z);
G4LogicalVolume* waterTank_log
= new G4LogicalVolume(waterTank_box,water,"Tank",0,0,0);
G4VPhysicalVolume* waterTank_phys
= new G4PVPlacement(0,G4ThreeVector(),waterTank_log,"Tank",
expHall_log,false,0);
// The Air Bubble
//
G4Box* bubbleAir_box = new G4Box("Bubble",fBubble_x,fBubble_y,fBubble_z);
G4LogicalVolume* bubbleAir_log
= new G4LogicalVolume(bubbleAir_box,air,"Bubble",0,0,0);
//G4VPhysicalVolume* bubbleAir_phys =
new G4PVPlacement(0,G4ThreeVector(0,2.5*m,0),bubbleAir_log,"Bubble",
waterTank_log,false,0);
// ------------- Surfaces --------------
//
// Water Tank
//
G4OpticalSurface* opWaterSurface = new G4OpticalSurface("WaterSurface");
opWaterSurface->SetType(dielectric_dielectric);
opWaterSurface->SetFinish(ground);
opWaterSurface->SetModel(unified);
new G4LogicalBorderSurface("WaterSurface",
waterTank_phys,expHall_phys,opWaterSurface);
// Air Bubble
//
G4OpticalSurface* opAirSurface = new G4OpticalSurface("AirSurface");
opAirSurface->SetType(dielectric_dielectric);
opAirSurface->SetFinish(polished);
opAirSurface->SetModel(glisur);
G4LogicalSkinSurface* airSurface =
new G4LogicalSkinSurface("AirSurface", bubbleAir_log, opAirSurface);
G4OpticalSurface* opticalSurface = dynamic_cast <G4OpticalSurface*>
(airSurface->GetSurface(bubbleAir_log)->GetSurfaceProperty());
if (opticalSurface) opticalSurface->DumpInfo();
//
// Generate & Add Material Properties Table attached to the optical surfaces
//
const G4int num = 2;
G4double ephoton[num] = {2.034*eV, 4.136*eV};
//OpticalWaterSurface
G4double refractiveIndex[num] = {1.35, 1.40};
G4double specularLobe[num] = {0.3, 0.3};
G4double specularSpike[num] = {0.2, 0.2};
G4double backScatter[num] = {0.2, 0.2};
G4MaterialPropertiesTable* myST1 = new G4MaterialPropertiesTable();
myST1->AddProperty("RINDEX", ephoton, refractiveIndex, num);
myST1->AddProperty("SPECULARLOBECONSTANT", ephoton, specularLobe, num);
myST1->AddProperty("SPECULARSPIKECONSTANT", ephoton, specularSpike, num);
myST1->AddProperty("BACKSCATTERCONSTANT", ephoton, backScatter, num);
opWaterSurface->SetMaterialPropertiesTable(myST1);
//OpticalAirSurface
G4double reflectivity[num] = {0.3, 0.5};
G4double efficiency[num] = {0.8, 1.0};
G4MaterialPropertiesTable *myST2 = new G4MaterialPropertiesTable();
myST2->AddProperty("REFLECTIVITY", ephoton, reflectivity, num);
myST2->AddProperty("EFFICIENCY", ephoton, efficiency, num);
opAirSurface->SetMaterialPropertiesTable(myST2);
//always return the physical World
return expHall_phys;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,293 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "globals.hh"
#include "OpNovicePhysicsList.hh"
#include "OpNovicePhysicsListMessenger.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4BosonConstructor.hh"
#include "G4LeptonConstructor.hh"
#include "G4MesonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4IonConstructor.hh"
#include "G4ShortLivedConstructor.hh"
#include "G4ProcessManager.hh"
#include "G4Cerenkov.hh"
#include "G4Scintillation.hh"
#include "G4OpAbsorption.hh"
#include "G4OpRayleigh.hh"
#include "G4OpMieHG.hh"
#include "G4OpBoundaryProcess.hh"
#include "G4LossTableManager.hh"
#include "G4EmSaturation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNovicePhysicsList::OpNovicePhysicsList()
: G4VUserPhysicsList(),
fCerenkovProcess(NULL),
fScintillationProcess(NULL),
fAbsorptionProcess(NULL),
fRayleighScatteringProcess(NULL),
fMieHGScatteringProcess(NULL),
fBoundaryProcess(NULL),
fMessenger(0)
{
fMessenger = new OpNovicePhysicsListMessenger(this);
SetVerboseLevel(0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNovicePhysicsList::~OpNovicePhysicsList() { delete fMessenger; }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
G4BosonConstructor bConstructor;
bConstructor.ConstructParticle();
G4LeptonConstructor lConstructor;
lConstructor.ConstructParticle();
G4MesonConstructor mConstructor;
mConstructor.ConstructParticle();
G4BaryonConstructor rConstructor;
rConstructor.ConstructParticle();
G4IonConstructor iConstructor;
iConstructor.ConstructParticle();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsList::ConstructProcess()
{
AddTransportation();
ConstructDecay();
ConstructEM();
ConstructOp();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Decay.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsList::ConstructDecay()
{
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (theDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(theDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4eMultipleScattering.hh"
#include "G4MuMultipleScattering.hh"
#include "G4hMultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
// gamma
// Construct processes for gamma
pmanager->AddDiscreteProcess(new G4GammaConversion());
pmanager->AddDiscreteProcess(new G4ComptonScattering());
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
} else if (particleName == "e-") {
//electron
// Construct processes for electron
pmanager->AddProcess(new G4eMultipleScattering(),-1, 1, 1);
pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
} else if (particleName == "e+") {
//positron
// Construct processes for positron
pmanager->AddProcess(new G4eMultipleScattering(),-1, 1, 1);
pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1, 4);
} else if( particleName == "mu+" ||
particleName == "mu-" ) {
//muon
// Construct processes for muon
pmanager->AddProcess(new G4MuMultipleScattering(),-1, 1, 1);
pmanager->AddProcess(new G4MuIonisation(), -1, 2, 2);
pmanager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3);
pmanager->AddProcess(new G4MuPairProduction(), -1, 4, 4);
} else {
if ((particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino") &&
!particle->IsShortLived()) {
// all others charged particles except geantino
pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(), -1,2,2);
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsList::ConstructOp()
{
fCerenkovProcess = new G4Cerenkov("Cerenkov");
fScintillationProcess = new G4Scintillation("Scintillation");
fAbsorptionProcess = new G4OpAbsorption();
fRayleighScatteringProcess = new G4OpRayleigh();
fMieHGScatteringProcess = new G4OpMieHG();
fBoundaryProcess = new G4OpBoundaryProcess();
// fCerenkovProcess->DumpPhysicsTable();
// fScintillationProcess->DumpPhysicsTable();
// fRayleighScatteringProcess->DumpPhysicsTable();
SetVerbose(1);
fCerenkovProcess->SetMaxNumPhotonsPerStep(20);
fCerenkovProcess->SetMaxBetaChangePerStep(10.0);
fCerenkovProcess->SetTrackSecondariesFirst(true);
fScintillationProcess->SetScintillationYieldFactor(1.);
fScintillationProcess->SetTrackSecondariesFirst(true);
// Use Birks Correction in the Scintillation process
G4EmSaturation* emSaturation =
G4LossTableManager::Instance()->EmSaturation();
fScintillationProcess->AddSaturation(emSaturation);
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (fCerenkovProcess->IsApplicable(*particle)) {
pmanager->AddProcess(fCerenkovProcess);
pmanager->SetProcessOrdering(fCerenkovProcess,idxPostStep);
}
if (fScintillationProcess->IsApplicable(*particle)) {
pmanager->AddProcess(fScintillationProcess);
pmanager->SetProcessOrderingToLast(fScintillationProcess, idxAtRest);
pmanager->SetProcessOrderingToLast(fScintillationProcess, idxPostStep);
}
if (particleName == "opticalphoton") {
G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
pmanager->AddDiscreteProcess(fAbsorptionProcess);
pmanager->AddDiscreteProcess(fRayleighScatteringProcess);
pmanager->AddDiscreteProcess(fMieHGScatteringProcess);
pmanager->AddDiscreteProcess(fBoundaryProcess);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsList::SetVerbose(G4int verbose)
{
fCerenkovProcess->SetVerboseLevel(verbose);
fScintillationProcess->SetVerboseLevel(verbose);
fAbsorptionProcess->SetVerboseLevel(verbose);
fRayleighScatteringProcess->SetVerboseLevel(verbose);
fMieHGScatteringProcess->SetVerboseLevel(verbose);
fBoundaryProcess->SetVerboseLevel(verbose);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsList::SetNbOfPhotonsCerenkov(G4int MaxNumber)
{
fCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumber);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsList::SetCuts()
{
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
//
SetCutsWithDefault();
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,90 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "OpNovicePhysicsListMessenger.hh"
#include "OpNovicePhysicsList.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAnInteger.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNovicePhysicsListMessenger::
OpNovicePhysicsListMessenger(OpNovicePhysicsList* pPhys)
: G4UImessenger(),
fPhysicsList(pPhys)
{
fOpNoviceDir = new G4UIdirectory("/OpNovice/");
fOpNoviceDir->SetGuidance("UI commands of this example");
fPhysDir = new G4UIdirectory("/OpNovice/phys/");
fPhysDir->SetGuidance("PhysicsList control");
fVerboseCmd = new G4UIcmdWithAnInteger("/OpNovice/phys/verbose",this);
fVerboseCmd->SetGuidance("set verbose for physics processes");
fVerboseCmd->SetParameterName("verbose",true);
fVerboseCmd->SetDefaultValue(1);
fVerboseCmd->SetRange("verbose>=0");
fVerboseCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fCerenkovCmd =
new G4UIcmdWithAnInteger("/OpNovice/phys/cerenkovMaxPhotons",this);
fCerenkovCmd->SetGuidance("set max nb of photons per step");
fCerenkovCmd->SetParameterName("MaxNumber",false);
fCerenkovCmd->SetRange("MaxNumber>=0");
fCerenkovCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNovicePhysicsListMessenger::~OpNovicePhysicsListMessenger()
{
delete fVerboseCmd;
delete fCerenkovCmd;
delete fPhysDir;
delete fOpNoviceDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if( command == fVerboseCmd )
{fPhysicsList->SetVerbose(fVerboseCmd->GetNewIntValue(newValue));}
if( command == fCerenkovCmd )
{fPhysicsList->
SetNbOfPhotonsCerenkov(fCerenkovCmd->GetNewIntValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,113 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "OpNovicePrimaryGeneratorAction.hh"
#include "OpNovicePrimaryGeneratorMessenger.hh"
#include "Randomize.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNovicePrimaryGeneratorAction::OpNovicePrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
fParticleGun(0)
{
G4int n_particle = 1;
fParticleGun = new G4ParticleGun(n_particle);
//create a messenger for this class
fGunMessenger = new OpNovicePrimaryGeneratorMessenger(this);
//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);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNovicePrimaryGeneratorAction::~OpNovicePrimaryGeneratorAction()
{
delete fParticleGun;
delete fGunMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
fParticleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePrimaryGeneratorAction::SetOptPhotonPolar()
{
G4double angle = G4UniformRand() * 360.0*deg;
SetOptPhotonPolar(angle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePrimaryGeneratorAction::SetOptPhotonPolar(G4double angle)
{
if (fParticleGun->GetParticleDefinition()->GetParticleName()!="opticalphoton")
{
G4cout << "--> warning from PrimaryGeneratorAction::SetOptPhotonPolar() :"
"the particleGun is not an opticalphoton" << G4endl;
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);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "OpNovicePrimaryGeneratorMessenger.hh"
#include "OpNovicePrimaryGeneratorAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNovicePrimaryGeneratorMessenger::
OpNovicePrimaryGeneratorMessenger(OpNovicePrimaryGeneratorAction* OpNoviceGun)
: G4UImessenger(),
fOpNoviceAction(OpNoviceGun)
{
fGunDir = new G4UIdirectory("/OpNovice/gun/");
fGunDir->SetGuidance("PrimaryGenerator control");
fPolarCmd =
new G4UIcmdWithADoubleAndUnit("/OpNovice/gun/optPhotonPolar",this);
fPolarCmd->SetGuidance("Set linear polarization");
fPolarCmd->SetGuidance(" angle w.r.t. (k,n) plane");
fPolarCmd->SetParameterName("angle",true);
fPolarCmd->SetUnitCategory("Angle");
fPolarCmd->SetDefaultValue(-360.0);
fPolarCmd->SetDefaultUnit("deg");
fPolarCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNovicePrimaryGeneratorMessenger::~OpNovicePrimaryGeneratorMessenger()
{
delete fPolarCmd;
delete fGunDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNovicePrimaryGeneratorMessenger::SetNewValue(
G4UIcommand* command, G4String newValue)
{
if( command == fPolarCmd ) {
G4double angle = fPolarCmd->GetNewDoubleValue(newValue);
if ( angle == -360.0*deg ) {
fOpNoviceAction->SetOptPhotonPolar();
} else {
fOpNoviceAction->SetOptPhotonPolar(angle);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Make this appear first!
#include "G4Timer.hh"
#include "OpNoviceRunAction.hh"
#include "G4Run.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceRunAction::OpNoviceRunAction()
: G4UserRunAction(),
fTimer(0)
{
fTimer = new G4Timer;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceRunAction::~OpNoviceRunAction()
{
delete fTimer;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceRunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
fTimer->Start();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceRunAction::EndOfRunAction(const G4Run* aRun)
{
fTimer->Stop();
G4cout << "number of event = " << aRun->GetNumberOfEvent()
<< " " << *fTimer << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,87 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "OpNoviceStackingAction.hh"
#include "G4VProcess.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4Track.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceStackingAction::OpNoviceStackingAction()
: G4UserStackingAction(),
fScintillationCounter(0), fCerenkovCounter(0)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceStackingAction::~OpNoviceStackingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack
OpNoviceStackingAction::ClassifyNewTrack(const G4Track * aTrack)
{
if(aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition())
{ // particle is optical photon
if(aTrack->GetParentID()>0)
{ // particle is secondary
if(aTrack->GetCreatorProcess()->GetProcessName() == "Scintillation")
fScintillationCounter++;
if(aTrack->GetCreatorProcess()->GetProcessName() == "Cerenkov")
fCerenkovCounter++;
}
}
return fUrgent;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceStackingAction::NewStage()
{
G4cout << "Number of Scintillation photons produced in this event : "
<< fScintillationCounter << G4endl;
G4cout << "Number of Cerenkov photons produced in this event : "
<< fCerenkovCounter << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceStackingAction::PrepareNewEvent()
{
fScintillationCounter = 0;
fCerenkovCounter = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,98 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: OpNoviceSteppingAction.cc 71007 2013-06-09 16:14:59Z maire $
//
/// \file OpNoviceSteppingAction.cc
/// \brief Implementation of the OpNoviceSteppingAction class
#include "OpNoviceSteppingAction.hh"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4OpticalPhoton.hh"
#include "G4Event.hh"
#include "G4RunManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceSteppingAction::OpNoviceSteppingAction()
: G4UserSteppingAction()
{
fScintillationCounter = 0;
fCerenkovCounter = 0;
fEventNumber = -1;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceSteppingAction::~OpNoviceSteppingAction()
{ ; }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceSteppingAction::UserSteppingAction(const G4Step* step)
{
G4int eventNumber = G4RunManager::GetRunManager()->
GetCurrentEvent()->GetEventID();
if (eventNumber != fEventNumber) {
G4cout << " Number of Scintillation Photons in previous event: "
<< fScintillationCounter << G4endl;
G4cout << " Number of Cerenkov Photons in previous event: "
<< fCerenkovCounter << G4endl;
fEventNumber = eventNumber;
fScintillationCounter = 0;
fCerenkovCounter = 0;
}
G4Track* track = step->GetTrack();
G4String ParticleName = track->GetDynamicParticle()->
GetParticleDefinition()->GetParticleName();
if (ParticleName == "opticalphoton") return;
const std::vector<const G4Track*>* secondaries =
step->GetSecondaryInCurrentStep();
if (secondaries->size()>0) {
for(unsigned int i=0; i<secondaries->size(); ++i) {
if (secondaries->at(i)->GetParentID()>0) {
if(secondaries->at(i)->GetDynamicParticle()->GetParticleDefinition()
== G4OpticalPhoton::OpticalPhotonDefinition()){
if (secondaries->at(i)->GetCreatorProcess()->GetProcessName()
== "Scintillation")fScintillationCounter++;
if (secondaries->at(i)->GetCreatorProcess()->GetProcessName()
== "Cerenkov")fCerenkovCounter++;
}
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,181 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "OpNoviceSteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceSteppingVerbose::OpNoviceSteppingVerbose()
: G4SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
OpNoviceSteppingVerbose::~OpNoviceSteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceSteppingVerbose::StepInfo()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel >= 1 ){
if( verboseLevel >= 4 ) VerboseTrack();
if( verboseLevel >= 3 ){
G4cout << G4endl;
G4cout << std::setw( 5) << "#Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
}
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< " ";
// if( fStepStatus != fWorldBoundary){
if( fTrack->GetNextVolume() != 0 ) {
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
} else {
G4cout << std::setw(10) << "OutOfWorld";
}
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
G4cout << " "
<< std::setw(10)
<< fStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName();
} else {
G4cout << " UserLimit";
}
G4cout << G4endl;
if( verboseLevel == 2 ){
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
if(tN2ndariesTot>0){
G4cout << " :----- List of 2ndaries - "
<< "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
<< "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
<< ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
<< ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
<< "), "
<< "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
<< " ---------------"
<< G4endl;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
G4cout << " : "
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
G4cout << " :-----------------------------"
<< "----------------------------------"
<< "-- EndOf2ndaries Info ---------------"
<< G4endl;
}
}
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void OpNoviceSteppingVerbose::TrackingStarted()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel > 0 ){
G4cout << std::setw( 5) << "Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< " ";
if(fTrack->GetNextVolume()){
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
} else {
G4cout << "OutOfWorld";
}
G4cout << " initStep" << G4endl;
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,68 @@
# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
#
# Use this open statement to create a .prim file suitable for
# viewing in DAWN:
#/vis/open DAWNFILE
#
# Use this open statement to create a .heprep file suitable for
# viewing in HepRApp:
#/vis/open HepRepFile
#
# Use this open statement to create a .wrl file suitable for
# viewing in a VRML viewer:
#/vis/open VRML2FILE
#
# Disable auto refresh and quieten vis messages whilst scene and
# trajectories are established:
/vis/viewer/set/autoRefresh false
/vis/verbose errors
#
# Draw geometry:
/vis/drawVolume
#
# Specify view angle:
#/vis/viewer/set/viewpointThetaPhi 90. 0.
#
# Specify zoom value:
/vis/viewer/zoom 1.5
#
# Specify style (surface or wireframe):
#/vis/viewer/set/style wireframe
#
# Draw coordinate axes:
#/vis/scene/add/axes 0 0 0 1 m
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByCharge
/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
#
# Draw hits at end of event:
#/vis/scene/add/hits
#
# To draw only gammas:
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#
# To invert the above, drawing all particles except gammas,
# keep the above two lines but also add:
#/vis/filtering/trajectories/particleFilter-0/invert true
#
# Many other options are available with /vis/modeling and /vis/filtering.
# For example, to select colour by particle ID:
#/vis/modeling/trajectories/create/drawByParticleID
#/vis/modeling/trajectories/drawByParticleID-0/set e- blue
#
# To superimpose all of the events from a given run:
/vis/scene/endOfEventAction accumulate
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush

Some files were not shown because too many files have changed in this diff Show More