1 / 14

GEANT4 WORK

GEANT4 WORK. LSST Telescope Simulation using GEANT4. |> G4cout << ”Last updated :” << last_update << G4endl; |> Last updated : September 12, 2006 |>.

ahava
Download Presentation

GEANT4 WORK

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. GEANT4 WORK LSST Telescope Simulation using GEANT4 |> G4cout << ”Last updated :” << last_update << G4endl; |> Last updated : September 12, 2006 |> September 2006 Bogdan Popescu

  2. GEANT4 Overview 1 http://geant4.web.cern.ch/geant4/ Geant4 is a toolkit for the simulation of the passage of particles through matter. Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science. It provides a complete set of tools for all areas of detector simulation: geometry, tracking, detector response, run, event and track management, visualization and user interface. The multi-disciplinary nature of the toolkit requires that it supply an abundant set of Physics Processes to handle diverse interactions of particles with matter over a wide energy range. For many physics processes a choice of different models is available. A large set of utilities is provided, including a powerful set of random number generators. Other features, including a set of physics units and constants, particle management compliant with the Particle Data Group, interfaces to event generators, and object persistency solutions, complete the toolkit. 1 http://geant4.web.cern.ch/geant4/ September 2006 Bogdan Popescu

  3. GEANT4 Files [lsst] [include] lsstDetectorConstruction.hh lsstPhysicsList.hh lsstPrimaryGeneratorAction.hh [src] lsstDetectorConstruction.cc lsstPhysicsList.cc lsstPrimaryGeneratorAction.cc lsst.cc vis.mac September 2006 Bogdan Popescu

  4. lsstDetectorConstruction.cc – Include Declarations #include "lsstDetectorConstruction.hh" #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4Element.hh" #include "G4ElementTable.hh" #include "G4LogicalBorderSurface.hh" #include "G4Box.hh" #include "G4Tubs.hh" #include "G4Sphere.hh" #include "G4LogicalVolume.hh" #include "G4ThreeVector.hh" #include "G4RotationMatrix.hh" #include "G4PVPlacement.hh" #include "G4SubtractionSolid.hh" #include "G4VisAttributes.hh" #include "G4Colour.hh" #include "G4OpBoundaryProcess.hh" #include "G4OpticalSurface.hh" #include "globals.hh" # # materials # materials # elements # elements # optical processes # geometry # geometry # geometry # geometry # geometry # geometry # geometry # geometry, boolean operation # visualization # visualization # optical processes # optical processes # September 2006 Bogdan Popescu

  5. lsstDetectorConstruction.cc – Materials //-------------------------- materials --- elements --- air --- G4double a; // atomic mass G4double z; // atomic number G4double density; G4Material* Al = new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3); G4String name, symbol; G4int nel; 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); a = 28.09*g/mole; G4Element* elSi = new G4Element(name="Silicon", symbol="Si", z=14., a); // Air // --- density = 1.29e-03*g/cm3; G4Material* Air = new G4Material(name="Air", density, nel=2); Air->AddElement(elN, .7); Air->AddElement(elO, .3); //------------------------------------------------------ September 2006 Bogdan Popescu

  6. lsstDetectorConstruction.cc – World Volume //-- experimental hall (world volume) //-- beam line along x axis G4double expHall_x = 15.0*m; G4double expHall_y = 10.0*m; G4double expHall_z = 10.0*m; G4Box* experimentalHall_box = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z); experimentalHall_log = new G4LogicalVolume(experimentalHall_box,Air,"expHall_log",0,0,0); experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),experimentalHall_log,"expHall",0,false,0); September 2006 Bogdan Popescu

  7. lsstDetectorConstruction.cc – Mirror #2 //------------------------------ Mirror #2 G4double pRmin = 6.4*m; G4double pRmax = 6.8*m; G4double pSPhi = 0.0*deg; G4double pDPhi = 360.0*deg; G4double pSTheta = 165.522*deg; G4double pDTheta = 14.478*deg; G4Sphere* sphere01 = new G4Sphere("sphere01", pRmin,pRmax,pSPhi,pDPhi,pSTheta,pDTheta); G4Tubs* tube01 = new G4Tubs("tube01",0.0*m, 0.9*m,20.0*m,0*deg,360*deg); G4SubtractionSolid* sphere_minus_cyl = new G4SubtractionSolid("Sphere-Cyl",sphere01,tube01); tracker_log = new G4LogicalVolume(sphere_minus_cyl,Al,"tracker_log",0,0,0); G4double trackerPos_x = 3.0*m; G4double trackerPos_y = 0.*m; G4double trackerPos_z = 0.*m; G4RotationMatrix *mirror_rot = new G4RotationMatrix(G4ThreeVector(0.0,1.0,0.0),-90.0*deg); tracker_phys = new G4PVPlacement(mirror_rot,G4ThreeVector(trackerPos_x,trackerPos_y,trackerPos_z) ,tracker_log,"tracker",experimentalHall_log,false,0); G4VisAttributes* blue; blue = new G4VisAttributes(G4Colour(0.0, 0.0, 1.0)); tracker_log->SetVisAttributes(blue) September 2006 Bogdan Popescu

  8. lsstDetectorConstruction.cc – Mirror #2 G4Sphere* sphere01 = new G4Sphere("sphere01",pRmin,pRmax,pSPhi,pDPhi,pSTheta,pDTheta); G4Tubs* tube01 = new G4Tubs("tube01",0.0*m,0.9*m,20.0*m,0*deg,360*deg); G4SubtractionSolid* sphere_minus_cyl = new G4SubtractionSolid("Sphere-Cyl",sphere01,tube01); September 2006 Bogdan Popescu

  9. lsstDetectorConstruction.cc – Mirror #1 //-------------------- Mirror #1 G4double pRmin2 = 19.835*m; G4double pRmax2 = 20.0*m; G4double pSPhi2 = 0.*deg; G4double pDPhi2 = 360.*deg; G4double pSTheta2 = 167.834*deg; G4double pDTheta2 = 12.166*deg; G4Sphere* sphere02 = new G4Sphere("sphere02",pRmin2, pRmax2,pSPhi2,pDPhi2,pSTheta2,pDTheta2); G4Tubs* tube02 = new G4Tubs("tube02", 0.0*m,2.558*m,20.0*m,0*deg,360*deg); G4SubtractionSolid* sphere_minus_cyl2 = new G4SubtractionSolid("Sphere-Cyl2",sphere02,tube02); tracker_log = new G4LogicalVolume(sphere_minus_cyl2,Al,"tracker_log",0,0,0); G4double trackerPos_x2 = 25.0*m; G4double trackerPos_y2 = 0.*m; G4double trackerPos_z2 = 0.*m; G4RotationMatrix *mirror_rot2 = new G4RotationMatrix(G4ThreeVector(0.0,1.0,0.0),-90.0*deg); tracker_phys = new G4PVPlacement(mirror_rot2,G4ThreeVector(trackerPos_x2, trackerPos_y2,trackerPos_z2),tracker_log,"tracker",experimentalHall_log,false,0); tracker_log->SetVisAttributes(yellow); September 2006 Bogdan Popescu

  10. lsstDetectorConstruction.cc – Mirror #3 //-------------------- Mirror #3 G4double pRmin3 = 8.4*m; G4double pRmax3 = 8.9*m; G4double pSPhi3 = 0.*deg; G4double pDPhi3 = 360.*deg; G4double pSTheta3 = 162.686*deg; G4double pDTheta3 = 17.314*deg; G4Sphere* sphere03 = new G4Sphere("sphere03",pRmin3,pRmax3,pSPhi3, pDPhi3,pSTheta3,pDTheta3); G4Tubs* tube03 = new G4Tubs("tube03", 2.47*m,2.65*m,20.0*m,0*deg,360*deg); G4SubtractionSolid* sphere_minus_cyl3 = new G4SubtractionSolid("Sphere-Cyl3",sphere03,tube03); tracker_log = new G4LogicalVolume(sphere_minus_cyl3,Al,"tracker_log",0,0,0); G4double trackerPos_x3 = 13.7*m; G4double trackerPos_y3 = 0.*m; G4double trackerPos_z3 = 0.*m; G4RotationMatrix *mirror_rot3 = new G4RotationMatrix(G4ThreeVector(0.0,1.0,0.0),-90.0*deg); tracker_phys = new G4PVPlacement(mirror_rot3,G4ThreeVector(trackerPos_x3, trackerPos_y3,trackerPos_z3),tracker_log,"tracker",experimentalHall_log,false,0); tracker_log->SetVisAttributes(red); September 2006 Bogdan Popescu

  11. lsstDetectorConstruction.cc – Mirror #1, #3 // G4SubtractionSolid* sphere_minus_cyl2 = new G4SubtractionSolid("Sphere-Cyl2",sphere02,tube02); // G4SubtractionSolid* sphere_minus_cyl3 = new G4SubtractionSolid("Sphere-Cyl3",sphere03,tube03); September 2006 Bogdan Popescu

  12. lsstPrimaryGeneratorAction.cc #include "lsstPrimaryGeneratorAction.hh" #include "G4Event.hh" #include "G4ParticleGun.hh" #include "G4ParticleTable.hh" #include "G4ParticleDefinition.hh" #include "globals.hh" lsstPrimaryGeneratorAction::lsstPrimaryGeneratorAction() { G4int n_particle = 1; particleGun = new G4ParticleGun(n_particle); G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); G4String particleName; particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="opticalphoton")); particleGun->SetParticleEnergy(1.0*eV); particleGun->SetParticlePosition(G4ThreeVector(-14.0*m, 4.5*m, 4.5*m));} lsstPrimaryGeneratorAction::~lsstPrimaryGeneratorAction() { delete particleGun;} void lsstPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { G4int i = anEvent->GetEventID() % 4; G4ThreeVector v(1.0,0.0,0.0); switch(i) { case 0: break; case 1: v.setY(0.1); break; case 2: v.setZ(0.1); break; case 3: v.setY(-0.1);break;} particleGun->SetParticleMomentumDirection(v); particleGun->GeneratePrimaryVertex(anEvent);} September 2006 Bogdan Popescu

  13. Visualization – vis.mac # Sets some default verbose /control/verbose 2 /control/saveHistory /run/verbose 2 # create empty scene /vis/scene/create # Use this open statement to get an .eps and .prim files suitable for viewing in DAWN. ###/vis/open DAWNFILE # Use this open statement instead for OpenGL in immediate mode. /vis/open OGLIX # Set camera /vis/viewer/reset ##/vis/viewer/zoom 0.8 /vis/viewer/set/viewpointThetaPhi 30 120 # Create an empty scene and add the detector geometry to it /vis/drawVolume # Output an empty detector /vis/viewer/flush # for drawing the tracks ###/vis/open DAWNFILE /tracking/storeTrajectory 1 /vis/scene/endOfEventAction accumulate # At end of each run, an automatic flush causes graphical output. /vis/scene/add/trajectories /run/beamOn 4 # Visualize events added to the current scene ##/tracking/storeTrajectory 1 /vis/viewer/flush September 2006 Bogdan Popescu

  14. Images September 2006 Bogdan Popescu

More Related