• No results found

LHCb Software Strategy

N/A
N/A
Protected

Academic year: 2022

Share "LHCb Software Strategy"

Copied!
25
0
0

Loading.... (view fulltext now)

Full text

(1)

2 2

Introduction to Gaudi Introduction to Gaudi

CERN Tutorial, October 2009

(2)

LHCb Software Strategy

Develop an Architecture (‘blueprint’) and a Framework (real code) to be used at all

stages of LHCb data processing

HLT, simulation, reconstruction, analysis Avoid fragmentation and duplication of

Avoid fragmentation and duplication of computing efforts

Transparent use of third-party components wherever possible

Applications are developed by customizing

the Framework

(3)

What is a Framework?

What is a Framework?

Framework Definition [1,2]

An architectural pattern that codifies a

particular domain. It provides the suitable

knobs, slots and tabs that permit clients to use and adapt to specific applications within a

Framework Definition [1,2]

An architectural pattern that codifies a

particular domain. It provides the suitable

knobs, slots and tabs that permit clients to use and adapt to specific applications within a

2-3 CERN Tutorial, October 2009

and adapt to specific applications within a given range of behavior.

In practice

A skeleton of an application into which

developers plug in their code and provides most of the common functionality .

and adapt to specific applications within a given range of behavior.

In practice

A skeleton of an application into which

developers plug in their code and provides most of the common functionality .

[1] G. Booch, “Object Solutions”, Addison-Wesley 1996

[2] E. Gamma, et al., “Design Patterns”, Addison-Wesley 1995

(4)

Framework Benefits Framework Benefits

Common vocabulary, better

specifications of what needs to be done, better understanding of the system.

Low coupling between concurrent developments. Smooth integration.

Common vocabulary, better

specifications of what needs to be done, better understanding of the system.

Low coupling between concurrent developments. Smooth integration.

developments. Smooth integration.

Organization of the development.

Robustness, resilient to change (change-tolerant).

Fostering code re-use

developments. Smooth integration.

Organization of the development.

Robustness, resilient to change (change-tolerant).

Fostering code re-use

(5)

Software Organization

R e co ns tr uc ti on Si m ul at io n A na lys is

H ig h l e ve l tr ig ge rs

One framework for basic services Applications built on top of

frameworks and implementing the required algorithms.

2-5 CERN Tutorial, October 2009

Frameworks Toolkits

Foundation Libraries

H ig h l e ve l tr ig ge rs

One framework for basic services + various specialized frameworks:

detector description, visualization, persistency, interactivity, simulation, etc.

A series of widely used basic libraries: Boost, GSL, Root etc.

(6)

Gaudi Architecture

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

(7)

Gaudi Object Diagram

Converter

Event Data Service

Persistency

Service Data Files

Algorithm Message

Service JobOptions

Service

Application

Manager Event ConverterConverter

Selector

Transient Event Store

2-7 CERN Tutorial, October 2009

Algorithm Algorithm Algorithm

Detec. Data Service

Persistency

Service Data Files Transient

Detector Store JobOptions

Service Particle Prop.

Service Other

Services Histogram

Service

Persistency

Service Data Files Transient

Histogram Store Store

(8)

Separation between “data” and “algorithms”

Converter

Event Data Service

Persistency

Service Data Files

Algorithm Message

Service JobOptions

Service

Application

Manager Event ConverterConverter

Selector

Transient Event Store Algorithm

Algorithm Algorithm

Detec. Data Service

Persistency

Service Data Files Transient

Detector Store JobOptions

Service Particle Prop.

Service Other

Services Histogram

Service

Persistency

Service Data Files Transient

Histogram Store Store

(9)

Three basic categories of data

characterized by their “lifetime” in the job

Converter

Event Data Service

Persistency

Service Data Files

Algorithm Message

Service JobOptions

Service

Application

Manager Event ConverterConverter

Selector

Transient Event Event Event Event

Store

2-9 CERN Tutorial, October 2009

Algorithm Algorithm Algorithm

Detec. Data Service

Persistency

Service Data Files Transient

Detector Store JobOptions

Service Particle Prop.

Service Other

Services Histogram

Service

Persistency

Service Data Files Transient

Histogram Store Store

(10)

Separation between “transient” and “persistent”

representations of the data

Converter

Event Data Service

Persistency

Service Data Files

Algorithm Message

Service JobOptions

Service

Application

Manager Event ConverterConverter

Selector

Transient Event Store Algorithm

Algorithm Algorithm

Detec. Data Service

Persistency

Service Data Files Transient

Detector Store JobOptions

Service Particle Prop.

Service Other

Services Histogram

Service

Persistency

Service Data Files Transient

Histogram Store Store

(11)

Data store-centered (“blackboard”) architectural style

Converter

Event Data Service

Persistency

Service Data Files

Algorithm Message

Service JobOptions

Service

Application

Manager Event ConverterConverter

Selector

Transient Event Store

2-11 CERN Tutorial, October 2009

Algorithm Algorithm Algorithm

Detec. Data Service

Persistency

Service Data Files Transient

Detector Store JobOptions

Service Particle Prop.

Service Other

Services Histogram

Service

Persistency

Service Data Files Transient

Histogram Store Store

(12)

“User code” encapsulated in few specific places

Converter

Event Data Service

Persistency

Service Data Files

Algorithm Message

Service JobOptions

Service

Application

Manager Event ConverterConverter

Selector

Transient Event Store Algorithm

Algorithm Algorithm

Detec. Data Service

Persistency

Service Data Files Transient

Detector Store JobOptions

Service Particle Prop.

Service Other

Services Histogram

Service

Persistency

Service Data Files Transient

Histogram Store Store

(13)

Well defined component “interfaces”

Converter

Event Data Service

Persistency

Service Data Files

Algorithm Message

Service JobOptions

Service

Application

Manager Event ConverterConverter

Selector

Transient Event Store

2-13 CERN Tutorial, October 2009

Algorithm Algorithm Algorithm

Detec. Data Service

Persistency

Service Data Files Transient

Detector Store JobOptions

Service Particle Prop.

Service Other

Services Histogram

Service

Persistency

Service Data Files Transient

Histogram Store Store

(14)

Gaudi Interface model

EventDataSvc IDataProviderSvc IAlgorithm IProperty ApplicationMgr ISvcLocator

Concrete Algorithm IDataProviderSvc

IHistogramSvc

IMessageSvc Obj_B

DetectorDataSvc HistogramSvc

MessageSvc Obj_A

(15)

Laptop Interface Model

IDVIConnector IWiFiPort

• Each interface is specialized in a

IVGAConnector

2-15 CERN Tutorial, October 2009

IKeyboard

IUSBConnector

• 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.

(16)

Electrical plug interface model

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

(17)

Interfaces in Practice

class IMyInterface: virtual public IAlgTool {

virtual double doSomething( int a, double b ) = 0;

}

IMyInterface.h IMyInterface.h

#include “IMyInterface.h”

MyDoSomethingTool.h MyDoSomethingTool.h

2-17 CERN Tutorial, October 2009

#include “IMyInterface.h”

class MyDoSomethingTool : public GaudiTool,

virtual public IMyInterface { inline double doSomething( int a, double b )

{ return b * (double)a; }

}

(18)

”);

#include “IMyInterface.h”

ClientAlgorithm::myMethod() { // Declare the interface IMyInterface* myInterface;

// Get the interface from somewhere

myInterface = tool<IMyInterface>(“MyDoSomethingTool”);

ClientAlgorithm.cpp ClientAlgorithm.cpp

”);

myInterface = tool<IMyInterface>(“MyDoSomethingTool”);

// Use the interface

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

}

(19)

Gaudi Component Model

Algorithms, Converters, Services and Tools are known as Components

– Self contained objects with behaviour

– Loaded at run time from component libraries (“plugins”)

2-19 CERN Tutorial, October 2009

(“plugins”)

– Interact with the framework and with each other via Interfaces

– Behaviour controlled by Properties (“Job options”)

Properties

– Control and data parameters for Algorithms, Services

and Tools

(20)

Algorithm

Users write Concrete Algorithms

Most of the tutorial will be devoted to that

It is called once per physics event

It is called once per physics event

Implements three methods in addition to the constructor and destructor

initialize(), execute(), finalize()

(21)

Data

Data Object

– Atomic data unit (visible and managed by transient data store)

– No algorithmic code

Transient Data Store

2-21 CERN Tutorial, October 2009

Transient Data Store

– Central service and repository for data objects

– Manages data location, life cycle, load on demand, …

Data Converter

– Provides explicit/implicit conversion from/to persistent

data format to/from transient data

(22)

Algorithm & Transient Store

Algorithm A

Data T1 Data T2, T3

Data T1 Data T1

Algorithm B

Algorithm C

Transient Event Data Store

Data T2

Data T3, T4 Data T4

Data T5

Real dataflow Apparent dataflow

(23)

Services and Tools

Services

– Globally available software components providing framework functionality

• JobOptions Service, Message Service, Particle Properties Service, Event Data Service, Histogram Service, N-tuple Service, Detector Data Service, Magnetic Field Service, Random Number Service, Chrono Service, (Persistency Services), (User Interface &

Visualization Services), (Geant4 Services)

2-23 CERN Tutorial, October 2009

Visualization Services), (Geant4 Services)

Tools

– Globally or locally available components providing algorithmic functionality

– Callable many times per event, through specific interface and with arguments

• IBdlTool, IDistanceCalculator, IHltSummaryTool, IMassVertexFit, IProtoParticleFilter, ISTReadoutTool, ITrackFitter….

(24)

Gaudi Product Sheet

Current release

v21r4 (Sept 2009)

Supported Platforms

Scientific Linux (CERN) 5 & gcc 4.3

Scientific Linux (CERN) 4 & gcc 3.4

Windows XP & VisualC++ 7.1

(gcc 4.3 with OSX 10.5)

Web address.

(25)

Documentation

Gaudi User Guide

A 220 pages document targeted to end-users

FAQ: Mixture of Gaudi and LHCb specific topics

– https://twiki.cern.ch/twiki/bin/view/LHCb/FAQ/LHCbFAQ

C++ Documentation (generated from code)

Doxygen:

2-25 CERN Tutorial, October 2009

Doxygen:

– Uses special comments in code, e.g. Tutorial solutions

– http://cern.ch/proj-gaudi/releases/GAUDI/doc/html/index.html – Lbglimpse: indexed search within released code

– Lbglimpse <search string> <Project> <version>

• Lbglimpse IJobOptionsSvc Gaudi v21r4

Self help mailing lists:

[email protected], [email protected]

References

Related documents

Classifiers simply use classification results embedded by collaborators. The decision of directly using actions obviates any additional state requirements in classifiers. Lattice

This report is accessible on all Windows stations with Esko Software Suite products installed (when an active Esko Configuration Manager module is present in the network) or on

[r]

If not met the us international issue data monday in force for the whole spectrum of international states and other documents and instruments that world and instruments. Group of the

veins is, it is difficult to consider as good results a non occlusion or an incomplete occlusion of the trunk or the persistence of a leakage point, even though no recurrent

The following appeared in the annual report from the president of the National Brush Company.. &#34;In order to save money, we at the National Brush Company have decided to

Fig. 1-42 Right foot from above showing tendons. tendon is palpable and visible about one finger width lateral to the medial malleolus. It is the most prominent tendon visible

By setting clear expectations with both contract providers and Covenant Health leaders, we uphold our commitment in providing the highest quality care to the residents and patients