1 / 17

Gauss in General

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

raya-chaney
Télécharger la présentation

Gauss in General

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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

  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

  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)

  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]

  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: lhcb-gauss@cern.ch • Changes in between versions • Refer to release notes and Job Options in specific versions • Use latest DC06 released version (or development…)

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

  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]

  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

  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

  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" };

  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“ , ... };

  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

  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

  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

  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

  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/

More Related