1 / 13

ROOT What & Why? ROOT Status ROOT Application ROOT Install ROOT Example ROOT References

Introduction to. ROOT What & Why? ROOT Status ROOT Application ROOT Install ROOT Example ROOT References. March 13, 2003 Dae Jung Kong @ CHEP. Why not PAW ? Why ROOT ?. Very Huge Data >> Tbyte Computing Technology. ROOT What & Why?.

keefer
Télécharger la présentation

ROOT What & Why? ROOT Status ROOT Application ROOT Install ROOT Example ROOT References

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to ROOT What & Why? ROOT Status ROOT Application ROOT Install ROOT Example ROOT References March 13, 2003 Dae Jung Kong @ CHEP

  2. Why not PAW? Why ROOT? Very Huge Data >> Tbyte Computing Technology ROOT What & Why? ROOT is a Data Analysis and DAQ or other application Tool based on C/C++ PAW(Physics Analysis Workstation) is physics analysis tool using Fortran Lang. • Regular grammar (C++) on command line • Single language (compiled and interpreted) • Object Oriented (use your class in the interpreter) • Advanced Interactive User Interface • Well Documented code. HTML class descriptions for every class. • 3-d interfaces with OpenGL and X3D.

  3. ROOT Status First ROOT release version 1.0 published in 1995 and update almost monthly….. Platform & Complier Linux Unix (HP, SGI, Compaq…) Window(NT,2000) GCC, egcs, CC, g++, VC++, ….

  4. ROOT Applications Almost HEP/nuclear experiments in the World Other fields Economics Medical Applied physics WHY ?

  5. ROOT Install Getting the source To install ROOT from source you first have to get the tar file containing the source. prompt% ftp root.cern.ch User: anonymous Password: <your-email-address> ftp> cd /root ftp> bin ftp> get root-<version>.source.tar.gz ftp> bye prompt% gzip -dc root-<version>.source.tar.gz | tar -xf - Getting ready to build You may want to compile features into ROOT, which depends on third party libraries. Make sure you meet all demands for additional features before trying to enable them (see below). If you are using some Un*x, you need to have libXpm installed. On very few systems libXpm.a is not available. In that case get the pre-built version from: ftp://root.cern.ch/root/xpmThen use either environment variable XPM or "configure" flags "--with-xpm=<dir>" to specify where you installed libXpm, if you didn't install it in some generally searched directory (see more below). ROOT Install from source. You want to install in a generic directory, depending on environment variables ROOTSYS, LD_LIBRARY_PATH, and PATH. > setenv ROOTSYS /root set ROOTSYS to the `root' directory: (csh) > ./configure --help now type the build commands: all shells: > ./configure <arch> [change arch appropriately] > gmake [or, make -j2 for dual CPU machines] > gmake install [when run directory is not $ROOTSYS] > setenv PATH ${ROOTSYS}/bin:${PATH} add $ROOTSYS/bin to PATH > setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:${LD_LIBRARY_PATH} add $ROOTSYS/lib to LD_LIBRARY_PATH > rehash > root try running root:

  6. $ROOTSYS bin include lib tutorials test libCint.so Aclock.cxx *.h cint EditorBar.C fitslicesy.C ntuple1.C libCore.so Aclock.h ... makecint Ifit.C formula1.C oldbenchmarks.C libEG.so Event.cxx new analyze.C framework.C pdg.dat *libEGPythia.so Event.h proofd archi.C games.C psexam.C *libEGPythia6.so EventLinkDef.h proofserv arrow.C gaxis.C pstable.C libEGVenus.so Hello.cxx rmkdepend basic.C geometry.C rootalias.C libGpad.so Hello.h root basic.dat gerrors.C rootenv.C libGraf.so MainEvent.cxx root.exe basic3d.C gerrors2.C rootlogoff.C libGraf3d.so Makefile rootcint benchmarks.C graph.C rootlogon.C libGui.so Makefile.in root-config canvas.C h1draw.C rootmarks.C libGX11.so Makefile.win32 rootd classcat.C hadd.C runcatalog.sql *libGX11TTF.so README cleanup.C hclient.C runzdemo.C libHist.so TestVectors.cxx * Optional compile.C hcons.C second.C libHistPainter.so Tetris.cxx Installation copytree.C hprod.C shapes.C libHtml.so Tetris.h copytree2.C hserv.C shared.C libMatrix.so eventa.cxx demos.C hserv2.C splines.C libMinuit.so eventb.cxx demoshelp.C hsimple.C sqlcreatedb.C libNew.so eventload.cxx dialogs.C hsum.C sqlfilldb.C libPhysics.so guitest.cxx dirs.C hsumTimer.C sqlselect.C libPostscript.so hsimple.cxx ellipse.C htmlex.C staff.C libProof.so hworld.cxx eval.C io.C staff.dat *libRFIO.so minexam.cxx event.C latex.C surfaces.C *libRGL.so stress.cxx exec1.C latex2.C tcl.C libRint.so tcollbm.cxx exec2.C latex3.C testrandom.C *libThread.so tcollex.cxx feynman.C manyaxis.C tornado.C libTree.so test2html.cxx fildir.C multifit.C tree.C libTreePlayer.so tstring.cxx file.C myfit.C two.C libTreeViewer.so vlazy.cxx fillrandom.C na49.C xyslider.C *libttf.so vmatrix.cxx first.C na49geomfile.C xysliderAction.C libX3d.so vvector.cxx fit1.C na49view.C zdemo.C libXpm.a fit1_C.C na49visible.C ROOT Framework

  7. What Can we do with ?? • Histogramming and Fitting(Gauss, Poly, exp, Landau..) • Graphics (2D, 3D) • I/O to file : specialized for histograms, Ntuples (Trees) • Collection Classes and Run Time Type Identification • User Interface • GUI: Browsers, Panels, Tree Viewer • Command Line interface: C++ interpreter CINT • Script Processor (C++ compiled C++ interpreted)

  8. Three User Interfaces • GUIwindows, buttons, menus • Root Command lineCINT (C++ interpreter) • Macros, applications, libraries (C++ compiler • and interpreter)

  9. ROOT Example hep2:2:11pm:Root_temp_527>> root *************************************************** * W E L C O M E to R O O T * * Version 3.03/07 5 August 2002 * * * * You are welcome to visit our Web site * * http://root.cern.ch * **************************************************** FreeType Engine v1.x used to render TrueType fonts. Compiled for linuxkcc. CINT/ROOT C/C++ Interpreter version 5.15.50, July 7 2002 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0] .q root [1] .x file.C root [2] .! ls(linux command) root [3] b = TBrowser(); Root[4] .? Or .help root [0] TFile f("filter.root") root [3] f.ls() TFile** filter.root TFile* filter.root KEY: TH1F h1;1 x distribution KEY: TNtuple ntuple;1 data from ascii file

  10. ROOT Example Cont. 1 • hep2:2:24pm:Root_temp_527>> more filter.txt • 10 6 0. 0.00001 0. 0. 0. • 20 6.25 0. 0.78766 0.00919 0.00007 0. • 30 6.7 0. 0.78371 0.00874 0.00006 0. • 40 7 0. 0.7923 0.00974 0.00009 0. • 50 7.3 0. 0.82585 0.14758 0.00032 0.00001 • 60 7.5 0. 0.86892 0.24537 0.00147 0.00008 • 70 7.6 0. 0.86069 0.22308 0.00111 0.00005 • 80 7.85 0. 0.10788 0. 0. 0. • 90 8 0.00001 0.00654 0. 0. 0. • 8.1 0.00004 0.00546 0. 0. 0. • 4910 3.74 0.99409 0.99472 0.94842 0.85311 0.76737 • 4920 3.73 0.99413 0.99475 0.94871 0.85389 0.76855 • 4930 3.73 0.99417 0.99478 0.949 0.85468 0.76973 • 4940 3.72 0.9942 0.99481 0.94929 0.85545 0.77089 • 4950 3.71 0.99424 0.99484 0.94957 0.85622 0.77205 • 4960 3.7 0.99428 0.99487 0.94986 0.85699 0.7732 • 4970 3.69 0.99431 0.9949 0.95014 0.85775 0.77434 • 4980 3.68 0.99435 0.99493 0.95042 0.8585 0.77548 • 4990 3.67 0.99438 0.99496 0.95069 0.85926 0.77661 • 5000 3.66 0.99442 0.99499 0.95097 0.86 0.77773 • 5010 3.65 0.99445 0.99501 0.95124 0.86074 0.77885 hep2:2:21pm:Root_temp_527>> more filter.C //Reading " MCP Qunatum Efficiency + Polyca_2 + Al_0.1 + Al_1 + Al_3 + Al_5 microns " and making an ntuple // to read data from an ascii file and create a root file with and an ntuple. { gROOT->Reset(); FILE *fp = fopen("./filter.txt","r"); Float_t x,q,p,al_1,al_10,al_30,al_50; Int_t ncols; Int_t nlines = 0; TFile *f = new TFile("./filter.root","RECREATE"); TH1F *h1 = new TH1F("h1","x distribution",100,-4,4); TNtuple *ntuple = new TNtuple("ntuple","data from ascii file",“ x:q:p:al_1:al_10:al_30:al_50"); while (1) { ncols = fscanf(fp,"%f %f %f %f %f %f %f", &x, &q, &p, &al_1, &al_10, &al_30, &al_50); if (ncols < 0) break; if (nlines < 500) printf("x=%8f, q=%8f, p=%8f, al_1=%8f, al_10=%8f, al_30=%8f, al_50=%8f\n",x,q,p,al_1,al_10,al_30,al_50); h1->Fill(x); ntuple->Fill(x,q,p,al_1,al_10,al_30,al_50); nlines++; } printf(" found %d points\n",nlines); fclose(fp); f->Write(); }

  11. ROOT Example Cont. 2 hep2:2:37pm:Root_temp_527>> more filter_selection.C { gROOT->Reset(); c1 = new TCanvas("c1","The Ntuple canvas",200,10,700,780); gBenchmark->Start("ntuple1"); f1 = new TFile("./filter.root"); // Inside this canvas, we create 4 pads pad1 = new TPad("pad1","This is pad1",0.02,0.52,0.48,0.98,18); pad2 = new TPad("pad2","This is pad2",0.52,0.52,0.98,0.98,17); pad3 = new TPad("pad3","This is pad3",0.02,0.02,0.48,0.48,21); pad4 = new TPad("pad4","This is pad4",0.52,0.02,0.98,0.48,20); pad1->Draw(); pad2->Draw(); pad3->Draw(); pad4->Draw(); // pad 1 gStyle->SetStatW(0.30); gStyle->SetStatH(0.20); gStyle->SetStatColor(42); pad1->cd(); // MCP Quantum Efficiency Polycarbonate 2 micron pad1->GetFrame()->SetFillColor(38); pad1->GetFrame()->SetBorderSize(8); ntuple->SetMarkerColor(1); ntuple->Draw("q:x","x>0"); ntuple->SetMarkerColor(2); ntuple->Draw("p:x","x>0","same"); c1->Update(); // pad2 gStyle->SetStatW(0.30); gStyle->SetStatH(0.20); gStyle->SetStatColor(42); pad2->cd(); // Aluminum 0.1 micron // Aluminum 1 micron pad2->GetFrame()->SetFillColor(38); pad2->GetFrame()->SetBorderSize(8); ntuple->SetMarkerColor(1); ntuple->Draw("al_1:x","x>0"); ntuple->SetMarkerColor(2); ntuple->Draw("al_10:x","x>0","same"); c1->Update(); // pad 3 gStyle->SetStatW(0.30); gStyle->SetStatH(0.20); gStyle->SetStatColor(42); pad3->cd(); // Aluminum 3 micron // Aluminum 5 micron pad3->GetFrame()->SetFillColor(38); pad3->GetFrame()->SetBorderSize(8); ntuple->SetMarkerColor(1); ntuple->Draw("al_30:x","x>0"); ntuple->SetMarkerColor(2); ntuple->Draw("al_50:x","x>0","same"); c1->Update(); // Pad 4 gStyle->SetStatW(0.30); gStyle->SetStatH(0.20); gStyle->SetStatColor(42); // MCP Quantum Efficiency + Polycarbonate 2 micron + Aluminum 0.1 micron // MCP Quantum Efficiency + Polycarbonate 2 micron + Aluminum 1 micron // MCP Quantum Efficiency + Polycarbonate 2 micron + Aluminum 3 micron // MCP Quantum Efficiency + Polycarbonate 2 micron + Aluminum 5 micron // pad4->cd(); pad4->GetFrame()->SetFillColor(38); pad4->GetFrame()->SetBorderSize(8); ntuple->SetMarkerColor(1); ntuple->Draw("q*p*al_1:x","x>0"); ntuple->SetMarkerColor(2); ntuple->Draw("q*p*al_10:x","x>0","same"); ntuple->SetMarkerColor(3); ntuple->Draw("q*p*al_30:x","x>0","same"); ntuple->SetMarkerColor(4); ntuple->Draw("q*p*al_50:x","x>0","same"); c1->Update(); gStyle->SetStatColor(19); gBenchmark->Show("ntuple1"); }

  12. ROOT Example Cont. 3 Pad 1 Pad 2 Pad 3 Pad 4

  13. ROOT References http://root.cern.ch : ROOT Home page http://www-cpd.fnal.gov/root/ : ROOT Fermilab

More Related