250 likes | 419 Views
GAUSS - GEANT4 based simulation for LHCb. GEANT4 Users’ Workshop 14 November 2002 W. Pokorski / CERN. Contents. Introduction to LHCb Overview of Gauss project GiGa – Gaudi interface to GEANT4 overview and presentation of a few selected topics Summary. LHCb Experiment.
E N D
GAUSS - GEANT4 based simulation for LHCb GEANT4 Users’ Workshop 14 November 2002 W. Pokorski / CERN
Contents • Introduction to LHCb • Overview of Gauss project • GiGa – Gaudi interface to GEANT4 • overview and presentation of a few selected topics • Summary LHCb Simulation
LHCb Experiment Precision Measurements of CP violation in the B Meson System • From the CP asymmetries in the final states of B-meson decays, measure CKM Angles. • Large Sample of Events with Bd and Bs Mesons • Most of the b hadrons are produced at small polar angles. LHCb: Single Forward Arm Spectrometer with Open Geometry. This design is being modified to optimize the performance of LHCb. LHCb Simulation
GAUDI – LHCb software framework • all of the LHCb event processing software is built within a framework – Gaudi framework • separation between data and algorithms • data store-centred architectural style • separation between transient and persistent data • isolation of user codes/algorithms from underlying persistency technologies • components interact through their abstract interfaces LHCb Simulation
GAUDI - Object Diagram Converter Converter Application Manager Interactive Service Converter Event Selector Transient Event Store Data Files Message Service Persistency Service Event Data Service JobOptions Service Algorithm Algorithm Algorithm Data Files Transient Detector Store Particle Prop. Service Persistency Service Detec. Data Service Other Services Data Files Transient Histogram Store Persistency Service Histogram Service LHCb Simulation
Gauss application JobOpts JobOpts JobOpts Int.face GiGa Digi Alg Geant4 (GiGa) Pythia etc Geant4 MCParticle MCVertex MCHit Digit MCDigit HepMC Cnv Cnv Cnv Geometry Generator Detector Simulation Digitization LHCb Simulation
GiGa overview • GEANT4 Interfacefor Gaudi Applications or Gaudi Interfaceto GEANT4 Applications • makes GEANT4 callable and controllable from within GAUDI environment • common detector geometry source used by other applications (reconstruction, visualisation) • communication via Transient Stores (Event, Detector Data) as any other service or algorithm in Gaudi • use of common services (ParticlePropertySvc, RandomNumberSvc, MagneticFieldSvc, etc.) LHCb Simulation
GiGa structure Data Files Persistency Service Application Manager GiGaKine Conversion Service G4 Kine Transient Event Store Event Service Geant4 GiGaHits Conversion Service G4 Hits Converter Algorithm Cnv GiGa Service Algorithm Algorithm Cnv Transient Detector Store GiGaGeom Conversion Service G4 Geom Action Detec. Service Action Other Services Data Files Persistency Service LHCb Simulation
GiGa features • it is a façade pattern • minimizes the couplings to Geant4 • all interactions with Geant4 only through abstract interfaces of GiGa Service • provides access to internal G4 event loop via GiGaRunManager • instantiates different “actions” and physics lists using abstract factory approach (makes them to be plugable components) LHCb Simulation
A few selected topics: • Dynamic loading and instantiation using Abstract Factories • GiGaRunManager • GaussTrajectory and GaussEventAction • Loading the Geometry • Sensitive Detectors • Physics lists LHCb Simulation
Abstract Factory approach (1/3) • concrete implementations of different functional parts (user actions, physics lists, etc) are collected in “component libraries” • not linked to the main program, used purely at run-time • changes in the implementation of the component library does not require the application to be relinked • configurable at run-time • set of components (different UserActions, Physics lists, etc) can be changed by specifying different jobOptions of the application LHCb Simulation
Abstract Factory approach (2/3) List of dlls to load Table of components that could be instantiated DLL DLL getFactoryTable DLL ApplicationMgr FactoryTable Set of options for components (for ex cuts for physics list) Factories which are in charge of instantiating concrete objects {instantiate} SvcFactory SvcFactory xxxFactory IFactory “new” executed here!!! {new} Application Service Service UserActions, Physics Lists, etc LHCb Simulation
Abstract Factory approach (3/3) Gaudi world G4 world virtual Gaudi Services Abstract Factory returns pointer to this concrete implementations of components LHCb Simulation
GiGaRunManager • GiGaRunManager is a specialization of G4RunManager • no beamOn method, “event loop” external to GiGaRunManager, no “G4 run” concept • simulation of single events triggered (and controlled) externally • calls directly to G4EventManager::processOneEvent • construction of primary events controlled from outside of G4 • “event building” controlled from jobOptions • no UserPrimaryGeneratorAction::GeneratePrimaries • direct control over calls to G4Event::AddPrimaryVertex • possibility of combining several generated events (pile-up) inside one G4 events by setting appropriate jobOptions LHCb Simulation
GaussTrajectory • implements G4VTrajectory • in addition to G4Trajectory: time of flight at each TrajectoryPoint – needed in order to convert to LHCb event model • speciallized AppendStep method – triggered by a flag set in GaussStepAction::UserSteppingAction • controls which trajectory points to append (begin, end, reflections of optical photons, creation of interesting particles, etc) • storing (or not) of trajectories controlled by GaussTrackingAction LHCb Simulation
GaussTracking Action • PostUserTrackingAction: takes decision whether to store given trajectory • several criteria implemented (to be extended) depending on: • energy, energy of secondaries • particle type, particle type of secondaries • creation of a hit • etc • in case a trajectory is not stored, consistency is assured by updating ParentID of the secondaries to the last (in given decay chain) stored trajectory LHCb Simulation
GiGa - Geometry Conversion Xml description Materials Volumes Xml Cnv Geo Conversion Service Converter Converter Gaudi transient store Geant4 Materials Geant4 Volumes LHCb Simulation
Geometry conversion ex. (RICH 1) XmlGaudiGiGaG4OpenGL LHCb Simulation
Sensitive Detectors & Hits GiGaSensDetTracker G4TrackerHits (Geant4) creates GiGaTrackerHitsCnv ProcessHit() Geant4 world converts to: invoked when particle passed through the sensitive volume MCHits (/Event/MC/OT/Hits) lvVolume (XmlDDDB) Gaudi world <logvol name="lvU_ActiveLayer" … sensdet="GiGaSensDetTracker/myDet"> LHCb Simulation
Detector Simulation – “physics lists” • physics lists: • crucial part of the whole simulation program – will certainly require several tuning iterations • most of the stuff already implemented in Geant4 • some specific processes needed implementation • for RICH: photoelectric process (creation of photoelectrons in HPDs), energy loss: in the silicon of HPDs • modular physics lists implemented using Abstract Factories concept • allows dynamic loading and configuration (via jobOptions) of different physics lists, not need to recompile anything • expected to increase flexibility and to make validation easier LHCb Simulation
RICH1 with SingleParticleGun RICH1 Event Pion with 7 GeV/c. Cherenkov Photons In Aerogel and C4F10. Rayleigh scattering Switched off for Illustration. S. Easo LHCb Simulation
RICH1 Hits LHCb Simulation
Panoramix view of MCHits LHCb Simulation
Panoramix view of MCHits (2) LHCb Simulation
Summary • LHCb simulation application build within common LHCb software framework (used by reconstruction, visualization, analysis) • communication with GEANT4 via an interface (GiGa) allowing flexible use of G4 functionalities • extensive use of AbstractFactory concept, allowing run-time loading of specific components LHCb Simulation