Corso di Analisi dei Dati e delle Informazioni *
|
|
- Denis Gilmore
- 8 years ago
- Views:
Transcription
1 Corso di Analisi dei Dati e delle Informazioni * University of Pavia Doctorate School in Physics 2015 edition ROOT: an object-oriented Data Analysis framework * CADI: caṡo s. m. [dal lat. casus -us, propr. «caduta», der. di cadĕre «cadere», dal gioco dei dadi] Andrea Fontana Istituto Nazionale di Fisica Nucleare Sezione di Pavia
2 Course program C++ review A Vector3 class ROOT classes Interactive sessions, named and unnamed macros Graphs Histograms Ntuples Trees Tfiles Random numbers Mininimization with Tminuit ROOT exercises MC theory: Buffon s needle MC basics: central limit, hit or miss, tests n random generators Best fit with Minuit: Gradient, simplex, seek Chi2 and likelihood Binned and unbinned data Parameters estimation Statistical tests Addendum: Excel advances Solver Statistical tests External (free) libraries
3 ROOT classes The backbone of the ROOT architecture is a layered class hierarchy with, currently, around 1200 classes grouped in about 60 frameworks (libraries) divided in 19 main categories (modules). This hierarchy is organized in a mostly single-rooted class library, that is, most of the classes inherit from a common base class TObject.
4 Mother of all ROOT objects. Tobject and ROOT classes hierarchy The TObject class provides default behaviour and protocol for all objects in the ROOT system. It provides protocol for object I/O, error handling, sorting, inspection, printing, drawing, etc. Every object which inherits from TObject can be stored in the ROOT collection classes.
5 ROOT classes used in Physics ROOT has been developed by physicists and it was originally thought as a tool for physicists in the HEP community for analysing and displaying data. Now ROOT is much more widely known and used and its role became more general: it is now used in other fields, like in mathematical finance and in banking/trading. Its main role is still for the physicist, though, and the classes that it provides that are useful for us can be grouped as follows: - classes for data analysis; - classes for Physics computations and simulations; - classes for programming graphical interfaces;
6 ROOT analysis classes The first classes to be studied to start playing with ROOT are the ones to create histograms, graphs and trees/ntuples and to save them in ROOT files. Since these classes play a central role in many ROOT applications in HEP, We will see how to use them: - TF1 - TGraph - TH1F, TH2F - TNtuple - TFile - TTree We ll see also how to fit an experimental histogram with a parametrical function (e.g. a Gauss distribution).
7 Functions ROOT can be used to display a function of one variable, x TF1 *f1 = new TF1("f1","sin(x)/x",0.,10.); f1->draw(); A slightly extended version of this example is the definition of a function with parameters, called [0], [1] and so on in the ROOT formula syntax TF1 *f1 = new TF1("f2","[0]*sin([1]*x)/x",0.,10.); f1->setparameter(0,1); f1->setparameter(1,1); f1->draw();
8 User defined functions ROOT can be used to display also user functions of n variables and m parameters, by passing a pointer to the array of variables and to the array of parameters: double func(double *x, double *p) { return p[0]+p[1]*pow(x[0],1); } The function can be defined, together with the parameters, as: TF1 *f=new TF1("f",func,0,10,2); f->setparameter(0,1); f->setparameter(1,1); f->draw();
9 Graphs A graph is a graphical object made of two arrays X and Y and it holds the x,y coordinates of N points. First the data vectors with N elements are defined and the the constructor is invoked: Int_t N=10; Double_t x[n], y[n]; TGraph *g1 = new TGraph(N, x, y); The graph is drawn with: g1->draw(); and many graphical options are available: g1->draw( AL ); axis with polyline between points g1->draw( A* ); star at each point g1->draw( AB ); bar chart Graphs can be superimposed by leaving out the A option for the second graph or using a MultiGraph.
10 A sample Graph grandom->uniform(0.,1.)
11 Multigraphs Using a MultiGraph is a cool way to plot various graphs on the same canvas. A TMultiGraph object is simply a collection of TGraph objects (think of it like of an array of TGraphs ) Assuming to have two independent graphs: TGraph *g1 = new Tgraph(N, x1, y1); TGraph *g2 = new Tgraph(N, x2, y2); we can plot them on the same sheet: TMultiGraph *mg = new TMultiGraph(); mg->add(g1); mg->add(g2); mg->draw( ALP );
12 Graphs: input from ASCII files A graph is a graphical object made of two arrays X and Y and it holds the x,y coordinates of N points. TGraphErrors(const char *filename, const char *format="%lg %lg %lg %lg", Option_t *option=""); The format string can be: "%lg %lg" read only 2 first columns into X,Y "%lg %lg %lg" read only 3 first columns into X,Y and EY "%lg %lg %lg %lg" read only 4 first columns into X,Y,EX,EY
13 Histograms ROOT supports histograms in 1D, 2D and 3D and also profile histograms. Histograms are created with the constructor: TH1F *h1 = new TH1F( h1, h1 title, 100, 0, 5); TH2F *h2 = new TH2F( h2, h2 title, 100, 0, 5, 100, -1, 1); With the following parameters (for the TH1 object): - histogram s name (TH1F inherits from TNamed) - histogram s title - number of bins - x minimum - x maximum The bin size is fixed by default, but variable bin sizes are supported with the constructor TH1F *h1 = new TH1F( h1, h1 title, 100, xbins); where xbins is an array of low edges for each bin.
14 Filling Histograms Histograms are filled using the Fill() method that is overloaded to handle different cases: h1->fill(x); h1->fill(x,w); h2->fill(x,y); h2->fill(x,y,w); The Fill() method computes the bin number corresponding to the given x and y argument and increments this bin by the given weight (the default weight is 1). During filling some statistical parameters are incremented to compute the mean value and the root mean square. A random number filling method is available to fill histograms according to a distribution: h1->fillrandom( gaus,10000);
15 Drawing Histograms Histograms can be drawn in various formats and with many options. The basic command is: h1->draw(); The histogram is drawn inside a TPad and within a TCanvas. These are graphical objects used to store multiple histograms in the same view: Tcanvas *c1 = new Tcanvas( c1, Canvas with histos ); c1->divide(1,2); c1->cd(1); h1->draw(); c1->cd(2); h2->draw(); It is possible to superimpose histograms with: h1->draw(); h2->draw( same );
16 A sample 1D histogram
17 Fitting Histogram ROOT provides a graphical interface to fit 1D histograms according to well known and very common functions: Gaussian, Landau, Polynomia and user functions. To fit an histogram with a user function, it is necessary to write a separate function that holds the function and the parameters in an array. Better method: class TMinuit.
18 Comparing TF1, TGraph and TH1F Some warnings on common operations, like: Direct comparison Rescaling Normalization Integration See example
19 TNtuple Ntuples are very common data structures in the HEP community to store experimental data and their use stems from the days of PAW and fortran programming. An ntuple can be thought as a spreadsheet table in two dimensions and it is a structure optimized to collect and store numerical data into a ROOT file. It is built with the constructor: Tntuple *nt = new Tntuple( ntuple, A simple table, x:y ); and filled (within a loop where x and y are evaluated) with: ntuple->fill(x,y); It can be viewed and browsed with: ntuple->print(); ntuple->scan();
20 Working with data in ntuples The Scan() method allows to browse through all the ntuple entries. It is also possible to make cuts on variables with commands like: ntuple->scan( x, y>0.5 ); It is possible to directly draw histograms of data entries in ntuples by invoking the Draw() method for the ntuple. A default histogram called htemp is draw n on a default canvas: ntuple->draw( x );
21 The C++ interpreter Written by Masaharu Goto in C (up to ROOT 5) CLING in ROOT6 (very new!) Standalone (non root) version available Incorporated in ROOT Applied for: Interactive command line Macro execution (language: C++ with extras); may compile macro at runtime (ACLiC feature) for debugging purposes Generates object introspection metadata ( dictionary ) when compiling ROOT
22 CINT command line 1. CINT native commands start with..? list all the CINT commands.x [filename] load [filename] and execute function [filename] e.g.: root[1].x plot.c( data.root ).L [filename] load [filename] e.g. root[2].l plot.c.! [shellcmd] execute shell command e.g. root[3].! ls al
23 CINT command line 2.Expression evaluation (advanced calculator): root[3] 3*4 (int)12 3. C++ Syntax (almost; see below...): root [0] TBrowser *b = new TBrowser() or root [0] TBrowser *b = new TBrowser(); 4. Leave off final semicolon to see the return value of the command. root [0] 23+5 // show return value (int)28 root [1] 23+5; // no return value root [2]
24 CINT: differences with compiled C++ Declaration can be omitted f = new TFile( data.root"); Member access: "." and "-> both possible (depends on ROOT version) f.ls() or f->ls() Local object is not deleted when leaving scope { TString s( test ); cout << s.data()<<endl; // OK } cout << s.data()<< endl; // only in CINT!
25 CINT: differences with compiled C++ 1. Unknown variables are automatically initialized by searching the object of that name in groot: TH1F *h = new TH1F ( histo","fpx,100,-5,5); histo->draw(); Implicitely the following is done (as correct for compiled code): TH1F* histo=dynamic_cast<th1f*> (groot->findobject( histo")); histo->draw(); C++ variable name ROOT object name
26 Using ROOT classes interactively >root root [] TF1 f1( function1","sin(x)/x",0,10); root [] f1.draw(); // pure C++ or root [] function1.draw(); //cint reference by root name root [] f1.eval( )... See ROOT class documentation root [] f1.derivative(2.3) for existing methods!.. root [] f1.integral(0,3)... root [].q
27 Root GUI: TCanvas
28 Root GUI: TBrowser
29 Global ROOT objects (examples) groot (session object singleton, class TROOT) TObject* ob=groot->findobject( hpx ); // get known object by root name TSeqCollection* list= groot->getlistoffiles(); // access to collections of registered objects groot->setbatch(ktrue); // switch to non graphic mode gsystem (operating system interface, class TSystem) gsystem->load( libstt.so ); // load external library (for CINT) gsystem->exec( rm rf *.root ); // call shell command (from compiled code) gdirectory (current root directory, class TDirectory) cout <<gdirectory->getname()<< endl; gpad (currently selected draw pad, class TPad) gpad->clear();
30 Unnamed scripts Example hsimple.c (from ROOT tutorials): used ROOT classes: TFile: root file handle object TCanvas: window to draw graphics TH1F, TH2F, TProfile: histogram classes TNtuple: ntuple of values (simple TTree) TRandom (global grandom): random generator TBenchmark (global gbenchmark)
31 Named scripts Examples (from tutorial directory in ROOT): root >.L fithist.c root > fithist() root > root >.x fithist.c() script must contain one function with same name as scriptfile (for.x) script function may have arguments script may contain also other functions / subroutines script may contain class definitions objects in scope of named scripts are deleted after leaving script, objects in scope of unnamed scripts remain available! root >.L htest.c root > htw() root > htr1() root > htr2() root > htr3() A good example
32 ROOT files ROOT objects can be saved to files for future analysis or simply for storage. A ROOT file is very similar to a UNIX file directory, with directories and objects organized in a user-decided structure and in a machine independent format (very important!). By opening a ROOT file (in overwrite mode) with the constructor: TFile f( Test.root, recreate ); this file becomes the current directory and all the objects created from now on are saved into the file by invoking the respective Write method (which is a method defined for TObject). For instance for an histogram called h, we will write it to the above Tfile by: h->write(); This method is not very efficient for writing MANY objects.
33 TFile and TDirectory TDirectory: logical organisation of Tobjects (ownership, subdirectory structure,...) TFile is a TDirectory related to a storage medium (disk, tape, remote server,...) Last created TFile is current file: TH1 and TTrees created afterwards are owned by file and deleted on file close! (default, can be changed by user) TObject::Write() saves to current file A Root object belongs to one TDirectory only, but may be in several collections and TFolder
34 A sample ROOT file We have an histogram filled with random numbers generated according to a Gaussian distribution and save it into a ROOT file: TFile f( Histos.root, recreate ); char name[10], title[20]; for(int_t k=0; k<15; k++){ sprintf(name, h%d,k); sprintf(title, Histo %d,k); TH1F *h = new TH1F(name, title, 100, -4, 4); h->fillrandom( gaus,1000);} h->write(); f.close(); The file can then be reopened and its contents loaded in memory for display or further use: TFile f( Histos.root ); TH1F *g = (TH1F*)f.Get( h3 ); g->draw();
35 Useful facts about ROOT files It is possible to graphically browse through a ROOT file using a Tbrowser object: TFile f( Test.root ); TBrowser browser; A ROOT file is always compressed by default using a gzip-like compression algorithm. The default level of compression is 1, a compromise value for speed a compression efficiency. It can be changed by: f.setcompressionlevel(n) n=0: no compression, n=9: best By closing a ROOT file, all the objects in the present directory are saved to the file and removed from the memory. Any reference to them results in an error! f.close(); h->draw(); ERROR!
36 Saving objects to files A TFile provides persistency, but it is not very efficient in terms of optimizing disk space and access speed. This is particularly true when saving many objects of the same class. Writing millions of objects to a TFile involves writing an object header to the file which is always the same, with a great waste of time and space. ROOT provides a solution to this problem (very common in HEP) with the TTree class (and its simplified version TNtuple class). A TTree provides a structure to organize data, clever enough not to duplicate the object header and optimized for data access. These structures are filled with data and written to a TFile, instead of writing data directly to the TFile. A TTree is a true OO database for storing data and is widely used in the HEP community for saving data.
37 Trees A Tree is a key concept in ROOT and it also give the name to ROOT, along with Tbranch, Tleaf A Ttree object is a generalization of the ntuple concept and is a structure to hold objects, both ROOT objects and user-defined objects. A Ttree is divided in branches, one branch for each object and when it is filled the branch buffers are filled first and written to the file when the buffer is full. TTrees are also optimized for access to data by using a hierarchy of branches that can be accessed individually. Important: a Ttree is not editable! Once written, no data cannot be updated and it can only be read.
38 TTrees features Designed to store large number of events (buffering, compression, IO with TFile) Data organized hierarchically into branches Branches may be read back partially (performance!) TTree::Draw(... ) implicit analysis loop by string expression TTree::MakeClass() automatic code generation for explicit analysis loop TChain : public TTree process sequentially trees of same structure in several files TTree::AddFriend access parallel events of a friend tree with different branch structure (for TTree::Draw() expression)
39 TBranches The TTree basic entry is a Tbranch object, that creates a column (very loosely speaking) in our table. A Tbranch can hold an entire object, a list of variables or even an array of objects. TBranches can be built in three ways: 1) with a list of variables from a C-like structure (see ntuples) tree->branch( Data Branch,&data, x/d:y/d ); 2) with an object (like a TVector3 for example): TVector3 *v = new TVector3(); tree->branch( Data Branch, TVector3, &v,64000,0); 3) with an array of objects (like a TClonesArray of TVector3s): TClonesArray ca; tree->branch( Data Branch, TVector3, &ca,64000,0);
40 TTrees of objects The TBranch method stores objects constructed according to a given class in a branch: TVector3 *v = new TVector3(); tree->branch( Data Branch, TVector3, &v,64000,1); Parameters to the Branch() method are: - branch name - the class name - the address of a pointer to an object - the buffer size (in bytes) - a flag that indicates the split mode (in split mode=1 the data members (leaves) are saved in separate subbranches, while in split mode=0 the object is saved as an entity and not broken down to elementary types). The tree is then filled (within a loop where v contains data): tree->fill();
41 The 5 steps to build a TTree There is traditionally a 5 steps recipe to build a tree, fill it with data and store it into a ROOT file: 1) Create the file 2) Create the TTree 3) Add Tbranches to the TTree 4) Fill the TTree 5) Write the TTree to the TFile
42 Creating a TTree TFile* hfile = new File("AFile.root","RECREATE","Example"); TTree* mytree = new TTree( Mytree, Mytree ); TEvent *event = new TEvent(); // structure to save mytree->branch("eventbranch", TEvent",&event, 32000,1); Branch name Event class name Address of pointer to event object Buffer size Split level Split=0 Split=1 (default)
43 Filling a TTree for(int_t i=0; i<500000; ++i){ Float_t random = grandom->rndm(1); event->fvalue=random*3; // put values into event structure event->fsum+=random;... mytree->fill(); // will write event into tree basket buffer } mytree->write(); // will write tree buffers and header to file delete myfile; // destructor of TFile will close it TTree::Fill will write data from all active branches (deactivate branch with TTree::SetBranchStatus) Different TTree::Branch() methods for data from simple variables, collections, folders, class objects (see ROOT docs and tutorials)
44 Reading a TTree explicitely TFile hfile("afile.root"); TTree* tr= dynamic_cast<ttree*>(hfile.get( Mytree )); if(tr==0){ cerr << error: did not find tree! ; return 1; // or may throw exception here... } TObject* h1= new TH1F( hpx, title,2048,0,2047); TEvent* eve= new TEvent; tr->setbranchaddress( EventBranch,&eve); // by branchname! Int_t all=tr->getentries(); // number of events for(int_t i=0; i<all; ++i){ tr->getentry(i); // read event #i into memory h1->fill(eve->fvalue); // do analysis on members of event class here! //... }
45 Reading a TTree explicitely Event object at SetBranchAddress must match the structure used on writing the tree TTree::GetEntry will read data from active branches only (deactivate branch with SetBranchStatus( branchname, 0)) Use TChain instead of TTree to sum trees of same structure in different files (see ROOT doc). TTree::MakeClass() generates sourcecode for event reading from given TTree (eventclass need not be known!) See example below... Explicit reading of events is not necessary for simple analysis, use TTree::Draw() feature (GUI: treeviewer)!
46 TTree Draw() examples TTree* tr=.. // got from file tr->draw( fvalue, fvalue>100 && fvalue<500 ); // fill default histogram htemp with fvalue if // condition is true; draw htemp tr->draw( fx:fy >> hpxpy,, lego ); // fill existing 2d histogram of name hpxpy // and display as lego plot tr->draw( fmatrix[][]/fvalue >>+hmatrix, ); // continue filling histogram hmatrix // with sum of all elements of matrix by fvalue tr->draw( >>myeventlist, sqrt(fvalue)>fmatrix[0][2] ); // mark all events in tree that fulfill // the condition into TEventList myeventlist
47 TTree Draw() TTree::Draw(expression,selection,option) May fill histogram/graph from expression, or will mark matching events in a TEventList Expression may contain any combination of known branch names Expression may specify output histogram name and dimensions, or output eventlist Selection gives condition between branch values of one event; this must be true to execute expression Option may contain draw option for result histogram See ROOT Docs for complete list of features!
48 TEventList A ROOT TEventList is a list of event numbers. The TEventList is used to constrain the events used in processing such as for histogram creation. This is useful when dealing with large files. root [0] TFile f( data.root") root [1] TTree *t = (TTree*)f->Get( tree") root [2] t->getentries() (const Stat_t) e+004 root [3] t->draw(">>elist", x>0 && y<0") (Int_t)13485 root [4] elist->getn() (const Int_t)13485 root [5] t->seteventlist(elist) root [6] t->draw( z") root [7] t->seteventlist(0) root [8] t->draw( z")
49 TEventList What about more complex TTrees like the hits, digi and reconstruction ROOT TTrees? In this case, we use an event loop to find the events that satisfy our criteria. TFile *f = new TFile( data.root ); TTree *t = (TTree*)f->Get( tree ); Event *evt = new Event(); t->setbranchaddress( Event, &evt); TEventList *elist = new TEventList(); UInt_t numevents = t->getentries(); UInt_t i; for (i = 0; i < numevents; i++) { t->getevent(i); if (evt->value() > 0) { elist->enter(i); } evt->clean();
50 TTree MakeClass() TFile hfile("afile.root"); TTree* tr= dynamic_cast<ttree*>(hfile.get( Mytree )); if(tr!=0) tr->makeclass( MyAnalysis ); Generates code skeleton for analysis of any Ttree (files MyAnalysis.h, MyAnalysis.C) Tree is analyzed by generated class MyAnalysis: members contain each branch/leaf found in tree constructor initializes tree/chain from file(s) Init(TTree*) sets branch addresses to members Show(int num) dumps entry #num Loop() here user can put own analysis code
51 TTree MakeClass() root>.l MyAnalysis.C root> MyAnalysis an; // should initialize tree root> an.loop(); // run implicit analysis loop Class MyAnalysis may be used from CINT or can be compiled Quick code generation even for unknown data structures! Substructure of original event class may be lost, all tree branches are mapped flat to MyAnalysis data members See Root users guide for further description...
52 Automatic Compiler of Libraries for CINT (ACLiC) >root root [].x fithisto.c() execute script in interpreter root [].x fithisto.c+() compile script into library fithist.c.so in background, then execute function (note: only recompile if fithist.c have changed since last compile) root [].x fithisto.c++() compile library in any case before execution root [].L fithisto.c+ compile script and load library, but do not execute root [] fithisto() will execute loaded function root [].L fithisto.c++g // compile and execute function with debug (-g) root [].x fithisto.c++o // compile and execute function with optimization (-O) ACLiC needs external tools to compile the shared library.
53 Executables and ROOT scripts Very simple way to transform a ROOT script into a real compiled executable program by using the TROOT class. #include <iostream> #include "TApplication.h" #include "TFile.h" #include "TH1.h" { using namespace std; int main(int argc, char **argv) { } TApplication myapp("app", &argc, argv); TFile *f=new TFile("pdebug.root","recreate"); TH1F *h=new TH1F("h","h",100,-5,5); h->fillrandom("gaus",10000); h->draw(); h->write(); The original script: groot->reset(); TH1F *h=new TH1F("h","h",100,-5,5); h->fillrandom("gaus",10000); h->draw(); Working with a real programs makes // f->close(); easier to debug it and allows to create myapp.run(); CINT independent programs, that } return 0; only use ROOT as an external library.
54 Debugging ROOT A debug session of a ROOT program with TVector3 objects: a is on the stack, *b on the heap! Having a ROOT executable program, it is much more easy to debug it by using standard debuggers, like gdb or ddd. CINT has its own debug, but it is very basic and lacks a graphical interface.
55 C++ differences CINT interpreted ACLiC Compiled code ROOT class declarations ROOT classes require to ROOT classes require to are known implicitely include declarations, too include declarations, too NOTE: include all non- e.g. #include TH1.h e.g. #include TH1.h ROOT classes! ROOT class definitions Automatic linking against ROOT classes require to are known implicitely ROOT libs and the link against respective generated library libraries when building executable Makefile No function declaration needed Declare function before use Declare function before use CINT C++ Compiler C++ Compiler C++
56 Extending ROOT Creation of a ROOT dictionary allow to access the ROOT advanced I/O functions by adding extra member functions to user classes (streamers) and to add RTTI data to users programs. RTTI means Run Time Type Information and it is a system to find out which class an object belongs, its baseclasses, its datamembers and methods, the methods signatures and other informations needed to make advanced object browsers and to use the automatic documentation generation. To add user classes to ROOT it is necessary to add two calls to functions that links the classes to the dictionary: - ClassDef(ClassName, ClassVersionID); - ClassImp(ClassName); and to prepare a LinkDef.h file and a Makefile.
57 Adding own classes to ROOT Motivation: User subclasses of TObject may benefit from ROOT I/O, collections, runtime introspection,... Interpreter: just load class definition (see MakeClass example), but no I/O for new class possible! Compiled into user library: add ClassImp / ClassDef statements in class sources prepare LinkDef.h file provide dictionary generation in Makefile
58 Adding own classes to ROOT MyEvent.h class MyEvent : public TObject{ public: MyEvent(); fvalue; fmatrix[100][100]; // lots of data members here... ClassDef(MyEvent,1) }; Macros, create code for Streamer, type information, etc. ClassImp(MyEvent) MyEvent::MyEvent(){} // may contain other method definitions... MyEvent.cxx
59 Adding own classes to ROOT LinkDef.h #ifdef CINT #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class MyEvent; #endif Class name may have Options: #pragma link C++ class MyEvent-; do not generate automatic streamer (for objects with customized streamers) #pragma link C++ class MyEvent!; do not generate the operator >> (for classes not inheriting from TObject) #pragma link C++ class MyEvent+; enable new ROOT I/O (from Root >v.3)
60 Adding own classes to ROOT In the Makefile (for generation and linking of ROOT dictionary): libmyevent.so: MyEvent.o MyEventDict.o g++ -shared Wl soname libmyevent.so O MyEvent.o MyEventDict.o o libmyevent.so #... #... MyEventDict.cxx MyEvent.h LinkDef.h $(ROOTSYS)/bin/rootcint -f MyEventDict.cxx -c MyEvent.h LinkDef.h
61 Exercise 1 Write simple class, call it MyClass and store it in MyClass.h and MyClass.cxx Generate dictionary: rootcint f MyDict.cxx c MyClass.h Compile MyClass.cxx and mydict.cxx into a shared library: g++ -shared fpic `root-config - cflags` -o libmyclass.so MyClass.cxx MyDict.cxx
62 Exercise 1 (cont.) Start ROOT, load libmyclass.so: $ root root [0] gsystem->load( libmyclass ) Create and play with MyClass object: root [1] MyClass a root [2] a.print() root [3]
63 Linking Class to ROOT RTTI To link a class to the ROOT RTTI system two macros need to be added to MyClass: ClassDef(class name, version id) // MyClass.h class MyClass { public:... ClassDef(MyClass,1) // analyse my data }; ClassImp(class name) // MyClass.cxx #include MyClass.h ClassImp(MyClass)
64 ClassDef and ClassImp These macros provide: Several static methods to obtain reflection/meta class information static TClass *Class(); static const char *Class_Name(); virtual TClass *IsA() const; Inspection and Streamer (I/O) methods virtual void ShowMembers(TMemberInspector &insp, char *parent); static Version_t Class_Version() { return id; } virtual void Streamer(TBuffer &b); friend TBuffer &operator>>(tbuffer &buf, name *&obj); Methods returning header and source file name Small class and static object to register class to ROOT when library is loaded
65 Exercise 2 Add ClassDef() and ClassImp() macros to MyClass And also add: #include <Rtypes.h> to MyClass.h Repeat same steps as in exercise 1: rootcint f MyDict.cxx c MyClass.h g++ -shared fpic `root-config - cflags` -o libmyclass.so MyClass.cxx MyDict.cxx $ root root [0] gsystem->load( libmyclass ) root [1] MyClass a root [2] a.print() root [3] a.p<tab> works now
66 Full Integration into ROOT To make your class a fully ROOT supported class, with full I/O capabilities, just add derivation from TObject to MyClass // MyClass.h class MyClass : public TObject { public:... ClassDef(MyClass,1) // analyse my data };
67 Exercise 3 Add public derivation from TObject to your class Replace the Rtypes.h include by TObject.h Repeat same two build steps as in the previous exercises Create object of MyClass and Dump() its run time contents: root [1] MyClass a root [2] a.dump() Root [3]
68 Exercise 3 (cont.) Open a file and write the object: root [1] MyClass a root [2] TFile f( test.root, recreate ) root [3] a.write( a1 ) root [4] f.close() Open a file and read the object: root [1] TFile f( test.root ) root [2] MyClass *a = (MyClass*) f.get( a1 ) root [3] f.close() root [4] a->dump()
69 Summary ROOT is a powerful tool for the modern HEP physicist both for analysis and for simulations. ROOT offers collections, folders, directories and files for organization of TObjects TTree is powerful class for keeping and analyzing event data (Draw(), TEventList(), MakeClass(),..) User can ROOTify own classes with a simple recipe (ClassImp, ClassDef, LinkDef.h, Makefile) Two things to remember when doing Physics with ROOT or any other OO system: - Quantum Mechanics is more difficult and you know it already! - Hamming s Rule: The purpose of computing is insight, not numbers.
70 Where to go from here?
71 Documentation and Forum
Brent A. Perdue. July 15, 2009
Title Page Object-Oriented Programming, Writing Classes, and Creating Libraries and Applications Brent A. Perdue ROOT @ TUNL July 15, 2009 B. A. Perdue (TUNL) OOP, Classes, Libraries, Applications July
More informationIntroduction to ROOT
Introduction to ROOT Last time and today Last time we took a quick look at LATEX Today we will start the second half of the course ROOT A basic introduction. We start with really using ROOT next time when
More information11 Input/Output. The Physical Layout of ROOT Files
11 Input/Output This chapter covers the saving and reading of objects to and from ROOT files. It begins with an explanation of the physical layout of a ROOT file. It includes a discussion on compression,
More informationIntroduction to ROOT and data analysis
Introduction to ROOT and data analysis What is ROOT? Widely used in the online/offline data analyses in particle and nuclear physics Developed for the LHC experiments in CERN (root.cern.ch) Based on Object
More informationGO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4GO4G
J.Adamczewski, H.G.Essel, S.Linev Lectures Juni 2006 Go4 v3 - http://go4.gsi.de 1 Lectures day 1 10.00h Essel Go4 V3 Overview Analysis design GUI control 10.45h Essel Simple Analysis First look into analysis
More informationAn Incomplete C++ Primer. University of Wyoming MA 5310
An Incomplete C++ Primer University of Wyoming MA 5310 Professor Craig C. Douglas http://www.mgnet.org/~douglas/classes/na-sc/notes/c++primer.pdf C++ is a legacy programming language, as is other languages
More informationROOT Basics. Deb Mohapatra. This lecture is based on Fermilab ROOT tutorial and ROOT lecture in CERN summer school
ROOT Basics Deb Mohapatra This lecture is based on Fermilab ROOT tutorial and ROOT lecture in CERN summer school WHAT IS ROOT? Introduction ROOT is an object oriented framework It has a C/C++ interpreter
More informationUse of ROOT in Geant4
Use of ROOT in Geant4 A.Dotti, SLAC I. Hrivnacova, IPN Orsay W. Pokorski, CERN ROOT Users Workshop, 11-14 March 2013, Saas-Fee Outline Analysis tools in Geant4 Use of Root in Geant4 testing Experience
More information12 Trees. Why Should You Use a Tree? A Simple TTree
12 Trees Why Should You Use a Tree? In the Input/Output chapter, we saw how objects can be saved in ROOT files. In case you want to store large quantities of same-class objects, ROOT has designed the TTree
More informationKITES TECHNOLOGY COURSE MODULE (C, C++, DS)
KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL
More informationThe C Programming Language course syllabus associate level
TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming
More informationHow To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)
TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions
More informationStorage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas
CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage
More information16 Collection Classes
16 Collection Classes Collections are a key feature of the ROOT system. Many, if not most, of the applications you write will use collections. If you have used parameterized C++ collections or polymorphic
More informationMakefiles and ROOT. Sean Brisbane 12/12/11
Makefiles and ROOT Sean Brisbane 12/12/11 Introduction and purpose By the end of today you should know: The basics of the g++ compiler; How to write Makefiles for medium-sized projects; How to build a
More informationPROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON
PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London
More informationC++ Programming Language
C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract
More informationCpSc212 Goddard Notes Chapter 6. Yet More on Classes. We discuss the problems of comparing, copying, passing, outputting, and destructing
CpSc212 Goddard Notes Chapter 6 Yet More on Classes We discuss the problems of comparing, copying, passing, outputting, and destructing objects. 6.1 Object Storage, Allocation and Destructors Some objects
More informationPART-A Questions. 2. How does an enumerated statement differ from a typedef statement?
1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members
More informationC++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
More informationThomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation
Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science updated 03/08/2012 Unit 1: JKarel 8 weeks http://www.fcps.edu/is/pos/documents/hs/compsci.htm
More information25 Writing a Graphical User Interface
25 Writing a Graphical User Interface The ROOT GUI classes support an extensive and rich set of widgets with the Windows 95 look and feel. The widget classes interface to the underlying graphics system
More informationWeb-based based Access to ROOT
Web-based based Access to ROOT at D-ZeroD Displaying histograms generated by ROOT in a Web Browser ROOT histogram server program Proxy CGI program invoked by a Web server from an HTML forms page Virtual
More informationGlossary of Object Oriented Terms
Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction
More informationGetting Started with the Internet Communications Engine
Getting Started with the Internet Communications Engine David Vriezen April 7, 2014 Contents 1 Introduction 2 2 About Ice 2 2.1 Proxies................................. 2 3 Setting Up ICE 2 4 Slices 2
More informationA QUICK OVERVIEW OF THE OMNeT++ IDE
Introduction A QUICK OVERVIEW OF THE OMNeT++ IDE The OMNeT++ 4.x Integrated Development Environment is based on the Eclipse platform, and extends it with new editors, views, wizards, and additional functionality.
More informationROOT: A Data Analysis and Data Mining Tool from CERN
ROOT: A Data Analysis and Data Mining Tool from CERN Ravi Kumar ACAS, MAAA, and Arun Tripathi, Ph.D. Abstract This note briefly describes ROOT, which is a free and open-source data mining tool developed
More informationCISC 181 Project 3 Designing Classes for Bank Accounts
CISC 181 Project 3 Designing Classes for Bank Accounts Code Due: On or before 12 Midnight, Monday, Dec 8; hardcopy due at beginning of lecture, Tues, Dec 9 What You Need to Know This project is based on
More informationAppendix K Introduction to Microsoft Visual C++ 6.0
Appendix K Introduction to Microsoft Visual C++ 6.0 This appendix serves as a quick reference for performing the following operations using the Microsoft Visual C++ integrated development environment (IDE):
More informationC++FA 5.1 PRACTICE MID-TERM EXAM
C++FA 5.1 PRACTICE MID-TERM EXAM This practicemid-term exam covers sections C++FA 1.1 through C++FA 1.4 of C++ with Financial Applications by Ben Van Vliet, available at www.benvanvliet.net. 1.) A pointer
More informationName: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
More informationWESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math
Textbook Correlation WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Following Directions Unit FIRST QUARTER AND SECOND QUARTER Logic Unit
More informationC Programming Review & Productivity Tools
Review & Productivity Tools Giovanni Agosta Piattaforme Software per la Rete Modulo 2 Outline Preliminaries 1 Preliminaries 2 Function Pointers Variadic Functions 3 Build Automation Code Versioning 4 Preliminaries
More informationFundamentals of Java Programming
Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors
More informationCS 103 Lab Linux and Virtual Machines
1 Introduction In this lab you will login to your Linux VM and write your first C/C++ program, compile it, and then execute it. 2 What you will learn In this lab you will learn the basic commands and navigation
More informationEl Dorado Union High School District Educational Services
El Dorado Union High School District Course of Study Information Page Course Title: ACE Computer Programming II (#495) Rationale: A continuum of courses, including advanced classes in technology is needed.
More informationDiskPulse DISK CHANGE MONITOR
DiskPulse DISK CHANGE MONITOR User Manual Version 7.9 Oct 2015 www.diskpulse.com info@flexense.com 1 1 DiskPulse Overview...3 2 DiskPulse Product Versions...5 3 Using Desktop Product Version...6 3.1 Product
More informationXcode Project Management Guide. (Legacy)
Xcode Project Management Guide (Legacy) Contents Introduction 10 Organization of This Document 10 See Also 11 Part I: Project Organization 12 Overview of an Xcode Project 13 Components of an Xcode Project
More informationLeak Check Version 2.1 for Linux TM
Leak Check Version 2.1 for Linux TM User s Guide Including Leak Analyzer For x86 Servers Document Number DLC20-L-021-1 Copyright 2003-2009 Dynamic Memory Solutions LLC www.dynamic-memory.com Notices Information
More informationPhys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions
Phys4051: C Lecture 2 & 3 Functions (Review) Comment Statements Variables & Operators Branching Instructions Comment Statements! Method 1: /* */! Method 2: // /* Single Line */ //Single Line /* This comment
More informationCORBA Programming with TAOX11. The C++11 CORBA Implementation
CORBA Programming with TAOX11 The C++11 CORBA Implementation TAOX11: the CORBA Implementation by Remedy IT TAOX11 simplifies development of CORBA based applications IDL to C++11 language mapping is easy
More informationThis chapter is an example of a typical physics analysis. Large data files are chained together and analyzed using the TSelector class.
21 Example Analysis This chapter is an example of a typical physics analysis. Large data files are chained together and analyzed using the TSelector class. Explanation This script uses four large data
More informationCompiler Construction
Compiler Construction Lecture 1 - An Overview 2003 Robert M. Siegfried All rights reserved A few basic definitions Translate - v, a.to turn into one s own language or another. b. to transform or turn from
More informationObject Oriented Software Design II
Object Oriented Software Design II Introduction to C++ Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 20, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February
More informationMonitoring, Tracing, Debugging (Under Construction)
Monitoring, Tracing, Debugging (Under Construction) I was already tempted to drop this topic from my lecture on operating systems when I found Stephan Siemen's article "Top Speed" in Linux World 10/2003.
More informationCopyright 2001, Bill Trudell. Permission is granted to copy for the PLoP 2001 conference. All other rights reserved.
The Secret Partner Pattern Revision 3a by Bill Trudell, July 23, 2001 Submitted to the Pattern Languages of Programs Shepherd: Neil Harrison PC Member: Kyle Brown Thumbnail This paper describes the Secret
More informationGetting off the ground when creating an RVM test-bench
Getting off the ground when creating an RVM test-bench Rich Musacchio, Ning Guo Paradigm Works rich.musacchio@paradigm-works.com,ning.guo@paradigm-works.com ABSTRACT RVM compliant environments provide
More informationVisual Basic Programming. An Introduction
Visual Basic Programming An Introduction Why Visual Basic? Programming for the Windows User Interface is extremely complicated. Other Graphical User Interfaces (GUI) are no better. Visual Basic provides
More informationIntroduction to Matlab
Introduction to Matlab Social Science Research Lab American University, Washington, D.C. Web. www.american.edu/provost/ctrl/pclabs.cfm Tel. x3862 Email. SSRL@American.edu Course Objective This course provides
More informationTEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control
TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control Version 3.4, Last Edited 9/10/2011 Students Name: Date of Experiment: Read the following guidelines before working in
More information2. Advance Certificate Course in Information Technology
Introduction: 2. Advance Certificate Course in Information Technology In the modern world, information is power. Acquiring information, storing, updating, processing, sharing, distributing etc. are essentials
More informationUnderstand for FORTRAN
Understand Your Software... Understand for FORTRAN User Guide and Reference Manual Version 1.4 Scientific Toolworks, Inc. Scientific Toolworks, Inc. 1579 Broad Brook Road South Royalton, VT 05068 Copyright
More informationThe System Monitor Handbook. Chris Schlaeger John Tapsell Chris Schlaeger Tobias Koenig
Chris Schlaeger John Tapsell Chris Schlaeger Tobias Koenig 2 Contents 1 Introduction 6 2 Using System Monitor 7 2.1 Getting started........................................ 7 2.2 Process Table.........................................
More informationIntroduction. What is an Operating System?
Introduction What is an Operating System? 1 What is an Operating System? 2 Why is an Operating System Needed? 3 How Did They Develop? Historical Approach Affect of Architecture 4 Efficient Utilization
More informationAP Computer Science Java Subset
APPENDIX A AP Computer Science Java Subset The AP Java subset is intended to outline the features of Java that may appear on the AP Computer Science A Exam. The AP Java subset is NOT intended as an overall
More informationwww.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk
CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling
More informationEmbedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C
Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection
More informationCurriculum Map. Discipline: Computer Science Course: C++
Curriculum Map Discipline: Computer Science Course: C++ August/September: How can computer programs make problem solving easier and more efficient? In what order does a computer execute the lines of code
More informationFacebook Twitter YouTube Google Plus Website Email
PHP MySQL COURSE WITH OOP COURSE COVERS: PHP MySQL OBJECT ORIENTED PROGRAMMING WITH PHP SYLLABUS PHP 1. Writing PHP scripts- Writing PHP scripts, learn about PHP code structure, how to write and execute
More informationALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)
ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) Subject Description: This subject deals with discrete structures like set theory, mathematical
More informationWeb interface for online ROOT and DAQ applications
Web interface for online ROOT and DAQ applications Jörn Adamczewski-Musch, Bertrand Bellenot, and Sergey Linev Abstract A specialized web server, based on embeddable Civetweb http server, has been implemented
More informationMPLAB TM C30 Managed PSV Pointers. Beta support included with MPLAB C30 V3.00
MPLAB TM C30 Managed PSV Pointers Beta support included with MPLAB C30 V3.00 Contents 1 Overview 2 1.1 Why Beta?.............................. 2 1.2 Other Sources of Reference..................... 2 2
More informationBeginner s Matlab Tutorial
Christopher Lum lum@u.washington.edu Introduction Beginner s Matlab Tutorial This document is designed to act as a tutorial for an individual who has had no prior experience with Matlab. For any questions
More informationAppendix M: Introduction to Microsoft Visual C++ 2010 Express Edition
Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition This book may be ordered from Addison-Wesley in a value pack that includes Microsoft Visual C++ 2010 Express Edition. Visual C++ 2010
More informationBasics of I/O Streams and File I/O
Basics of This is like a cheat sheet for file I/O in C++. It summarizes the steps you must take to do basic I/O to and from files, with only a tiny bit of explanation. It is not a replacement for reading
More informationObject Oriented Software Design II
Object Oriented Software Design II C++ intro Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 26, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February 26,
More informationNetscape Internet Service Broker for C++ Programmer's Guide. Contents
Netscape Internet Service Broker for C++ Programmer's Guide Page 1 of 5 [Next] Netscape Internet Service Broker for C++ Programmer's Guide Nescape ISB for C++ - Provides information on how to develop and
More informationC++ Overloading, Constructors, Assignment operator
C++ Overloading, Constructors, Assignment operator 1 Overloading Before looking at the initialization of objects in C++ with constructors, we need to understand what function overloading is In C, two functions
More informationFree Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program
Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2015 The third
More informationDeveloping an ODBC C++ Client with MySQL Database
Developing an ODBC C++ Client with MySQL Database Author: Rajinder Yadav Date: Aug 21, 2007 Web: http://devmentor.org Email: rajinder@devmentor.org Assumptions I am going to assume you already know how
More informationN3458: Simple Database Integration in C++11
N3458: Simple Database Integration in C++11 Thomas Neumann Technische Univeristät München neumann@in.tum.de 2012-10-22 Many applications make use of relational database to store and query their data. However,
More informationWorking with Excel in Origin
Working with Excel in Origin Limitations When Working with Excel in Origin To plot your workbook data in Origin, you must have Excel version 7 (Microsoft Office 95) or later installed on your computer
More informationIllustration 1: Diagram of program function and data flow
The contract called for creation of a random access database of plumbing shops within the near perimeter of FIU Engineering school. The database features a rating number from 1-10 to offer a guideline
More informationThe Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1
The Java Series Java Essentials I What is Java? Basic Language Constructs Slide 1 What is Java? A general purpose Object Oriented programming language. Created by Sun Microsystems. It s a general purpose
More informationIntroduction Object-Oriented Network Programming CORBA addresses two challenges of developing distributed systems: 1. Making distributed application development no more dicult than developing centralized
More informationRunning your first Linux Program
Running your first Linux Program This document describes how edit, compile, link, and run your first linux program using: - Gnome a nice graphical user interface desktop that runs on top of X- Windows
More informationVisual Studio 2008 Express Editions
Visual Studio 2008 Express Editions Visual Studio 2008 Installation Instructions Burning a Visual Studio 2008 Express Editions DVD Download (http://www.microsoft.com/express/download/) the Visual Studio
More informationCourse Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)
Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Duration of Course: 6 Months Fees: Rs. 25,000/- (including Service Tax) Eligibility: B.E./B.Tech., M.Sc.(IT/ computer
More informationElixir Schedule Designer User Manual
Elixir Schedule Designer User Manual Release 7.3 Elixir Technology Pte Ltd Elixir Schedule Designer User Manual: Release 7.3 Elixir Technology Pte Ltd Published 2008 Copyright 2008 Elixir Technology Pte
More informationIVI Configuration Store
Agilent Developer Network White Paper Stephen J. Greer Agilent Technologies, Inc. The holds information about IVI drivers installed on the computer and configuration information for an instrument system.
More informationJava (12 Weeks) Introduction to Java Programming Language
Java (12 Weeks) Topic Lecture No. Introduction to Java Programming Language 1 An Introduction to Java o Java as a Programming Platform, The Java "White Paper" Buzzwords, Java and the Internet, A Short
More information#pragma omp critical x = x + 1; !$OMP CRITICAL X = X + 1!$OMP END CRITICAL. (Very inefficiant) example using critical instead of reduction:
omp critical The code inside a CRITICAL region is executed by only one thread at a time. The order is not specified. This means that if a thread is currently executing inside a CRITICAL region and another
More informationCatDV Pro Workgroup Serve r
Architectural Overview CatDV Pro Workgroup Server Square Box Systems Ltd May 2003 The CatDV Pro client application is a standalone desktop application, providing video logging and media cataloging capability
More informationComputing Concepts with Java Essentials
2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann
More informationCompute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005
Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005 Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005... 1
More informationUnit 4.3 - Storage Structures 1. Storage Structures. Unit 4.3
Storage Structures Unit 4.3 Unit 4.3 - Storage Structures 1 The Physical Store Storage Capacity Medium Transfer Rate Seek Time Main Memory 800 MB/s 500 MB Instant Hard Drive 10 MB/s 120 GB 10 ms CD-ROM
More informationParallel and Distributed Computing Programming Assignment 1
Parallel and Distributed Computing Programming Assignment 1 Due Monday, February 7 For programming assignment 1, you should write two C programs. One should provide an estimate of the performance of ping-pong
More informationFree Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program
Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2014 Jill Seaman
More informationC++ Crash Kurs. C++ Object-Oriented Programming
C++ Crash Kurs C++ Object-Oriented Programming Dr. Dennis Pfisterer Institut für Telematik, Universität zu Lübeck http://www.itm.uni-luebeck.de/people/pfisterer C++ classes A class is user-defined type
More informationIS0020 Program Design and Software Tools Midterm, Feb 24, 2004. Instruction
IS0020 Program Design and Software Tools Midterm, Feb 24, 2004 Name: Instruction There are two parts in this test. The first part contains 50 questions worth 80 points. The second part constitutes 20 points
More informationMOVES Batch Mode: Setting up and running groups of related MOVES run specifications. EPA Office of Transportation and Air Quality 11/3/2010
MOVES Batch Mode: Setting up and running groups of related MOVES run specifications EPA Office of Transportation and Air Quality 11/3/2010 Webinar Logistics Please use question box to send any questions
More informationLast Class: OS and Computer Architecture. Last Class: OS and Computer Architecture
Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 3, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts
More informationParallelization: Binary Tree Traversal
By Aaron Weeden and Patrick Royal Shodor Education Foundation, Inc. August 2012 Introduction: According to Moore s law, the number of transistors on a computer chip doubles roughly every two years. First
More informationXeon Phi Application Development on Windows OS
Chapter 12 Xeon Phi Application Development on Windows OS So far we have looked at application development on the Linux OS for the Xeon Phi coprocessor. This chapter looks at what types of support are
More informationGood FORTRAN Programs
Good FORTRAN Programs Nick West Postgraduate Computing Lectures Good Fortran 1 What is a Good FORTRAN Program? It Works May be ~ impossible to prove e.g. Operating system. Robust Can handle bad data e.g.
More informationAN INTRODUCTION TO UNIX
AN INTRODUCTION TO UNIX Paul Johnson School of Mathematics September 24, 2010 OUTLINE 1 SHELL SCRIPTS Shells 2 COMMAND LINE Command Line Input/Output 3 JOBS Processes Job Control 4 NETWORKING Working From
More informationComp151. Definitions & Declarations
Comp151 Definitions & Declarations Example: Definition /* reverse_printcpp */ #include #include using namespace std; int global_var = 23; // global variable definition void reverse_print(const
More informationANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)
ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) Who am I? Lo Chi Wing, Peter Lecture 1: Introduction to Android Development Email: Peter@Peter-Lo.com Facebook: http://www.facebook.com/peterlo111
More informationCourse MS10975A Introduction to Programming. Length: 5 Days
3 Riverchase Office Plaza Hoover, Alabama 35244 Phone: 205.989.4944 Fax: 855.317.2187 E-Mail: rwhitney@discoveritt.com Web: www.discoveritt.com Course MS10975A Introduction to Programming Length: 5 Days
More informationMAS 500 Intelligence Tips and Tricks Booklet Vol. 1
MAS 500 Intelligence Tips and Tricks Booklet Vol. 1 1 Contents Accessing the Sage MAS Intelligence Reports... 3 Copying, Pasting and Renaming Reports... 4 To create a new report from an existing report...
More information