Commit db9e51d3 authored by positron cool guys's avatar positron cool guys
Browse files

quality of life scripts

parent 7297856a
#!/bin/bash
#daq parameters
export DAQEXE="" #to be set
export DAQDIR=""
export DAQOUTDIR="/home/positron/LymanAlpha/MuMass/data"
#reconstruction
export RECOMULTEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/map_multiplex" #to be set
export RECOEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/analyze_PositionData"
export RECODIR=$DAQOUTDIR"/reconstructed"
#plotting and fitting
export ANALEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/reconstructAndPlot"
export ANALDIR=$DAQOUTDIR"/analysed"
make $ANALEXE
for file in $RECODIR/*root
do
#analysed data
export analfileout=$DAQOUTDIR/"analysed/Analysed_"$(basename $file)
#run the reco
echo "running reco for $file"
$ANALEXE $file $analfileout
done
echo "ALL DONE"
#!/bin/bash
#define parameters
export TIMEWAIT=300 #second
#daq parameters
export DAQEXE="" #to be set
export DAQDIR=""
export DAQOUTDIR="/home/positron/LymanAlpha/MuMass/data"
#reconstruction
export RECOMULTEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/map_multiplex" #to be set
export RECOEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/analyze_PositionData"
export RECODIR=$DAQOUTDIR"/reconstructed"
#plotting and fitting
export ANALEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/reconstructAndPlot"
export ANALDIR=$DAQOUTDIR"/analysed"
while [ true ]
do
echo "CHECK DAQ IS COMPILED"
cd $DAQDIR
make
$DAQEXE
echo "CHECK IF NEW FILES ARE THERE"
for file in $DAQOUTDIR/*root
do
#check if file was already mapped to multiplexing
export newfile=$(basename $file)
export multiplexedfile=$DAQOUTDIR"/mapped/${newfile%.*}_mapped.root"
echo "multiplexed file is: $multiplexedfile"
if [ ! -f $multiplexedfile ]; then
#run the reco
echo "$file not yet mapped, running multiplexing"
#WARNING: bad hack!! dumping filename to txt to read
echo $file > /home/positron/LymanAlpha/MuMass/mumass-mm-analysis/filename.txt
echo "converting file: $file"
cd /home/positron/LymanAlpha/MuMass/mumass-mm-analysis/
root -l -q /home/positron/LymanAlpha/MuMass/mumass-mm-analysis/domultiplexing.C
cd -
#check if reconstructed file exist
export recofileout=$DAQOUTDIR/"reconstructed/Reco_"$(basename $multiplexedfile)
#run the reco
echo "$multiplexedfile not yet reconstructed, running reco"
$RECOEXE $multiplexedfile $recofileout
#analysed data
export analfileout=$DAQOUTDIR/"analysed/Analysed_"$(basename $recofileout)
#run the reco
echo "$multiplexedfile not yet reconstructed, running reco"
$ANALEXE $recofileout $analfileout
fi
echo "FILE $file SCANNED"
done
echo "ALL FINISHED, WAITING FOR $TIMEWAIT SECONDS"
sleep $TIMEWAIT
#for now blocking it here
continue
#run the python script for plotting
echo "RUNNING PLOTTING SCRIPT"
python --directory $ANALDIR --log --histoname decayPositions_z_10deg --fitoption ML --normalize --drawline --targetz 0 --fitrange -30 -5 --nfiles 3
done
#!/bin/bash
#define parameters
export TIMEWAIT=300 #second
if [ $# -gt 2 ]; then
echo "INVALID PARAMETER NUMBER: $#"
echo "usage: ./pushdata <datadir> <time between copy in seconds>"
exit
fi
DATADIR=$1
SERVERNAME=deperoe@essos4.ethz.ch
SERVERDIR=/mnt/storage/deperoe/mumass/run_November2021
TIME=$2
#run command
while [ true ]
do
rsync -avh --progress $1 $SERVERNAME:$SERVERDIR
sleep $TIME
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment