06.09.2015 Views

LHCb applications

data - CERN

data - CERN

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Overview of Gaudi and of<br />

<strong>LHCb</strong> <strong>applications</strong><br />

<strong>LHCb</strong> Simulation Tutorial<br />

CERN, 21 st -22 nd February 2012<br />

011010011101<br />

10101000101<br />

01010110100 <br />

B00le <br />

1


Simulation Tutorial - Feb. 2012<br />

2<br />

<strong>LHCb</strong> software Organization<br />

Applications built on top of<br />

frameworks and implementing the<br />

required algorithms.<br />

One framework for basic services<br />

+ various specialized frameworks:<br />

detector description,<br />

visualization, persistency,<br />

interactivity, simulation, etc.<br />

High level triggers<br />

Reconstruction<br />

Simulation<br />

Frameworks<br />

Toolkits<br />

Analysis<br />

A series of widely used basic<br />

libraries: Boost, GSL, Root etc.<br />

Foundation Libraries


Simulation Tutorial - Feb. 2012<br />

3<br />

<strong>LHCb</strong> <strong>applications</strong><br />

Event Model / Detector Description / Conditions<br />

MicroDST<br />

GenParticles<br />

Raw Data<br />

Simul.<br />

Gauss<br />

Digit.<br />

Boole<br />

HLT<br />

Moore<br />

Reco.<br />

Brunel<br />

Stripping<br />

DaVinci<br />

Analysis<br />

DaVinci<br />

Analysis<br />

Bender<br />

MCParticles<br />

MCHits<br />

DST<br />

Ev.Disp.<br />

Panoramix<br />

Gaudi


Simulation Tutorial - Feb. 2012<br />

4<br />

Gaudi Framework<br />

! GAUDI is an architecture and framework for eventprocessing<br />

<strong>applications</strong> (simulation, reconstruction, etc.)<br />

! Initially developed for <strong>LHCb</strong>, it has been adopted and extended by<br />

ATLAS and adopted by several other experiments including Fermi<br />

Space Telescope, HARP, Minerva, Daya Bay<br />

! Main Design Choices best illustrated by looking at the<br />

Gaudi Object diagram<br />

! A snapshot of the components in memory, once the job is initialized<br />

and running


Simulation Tutorial - Feb. 2012<br />

5<br />

Gaudi Object Diagram<br />

Application<br />

Manager<br />

Event<br />

Selector<br />

Converter<br />

Converter<br />

Converter<br />

Message<br />

Service<br />

JobOptions<br />

Service<br />

Particle Prop.<br />

Service<br />

Algorithm<br />

Algorithm<br />

Event Data<br />

Service<br />

Detec. Data<br />

Service<br />

Transient<br />

Event<br />

Store<br />

Transient<br />

Detector<br />

Store<br />

Persistency<br />

Service<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Data<br />

Files<br />

Other<br />

Services<br />

Histogram<br />

Service<br />

Transient<br />

Histogram<br />

Store<br />

Persistency<br />

Service<br />

Data<br />

Files


Simulation Tutorial - Feb. 2012<br />

6<br />

Separation between “data” and “algorithms”<br />

Application<br />

Manager<br />

Event<br />

Selector<br />

Converter<br />

Converter<br />

Converter<br />

Message<br />

Service<br />

JobOptions<br />

Service<br />

Particle Prop.<br />

Service<br />

Algorithm<br />

Algorithm<br />

Event Data<br />

Service<br />

Detec. Data<br />

Service<br />

Transient<br />

Event<br />

Store<br />

Transient<br />

Detector<br />

Store<br />

Persistency<br />

Service<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Data<br />

Files<br />

Other<br />

Services<br />

Histogram<br />

Service<br />

Transient<br />

Histogram<br />

Store<br />

Persistency<br />

Service<br />

Data<br />

Files


Simulation Tutorial - Feb. 2012<br />

7<br />

Three basic categories of data<br />

characterized by their “lifetime” in the job<br />

Application<br />

Manager<br />

Event<br />

Selector<br />

Converter<br />

Converter<br />

Converter<br />

Message<br />

Service<br />

JobOptions<br />

Service<br />

Particle Prop.<br />

Service<br />

Algorithm<br />

Algorithm<br />

Event Data<br />

Service<br />

Detec. Data<br />

Service<br />

Transient<br />

Event<br />

Store<br />

Transient<br />

Detector<br />

Store<br />

Persistency<br />

Service<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Data<br />

Files<br />

Other<br />

Services<br />

Histogram<br />

Service<br />

Transient<br />

Histogram<br />

Store<br />

Persistency<br />

Service<br />

Data<br />

Files


Simulation Tutorial - Feb. 2012<br />

8<br />

Separation between “transient” and “persistent”<br />

representations of the data<br />

Application<br />

Manager<br />

Event<br />

Selector<br />

Converter<br />

Converter<br />

Converter<br />

Message<br />

Service<br />

JobOptions<br />

Service<br />

Particle Prop.<br />

Service<br />

Algorithm<br />

Algorithm<br />

Event Data<br />

Service<br />

Detec. Data<br />

Service<br />

Transient<br />

Event<br />

Store<br />

Transient<br />

Detector<br />

Store<br />

Persistency<br />

Service<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Data<br />

Files<br />

Other<br />

Services<br />

Histogram<br />

Service<br />

Transient<br />

Histogram<br />

Store<br />

Persistency<br />

Service<br />

Data<br />

Files


Simulation Tutorial - Feb. 2012<br />

Data store-centered (“whiteboard”) architectural<br />

style<br />

9<br />

Application<br />

Manager<br />

Event<br />

Selector<br />

Converter<br />

Converter<br />

Converter<br />

Message<br />

Service<br />

JobOptions<br />

Service<br />

Particle Prop.<br />

Service<br />

Algorithm<br />

Algorithm<br />

Event Data<br />

Service<br />

Detec. Data<br />

Service<br />

Transient<br />

Event<br />

Store<br />

Transient<br />

Detector<br />

Store<br />

Persistency<br />

Service<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Data<br />

Files<br />

Other<br />

Services<br />

Histogram<br />

Service<br />

Transient<br />

Histogram<br />

Store<br />

Persistency<br />

Service<br />

Data<br />

Files


Simulation Tutorial - Feb. 2012<br />

10<br />

“User code” (Algorithms, Tools) encapsulated in few specific<br />

places, callable and controllable from within the framework<br />

Application<br />

Manager<br />

Event<br />

Selector<br />

Converter<br />

Converter<br />

Converter<br />

Message<br />

Service<br />

JobOptions<br />

Service<br />

Particle Prop.<br />

Service<br />

Algorithm<br />

Algorithm<br />

Event Data<br />

Service<br />

Detec. Data<br />

Service<br />

Transient<br />

Event<br />

Store<br />

Transient<br />

Detector<br />

Store<br />

Persistency<br />

Service<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Data<br />

Files<br />

Other<br />

Services<br />

Histogram<br />

Service<br />

Transient<br />

Histogram<br />

Store<br />

Persistency<br />

Service<br />

Data<br />

Files


Simulation Tutorial - Feb. 2012<br />

11<br />

“User code” (Algorithms, Tools) encapsulated in few specific<br />

places, callable and controllable from within the framework<br />

Application<br />

Manager<br />

Event<br />

Selector<br />

Converter<br />

Converter<br />

Converter<br />

Message<br />

Service<br />

JobOptions<br />

Service<br />

Particle Prop.<br />

Service<br />

Gauss<br />

Event Generation<br />

Algorithms & Tools<br />

Detector Simulation<br />

Algorithms & Tools<br />

Event Data<br />

Service<br />

Detec. Data<br />

Service<br />

Transient<br />

Event<br />

Store<br />

Transient<br />

Detector<br />

Store<br />

Persistency<br />

Service<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Data<br />

Files<br />

Other<br />

Services<br />

software<br />

Simulation dedicated<br />

Geant4 Service (GiGa)<br />

Histogram<br />

Service<br />

Transient<br />

Histogram<br />

Store<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Generator Libraries


Simulation Tutorial - Feb. 2012<br />

12<br />

Well defined component “interfaces”<br />

Application<br />

Manager<br />

Event<br />

Selector<br />

Converter<br />

Converter<br />

Converter<br />

Message<br />

Service<br />

JobOptions<br />

Service<br />

Particle Prop.<br />

Service<br />

Algorithm<br />

Algorithm<br />

Event Data<br />

Service<br />

Detec. Data<br />

Service<br />

Transient<br />

Event<br />

Store<br />

Transient<br />

Detector<br />

Store<br />

Persistency<br />

Service<br />

Persistency<br />

Service<br />

Data<br />

Files<br />

Data<br />

Files<br />

Other<br />

Services<br />

Histogram<br />

Service<br />

Transient<br />

Histogram<br />

Store<br />

Persistency<br />

Service<br />

Data<br />

Files


Simulation Tutorial - Feb. 2012<br />

13<br />

Gaudi Interface model<br />

ApplicationMgr<br />

ISvcLocator<br />

EventDataSvc<br />

DetectorDataSvc<br />

HistogramSvc<br />

IDataProviderSvc<br />

IDataProviderSvc<br />

IHistogramSvc<br />

IAlgorithm IProperty<br />

Concrete<br />

Algorithm<br />

MessageSvc<br />

IMessageSvc<br />

Obj_A<br />

Obj_B<br />

ToolSvc<br />

IToolSvc


Simulation Tutorial - Feb. 2012<br />

14<br />

Laptop Interface Model<br />

IWiFiPort<br />

IDVIConnector<br />

IVGAConnector<br />

IKeyboard<br />

IUSBConnector<br />

• Each interface is specialized in a<br />

domain.<br />

• Interfaces are independent of<br />

concrete implementations.<br />

• You can mix devices from several<br />

constructors.<br />

• Application built by composing.<br />

• Standardizing on the interfaces<br />

gives us big leverage.


Simulation Tutorial - Feb. 2012<br />

15<br />

Electrical plug interface model<br />

Don’t define too many interfaces for the same job!


Simulation Tutorial - Feb. 2012<br />

16<br />

IMyInterface.h<br />

Interfaces in Practice<br />

class IMyInterface: virtual public IAlgTool {<br />

virtual double doSomething( int a, double b ) = 0;<br />

}<br />

MyDoSomethingTool.h<br />

#include “IMyInterface.h”<br />

class MyDoSomethingTool : public GaudiTool,<br />

virtual public IMyInterface {<br />

inline double doSomething( int a, double b )<br />

{ return b * (double)a; }<br />

}


Simulation Tutorial - Feb. 2012<br />

17<br />

ClientAlgorithm.cpp<br />

#include “IMyInterface.h”<br />

ClientAlgorithm::myMethod() {<br />

// Declare the interface<br />

IMyInterface* myInterface;<br />

// Get the interface from somewhere<br />

myInterface = tool(“MyDoSomethingTool”);<br />

// Use the interface<br />

double result = myInterface->doSomething( 10, 100.5);<br />

}


Simulation Tutorial - Feb. 2012<br />

18<br />

Algorithm & Transient Store<br />

Data T1<br />

Data T1<br />

Data T2, T3<br />

Algorithm<br />

A<br />

Transient Event<br />

Data Store<br />

Data T2<br />

Data T4<br />

Algorithm<br />

B<br />

Data T3, T4<br />

Data T5<br />

Algorithm<br />

C<br />

Apparent dataflow<br />

Real dataflow<br />

Data T5


Simulation Tutorial - Feb. 2012<br />

19<br />

Tools and Services<br />

<br />

<br />

<br />

Algorithms have some limitations<br />

<br />

Only called once per event, only share data via TES<br />

What about private data?<br />

Tools are components providing algorithmic functionality<br />

<br />

<br />

<br />

Callable many times per event, through specific interface and with arguments<br />

IBdlTool, IDistanceCalculator, IHltSummaryTool, IMassVertexFit,<br />

IProtoParticleFilter, ISTReadoutTool, ITrackFitter….<br />

Can be private: owned and accessible only by the component creating it<br />

Or public: owned by the framework and accessible globally<br />

Services:<br />

<br />

Similar to public tools, created by framework to provide global functionality<br />

Job Options Service, Message Service, Particle Properties Service, Event Data<br />

Service, Histogram Service, Ntuple Service, Detector Data Service, Magnetic<br />

Field Service, Random Number Service, Persistency Services…


Simulation Tutorial - Feb. 2012<br />

20<br />

Persistent datasets<br />

! A special algorithm (“OutputStream”) runs at the end of<br />

each event to select transient event data to be written to<br />

the persistent output file<br />

! Defines content of output file<br />

! Configured by “Configurables” in GaudiConf package<br />

<br />

SimConf.py, DigiConf.py, DstConf.py<br />

! Called by main application Configurable<br />

<br />

Gauss(), Boole(), Brunel(), DaVinci()<br />

! Several pre-defined contents are available:<br />

gen: Gauss().Phases = [“Generator”]<br />

xgen: Gauss().Phases = [“Generator”, “GenToMCTree”]<br />

sim: Gauss default<br />

digi Boole default<br />

xdigi Boole().DigiType = “Extended”<br />

dst Brunel default<br />

xdst Brunel().OutputType = “XDST” (needs xdigi as input)<br />

(sdst) Brunel().OutputType = “SDST” (only for real data production)<br />

(mdst) Stripping output, several streams defined, only real data


Simulation Tutorial - Feb. 2012<br />

21<br />

! gen<br />

! Generator files: Files with only the /Event/Gen tree, hence only generator information and the HepMC<br />

record. The complete hard interaction is available.<br />

! xgen<br />

! Extended generator files: Files with the /Event/MC/MCParticles and /Event/MC/MCVertices tree in<br />

addition to /Event/Gen To produce these files only the generator phase of Gauss has been run, i.e. the<br />

content in the MCtruth tree is a copy of the generator information after hadronization. In other words<br />

quarks and strings do not appear in the MCParticles<br />

! sim<br />

! Simulation files: Files resulting from the detector simulation. The configuration of the detector (all, velo<br />

open, calo only, dddb tag) is specified in the SimulationConditions. The MCtruth tree is filled with the<br />

information from the generator for primary particles and with the secondaries produced in the detector<br />

trough transport. Hits for all detectors are also present (MCHits, MCRichHits, MCCaloHits) and<br />

additional simulation information as MCRichSegments. In case of simulations with spill-over the whole<br />

information is also available for the the spill-over slots. The full /Event/Gen is copied.<br />

! digi<br />

! Digitization files: Files containing the digitization of the simulation and the raw event as from the DAQ.<br />

They result from the Boole processing. After the Moore processing the trigger information is added. They<br />

include the MCTruth, hence the /Event/Gen and the /Event/MC/Particles and Vertices.<br />

! xdigi<br />

! Extended digitization files: Files with the whole content of both sim and digi processing.<br />

! dst<br />

! Dst files: Files resulting from the reconstruction of MC samples or real data. They include the RawEvent<br />

and the full reconstruction output. For MC they also include the MC truth, hence the /Event/Gen and<br />

the /Event/MC/Particles and Vertices. After stripping, also include particles forming signals selected by<br />

the lines that have fired<br />

! xdst<br />

! Extended dst files: Files with the whole content of sim, digi and dst (simulated data only)<br />

! sdst<br />

! dst files for input to real data stripping: reconstruction output only, no MC truth, no RawEvent<br />

! mdst<br />

! MicroDST files: the smallest format containing reconstruction information of only particles forming signal<br />

selected by the stripping lines that have fired. MC truth not implemented

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!