V0.02 The ROOT Collection Classes. V0.02 2 Collection Classes Group of related objects TObjects or descendants from TObject Abstract base class TCollection.

Slides:



Advertisements
Similar presentations
Chapter 22 Implementing lists: linked implementations.
Advertisements

Collections Chapter Java Collection Frameworks The Java collection framework is a set of utility classes and interfaces. Designed for working with.
Chapter 7 Strings F Processing strings using the String class, the StringBuffer class, and the StringTokenizer class. F Use the String class to process.
Introduction to Computers and Programming Lecture 11: Introduction to Methods Professor: Evan Korth New York University.
Introduction to Computers and Programming Introduction to Methods in Java.
Building Memory… Day 5 – November 27, Need to flip cards Create a remove method to remove from drawing canvas Call a show method to show on the.
External Sorting 198:541. Why Sort?  A classic problem in computer science!  Data requested in sorted order e.g., find students in increasing gpa order.
1 Chapter 5: Names, Bindings and Scopes Lionel Williams Jr. and Victoria Yan CSci 210, Advanced Software Paradigms September 26, 2010.
21-Apr-2005J. Adamczewski1 DVEE C++ course 2005 The ROOT framework 1: Introduction.
UNIT - 1Topic - 3. Computer software is a program that tells a computer what to do. Computer software, or just software, is any set of machine-readable.
Object-Oriented Programming (OOP). Implementing an OOD in Java Each class is stored in a separate file. All files must be stored in the same package.
Google’s MapReduce Connor Poske Florida State University.
Pointers OVERVIEW.
MIPS coding. slt, slti slt $t3, $t1, $t2 – set $t3 to be 1 if $t1 < $t2 ; else clear $t3 to be 0. – “Set Less Than.” slti $t3, $t1, 100 – set $t3 to be.
GAM 200 Club. How to Game Engine GAM 200 Club Zachary Nawar.
Processing Workshop. What is processing? “Processing is an open source programming language and environment for people who want to program images, animation,
MIPS coding. Review Shifting – Shift Left Logical (sll) – Shift Right Logical (srl) – Moves all of the bits to the left/right and fills in gap with 0’s.
APS105 Lists. Structures Arrays allow a collection of elements –All of the same type How to collect elements of different types? –Structures; in C: struct.
ITEC 320 Lecture 9 Nested records / Packages. Review Project ?’s Records Exam 1 next Friday.
List Interface and Linked List Mrs. Furman March 25, 2010.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Array Lists Array Lists Dale.
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.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 21 Sets and Maps.
Programming Fundamentals Enumerations and Functions.
Go4 Workshop J.Adamczewski-Musch, S.Linev Go4 advanced features.
ROOT1 Hands-on Sami Kama. S.Kama ROOT1 Hands-On ISTAPP2011 Dogus Univ.07/02/ Download root file from indico.
ARRAYS.
Chapter 5 – Making Music: An On-Screen Piano (Part 1 – Using Loops)
ROOT: Functions & Histograms
Test 2 Review Outline.
Review 1.
Arrays Chapter 7.
Regarding homework 9 Many low grades
Arrays Low level collections.
Chapter 19 Java Data Structures
Objectives Identify the built-in data types in C++
OOP-4-Templates, ListType
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
C++ Arrays.
Arrays and Records.
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
Siti Nurbaya Ismail Senior Lecturer
CSC 253 Lecture 8.
Array Lists Chapter 6 Section 6.1 to 6.3
Arrays … The Sequel Applications and Extensions
ㅎㅎ Fourth step for Learning C++ Programming Two functions
CSC 253 Lecture 8.
Dynamic Programming.
Dynamic Programming.
MIPS coding.
int [] scores = new int [10];
Can store many of the same kind of data together
Chapter 7 Part 2 Edited by JJ Shepherd
Collections Not in our text.
MIPS Coding.
CS2011 Introduction to Programming I Arrays (I)
MSIS 655 Advanced Business Applications Programming
Arrays Chapter 7.
Linked List and Selection Sort
2 code samples int [] array; int i, j, temp; for(i = 0; i < array.length/2; i++) { j = array.length-1-i; temp = array[i]; array[i] = array[j]; array[j]
Chapter 9: Data Structures: Arrays
JavaScript: Arrays.
Arrays.
Project 1 Sequence CS 211 – Fall 2017.
C H A P T E R F I V E Memory Management.
MIPS assembly.
Arrays and Pointers CSE 2031 Fall May 2019.
The ROOT framework 1: Introduction
Arrays and Pointers CSE 2031 Fall July 2019.
Assignment #2 (Assignment due: Nov. 06, 2018) v1 v2 v3 v4 v5
Presentation transcript:

V0.02 The ROOT Collection Classes

V Collection Classes Group of related objects TObjects or descendants from TObject Abstract base class TCollection

V Collection Classes (cont.) Ordered Collections (Sequences) Sorted Collections Unordered Collections

V TClonesArray Array of Identical Objects. Memory for the Objects stored is allocated only once. Use TClonesArray to store heterogeneous object arrays in a TTree.

V Iterators Declare an iterator for a collection “()”operator

V Collection Example Scenario: use a collection of nine histograms and draw them on nine sub pads on a canvas myTree.DrawHistograms();

V Collection Example (cont.) 1. Download needed files. 2. Decide what type of collection we need. 3. Add the collection to the class

V Collection Example (cont.) 4. Change the Loop() to fill the histograms 5. Fill the Array 6. Declare the method to draw the histograms: voidDrawHistograms(void);

V Collection Example (cont.) 7. Implement DrawHistograms(). Create a canvas and divide it into 9 sub-pads. 8. Use the iterator to draw each histogram in a sub-pad.

V Collection Example (cont.) 9. Load and run

V Collection Example:TMap Scenario: Add a method that takes up to nine names of histograms as parameters and draws them in order. myTree.DrawHistograms ("Px", "Py", "Xfirst", "Xlast")

V Collection Example:TMap (cont.) 1. Decide what type of collection we need. 2. Add the collection to the class

V Collection Example:TMap (cont.) 3. Build the map from the array. fHistoMap.Add( new TObjString( theHisto->GetName()),theHisto);

V Collection Example:TMap (cont.) 4. Declare the method to draw the histograms: voidDrawHistograms(char * name1, char * name2 = 0...); 5. Create a TObjArray of names.

V Collection Example:TMap (cont.) 6. Find the histograms in the Map and draw them.

V Collection Example:TMap (cont.) 7. Load and run

V Exercise 4 Add a method to the ABC class with the following signature: void MakeHistos(char * n1, char * n2, char * n3, char * n4) MakeHistos will: –draw the histograms specified in the list of names –save the histograms to a file called ABC_histos.root