Skip to content

Commit

Permalink
New approach to set the seed when selecting events after transport
Browse files Browse the repository at this point in the history
  • Loading branch information
fprino committed May 31, 2021
1 parent 78fd624 commit d97cb54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions MC/dpgsim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ if [[ $CONFIG_MODE == *"sim"* ]] || [[ $CONFIG_MODE == *"full"* ]]; then
echo "* EVENT SELECTION : $CONFIG_SELEVMACRO" >&2
echo "* EVENT SELECTION : output log in tag.log" >&2

time aliroot -b -q -x $CONFIG_SELEVMACRO > tag.log 2>&1
aliroot -b -q -x ${CONFIG_SELEVMACRO}+ > tag.log 2>&1
exitcode=$?
isthere="$(grep "FOUND IN KINE TREE" tag.log)"
echo $isthere
Expand All @@ -1059,7 +1059,11 @@ if [[ $CONFIG_MODE == *"sim"* ]] || [[ $CONFIG_MODE == *"full"* ]]; then
echo "Requested particle not found -> generate another event"
rm *.Hits.root galice.root Kinematics.root TrackRefs.root geometry.root sim.log
jtry=$((jtry+1))
CONFIG_SEED=$(($CONFIG_SEED+1))
CONFIG_SEED=($(awk -v ranseed=$CONFIG_SEED 'BEGIN {
srand(ranseed)
k=rand()
print int(1 + k * 10000000)
}'))
echo "New seed" $CONFIG_SEED
fi
done
Expand Down

0 comments on commit d97cb54

Please sign in to comment.