200 likes | 371 Views
AliRoot + Geant4, Fluka. I. Hrivnacova, IPN, Orsay ALICE Offline Meeting, CERN, 18 March 2002. Outline. Architecture AliRoot with 3 Monte Carlo’s Flugg, AliFluka Implementation Present status Geant4 Reflections, MANY To be done. Monte Carlo Interface. AliMC. Geant3. TGeant3.
E N D
AliRoot + Geant4, Fluka I. Hrivnacova, IPN, Orsay ALICE Offline Meeting, CERN, 18 March 2002
Outline • Architecture • AliRoot with 3 Monte Carlo’s • Flugg, AliFluka • Implementation • Present status • Geant4 • Reflections, MANY • To be done ALICE Offline Meeting, CERN, 18 March 2002
Monte Carlo Interface AliMC Geant3 TGeant3 Geant3 geometry TGeant4 G3toG4 Geant4 Geant4 geometry TFluka To do ? Fluka geometry Fluka ALICE Offline Meeting, CERN, 18 March 2002
Compiling Existing Pieces AliMC Geant3 Geant3 geometry TGeant3 Geant4 TGeant4 G3toG4 Geant4 geometry Flugg Fluka TFluka ALICE Offline Meeting, CERN, 18 March 2002
Flugg • By Sara Vanini • Enables to run Fluka with Geant4 geometry • Structure: • config, documents, examples, source • source: Wrappers, dummyG4, global, geometry, materials, intercoms, graphics_reps • 4 examples • All with a simple geometry • Builds needed Geant4 libraries itself • Does not require Geant4 installation • Has to be updated with each Geant4 release ALICE Offline Meeting, CERN, 18 March 2002
Flugg ++ • Put up to date with • Geant4 – upgrade from version 1.0 to 3.2 • FLUKA • CVS repository • /afs/cern.ch/user/f/fluka/flugg/flugg.cvs • Kept history of the developments • Access only for developers • Automated procedure for updating Geant4 part to new Geant4 releases • Scripts: update_config.sh, update_source.sh • Still needs to update binmake.gmk by hand ALICE Offline Meeting, CERN, 18 March 2002
“Light” Flugg • Geant4 part removed from Flugg source • Libraries • FGGWrappers, G4dummy • Test • Added test code for all CSG + specific solids • Requires Geant4 installation • User application has to be linked also with Geant4 libraries • Easier to follow Geant4 releases • Included in AliRoot ALICE Offline Meeting, CERN, 18 March 2002
TGeant4, AliGeant4 • Requirement: to limit usage of Geant4 in AliFluka to geometry part only • TGeant4, AliGeant4 categories • Classes are grouped in categories: • global, geometry, physics, event, run, visualization, interfaces • One directional dependence • Granular libraries for subpackages are not supported in AliRoot • The “global” libraries depend on full Geant4 ALICE Offline Meeting, CERN, 18 March 2002
TGeant4, AliGeant4 ++ • Makefile.flugg - alternative makefiles • 2 libraries in each package: • Low level: global, geometry, visualization • High level: digits+hits, physics, event, run, interfaces • Design iteration • Category geometry splitted into 2: geometry and digits+hits • Eliminated the dependence on Geant4 digits+hits (not included in Flugg) • 4 new classes (separated from existing ones) ALICE Offline Meeting, CERN, 18 March 2002
AliFluka • Classes: • TFluka • Realization of AliMC interface for Fluka • Implemented methods for building geometry • Delegation to TG4GeometryManager • AliDetConstructionHelper • Instantiates AliRoot detectors, AliDetectorConstruction • To be replaced with an analog to TG4RunManager (or AliGeant3) ALICE Offline Meeting, CERN, 18 March 2002
AliFluka ++ • TFluka class ALICE Offline Meeting, CERN, 18 March 2002
AliFluka ++ • alifluka.cxx • Main program, analogous to aligeant4 • Links with libraries: • ROOT, CLHEP, Geant4 (up to geometry), TGeant4_1, AliGeant4_1, Flugg, Fluka ALICE Offline Meeting, CERN, 18 March 2002
Present Status • Only very simple geometry tested • Materials • Have to be defined in a Fluka way • Correspondence between volumes and materials have to be defined by hand • Known problems • Problem with interpreting ROOT macro (Config.C) • G4Para solids – in a Flugg application ALICE Offline Meeting, CERN, 18 March 2002
Geant4 4.0Reflections • Geant4 standard geometry: • Rotation, Translation • Using HepRotation, Hep3Vector from CLHEP • G4ReflectionFactory, G4ReflectedSolid • Enable to use general transformations which can be composed of rotation, translation and reflection • Using HepTransform3D from CLHEP • The occurrence of reflection is limited to G4ReflectionSolid – no modifications of the rest of Geant4 were required ALICE Offline Meeting, CERN, 18 March 2002
Geant4 4.0Reflections ++ • G4ReflectionFactory, G4ReflectedSolid • Principle: • General transformation that contains reflection is decomposed into “pure ”rotation and reflection • Reflection is then applied to a solid and a new G4ReflectedSolid instance is created and placed with a transformation containing only the pure rotation and translation • Reflection factory handles the pairs of constituent and reflected logical volumes + volumes daughters • Limitation to CSG solids • not yet supported PCON, PGON (specific solids) ALICE Offline Meeting, CERN, 18 March 2002
Geant4 4.0MANY • G3toG4: • G3toG4MANY.cc, G4gsbool.cc • MANY positions are resolved in G3toG4MANY function using boolean operations on solids • User has to provide additional info using Gsbool function for all overlapping volumes. Daughters are resolved automatically and should not be specified via Gsbool • Limitation: • Each volume with a MANY position can have only this one position ALICE Offline Meeting, CERN, 18 March 2002
MANY Geometries in AliRoot • Gsbool() function added to AliMC • Dummy implementation in TGeant3 • Delegation to G4gsbool in TGeant4 • MANY geometries: • MUON, MAG, PIPE, SHIL, TRD, ITS • Resolved: • PIPE, SHIL - Gsbool additions only • MAG, MUON - Gsbool additions + change of geometry • TRD - only change of geometry (no overlapping volumes) • Done with v3-06-rev02 (PPR release) • Tested using lego plots ALICE Offline Meeting, CERN, 18 March 2002
MANY Geometries in AliRoot • In v3-07-04 release • Included modifications in STEER • Not included modifications in detectors/structures geometries • Most of resolved geometries were modified – the modifications for MANY will have to be merged with those in CVS and tested again ALICE Offline Meeting, CERN, 18 March 2002
Patch to Geant4 • Modifications to Geant4 needed for AliRoot: • Patch for reflections • Needed until Geant4 reflection classes will support specific and boolean solids • Patch for stacking • Special treatment for AliRoot stacking mechanism • To be re-discussed with Geant4 team • Patch for optical boundary process • Agreed with the author to be included in the next patch/release • Patch for G4Navigator • A special function added for Flugg • Best solution is being discused • /afs/cern.ch/user/i/ivana/public/patch/geant4 ALICE Offline Meeting, CERN, 18 March 2002
To do • Geant4 side • Include modifications in AliRoot for MANY and keep them in mind when modifying geometry • Magnetic field • Flugg side • Materials • Test more complex geometries • TFluka • Complete the implementation for the other functions of AliMC (stepping, run management) ALICE Offline Meeting, CERN, 18 March 2002