Jose A. Hernando Trigger Gaudies Reconstruction Tools & Algorithms Inspectors MC & Data Algorithms Template preserved container Jose A. Hernando.

Slides:



Advertisements
Similar presentations
Chapter 3 – Lists A list is just what the name implies, a finite, ordered sequence of items. Order indicates each item has a position. A list of size 0.
Advertisements

Chapter 6 Queues and Deques.
. Smart Pointers. Memory Management u One of the major issues in writing C/C++ code is managing dynamically allocated memory u Biggest question is how.
Data Structures: A Pseudocode Approach with C
Reconstruction and Analysis on Demand: A Success Story Christopher D. Jones Cornell University, USA.
Sets and Maps Chapter 9. Chapter 9: Sets and Maps2 Chapter Objectives To understand the Java Map and Set interfaces and how to use them To learn about.
C++ Programming: Program Design Including Data Structures, Fifth Edition Chapter 17: Linked Lists.
Data Structures Using C++ 2E
Standard library types Practical session # 3 Software Engineering
Review of C++ Programming Part II Sheng-Fang Huang.
CLEO’s User Centric Data Access System Christopher D. Jones Cornell University.
C++ / G4MICE Course Session 3 Introduction to Classes Pointers and References Makefiles Standard Template Library.
Data Structures Using C++ 2E
1 T1-T3 in L1 algorithm  Idea (F. Teubert) Use extra tracking information to measure the large Pt that triggers the event (L1, HLT). Based in the fact.
A Computer Science Tapestry 1 Recursion (Tapestry 10.1, 10.3) l Recursion is an indispensable technique in a programming language ä Allows many complex.
Browsing Data with GaudiPython Disclaimers: 1.I am an apprentice! 2.The porpoise: we think GaudiPython could be quite useful for a LHCb physicist… Browsing.
Data Structures Using C++ 2E Chapter 8 Queues. Data Structures Using C++ 2E2 Objectives Learn about queues Examine various queue operations Learn how.
Event Data History David Adams BNL Atlas Software Week December 2001.
Stacks. A stack is a data structure that holds a sequence of elements and stores and retrieves items in a last-in first- out manner (LIFO). This means.
G.Corti, P.Robbe LHCb Software Week - 19 June 2009 FSR in Gauss: Generator’s statistics - What type of object is going in the FSR ? - How are the objects.
Level 2 ID-tracking truth association Trigger AOD discussion 13 December 2006 Ricardo Gonçalo - RHUL.
AIDA Tuple Service Manuel Domenech Wednesday
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
ICOM 4035 – Data Structures Lecture 3 – Bag ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
Use of Gaudi in Reconstruction Weidong Li 23/06/2004.
1 T1-T3 in L1 algorithm  Outlook: I) Summary of L1-confirmation II) About the TrgForwardTracking package III) Confirming (preliminary)  L1-confirmation.
Gaudi Framework Tutorial, April Algorithm Tools: what they are, how to write them, how to use them.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
Dual-use prototype for analysis tools David Adams BNL October 16, 2013 ASG tools working group.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Interval of Validity Service IOVSvc ATLAS Software Week May Architecture.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Stacks.
Navigation Timing Studies of the ATLAS High-Level Trigger Andrew Lowe Royal Holloway, University of London.
Review of Stacks and Queues Dr. Yingwu Zhu. How does a Stack Work? Last-in-First-out (LIFO) data structure Adding an item Push operation Removing an item.
Apr. 8, 2002Calibration Database Browser Workshop1 Database Access Using D0OM H. Greenlee Calibration Database Browser Workshop Apr. 8, 2002.
Argonne Jamboree January 2010 Esteban Fullana AOD example analysis.
David Adams ATLAS DIAL: Distributed Interactive Analysis of Large datasets David Adams BNL August 5, 2002 BNL OMEGA talk.
1 9/6/05CS360 Windows Programming CS360 Windows Programming.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
GAUDI Muon Software  Algorithms : Muon Digitization MuonL0Trigger MuonIdentification  Detector Description Database  Transient Detector Store  Detector.
Tutorial: Examples (09may00 - ATLAS Software LBNL) May 2000 Prototype Framework Tutorial: Examples Paolo Calafiura, Charles Leggett HCG/NERSC/LBNL.
Tracking Event Model, Status 1.The plan, and the classes (again) 2.The packages modified or to be modified 3.Interactive reconstruction 4.Some ideas 5.Conclusion.
Level 2 ID-tracking truth association How it works Information in POOL How to use it.
DaVinciAssociators How to relate physics objects to MC truth.
Sets and Maps Chapter 9. Chapter Objectives  To understand the Java Map and Set interfaces and how to use them  To learn about hash coding and its use.
Muon Persistency Persistent Analysis Objects Muon Persistency Norbert Neumeister µ-PRS meeting February 10, 2004.
Array 10 GB Hard Disk 2 GB 4 GB2 GB 3 GB DATA 4 GB Free Store data in the form of Array (Continuous memory locations) Solution-1: No Solution. Memory Insufficient.
Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example Based on original by S. Rajagopalan BNL.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 17: Linked Lists.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 18: Linked Lists.
Gaudi Framework Tutorial, April Histograms And N-tuples.
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
Athena StoreGate Tutorial: May 30, Objectives Learn how to access data objects using StoreGate How to record/retrieve by TYPE Optionally using keys.
For Loop GCSE Computer Science – Python. For Loop The for loop iterates over the items in a sequence, which can be a string or a list (we will discuss.
Nikhef Bfys Workshop Day One: Exploring a (m)DST Juan Palacios
Joe Foster 1 This talk extends the one I gave in 2006 called Visualizing Data with ROOT. –
Gaudi Framework Tutorial, April Histograms And N-tuples.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
HYDRA Framework. Setup of software environment Setup of software environment Using the documentation Using the documentation How to compile a program.
DANA David Lawrence Oct. 21, D. Lawrence, JLab GlueX Software Workshop Oct Outline Requirements Philosophy Overview of Features Open Questions.
AOD example analysis Argonne Jamboree January 2010
CS212: Object Oriented Analysis and Design
C++ Programming:. Program Design Including
Data Structures Using C++ 2E
“Algorithm Tools” what they are, how to get them and how to use them
CS 215 Final Review Ismail abumuhfouz Fall 2014.
Tuesday, February 20, 2018 Announcements… For Today… 4+ For Next Time…
Arrays and Collections
Object Oriented Programming in java
Tracking Event Model, Status
Data Structures & Programming
Presentation transcript:

Jose A. Hernando Trigger Gaudies Reconstruction Tools & Algorithms Inspectors MC & Data Algorithms Template preserved container Jose A. Hernando

Reconstruction (access) The reconstruction algorithms share: – Access to the geometry (see geometry part) – Access to Hits We should define an interface (base) class. Solution: – The Reconstruction Tool/Alg should look for the data classes: – An algorithm at the initialization of the run that creates Geometry classes (calibration) – An algorithm that event by event create hits classes OLRecordsHits HitMaker event by event geocal geometry geocal Ini of run geocal Hits

Jose A. Hernando (status) RecAlg::execute() { vector ntracks; for seed in tracks new track* ntrack = NULL; if (rectool.reconstruct(seed,track)) ntracks.push_back(track); clone_killing(ntracks) }; Class RecTool: public ToolAlg { (status) reconstruct (const Track& seed, Track*& track) ; (status) reconstruct (const (TrackState)& state, Track*& track); }; Reconstruction (Tool & Algorithm) The reconstruction can be partial or complete – Partial: A collection of selected tracks, – Complete: all seed tracks, or with no input Solution – The reconstruction should be a Tool and an Alg – The Tool and Alg will require: – – The Tool will take a seed a reconstruct a track – The Alg will delegate in the tool to reconstruct – Property of RecAlg: Address of the input container Check for a flagged input ot not Tracks (3d)Tracks (VTT) VeloTTRecAlg geocal Hits Track VeloTT RecTool Track Hits geo VeloTT RecTool VeloTTRecAlg RecTool RecAlg

Jose A. Hernando Inspectors The reconstruction algorithms are inspected: – They accumulate data during the run Histograms, counters, timers – These run data can be made persistent (or simply printed out) Solution – The inspector are tools – the algorithms retrieve them and use them. – Any inspector should have user friendly methods. To book, fill histogram, ntuples To start, stop timers – The inspector should contain and manage the run data The user do not care of the data Ini of run IniInspectors Histos Ntuples Timers Counters end of run Summarize Counters

Jose A. Hernando Histos Histogram Inspector Histogram Inspector: – It server histograms between the user and HistoSvc of Gaudi – The user book and fill it as old Hbook Book(ID, n, x0, xf); Fill(ID,x); – The user do not have to keep the histograms pointers in their algorithm – The “key” of histogram can be (string) name, (int) ID – Properties of HistoInspector Persistency HBOOT/ROOT/etc Address. Class IHistoInspector: public ToolAlg { (status) book(key, n, x0, xf); (status) book(key, nx, x0, xf, ny, x0, xf); (status) fill(key, x, increment = 1); (status) fill(key, x, y, increment = 1); }; (status) VeloTTRecAlg::initialize() { histoInsp().book(“TTHits”,200,0,50); histoInsp().book(“TTXY”,50,-80,80,50,-80,80); } (status )VeloTTRecAlg: execute { … histoInsp().fill(“velo hits”, nhits,1.); histoInsp().fill(“xy velo hits”, x, y, 1.); } VeloTTRecAlg Use in Algorithms : Inspector header (some user friend methods)

Jose A. Hernando NTuples Ntuples Inspectors NTuples Inspector: – It server ntuples between the user and NTupSvc of Gaudi – The user book and fill ntuples similar as old Hbook Book(ID, name); Fill(ID,name,x); tup[name] = x; – The user do not have to keep the ntuples entries pointers in their algorithm – The ntuple will have an ID (int) and every entry an name (string) (int) NtupleID, (string) name – Properties of HistoInspector Persistency HBOOT/ROOT/etc Address. Class NtupleInspector: public ToolAlg { (status) create(id); (status) define(var_name); (status) fill(var_name, var); (double&) operator() [](varname); }; (status) VeloTTRecAlg::initialize() { NtupleInsp().create(10); NtupleInsp().define(“TTHits”); } (status) VeloTTRecAlg: execute { … (int) nhits = tthits.size(); NtupleInsp().fill(“TTHits”, nhits); } VeloTTRecAlg Use in Algorithms : Inspector header (some user friend methods)

Jose A. Hernando Timer Timer Inspectors Timer Inspector: – It store a histogram for user timer – The user start and stop the timer start(name); stop(name); The elapsed time is the entry of a 1D histogram – The information is printed or stores as histogram – Properties of TimerInspector Persistency HBOOT/ROOT/etc Address. Class NtupleInspector: public ToolAlg { (status) start(name); (status) stop(name); }; (status) VeloTTRecAlg: execute { TimerInsp().start(“VeloTTRECAlg_exe”); …. TimerInsp().sto(“VeloTTRecAlg_exe”); } VeloTTRecAlg Use in Algorithms : Inspector header (some user friend methods)

Jose A. Hernando Counter Counter Inspectors Counter Inspector: – It store counters – The user can increment a counter reset(name); increment(name, (int) val); – The information is printed at the end of the run. Class NtupleInspector: public ToolAlg { (status) reset(name); (status) increment(name, (int) val=1); }; (status) L1Decision: execute { CounterInsp().increment(“passingL1”); } VeloTTRecAlg Use in Algorithms : Inspector header (some user friend methods)

Jose A. Hernando MC & Data Algorithms How to check an algorithm with MC without been intrusive? – The Data Algorithm [DAlg] should not contain any track of MC – Who to test the code without duplication? Solution 1. A MC Algorithms that takes as input Data and MCData As other Algorithm but now takes also MCData. It can be use as checker of the output but not during the execution of the Dalg You add the MCAlg to the sequencer 2. A MC Algorithm inherits from the Data Algorithm The MCAlg overwrites DAlg methods, and add MC information. Doing the check you replace DAlg by MCAlg in the sequencer Tracks Hits Counter CheckRecEff Class MCAlg : public DAlg, public algorithm { (status) initialize(); (status) execute(); (status) finalize(); protected: Associator * m_astor; } (status) MCAlg : initialize() { DAlg::initialize(); HistoInsp().book(“track_mcw”,50,0,1); } (status) MCAlg::execute() { Create_cheating_mctracks(); Set_address_to_cheated_mctracks(); DAlg::execute(); // DAlg::matching(); Study_efficiency(); } In the header In the cpp

Jose A. Hernando MC & Data Algorithms (2) The Algorithms repeat some common task: – Go to the DataSvc and get the data (MC) – Go to the ToolSvc and get the tool Solution – We can write with an script (python): Input txt file ( ): –DataObjs address –Tool address –properties – It will write in the squeleton of header file 1. The member pointer and access to the data const L13dTracks& l13dtracks(); 2. The member pointer and access to the tools HistoInsp& histoInsp(); – It will write the squeleton of the cpp file The “nots” of Gaudi to get the data and the tools The “nots” of Gaudi to make the alg factory. Tracks Hits Histos CheckRecEff Class CheckRecEff : public algorithm { HistoInsp& histoInsp() {return *m_Hinsp;} Const L13dTracks& l13dtracks() const {return *m_l13dtracks;} protected: HistoInsp* m_HInsp; L13dTracks* m_l13dtracks; }; Static cont AlgFactory Const IAlgFactory& … (status) CheckRecEff : initialize() { Retrieve_run(); histoInsp().book(“ntracks”,50,0,50); } (status) CheckRecEff::execute() { Retrieve_event(); Int ntracks = l13dtracks().size(); histoInsp().fill(“ntracks”,ntracks); } (status) CheckRecEff::retrieve_event() { m_l13dtracks = SmartPtr L13dTracks(evtSvc(), m_address_l1trks); }

Jose A. Hernando Template preserved container How we can avoid to create new objects and delete them per event? – This is one of the most time consuming task! Solution: – Create our own template container Booked_vector hits(50); – The container (the pointer) should survive an event We can not use the eventSvc We can instanciate a new DataSvc in Gaudi for this porpose. (I.e. TgDataSvc) We will acces the data from these container from this DataSvc – The container has a fixed dimension at creation time This can be expanded dynamically. – The container can be reset and return the next empty element. – The elements should be reset(able) – The container can be smart and have keys or flags to access selected elements. Template class booked_vector { Booked_vector(int n); Reset(); (Int) size() const {}; T& next() {} (iterator)& begin() {} (iterator)& end() {} protected: Std::vector m_vector; } (status) HltXAlg ::execute() { (booked_vector ) hltHits().reset() HltHit* hit = hltHits().next(); // return first Fill_hit(hit); Int nhits = hltHits().size() ;// size now =1 } In the header In the cpp

Jose A. Hernando Conclusions The Gaudies: – It is code to help to create and use the (trigger) small algorithms – It is code to make Gaudi more user friendly – It is code to simplify our coding experience. Gaudies: – The Reconstruction Algorithm and Tool The Reconstruction Tool operates in one seed track The Reconstruction Algorithm operates (in a container of tracks) and uses the Tool – The Inspectors They are tools to store and manage a run-type data They have user friendly tools –Histos, Ntuples, Timer, Counter Inspectors – The MC and Data Algorithm A MCAlgorithm can check its DataAlgorithm without disturbing the DataAlg. The general code of accessing data/tools and other “nots” of Gaudi can be create automatically with an script (python) – A template preserved container Is is a container of fixed size to be changed dynamically It can be reset(), and ask for the next() empty element The container leaves in a DataSvc of Gaudi different than the eventSvs and survives during the run The Gaudis should be a package