Dual-use prototype for analysis tools David Adams BNL October 16, 2013 ASG tools working group.

Slides:



Advertisements
Similar presentations
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Advertisements

Dual use tools: requirements and design David Adams BNL November 20, 2013 ASG tools working group.
Road Map Introduction to object oriented programming. Classes
David Adams ATLAS DIAL Distributed Interactive Analysis of Large datasets David Adams BNL March 25, 2003 CHEP 2003 Data Analysis Environment and Visualization.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
1 Lab Session-XIV CSIT121 Spring 2002 b Namespaces b First Class Travel b Lab Exercise 14 (Demo) b Lab Exercise b Practice Problem.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
TRIGGER DATA FOR PHYSICS ANALYSIS ATLAS Software Tutorial – 22 nd to 24 th April 2009 Ricardo Gonçalo – Royal Holloway.
A First Program Using C#
Peter van Gemmeren (ANL): ANL Analysis Jamboree The ATLAS Data Model.
The New TrigDecision Nicolas Berger, Till Eifert, Ricardo Gonçalo Physics Analysis Tools session ATLAS Software Workshop – Munich, March 2007.
Introduction to C Programming CE Lecture 7 Compiler options and makefiles.
David Adams ATLAS AJDL: Analysis Job Description Language David Adams BNL December 15, 2003 PPDG Collaboration Meeting LBL.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
Axel Naumann University of Nijmegen / NIKHEF, NL ROOT 2004 Users Workshop The Future of THtml Plans and Status of ROOT’s documentation facility.
CERN Tutorial, September Job Options and Printing.
Job Options and Printing 1 LHCb software tutorial - September 2011.
David Adams ATLAS DIAL status David Adams BNL July 16, 2003 ATLAS GRID meeting CERN.
Templates An introduction. Simple Template Functions template T max(T x, T y) { if (x > y) { return x; } else { return y; } } int main(void) { int x =
Event Data History David Adams BNL Atlas Software Week December 2001.
Datasets on the GRID David Adams PPDG All Hands Meeting Catalogs and Datasets session June 11, 2003 BNL.
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.
1 Advanced Issues on Classes Part 3 Reference variables (Tapestry pp.581, Horton 176 – 178) Const-reference variables (Horton 176 – 178) object sharing:
David Adams ATLAS Architecture for ATLAS Distributed Analysis David Adams BNL March 25, 2004 ATLAS Distributed Analysis Meeting.
ADTs and C++ Classes Classes and Members Constructors The header file and the implementation file Classes and Parameters Operator Overloading.
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
Particle to MC truth association Juan Palacios (Nikhef) LHCb software week June
Use of Gaudi in Reconstruction Weidong Li 23/06/2004.
Gaudi Framework Tutorial, April Algorithm Tools: what they are, how to write them, how to use them.
Gaudi Framework Tutorial, April Job Options and Printing.
Jose A. Hernando Trigger Gaudies Reconstruction Tools & Algorithms Inspectors MC & Data Algorithms Template preserved container Jose A. Hernando.
Reconstruction Configuration with Python Chris Jones University of Cambridge.
9-13/9/03 Atlas Overview WeekPeter Sherwood 1 Atlfast, Artemis and Atlantis What, Where and How.
David Adams ATLAS DIAL/ADA JDL and catalogs David Adams BNL December 4, 2003 ATLAS software workshop Production session CERN.
David Adams ATLAS Virtual Data in ATLAS David Adams BNL May 5, 2002 US ATLAS core/grid software meeting.
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.
M1G Introduction to Programming 2 5. Completing the program.
INFSO-RI Enabling Grids for E-sciencE Ganga 4 – The Ganga Evolution Andrew Maier.
Integration of the ATLAS Tag Database with Data Management and Analysis Components Caitriana Nicholson University of Glasgow 3 rd September 2007 CHEP,
Chapter 3 Functions. 2 Overview u 3.2 Using C++ functions  Passing arguments  Header files & libraries u Writing C++ functions  Prototype  Definition.
9/12/99R. Moore1 Level 2 Trigger Software Interface R. Moore, Michigan State University.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
S. Rajagopalan, BNLATLAS software week, 2/15/00 LAr OO Reconstruction People: H. Ma, S. Rajagopalan, J. Schwindling –+ help/advise from several others.
Bologna Tutorial, April Job Options and Printing.
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
David Adams ATLAS ATLAS Distributed Analysis: Overview David Adams BNL December 8, 2004 Distributed Analysis working group ATLAS software workshop.
Classes, Interfaces and Packages
Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 15. Dictionaries (1): A Key Table Class.
David Adams ATLAS ATLAS-ARDA strategy and priorities David Adams BNL October 21, 2004 ARDA Workshop.
CINT & Reflex – The Future CINT’s Future Layout Reflex API Work In Progress: Use Reflex to store dictionary data Smaller memory footprint First step to.
INFSO-RI Enabling Grids for E-sciencE Using of GANGA interface for Athena applications A. Zalite / PNPI.
David Adams ATLAS ATLAS Distributed Analysis (ADA) David Adams BNL December 5, 2003 ATLAS software workshop CERN.
David Adams ATLAS ATLAS Distributed Analysis and proposal for ATLAS-LHCb system David Adams BNL March 22, 2004 ATLAS-LHCb-GANGA Meeting.
Gaudi Framework Tutorial, Algorithm Tools: what they are and how to use them.
CLASSES AND OBJECTS Chapter 3 : constructor, Separate files, validating data.
David Adams ATLAS ADA: ATLAS Distributed Analysis David Adams BNL December 15, 2003 PPDG Collaboration Meeting LBL.
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.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
C# Programming: From Problem Analysis to Program Design1 Creating Your Own Classes C# Programming: From Problem Analysis to Program Design 4th Edition.
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
David Adams ATLAS Hybrid Event Store Integration with Athena/StoreGate David Adams BNL March 5, 2002 ATLAS Software Week Event Data Model and Detector.
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
Chapter 9: Value-Returning Functions
Creating Your Own Classes
“Algorithm Tools” what they are, how to get them and how to use them
User-Defined Functions
SPL – PS1 Introduction to C++.
Presentation transcript:

Dual-use prototype for analysis tools David Adams BNL October 16, 2013 ASG tools working group

Introduction Trying to understand how to structure run 2 analysis tools Analysis tools must run in both Athena and Root o Call these “dual-use” o With minimal code duplication (to ease maintenance) Jet/Etmiss expanding definition of analysis tools o Any useful tool that can be run without Athena-specific services o Services means geometry, magnetic field, conditions DB o Useful means useful to late-stage analysis, e.g.: – Jet moment calculators: JVF, jet area, … – Association calculators: calo-track, calo-truth, … – Jet finding, grooming, … Expect tool standards to be specified by the ASG tools working group o Requirements for user interface and tool developers interface o Plus supporting software Here discuss the current implementation: AsgEx o See the AsgEx Twiki for additional informationAsgEx Twiki D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, 20132

Tool user requirements Tool interfaces Different tools have different interfaces Expect to switch to object (e.g. Jet) based interface o Instead of a long list of floats (pT, eta, NPV, …) Tools intended to read and write event data can have no arguments o Configured with names of input and output collections Configuration Users should have means to configure tools in both Athena and ROOT o For Athena, integrate with job options (or keep current syntax) For Root, nice to have a C++ interface Also like to have a common Python interface for Athena and Root o Same as current job options? More on this later. Configuration should support tools using other tools o So individual tools can be simple and interchangeable o Job options support this with ToolHandle as developer interface D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, 20133

Tool developer requirements Want to make it easy to develop tools Not just by expert programmers Allow development in either Athena or Root o With easy port to the other environment Implies we should establish coding conventions and provide supporting software to enable the above Configuration Common means to access the configuration info discussed earlier Event data Common means to read and write collections in current event Common way to access the objects in those collections: xAOD Status codes StatusCode in Root but tools can decide to use or not Logging messages Enable Athena-like message service and ATH_MSG_XXX macros D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, 20134

Prototypes Jet/Etmiss has been developing dual-use prototypes To help determine requirements (previous pages) To see what is possible Prototype 1: JetEx D. Adams talk in September o Simple interface with wrappers for Athena Criticized as too different from Athena Prototype 2: AsgEx Latest version of this evolving SW described here Code in SVN: user-dadams/AsgEx (5 packages) Interface very similar to Athena o declareProperty(), evtStore()->retrieve(), ToolHandle, ATH_MSG_XXX,… Requires some supporting software o To give appearance of Athena property and event services in Root D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, 20135

AsgEx Python configuration D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, Provide Python-based job configuration in AsgEx As in Athena—try to use Athena syntax See example code fragment below o Configures low-level tool JetDumper and then o High-level tool AsgRunner which uses the first tool Work in progress (PA) to provide the same syntax in Root

AsgEx status Status of the AsgEx prototype Both low- and high-level tool examples working o High-level = tool that uses other configured tools o Same tools (JetDumper, AsgRunner) code run in Athena and Root o Script-generated wrappers provided to allow configuration and event access in Root using Athena interfaces Athena configuration with standard job options (previous page) Root configuration with setProperty in C++ o Work in progress to add Python wrapper (job options syntax) Separate interface and implementation classes (as in Athena) Class diagrams follow Athena only, AsgEx in Root, AsgEx in Athena Two example tools: low-level JetDumper, high-level AsgRunner Legend: White = Athena, Red = ASG support, Green = user-supplied, Blue = automatically-generated Athena wrappers D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, 20137

Athena only (run 1 model for comparison) D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, Tool interface Low-level toolHigh-level tool

AsgEx Root classes D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, ASG support, mostly replacements for Athena ToolHandle typedefs Classes supplied by the tool developer

AsgEx Athena classes D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, AsgEx general support classes AsgEx Athena tool classes (generated automatically) Athena classes ToolHandle typedefs

Comments on AsgEx Intended to be prototype Used to identify requirements and aid in design of final system Propose we use this as the starting point for development o Assuming the user and developer interface are close to what we want o Allow development of physics tools to start very soon o Modular design makes it easy to substitute pieces (e.g. event store) o If we want to re-implement, we should start ASAP Event access is based on JetAnalysisEDM Subset of jet AOD interface to either AOD or D3PD Need to switch this to xAOD o When xAOD is available o Do we need/want access to D3PD or AOD with same interface? Python-based configuration under development Likely to extend PropertyMgr, add ToolSvc Latter might be nice to have in C++ world D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16,

Example tool Code follows for an example analysis tool Creates fast jet inputs from an input collection o E.g. from clusters, tracks or truth particles Just written yesterday—may have some problems Illustrates the features of the developer interface Header and source file on following pages o Code in AsgEx/AsgExJetReco This package is not (yet) tested in Athena D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16,

Example tool header 1/2 // PseudoJetGetter.h #ifndef jetreco_PseudoJetGetter #define jetreco_PseudoJetGetter // David Adams // October 2013 // // Tool to fetch pseudo jets. #include "AsgExTool/AsgTool.h" #include "AsgExToolInterface/IProcessTool.h" #include "fastjet/PseudoJet.hh" #include "JetAnalysisEDM/JetDualUseEDMInclude.h" namespace jetreco { class PseudoJetGetter : virtual public asgex::IProcessTool, virtual public asg::AsgTool { D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, public: typedef std::vector PseudoJetList; // Constructor. PseudoJetGetter(); // Append from a collection to a list of PseudoJets. template int append(const TList& inputs, PseudoJetList& psjs) const; // Append from named collection to a list of PseudoJets. int appendTo(PseudoJetList& psjs) const; // Append from named input collection to named output collection. int process() const; // Dump to log. void print() const; private: //data // Job options. std::string m_incoll; std::string m_outcoll; Tool must be in a namespace Inherit both interface and implementation Ctor takes no arguments. User interface Configuration parameters From IProcessTool

Example tool header 2/2 }; } // end namespace jetreco #ifndef __CINT__ template int jetreco::PseudoJetGetter:: append(const TList& inputs, PseudoJetList& psjs) const { for ( typename TList::const_iterator iinp=inputs.begin(); iinp!=inputs.end(); ++iinp ) { const JetAnalysisEDM::Particle* ppar = *iinp; fastjet::PseudoJet psj(ppar->px(), ppar->py(), ppar->pz(), ppar->e()); psjs.push_back(psj); } ATH_MSG_DEBUG("After append, PseudoJet count is " << psjs.size()); return 0; } #endif // CINT #endif D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, Templated method: constructs fastjet PseudoVector’s from particles using four-vector interface

Example tool source 1/2 // PseudoJetGetter.cxx #include "AsgExJetReco/PseudoJetGetter.h" using jetreco::PseudoJetGetter; //********************************************************************** PseudoJetGetter::PseudoJetGetter() { declareProperty("Input", m_incoll); declareProperty("Output", m_outcoll); } //********************************************************************** int PseudoJetGetter::appendTo(PseudoJetList& psjs) const { ATH_MSG_VERBOSE("Entering appendTo(PseudoJetList)..."); const JetCollection* pjets = 0; StatusCode sc = evtStore()->retrieve(pjets, m_incoll); if ( sc.isFailure() || pjets == 0 ) { ATH_MSG_ERROR("Unable to find input collection: " << m_incoll); return 1; } return append(*pjets, psjs); } D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, Properties declared in ctor Athena-style message logging Data retrieved from event store Athena-style return code

Example tool source 2/2 //********************************************************************** int PseudoJetGetter::process() const { ATH_MSG_VERBOSE("Entering process()..."); PseudoJetList* ppsjs; const PseudoJetList* ppsjs_const; ppsjs_const = evtStore()->retrieve (m_outcoll); ppsjs = const_cast (ppsjs_const); if ( ppsjs == 0 ) { ATH_MSG_VERBOSE("Creating new PseudoJet collection"); ppsjs = new PseudoJetList; evtStore()->record(m_outcoll, ppsjs); } else { ATH_MSG_VERBOSE("Using existing PseudoJet collection"); } return appendTo(*ppsjs); } //********************************************************************** void PseudoJetGetter::print() const { ATH_MSG_INFO(" Input collection: " << m_incoll); ATH_MSG_INFO(" Output collection: " << m_outcoll); ATH_MSG_INFO(" Output level: " << msg_level_name()); } D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, Common tool interface includes print method to show properties Recording transient data in event store

Conclusions Dual-use tool example (AsgEx) in place See the AsgEx Twiki for detailsAsgEx Twiki Example tools JetDumper and AsgRunner run in Root and Athena o Syntax very similar to Athena o No #ifdef or CPP macros in tool developer code Plans ASG working group should decide whether to use AsgEx as the basis for future development or to re-implement Starting to adding jet reconstruction tools based on AsgEx o New package AsgEx/AsgExJetReco Migrate to xAOD o When xAOD specified (at least for jets and jet inputs: cluster, track, truth) o And data is available in xAOD or means provided to access common D3PD through xAOD interface Add Python configuration for Root using Athena job options syntax D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16,

Extras Updated run 2 jet analysis use cases D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16,

Run 2 jet analysis use cases D. Adams, BNL Dual-use tool prototype for run 2 ASG tools working group October 16, Tier0TrainPost-train Athena Root xAOD ntuple Apply jet calibrationyes no Systematic variation of jet calibno yes yes? (Re)calculate jet moment(s)yes no? Create new jet coll. for physicsyes no Perf. study varying jet parsno yes no Tool code developmentno yes no