Mantis
a framework and toolkit for Geant4 simulation in CMS
- M. Stavrianakou
CERN Geant4 Workshop 02.10.2002
Mantis a framework and toolkit for Geant4 simulation in CMS M. - - PowerPoint PPT Presentation
Mantis a framework and toolkit for Geant4 simulation in CMS M. Stavrianakou CERN Geant4 Workshop 02.10.2002 COBRA Mantis OSCAR COBRA is the CMS framework; it implements the CMS OO architecture Mantis is the
CERN Geant4 Workshop 02.10.2002
02.10.2002 2
➨ Mantis as a subsystem of COBRA is ❐a toolkit for building or interfacing to detector geometries and
sensitive volumes, generators, physics, magnetic fields, actions etc
❐a framework for Geant4 simulation applications (interactive or batch)
steering and control, persistency, histogramming etc
✁provides run and event management
✂provides interfaces for loading the specific libraries for geometry, magnetic field, generators, physics, tuning and monitoring actions
———————————————————————————————————————————————— Mantis is also:
➨a human able to see the future: from the Greek word for seer, prophet ➨a rather nasty insect ➨a very cute and timid shrimp
02.10.2002 3
relies on COBRA for the application main
persistency) are driven by COBRA “simple configurables” (kind of “datacard”mechanism)
available transparently via the underlying COBRA infrastructure
➨ an event source factory based on a COBRA abstract event “reader”of
simulated events
➨ a run manager
and handles generator, magnetic field and visualisation selection and instantiation
✄powerful key COBRA features (lazy instantiation, action on demand, etc) and patterns (factories, dispatchers-observers etc) are used extensively (but are probably not yet exploited to their full potential)
02.10.2002 4
Run and event management are implemented in order to work around (what we may consider) restrictive Geant4 mechanisms and facilitate synergy with COBRA
➨ Run Manager (inherits from G4RunManager) takes over control for:
❐ geometry initialization
☎UserInitialization of a G4VUserDetectorConstruction bypassed
❐ generator initialization and Monte Carlo event conversion to G4Event
✆G4VUserPrimaryGeneratorAction bypassed
❐ physics initialization
✝UserInitialization of a G4VUserPhysicsList bypassed
➨ Event
❐ is a COBRA SimEvent
✞analogous to its Geant3 counterpart
❐ manages Monte-Carlo truth
✟raw event/particles from generator and G4 simulated tracks and vertices
✠does not directly depend on Geant4, but needs EventAction and Tracking Action to retrieve G4 simulated tracks and vertices
02.10.2002 5
➨ Setup selection
❐ full CMS, partial, test beam etc driven by configuration (XML)
➨ Geometry building
❐ automated conversion from DDD to Geant4 solids, materials, volumes
➨ User limits
❐ step and track length, production, tracking and time cuts:
✡automatic conversion and assignment from DDD to Geant4 work in progress
➨ no code modification, no recompilation, loadable on demand
provided types of field, allowing
➨ selection (Uniform, 2D map, 3D map)
➨ interface to G4 with
☛choice of integrator
☞tuning options
➨ loadable on demand
02.10.2002 6
volumes
➨ any number of instances of a given sensitive detector,
assignable to any type and number of logical volumes
➨ loadable on demand
➨ creation
❐ using Geant4 ProcessStep
➨ formatting ➨ persistency
✌hit modelling, numbering scheme, readout choice by CMS detector group experts (OSCAR-side)
✍hits directly digitizable and usable by the CMS OO reconstruction program ORCA
02.10.2002 7
GeneratorInterface
➨ to produce a CMS RawHepEvent ❐ converted and passed to Geant4 using the G4HEPEvtInterface ❐ HepMC/HepPDT have been evaluated
✎will be used following evolution in context of on-going RTAGs
✏preference/recommendation for physical decoupling from CLHEP
➨ to allow selection and configuration at the application steering level
➨ configurable particle gun with choice of vertex generator ➨ CMS HepEvt ntuple ➨ CMS text file with choice of vertex generator ➨ Pythia6 on-the-fly
02.10.2002 8
Physics Lists and Cuts infrastructure for
➨ building a concrete physics list ➨ list selection configuration ❐active categories of processes
✑general, electromagnetic, hadronic, ion …
❐selection of production (range) cuts: default, from file
✒currently using cuts per material User Actions infrastructure for
➨ tuning ➨ monitoring
✓quantities of interest (Begin/End Of Run/Event, Step, Pre/Post Track) “dispatched” to potential “observers” using COBRA dispatcher-
at present foresee only one CMS “stacking action” possibly emulating level 1 trigger
✕any number of (combinations of) observers may be present
✖no need for central “action management”
02.10.2002 9
02.10.2002 10
CMS Geometry example CMS Sensitive Detector and Hits example
02.10.2002 11
CMS Production Physics List User Action Example
02.10.2002 12
Mantis has been inspired by and developed in the context of COBRA
✘it has also been inspired by and reused ideas from Goofy (ATLAS) and has profited from the pre-existing OSCAR implementation
✙Interactivity is largely addressed by IGUANA
✚Mantis relies on basic G4 services/messengers; future versions may exploit emerging G4/Python facilities
✛Mantis amounts to ~5K lines of code developed by ~1 FTE in ~3 months
✜Realistic beta-testing by the CMS b/ – Tracker is in progress
✢vital feedback is contributing to improvements
✣There are outstanding requirements as well as currently unforeseen ones
✤Thanks to the underlying COBRA architecture, implementation of most new requirements is straightforward
✥Several requirements to Geant4 have emerged during the Mantis development
✦these we sometimes address as Geant4 shortcomings or restrictive mechanisms but this should not be taken as criticism in any negative sense; given the scope and magnitude of LHC experiment simulations, requirement evolution is inevitable
✧Mantis and the underlying COBRA infrastructure are not CMS-specific