25
GAUSS - GEANT4 based simulation for LHCb GEANT4 Users’ Workshop 14 November 2002 W. Pokorski / CERN

GAUSS - GEANT4 based simulation for LHCb

Embed Size (px)

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Page 1: GAUSS - GEANT4 based simulation for LHCb

GAUSS - GEANT4 based simulation for LHCb

GEANT4 Users’ Workshop14 November 2002W. Pokorski / CERN

Page 2: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 2

Contents

Introduction to LHCb

Overview of Gauss project

GiGa – Gaudi interface to GEANT4overview and presentation of a few selected topics

Summary

Page 3: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 3

From the CP asymmetries in the final states of B-meson decays, measure CKM Angles. Large Sample of Events with Bd and Bs MesonsMost of the b hadrons are produced at small polar angles. LHCb: Single Forward Arm Spectrometer with Open Geometry.

This design isbeing modifiedto optimize theperformance of LHCb.

LHCb Experiment

Precision Measurements of CP violation in the B Meson System

Page 4: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 4

GAUDI – LHCb software framework

all of the LHCb event processing software is built within a framework – Gaudi frameworkseparation between data and algorithmsdata store-centred architectural styleseparation between transient and persistent data

isolation of user codes/algorithms from underlying persistency technologies

components interact through their abstract interfaces

Page 5: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 5

GAUDI - Object Diagram

Converter

Algorithm

Event DataService

PersistencyService

DataFiles

AlgorithmAlgorithm

Transient Event Store

Detec. DataService

PersistencyService

DataFiles

Transient Detector

Store

MessageService

JobOptionsService

Particle Prop.Service

OtherServices

HistogramService

PersistencyService

DataFiles

TransientHistogram

Store

ApplicationManager

ConverterConverterEventSelector

InteractiveService

Page 6: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 6

Gauss application

Geant4

JobOpts JobOpts

Geant4(GiGa)

DigiAlg

JobOpts

DigitMCDigit

Geometry

HepMCMCParticleMCVertex

MCHit

Generator Detector Simulation Digitization

Cnv

Cnv

Cnv

GiGa

Pythiaetc

Int.face

Page 7: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 7

GiGa overview

GEANT4 Interface for Gaudi Applications or Gaudi Interface to 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 Gaudiuse of common services (ParticlePropertySvc, RandomNumberSvc, MagneticFieldSvc, etc.)

Page 8: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 8

GiGa structure

Geant4

Algorithm

EventService

PersistencyService

DataFiles

AlgorithmAlgorithm

Transient Event Store

Detec. Service

PersistencyService

DataFiles

Transient Detector

Store

ApplicationManager

GiGaService

G4 Hits

G4 Kine

GiGaKine Conversion

Service

CnvCnvConverter

OtherServices

ActionAction

GiGaHits Conversion

Service

G4 Geom

GiGaGeomConversion

Service

Page 9: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 9

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 GiGaRunManagerinstantiates different “actions” and physics lists using abstract factory approach (makes them to be plugable components)

Page 10: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 10

A few selected topics:

Dynamic loading and instantiation using Abstract FactoriesGiGaRunManagerGaussTrajectory and GaussEventActionLoading the GeometrySensitive DetectorsPhysics lists

Page 11: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 11

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-timeset of components (different UserActions, Physics lists, etc) can be changed by specifying different jobOptions of the application

Page 12: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 12

Abstract Factory approach (2/3)

DLLDLLDLL

SvcFactoryIFactory

Service

{new}

ServiceUserActions,Physics Lists,

etc

SvcFactoryxxxFactory

FactoryTableApplicationMgrgetFactoryTable

Application

{instantiate}

Table of components that could be instantiated

Factories which are in charge of instantiating

concrete objects

List of dlls to load

Set of options for components

(for ex cuts forphysics list)

“new” executed here!!!

Page 13: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 13

Abstract Factory approach (3/3)

G4 worldGaudi world

concrete implementations of

components

virtual

Gaudi Services

Abstract Factory returns pointer to this

Page 14: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 14

GiGaRunManager

GiGaRunManager is a specialization of G4RunManagerno 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 jobOptionsno UserPrimaryGeneratorAction::GeneratePrimariesdirect control over calls to G4Event::AddPrimaryVertex

possibility of combining several generated events (pile-up) inside one G4 events by setting appropriate jobOptions

Page 15: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 15

GaussTrajectory

implements G4VTrajectoryin addition to G4Trajectory: time of flight at each TrajectoryPoint – needed in order to convert to LHCb event modelspeciallized 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

Page 16: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 16

GaussTracking Action

PostUserTrackingAction: takes decision whether to store given trajectoryseveral criteria implemented (to be extended) depending on:

energy, energy of secondariesparticle type, particle type of secondariescreation of a hitetc

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

Page 17: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 17

GiGa - Geometry Conversion

ConverterConverter ConverterConverter

Geant4Geant4

MaterialMaterialss

Geant4Geant4

MaterialMaterialss

Geant4Geant4

VolumVolumeses

Geant4Geant4

VolumVolumeses

VolumesVolumesMaterialsMaterials

Xml description

Xml Cnv

Gaudi transient

store

Geo Conversion Service

Page 18: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 18

Geometry conversion ex. (RICH 1)

XmlGaudiGiGaG4OpenGL

Page 19: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 19

Sensitive Detectors & Hits

G4TrackerHits

(Geant4)

GiGaSensDetTracker

lvVolume

(XmlDDDB)

GiGaTrackerHitsCnv

MCHits

(/Event/MC/OT/Hits)

Geant4 world

Gaudi world

ProcessHit()

<logvol name="lvU_ActiveLayer" … sensdet="GiGaSensDetTracker/myDet">

creates

invoked when particle passed through the sensitive volume

converts to:

Page 20: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 20

Detector Simulation – “physics lists”

physics lists:crucial part of the whole simulation program – will certainly require several tuning iterationsmost of the stuff already implemented in Geant4some 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 anythingexpected to increase flexibility and to make validation easier

Page 21: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 21

RICH1 with SingleParticleGun

Pion with 7 GeV/c. Cherenkov PhotonsIn Aerogel and C4F10.

RICH1 Event

Rayleigh scatteringSwitched off forIllustration.

S. Easo

Page 22: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 22

RICH1 Hits

Page 23: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 23

Panoramix view of MCHits

Page 24: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 24

Panoramix view of MCHits (2)

Page 25: GAUSS - GEANT4 based simulation for LHCb

14/11/2002 LHCb Simulation 25

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 functionalitiesextensive use of AbstractFactory concept, allowing run-time loading of specific components