-
Notifications
You must be signed in to change notification settings - Fork 54
Running GRSISort
The steps involved in using GRSISort are:
We are running a multistage sorting model with GRSISort. This has one main advantage: It allows us to sort the very large MIDAS files non-locally and then download the heavily compressed histograms or analysis tree data.
By default GRSIsort will open up a root session in the GRSI environment.
The strategy used by GRSISort is to unpack the MIDAS file and convert the information into two ROOT Trees.
The first tree in the fragment?????_???.root
file contains TFragments and is essentially all of the information from the MIDAS File with higher compression and accessibility.
The second tree in the analysis?????_???.root
file contains built events with detector information (essentially the same fragments, but in groups and translated into detectors).
grsisort --recommended NAME_OF_MIDAS_FILE.mid -> Converts the midas file into a fragment tree, and an analysis tree.
The --recommended
flag includes a number of default GRSISort flags (-a, -q, -l, --write-diagnostics, --word-count-offset=-1, --write-fragment-tree, --write-bad-fragments, --separate-out-of-order, --suppress-error, and --reconstruct-timestamp).
These and all other available flags can be seen using grsisort -h
.
See here for all command line options and their explanations.
This shows all the recommended flags in dark green, and the flags used in creating the analysis tree and making histograms in dark cyan.
Some currently accepted flags for the midas sort:
- --suppress_error, suppresses errors from failed data parsing appearing in stdout
- --log_errors, sends errors from failed data parsing to file, will not send errors if supress error option is also used!
- -q, quits the grsi environment after completing the midas sort (important when sorting a file)
- -b, run in batch mode (useful when running a ```.C`` script on the sorted file
Only one midas file can be sorted at a time.
When sorting the fragment tree, you can read in a calibration file at the same time and it will perform the calibrations while sorting. This can be done with the command:
grsisort -flags <midasfile>.mid <calibrationfile>.cal
If a different calibration is supposed to be used it can be either loaded temporarily by giving the corresponding .cal file after the fragment/analysis tree file, or it can be written permanently to the files by using the WriteCalToRoot program which can be used to update or replace the calibration. It is possible to use multiple calibration files, in which case for duplicate entries the value will be taken from last file provided. This can be used e.g. to provide energy calibrations and cross-talk corrections is separate files.
You can list the parameters included in the fragment tree with:
FragmentTree->Print()
Alternatively, you view them in a graphical interface with:
FragmentTree->StartViewer()
After sorting the data and creating a fragment tree, you can create histograms by running normal ROOT commands:
FragmentTree->Draw("<variable> >> <histogramName>(<xbins>,<xmin>,<xmax>)", "<cuts>", "<displayOptions>")
Here is an example that displays a 1D histogram of calibrated energy of all detectors:
FragmentTree->Draw("GetEnergy() >> h(16000,0,16000)", "", "")
Another example, of a 2D histogram that displays calibrated energy vs. detector number ignoring channel 12, is:
FragmentTree->Draw("fChannelNumber:GetEnergy() >> h(16000,0,16000,64,0,64)", "fChannelNumber!=12", "colz")
This is mainly useful for a first look at the data, to produce multiple histograms at once for many root files use GRSIFrame (or GRSIProof).
If the -a flag is used on the MIDAS file, GRSISort will sort the MIDAS file and complete a fragment sort by applying the flags and sorting the fragment tree, making an analysis tree file.
Home | Setup Guide | Running GRSISort | Technical Docs | Commands | Issue Tracker | Team
Useful resources