File indexing completed on 2024-04-06 11:57:28
0001
0002
0003
0004
0005
0006
0007
0008 if [ "$#" == 0 ]; then
0009 echo "Usage: cntevts_in_file.sh <filelist>"
0010 exit 1
0011 fi
0012
0013 TAG="nevents${2}"
0014
0015 rm -f $TAG.*
0016
0017 for file in $( cat $1 )
0018 do
0019 echo
0020 echo "Querying DBS for $file"
0021 echo "---> $(./query.py --input="find file.numevents where file=$file" --verbose=0 --limit=-1)" >> $TAG".tmp"
0022
0023 echo "#events: $( tail -n 2 $TAG.tmp )"
0024 done
0025
0026
0027
0028 IND=0
0029 takenext=0
0030
0031 for line in $(cat $TAG".tmp")
0032 do
0033 let IND=IND+1
0034
0035 if [ $IND == 1 ]
0036 then
0037 echo
0038 fi
0039
0040 if [ $takenext -ge 1 ]
0041 then
0042 let takenext=takenext+1
0043 fi
0044
0045
0046
0047 if [ "$line" == "Found" ]
0048 then
0049
0050
0051 takenext=1
0052 fi
0053
0054
0055
0056
0057 if [ $takenext == 4 ]
0058 then
0059 IND=0
0060
0061
0062 echo $line >> ${TAG}".out"
0063
0064 takenext=0
0065 fi
0066
0067 done
0068
0069 mv ${TAG}".out" ../data/
0070