Presentation is loading. Please wait.

Presentation is loading. Please wait.

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)

Similar presentations


Presentation on theme: "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)"— Presentation transcript:

1 WORK Bo-Wen Shiou

2 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)

3 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

4 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);

5 // 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; }

6 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(){}

7 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= 207.19*g/mole, density= 11.35*g/cm3); new G4Material("Lead", z= 82., a= 207.19*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);

8 //------------------------------ 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);

9 //------------------------------ 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; }

10 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(); }

11 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(); }

12 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); }

13 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)); }

14 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); }

15 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 6.90363 keV e- 598.345 keV e+ 570.85 keV proton 100 keV Energy thresholds : gamma 6.90363 keV e- 598.345 keV e+ 570.85 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 101.843 keV e- 1.36749 MeV e+ 1.27862 MeV proton 100 keV Energy thresholds : gamma 101.843 keV e- 1.36749 MeV e+ 1.27862 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 ***************************************************************************************************** *****************************************************************************************************

16 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+03 0 1e+04 0 0 0 expHall initStep 0 0 2e+03 0 1e+04 0 0 0 expHall initStep 1 0 1.5e+03 0 1e+04 0 500 500 tracker Transportation 1 0 1.5e+03 0 1e+04 0 500 500 tracker Transportation 2 0 500 0 1e+04 0 1e+03 1.5e+03 caloLayer Transportation 2 0 500 0 1e+04 0 1e+03 1.5e+03 caloLayer Transportation 3 0 490 0 1e+04 0 10 1.51e+03 caloBlock Transportation 3 0 490 0 1e+04 0 10 1.51e+03 caloBlock Transportation 4 0 410 0 1e+04 0 80 1.59e+03 caloLayer Transportation 4 0 410 0 1e+04 0 80 1.59e+03 caloLayer Transportation 5 0 390 0 1e+04 0 20 1.61e+03 caloBlock Transportation 5 0 390 0 1e+04 0 20 1.61e+03 caloBlock Transportation 6 0 310 0 1e+04 0 80 1.69e+03 caloLayer Transportation 6 0 310 0 1e+04 0 80 1.69e+03 caloLayer Transportation 7 0 290 0 1e+04 0 20 1.71e+03 caloBlock Transportation 7 0 290 0 1e+04 0 20 1.71e+03 caloBlock Transportation 8 0 210 0 1e+04 0 80 1.79e+03 caloLayer Transportation 8 0 210 0 1e+04 0 80 1.79e+03 caloLayer Transportation 9 0 190 0 1e+04 0 20 1.81e+03 caloBlock Transportation 9 0 190 0 1e+04 0 20 1.81e+03 caloBlock Transportation 10 0 110 0 1e+04 0 80 1.89e+03 caloLayer Transportation 10 0 110 0 1e+04 0 80 1.89e+03 caloLayer Transportation 11 0 90 0 1e+04 0 20 1.91e+03 caloBlock Transportation 11 0 90 0 1e+04 0 20 1.91e+03 caloBlock Transportation 12 0 10 0 1e+04 0 80 1.99e+03 caloLayer Transportation 12 0 10 0 1e+04 0 80 1.99e+03 caloLayer Transportation 13 0 -10 0 1e+04 0 20 2.01e+03 caloBlock Transportation 13 0 -10 0 1e+04 0 20 2.01e+03 caloBlock Transportation 14 0 -90 0 1e+04 0 80 2.09e+03 caloLayer Transportation 14 0 -90 0 1e+04 0 80 2.09e+03 caloLayer Transportation 15 0 -110 0 1e+04 0 20 2.11e+03 caloBlock Transportation 15 0 -110 0 1e+04 0 20 2.11e+03 caloBlock Transportation 16 0 -190 0 1e+04 0 80 2.19e+03 caloLayer Transportation 16 0 -190 0 1e+04 0 80 2.19e+03 caloLayer Transportation 17 0 -210 0 1e+04 0 20 2.21e+03 caloBlock Transportation 17 0 -210 0 1e+04 0 20 2.21e+03 caloBlock Transportation 18 0 -290 0 1e+04 0 80 2.29e+03 caloLayer Transportation 18 0 -290 0 1e+04 0 80 2.29e+03 caloLayer Transportation 19 0 -310 0 1e+04 0 20 2.31e+03 caloBlock Transportation 19 0 -310 0 1e+04 0 20 2.31e+03 caloBlock Transportation 20 0 -390 0 1e+04 0 80 2.39e+03 caloLayer Transportation 20 0 -390 0 1e+04 0 80 2.39e+03 caloLayer Transportation 21 0 -410 0 1e+04 0 20 2.41e+03 caloBlock Transportation 21 0 -410 0 1e+04 0 20 2.41e+03 caloBlock Transportation 22 0 -490 0 1e+04 0 80 2.49e+03 caloLayer Transportation 22 0 -490 0 1e+04 0 80 2.49e+03 caloLayer Transportation 23 0 -510 0 1e+04 0 20 2.51e+03 caloBlock Transportation 23 0 -510 0 1e+04 0 20 2.51e+03 caloBlock Transportation 24 0 -590 0 1e+04 0 80 2.59e+03 caloLayer Transportation 24 0 -590 0 1e+04 0 80 2.59e+03 caloLayer Transportation 25 0 -610 0 1e+04 0 20 2.61e+03 caloBlock Transportation 25 0 -610 0 1e+04 0 20 2.61e+03 caloBlock Transportation 26 0 -690 0 1e+04 0 80 2.69e+03 caloLayer Transportation 26 0 -690 0 1e+04 0 80 2.69e+03 caloLayer Transportation 27 0 -710 0 1e+04 0 20 2.71e+03 caloBlock Transportation 27 0 -710 0 1e+04 0 20 2.71e+03 caloBlock Transportation 28 0 -790 0 1e+04 0 80 2.79e+03 caloLayer Transportation 28 0 -790 0 1e+04 0 80 2.79e+03 caloLayer Transportation 29 0 -810 0 1e+04 0 20 2.81e+03 caloBlock Transportation 29 0 -810 0 1e+04 0 20 2.81e+03 caloBlock Transportation 30 0 -890 0 1e+04 0 80 2.89e+03 caloLayer Transportation 30 0 -890 0 1e+04 0 80 2.89e+03 caloLayer Transportation 31 0 -910 0 1e+04 0 20 2.91e+03 caloBlock Transportation 31 0 -910 0 1e+04 0 20 2.91e+03 caloBlock Transportation 32 0 -990 0 1e+04 0 80 2.99e+03 caloLayer Transportation 32 0 -990 0 1e+04 0 80 2.99e+03 caloLayer Transportation 33 0 -1.01e+03 0 1e+04 0 20 3.01e+03 caloBlock Transportation 33 0 -1.01e+03 0 1e+04 0 20 3.01e+03 caloBlock Transportation 34 0 -1.1e+03 0 1e+04 0 90 3.1e+03 expHall Transportation 34 0 -1.1e+03 0 1e+04 0 90 3.1e+03 expHall Transportation 35 0 -3e+03 0 1e+04 0 1.9e+03 5e+03 OutOfWorld Transportation 35 0 -3e+03 0 1e+04 0 1.9e+03 5e+03 OutOfWorld Transportation

17 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 : 1 ++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++

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

19 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); }

20 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(); }

21 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); }...

22

23 END


Download ppt "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)"

Similar presentations


Ads by Google