-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateFileListReco.sh
More file actions
executable file
·41 lines (32 loc) · 902 Bytes
/
createFileListReco.sh
File metadata and controls
executable file
·41 lines (32 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
if [ -z "$1" ]
then
echo "./createFileList.sh [RUN] [SUBRUN]"
echo "if no subrun is provided it will create a file list for the whole run"
exit 1
fi
RUN=$1
SUBRUN=$(printf "%04d" $2)
outdir=/dune/data/users/lcremone/ProtoDuneNoise/filelists/
outname=$outdir/np04_raw_run00${RUN}_${SUBRUN}_reco.list
if [ -z "$2" ]
then
SUBRUN='%'
outname=$outdir/np04_raw_run00${RUN}_allsubruns_reco.list
fi
filename=np04_raw_run00${RUN}_${SUBRUN}_dl%_reco_%.root
echo $filename
sortedlist=`samweb list-files "file_name like $filename" | sort -V`
echo $sortedlist
prefix='enstore:'
for file in `echo $sortedlist`;
do
filepath=`samweb locate-file $file | grep pnfs`;
if [[ $filepath == *"pnfs"* ]]; then
#echo $filepath
filepath=${filepath#"$prefix"}
filepath=${filepath%(*}
ls $filepath/*root
fi
done > $outname
echo "Saved list in $outname"