1 / 15

Work_Geant4

Work_Geant4. Bo-Wen Shiou. A Sample main() Method. #include "G4RunManager.hh“ #include "G4UImanager.hh" #include "ExN01DetectorConstruction.hh“ #include "ExN01PhysicsList.hh“ #include "ExN01PrimaryGeneratorAction.hh" int main() {

enid
Download Presentation

Work_Geant4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Work_Geant4 Bo-Wen Shiou

  2. A Sample main() Method #include "G4RunManager.hh“ #include "G4UImanager.hh" #include "ExN01DetectorConstruction.hh“ #include "ExN01PhysicsList.hh“ #include "ExN01PrimaryGeneratorAction.hh" int main() { // construct the default run manager G4RunManager* runManager = new G4RunManager; // set mandatory initialization classes runManager->SetUserInitialization(new ExN01DetectorConstruction); runManager->SetUserInitialization(new ExN01PhysicsList);

  3. // set mandatory user action class runManager->SetUserAction(new ExN01PrimaryGeneratorAction); // initialize G4 kernel runManager->Initialize(); // get the pointer to the UI manager and set verbosities G4UImanager* UI = G4UImanager::GetUIpointer(); UI->ApplyCommand("/run/verbose 1"); UI->ApplyCommand("/event/verbose 1"); UI->ApplyCommand("/tracking/verbose 1"); // start a run int numberOfEvent = 3; runManager->BeamOn(numberOfEvent); // job termination delete runManager; return 0; }

  4. Detector Construction 1. Create a geometry . 2. Using this geometry , and adding other attributes

  5. Create a geometry Example :  Creating a box. 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);

  6. Example : Create a Logical Volume G4LogicalVolume* experimentalHall_log = newG4LogicalVolume(experimentalHall_box,Ar,"expHall_log"); Example : Create a Physical Volume G4VPhysicalVolume* experimentalHall_phys = new G4PVPlacement(0, // no rotation G4ThreeVector(0.,0.,0.), // translation position experimentalHall_log, // its logical volume "expHall", // its name 0, // its mother volume false, // no boolean operations 0); // its copy number

  7. Materials in the Detector • G4Element Ex: atomic number , atomic mass ……etc • G4Material Ex: density , temperature , pressure ……etc

  8. Example: water a = 1.01*g/mole; G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a); a = 16.00*g/mole; G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a); density = 1.000*g/cm3; G4Material* H2O = new G4Material(name="Water",density,ncomponents=2); H2O->AddElement(elH, natoms=2); H2O->AddElement(elO, natoms=1);

  9. Example : air a = 14.01*g/mole; G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a); a = 16.00*g/mole; G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a); density = 1.290*mg/cm3; G4Material* Air = new G4Material(name="Air ",density,ncomponents=2); Air->AddElement(elN, fractionmass=70*perCent); Air->AddElement(elO, fractionmass=30*perCent);

  10. G4VuserPhysicsList • ConstructParticle(); // construction of particles • ConstructProcess(); // construct processes and register them to particles • SetCuts(); // setting a range cut value for all particles

  11. Example : Construct a proton and a geantino. void ExN01PhysicsList::ConstructParticle() { G4Proton::ProtonDefinition(); G4Geantino::GeantinoDefinition(); }

  12. G4BosonConstructor • G4LeptonConstructor • G4MesonConstructor • G4BarionConstructor • G4IonConstructor • G4ShortlivedConstructor.

  13. Example :  Construct all leptons. void ExN05PhysicsList::ConstructLeptons() { // Construct all leptons G4LeptonConstructor pConstructor; pConstructor.ConstructParticle(); }

  14. Dictionary of Particles G4ParticleTable  FindParticle(G4String name); // find the particle by name FindParticle(G4int PDGencoding) // find the particle by PDG encoding .

  15. G4ParticleDefinition* GetIon ( G4int atomicNumber, G4int atomicMass, G4double excitationEnergy );

More Related