Presentation is loading. Please wait.

Presentation is loading. Please wait.

LHCb Software Tutorial

Similar presentations


Presentation on theme: "LHCb Software Tutorial"— Presentation transcript:

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

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 Software Tutorial - Gauss - Last update: 10 October 2007

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 Software Tutorial - Gauss - Last update: 10 October 2007

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) Software Tutorial - Gauss - Last update: 10 October 2007

5 Gauss project and application
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] Software Tutorial - Gauss - Last update: 10 October 2007

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: Changes in between versions Refer to release notes and Job Options in specific versions Use latest DC06 released version (or development…) Software Tutorial - Gauss - Last update: 10 October 2007

7 Structure of Gauss application
Two INDEPENDENT phases normally run in sequence as in production Pythia, EvtGen JobOpts Interface Initialize JobOpts HepMC MCParticle MCVertex MCHits POOL LHCb Event model Exchange model GiGa Geant4 Initialize Initialize HepMC Cnv Cnv Monitor Cnv Monitor Monitor Geometry Event Generation primary event generator specialized decay package pile-up generation Detector Simulation geometry of the detector (LHCb  Geant4) tracking through materials (Geant4) hit creation and MC truth information (Geant4  LHCb) Software Tutorial - Gauss - Last update: 10 October 2007

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 v opts will be used for this course A complete Gauss job is run with this vYYYYMM.opts files $GAUSSROOT/$CMTCONFIG/Gauss.exe $GAUSSOPTS/v 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] Software Tutorial - Gauss - Last update: 10 October 2007

9 Job Options – Gauss.opts
Configuration of algorithms to run and in which order is in 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 Software Tutorial - Gauss - Last update: 10 October 2007

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 ORSequence.ModeOR = true; ApplicationMgr.TopAlg += { "GaudiSequencer/Generator" }; ApplicationMgr.TopAlg += { "GaudiSequencer/Simulation" }; ... Generator.MeasureTime = true; Simulation.MeasureTime = true; Simulation.Members = { "SimInit/GaussSim" }; Simulation.Members += { …, "GiGaCheckEventStatus" }; Simulation.Members += { "G4HepMCToMCTruth" }; Executed only if G4 event is checked as OK Software Tutorial - Gauss - Last update: 10 October 2007

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" }; Software Tutorial - Gauss - Last update: 10 October 2007

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" }; // General GaussTape.ItemList = { "/Event#1“ }; // Generator output GaussTape.ItemList += { "/Event/Gen#1“ ,"/Event/Gen/Header#1" ,"/Event/Gen/Collisions#1“ ,"/Event/Gen/HepMCEvents#1“ }; // Simulation output GaussTape.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“ , ... }; Software Tutorial - Gauss - Last update: 10 October 2007

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 Software Tutorial - Gauss - Last update: 10 October 2007

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: HistogramPersistencySvc.OutputFile = "GaussHistos.root"; NTupleSvc.Output={"FILE1 DATAFILE='GaussMonitor.root' TYP='ROOT' OPT='NEW'"}; Gauss.opts Software Tutorial - Gauss - Last update: 10 October 2007

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 Software Tutorial - Gauss - Last update: 10 October 2007

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 Algorithms Algorithms encapsulates the physics contents of the data processing program. It is the “place holder” foreseen by the framework for the end-user code. This is why most of the tutorial will be devoted to development of algorithms. Algorithms are scheduled to be executed explicitly once per physics event. If the complexity requires, the algorithm can be made as a composite of a number of sub-algorithms. The complex algorithm schedules explicitly the execution of the sub-algorithms in the proper order to produce the desired results. If an algorithm requires some data that happens to be produced by another algorithm, then the system has to ensure by explicit coding that the algorithms are executed in the correct sequence. Software Tutorial - Gauss - Last update: 10 October 2007

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/ Software Tutorial - Gauss - Last update: 10 October 2007


Download ppt "LHCb Software Tutorial"

Similar presentations


Ads by Google