WORK Bo-Wen Shiou. GNUmakefile GNUmakefile XXX.cc (ex:try03.cc) XXX.cc (ex:try03.cc) include folder (xxx.hh) include folder (xxx.hh) src folder (xxx.cc)

Slides:



Advertisements
Similar presentations
Primary Particle KOI, Tatsumi Geant4 V9.4 Geant4 Tutorial at Texas A&M 11-Jan
Advertisements

山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
Geant4 v9.2p02 Particle Gun Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary particle generation Makoto Asai (SLAC) Geant4 Users CERN Nov. 12 th, 2002.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor CHEP 2000 at Padova Hajime Yoshida Naruto University of Education.
parameterisation The aim of the exercise is again to build a lead-scintillator calorimeter, this time though the calorimeter will be a trapezoid.
Materials 1 Images: Isotopic composition Molecular composition Density Pressure State Temperature.
Tuesday, Nov 9th 9:30-12:30 –Visualization attributes –Physics processes 14:00-17:00 –Kinematics and event generation (from yesterday) Particle gun –Boolean.
Geometry Detector geometry A detector geometry in Geant4 is made of a number of volumes. The largest volume is called the World volume. It must contain.
Materials In nature, general materials (compounds, mixtures) are made by elements and elements are made by isotopes. These are the three main classes.
Geant4 Electromagnetic Physics Introduction V.Ivanchenko, M.Maire, M.Verderi  Process interface  Physics categories  Electromagnetic physics  PhysicsList.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Physics I: Physics Lists Geant4 Tutorial at Jefferson Lab 10 July 2012 Dennis Wright (SLAC) Geant4 9.6 beta.
1 Primary particles Geant4 User's Tutorial CERN, February 2010 Talk from previous tutorial by Giovanni Santin Ecole Geant4, Annecy 2008.
Work_Geant4 Bo-Wen Shiou. #include "G4RunManager.hh“ #include "G4RunManager.hh“ #include "G4UImanager.hh" #include "G4UImanager.hh" #include "ExN01DetectorConstruction.hh“
Special Topics in Nuclear Physics, JU, Second Semester, (Saed Dababneh). 1 Course web or
Geant4 Physics List V.Ivanchenko Thanks to P.Gumplinger, M.Maire, H.P.Wellisch  General Physics  Electromagnetic Physics  Optical Photons  Hadronic.
Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, and Nov 2008 With.
W. Pokorski - CERN Simulation Project1 Python binding for Geant4 toolkit using Reflex/PyROOT tool Witek Pokorski EuroPython 2006, CERN, Geneva
6th April 2005Wah-kai Ngai1 First Example in Geant4 3rd HK simulation group meeting.
1 Physics I: Physics Lists Paris Geant4 Tutorial 4 June 2007 Marc Verderi Laboratoire Leprince-Ringuet (Heavily copied from D. Wright) Geant4 V8.3.
Monte Carlo /12/07. What is Geant ? Monte Carlo simulation tool for nuclear and particle physics Set up detectors –Sensitive detector which returns.
User Application Toolkit + User application toolkit Geant4 is a toolkit –i.e. you cannot “run” it out of the box –You must write.
User Application Luciano Pandola INFN-LNGS Partially based on a presentation by Maria Grazia Pia (INFN-Ge)
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Monte carlo and analysis tool study Shi-hong yao.
Generating Primary Particles Each Geant4 Event starts with generation of one or multiple primary particles It is up to the user to define primary particle.
Physics processes in general SLAC User’s Workshop February 18 – Marc Verderi Ecole Polytechnique - LLR.
Maria Grazia Pia INFN Genova Salamanca, July 2002
CBM Software Meeting 1 CBM Simulation & Analysis Framework Geant3 / Gean4 configuration M. Al-Turany, D. Bertini.
Run and Event G4Run and G4RunManager In Geant4, the Run is the largest unit of simulation and it consist of a series of events Within a Run, the detector.
A Hands-on introduction to Geant4 Andrea Dell’Acqua CERN-EP/ATC
Geant4 examples Sébastien Incerti On behalf of the Geant4 collaboration with special thanks to Luciano Pandola, INFN.
V.Ivanchenko Salamanca1 Geant4: Electromagnetic Processes 1  Introduction  Interfaces  PhysicsList  Optical process.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
Physics I: Physics Lists Puebla Geant4 Tutorial 15 June 2010 Dennis Wright Geant4 V9.3.p01.
Geant4 Training 2003 Primary Particle Generation The full set of lecture notes of this Geant4 Course is available at
Geant4 release 5.1 summary Gabriele Cosmo EP/SFT.
Use of Ions in MT Makoto Asai 2013 Geant4 Collaboration Seville.
1 Exercises 0 Go inside the “hadrontherapy” directory: cd hadrontherapy Copy the Hadrontherapy example to your home folder: cp –r $G4INSTALL/examples/advanced/hadrontherapy.
Makoto Asai.  Parallel layered mass geometry  Other minor improvement  G4Exception.
Maria Grazia Pia Retrieving information from kernel Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Makoto Asai.  In the past, material is considered only if it appears in the mass (tracking) world. The user might define parallel world(s) for artificial.
Starting with an example PART I Set your environment up and get a Geant4 example.
Interaction with the Geant4 kernel
Electromagnetic and hadronic physics in Geant4
Interaction with the Geant4 kernel
Basics of a user application
Geant4:User Actions and Analysis
G.A.P.Cirrone, S.E.Mazzaglia - INFN/LNS, Italy
Physics I: Physics Lists
Geant4: Electromagnetic Processes 2
User Application
User Application
Marc Verderi GEANT4 collaboration meeting 01/10/2002
User Application
The full set of lecture notes of this Geant4 Course is available at
The full set of lecture notes of this Geant4 Course is available at
Kernel Author: Makoto Asai.
Primary particle Makoto Asai (SLAC Computing Services)
The full set of lecture notes of this Geant4 Course is available at
Monte Carlo /12/25.
Presentation transcript:

WORK Bo-Wen Shiou

GNUmakefile GNUmakefile XXX.cc (ex:try03.cc) XXX.cc (ex:try03.cc) include folder (xxx.hh) include folder (xxx.hh) src folder (xxx.cc) src folder (xxx.cc)

GNUmakefile name := try03 name := try03 G4TARGET := $(name) G4TARGET := $(name) G4EXLIB := true G4EXLIB := true ifndef G4INSTALL ifndef G4INSTALL G4INSTALL =../../.. G4INSTALL =../../.. endif endif.PHONY: all.PHONY: all all: lib bin all: lib bin include $(G4INSTALL)/config/binmake.gmk include $(G4INSTALL)/config/binmake.gmk

try03.cc #include "G4RunManager.hh" #include "G4RunManager.hh" #include "G4UImanager.hh" #include "G4UImanager.hh" #include "try03DetectorConstruction.hh" #include "try03DetectorConstruction.hh" #include "try03PhysicsList.hh" #include "try03PhysicsList.hh" #include "try03PrimaryGeneratorAction.hh" #include "try03PrimaryGeneratorAction.hh" int main() int main() { // Construct the default run manager // Construct the default run manager // // G4RunManager* runManager = new G4RunManager; G4RunManager* runManager = new G4RunManager; // set mandatory initialization classes // set mandatory initialization classes // // G4VUserDetectorConstruction* detector = new try03DetectorConstruction; G4VUserDetectorConstruction* detector = new try03DetectorConstruction; runManager->SetUserInitialization(detector); runManager->SetUserInitialization(detector); // // G4VUserPhysicsList* physics = new try03PhysicsList; G4VUserPhysicsList* physics = new try03PhysicsList; runManager->SetUserInitialization(physics); runManager->SetUserInitialization(physics); // set mandatory user action class // set mandatory user action class // // G4VUserPrimaryGeneratorAction* gen_action = new try03PrimaryGeneratorAction; G4VUserPrimaryGeneratorAction* gen_action = new try03PrimaryGeneratorAction; runManager->SetUserAction(gen_action); runManager->SetUserAction(gen_action);

// Initialize G4 kernel // Initialize G4 kernel // // runManager->Initialize(); runManager->Initialize(); // Get the pointer to the UI manager and set verbosities // Get the pointer to the UI manager and set verbosities // // G4UImanager* UI = G4UImanager::GetUIpointer(); G4UImanager* UI = G4UImanager::GetUIpointer(); UI->ApplyCommand("/run/verbose 1"); UI->ApplyCommand("/run/verbose 1"); UI->ApplyCommand("/event/verbose 1"); UI->ApplyCommand("/event/verbose 1"); UI->ApplyCommand("/tracking/verbose 1"); UI->ApplyCommand("/tracking/verbose 1"); // Start a run // Start a run // // G4int numberOfEvent = 1; G4int numberOfEvent = 1; runManager->BeamOn(numberOfEvent); runManager->BeamOn(numberOfEvent); // Job termination // Job termination // // // Free the store: user actions, physics_list and detector_description are // Free the store: user actions, physics_list and detector_description are // owned and deleted by the run manager, so they should not // owned and deleted by the run manager, so they should not // be deleted in the main() program ! // be deleted in the main() program ! // // delete runManager; delete runManager; return 0; return 0; }

try03DetectorConstruction.cc #include "try03DetectorConstruction.hh" #include "G4Material.hh" #include "G4Box.hh" #include "G4Tubs.hh" #include "G4LogicalVolume.hh" #include "G4ThreeVector.hh" #include "G4PVPlacement.hh" #include "globals.hh" try03DetectorConstruction::try03DetectorConstruction() : experimentalHall_log(0), tracker_log(0), : experimentalHall_log(0), tracker_log(0), calorimeterBlock_log(0), calorimeterLayer_log(0), calorimeterBlock_log(0), calorimeterLayer_log(0), experimentalHall_phys(0), calorimeterLayer_phys(0), experimentalHall_phys(0), calorimeterLayer_phys(0), calorimeterBlock_phys(0), tracker_phys(0) calorimeterBlock_phys(0), tracker_phys(0){;}try03DetectorConstruction::~try03DetectorConstruction(){}

G4VPhysicalVolume* try03DetectorConstruction::Construct() G4VPhysicalVolume* try03DetectorConstruction::Construct() { // materials // materials G4double a; // atomic mass G4double a; // atomic mass G4double z; // atomic number G4double z; // atomic number G4double density; G4double density; G4Material* Ar = G4Material* Ar = new G4Material("ArgonGas", z= 18., a= 39.95*g/mole, density= 1.782*mg/cm3); new G4Material("ArgonGas", z= 18., a= 39.95*g/mole, density= 1.782*mg/cm3); G4Material* Al = G4Material* Al = new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3); new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3); G4Material* Pb = G4Material* Pb = new G4Material("Lead", z= 82., a= *g/mole, density= 11.35*g/cm3); new G4Material("Lead", z= 82., a= *g/mole, density= 11.35*g/cm3); // volumes // volumes // experimental hall (world volume) // experimental hall (world volume) G4double expHall_x = 1.0*m; G4double expHall_x = 1.0*m; G4double expHall_y = 3.0*m; G4double expHall_y = 3.0*m; G4double expHall_z = 1.0*m; G4double expHall_z = 1.0*m; G4Box* experimentalHall_box G4Box* experimentalHall_box = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z); = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z); experimentalHall_log = new G4LogicalVolume(experimentalHall_box, experimentalHall_log = new G4LogicalVolume(experimentalHall_box, Ar,"expHall_log",0,0,0); Ar,"expHall_log",0,0,0); experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(), experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(), experimentalHall_log,"expHall",0,false,0); experimentalHall_log,"expHall",0,false,0);

// a tracker tube // a tracker tube G4double innerRadiusOfTheTube = 0.0*m; G4double innerRadiusOfTheTube = 0.0*m; G4double outerRadiusOfTheTube = 0.5*m; G4double outerRadiusOfTheTube = 0.5*m; G4double hightOfTheTube = 1.0*m; G4double hightOfTheTube = 1.0*m; G4double startAngleOfTheTube = 0.*deg; G4double startAngleOfTheTube = 0.*deg; G4double spanningAngleOfTheTube = 360.*deg; G4double spanningAngleOfTheTube = 360.*deg; G4Tubs* tracker_tube = new G4Tubs("tracker_tube",innerRadiusOfTheTube, G4Tubs* tracker_tube = new G4Tubs("tracker_tube",innerRadiusOfTheTube, outerRadiusOfTheTube,hightOfTheTube, outerRadiusOfTheTube,hightOfTheTube, startAngleOfTheTube,spanningAngleOfTheTube); startAngleOfTheTube,spanningAngleOfTheTube); tracker_log = new G4LogicalVolume(tracker_tube,Al,"tracker_log",0,0,0); tracker_log = new G4LogicalVolume(tracker_tube,Al,"tracker_log",0,0,0); G4double trackerPos_x = 0.0*m; G4double trackerPos_x = 0.0*m; G4double trackerPos_y = 1.0*m; G4double trackerPos_y = 1.0*m; G4double trackerPos_z = 0.0*m; G4double trackerPos_z = 0.0*m; tracker_phys = new G4PVPlacement(0, tracker_phys = new G4PVPlacement(0, G4ThreeVector(trackerPos_x,trackerPos_y,trackerPos_z), G4ThreeVector(trackerPos_x,trackerPos_y,trackerPos_z), tracker_log,"tracker",experimentalHall_log,false,0); tracker_log,"tracker",experimentalHall_log,false,0);

// a calorimeter block // a calorimeter block G4double block_x = 0.5*m; G4double block_x = 0.5*m; G4double block_y = 1.0*m; G4double block_y = 1.0*m; G4double block_z = 0.5*m; G4double block_z = 0.5*m; G4Box* calorimeterBlock_box = new G4Box("calBlock_box",block_x, G4Box* calorimeterBlock_box = new G4Box("calBlock_box",block_x, block_y,block_z); block_y,block_z); calorimeterBlock_log = new G4LogicalVolume(calorimeterBlock_box, calorimeterBlock_log = new G4LogicalVolume(calorimeterBlock_box, Pb,"caloBlock_log",0,0,0); Pb,"caloBlock_log",0,0,0); G4double blockPos_x = 0.0*m; G4double blockPos_x = 0.0*m; G4double blockPos_y = -0.1*m; G4double blockPos_y = -0.1*m; G4double blockPos_z = 0.0*m; G4double blockPos_z = 0.0*m; calorimeterBlock_phys = new G4PVPlacement(0, calorimeterBlock_phys = new G4PVPlacement(0, G4ThreeVector(blockPos_x,blockPos_y,blockPos_z), G4ThreeVector(blockPos_x,blockPos_y,blockPos_z), calorimeterBlock_log,"caloBlock",experimentalHall_log,false,0); calorimeterBlock_log,"caloBlock",experimentalHall_log,false,0); // calorimeter layers // calorimeter layers G4double calo_x = 40.*cm; G4double calo_x = 40.*cm; G4double calo_y = 1.*cm; G4double calo_y = 1.*cm; G4double calo_z = 40.*cm; G4double calo_z = 40.*cm; G4Box* calorimeterLayer_box = new G4Box("caloLayer_box", G4Box* calorimeterLayer_box = new G4Box("caloLayer_box", calo_x,calo_y,calo_z); calo_x,calo_y,calo_z); calorimeterLayer_log = new G4LogicalVolume(calorimeterLayer_box, calorimeterLayer_log = new G4LogicalVolume(calorimeterLayer_box, Al,"caloLayer_log",0,0,0); Al,"caloLayer_log",0,0,0); for(G4int i=0;i<19;i++) // loop for 19 layers for(G4int i=0;i<19;i++) // loop for 19 layers { { G4double caloPos_x = 0.00*cm; G4double caloPos_x = 0.00*cm; G4double caloPos_y = (i-9)*10.*cm; G4double caloPos_y = (i-9)*10.*cm; G4double caloPos_z = 0.0*cm; G4double caloPos_z = 0.0*cm; calorimeterLayer_phys = new G4PVPlacement(0, calorimeterLayer_phys = new G4PVPlacement(0, G4ThreeVector(caloPos_x,caloPos_y,caloPos_z), G4ThreeVector(caloPos_x,caloPos_y,caloPos_z), calorimeterLayer_log,"caloLayer",calorimeterBlock_log,false,i); calorimeterLayer_log,"caloLayer",calorimeterBlock_log,false,i); } } return experimentalHall_phys; return experimentalHall_phys; }

try03PhysicsList.cc #include "try03PhysicsList.hh" #include "try03PhysicsList.hh" #include "G4ParticleTypes.hh" #include "G4ParticleTypes.hh" #include "G4ParticleTable.hh" #include "G4ParticleTable.hh" #include "G4ParticleDefinition.hh" #include "G4ParticleDefinition.hh" try03PhysicsList::try03PhysicsList() try03PhysicsList::try03PhysicsList() {;} {;} try03PhysicsList::~try03PhysicsList() try03PhysicsList::~try03PhysicsList() {;} {;} void try03PhysicsList::ConstructParticle() void try03PhysicsList::ConstructParticle() { // In this method, static member functions should be called // In this method, static member functions should be called // for all particles which you want to use. // for all particles which you want to use. ConstructBosons(); ConstructBosons(); ConstructLeptons(); ConstructLeptons(); ConstructMesons(); ConstructMesons(); ConstructBaryons(); ConstructBaryons(); ConstructIons(); ConstructIons(); }

void try03PhysicsList::ConstructBosons() void try03PhysicsList::ConstructBosons() { //gamma //gamma G4Gamma::GammaDefinition(); G4Gamma::GammaDefinition(); } #include "G4LeptonConstructor.hh" #include "G4LeptonConstructor.hh" void try03PhysicsList::ConstructLeptons() void try03PhysicsList::ConstructLeptons() { // Construct all leptons // Construct all leptons G4LeptonConstructor pConstructor; G4LeptonConstructor pConstructor; pConstructor.ConstructParticle(); pConstructor.ConstructParticle(); } #include "G4MesonConstructor.hh" #include "G4MesonConstructor.hh" void try03PhysicsList::ConstructMesons() void try03PhysicsList::ConstructMesons() { // Construct all mesons // Construct all mesons G4MesonConstructor pConstructor; G4MesonConstructor pConstructor; pConstructor.ConstructParticle(); pConstructor.ConstructParticle(); } #include "G4BaryonConstructor.hh" #include "G4BaryonConstructor.hh" void try03PhysicsList::ConstructBaryons() void try03PhysicsList::ConstructBaryons() { // Construct all barions // Construct all barions G4BaryonConstructor pConstructor; G4BaryonConstructor pConstructor; pConstructor.ConstructParticle(); pConstructor.ConstructParticle(); } #include "G4IonConstructor.hh" #include "G4IonConstructor.hh" void try03PhysicsList::ConstructIons() void try03PhysicsList::ConstructIons() { // Construct light ions // Construct light ions G4IonConstructor pConstructor; G4IonConstructor pConstructor; pConstructor.ConstructParticle(); pConstructor.ConstructParticle(); }

void try03PhysicsList::ConstructProcess() void try03PhysicsList::ConstructProcess() { // Define transportation process // Define transportation process AddTransportation(); AddTransportation(); } void try03PhysicsList::SetCuts() void try03PhysicsList::SetCuts() { // uppress error messages even in case e/gamma/proton do not exist // uppress error messages even in case e/gamma/proton do not exist G4int temp = GetVerboseLevel(); SetVerboseLevel(0); G4int temp = GetVerboseLevel(); SetVerboseLevel(0); // " G4VUserPhysicsList::SetCutsWithDefault" method sets // " G4VUserPhysicsList::SetCutsWithDefault" method sets // the default cut value for all particle types // the default cut value for all particle types SetCutsWithDefault(); SetCutsWithDefault(); // Retrieve verbose level // Retrieve verbose level SetVerboseLevel(temp); SetVerboseLevel(temp); }

try03PrimaryGeneratorAction.cc #include "try03PrimaryGeneratorAction.hh" #include "try03PrimaryGeneratorAction.hh" #include "try03DetectorConstruction.hh" #include "try03DetectorConstruction.hh" #include "G4Event.hh" #include "G4Event.hh" #include "G4ParticleGun.hh" #include "G4ParticleGun.hh" #include "G4ParticleTable.hh" #include "G4ParticleTable.hh" #include "G4ParticleDefinition.hh" #include "G4ParticleDefinition.hh" #include "globals.hh" #include "globals.hh" try03PrimaryGeneratorAction::try03PrimaryGeneratorAction() try03PrimaryGeneratorAction::try03PrimaryGeneratorAction() { G4int n_particle = 1; G4int n_particle = 1; particleGun = new G4ParticleGun(n_particle); particleGun = new G4ParticleGun(n_particle); G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); G4String particleName; G4String particleName; particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="proton")); particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="proton")); particleGun->SetParticleEnergy(10.0*GeV); particleGun->SetParticleEnergy(10.0*GeV); particleGun->SetParticlePosition(G4ThreeVector(0.0*m, 2.0*m, 0.0)); particleGun->SetParticlePosition(G4ThreeVector(0.0*m, 2.0*m, 0.0)); }

try03PrimaryGeneratorAction::~try03PrimaryGeneratorAction() try03PrimaryGeneratorAction::~try03PrimaryGeneratorAction() { delete particleGun; delete particleGun; } void try03PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) void try03PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { G4int i = anEvent->GetEventID() % 3; G4int i = anEvent->GetEventID() % 3; G4ThreeVector v(0.0,-1.0,0.0); G4ThreeVector v(0.0,-1.0,0.0); switch(i) switch(i) { { case 0: case 0: break; break; case 1: case 1: v.setY(0.1); v.setY(0.1); break; break; case 2: case 2: v.setZ(0.1); v.setZ(0.1); break; break; } } particleGun->SetParticleMomentumDirection(v); particleGun->SetParticleMomentumDirection(v); particleGun->GeneratePrimaryVertex(anEvent); particleGun->GeneratePrimaryVertex(anEvent); }

try03data ========= Table of registered couples ============================== ========= Table of registered couples ============================== Index : 0 used in the geometry : Yes recalculation needed : No Index : 0 used in the geometry : Yes recalculation needed : No Material : ArgonGas Material : ArgonGas Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 100 keV Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 100 keV Region(s) which use this couple : Region(s) which use this couple : DefaultRegionForTheWorld DefaultRegionForTheWorld Index : 1 used in the geometry : Yes recalculation needed : No Index : 1 used in the geometry : Yes recalculation needed : No Material : Aluminum Material : Aluminum Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Energy thresholds : gamma keV e keV e keV proton 100 keV Energy thresholds : gamma keV e keV e keV proton 100 keV Region(s) which use this couple : Region(s) which use this couple : DefaultRegionForTheWorld DefaultRegionForTheWorld Index : 2 used in the geometry : Yes recalculation needed : No Index : 2 used in the geometry : Yes recalculation needed : No Material : Lead Material : Lead Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm Energy thresholds : gamma keV e MeV e MeV proton 100 keV Energy thresholds : gamma keV e MeV e MeV proton 100 keV Region(s) which use this couple : Region(s) which use this couple : DefaultRegionForTheWorld DefaultRegionForTheWorld ==================================================================== ==================================================================== Start Run processing. Start Run processing. ===================================== ===================================== G4EventManager::ProcessOneEvent() G4EventManager::ProcessOneEvent() ===================================== ===================================== 1 primaries are passed from G4EventTransformer. 1 primaries are passed from G4EventTransformer. !!!!!!! Now start processing an event !!!!!!! !!!!!!! Now start processing an event !!!!!!! ***************************************************************************************************** ***************************************************************************************************** * G4Track Information: Particle = proton, Track ID = 1, Parent ID = 0 * G4Track Information: Particle = proton, Track ID = 1, Parent ID = 0 ***************************************************************************************************** *****************************************************************************************************

Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName 0 0 2e e expHall initStep 0 0 2e e expHall initStep e e tracker Transportation e e tracker Transportation e e e+03 caloLayer Transportation e e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e+03 caloBlock Transportation e e+03 caloBlock Transportation e e+03 caloLayer Transportation e e+03 caloLayer Transportation e e e+03 caloBlock Transportation e e e+03 caloBlock Transportation e e e+03 expHall Transportation e e e+03 expHall Transportation e e e+03 5e+03 OutOfWorld Transportation e e e+03 5e+03 OutOfWorld Transportation

Track (trackID 1, parentID 0) is processed with stopping code 2 Track (trackID 1, parentID 0) is processed with stopping code 2 NULL returned from G4StackManager. NULL returned from G4StackManager. Terminate current event processing. Terminate current event processing. Run terminated. Run terminated. Run Summary Run Summary Number of events processed : 1 Number of events processed : 1 User=0.01s Real=0.01s Sys=0s User=0.01s Real=0.01s Sys=0s G4 kernel has come to Quit state. G4 kernel has come to Quit state Maximum number of tracks in the urgent stack : 1 Maximum number of tracks in the urgent stack :

join the field Change: Change: DetectorConstruction DetectorConstruction PhysicsList PhysicsList MagneticField MagneticField

try01DetectorConstruction.cc 1. #include "try01MagneticField.hh" 1. #include "try01MagneticField.hh" 2. try01DetectorConstruction::try01DetectorConstruction() 2. try01DetectorConstruction::try01DetectorConstruction() : experimentalHall_log(0), tracker_log(0), : experimentalHall_log(0), tracker_log(0), calorimeterBlock_log(0), calorimeterLayer_log(0), calorimeterBlock_log(0), calorimeterLayer_log(0), experimentalHall_phys(0), calorimeterLayer_phys(0), experimentalHall_phys(0), calorimeterLayer_phys(0), calorimeterBlock_phys(0), tracker_phys(0),fpMagField(0) calorimeterBlock_phys(0), tracker_phys(0),fpMagField(0) { fpMagField = new try01MagneticField(); fpMagField = new try01MagneticField(); } try01DetectorConstruction::~try01DetectorConstruction() try01DetectorConstruction::~try01DetectorConstruction() { delete fpMagField; delete fpMagField; } 3. void try01DetectorConstruction::SetMagField(G4double fieldValue) { fpMagField->SetMagFieldValue(fieldValue); fpMagField->SetMagFieldValue(fieldValue); }

try01PhysicsList.cc 1. #include "G4ProcessManager.hh “ 1. #include "G4ProcessManager.hh “ 2. void try01PhysicsList::ConstructProcess() 2. void try01PhysicsList::ConstructProcess() { // Define transportation process // Define transportation process AddTransportation(); AddTransportation(); ConstructEM(); ConstructEM(); }

3. #include "G4ComptonScattering.hh" 3. #include "G4ComptonScattering.hh" #include "G4GammaConversion.hh" #include "G4GammaConversion.hh" #include "G4PhotoElectricEffect.hh ” #include "G4PhotoElectricEffect.hh ”... void try01PhysicsList::ConstructEM() void try01PhysicsList::ConstructEM() { theParticleIterator->reset(); theParticleIterator->reset(); while( (*theParticleIterator)() ){ while( (*theParticleIterator)() ){ G4ParticleDefinition* particle = theParticleIterator->value(); G4ParticleDefinition* particle = theParticleIterator->value(); G4ProcessManager* pmanager = particle->GetProcessManager(); G4ProcessManager* pmanager = particle->GetProcessManager(); G4String particleName = particle->GetParticleName(); G4String particleName = particle->GetParticleName(); if (particleName == "gamma") if (particleName == "gamma") { // gamma { // gamma pmanager->AddDiscreteProcess(new G4PhotoElectricEffect); pmanager->AddDiscreteProcess(new G4PhotoElectricEffect); pmanager->AddDiscreteProcess(new G4ComptonScattering); pmanager->AddDiscreteProcess(new G4ComptonScattering); pmanager->AddDiscreteProcess(new G4GammaConversion); pmanager->AddDiscreteProcess(new G4GammaConversion); }...

END