Commit c3985c40 authored by Breno Rilho Lemos's avatar Breno Rilho Lemos 💬

Add default animation option to shell script

parent 598c9220
...@@ -43,7 +43,7 @@ int runAnalysis(int selected_event=0) ...@@ -43,7 +43,7 @@ int runAnalysis(int selected_event=0)
TChain* chain = new TChain("esdTree"); TChain* chain = new TChain("esdTree");
// add a few files to the chain (change this so that your local files are added) // add a few files to the chain (change this so that your local files are added)
chain->Add("AliESDs.root"); // Breno put it on the same directory that was cloned from Pezzi's // repository: AliESD_Example chain->Add("AliESDs.root"); // Breno put it on the same directory that was cloned from Pezzi's // repository: AliESD_Example
chain->Add("AliESDs2.root"); //chain->Add("AliESDs2.root");
//chain->Add("../root_files/AliAOD.Muons2.root"); //chain->Add("../root_files/AliAOD.Muons2.root");
//chain->Add("../root_files/AliAOD.Muons3.root"); //chain->Add("../root_files/AliAOD.Muons3.root");
......
...@@ -22,9 +22,11 @@ export PATH="/home/schnorr/install/blender-2.79-linux-glibc219-x86_64/:$PATH" ...@@ -22,9 +22,11 @@ export PATH="/home/schnorr/install/blender-2.79-linux-glibc219-x86_64/:$PATH"
############################## ##############################
function usage() function usage()
{ {
echo "$0 <URL> <DOWNLOAD>"; echo "$0 <URL> <DOWNLOAD> <DEFAULT_ANIMATION>(optional)";
echo " where <URL> is a URL to uniquely identify a dataset"; echo " where <URL> is a URL to uniquely identify a dataset";
echo " where <DOWNLOAD> is true or false, indicate whether the dataset should be downloaded"; echo " where <DOWNLOAD> is true or false, indicate whether the dataset should be downloaded";
echo " where <DEFAULT_ANIMATION> is true or false, indicate whether the default animation should be generated";
echo " leaving <DEFAULT_ANIMATION> blank will generate custom animation from data file";
} }
############################## ##############################
...@@ -44,6 +46,20 @@ if [ -z $DOWNLOAD ]; then ...@@ -44,6 +46,20 @@ if [ -z $DOWNLOAD ]; then
exit exit
fi fi
DEFAULT_ANIMATION=$3
if [ "$DEFAULT_ANIMATION" = "true" ]; then
echo "Preparing default animation."
##############################
# Phase 1: blender animate #
##############################
pushd ${BLENDER_SCRIPT_DIR}
blender -noaudio --background -P animate_particles.py -- -radius=0.05 -duration=2 -camera="BarrelCamera" -datafile="d-esd-detail.dat" -simulated_t=0.02 -fps=5 -resolution=100 -stamp_note="Texto no canto"
popd
mkdir --verbose -p ${BLENDER_OUTPUT}
mv --verbose /tmp/blender ${BLENDER_OUTPUT}
echo "Done."
fi
############################## ##############################
# Download Dataset # # Download Dataset #
############################## ##############################
...@@ -51,31 +67,32 @@ if [ "$DOWNLOAD" = "true" ]; then ...@@ -51,31 +67,32 @@ if [ "$DOWNLOAD" = "true" ]; then
echo "Downloading data." echo "Downloading data."
wget $URL wget $URL
fi fi
# Verify if AliESDs.root is here
ALIESD_ROOT_FILE=$(pwd)/AliESDs.root
############################## if [ -z $DEFAULT_ANIMATION ]; then
# Phase 1: aliroot extract # # Verify if AliESDs.root is here
############################## # #ALIESD_ROOT_FILE=$(pwd)/AliESDs.root
eval $(alienv -w ${ALIENV_WORK_DIR} -a ubuntu1604_x86-64 load ${ALIENV_ID}) mv --verbose $(pwd)/AliESDs.root ${ALIROOT_SCRIPT_DIR}
pushd ${ALIROOT_SCRIPT_DIR}
rm --verbose AliESDs.root
ln --verbose -s $ALIESD_ROOT_FILE AliESDs.root
aliroot runAnalysis.C
for type in s m l; do
ls -lh ${type}-esd-detail.dat
done
popd
############################## ##############################
# Phase 2: blender animate # # Phase 1: aliroot extract #
############################## ##############################
for type in s m l; do eval $(alienv -w /home/tropos/alice/sw -a ubuntu1804_x86-64 load ${ALIENV_ID}) #-w ${ALIENV_WORK_DIR} -a ubuntu1604_x86-64 load ${ALIENV_ID})
mv --verbose ${ALIROOT_SCRIPT_DIR}/${type}-esd-detail.dat ${BLENDER_SCRIPT_DIR} pushd ${ALIROOT_SCRIPT_DIR}
done # #rm --verbose AliESDs.root
pushd ${BLENDER_SCRIPT_DIR} # #ln --verbose -s $ALIESD_ROOT_FILE AliESDs.root
blender -noaudio --background -P animate_particles.py -- -radius=0.05 -duration=10 -camera="BarrelCamera" -datafile="d-esd-detail.dat" -simulated_t=0.02 -fps=24 -resolution=100 aliroot -q -b "runAnalysis.C(2)"
popd ls -lh esd-detail.dat
mkdir --verbose -p ${BLENDER_OUTPUT} #done
mv --verbose /tmp/blender ${BLENDER_OUTPUT} popd
echo "Done."
##############################
# Phase 2: blender animate #
##############################
mv --verbose ${ALIROOT_SCRIPT_DIR}/esd-detail.dat ${BLENDER_SCRIPT_DIR}
pushd ${BLENDER_SCRIPT_DIR}
blender -noaudio --background -P animate_particles.py -- -radius=0.05 -duration=2 -camera="BarrelCamera" -datafile="esd-detail.dat" -simulated_t=0.02 -fps=5 -resolution=100 -stamp_note="Texto no canto"
popd
mkdir --verbose -p ${BLENDER_OUTPUT}
mv --verbose /tmp/blender ${BLENDER_OUTPUT}
echo "Done."
fi
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