Object Networks: an Introduction

Use of a Generic Identification Scheme Connecting
Events and Detector Description in Atlas

Authors: C. Arnault, RD Schaffer (LAL Orsay)

The problem:

Data coming from a HEP detector requires access to “detector
description” to be used



E.g. geometry, calibration, alignment
This can be done in many ways, but ultimately this relies on a keylookup to match the readout data with its detector description data
The chosen solution:


An identification scheme which follows an hierarchical structure of
the detector
Support: id dictionary, various identifiers, and id “helpers” factories/manipulators
27 March 2003
RD Schaffer & C. Arnault CHEP03
1
A historical overview


Basic identifier classes available - 1998

Incorporation in first C++ event model

Based on expanded form of Identifier
Migration to next generation event model - 2002 today

Deployment of an Identifier dictionary

Movement to compact and hash identifiers

Use of an two-level container based on hashes
27 March 2003
RD Schaffer & C. Arnault CHEP03
2
The Identifier Specification

We have defined a tree-like identifier for all detectors:

E.g. Silicon Strip Tracker (SCT):
ID levels
Detector system
InnerDetector
Pixel
SCT
NegEndCap
disk 0
disk 1
disk 2
Barrel
layer 0
layer 1
wafer phi 0
wafer eta 0
strip 0
27 March 2003
…
…
strip N
subsystem
TRT
PosEndCap
layer 2
…
disk 0
disk 1
disk 2
wafer phi N
wafer eta N
Detector element level
radial
phi
eta
Readout channel level
RD Schaffer & C. Arnault CHEP03
3
The Identifier Specification (2)

Specification may identify different parts, depending
upon the depth


Subdetector, barrel/endcap, detector elements, readout
channels
As will be seen, this has led to a three-level model
used in different parts of the software
Subdetector
27 March 2003
1..n
Detector element
RD Schaffer & C. Arnault CHEP03
1..n
Readout channel
4
Infrastructure: Basic Model
Get id for a particular wafer
client
Initialize dictionary
wafer_id(values)
id
ID Helper
pack
id
ID Dictionary
27 March 2003
RD Schaffer & C. Arnault CHEP03
DOM Parser
parse and
build
read
XML
specification
5
Infrastructure: Identifier classes

Various identifier classes

only contain numbers - no strings

Expanded - internal representation is vector<short>

Compact - 32 bit, created by id dictionary

Hash - 32 bit, transformation of id to number 0 - N elements

27 March 2003
Allows constant-time table look-up
RD Schaffer & C. Arnault CHEP03
6
Infrastructure: Range classes

Specification “capture”

Range class

contains the allowed values at each level for a region of
identifiers



MultiRange class


Each level: min/max or enumeration (plus wild-carded min/max)
2 / -2, 2 / 1 / -6 : 6 / 0 : 55 / 0 : 767
full specification for a part of detector (vector<Range>)
Both provide


27 March 2003
iterators over ids
match(id) - id validity check
RD Schaffer & C. Arnault CHEP03
7
Infrastructure: Identifier dictionary

Features:

Defines logical hierarchy, providing a name for each level

Specifies the non-overlapping regions of valid identifier values


Primary specification is in XML files =>


E.g. each barrel layer is a different region because N changes
DOM parser builds IdDictDictionary in memory
Dictionary operations:

Can perform various queries on dictionary

Extract MultiRange object for a subset of the specification

Pack/unpack identifiers (expanded <=> compact 32 bit)
27 March 2003
RD Schaffer & C. Arnault CHEP03
8
Infrastructure: Helper classes

The client interface to the ID dictionary

Each detector system has an ID helper class

There is a common implementation base class

Create/decode compact ids

Defines which ids can be created

E.g. detector element or readout channel

Converts compact id <=> hash id

Provides iterators over all identifiers

Can provide (limited) access to neighbour identifiers

27 March 2003
Dictionary contains previous/next, min/max, wrap around
RD Schaffer & C. Arnault CHEP03
9
Infrastructure: Helper classes (2)

Part of interface of PixelID helpers
;
PixelID
Identifier wafer_id ( int barrel_ec,
int layer_disk,
int phi_module,
int eta_module ) const;
Identifier pixel_id ( const Identifier& id,
int phi_index,
int eta_index) const;
int
barrel_ec
(const Identifier& id) const;
int
layer_disk
(const Identifier& id) const;
int
phi_module
(const Identifier& id) const;
int
eta_module (const Identifier& id) const;
int
phi_index
(const Identifier& id) const;
int
eta_index
(const Identifier& id) const;
27 March 2003
RD Schaffer & C. Arnault CHEP03
10
More on compact and hash ids

Dictionary packs level values in an optimized binary
representation

Want to fit all readout channels into 32-bit id

Maintaining simple decoding of each of the different levels





I.e. simple “mask and shift” operations
Pixel readout channel id requires some special treatment (36 bits)
Use generic packing algorithm takes into account nonoverlapping sub-regions
Packed id stores indices - level values kept in dictionary
Compact id can be used as a key in a binary look-up
27 March 2003
RD Schaffer & C. Arnault CHEP03
11
More on compact and hash ids (2)

The term “hash id” is not quite exact


The dictionary “knows” the extent of values for any subset of
compact identifiers
This can be used to convert a subset into a sequence of 0 to
N-1



Binary look-up becomes constant-time look-up
Look-up table size is known and minimized
The hash id allows “pointer-like” navigation while
“decoupling” different parts of the model
27 March 2003
RD Schaffer & C. Arnault CHEP03
12
Impact of identifiers on the data model

Introduced a two-level container used for event data:
Container

Collection
1..n
detElem
Hash id
T: Digit
Readout
channel id
Currently being used in High Level Trigger studies for data
access for reconstruction within region-of-interest (ROI)

ROI from LVL1 trigger =>  => hash ids => collections to
decode from online byte-stream


1..n
Integrated in the triggering of the Athena conversion services
Used in offline reconstruction for data access within roads
27 March 2003
RD Schaffer & C. Arnault CHEP03
13
Impact of identifiers on the data model (2)

Connection to detElem transformation matrices
Detector Store
Detector Element hierarchy
1..*
AlgAlg
DetDescr
interface
IdHelper
root
1
DetDescrMgr
1
1..*
0..*
1
DetDescrElement
1..*
(position)
27 March 2003
1
parent
DetNode
children
Descriptor
1
Hash id
GeoModel node hierarchy
RD Schaffer & C. Arnault CHEP03
PhyVol
position
14
Summary



We have set up an hierarchical identification system
reflecting the structure of the detectors
Used to identify detector elements and readout
channels
The identification specification is captured in memory
in an “identifier dictionary”


Fed by an XML description
Various forms of identifiers are being used:

Compact 32-bit identifiers

Hash ids provide constant-time look-ups
27 March 2003
RD Schaffer & C. Arnault CHEP03
15
Summary (2)



Use cases for identifiers include:

The connection of event data to detector description

Access to event data within regions-of-interest
A new iteration of the definition of our event model is
being completed and incorporate for a first time
compact and hash ids
The usefulness of the identifiers will be understood
better in the coming weeks as studies are performed
for the High Level Trigger Technical Design Report
27 March 2003
RD Schaffer & C. Arnault CHEP03
16