Title: Get yourself ready
1Get yourself ready
- Local station (PC) login - see sticker
- ltuser-namegt trainlta-zgt
- ltpasswordgt trainlta-zgt01
- create a terminal window and issue xhost
- Do Not Do This Normally!!!! Security breach!!!!
- atlas.cern.ch login
- as per sticker on your monitor
- ssh lxplus6.cern.ch -l ltUsergt
- User atltrltxgt where ltxgt is 0- 9 and a-e
- Password
No special requirement if you have space you may
re-do the tutorial later on your account. AthASK
does not need CMT pre-configured environment
- Try getting a terminal window and emacs (or other
editor, e.g., nedit) - set DISPLAY environment variable accordingly if
that does not work
2AthenaA condensed Introduction
3Outline
- 1. Introduction (Massimo Marino - LBNL)
- 2. AthASK (Massimo Marino - LBNL)
- 3. TDS StoreGate (Paolo Calafiura - LBNL)
- 4. Reconstruction in Athena (David Rousseau - LAL)
4Aims for the Tutorial
- At the end of the day you should
- Be more familiar with terms and concepts in
Athena - Be able to understand code development of
Algorithms - Be able to write simple analysis programs
5Structure
- Presentation of concepts
- Athena
- AthASK
- StoreGate
- Hands On
- Access Atlas sw with ASK (AthASK)
- Start with an (almost) empty reconstruction
Algorithm - Work towards a fully featured application
6Introduction
7Athena as a Framework
- Framework Definition 1,2
- 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 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 communications
among different components.
1 G. Booch, Object Solutions, Addison-Wesley
1996
2 E. Gamma, et al., Design Patterns,
Addison-Wesley 1995
8Definition of Terms
- Algorithm user application building block,
visible controlled by framework. Simple or
Composite , i.e., may delegate process to
sub-Algorithms - inherits from Algorithm class
- Implements three methods for invocation by
framework - initialize(), execute(), finalize()
- Data Object generally produced/accessed by
Algorithms. Visible managed by TDS -
whiteboard/drawer concept - e.g., Collection containing Cluster Objects
- Transient Data Store(s)
- Central service and repository for data objects
(data location, life cycle, load on demand, ) - Event store, detector data store, histogram
store, ntuple store - Accessed via StoreGate
9Definition of Terms (2)
- Services
- Globally available software components providing
specific framework capabilities, e.g., Message
service, Histogram service, etc
- Data Converter
- Provides explicit/implicit conversion from/to
persistent data format to/from transient data - Decouple Algorithm code from underlying
persistency mechanism(s)
- Properties
- Control and data parameters for Algorithms and
Services. Allow for run-time configuration.
Specified via startup text files (jobOptions),
Python scripts or from the scripting language
shell
10Athena-Gaudi Object Diagram
Application Manager
Converter
Converter
Converter
Event Selector
Transient Event Store
Data Files
Persistency Service
Message Service
StoreGate Svc
Transient Detector Store
JobOptions Service
MC Event Generators
Algorithm
Algorithm
Data Files
Sequencer
Persistency Service
Particle Prop. Service
RandomGen Service
Other Services
Data Files
Transient Histogram Store
Persistency Service
Histogram Service
Auditors
Scripting Service
11Algorithm Transient Store
Simulated Data Flow
Data T1
Data T
Transient Event Data Store
Algorithm A
Data T1
Data T2, T3
Data T2
Data T3
Algorithm B
Data T2
Data T4
Data T4
Algorithm C
Data T3, T4
Apparent dataflow
Data T5
Real dataflow
Data T5
12Definition of Terms (3)
- Job Options files
- Conventional text file (default jobOptions.txt)
used to control an Athena application
configuration at run-time
- Auditors
- Monitor various aspects of other framework
components - NameAuditor, ChronoAuditor, MemoryAuditor,
MemStatAuditor, etc
- Sequences
- Lists of members Algorithms managed by a
Sequencer. - Sequences can be nested. Default behavior the
Sequencer terminates a sequence when an event
fails a filter. The StopOverride property
overrides the default behavior. - Filters
- Event selection criteria.
13Accessing Services
- Within the Algorithm services are readily
accessible. - The most common are
- msgSvc( ) or messageService( )
- histoSvc( ) or histogramDataService( )
- ntupleSvc( ) or ntupleService( )
- serviceltTgt() generalized access to Services
- serviceLocator( )
- And more
-
14Accessing Services
ISvcLocator
ApplicationMgr
IAlgorithm
IProperty
StoreGateSvc
Concrete Algorithm
IHistogramSvc
HistogramSvc
Obj_B
Obj_A
IMessageSvc
MessageSvc
ParticlePropertySvc
IParticlePropertySvc
15In Practice
IMyInterface.h
class IMyInterface void doSomething( int a,
double b ) 0
ClientAlgoritm.cpp
include IMyInterface.h ClientAlgotihmmyMetho
d() // Declare the interface IMyInterface
myinterface // Get the interface from
somewhere service(MyServiceProvider,
myinterface ) // Use the interface
myinterface-gtdoSomething( 10, 100.5)
16Printing and Job Options
17MsgStream
- Use of the MsgStream class
- Usable like standard stream
- Different levels of printing - OutputLevel
- MSGNIL (0) DEFAULT
- MSGVERBOSE (1)
- MSGDEBUG (2)
- MSGINFO (3)
- MSGWARNING (4)
- MSGERROR (5)
- MSGFATAL (6)
- MSGALWAYS (7)
- Record, not line oriented
- Allows to define the severity level per object
instance - MessageSvc.OutputLevel 3
- MyAlgorithm.OutputLevel 2
18MsgStream Example of use
- Print messages with MsgStream
- Include message stream header
- include GaudiKernel/MsgStream.h
- Create MsgStream object and print
- For example, in initialize()
- MsgStream log(msgSvc(), name())log ltlt
MSGINFO - ltlt Initializing AnalysisSkeleton
- ltlt endreq
19Athena job configuration
- Job is essentially steered by a conventional text
file or a Python script - Options properties are accessed through
framework interfaces, IJobOptionsSvc or
IScriptingSvc
20JobOptions details
- Common entries in jobOptions.txt
- Example of Standard Configuration
- include "Atlas_Gen.UnixStandardJob.txt
- include StandardAtlfastOptions.txt
- Maximum number of events to execute
- ApplicationMgr.EvtMax ltintegergt
- Component libraries to be loaded
- ApplicationMgr.DLLs ltcomma separated array
of stringgt - Top level algorithms Type/ObjectName
- ApplicationMgr.TopAlg ltcomma separated Array
of stringgt - Comments
- Preceded by //
21Histograms
22Booking 2-d Histograms
- Through the Histogram service
- IHistogram2D multiplicityVsEnergyH2D
- histoSvc()-gtbook(/stat/myhist/, 2,
- "MultiplictyvsEnergy(GeV)",
- 100,
- 0.0,
- 1000.0,
- 50,
- 0.0,
- 500.0)
23Filling Histograms
Calls similar to HBOOK HF1 HF2
24Generic Histogram Access
- Its just another data store object
- const DataHandleltIHistogram1Dgt h1d
- m_sgSvc?retrieve(h1d , /stat/my1Dhist/3)
- h1d-gtfill( value, weight)
- Or book on the fly
- IHistogram1D h1d histoSvc()-gtbook(
- /stat/my1Dhist,
- lthistgt,
- Title,
- ltbinsgt,
- ltlowegdegt,
- lthighedgegt)
25Histogram Persistency
- In jobOptions file
- Load the relevant shared library
- ApplicationMgr.DLLs HbookCnv/
RootHistCnv - Specify persistency (accordingly to shared lib)
- ApplicationMgr.HistogramPersistency
- HBOOK / ROOT / NONE (default)
- Specify name of output file, e.g.,
- HistogramPersistencyService.OutputFile
atlfast.hbook / atlfast.rt
26Ntuples
27Booking A Ntuple
Through the Ntuple service NTuplePtr nt(
ntupleSvc(), "/NTUPLES/FILE1/100) if ( !nt )
//check if already booked nt
ntupleSvc()-gtbook (
/NTUPLES/FILE1/100",
CLID_ColumnWiseTuple,
My Ntuple") if ( nt )
use it
28Define Ntuple Columns
- For column-wise, variable must first be declared
as data members of the class - Item, Array, Matrix of type bool, float, long
- NTupleItemltlonggt m_ntrk
- NTupleItemltfloatgt m_energy
- NTupleArrayltfloatgt m_mom
- NTupleTuple p_nt1
- After the Ntuple is booked
- if ( p_nt1 )
- status p_nt1-gtaddItem(Ntrack, m_ntrk,
0,5000)status p_nt1-gtaddItem(Energy,m_energy
)status p_nt1-gtaddItem(Momentum,m_ntrk,
m_mom)
29Filling Ntuples
- Items behave like a number
- Just assign values
- m_energy 50.67
- Same for arrays
- m_momi 10.25
- Write record
- status ntupleSvc()-gtwriteRecord(m_ntuple)
- if ( status.isFailure() )
- log ltlt MSGERROR ltlt "Cannot fill Ntuple" ltlt
endreq -
30Ntuple Persistency
In job options specify output files
NTupleSvc.Output FILE1
DATAFILEatlfast.ntup'
OPT'NEW' TYPHBOOK'"
Technology HBOOK
NTupleSvc.Output FILE1
DATAFILEatlfast.ntup'
OPT'NEW' TYP'ROOT'"
Technology ROOT
31Documentation
- Athena User Guide v2.0.x (et al.) - release
notes - Gaudi Developer Guide
- Both from http//atlas.web.cern.ch/Atlas/GROUPS/SO
FTWARE/OO/architecture/General/index.html - Athena Tutorials
- http//atlas.web.cern.ch/Atlas/GROUPS/SOFTWARE/OO/
architecture/General/Tutorial/ - Web video stream
- http//www.wlap.org
- AthASK
- http//wlav.home.cern.ch/wlav/athena/athask/index
.html