Skip to content

Commit

Permalink
fixed bugs in genweight stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dteague committed May 18, 2017
1 parent a4e2383 commit d13b304
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 45 deletions.
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Analyze_Grid/*~
Analyze_Grid/#*#
Analyze_Grid/*/*stderr
Analyze_Grid/*/*stdout
Analyze_Grid/*/*log
Analyze_Grid/*.root
Analyze_Grid/addingRoot_recursive.sh
Analyze_Grid/addingRoot.sh
Analyze_Grid/deleteEOSAnalysisRootFiles.csh
Analyze_Grid/run_adding.sh
Analyze_Grid/tntAnalyze.sh
Analyze_Grid/list_Samples/*txt
Fastsim_Grid/*~
nTuple_Grid/*~
tester
42 changes: 16 additions & 26 deletions Analyze_Grid/NormalSetup.csh → Analyze_Grid/NormalSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,17 @@ then
sed -i -e s/USER_NAME/$varname/g master.sh
fi

printf "What is the name of your eos analysis directory? Below are your options (enter number)"

temp_dir=$(ls list_Samples | head -n1)
top_dir=${temp_dir/.txt/}

fl1=""
for files in $(ls -d /eos/uscms/store/user/$varname/*/ | xargs -n 1 basename)
for files in $(ls /eos/uscms/store/user/$varname/)
do
for files2 in $(xrdfs root://cmseos.fnal.gov/ ls /store/user/$varname/$files)
do
tmp=""
if [ ! -z $files2 ]
then
tmp=$(basename $files2)
fi
if [ $tmp == $top_dir ]
then
fl1="$fl1 $files"
fi
done
diff <(ls list_Samples | xargs -n1 basename | sed 's/.txt//g') <(ls /eos/uscms/store/user/$varname/$files) &>/dev/null
if [ $? -eq 0 ]
then
fl1="$fl1 $files"
fi
done

echo
echo "What is the name of your eos analysis directory? Below are your options (enter number)"

select filename in $fl1 NEW_FILE
do
Expand All @@ -113,12 +101,12 @@ do
read dirname
done

xrdfs root://cmseos.fnal.gov/ mkdir /store/user/$varname/$dirname
sed -e "s/DUMMY/$varname/g" -e "s/TEMPDIRECTORY/$dirname/g" \
<defaults/makeEOSdirectories_default.csh >makeEOSdirectories.csh
chmod 700 makeEOSdirectories.csh
./makeEOSdirectories.csh
rm makeEOSdirectories.csh
mkdir /eos/uscms/store/user/$varname/$dirname
for file in $(ls ./list_Samples)
do
file=${file/.txt/}
mkdir /eos/uscms/store/user/$varname/$dirname/$file
done
echo Your eos analysis directories have been created
break

Expand All @@ -128,7 +116,9 @@ do
fi
done

printf "\n"
exit 0

echo

echo "Which analyzer do you want to use?"
analyzer_dir=$(get_Analyzer_dir)
Expand Down
6 changes: 6 additions & 0 deletions Analyze_Grid/SAMPLES_LIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ HTMHT_Run2016F_23Sep2016_v1_fix3
HTMHT_Run2016G_23Sep2016_v2_fix3
HTMHT_Run2016H_PromptReco_v2_fix3
HTMHT_Run2016H_PromptReco_v3_fix3

WJetsToLNu_HT-1200To2500_v1_RunIISummer16MiniAODv2
WJetsToLNu_HT-200To400_ext1-v1_RunIISummer16MiniAODv2
WJetsToLNu_HT-200To400_ext2-v1_RunIISummer16MiniAODv2
WJetsToLNu_HT-200To400_v1_RunIISummer16MiniAODv2
WJetsToLNu_HT-2500ToInf_ext1-v1_RunIISummer16MiniAODv2
2 changes: 1 addition & 1 deletion Analyze_Grid/defaults/addingRoot_recursive_default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ do
continue
fi

isData=$(echo $inputList | sed -rn 's/^(.+)_Run.*$/\1/gp')
isData=$(echo $inputList | sed -rn 's/^(.+)_Run201.*$/\1/gp')
num=$(xrdfs root://cmseos.fnal.gov/ ls /store/user/DUMMY/TEMPDIRECTORY/$inputList | grep root | wc -l)

if [ -z $isData ]
Expand Down
8 changes: 0 additions & 8 deletions Analyze_Grid/defaults/makeEOSdirectories_default.csh

This file was deleted.

2 changes: 1 addition & 1 deletion Analyze_Grid/defaults/tntAnalyze_default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cp -r ANALYZERDIRAnalyzer/PartDet/ .
cp -r ANALYZERDIRAnalyzer/Pileup/ .
cp -r ANALYZERDIRAnalyzer/Analyzer .

isData=$(echo $input_sample | grep "Run")
isData=$(echo $input_sample | grep "Run201")
if [ ! -z $isData ]
then
sed -r -i -e 's/(isData\s+)(0|false)/\1true/' -e 's/(CalculatePUS[a-z]+\s+)(1|true)/\1false/' \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash

for y in `ls -p -I defaults -I list_Samples | grep /`
for y in `ls -p | grep /`
do

new_file=${y/\//}
if [ -z $(ls list_Samples | grep $new_file) ]
then
continue
fi
echo Deleting the following directory: ${new_file}

rm -rf ${new_file}
Expand Down
5 changes: 4 additions & 1 deletion Analyze_Grid/get_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ do
echo "Can't find output files in this directory"
continue
fi
ls $store/$first/$name/*/*/OutTree*root | awk '{print "root://cmseos.fnal.gov//"$0}' > $start/list_Samples/$name.txt

generator=$(echo $first | sed -rn 's/^.*_13TeV(-|_)(.*)$/-\2/p')

ls $store/$first/$name/*/*/OutTree*root | awk '{print "root://cmseos.fnal.gov//"$0}' > $start/list_Samples/$name$generator.txt
done

done
10 changes: 5 additions & 5 deletions Analyze_Grid/master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ then
fi

touch kill_process.sh
echo "/usr/sbin/lsof | grep -e 'USER_NAME.*master.sh' | awk '{print \$2}' | xargs kill" > kill_process.sh
echo "condor_rm USER_NAME" >> kill_process.sh
echo "/usr/sbin/lsof | grep -e 'dteague.*master.sh' | awk '{print \$2}' | xargs kill" > kill_process.sh
echo "condor_rm dteague" >> kill_process.sh

IFS=$'\n'
for inputList in $(cat SAMPLES_LIST.txt)
Expand All @@ -74,7 +74,7 @@ do
cd ${inputList}
while [ $left -gt 0 ]
do
running=$(condor_q USER_NAME | grep $runfile | wc -l)
running=$(condor_q dteague | grep $runfile | wc -l)
if [ $running -ge $limit ]
then
sleep 1m
Expand All @@ -95,13 +95,13 @@ done

rm kill_process.sh

running=$(condor_q USER_NAME | grep $runfile | wc -l)
running=$(condor_q dteague | grep $runfile | wc -l)
echo
while [ $running -ne 0 ]
do
echo .
sleep 1m
running=$(condor_q USER_NAME | grep $runfile | wc -l)
running=$(condor_q dteague | grep $runfile | wc -l)
done

error=0
Expand Down

0 comments on commit d13b304

Please sign in to comment.