220 likes | 402 Views
Overview of Gaudi and of LHCb applications. LHCb software Organization. Applications built on top of frameworks and implementing the required algorithms. Reconstruction. Simulation. High level triggers. Analysis. One framework for basic services + various specialized frameworks:
E N D
LHCb software Organization Applications built on top of frameworks and implementing the required algorithms. Reconstruction Simulation High level triggers Analysis • One framework for basic services • + various specialized frameworks: • detector description, visualization, persistency, interactivity, simulation, etc. Frameworks Toolkits A series of widely used basic libraries: Boost, GSL, Root etc. Foundation Libraries
LHCb applications Event Model / Detector Description / Conditions MCHits Gaudi MicroDST DST Raw Data GenParticles Stripping DaVinci Analysis DaVinci Simul. Gauss Analysis Bender Digit. Boole HLT Moore Reco. Brunel Ev.Disp. Panoramix MCParticles
GAUDI is an architecture and framework for event-processing applications (simulation, reconstruction, etc.) • Initially developed for LHCb, it has been adopted and extended by ATLAS and adopted by several other experiments including Fermi Space Telescope, HARP, Minerva, Daya Bay • Main Design Choices best illustrated by looking at the Gaudi Object diagram • A snapshot of the components in memory, once the job is initialized and running Gaudi Framework
Gaudi Object Diagram Converter Converter Application Manager Converter Event Selector Data Files Message Service Persistency Service Event Data Service Transient Event Store 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
Separation between “data” and “algorithms” Converter Converter Application Manager Converter Event Selector Data Files Message Service Persistency Service Event Data Service Transient Event Store 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
Three basic categories of datacharacterized by their “lifetime” in the job Converter Converter Application Manager Converter Event Selector Data Files Message Service Persistency Service Event Data Service Transient Event Store 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
Separation between “transient” and “persistent” representations of the data Converter Converter Application Manager Converter Event Selector Data Files Message Service Persistency Service Event Data Service Transient Event Store 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
Data store-centered (“whiteboard”) architectural style Converter Converter Application Manager Converter Event Selector Data Files Message Service Persistency Service Event Data Service Transient Event Store 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
“User code” (Algorithms, Tools) encapsulated in few specific places, callable and controllable from within the framework Converter Converter Application Manager Converter Event Selector Data Files Message Service Persistency Service Event Data Service Transient Event Store 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
“User code” (Algorithms, Tools) encapsulated in few specific places, callable and controllable from within the framework Converter Converter Application Manager Converter Event Selector Data Files Message Service Persistency Service Event Data Service Transient Event Store JobOptions Service Gauss Event Generation Algorithms & Tools Data Files Transient Detector Store Particle Prop. Service Persistency Service Detector Simulation Algorithms & Tools Detec. Data Service Simulation dedicated software Other Services Data Files Transient Histogram Store Persistency Service Histogram Service Geant4 Service (GiGa) Generator Libraries
Well defined component “interfaces” Converter Converter Application Manager Converter Event Selector Data Files Message Service Persistency Service Event Data Service Transient Event Store 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
Gaudi Interface model ISvcLocator ApplicationMgr IDataProviderSvc IProperty IAlgorithm EventDataSvc Concrete Algorithm IDataProviderSvc DetectorDataSvc IHistogramSvc HistogramSvc Obj_A Obj_B MessageSvc IMessageSvc ToolSvc IToolSvc
Laptop Interface Model IDVIConnector IWiFiPort IVGAConnector • Each interface is specialized in a domain. • Interfaces are independent of concrete implementations. • You can mix devices from several constructors. • Application built by composing. • Standardizing on the interfaces gives us big leverage. IKeyboard IUSBConnector
Electrical plug interface model Don’t define too many interfaces for the same job!
Interfaces in Practice IMyInterface.h class IMyInterface: virtual public IAlgTool { virtual double doSomething( int a, double b ) = 0; } MyDoSomethingTool.h #include “IMyInterface.h” class MyDoSomethingTool : public GaudiTool, virtual public IMyInterface { inline double doSomething( int a, double b ) { return b * (double)a; } }
ClientAlgorithm.cpp #include “IMyInterface.h” ClientAlgorithm::myMethod() { // Declare the interface IMyInterface* myInterface; // Get the interface from somewhere myInterface = tool<IMyInterface>(“MyDoSomethingTool”); // Use the interface double result = myInterface->doSomething( 10, 100.5); }
Algorithm & Transient Store Data T1 Data T1 Transient Event Data Store Data T1 Algorithm A Data T2, T3 Data T2 Algorithm B Data T4 Data T3, T4 Algorithm C Apparent dataflow Data T5 Real dataflow Data T5
Tools and Services • Algorithms have some limitations • Only called once per event, only share data via TES • What about private data? • Tools are components providing algorithmic functionality • Callable many times per event, through specific interface and with arguments • IBdlTool, IDistanceCalculator, IHltSummaryTool, IMassVertexFit, IProtoParticleFilter, ISTReadoutTool, ITrackFitter…. • Can be private: owned and accessible only by the component creating it • Or public: owned by the framework and accessible globally • Services: • Similar to public tools, created by framework to provide global functionality • Job Options Service, Message Service, Particle Properties Service, Event Data Service, Histogram Service, Ntuple Service, Detector Data Service, Magnetic Field Service, Random Number Service, Persistency Services…
A special algorithm (“OutputStream”) runs at the end of each event to select transient event data to be written to the persistent output file • Defines content of output file • Configured by “Configurables” in GaudiConf package • SimConf.py, DigiConf.py, DstConf.py • Called by main application Configurable • Gauss(), Boole(), Brunel(), DaVinci() • Several pre-defined contents are available: • gen: Gauss().Phases = [“Generator”] • xgen: Gauss().Phases = [“Generator”, “GenToMCTree”] • sim: Gauss default • digi Boole default • xdigiBoole().DigiType = “Extended” • dst Brunel default • xdstBrunel().OutputType = “XDST” (needs xdigi as input) • (sdst) Brunel().OutputType = “SDST” (only for real data production) • (mdst) Stripping output, several streams defined, only real data Persistent datasets
gen • Generator files: Files with only the /Event/Gen tree, hence only generator information and the HepMC record. The complete hard interaction is available. • xgen • Extended generator files: Files with the /Event/MC/MCParticles and /Event/MC/MCVertices tree in addition to /Event/Gen To produce these files only the generator phase of Gauss has been run, i.e. the content in the MCtruth tree is a copy of the generator information after hadronization. In other words quarks and strings do not appear in the MCParticles • sim • Simulation files: Files resulting from the detector simulation. The configuration of the detector (all, velo open, calo only, dddb tag) is specified in the SimulationConditions. The MCtruth tree is filled with the information from the generator for primary particles and with the secondaries produced in the detector trough transport. Hits for all detectors are also present (MCHits, MCRichHits, MCCaloHits) and additional simulation information as MCRichSegments. In case of simulations with spill-over the whole information is also available for the the spill-over slots. The full /Event/Gen is copied. • digi • Digitization files: Files containing the digitization of the simulation and the raw event as from the DAQ. They result from the Boole processing. After the Moore processing the trigger information is added. They include the MCTruth, hence the /Event/Gen and the /Event/MC/Particles and Vertices. • xdigi • Extended digitization files: Files with the whole content of both sim and digi processing. • dst • Dst files: Files resulting from the reconstruction of MC samples or real data. They include the RawEvent and the full reconstruction output. For MC they also include the MC truth, hence the /Event/Gen and the /Event/MC/Particles and Vertices. After stripping, also include particles forming signals selected by the lines that have fired • xdst • Extended dst files: Files with the whole content of sim, digi and dst (simulated data only) • sdst • dst files for input to real data stripping: reconstruction output only, no MC truth, no RawEvent • mdst • MicroDST files: the smallest format containing reconstruction information of only particles forming signal selected by the stripping lines that have fired. MC truth not implemented
Gaudi Web site • http://cern.ch/proj-gaudi/ • Includes Gaudi User Guide: old and unmaintained, but still useful as a reference • FAQ: Mixture of Gaudi and LHCb specific topics • https://twiki.cern.ch/twiki/bin/view/LHCb/FAQ/LHCbFAQ • C++ Documentation (generated from code) • Doxygen: • Uses special comments in code • http://cern.ch/LHCb-release-area/DOC/lhcb/releases/latest/doxygen/index.html • Lbglimpse: indexed search within released code • Lbglimpse <search string> <Project> <version> • LbglimpseIJobOptionsSvc Gauss v41r2 • Self help mailing lists: • lhcb-soft-talk@cern.ch, gaudi-talk@lists.bnl.gov • Application mailing lists • lhcb-gauss@cern.ch, lhcb-reconstruction@cern.ch, lhcb-davinci@cern.ch, etc. • Application DOC pages • http://cern.ch/LHCb-release-area/DOC/gauss/, http://cern.ch/LHCb-release-area/DOC/boole/, etc. Documentation