Dumping Data from an Ntuple


This page will tell you how to use my dump script to dump all the data from a file to the screen or to a text file for analysis of single events.

Quick guide to using the script
More detailed look at commands
Look at the code and compile the program for yourself (so you can change cuts, etc..)

I just added a simple output format: this runs the electrons, muons, taus, photons and jets through standard and likelihood cuts and outputs the or of the two (ie if anything passes one cut or the other, it will be displayed). This data, along with the met block are then displayed in a chart with the most relevant data from each block.


The First thing you need to do is download the file here into the directory of your data. If that version is not working for some reason, try the BASH version.

Then, go to that directory, and type in your terminal:

chmod u+rx dump.sh

this will set the permissions for you to both read and execute the file, if you like add a w after the rx in order to gain write privileges. You only need to do this the first time you download the file.


Usage in Brief

Commands that Work:
dump.sh file_name
dump.sh file_name event
dump.sh file_name ntuple
dump.sh file_name ntuple event
dump.sh file_name ntuple simple
dump.sh file_name ntuple simple event
dump.sh file_name simple
dump.sh file_name simple event

and you can add the " > textfile " to the end to out put to a textfile still.

file_name is the name of the file; event(optional) is the event number selection; and ntuple (must be typed verbatim) ntuples the data with ver 4.11.1 before dumping it; simple (also typed verbatim) changes the output to a a chart with key data in it, rather than just listing it all.




Details......

In order to dump the files to your display, type:

dump.sh file_name
where file_name is simply the file with all the data you want dumped, the script will automatically detect the run and event numbers assuming the filename follows the convention ( xxxxx.xxxxx.runnumber.eventnumber.xxxx ) it pulls the numbers by scanning for the periods, however, if your file, for whatever reason, does not follow this convention, you can type:

dump.sh file_name event_number
where event_number is the event number you want dumped.


By adding ntuple after the filename, the script will automatically ntuple the datafile (file_name) for you, creating a file filename.UCNtuple_4111.root
The command line for this would look like:

dump.sh file_name ntuple
or this:
dump.sh file_name ntuple event_number


By adding simple in the command line after 'ntuple' the script will output more limited data to a chart. For this to look best, make sure that your terminal window is relatively wide before you run it, so that there is no overflow onto the next lines. The command looks like

dump.sh file_name simple
or
dump.sh file_name ntuple simple


Basically, to make the script works so long as the modifiers are always in the proper order 1)filename 2)ntuple 3)simple 4)event. You can drop any of the modifiers (except filename) so long as the order is maintained without it/them.

If you want the data in a text file, simpy type the command line as usual with" > textfile.txt " at the end, like so :

dump.sh file_name event > textfile.txt

where textfile.txt is the name of the file you want all the data output to.


Looking at the source, compiling for yourself...

All the data for the routine is located in /cdf/data20a/psgibbs/my_dump/
Important files are dumpscriptcompile.C (main program, calls other functions, etc), dumphf.C (dumps everything into the list format), dumphfsimple.C (makes the chart), objects.ET.C (has the cuts and such in it). If you'd like to make changes and compile it again you probably want to copy the directory somewhere, make your changes, and then at the commandline type:

KCC --no_exceptions -o dumping dumpscriptcompile.C -I. -I$ROOTSYS/include/ -I/cdf/code/cdfsoft/dist/releases/4.11.1/include/ -I/cdf/data20a/psgibbs/my_dump/include/ `root-config --libs`

You would then want to change the shell script so that after the if statements, it runs your new executable (in this case it would be called 'dumping' and would be created in whatever directory you ran the command from.

All the files are linked to /cdf/data20a/psgibbs/my_dump/ and the permissions should be set properly for general usage, let me know if anything needs to be changed or fixed.


This page is maintained by Paul Gibbs. Please direct comments and questions to psgibbs@hep.uchicago.edu.