Skip to content
Snippets Groups Projects
Commit 68058c70 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

v96r4

parent fed7c1dd
No related tags found
No related merge requests found
Showing
with 622 additions and 0 deletions
if [ "$1" = "sim" ]
then
../../x86_64-slc6-gcc48-opt/testEm3.exe opt2.mac #generated the data if run with sim option
fi
g++ -c `root-config --cflags` Plot.C
g++ -o Plot `root-config --glibs` Plot.o
./Plot
#creates full file of plots Save.root and Key results in Selectedresults.root
Term,Value,Uncertainty;
a, 0.0943 , 0.0008;
c, 0.005 , 0.001;
Energy,Sampling Fraction,Uncertainty
44.44 , 0.1431 , 7e-05;
25 , 0.1431 , 8.8e-05;
16 , 0.1429 , 0.00011;
11.11 , 0.1429 , 0.00014;
8.16 , 0.1431 , 0.00016;
6.25 , 0.1429 , 0.00017;
4.94 , 0.1425 , 0.0002;
4 , 0.1429 , 0.00022;
3.31 , 0.1425 , 0.00024;
2.78 , 0.1422 , 0.00026;
2.37 , 0.1419 , 0.00028;
2.04 , 0.1428 , 0.00029;
1.78 , 0.1431 , 0.00033;
package G4TestEm3
version v5r0
branches cmt doc scripts
##################################################
# Package to run extended Geant4 example TestEm3 #
##################################################
use G4physics_lists v* Geant4
use G4analysis v* Geant4
use G4LHCblists v* Geant4
include_dirs ../include
#------ Example TestEm7- -------
#------ Building the library -------
library G4TestEm3 $(G4LibraryFlags) ../src/*.cc
apply_pattern linker_library library=G4TestEm3
#------ Building the application ---
application testEm3 ../TestEm3.cc
#========================================================================
private
apply_pattern G4_copy_examples_source
macro_append testEm3_dependencies " G4TestEm3 "
end_private
!-----------------------------------------------------------------------------
! Package : electromagnetic/G4TestEm3
! Responsible : Timothy Williams
! Purpose : Standalone Geant4 example used to test EM shower simulation
!-----------------------------------------------------------------------------
! 2014-11-13 - Timothy Williams
-Initial Version.
-Full desription of example available at:- http://geant4.web.cern.ch/geant4/UserDocumentation/Doxygen/examples_doc/html/ExampleTestEm3.html
2014-11-19 - Timothy Williams
-added Simulated data and analysis code in directory Test/opt2. This will be used for LHCbPR.
2014-11-20 - Timothy Williams
-added README to Test/opt2 exaplining analysis for LHCbPR.2
2015-12-07- Timothy Williams
Updated Analysis code Plot.C, added more information and better formatting to plots, removed all binary files, added run.sh script to run entire analysis. Run as "run.sh sim" to run geant4 and create output.
\ No newline at end of file
all:
g++ -c -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/afs/cern.ch/sw/lcg/releases/LCG_70/ROOT/5.34.22/x86_64-slc6-gcc48-opt/include Plot.C
g++ -o Plot -L/afs/cern.ch/sw/lcg/releases/LCG_70/ROOT/5.34.22/x86_64-slc6-gcc48-opt/lib -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic Plot.o
\ No newline at end of file
File added
# $Id: TestEm3.in,v 1.27 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "exampleN03.cc"
# (can be run in batch, without graphic)
#
# Lead-liquidArgon 50 layers; electron 1 GeV
#
/control/verbose 2
/run/verbose 2
#
/testem/phys/addPhysics emstandard_opt0
#
/run/initialize
/process/em/verbose 1
/process/msc/Skin 1
#
/gun/particle e-
/gun/energy 1 GeV
#
###/analysis/setFileName testem3
###/analysis/h1/set 1 100 700. 1000. MeV #edep in absor1
###/analysis/h1/set 2 100 0. 300. MeV #edep in absor2
###/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
###/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
###/analysis/h1/set 21 102 0. 102. none #energy flow
###/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
#
/testem/event/printModulo 50
#
/run/beamOn 100
#
/process/em/setSecBiasing eIoni World 0.3 2 MeV
/process/em/setSecBiasing eBrem World 0.2 1 MeV
/run/physicsModified
/run/beamOn 100
#
# $Id: atlashec.mac,v 1.8 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "TestEm3.cc"
#
# Atlas HEC model;
#
/control/verbose 2
/run/verbose 1
#
/testem/det/setNbOfLayers 25
/testem/det/setNbOfAbsor 2
/testem/det/setAbsor 1 liquidArgon 0.85 cm
/testem/det/setAbsor 2 Copper 2.5 cm
/testem/det/setSizeYZ 17 cm
#
/testem/phys/addPhysics emstandard_opt0
/testem/phys/setCuts 0.7 mm
#
/run/initialize
#
/analysis/setFileName 10gev
/analysis/h1/set 1 100 0. 1000. MeV
/analysis/h1/set 2 100 9. 10. GeV
#
/gun/particle e-
/gun/particle pi+
/gun/energy 100 GeV
/gun/position -40.635 0 0
#
/testem/event/printModulo 100
/run/beamOn 100
# $Id: dedx.mac,v 1.5 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "TestEm3.cc"
# (can be run in batch, without graphic)
#
# To control dE/dx calculation:
# 1 layer; minimum ionizing particle
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setNbOfLayers 1
/testem/det/setNbOfAbsor 1
/testem/det/setAbsor 1 liquidArgon 1 cm
/testem/det/setSizeYZ 1 cm
#
/testem/phys/addPhysics local
/testem/phys/setCuts 1 km
#
/run/initialize
#
/process/inactivate msc
/process/eLoss/fluct false
#
/testem/gun/setDefault
/gun/particle mu-
/gun/energy 50 GeV
#
/tracking/verbose 1
#
/run/beamOn 2
# $Id: emtutor.mac,v 1.1 2007-04-06 17:41:54 maire Exp $
#
# Macro file for "TestEm3.cc"
#
# water 1 layer;
#
/control/verbose 2
#
/testem/det/setNbOfLayers 1
/testem/det/setNbOfAbsor 1
/testem/det/setAbsor 1 Aluminium 10 cm
/testem/det/setSizeYZ 10 cm
#
/testem/phys/setCuts 2 cm
#
/run/initialize
#
/control/execute vis.mac
#
/testem/gun/setDefault
# $Id: ionC12.mac,v 1.11 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "TestEm3.cc"
# (can be run in batch, without graphic)
#
# CsI 1 layer;
#
/control/verbose 2
/run/verbose 2
/tracking/verbose 1
#
# select EM PhysicsList
#
/testem/phys/addPhysics local
#
/testem/phys/setCuts 1 mm
#
/testem/det/setNbOfLayers 1
/testem/det/setNbOfAbsor 1
/testem/det/setAbsor 1 CsI 1.99 cm
/testem/det/setSizeYZ 3 cm
#
/gun/particle ion
/gun/ion 6 12
/run/initialize
#
/testem/gun/setDefault
#/gun/particle ion
#/gun/ion 6 12
/gun/energy 108 GeV
#
/analysis/h1/set 1 200 350. 550. MeV
#
/testem/event/printModulo 1000
/run/beamOn 5000
# $Id: lhcb.mac,v 1.4 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "TestEm3.cc"
#
# LHCB ECAL model
#
/control/verbose 2
/run/verbose 1
#
/testem/det/setNbOfLayers 66
/testem/det/setNbOfAbsor 2
/testem/det/setAbsor 1 Lead 2 mm
/testem/det/setAbsor 2 Scintillator 4 mm
/testem/det/setSizeYZ 20 cm
#
/testem/phys/addPhysics emstandard_opt0
#
/gun/particle e-
/gun/energy 10 GeV
#
/testem/event/printModulo 50
#
/testem/phys/setCuts 3 mm
/run/initialize
/analysis/setFileName OUTPUT_3.000
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 1 mm
/run/initialize
/analysis/setFileName OUTPUT_1.000
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 0.5 mm
/run/initialize
/analysis/setFileName OUTPUT_0.500
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 0.1 mm
/run/initialize
/analysis/setFileName OUTPUT_0.100
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 0.07 mm
/run/initialize
/analysis/setFileName OUTPUT_0.070
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 0.030 mm
/run/initialize
/analysis/setFileName OUTPUT_0.030
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 0.01 mm
/run/initialize
/analysis/setFileName OUTPUT_0.010
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 0.007 mm
/run/initialize
/analysis/setFileName OUTPUT_0.007
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 0.003 mm
/run/initialize
/analysis/setFileName OUTPUT_0.003
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
#
/testem/phys/setCuts 0.001 mm
/run/initialize
/analysis/setFileName OUTPUT_0.001
/analysis/h1/set 1 500 5. 10. GeV
/analysis/h1/set 2 500 0. 5. GeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 5000
\ No newline at end of file
# $Id: linac.mac,v 1.6 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "TestEm3"
#
# Linac/Ecal from Graham Wilson;
#
/control/verbose 2
/run/verbose 1
#
/testem/det/setNbOfLayers 42
/testem/det/setNbOfAbsor 4
/testem/det/setAbsor 1 Tungsten 2.50 mm
/testem/det/setAbsor 2 NemaG10 0.68 mm
/testem/det/setAbsor 3 Silicon 0.32 mm
/testem/det/setAbsor 4 Air20 0.25 mm
/testem/det/setSizeYZ 30 cm
#
/testem/phys/addPhysics local
/testem/phys/setCuts 10 um
#
/run/initialize
#
/analysis/setFileName linac
/analysis/h1/set 3 100 0. 20. MeV #edep in absor3
#
/gun/particle gamma
/gun/energy 1 GeV
#
/testem/event/printModulo 100
#
/run/beamOn 1000
# $Id: lockwood.mac,v 1.6 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "TestEm3.cc"
# (can be run in batch, without graphic)
#
# Al-Au-Al 1 layer;
#
# G.L.Lockwood et al. SAND79-0414 (1980)
#
/control/verbose 2
/run/verbose 2
#
/testem/phys/addPhysics local
#
/testem/det/setNbOfLayers 1
/testem/det/setNbOfAbsor 3
/testem/det/setAbsor 1 Aluminium 170 um
/testem/det/setAbsor 2 Gold 23 um
/testem/det/setAbsor 3 Aluminium 850 um
/testem/det/setSizeYZ 1050 um
#
/testem/phys/setCuts 1 um
#
/run/initialize
#
/testem/gun/setDefault
/gun/particle e-
/gun/energy 1 MeV
/testem/gun/rndm 0.8
#
/testem/stepMax/absorber 2 5 um
#
/testem/event/printModulo 1000
#
/run/beamOn 10
{
gROOT->Reset();
// Draw histos filled by Geant4 simulation
//
///TFile f = TFile("testem3.root");
TFile f = TFile("run01.root");
TCanvas* c1 = new TCanvas("c1", " ");
TH1D* hist1 = (TH1D*)f.Get("1");
hist1->Draw("HIST");
TH1D* hist2 = (TH1D*)f.Get("2");
hist2->Draw("HIST");
TH1D* hist3 = (TH1D*)f.Get("11");
c1->SetLogy(1);
c1->cd();
c1->Update();
hist3->Draw("HIST");
TH1D* hist4 = (TH1D*)f.Get("12");
hist4->Draw("HIST");
TH1D* hist5 = (TH1D*)f.Get("21");
hist5->Draw("HIST");
TH1D* hist6 = (TH1D*)f.Get("22");
hist6->Draw("HIST");
}
# $Id: retrieveTables.mac,v 1.6 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "exampleN03.cc"
#
# can be run in batch, without graphic
# or interactively: Idle> /control/execute run1.mac
#
/control/verbose 2
#
# select EM PhysicsList
#
/testem/phys/addPhysics emstandard_opt0
#
/run/particle/retrievePhysicsTable physdata
/run/initialize
/process/eLoss/verbose 1
/process/eLoss/CSDARange true
#
/gun/particle e-
/gun/energy 1 GeV
#
/run/beamOn 3
#
/run/particle/storePhysicsTable physdata1
#
# $Id: run01.mac,v 1.19 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "exampleN03.cc"
# (can be run in batch, without graphic)
#
# Lead-liquidArgon 50 layers; electron 1 GeV
#
/control/verbose 2
/run/verbose 2
#
/testem/phys/addPhysics local
#
/testem/phys/setCuts 100 um
#
/run/initialize
#
/gun/particle e-
/gun/energy 1 GeV
#
/analysis/setFileName run01
/analysis/h1/set 1 100 700. 1000. MeV
/analysis/h1/set 2 100 0. 300. MeV
/analysis/h1/set 11 52 0. 52. none #long. profile in absor1
/analysis/h1/set 12 52 0. 52. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
#
/testem/event/printModulo 100
#
/run/beamOn 1000
# $Id: run02.mac,v 1.16 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "TestEm3.cc"
# (can be run in batch, without graphic)
#
# Tungsten-Silicon 50 layers; electron 1 GeV
#
/control/verbose 2
/run/verbose 2
#
/testem/phys/addPhysics local
#
/testem/det/setNbOfLayers 50
/testem/det/setNbOfAbsor 2
/testem/det/setAbsor 1 Tungsten 2 mm
/testem/det/setAbsor 2 Silicon 0.3 mm
#
/testem/phys/setCuts 100 um
#
/run/initialize
#
/testem/gun/setDefault
/gun/particle e-
/gun/energy 1 GeV
#
/analysis/setFileName run02
/analysis/h1/set 1 100 900. 1000. MeV
/analysis/h1/set 2 100 0. 50. MeV
#
/testem/event/printModulo 50
#
/run/beamOn 200
# $Id: storeTables.mac,v 1.10 2009-09-17 20:06:26 maire Exp $
#
# Macro file for "testEm3.cc"
#
# can be run in batch, without graphic
# or interactively: Idle> /control/execute run1.mac
#
/control/verbose 2
#
/testem/phys/addPhysics emstandard_opt0
#
/run/initialize
/process/eLoss/verbose 1
/process/eLoss/CSDARange true
/run/beamOn 3
#
/run/particle/storePhysicsTable physdata
#
/gun/particle e-
/gun/energy 1 GeV
#
#/run/beamOn 3
#
/run/particle/retrievePhysicsTable physdata
#
/random/resetEngineFrom currentRun.rndm
/run/beamOn 3
#
# $Id: tileCal.mac,v 1.1 2011/01/03 13:54:15 maire Exp $
#
# Macro file for "TestEm3.cc"
#
# ATLAS tileCal
#
/control/verbose 2
/run/verbose 1
#
/testem/det/setNbOfLayers 50
/testem/det/setNbOfAbsor 2
/testem/det/setAbsor 1 Iron 14 mm
/testem/det/setAbsor 2 Scintillator 3 mm
/testem/det/setSizeYZ 20 cm
#
/testem/phys/addPhysics emstandard_opt0
/testem/phys/setCuts 1 um
#
/run/initialize
#
/analysis/setFileName mu.1mm
/analysis/h1/set 1 100 500. 1000. MeV
/analysis/h1/set 2 100 0. 50. MeV
#
/gun/particle mu+
/gun/energy 20 GeV
#
/testem/event/printModulo 4000
#
/run/beamOn 20000
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment