TTree::Draw What is it trying to be? Where is it going?

Slides:



Advertisements
Similar presentations
Question Bank. Explain the syntax of if else statement? Define Union Define global and local variables with example Concept of recursion with example.
Advertisements

Lists and the Collection Interface Chapter 4. Chapter Objectives To become familiar with the List interface To understand how to write an array-based.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Introduction to Arrays Chapter What is an array? An array is an ordered collection that stores many elements of the same type within one variable.
Add two strings representing numbers Carry = 0 S1 = S2 = S3 =
1 Today’s lecture  Last lecture we started talking about control flow in MIPS (branches)  Finish up control-flow (branches) in MIPS —if/then —loops —case/switch.
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)
This Time Pointers (declaration and operations) Passing Pointers to Functions Const Pointers Bubble Sort Using Pass-by-Reference Pointer Arithmetic Arrays.
CMPT 225 Sorting Algorithms Algorithm Analysis: Big O Notation.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Introduction to Arrays.
Chapter 9 Arrays. 2 Knowledge Goals Understand the difference between atomic and composite data types Understand the difference between unstructured and.
CMPUT 101 Lab #6 October 29, :00 – 17:00. Array in C/C++ Array is a structure type variable. One dimension of array int: int num[3]; There are.
Pointers A pointer is a variable that contains memory address as its value. A variable directly contains a specific value. A pointer contains an address.
Lists and the Collection Interface Chapter 4. Chapter 4: Lists and the Collection Interface2 Chapter Objectives To become familiar with the List interface.
Chapter 14 Generics and the ArrayList Class Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Fall 2007CS 2251 Lists and the Collection Interface Chapter 4.
Introduction of Arrays. Arrays Array form an important part of almost all programming language. It provides a powerful feature and can be used as such.
7.1 Arrays Introduction to arrays Any array is a collection of objects or primitives Useful when the number of reference variables is large or.
Sanjay Goel, School of Business, University at Albany, SUNY 1 MSI 692: Special Topics in Information Technology Lecture 4: Strings & Arrays Sanjay Goel.
Chapter 10 2D Arrays Collection Classes. Topics Arrays with more than one dimension Java Collections API ArrayList Map.
Games and Simulations O-O Programming in Java The Walker School
Chapter 6Java: an Introduction to Computer Science & Programming - Walter Savitch 1 l Array Basics l Arrays in Classes and Methods l Programming with Arrays.
Overview of Previous Lesson(s) Over View  OOP  A class is a data type that you define to suit customized application requirements.  A class can be.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
Java ProgrammingtMyn1 Java Programming Timo Mynttinen Mikkeli University of Applied Sciences.
Introduction to Arrays in Java Corresponds with Chapter 6 of textbook.
Comp 335 File Structures Hashing.
Copyright © Curt Hill Generic Classes Template Classes or Container Classes.
MA/CS 375 Fall 2002 Lecture 3. Example 2 A is a matrix with 3 rows and 2 columns.
Pointers A pointer is a variable that contains a memory address as it’s value. The memory address points to the actual data. –A pointer is an indirect.
CSE 232: C++ memory management Overview of Arrays Arrays are the simplest kind of data structure –One item right after another in memory (“contiguous range”
Data Structures Lecture 2: Array Azhar Maqsood NUST Institute of Information Technology (NIIT)
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
Problem Solving Methodology Rachel Gauci. Problem Solving Methodology Development Design Analysis Evaluation Solution requirements and constraints. Scope.
Computer Organization and Design Pointers, Arrays and Strings in C Montek Singh Sep 18, 2015 Lab 5 supplement.
1 Homework / Exam Finishing K&R Chapter 5 today –Skipping sections for now –Not covering section 5.12 Starting K&R Chapter 6 next Continue HW5.
Arrays: Part Opening Discussion zWhat did we talk about last class? zWhat do you think the picture of memory looks like when we declare.
Structuring Data: Arrays ANSI-C. Representing multiple homogenous data Problem: Input: Desired output:
Review Sorting algorithms Selection Sort Insertion Sort Bubble Sort Merge Sort Quick Sort.
C LANGUAGE Characteristics of C · Small size
9/28/2005Philippe Canal, ROOT Workshop TTree / SQL Philippe Canal (FNAL) 2005 Root Workshop.
Lecture 7 February 24, Javadoc version and author Tags These go in the comments before named classes. –Put your SS# on a separate line from the.
MA/CS 375 Fall 2002 Lecture 2. Motivation for Suffering All This Math and Stuff Try the Actor demo from
Lec 13 Oct 21, 02. Array Initialization in the declaration statement ► int temp[5] = {98, 87, 92, 79,85}; ► char codes[6] = { ‘s’, ’a’, ‘m’, ‘p’, ‘l’,
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
CSE 332: C++ pointers, arrays, and references Overview of Pointers and References Often need to refer to another object –Without making a copy of the object.
Announcements You will receive your scores back for Assignment 2 this week. You will have an opportunity to correct your code and resubmit it for partial.
ROOT-CORE Team 1 Philippe Canal Markus Frank I/O Basic I/O, RDBMS interfaces, Trees.
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.
© Janice Regan, CMPT 128, January CMPT 128: Introduction to Computing Science for Engineering Students Introduction to Arrays.
Multidimensional Arrays Vectors of Vectors When One Is Not Enough.
ADVANCED POINTERS. Overview Review on pointers and arrays Common troubles with pointers Multidimensional arrays Pointers as function arguments Functions.
Chapter 16 Pointers and Arrays Pointers and Arrays We've seen examples of both of these in our LC-3 programs; now we'll see them in C. Pointer Address.
CS 31 Discussion, Week 7 Faisal Alquaddoomi, Office Hours: BH 2432, W 4:30-6:30pm, F 12:30-1:30pm.
Array and Pointers An Introduction Unit Unit Introduction This unit covers the usage of pointers and arrays in C++
Announcements Quiz this Thursday 1. Multi dimensional arrays A student got a warning when compiling code like: int foo(char **a) { } int main() { char.
Lecture 8: Collections, Comparisons and Conversions. Svetla Boytcheva AUBG, Spring COS 240 Object-Oriented Languages.
Python Fundamentals: Complex Data Structures Eric Shook Department of Geography Kent State University.
CSI 3125, Data Types, page 1 Data types Outline Primitive data types Structured data types Strings Enumerated types Arrays Records Pointers Reading assignment.
Pointers as arrays C++ Programming Technologies. Pointers vs. Arrays Pointers and arrays are strongly related. In fact, pointers and arrays are interchangeable.
Lists and the Collection Interface Chapter 4. Chapter 4: Lists and the Collection Interface2 Chapter Objectives To become familiar with the List interface.
Java for Beginners University Greenwich Computing At School DASCO
C++, OBJECT ORIENTED PROGRAMMING
Student Book An Introduction
Java for Beginners University Greenwich Computing At School DASCO
Introduction to Python
Data Structures & Algorithms
Course Overview PART I: overview material PART II: inside a compiler
Presentation transcript:

TTree::Draw What is it trying to be? Where is it going?

What is it? Quick way of creating Histograms or TEventList from a TTree. Quick way of creating Histograms or TEventList from a TTree. Implement one or 2 simple straight- forward loops Implement one or 2 simple straight- forward loops Outer loop: Outer loop: For each entries For each entries Inner loop: Inner loop: For each elements of the ‘implied’ 1D array For each elements of the ‘implied’ 1D array

What is the ‘implied’ 1D array For each variables, all array dimensions are calculated For each variables, all array dimensions are calculated With int fArr[6][4][7] “fArr[][3][]” has 2 dimensions: 6 and 7 For each dimension calculates the minimum size For each dimension calculates the minimum size With fFloat[4][9] “fArr[][3][]+fFloat[][]” has 2 dimensions: 4 and 7 Calculates fArr[ i ][3][ j ]+fFloat[ i ][ j ] for (i,j) in: Calculates fArr[ i ][3][ j ]+fFloat[ i ][ j ] for (i,j) in: (0,0),(0,1)…(0,6),(1,0)…(1,6)…(3,0)…(3,6) (0,0),(0,1)…(0,6),(1,0)…(1,6)…(3,0)…(3,6) Iteration$ with return the ‘index’ in the above mention list (I.e. 6*i+j) Iteration$ with return the ‘index’ in the above mention list (I.e. 6*i+j) Length$ will return the number of element in the list (I.e 4*7=28) Length$ will return the number of element in the list (I.e 4*7=28)

Other features The index of an array can be a “formula” The index of an array can be a “formula” If the classes of the objects in the tree is available, on can call their members functions If the classes of the objects in the tree is available, on can call their members functionsfH.GetXaxis().GetXmax() If the objects are of different types, one can cast to a specific type. The objects which are NOT of that type (or an inherited type) are skipped: If the objects are of different types, one can cast to a specific type. The objects which are NOT of that type (or an inherited type) are skipped: With TShape *fShape : “((TBRIK*)fShape)->GetVisibility()>0”

New: Custom Histogram Size Abilities to customize bin numbers (in rootrc and function call) Abilities to customize bin numbers (in rootrc and function call) In rootrc file: In rootrc file: Hist.Binning.?D.[x,y,z,Prof,Profx,Profy] Hist.Binning.?D.[x,y,z,Prof,Profx,Profy] In TTree::Draw In TTree::Draw tree.Draw("sqrt(x)>>hsqrt(500,10,20)“ tree.Draw("sqrt(x)>>hsqrt(500,10,20)“ 1 - bins in x-direction 1 - bins in x-direction 2 - lower limit in x-direction 2 - lower limit in x-direction 3 - upper limit in x-direction 3 - upper limit in x-direction 4-6 same for y-direction 4-6 same for y-direction 7-9 same for z-direction 7-9 same for z-direction

New: Specials Variables Entry$ Entry$ Return the current entry number; TTree::GetReadEntry() Return the current entry number; TTree::GetReadEntry() Entries$ Entries$ Return the total number of entries; TTree::GetEntries() Return the total number of entries; TTree::GetEntries() Length$ Length$ Return the total number of elements of this formula for this entry (like TTreeFormula::GetNdata() ) Return the total number of elements of this formula for this entry (like TTreeFormula::GetNdata() ) Iteration$ Iteration$ Return the current iteration over this formula for this entry (i.e. Varies from 0 to length$). Return the current iteration over this formula for this entry (i.e. Varies from 0 to length$).

Other New Features Array of objects Array of objects Fixed (added?) Support for 1D and 2D graphical cuts Fixed (added?) Support for 1D and 2D graphical cuts TEventList now carries not only the list of entries but also the internal conditions. TEventList now carries not only the list of entries but also the internal conditions. I.e filters both the entry and the array elements inside. I.e filters both the entry and the array elements inside.

Other New “Features” Proper treatments of strings and char arrays Proper treatments of strings and char arrays String inside arrays String inside arrays Variable length array inside a non-split TClonesArray Variable length array inside a non-split TClonesArray Variable size arrays coordination Variable size arrays coordination (Between main formula, selection and index formula) (Between main formula, selection and index formula)

Outstanding Bugs Check for pointers that are 0 in the method calling chain Check for pointers that are 0 in the method calling chain Handling of variable size array that happens to be of size 1 Handling of variable size array that happens to be of size 1 A few odd problem with strings A few odd problem with strings

Question fTracks a TClonesArray of TTrack fTracks a TClonesArray of TTrack fPoints an array of double inside TTrack fPoints an array of double inside TTrack What should the following do? What should the following do?tree->Draw("fTracks.fPoints[][]-fTracks.fPoints[][fTracks.fAvgPoints]"); Either Either fTracks[ I ].fPoints[ J ] - fTracks[ I ].fPoints[fTracks[ I ].fAvgPoints] Or Or fTracks[ I ].fPoints[ J ] - fTracks[ I ].fPoints[fTracks[ J ].fAvgPoints]

Future Plan 1. Calling CINT function (or macro file) 2. Allow arguments if function calls In particular, using a notation to be defined, the CINT function will have direct access to the entry data.

Future Plan 3. Allow following (transparently) TRef and TRefArray 4. Implement Index$(variable,dimension) 5. Add an interface to pass the histogram by address rather than name