aboutsummaryrefslogtreecommitdiff
path: root/src/zdab-cat.c
AgeCommit message (Collapse)Author
2019-08-28fix some error handling in zebra.ctlatorre
This commit updates the zebra code to properly handle all the errors from get_bytes(). I also updated fit and cat-zdab to not display the errors about the FTX banks by default unless you run them with the -v command line option.
2019-07-16fix bug introduced in ebe2799tlatorre
This commit fixes a bug introduced in a previous commit when I moved all the code to add the run, gtid, etc. to the event object to get_event(). We actually need the run number before then to load the DQXX file for the right run.
2019-07-16update neck tube cut to include time difference changes due to cable changestlatorre
2019-07-11switch from YAML output to HDF5 to speed things uptlatorre
2019-07-08add vertex time field to zdab-cattlatorre
2019-06-20update zdab-cat to output 50 MHz clock time and trigger typetlatorre
2019-06-20fix cat-grid-jobs againtlatorre
2019-06-20update zdab-cat to emit multiple YAML documentstlatorre
This commit updates zdab-cat to output each event as an individual YAML document. The advantage of this is that we can then iterate over these without loading the entire YAML document in submit-grid-jobs which means that we won't use GB of memory on the grid submission node.
2019-06-20fix empty list at top of YAML output in zdab-cattlatorre
2019-06-19add data cleaning word and ftp, ftk, and rsp info to zdab-cat outputtlatorre
2019-06-06print out "loading DQXX ..." line to stderrtlatorre
2019-05-24add a script to concatenate output from grid jobstlatorre
2019-05-24add a script to submit jobs to the gridtlatorre
2019-05-23write to stdout if no output file is specifiedtlatorre
2019-05-23add zdab-cattlatorre
This commit adds a new program called zdab-cat which is kind of like fit, but just produces the YAML output without actually fitting anything.
e>
#!/usr/bin/env python
# Copyright (c) 2019, Anthony Latorre <tlatorre at uchicago>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

from subprocess import check_call
from os.path import split, splitext, join
import os

if __name__ == '__main__':
    import argparse

    parser = argparse.ArgumentParser("script to convert full GENIE root files to the reduced gst ROOT format")
    parser.add_argument("filenames", nargs="+", help="GENIE root files")
    parser.add_argument("--dest", required=True, help="destination directory")
    args = parser.parse_args()

    for filename in args.filenames:
        head, tail = split(filename)
        root, ext = splitext(tail)
        output = join(args.dest, root) + ".ntuple.root"
        cmd = ["gntpc","-f","gst","-i",filename,"-o",output]
        print(" ".join(cmd))
        with open(os.devnull,"w") as devnull:
            check_call(cmd, stdout=devnull, stderr=devnull)