exit
fi
-NN=5000
-echo 'analysing first'
+NN=1000
+SK=1000
+echo 'analyzing first'
echo ${NN}
-echo 'events...'
+echo 'events...'
+echo skipping ${SK} events
echo ' '
-echo 'fraction of trailing edges preceeding the leading edges'
+echo 'fraction of trailing edges without ToT info'
echo ' '
# this is the famous Carsten programming style...
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2000 | grep 'sing:0' | grep -v 'tot' | wc -l > check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2000 | grep 'sing:0' | grep -v 'tot' | wc -l > check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2000 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2000 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2001 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2001 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2001 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2001 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2002 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2002 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2002 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2002 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2003 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2003 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2003 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2003 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2004 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2004 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2004 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2004 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2005 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2005 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2005 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2005 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2006 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2006 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2006 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2006 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2007 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2007 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2007 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2007 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2008 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2008 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2008 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2008 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2009 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2009 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2009 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2009 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200a | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200a | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200a | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200a | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200b | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200b | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200b | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200b | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200c | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200c | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200c | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200c | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200d | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200d | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200d | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200d | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200e | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200e | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200e | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200e | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200f | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200f | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200f | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x200f | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2014 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2014 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2014 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2014 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2015 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2015 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2015 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2015 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2016 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2016 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2016 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2016 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2017 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2017 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2017 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2017 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2018 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2018 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2018 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2018 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2019 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2019 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2019 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x2019 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201a | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x201a | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201a | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x201a | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201b | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x201b | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201b | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x201b | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201c | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x201c | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201c | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x201c | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201d | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x201d | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
EOF
-hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201d | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+hldprint <<EOF $1 -raw -num $NN -skip $SK -onlytdc 0x201d | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
EOF