N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc EDM Workshop Detector Description Session.

Slides:



Advertisements
Similar presentations
Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
Advertisements

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett TruthAssociation EDM Workshop Event Data Model Session Jan
Exceptions, Templates, And The Standard Template Library (STL) Chapter 16.
Copyright © 2012 Pearson Education, Inc. Chapter 16: Exceptions, Templates, and the Standard Template Library (STL)
Information System Engineering
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Reconstruction and Analysis on Demand: A Success Story Christopher D. Jones Cornell University, USA.
ARRAYS AND POINTERS Although pointer types are not integer types, some integer arithmetic operators can be applied to pointers. The affect of this arithmetic.
Topics Covered: Data preparation Data preparation Data capturing Data capturing Data verification and validation Data verification and validation Data.
JavaScript & jQuery the missing manual Chapter 11
Pointer Data Type and Pointer Variables
Classes Representing Non-Trivial Objects. Problem Write a program that reads a temperature (either Fahrenheit or Celsius), and displays that same temperature.
June 14, 2001Exception Handling in Java1 Richard S. Huntrods June 14, 2001 University of Calgary.
Abstract Data Types (ADTs) and data structures: terminology and definitions A type is a collection of values. For example, the boolean type consists of.
1 Stacks Chapter 4 2 Introduction Consider a program to model a switching yard –Has main line and siding –Cars may be shunted, removed at any time.
1 Arrays Chapter 13 Especially read 13.1 – 13.2 Text introduces vectors, which we will not cover, in 13.3.
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Conditions DB in LHCb LCG Conditions DB Workshop 8-9 December 2003 P. Mato / CERN.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Alignment Strategy for ATLAS: Detector Description and Database Issues
Computer Programming 2 Lab(1) I.Fatimah Alzahrani.
Arrays Module 6. Objectives Nature and purpose of an array Using arrays in Java programs Methods with array parameter Methods that return an array Array.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett The Athena Control Framework in Production, New Developments and Lessons Learned.
Software Solutions for Variable ATLAS Detector Description J. Boudreau, V. Tsulaia University of Pittsburgh R. Hawkings, A. Valassi CERN A. Schaffer LAL,
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Andrew S. Budarevsky Adaptive Application Data Management Overview.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER 1 ACAT 2000, Fermilab Oct Control States... Control States for the Atlas Software Framework.
Exception Handling Unit-6. Introduction An exception is a problem that arises during the execution of a program. An exception can occur for many different.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Updates to Interval of Validity Service (IOVSvc) ATLAS Software Week Dec
DANA uses a factory model to deliver data “just in time”
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
Classes Representing Non-Trivial Objects. Problem Write a program that reads a temperature (either Fahrenheit or Celsius), and displays that same temperature.
ArrayList Class An ArrayList is an object that contains a sequence of elements that are ordered by position. An ArrayList is an object that contains a.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc ATLAS Software Week May Architecture.
Jose A. Hernando Trigger Gaudies Reconstruction Tools & Algorithms Inspectors MC & Data Algorithms Template preserved container Jose A. Hernando.
RUN-Time Organization Compiler phase— Before writing a code generator, we must decide how to marshal the resources of the target machine (instructions,
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Stacks.
Standard Template Library The Standard Template Library was recently added to standard C++. –The STL contains generic template classes. –The STL permits.
ESA UNCLASSIFIED – For Official Use Workshop #23 Pasadena, USA 25 rd March 2015 Sam Cooper Common services update (part 2)
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Callbacks May
CS-1030 Dr. Mark L. Hornick 1 Basic C++ State the difference between a function/class declaration and a function/class definition. Explain the purpose.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
Chapter 8 Class Inheritance and Interfaces F Superclasses and Subclasses  Keywords: super F Overriding methods  The Object Class  Modifiers: protected,
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc ATLAS Software Week Architecture Session.
Arrays Chapter 7. MIS Object Oriented Systems Arrays UTD, SOM 2 Objectives Nature and purpose of an array Using arrays in Java programs Methods.
Data Structures Arrays and Lists Part 2 More List Operations.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Prototype GEANT4 Service for ATHENA framework ATLAS Software Workshop Dec 3.
Athena StoreGate Tutorial: May 30, Objectives Learn how to access data objects using StoreGate How to record/retrieve by TYPE Optionally using keys.
Chapter 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists.
1 CAA 2009 Cross Cal 9, Jesus College, Cambridge, UK, March 2009 Caveats, Versions, Quality and Documentation Specification Chris Perry.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
David Adams ATLAS Hybrid Event Store Integration with Athena/StoreGate David Adams BNL March 5, 2002 ATLAS Software Week Event Data Model and Detector.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Transient Conditions/Detector Store using StoreGate ATLAS Software Workshop.
Design issues for Object-Oriented Languages
STOREGLTE A Data Model Toolkit for the Atlas Software Architecture
User-Written Functions
Andy Wang Object Oriented Programming in C++ COP 3330
News on the CDB Framework
Stacks Chapter 4.
Discussion section #2 HW1 questions?
Raw Event Conversion Service in BOSS framework
Review: libraries and packages
Java Remote Method Invocation
Preference Activity class
A type is a collection of values
Static Binding Static binding chooses the function in the class of the base class pointer, ignoring any versions in the class of the object actually.
Calibration Infrastructure Design
Presentation transcript:

N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc EDM Workshop Detector Description Session 01/27/2003

2 Charles Leggett Interval of Validity Service F Purpose: l associates valid time ranges with objects l triggers updates of data, and validity ranges when object enters a new validity range l allows use of call back functions F Use cases: l alignment data l calibration objects l detector description information l anything which has a timed validity range associated with it

3 Charles Leggett Access Patterns F Two types of access/usage patterns: l pure data, held in dB, used as a data member inside a class. Only needs to have it’s contents refreshed when it enters a new validity range. l Container class, eg GeoNode, which has no representation inside the dB, contains one or more IOV data objects from dB as data members. Needs to know when any of its constituent members enters a new validity range, at which point a callback method is triggered. F No overlap between these patterns l will never have an IOV data object which needs a callback l will never have a container class which has data stored in dB

4 Charles Leggett Class Example class myIOVClass { public: StatusCode CallBackFcn(list &dbKeys); private: const DataHandle m_align1; const DataHandle m_align2; myIOVAlg2* that; }; myIOVClass::initialize() { p_IOVSvc->regHandle(m_align1, dBkey1); p_IOVSvc->regHandle(m_align2, dBkey2); p_IOVSvc->regFcn(this, &myIOVClass::CallBackFcn, m_align1); p_IOVSvc->regFcn(this, &myIOVClass::CallBackFcn, m_align2); p_IOVSvc->regFcn(this, &myIOVClass::CallBackFcn, that, &myIOVClass2::OtherCallBackFcn); }

5 Charles Leggett Sequence Diagram AlgHandleStoregateProxyIOVSvcCondDBNovaCnvPPSvc regHandle(handle,key)  accessData() T* DataObj * reset() callback(dbKey) T*  regFcn(this,&Fcn,handle,key) reset() initialize execute asyn c bindHandle(handle) IOVDbSvc IOV,string getData(key) DataObj * PersSvc updateAddress(TA) buildIOA(string) IOA setRange(clID,key,IOV) createObj(IOA) setAddress(IOA) IOA buildIOA(string) partial IOA regProxy(proxy) bind(handle,key)

6 Charles Leggett Sequence  In Initialize(), alg registers DataHandle with the IOVSvc using IOVSvc->regHandle(handle,key), using the same dBkey as is used in the dB.  Alternatively, the algorithm registers container class (eg GeoNode) with IOVSvc->regFcn(), supplying callback fcn and DataHandles as parameters.  At first deref of the DataHandle, call is passed through to Proxy, which calls getAddress(TransientAddress) on the IOVDbSvc. IOVDbSvc talks to the CondDB to retrieve storage location of an element given a (clID,dbKey) pair. It gets back an IOV and a string which points to the actual location of the data from which an IOA can be built. It then calls setRange() on the IOVSvc, which adds the IOV to its list of registered intervals. The IOA is set in the TransientAddress, and then the DataProxy calls createObj() on the persistency converter for the actual data using this information, and gets back a DataObj*. The DataObj* is passed back through the chain of sequences to the Algorithm, eventually being converted to a T*.

7 Charles Leggett Sequence (cont) F The next time the DataHandle is derefed, a T* is automatically returned from the Proxy. F At the start of each event, the IOVSvc parses its list of registered entries to see if any are out of range. When it finds one, it first resets the corresponding proxy, then triggers the registered callback function. The callback function gets a list of the keys of the items which have gone out of range as a parameter. F The next time one of the DataHandles is derefed, the initial sequence is replayed, getting back a new IOV and data.

8 Charles Leggett Things Needed F IOVDbSvc l provided by Database people - see R.D.’s talk next. Can use AtlasTest/IOVASCIIDbSvc instead, which keeps IOV Range info in a hierarchical ASCII file based format. See that package for details. F A converter/conversion svc for your class. l an example can be found in AtlasTest/SiAlignTest

9 Charles Leggett Changes to DataHandle et al F DataHandle inherits from IResetable, declares reset() method F DataProxy list of bound handles ( list ) bindHandle(IResetable*), unbindHandle(IResetable*) l resetBoundHandles() F StoreGate l ProxyProvider bind() like retrieve, but also associates Handles with Proxy

10 Charles Leggett IOVSvc IOVSvc { public: StatusCode regHandle(DataHandle handle, string key); StatusCode regFcn(void (T::*fcn)(), T* obj, DataHandle handle, string key); StatusCode regFcn(void (T1::*fcn1)(), T1* obj, void (T2::*fcn2)(), T2* obj); private: StatusCode regProxy(DataProxy *); set m_proxies; map m_entries; multimap * > m_proxyMap; multiset m_startSet; multiset m_stopSet; }; Servic e IIncidentListe ner

11 Charles Leggett Associated Classes IOVRange IOVTime m_start IOVTime m_stop IOVTime IOVTime(int) IOVTime(EventID) unsigned long long m_time IOVEntry DataProxy* m_proxy IOVRange* m_range

12 Charles Leggett Internals of IOVSvc  indexing is done via DataProxy*  IOVs are held in map  Callback functions are multimap * > F IOVs are ordered in two sets: std::multiset m_startSet; std::multiset m_stopSet; m_startSet is ordered by decreasing start time, m_stopSet is ordered by increasing end time. As a result of this ordering, when the sets are scanned at the beginning of each event for entries that need to be marked invalid, as soon as the first valid entry is found in each set, the scanning can be stopped as one is assured that all subsequent entries are valid. F When invalid entries in these multisets are found, the associated DataProxy* is added to a list. At the end of the scan, the IOVs of these DataProxies are updated, the DataProxies are reset (and thus the associated DataHandles) and the associated callback functions are activated.

13 Charles Leggett A Real Example: Pixel Detector F Used to handle automatic alignments with the GeoModel. RCBase GeoGraphNode GeoAlignableTransfor m GeoTransform GeoSiAlTransform public: HepTransform3D getTransform() HepTransform3D* getDelta() void setDelta(HepTransform3D &) void clearDelta() private: const DataHandle m_DHdelta InnerDetector/InDetAlignment/SiAlignment

14 Charles Leggett How It Works F The GeoSiAlTransform is associated with a GeoFullPhysVolume, which has a cache for the alignment data.  When this alignment data is needed, getDelta() in GeoSiAlTransform is called, which in turn derefs the DataHandle m_DHdelta. This DataHandle has been registered with the IOVSvc, so the IOVSvc is able to manage its contents, updating it as necessary.  The method clearDelta() has also been registered as the accompanying callback function for this DataHandle, and is called when a new alignment is read in. It invalidates the position caches for all elements in the detector hierarchy below it, so that the next time the position of any of them is needed, it is recalculated with the updated information.

15 Charles Leggett Example Output Alignment first checked at event [1,5] db file opened, appropriate range found ([1,4] -> [1,8]), tag “tag2” read in Position loaded from converter (ideal + delta), identified by “tag2” Event [1,6] - start and stop sets show valid ranges for this detector element Event [1,10] - detector element is out of range, has been removed from stop set db file found and opened, next valid range found ([1,9]->[2,2]), tag “tag3” read in. Position loaded from converter, is now different from before (the delta has changed) Event [2,2] - start and stop sets show valid ranges for this detector element example taken from running package AtlasTest/SiAlignTest Colours provided by the colourized MsgService, coming soon to a terminal near you!

16 Charles Leggett Caveats F The callback function must be virtual. F All DataHandles to elements that the IOVSvc will manage must be const, or you’ll get a runtime error. F Don’t try to deref the DataHandle before the first event is loaded, eg in the initialize phase. The proxy hasn’t been filled, and you’ll get a pointer to a null object.  Whenever you call regFcn(...), you will get a warning that looks like this:...lots of crap... instantiated by... instantiated by...../../../Control/IOVSvc/IOVSvc /IOVSvc/CallBackID.icc:24: warning: unsigned int format, different type arg (arg 3) F This is OK, and can be safely ignored

17 Charles Leggett What’s Next F This is still a prototype, but has been demonstrated to work with the Pixel alignments in the Geo model F Has been in the release since 5.1.0, but has been evolving, along with StoreGate F Plan to have it in stable form in 6.0.0

18 Charles Leggett Other Stuff F Full online documentation: l F Thanks for giving this talk Paolo, and sparing me having to get up and be coherent at 3AM!