Download presentation
Presentation is loading. Please wait.
Published byMelina Willis Modified over 8 years ago
1
Working with HGeant Part 1 by Ilse Koenig: Overview of HGeant How to install it How to run it -Initialisation (geaini file, geometry from Oracle or files) -Interactive session Output of HGeant Simple example macro Part 2 by Jochen Markert: Looping on the output HADES analysis workshop, Darmstadt, Germany, 31 January - 1 February 2012
2
HGeant, the HADES simulation package HGEANT2 geant, grich, gmdc, gtof, grpc, gshower, gwall ROOT Cernlib Hydra2 libHydra (base, geom, geantutil) libSimulation libOraSim Oracle Executable hgeant geaini file (geometry, events,…) ROOT file Hydra2 DST based on GEANT 3.21 tracks particles through the HADES geometry generates detector hits based on a realistic modeling of the physical processes occurring along the tracks stores track information and hits in an HTree The analysis reads this tree, digitizes the hits, which are then handled like real events with the track number as additional data member (gives access to the original track and hit data).
3
1.Checkout hgeant2: svn co https://subversion.gsi.de/hades/hgeant2/trunk hgeant2https://subversion.gsi.de/hades/hgeant2/trunk hgeant2 2.Setup your shell environment (including Root, Cernlib and Hydra2 settings): Example: /misc/hadessoftware/etch32/install/hydra-dev/defall.sh 3.Copy Makefile from sub-directory adm to main directory. Change INSTALL_DIR to your local directory. 4.Build it: make 5.Install it: make install 6.Eventually remove the files created during build: make distclean How-to install HGeant2
4
Read by GEANT (ffread package) Read by HGeant2 C++ interface (class HGeantInput) Control by keywords and file extensions Initialisation: geaini_ora.dat Be careful with comments! (FORTRAN code) Example: Au+Au, 1.25GeV/A, ideal geometry
5
General control of the simulation, of the physics processes, the user applications see GEANT manual BASE040-1ff, PHYS001-3 http://hades-wiki.gsi.de/cgi-bin/view/SimAna/HGeantHowToRun read events from.evt event files automatic computation of the tracking medium parameters internal 1-shot generator OFF TOSCA field map scaling and polarity of magnetic field maximum number of steps allowed in tracking vertex sampling (here: emission from segmented target, 2-dim Gauss beam spot) 6 beam parameters: sig(X) sig(Y) Ebeam sig(Ebeam) offsetX offsetY (in mm and MeV) store all secondaries, but only active tracks generation of Cerenkov light continuous energy loss ON Delta-ray production ON number of events Reset eta branching (check against latest PDG value!) user defined GEANT switches (here: track all particle, no printing or plotting, input in lab GEANT time limits frame, all decays allowed, sample event plane angle ) size of output file (where tree is split) HGeant output mode (ROOT file) Vertex sampling with JVER, BEAM, TARG see http://hades-wiki.gsi.de/cgi-bin/view/SimAna/HGeantHowToRun and files geant/makevertex.F, geant/makevertex.F and geant/rantarg.F for details Pluto events with vertex: do not specify JVER, BEAM or TARG Always check vertex distribution before running large amount of statistics! The GEANT keywords in geaini_ora.dat
6
The geometry, input, output in geaini_ora.dat Reads actual geometry from Oracle for simulation reference run.map file for field map xxx.tup enables output of detector hits in the tree.evt for event input file.root for output file.setup file for detector subsets
7
Simulations on the batch farm Initialisation of geometry from Oracle possible, but not recommended for small simulation (one or two jobs) No-Go for large scale simulations (many jobs in parallel) Use geometry files created from Oracle! Advantage: faster (no waiting for active Oracle session) same geometry for all runs (not guaranteed for history date ”now”) listing of media possible (macro listMedia.C) Analysis on the batch farm: Use parameter ROOT file! Macro: ora2files.C
8
Reads the geometry from Oracle and creates all.geo and.hit files The macro ora2files.C Class HGeomInterface: Manages input/output from/to Oracle, files creates geometry, media, hit definitions in GEANT or ROOT
9
The geometry files in geaini_files.dat Reads all from files (no Oracle connection) To be used on the batch farm Oracle support OFF Id of simulation reference run (stored in the event header), found in Oracle WebDB.geo geometry files for the different detector parts (key words!) (retrieved from Oracle: “detector part”_”time”.geo).hit hit definition for the different detectors
10
cd ~/analysis_workshop/2012/working_with_hgeant/macros // run in batch mode ~/svn/hgeant2/hgeant -c -f geaini_files.dat How to run HGEANT Problem: maximum of 63 characters for directory+geaini filename !
11
Interactive session ~/svn/hgeant2/hgeant -f geaini_files.dat Creates ROOT session with small menu (macro hgeant2/geant/menu.C dcut cave 1 0 5 10.04.04 Cut volume cave at x=0 => yz plane satt rtam colo 2 Where is the target? Set colors! satt targ colo 4 next Clear window dcut cave 1 0 5 10.04.04 Redraw zoom Zooming: mark region with mouse, clear window and redraw use " zoom 0 " to unzoom daxis 0 0 0 5 Where is 0? (parameters x, y, z, scaling factor for size) pic Volumes and materials? Click in a volume with left mouse (leave menu with right mouse click) meas Distance between 2 points? (Click at points with left mouse keep pressed, move mouse to the second point and release key) Result in cm! draw rtam 60 30 0 77 30 2 2 3d-drawing (3 angles, x y origin, x y scaling) dtree cave 2 Command: dtree volume sub-levels => shows tree of volumes Left mouse click on a volume to see volume, daughters,... on an arrow to see additional sub-levels (leave menu with right mouse click) quit Leave KUIP interface => ROOT KUIP interface: (GEANT manual XINT001 and XINT002)
12
Output ROOT file HGeantKine Data of GEANT tracks HGeantMdc MDC hits HGeantRichPhoton RICH hit data for Cherenkov photons HGeantRichDirect RICH direct hits on photon detector HGeantRichMirror RICH hits on the mirror HGeantShower Shower hits HGeantTof Tof hits HGeantWall Forward Wall hits HGeantRpc RPC hits The detector hit classes are derived from class HLinkedDataObject and inherit from it as data member the index of the next hit.
13
HGeantKine (Part1/2) GEANT KINE data on primary and secondary particles in the simulated event
14
HGeantKine (Part2/2)
15
HGeantMdc
16
Looping on the output 1 3 decay 1 primary 2 secondary 4 detector getPrimary(4) Loop forward on kine tracks and MDC hits Loop backwards from MDC hits: see talk by Jochen Markert
17
Exercise: Protons 1.Simulation: shoot 500 MeV/c protons, one per sector, with fixed theta = 35 deg, phi = 30 deg 2.Analysis: Loop (forward) on output: plot vertex distribution for primaries plot incident angle on MDC plane 1 and 2 for primaries => multiple scattering print history of secondary tracks
18
Remove event file Set output file name No event file 1000 events shoot 500 MeV/c protons, one per sector, with fixed theta=35deg, phi=30deg KINE ikine pkine(10) Controls 1-shot generator ikine > 0 : generate ikine particle(s) or pair(s) per shot with fixed kinematics ikine = -1: generate one particle per sector (phi range must be set to 0..60) pkine(1), pkine(2) = theta (min, max in degrees) pkine(3), pkine(4) = phi (min, max in degrees) pkine(5), pkine(6) = momentum (min, max in MeV/c) pkine(7) = particle id1 (+1000*id2 for pairs) pkine(8), pkine(9) = pair opening angle (min, max in degrees) pkine(10) = orientation of pair in degrees (if>360, random) GEANT particles and ions: see GEANT manual CONS300 Example: geaini_protons.dat
19
Plots vertex distribution of primary tracks, incident angle theta on MDC plane 1 and 2 Print history of secondary particles Example macro: hloop_protons.C (Part1/4)
20
Example macro: hloop_protons.C (Part2/4)
21
Example macro: hloop_protons.C (Part3/4)
22
Example macro: hloop_protons.C (Part4/4)
23
Output of pKine->printHistory() Creation: see GEANT manual ZZZZ010-22 Medium: see macro listMedia.C Output of example macro: hloop_protons.C Run with compilation
24
Tilting angle plane1: 44.2° Tilting angle plane2: 53.0° Histograms of example macro hloop_protons.C
25
Create the ROOT browser to explore the geometry inside ROOT Lists media and their ids Same as in GEANT for same.dat file Works only with geo files, not with Oracle! List all media with macro listMedia.C
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.