-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinitParamFit.sh
executable file
·30 lines (27 loc) · 1.05 KB
/
initParamFit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# - Runs the initial parameter fit and creates a compiled .pdf file
# - Assumes that there is only one .csv file in the given directory,
# which holds the initial parameter information
#!/usr/bin/env bash
echo "Starting fit analysis..."
echo " Warning: All pdf, txt, and output root files from previous fits will be deleted. Proceed? (Y/N)"
read input
if [[ $input == "Y" || $input == "y" ]]; then
#remove files to preserve versions
rm *.pdf *fit.txt *gain.root
#file name formatting
csvName=`ls *.csv | head -1`
pdfName="${csvName/csv/pdf}"
# Loads root and runs the FitChargeDistributions_InitParam to create individual
# pdfs for all the PMTs
ROOTSYS=/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.16.00/x86_64-ubuntu18-gcc73-opt PATH=$ROOTSYS/bin:$PATH root -l -b <<EOF
.x FitChargeDistributions_InitParam.C("$csvName");
.q;
EOF
# Consolidates all the pdfs into a single pdf file
pdfunite *.pdf $pdfName
echo "Analysis finished."
echo "Output to: $pdfName"
evince $pdfName &
else
echo "Analysis cancelled."
fi