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

Include detailed TPC geometry

parent 75f4fbaa
......@@ -2,7 +2,9 @@
# animate_particles.py - Animate HEP events
#
# For console only rendering (example):
# $ blender -noaudio --background -P animate_particles.py -- -radius=0.05 -duration=1 -camera="BarrelCamera" -datafile="esd-detail.dat" -n_event=0 -simulated_t=0.02 -fps=24 -resolution=100 -transparency=1.2 -stamp_note="Texto no canto" -its=1 -tpc=0 -trd=1 -emcal=0 -blendersave=0 -picpct=5
# $ blender -noaudio --background -P animate_particles.py -- -radius=0.05 -duration=1 -camera="BarrelCamera" \
# -datafile="esd-detail.dat" -n_event=0 -simulated_t=0.02 -fps=24 -resolution=100 -transparency=1.2 \
# -stamp_note="Texto no canto" -its=1 -tpc=0 -trd=1 -detailed_tpc=1 -emcal=0 -blendersave=0 -picpct=5 -tpc_blender_path="/home/files/blender"
#
import os
......@@ -42,6 +44,8 @@ parser.add_argument('-trd','--trd')
parser.add_argument('-emcal','--emcal')
parser.add_argument('-blendersave','--blendersave')
parser.add_argument('-picpct','--picpct')
parser.add_argument('-tpc_blender_path','--tpc_blender_path')
parser.add_argument('-detailed_tpc','--detailed_tpc')
args = parser.parse_args()
bpy.context.user_preferences.view.show_splash = False
......@@ -59,9 +63,10 @@ resolution_percent = int(args.resolution_percent)
stamp_note = args.stamp_note
transp_par = float(args.transp_par)
datafile = str(args.datafile)
detectors = [int(args.its),int(args.tpc),int(args.trd),int(args.emcal)] # Array that stores which detectors to build
detectors = [int(args.its),int(args.tpc),int(args.trd),int(args.emcal),int(args.detailed_tpc)] # Array that stores which detectors to build
blendersave = int(args.blendersave) # 1 (save Blender file) or 0 (don't)
picpct = int(args.picpct) # percentage of animation to take picture
tpc_blender_path = str(args.tpc_blender_path) # path to 'animate' directory, where .blend file for detailed TPC is saved
#configure output
outputPath = "/tmp/alice_blender/"
......@@ -84,7 +89,7 @@ driver = dataDriver("AlirootFileGenerator",n_event,datafile) # Simple dataDriver
driver.configure(renderCamera, duration, fps, simulated_t, outputPath, fileIdentifier, resolution_percent)
### Build scene
init(stamp_note,renderCamera,transp_par,detectors) # Cleanup, addCameras, addALICE_TPC
init(stamp_note,renderCamera,transp_par,detectors,tpc_blender_path) # Cleanup, addCameras, addALICE_TPC
particles = driver.getParticles()
blender_particles, blender_tracks = createSceneParticles(particles,createTracks = True) # Create blender objects - one sphere per particle
......
This diff is collapsed.
......@@ -36,7 +36,7 @@ fi
OPTIONS=c:hdau:m:n:t:r:
LONGOPTS=camera:,mosaic,resolution:,fps:,transparency:,duration:,maxparticles:,\
minparticles:,numberofevents:,minavgpz:,minavgpt:,help,download,sample,url:,its,\
tpc,trd,emcal,blendersave,picpct:
tpc,detailedtpc,trd,emcal,blendersave,picpct:
# -regarding ! and PIPESTATUS see above
# -temporarily store output to be able to check for errors
......@@ -71,6 +71,7 @@ SAMPLE=false
URL=
ITS=1 # 1 means "build this detector", while 0 means "don't"
TPC=1
DETAILED_TPC=0
TRD=1
EMCAL=1
BLENDERSAVE=0
......@@ -151,6 +152,10 @@ while true; do
TPC=0
shift
;;
--detailedtpc)
DETAILED_TPC=1
shift
;;
--trd)
TRD=0
shift
......@@ -234,6 +239,8 @@ Usage:
038/ESD/0001/AliESDs.root
--its
Removes ITS detector from animation
--detailedtpc
Includes more detailed version of TPC in animation
--tpc
Removes TPC detector from animation
--trd
......@@ -285,8 +292,12 @@ else
if [[ $ITS = 1 ]]; then
echo "Building ITS"
fi
if [[ $TPC = 1 ]]; then
echo "Building TPC"
if [[ $DETAILED_TPC = 1 ]]; then
echo "Building detailed TPC"
else
if [[ $TPC = 1 ]]; then
echo "Building TPC"
fi
fi
if [[ $TRD = 1 ]]; then
echo "Building TRD"
......@@ -347,7 +358,8 @@ if [ "$SAMPLE" = "true" ]; then
-duration=${DURATION} -camera=${type} -datafile="d-esd-detail.dat" -simulated_t=0.03\
-fps=${FPS} -resolution=${RESOLUTION} -transparency=${TRANSPARENCY} -stamp_note=\
"opendata.cern.ch_record_1102_alice_2010_LHC10h_000139038_ESD_0001_2" -its=${ITS} \
-tpc=${TPC} -trd=${TRD} -emcal=${EMCAL} -blendersave=${BLENDERSAVE} -picpct=5
-tpc=${TPC} -trd=${TRD} -emcal=${EMCAL} -detailed_tpc=${DETAILED_TPC} \
-blendersave=${BLENDERSAVE} -picpct=${PICPCT} -tpc_blender_path=${BLENDER_SCRIPT_DIR}
done
popd
BLENDER_OUTPUT=.
......@@ -457,7 +469,8 @@ elif [ "$SAMPLE" = "false" ]; then
-duration=${DURATION} -camera=${type} -datafile="${LOCAL_FILE_WITH_DATA}"\
-n_event=${EVENT_ID} -simulated_t=0.03 -fps=${FPS} -resolution=${RESOLUTION}\
-transparency=${TRANSPARENCY} -stamp_note="${EVENT_UNIQUE_ID}" -its=${ITS}\
-tpc=${TPC} -trd=${TRD} -emcal=${EMCAL} -blendersave=${BLENDERSAVE} -picpct=${PICPCT}
-tpc=${TPC} -trd=${TRD} -emcal=${EMCAL} -detailed_tpc=${DETAILED_TPC} \
-blendersave=${BLENDERSAVE} -picpct=${PICPCT} -tpc_blender_path=${BLENDER_SCRIPT_DIR}
echo "${type} for event ${EVENT_UNIQUE_ID} done."
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