gauss in general

17
Gauss in General Gloria Corti CERN LHCb Software Tutorial Updated on 10 October 2007 Gauss Tutorial

Upload: raya-chaney

Post on 30-Dec-2015

26 views

Category:

Documents


0 download

DESCRIPTION

LHCb Software Tutorial Updated on 10 October 2007. Gauss in General. Gloria Corti CERN. Gauss Tutorial. Outline. Overview of the LHCb simulation, Gauss Purpose Application based on Gaudi Gauss Project and application Structure and phases Event generation - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Gauss in General

Gauss in General

Gloria CortiCERN

LHCb Software Tutorial

Updated on 10 October 2007

Gauss Tutorial

Page 2: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 2

Outline

Overview of the LHCb simulation, Gauss Purpose Application based on Gaudi

Gauss Project and application Structure and phases

Event generation Detector physics simulation

Output(s) Data Monitors: Printout and histograms

Looking at results

Page 3: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 3

Overall purpose

Gauss mimics what will happen in the spectrometer to understand experimental conditions and performance

Provides generation of proton-proton collisions decay of particles with special attention to those of b-hadrons tracking of particles in the detector and interactions with the

material production of “hits" when particles cross sensitive detectors

Data produced can be studied directly or in further processing

GenCollisions and HepMCEvents (Generator level information) MCTruth as seen by the (LHCb) experimental setup

MCParticles and MCVertices MCHits, MCRichHits and MCCaloHits

Output (.sim ) can be processed by Boole

Page 4: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 4

Gauss as a Gaudi application

Gauss is built on top of the Gaudi framework and follow its architectural design

same principles and terminology Gauss as a Gaudi based application is a collection of “User Code”

specialized for physics simulation A sequence of algorithms configured via the properties in job options

making use of framework general services JobOptions Service, Message Service, Particle Properties Service,

Event Data Service, Histogram Service, Random Number Generator, …

LHCb common software LHCb Event model, Detector Description, Magnetic Field Service, …

dedicated simulation software based on external libraries Generator algorithms and tools (Pythia, EvtGen, …), GiGa (Geant4

Service)

Page 5: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 5

Gauss project and application

Gauss Project Contains packages for the Generator phase based on external

libraries available from the Physics community Pythia, EvtGen, HepMC, Herwig …

Special interface libraries GENSER (LCG Generator Services): collection of many event

Generator libraries Interface Service to Geant4 – GiGa Packages with LHCb detectors simulation code based on GiGa Is based on the LHCb Project and the Gaudi Project

Sim/Gauss application Job options configuring the application A special main Gaudi application code necessary for Geant4

In this course we will use Gauss v25r12 [v30r3]

Page 6: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 6

Gauss information

Application coordinator – Gloria Corti for maintenance and general development Patrick Robbe, responsible for overall Event Generators and

EvtGen detectors responsible for specific simulations (e.g. RICH

Cerenkov, Energy deposition in Calorimeters) and validation

Gauss documentation Web page (LHCb Home → Computing → Gauss) includes link to Gauss User Guide… but for v18r3 (many

things are out of date) mailing list: [email protected]

Changes in between versions Refer to release notes and Job Options in specific versions Use latest DC06 released version (or development…)

Page 7: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 7

Structure of Gauss application

Event Generationprimary event generatorspecialized decay packagepile-up generation

Detector Simulationgeometry of the detector (LHCb Geant4)tracking through materials (Geant4)hit creation and MC truth information (Geant4 LHCb)

Geant4

GiGa

Cn

v

Cn

v

Cnv

JobOpts

Exchange model HepMC

MCParticleMCVertex

MCHits

POOL

LHCb Event model

Geometry

HepMCPythia,EvtGen

JobOpts

Interface

…Monitor

Two INDEPENDENT phases normally run in sequence as in production

Initialize

Monitor

Initialize

Initialize

Monitor

Page 8: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 8

Job Options – vYYYYMM.opts

Geometry dependency for Detector Simulation in vYYYYMM.opts different geometry are supported – loose dependency

XmlDDDB can be chosen by production for compatible Gauss versions need to be the same as what used later by Boole and Brunel v200601.opts will be used for this course

A complete Gauss job is run with this vYYYYMM.opts files $GAUSSROOT/$CMTCONFIG/Gauss.exe $GAUSSOPTS/v200601.opts

//--------------------------------------------------------------------------// Execute a standard production Gauss job//--------------------------------------------------------------------------#include "$GAUSSOPTS/Gauss.opts“

//--------------------------------------------------------------------------// Geometry database dependent options//--------------------------------------------------------------------------#include "$STDOPTS/DC06Conditions.opts"; [#include “$DDDBROOT/options/DC06.opts” for v30r3]

Page 9: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 9

Job Options – Gauss.opts

#include "$GAUSSOPTS/Common.opts" // Necessary for any Gauss executable//---------------------------------------------------------------------------// Phases to be executed: comment unwanted phases// i.e. Simulation if running generator in stand-alone// in which case comment also Simulation.opts below//---------------------------------------------------------------------------ApplicationMgr.TopAlg += { "GaudiSequencer/Generator" };ApplicationMgr.TopAlg += { "GaudiSequencer/Simulation" };//---------------------------------------------------------------------------// Initialization//---------------------------------------------------------------------------Generator.Members = { "GenInit/GaussGen" };Simulation.Members = { "SimInit/GaussSim" };. . .//---------------------------------------------------------------------------// Generator Phase//---------------------------------------------------------------------------#include "$GAUSSOPTS/Generator.opts"Generator.MeasureTime = true;//---------------------------------------------------------------------------// Simulation Phase//---------------------------------------------------------------------------#include "$GAUSSOPTS/Simulation.opts" Simulation.MeasureTime = true;

The file users edit more often

Comments (C++ style) to help modifying it

Configuration of algorithms to run and in which order is in Gauss.opts

Page 10: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 10

Gauss phases

The Generator and Simulation phases are instances of the class GaudiSequencer providing sequences of Algorithms

Itself an Algorithm Can be configured in OR or AND mode (AND is default)

Detailed timing information

ApplicationMgr.TopAlg += { "GaudiSequencer/Generator" };ApplicationMgr.TopAlg += { "GaudiSequencer/Simulation" };... Generator.MeasureTime = true;Simulation.MeasureTime = true;...Simulation.Members = { "SimInit/GaussSim" };Simulation.Members += { …, "GiGaCheckEventStatus" };Simulation.Members += { "G4HepMCToMCTruth" };

ORSequence.ModeOR = true;

Executed only if G4 event is checked as OK

Page 11: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 11

Phase structure

Generator and Simulation sequence for each event have its own

Initialization – each initializing random numbers and filling their own header

Event processing – generating pp collision and decay and transporting through detector

Monitor – printing information and filling histograms

ApplicationMgr.TopAlg += { "GaudiSequencer/Generator" };ApplicationMgr.TopAlg += { "GaudiSequencer/Simulation" };... Generator.Members = { "GenInit/GaussGen" };#include "$GAUSSOPTS/Generator.opts“

Generator.Members += { "GaudiSequencer/GenMonitor" };

Generator.Members += { "Generation" };

Page 12: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 12

Output event data file

Event data objects written in a file in POOL format by Gaudi OutStream

Contents can be found in file $STDOPTS/SimContents.opts included from GaussTape.opts

ApplicationMgr.OutStream += { "GaussTape" };GaussTape.Output = "DATAFILE='PFN:Gauss.sim

TYP='POOL_ROOTTREE' OPT='RECREATE'";PoolDbCacheSvc.Catalog = { "xmlcatalog_file:NewCatalog.xml" };

// GeneralGaussTape.ItemList = { "/Event#1“ };// Generator outputGaussTape.ItemList += { "/Event/Gen#1“ ,"/Event/Gen/Header#1" ,"/Event/Gen/Collisions#1“

,"/Event/Gen/HepMCEvents#1“ };// Simulation outputGaussTape.ItemList += { "/Event/MC#1“ ,"/Event/MC/Header#1"

,"/Event/MC/Particles#1“ ,"/Event/MC/Vertices#1" ,"/Event/MC/Velo#1“ ,"/Event/MC/Velo/Hits#1“

, ... };

Page 13: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 13

Monitors

Necessary to monitor generator and simulation outputs

Verify productions and remote installations Reference quantities to evaluate changes when using a new

version of a generator library or of Geant4 Reference quantities to compare different generators Understand what is happening

Print out exist for Generator and Simulation The efficiencies of the generator level cuts are computed

automatically for each job Algorithm exist to Dump Generator and Simulation

event Example in Monitor.opts

Some histograms are available in Monitor.opts Some ntuples are available in MonitorInDetail.opts

with Generator particles and vertices and MCTruth particles

Page 14: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 14

Visualize histograms and ntuples

Histograms and ntuples are saved in ROOT persistency (HBOOK available in Gaudi but not supported)

Use ROOT to visualize them Look at web site: http://root.cern.ch

HistogramPersistencySvc.OutputFile = "GaussHistos.root"; NTupleSvc.Output={"FILE1 DATAFILE='GaussMonitor.root' TYP='ROOT' OPT='NEW'"};

Gauss.opts

Page 15: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 15

Reading Gauss data

You may want to read the .sim files produced to look at data without generating them again

A skeleton GaussRead.opts is provided

//---------------------------------------------------------------------------// Phases to be executed: initialization + monitor//---------------------------------------------------------------------------ApplicationMgr.TopAlg = { "GaudiSequencer/Initialize" };ApplicationMgr.TopAlg += { "GaudiSequencer/Monitor" }; //---------------------------------------------------------------------------// Initialize the application//---------------------------------------------------------------------------Initialize.Members = { "LbAppInit/GaussRead" };//---------------------------------------------------------------------------// Monitor phase: as in production + user monitor// two separate phase for Generator and Simulation// can be commented separately//---------------------------------------------------------------------------Monitor.Members += { "GaudiSequencer/GenMonitor" };Monitor.Members += { "GaudiSequencer/SimMonitor" }; Monitor.Members += { "GaudiSequencer/UserMonitor" };

Additional user monitor set up

Page 16: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 16

Simple generator/simulation level analysis

If available software does not provide necessary info can write a simple analysis to execute when producing or when reading the events

Write a Gaudi concrete Algorithm It is called once per physics event Implements three methods in addition to the constructor and

destructor initialize(), execute(), finalize()

Three Gaudi algorithms can be useful GaudiAlg GaudiHistoAlg inheriting from GaudiAlg GaudiTupleAlg inheriting from GaudiHistoAlg Note: DVAlgorithm inherit from GaudiTupleAlg

provide methods for easier printing, retrieving data, histogramming, getting services,…

use emacs to start from skeleton

Page 17: Gauss in General

Software Tutorial - Gauss - Last update: 10 October 2007

Gauss in General - Page 17

Exercises

You will get familiar with running Gauss and reading a simulation file

Guidelines for the exercises on the web from the tutorial agenda

Packages used: Sim/Gauss v25r12 – Mandatory Tutorial/Simulation v2r0 – Optional

exercises/README.txt + exerciseN.txt solutions/exerciseN/