19
13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

  • View
    215

  • Download
    1

Embed Size (px)

Citation preview

Page 1: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 Geant4 Data Analysis J. Perl 1

Trivial Data Analysis for Geant4

Joseph Perl, SLACGeant4 v9.4

Page 2: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 2Geant4 Data Analysis J. Perl

Simple Analysis This WeekSimple Analysis This Week Geant4 does not attempt to provide its own data analysis tools, focusing Geant4 does not attempt to provide its own data analysis tools, focusing

instead on its central mission as a simulation toolkit.instead on its central mission as a simulation toolkit. The Geant4 user is expected to provide her own code to output results to The Geant4 user is expected to provide her own code to output results to

an appropriate analysis format.an appropriate analysis format. Like Geant4 itself, this present tutorial is focused on the physics, so we are Like Geant4 itself, this present tutorial is focused on the physics, so we are

just using the simplest possible output format here, comma-separated just using the simplest possible output format here, comma-separated values (.csv files)values (.csv files)

The resulting files can be analyzed by tools such as:The resulting files can be analyzed by tools such as: GnuplotGnuplot ExcelExcel OpenOfficeOpenOffice

Though we will not be using them in this present tutorial, information is Though we will not be using them in this present tutorial, information is available through the Geant4 web site on how to work with more advanced available through the Geant4 web site on how to work with more advanced data analysis tools such as Root or the AIDA-compliant tools, PI, JAS3 and data analysis tools such as Root or the AIDA-compliant tools, PI, JAS3 and OpenScientist. I’ll provide a few links to these more advanced tools in this OpenScientist. I’ll provide a few links to these more advanced tools in this talk, but will not go into any detailed instructions.talk, but will not go into any detailed instructions.

Page 3: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 3Geant4 Data Analysis J. Perl

GnuplotGnuplot

““Gnuplot Gnuplot is a is a portableportable command-line driven interactive command-line driven interactive data and function plotting utility for UNIX, IBM OS/2, MS data and function plotting utility for UNIX, IBM OS/2, MS Windows, DOS, Macintosh, VMS, Atari and many other Windows, DOS, Macintosh, VMS, Atari and many other platforms.”platforms.”

““The software is copyrighted but freely distributed (i.e., The software is copyrighted but freely distributed (i.e., you don't have to pay for it).”you don't have to pay for it).”

http://www.gnuplot.info/http://www.gnuplot.info/

Page 4: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 4Geant4 Data Analysis J. Perl

Plotting Data from a .csv File in GnuplotPlotting Data from a .csv File in Gnuplot

plot mydata.csvplot mydata.csv

(that’s all you need)(that’s all you need)

Page 5: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 5Geant4 Data Analysis J. Perl

ExcelExcel

Comes from a small company called MicroSoft.Comes from a small company called MicroSoft. Part of Microsoft Office.Part of Microsoft Office.

Page 6: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 6Geant4 Data Analysis J. Perl

Importing Data from a .csv File Into ExcelImporting Data from a .csv File Into Excel From the “Data” menu, select “Get External Data”…“Import Text File…”

Select the file The Text Import Wizard will come up Check the “Delimited” box Hit “Next” Check the “Comma” box The bottom part of the Wizard should now show your data nicely separated into

appropriate columns. Hit “Finish” You will see a dialog titled “Import Data” which will ask where to put the data.

Accept the defaults: Existing worksheet: =$A$1

Hit “OK” The data should now show up in the spreadsheet.

Page 7: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 7Geant4 Data Analysis J. Perl

Plotting with ExcelPlotting with Excel

Now that the data is in the spreadsheet, you can plot it as follows: Select at least one item in the filled data area. From the “Insert” menu, select “Chart…” Select Chart type: “Line” Hit “Finish” You’re done

Page 8: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 8Geant4 Data Analysis J. Perl

OpenOfficeOpenOffice

OpenOffice.org is a OpenOffice.org is a multiplatformmultiplatform and and multilingualmultilingual office suiteoffice suite and an and an open-sourceopen-source project.project.

Compatible with all other major office suites, the Compatible with all other major office suites, the product is free to download, use, and distribute.product is free to download, use, and distribute.

http://www.openoffice.org/http://www.openoffice.org/

Page 9: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 9Geant4 Data Analysis J. Perl

Importing Data from a .csv File Into OpenOfficeImporting Data from a .csv File Into OpenOffice

From the “File” menu, select “Open…” In the “File type” box, select “Text CSV”

Note that this is NOT the same as just “Text” Then select your file

Page 10: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 10Geant4 Data Analysis J. Perl

Importing Data from a .csv File Into OpenOfficeImporting Data from a .csv File Into OpenOffice Once you select your file:

The Text Import dialog will come up Check the “Comma” box The bottom part of the dialog should now show your data nicely separated into

appropriate columns. Hit “OK”

The data should now show up in the spreadsheet.

Page 11: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 11Geant4 Data Analysis J. Perl

Plotting with OpenOfficePlotting with OpenOffice Now that the data is in the spreadsheet, you can plot it as follows:

Select at least one item in the filled data area. From the “Insert” menu, select “Chart…” The defaults should be fine Hit “Next”

Select theicon for “Line”chart

Hit “Create” You’re done

Page 12: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 12Geant4 Data Analysis J. Perl

Pointers to More Advanced Data Analysis OptionsPointers to More Advanced Data Analysis Options

While the Geant4 collaboration does not maintain any data analysis system, While the Geant4 collaboration does not maintain any data analysis system, many data analysis tool developers have interfaced their systems to Geant4 many data analysis tool developers have interfaced their systems to Geant4 and each of the following has an active Geant4 user community.and each of the following has an active Geant4 user community.

A good way to get started thinking about any of these is to look in the Geant4 A good way to get started thinking about any of these is to look in the Geant4 Analysis Forum:Analysis Forum: http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/analysis.htmlhttp://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/analysis.html

Page 13: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 13Geant4 Data Analysis J. Perl

ROOTROOT

ROOT is an Object Oriented Data Analysis Framework.ROOT is an Object Oriented Data Analysis Framework. It is heavily used in High Energy Physics.It is heavily used in High Energy Physics. Freely available.Freely available.

http://root.cern.ch/http://root.cern.ch/

Page 14: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 14Geant4 Data Analysis J. Perl

AIDAAIDA

Analysis Interface for Data AnalysisAnalysis Interface for Data Analysis AIDA is an interface standard used by several advanced data analysis AIDA is an interface standard used by several advanced data analysis

tools. It provides a single standard way to create your datatools. It provides a single standard way to create your data Commands to instantiate an nTupleCommands to instantiate an nTuple Commands to fill an nTupleCommands to fill an nTuple Commands to instantiate a HistogramCommands to instantiate a Histogram Commands to fill a HistogramCommands to fill a Histogram

Depending on which AIDA-complaint tool you link in to Geant4, these Depending on which AIDA-complaint tool you link in to Geant4, these commands will one or the other analysis toolcommands will one or the other analysis tool

You can switch from one AIDA-compliant tool to another without having to You can switch from one AIDA-compliant tool to another without having to change how you book and fill your histograms.change how you book and fill your histograms.

http://aida.freehep.org/http://aida.freehep.org/

Page 15: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 15Geant4 Data Analysis J. Perl

The Three AIDA-Compliant Analysis SystemsThe Three AIDA-Compliant Analysis Systems

OpenScientistOpenScientist http://openscientist.lal.in2p3.fr/http://openscientist.lal.in2p3.fr/ C++C++

iAIDAiAIDA Refactored from a CERN LCG Application called PIRefactored from a CERN LCG Application called PI http://iaida.dynalias.net/Intro.htmlhttp://iaida.dynalias.net/Intro.html C++ and xmgraceC++ and xmgrace

JAS3JAS3 http://jas.freehep.org/jas3/http://jas.freehep.org/jas3/ JavaJava

Page 16: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 16Geant4 Data Analysis J. Perl

OpenScientist Pages Provide ExcellentOpenScientist Pages Provide ExcellentGeneral Instructions on Using AIDA with Geant4General Instructions on Using AIDA with Geant4

http://openscientist.lal.in2p3.fr/http://openscientist.lal.in2p3.fr/

Page 17: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 17Geant4 Data Analysis J. Perl

Geant4 DetailsGeant4 Details

Page 18: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 18Geant4 Data Analysis J. Perl

And Details on WindowsAnd Details on Windows

Page 19: 13 January 2011 Geant4 Data Analysis J. Perl 1 Trivial Data Analysis for Geant4 Joseph Perl, SLAC Geant4 v9.4

13 January 2011 19Geant4 Data Analysis J. Perl

Use Whatever Analysis Tool You LikeUse Whatever Analysis Tool You Like Geant4 does not attempt to provide its own data analysis tools, focusing Geant4 does not attempt to provide its own data analysis tools, focusing

instead on its central mission as a simulation toolkit.instead on its central mission as a simulation toolkit. The Geant4 user is expected to provide her own code to output results to The Geant4 user is expected to provide her own code to output results to

an appropriate analysis format.an appropriate analysis format. This present tutorial is focused on the physics, so we are just using the This present tutorial is focused on the physics, so we are just using the

simplest possible output format here, comma-separated values (.csv files)simplest possible output format here, comma-separated values (.csv files)