Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -25,7 +25,7 @@
//
//
// $Id: exampleP01.cc,v 1.2 2006/06/29 17:38:35 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01ChamberParameterisation.hh,v 1.2 2006/06/29 17:38:43 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// A parameterisation that describes a series of boxes along Z
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01DetectorConstruction.hh,v 1.2 2006/06/29 17:38:46 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01DetectorMessenger.hh,v 1.2 2006/06/29 17:38:49 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01EventAction.hh,v 1.2 2006/06/29 17:38:51 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01MagneticField.hh,v 1.2 2006/06/29 17:38:53 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// A class for control of the Magnetic Field of the detector.
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01PhysicsList.hh,v 1.2 2006/06/29 17:38:55 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01PrimaryGeneratorAction.hh,v 1.2 2006/06/29 17:38:58 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01RunAction.hh,v 1.2 2006/06/29 17:39:01 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01SteppingAction.hh,v 1.2 2006/06/29 17:39:04 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01SteppingVerbose.hh,v 1.2 2006/06/29 17:39:06 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose.
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01TrackerHit.hh,v 1.2 2006/06/29 17:39:08 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01TrackerSD.hh,v 1.2 2006/06/29 17:39:10 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01ChamberParameterisation.cc,v 1.2 2006/06/29 17:39:15 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01DetectorConstruction.cc,v 1.2 2006/06/29 17:39:17 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01DetectorMessenger.cc,v 1.2 2006/06/29 17:39:20 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01EventAction.cc,v 1.2 2006/06/29 17:39:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01MagneticField.cc,v 1.2 2006/06/29 17:39:26 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// User Field class implementation.
//
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01PhysicsList.cc,v 1.2 2006/06/29 17:39:29 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01PrimaryGeneratorAction.cc,v 1.2 2006/06/29 17:39:32 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01RunAction.cc,v 1.2 2006/06/29 17:39:34 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01SteppingAction.cc,v 1.2 2006/06/29 17:39:37 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01SteppingVerbose.cc,v 1.2 2006/06/29 17:39:39 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01TrackerHit.cc,v 1.2 2006/06/29 17:39:41 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: ExP01TrackerSD.cc,v 1.2 2006/06/29 17:39:43 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,55 @@
# $Id: GNUmakefile,v 1.1 2007/11/29 17:05:21 witoldp Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := exampleP02
G4TARGET := $(name)
G4EXLIB := true
LOCALDIR := ${PWD}
ifndef G4INSTALL
G4INSTALL = ../../..
endif
include $(G4INSTALL)/config/architecture.gmk
ifndef PLATFORM
PLATFORM = slc4_ia32_gcc34
endif
CPPFLAGS += -I$(ROOTSYS)/include
EXTRALIBS := -L$(ROOTSYS)/lib -lCore -lTree -lCint -lReflex -lCintex -ldl -lNet -lRIO
DICTIONARYPATH := ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/dictionary
.PHONY: all
all: dictionary lib bin
dictionary:
ifndef ROOTSYS
@echo ROOTSYS not defined!
endif
ifndef GCCXMLPATH
@echo GCCXMLPATH not defined!
endif
mkdir -p ${DICTIONARYPATH}
${ROOTSYS}/bin/genreflex ${LOCALDIR}/include/ExP02Classes.hh \
-s ${LOCALDIR}/xml/selection.xml -o ${DICTIONARYPATH}/Classes_rflx.cpp \
--gccxmlpath ${GCCXMLPATH} -Iinclude -I${G4INCLUDE} -I${CLHEP_INCLUDE_DIR}
#
gcc -o ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/libClassesDict.so -fpic -shared \
${DICTIONARYPATH}/Classes_rflx.cpp src/*.cc \
-Iinclude -I${ROOTSYS}/include -I${G4INCLUDE} -I${CLHEP_INCLUDE_DIR} \
${EXTRALIBS} -L${CLHEP_LIB_DIR} -l${CLHEP_LIB} -L${G4LIB}/${G4SYSTEM} ${LDLIBS2}
#
# mkdir -p ${G4WORKDIR}/bin/${G4SYSTEM}
# gcc -o ${G4WORKDIR}/bin/${G4SYSTEM}/readHits readHits.cc \
# -Iinclude -I${ROOTSYS}/include -I${G4INCLUDE} -I${CLHEP_INCLUDE_DIR} \
# ${EXTRALIBS} -L${CLHEP_LIB_DIR} -l${CLHEP_LIB} -L${G4LIB}/${G4SYSTEM} ${LDLIBS2}
clean_all: clean
@$(RM) hits.root
include $(G4INSTALL)/config/binmake.gmk
+19
View File
@@ -0,0 +1,19 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example P02 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 22, 07 W. Pokorski (exampleP02-V09-00-00)
- Created.
+78
View File
@@ -0,0 +1,78 @@
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
ExampleP02
----------
General description
-------------------
This example shows how to store in a binary file and how to
read back the geometry tree using the 'reflection' technique for
persistency provided by the Reflex tool also included in ROOT. The
Reflex tool allows to create a dictionary for the geometry classes,
making then possible to save the entire tree in a .root file.
The provided makefile produces the executable: 'exampleP02'. In order
to run it one has to specify the argument, either 'write' or
'read'. In the first case the geometry is instaciated in the standard
way and then saved into the root file (geo.root). In the second case,
the geometry is read from geo.root file.
Building and running the example
--------------------------------
Before buidling and/or running the example you need to set the
following environment variables:
ROOTSYS - ROOT installation directory, it is required to run ROOT
GCCXMLPATH - gccxml binary directory, it is needed by ROOT for the
dictionary generation
LD_LIBRARY_PATH - to include the ROOT library path and the path to
the dictionary library, i.e., for tcsh UNIX shell:
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$ROOTSYS/lib:
$G4WORKDIR/tmp/$G4SYSTEM/exampleP01
The present version of the example requires that Geant4 headers are
installed in a single directory referenced by G4INCLUDE, as the standard
Geant4 installation procedure allows to do.
Once those variables are set (together with the standard Geant4 setup)
the example can be build by issueing the 'make' command. The final
executable file can be found in the usual directory:
$G4WORKDIR/bin/$G4SYSTEM/
Remark on dictionary generation
-------------------------------
The dictionary is generated by ${ROOTSYS}/bin/genreflex
tool. The header file including headers for all the classes we want to
generate the dictionary for should be given as argument. Additionally,
a so called selection file (xml) should be provided (with -s flag) to
the genreflex tool (see the GNUmakefile). The role of this file is to
specify which classes we want to generate the dictionary for. The
selection file for our dictionary is in xml/ directory. Please refer
to genreflex manual for more details concerning the usage of that
tool.
Concerning generating dictionary for the Geant4 objects, there are
also two technical remarks that need to be made here. The gccxml tool
(version 0.6.0_patch1) requires all the templated classes to be
explicitely used somewhere in the included header files in order for
the generation of the dictionary to be possible. For those templated
classes for which it is not the case, the problem can be very easily
solved by instaciating them in the headerfile which is given to
genreflex (see includes/Classes.h) as argument.
The second remark is that there is an unfortunate clash of names as
far as G4String class is concerned. The header of G4String class
defines __G4String which happens to be the name of a variable used
within the generated dictionary code. The solution for that is to do
#undef __G4String in include/Classes.h file.
@@ -0,0 +1,119 @@
//
// ********************************************************************
// * 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: exampleP02.cc,v 1.1 2007/11/29 17:05:21 witoldp Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExP02DetectorConstruction.hh"
#include "ExP02DetConstrReader.hh"
#include "ExP02PhysicsList.hh"
#include "ExP02PrimaryGeneratorAction.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc, char** argv)
{
if(argc==1)
{
std::cout << "Please give 'write' or 'read' as argument " << std::endl;
return 0;
}
G4VUserDetectorConstruction* det;
if(std::string(argv[1]) == "read")
{
det = new ExP02DetConstrReader;
}
else if(std::string(argv[1]) == "write")
{
det = new ExP02DetectorConstruction;
}
else
{
std::cout << "Wrong argument!" << std::endl;
return 0;
}
// Run manager
G4RunManager * runManager = new G4RunManager;
// UserInitialization classes (mandatory)
runManager->SetUserInitialization(det);
runManager->SetUserInitialization(new ExP02PhysicsList);
#ifdef G4VIS_USE
// Visualization, if you choose to have it!
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
#endif
// UserAction classes
runManager->SetUserAction(new ExP02PrimaryGeneratorAction());
//Initialize G4 kernel
runManager->Initialize();
//get the pointer to the User Interface manager
G4UImanager * UI = G4UImanager::GetUIpointer();
// Define (G)UI terminal for interactive mode
// G4UIterminal is a (dumb) terminal.
G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
UI->ApplyCommand("/control/execute vis.mac");
session->SessionStart();
delete session;
#ifdef G4VIS_USE
delete visManager;
#endif
delete runManager;
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Binary file not shown.
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "ExP02GeoTree.hh"
//
#include "ExP02DetectorConstruction.hh"
//
#include "CLHEP/Vector/EulerAngles.h"
#include "CLHEP/Vector/ThreeVector.h"
#include "CLHEP/Vector/Rotation.h"
#include "CLHEP/Geometry/Transform3D.h"
//
#include "G4RunManager.hh"
#include "G4VisExtent.hh"
#include "G4Isotope.hh"
#include "G4Element.hh"
#include "G4ElementVector.hh"
#include "G4ElementTable.hh"
#include "G4Material.hh"
#include "G4MaterialCutsCouple.hh"
#include "G4MaterialPropertiesTable.hh"
#include "G4VSolid.hh"
#include "G4VCSGfaceted.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4Polycone.hh"
#include "G4Polyhedron.hh"
#include "G4PolyconeSide.hh"
#include "G4PolyPhiFace.hh"
#include "G4IntersectingCone.hh"
#include "G4Polyhedra.hh"
#include "G4Trd.hh"
#include "G4Trap.hh"
#include "G4Sphere.hh"
#include "G4Para.hh"
#include "G4Orb.hh"
#include "G4Torus.hh"
#include "G4Cons.hh"
#include "G4EnclosingCylinder.hh"
#include "G4ReduciblePolygon.hh"
#include "G4UnionSolid.hh"
#include "G4SubtractionSolid.hh"
#include "G4IntersectionSolid.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VPVParameterisation.hh"
#include "G4VUserRegionInformation.hh"
#include "G4UserLimits.hh"
//
std::vector<CLHEP::Hep3Vector> a;
std::vector<G4VCSGface*> b;
std::vector<G4PolyconeSideRZ> c;
std::vector<G4PolyPhiFaceEdge> d;
std::vector<G4PolyPhiFaceVertex> e;
//
#undef __G4String
@@ -0,0 +1,51 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
#ifndef ExP02DetConstrReader_h
#define ExP02DetConstrReader_h 1
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
class G4VPhysicalVolume;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExP02DetConstrReader : public G4VUserDetectorConstruction
{
public:
ExP02DetConstrReader();
~ExP02DetConstrReader();
public:
G4VPhysicalVolume* Construct();
};
//....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. *
// ********************************************************************
//
#ifndef ExP02DetectorConstruction_H
#define ExP02DetectorConstruction_H 1
class G4LogicalVolume;
class G4VPhysicalVolume;
#include "G4VUserDetectorConstruction.hh"
#include "G4Element.hh"
class ExP02DetectorConstruction : public G4VUserDetectorConstruction
{
public:
ExP02DetectorConstruction();
~ExP02DetectorConstruction();
G4VPhysicalVolume* Construct();
private:
// Logical volumes
//
G4LogicalVolume* experimentalHall_log;
G4LogicalVolume* tracker_log;
G4LogicalVolume* calorimeterBlock_log;
G4LogicalVolume* calorimeterLayer_log;
// Physical volumes
//
G4VPhysicalVolume* experimentalHall_phys;
G4VPhysicalVolume* calorimeterLayer_phys;
G4VPhysicalVolume* calorimeterBlock_phys;
G4VPhysicalVolume* tracker_phys;
};
#endif
@@ -0,0 +1,54 @@
//
// ********************************************************************
// * 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: ExP02GeoTree.hh,v 1.2 2007/12/10 16:29:11 gunter Exp $
#ifndef INCLUDE_EXP02GEOTREE_H
#define INCLUDE_EXP02GEOTREE_H 1
// Include files
#include "G4VPhysicalVolume.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
class ExP02GeoTree {
public:
ExP02GeoTree( );
ExP02GeoTree(G4VPhysicalVolume* vol, const G4ElementTable* et, const G4MaterialTable* mt);
virtual ~ExP02GeoTree( );
G4VPhysicalVolume* TopVol();
private:
G4VPhysicalVolume* topV;
const G4ElementTable* eltab;
const G4MaterialTable* mattab;
};
#endif // INCLUDE_EXP02GEOTREE_H
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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: ExP02PhysicsList.hh,v 1.1 2007/11/29 17:05:22 witoldp Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ExP02PhysicsList_h
#define ExP02PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExP02PhysicsList: public G4VUserPhysicsList
{
public:
ExP02PhysicsList();
~ExP02PhysicsList();
protected:
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
void SetCuts();
protected:
// these methods Construct particles
void ConstructBosons();
void ConstructLeptons();
void ConstructMesons();
void ConstructBaryons();
protected:
// these methods Construct physics processes and register them
void ConstructGeneral();
void ConstructEM();
};
//....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. *
// ********************************************************************
//
//
// $Id: ExP02PrimaryGeneratorAction.hh,v 1.1 2007/11/29 17:05:22 witoldp Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ExP02PrimaryGeneratorAction_h
#define ExP02PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
class ExP02DetectorConstruction;
class G4ParticleGun;
class G4Event;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class ExP02PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
ExP02PrimaryGeneratorAction();
~ExP02PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event*);
private:
G4ParticleGun* particleGun;
ExP02DetectorConstruction* myDetector;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
+23
View File
@@ -0,0 +1,23 @@
#
# Macro file for "persEx02.cc"
#
# can be run in batch, without graphic
# or interactively: Idle> /control/execute run1.mac
#
/run/verbose 2
/event/verbose 0
#
# proton 3 GeV to the direction (0.,0.,1.) (default kinematic)
# 1 event with detailled printing
#
/tracking/verbose 2
/stepping/verbose 2
/run/beamOn 1
#
# muon 300 MeV to the direction (0.,0.,1.)
# 3 events (no printing)
#
/gun/particle mu-
/gun/energy 300 MeV
/tracking/verbose 0
/run/beamOn 3
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//ROOT
#include "TROOT.h"
#include "TFile.h"
#include "TSystem.h"
#include "Cintex/Cintex.h"
//G4
#include "G4Element.hh"
#include "G4PVPlacement.hh"
#include "ExP02GeoTree.hh"
// local
#include "ExP02DetConstrReader.hh"
ExP02DetConstrReader::ExP02DetConstrReader()
{
// initialize ROOT
TSystem ts;
gSystem->Load("libClassesDict");
// ROOT::Cintex::Cintex::SetDebug(2);
ROOT::Cintex::Cintex::Enable();
// gDebug = 1;
}
ExP02DetConstrReader::~ExP02DetConstrReader()
{}
G4VPhysicalVolume* ExP02DetConstrReader::Construct()
{
ExP02GeoTree* geotree;
TFile fo("geo.root");
fo.GetObject("my_geo", geotree);
return geotree->TopVol();
}
@@ -0,0 +1,166 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
#include "ExP02DetectorConstruction.hh"
#include "G4Material.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "globals.hh"
//ROOT
#include "TROOT.h"
#include "TFile.h"
#include "TSystem.h"
#include "Cintex/Cintex.h"
#include "ExP02GeoTree.hh"
ExP02DetectorConstruction::ExP02DetectorConstruction()
: experimentalHall_log(0), tracker_log(0),
calorimeterBlock_log(0), calorimeterLayer_log(0),
experimentalHall_phys(0), calorimeterLayer_phys(0),
calorimeterBlock_phys(0), tracker_phys(0)
{;}
ExP02DetectorConstruction::~ExP02DetectorConstruction()
{
}
G4VPhysicalVolume* ExP02DetectorConstruction::Construct()
{
//------------------------------------------------------ materials
G4double a; // atomic mass
G4double z; // atomic number
G4double density;
G4Material* Ar =
new G4Material("ArgonGas", z= 18., a= 39.95*g/mole, density= 1.782*mg/cm3);
G4Material* Al =
new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3);
G4Material* Pb =
new G4Material("Lead", z= 82., a= 207.19*g/mole, density= 11.35*g/cm3);
//------------------------------------------------------ volumes
//------------------------------ experimental hall (world volume)
//------------------------------ beam line along x axis
G4double expHall_x = 3.0*m;
G4double expHall_y = 1.0*m;
G4double expHall_z = 1.0*m;
G4Box* experimentalHall_box
= new G4Box("expHall_box",expHall_x,expHall_y,expHall_z);
experimentalHall_log = new G4LogicalVolume(experimentalHall_box,
Ar,"expHall_log",0,0,0);
experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),
experimentalHall_log,"expHall",0,false,0);
//------------------------------ a tracker tube
G4double innerRadiusOfTheTube = 0.*cm;
G4double outerRadiusOfTheTube = 60.*cm;
G4double hightOfTheTube = 50.*cm;
G4double startAngleOfTheTube = 0.*deg;
G4double spanningAngleOfTheTube = 360.*deg;
G4Tubs* tracker_tube = new G4Tubs("tracker_tube",innerRadiusOfTheTube,
outerRadiusOfTheTube,hightOfTheTube,
startAngleOfTheTube,spanningAngleOfTheTube);
tracker_log = new G4LogicalVolume(tracker_tube,Al,"tracker_log",0,0,0);
G4double trackerPos_x = -1.0*m;
G4double trackerPos_y = 0.*m;
G4double trackerPos_z = 0.*m;
tracker_phys = new G4PVPlacement(0,
G4ThreeVector(trackerPos_x,trackerPos_y,trackerPos_z),
tracker_log,"tracker",experimentalHall_log,false,0);
//------------------------------ a calorimeter block
G4double block_x = 1.0*m;
G4double block_y = 50.0*cm;
G4double block_z = 50.0*cm;
G4Box* calorimeterBlock_box = new G4Box("calBlock_box",block_x,
block_y,block_z);
calorimeterBlock_log = new G4LogicalVolume(calorimeterBlock_box,
Pb,"caloBlock_log",0,0,0);
G4double blockPos_x = 1.0*m;
G4double blockPos_y = 0.0*m;
G4double blockPos_z = 0.0*m;
calorimeterBlock_phys = new G4PVPlacement(0,
G4ThreeVector(blockPos_x,blockPos_y,blockPos_z),
calorimeterBlock_log,"caloBlock",experimentalHall_log,false,0);
//------------------------------ calorimeter layers
G4double calo_x = 1.*cm;
G4double calo_y = 40.*cm;
G4double calo_z = 40.*cm;
G4Box* calorimeterLayer_box = new G4Box("caloLayer_box",
calo_x,calo_y,calo_z);
calorimeterLayer_log = new G4LogicalVolume(calorimeterLayer_box,
Al,"caloLayer_log",0,0,0);
for(G4int i=0;i<19;i++) // loop for 19 layers
{
G4double caloPos_x = (i-9)*10.*cm;
G4double caloPos_y = 0.0*m;
G4double caloPos_z = 0.0*m;
calorimeterLayer_phys = new G4PVPlacement(0,
G4ThreeVector(caloPos_x,caloPos_y,caloPos_z),
calorimeterLayer_log,"caloLayer",calorimeterBlock_log,false,i);
}
//------------------------------------------------------------------
// writing the geometry to a ROOT file
// initialize ROOT
TSystem ts;
gSystem->Load("libClassesDict");
// ROOT::Cintex::Cintex::SetDebug(2);
ROOT::Cintex::Cintex::Enable();
// gDebug = 1;
const G4ElementTable* eltab = G4Element::GetElementTable();
const G4MaterialTable* mattab = G4Material::GetMaterialTable();
ExP02GeoTree* geotree = new ExP02GeoTree(experimentalHall_phys, eltab, mattab);
TFile fo("geo.root","RECREATE");
fo.WriteObject(geotree, "my_geo");
return experimentalHall_phys;
}
@@ -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. *
// ********************************************************************
//
// $Id: ExP02GeoTree.cc,v 1.2 2007/12/10 16:29:20 gunter Exp $
// Include files
// local
#include "ExP02GeoTree.hh"
//-----------------------------------------------------------------------------
// Implementation file for class : ExP02GeoTree
//
// 2005-05-26 : Witold POKORSKI
//-----------------------------------------------------------------------------
//=============================================================================
// Standard constructor, initializes variables
//=============================================================================
ExP02GeoTree::ExP02GeoTree( ): topV(0)
{
eltab = G4Element::GetElementTable();
mattab = G4Material::GetMaterialTable();
}
ExP02GeoTree::ExP02GeoTree(G4VPhysicalVolume* vol, const G4ElementTable* et, const G4MaterialTable* mt):
topV(vol), eltab(et), mattab(mt)
{}
//=============================================================================
// Destructor
//=============================================================================
ExP02GeoTree::~ExP02GeoTree() {}
//=============================================================================
G4VPhysicalVolume* ExP02GeoTree::TopVol()
{
return topV;
}
@@ -0,0 +1,241 @@
//
// ********************************************************************
// * 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: ExP02PhysicsList.cc,v 1.2 2007/12/10 16:29:25 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "globals.hh"
#include "ExP02PhysicsList.hh"
#include "G4ProcessManager.hh"
#include "G4ParticleTypes.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExP02PhysicsList::ExP02PhysicsList(): G4VUserPhysicsList()
{
defaultCutValue = 1.0*cm;
SetVerboseLevel(1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExP02PhysicsList::~ExP02PhysicsList()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExP02PhysicsList::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.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExP02PhysicsList::ConstructBosons()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExP02PhysicsList::ConstructLeptons()
{
// leptons
// e+/-
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
// mu+/-
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
// nu_e
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
// nu_mu
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExP02PhysicsList::ConstructMesons()
{
// mesons
// light mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExP02PhysicsList::ConstructBaryons()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExP02PhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
ConstructGeneral();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
#include "G4StepLimiter.hh"
#include "G4UserSpecialCuts.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExP02PhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
// gamma
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
pmanager->AddDiscreteProcess(new G4ComptonScattering);
pmanager->AddDiscreteProcess(new G4GammaConversion);
} else if (particleName == "e-") {
//electron
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
} else if (particleName == "e+") {
//positron
pmanager->AddProcess(new G4MultipleScattering,-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
pmanager->AddProcess(new G4MultipleScattering,-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->IsShortLived()) &&
(particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
//all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
pmanager->AddProcess(new G4hIonisation, -1, 2,2);
///pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
///pmanager->AddProcess(new G4UserSpecialCuts, -1,-1,4);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Decay.hh"
void ExP02PhysicsList::ConstructGeneral()
{
// 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......
void ExP02PhysicsList::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,60 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "ExP02PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "globals.hh"
ExP02PrimaryGeneratorAction::ExP02PrimaryGeneratorAction()
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
// particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="pi+"));
particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="geantino"));
particleGun->SetParticleEnergy(1.0*GeV);
particleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, 0.0));
}
ExP02PrimaryGeneratorAction::~ExP02PrimaryGeneratorAction()
{
delete particleGun;
}
void ExP02PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
G4ThreeVector v(1.0,0.1,0.1);
particleGun->SetParticleMomentumDirection(v);
particleGun->GeneratePrimaryVertex(anEvent);
}
+35
View File
@@ -0,0 +1,35 @@
#
# Macro file for the initialization phase of "persEx02.cc"
# when runing in interactive mode
#
# Sets some default verbose
#
/control/verbose 2
/run/verbose 2
/tracking/verbose 2
#
# create empty scene
#
/vis/scene/create
#
# Create a scene handler for a specific graphics system
# (Edit the next line(s) to choose another graphic system)
#
/vis/open OGLIX
#
####/vis/open DAWNFILE
#
# draw scene
#
/vis/viewer/set/viewpointThetaPhi 60 60 deg
/vis/viewer/zoom 1.4
/vis/viewer/flush
#
# for drawing the tracks
# (if too many tracks cause core dump => storeTrajectory 0)
/tracking/storeTrajectory 1
/vis/scene/add/trajectories
# (if you prefer refreshing each event, comment out next line)
/vis/scene/endOfEventAction accumulate
#
/run/beamOn 1
@@ -0,0 +1,171 @@
<lcgdict>
<class name="G4String"/>
<class name="std::vector<double>"/>
<class name="G4OrderedTable"/>
<class name="std::vector<G4DataVector*>"/>
<class name="G4DataVector"/>
<class name="ExP02DetectorConstruction"/>
<class name="ExP02GeoTree"/>
<class name="G4RunManager"/>
<class name="G4Isotope"/>
<class name="G4Element">
<field name="fAtomicShells" comment="[fNbOfAtomicShells]" />
<field name="fRelativeAbundanceVector" comment="[fNumberOfIsotopes]" />
</class>
<class name="std::vector<G4Isotope*>"/>
<class name="std::vector<G4Element*>"/>
<class name="G4Material">
<field name="fMassFractionVector" comment="[fNumberOfElements]" />
<field name="fAtomsVector" comment="[fNumberOfElements]" />
<field name="VecNbOfAtomsPerVolume" comment="[fNumberOfElements]" />
</class>
<class name="G4IonisParamElm">
<!-- <field name="fShellCorrectionVector" comment="[3]" /> -->
<field name="fShellCorrectionVector" transient="true"/>
</class>
<class name="G4IonisParamMat">
<!-- <field name="fShellCorrectionVector" comment="[three]" /> -->
<field name="fShellCorrectionVector" transient="true"/>
</class>
<class name="G4SandiaTable">
<field name="fPhotoAbsorptionCof" transient="true"/>
</class>
<class name="G4MaterialPropertyVector"/>
<class name="G4MaterialPropertiesTable"/>
<class name="std::map<G4String, G4MaterialPropertyVector*>" />
<class name="std::map<G4String, double>" />
<class name="G4VSolid"/>
<class name="G4CSGSolid">
<field name="fpPolyhedron" transient="true"/>
</class>
<class name="G4VCSGface"/>
<class name="std::vector<G4VCSGface*>"/>
<class name="G4VCSGfaceted">
<field name="faces" comment="[numFace]"/>
<field name="fpPolyhedron" transient="true"/>
</class>
<class name="G4BooleanSolid">
<field name="fpPolyhedron" transient="true"/>
</class>
<class name="G4DisplacedSolid">
<field name="fpPolyhedron" transient="true"/>
</class>
<class name="G4AffineTransform"/>
<class name="G4Box"/>
<class name="G4Tubs"/>
<class name="G4Trd"/>
<class name="G4Trap"/>
<class name="TrapSidePlane"/>
<class name="G4Torus"/>
<class name="G4Sphere"/>
<class name="G4Para"/>
<class name="G4Orb"/>
<class name="G4Cons"/>
<class name="G4Polyhedra">
<field name="corners" comment="[numCorner]" />
</class>
<class name="G4PolyhedraSide">
<field name="vecs" comment="[numSide]" />
<field name="edges" comment="[numSide]" />
</class>
<class name="G4PolyhedraSideRZ"/>
<class name="G4PolyhedraSide::sG4PolyhedraSideVec"/>
<class name="G4PolyhedraSide::sG4PolyhedraSideEdge"/>
<class name="G4PolyhedraHistorical">
<field name="Z_values" comment="[Num_z_planes]" />
<field name="Rmin" comment="[Num_z_planes]" />
<field name="Rmax" comment="[Num_z_planes]" />
</class>
<class name="G4Polycone">
<field name="corners" comment="[numCorner]" />
</class>
<class name="G4PolyconeSide">
<field name="corners" comment="[ncorners]" />
</class>
<class name="G4PolyconeSideRZ"/>
<class name="std::vector<G4PolyconeSideRZ>"/>
<class name="G4PolyPhiFace">
<field name="corners" comment="[numEdges]"/>
<field name="edges" comment="[numEdges]"/>
</class>
<class name="G4PolyPhiFaceEdge"/>
<class name="G4PolyPhiFaceVertex"/>
<class name="std::vector<G4PolyPhiFaceEdge>"/>
<class name="std::vector<G4PolyPhiFaceVertex>"/>
<class name="G4PolyconeHistorical">
<field name="Z_values" comment="[Num_z_planes]" />
<field name="Rmin" comment="[Num_z_planes]" />
<field name="Rmax" comment="[Num_z_planes]" />
</class>
<class name="G4IntersectingCone"/>
<class name="G4EnclosingCylinder"/>
<!--
<class name="G4ReduciblePolygon"/>
<class name="G4ReduciblePolygon::ABVertex"/>
-->
<class name="G4UnionSolid"/>
<class name="G4SubtractionSolid"/>
<class name="G4IntersectionSolid"/>
<class name="G4LogicalVolume">
<field name="fFieldManager" transient="true"/>
<field name="fSensitiveDetector" transient="true"/>
<field name="fVoxel" transient="true"/>
<field name="fVisAttributes" transient="true"/>
<field name="fFastSimulationManager" transient="true"/>
</class>
<class name="std::vector<G4LogicalVolume*>"/>
<class name="std::vector<G4Material*>"/>
<class name="std::pair<G4Material*,G4MaterialCutsCouple*>"/>
<class name="std::map<G4Material*,G4MaterialCutsCouple*>"/>
<class name="G4Region">
<field name="fFastSimulationManager" transient="true"/>
<field name="fRegionalSteppingAction" transient="true"/>
</class>
<class name="G4MaterialCutsCouple"/>
<class name="G4ProductionCuts">
<field name="gammaDef" transient="true"/>
<field name="electDef" transient="true"/>
<field name="positDef" transient="true"/>
</class>
<class name="G4VUserRegionInformation"/>
<class name="G4UserLimits"/>
<class name="CLHEP::Hep3Vector"/>
<class name="std::vector<CLHEP::Hep3Vector>"/>
<class name="CLHEP::HepRotation"/>
<class name="HepGeom::Transform3D"/>
<class name="G4PVPlacement"/>
<class name="G4VPhysicalVolume"/>
<class name="G4VPVParameterisation"/>
<class name="std::vector<G4VPhysicalVolume*>"/>
</lcgdict>