mattiasoldani / succobt

A set of useful tools for the INSULAb beamtests
MIT License
0 stars 0 forks source link

asciinroot_to_root_pp: NOASCII case, remove dependence on ASCII folder #6

Open mattiasoldani opened 1 year ago

mattiasoldani commented 1 year ago

The relevant parts of code in which ascii_dir is should become

# I/O paths (set)
root_in_dir="/home/msoldani/data_in/H2ROOT_NEW"
root_out_dir="/home/msoldani/data_out/splitted_prel"
root_merged_dir="/home/msoldani/data_out/merged_prel"
if [ ! -d $root_in_dir ];then
    echo "ERROR: directory "$root_in_dir" not present."
    exit 1
fi
if [ ! -d $root_out_dir ];then
    echo "ERROR: directory "$root_out_dir" not present."
    exit 1
fi
if [ ! -d $root_merged_dir ];then
    echo "ERROR: directory "$root_merged_dir" not present."
    exit 1
fi

and

# loop on spills through input ASCII files
new_file_count=0;
for file in $(ls $root_in_dir"/run"$nrun"_"*.root); do

    # input ROOT file name (set)
    file2_1="${file/$root_in_dir/$root_in_dir}"  
    #file2_1="${file2_0/_00/_0}"  # needed to correct for the spill nr. size mismatch between input ASCII and ROOT
    file2="${file2_1/.dat/.root}"