Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for UL MiniAODv2 #150

Open
wants to merge 10 commits into
base: UL_master
Choose a base branch
from
1 change: 1 addition & 0 deletions multilep/python/particleLevelTTG_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
usePromptFinalStates = cms.bool(True), # for leptons, photons, neutrinos
excludePromptLeptonsFromJetClustering = cms.bool(True),
excludeNeutrinosFromJetClustering = cms.bool(True),
doJetClustering = cms.bool(True),

particleMinPt = cms.double(0.),
particleMaxEta = cms.double(5.), # HF range. Maximum 6.0 on MiniAOD
Expand Down
1 change: 1 addition & 0 deletions multilep/test/crab.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
config.JobType.sendExternalFolder = True
config.JobType.allowUndistributedCMSSW = True
config.JobType.numCores = 4
config.JobType.maxMemoryMB = 6000


config.section_('Data')
Expand Down
8 changes: 4 additions & 4 deletions multilep/test/multilep.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def getVal(arg):

# Latest recommended global tags can always be checked here: https://twiki.cern.ch/twiki/bin/viewauth/CMS/PdmVAnalysisSummaryTable
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
if is2018: process.GlobalTag.globaltag = '106X_dataRun2_v35' if isData else '106X_upgrade2018_realistic_v16_L1v1'
elif is2017: process.GlobalTag.globaltag = '106X_dataRun2_v35' if isData else '106X_mc2017_realistic_v9'
elif is2016preVFP: process.GlobalTag.globaltag = '106X_dataRun2_v35' if isData else '106X_mcRun2_asymptotic_preVFP_v11'
else: process.GlobalTag.globaltag = '106X_dataRun2_v35' if isData else '106X_mcRun2_asymptotic_v17'
if is2018: process.GlobalTag.globaltag = '106X_dataRun2_v37' if isData else '106X_upgrade2018_realistic_v16_L1v1'
elif is2017: process.GlobalTag.globaltag = '106X_dataRun2_v37' if isData else '106X_mc2017_realistic_v10'
elif is2016preVFP: process.GlobalTag.globaltag = '106X_dataRun2_v37' if isData else '106X_mcRun2_asymptotic_preVFP_v11'
else: process.GlobalTag.globaltag = '106X_dataRun2_v37' if isData else '106X_mcRun2_asymptotic_v17'

#
# Vertex collection
Expand Down
56 changes: 27 additions & 29 deletions multilep/test/runLocalHTCondor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ DATE=`date '+%Y%m%d_%H%M%S'`
#
input=$1
output="$2/$DATE/0000" # similar structure as crab
datasetName=$(echo "$2" | sed 's/\/.*//')
skim=$3
filesPerJob=$4
extraContent=$5
Expand All @@ -47,60 +48,57 @@ setCMSSW(){
echo "export PYTHONHOME=/cvmfs/cms.cern.ch/slc7_amd64_gcc820/external/python/2.7.15-pafccj" >> $1
}

#transfer(){
# #echo "gfal-mkdir -p srm://maite.iihe.ac.be:8443/$2/$(dirname $3)" >> $4
# #echo "cp -f file://$1/$3 srm://maite.iihe.ac.be:8443/$2/$3" >> $4
# #if [[ $proxy == *.sh ]]; then # Only clean-up the local files when a script is used for the proxy, then we are sure the proxy is valid and files should be copied correctly
# # echo "rm $1/$3" >> $4
# #fi
#}


#function to submit a job and catch invalid credentials
submitJob(){
if [ -e localSubmission.sub ]; then rm localSubmission.sub; fi

touch localSubmission.sub
if [ -e HTCondorSubmission/${datasetName}_localSubmission.sub ]; then rm HTCondorSubmission/${datasetName}_localSubmission.sub; fi

echo "universe = vanilla" >> localSubmission.sub
echo "executable = HTCondorSubmission/localSubmission\$(Process).sh" >> localSubmission.sub
touch HTCondorSubmission/${datasetName}_localSubmission.sub
if [[ ! -d "HTCondorSubmission/logs" ]]; then
mkdir "HTCondorSubmission/logs"
mkdir "HTCondorSubmission/err"
mkdir "HTCondorSubmission/out"
fi

echo "log = /user/nivanden/condor/logs/localSubmission_\$(ClusterId)_\$(Process).log" >> localSubmission.sub
echo "error = /user/nivanden/condor/error/localSubmission_\$(ClusterId)_\$(Process).err" >> localSubmission.sub
echo "output = /user/nivanden/condor/output/localSubmission_\$(ClusterId)_\$(Process).out" >> localSubmission.sub
echo "universe = vanilla" >> HTCondorSubmission/${datasetName}_localSubmission.sub
echo "executable = HTCondorSubmission/${datasetName}_localSubmission\$(Process).sh" >> HTCondorSubmission/${datasetName}_localSubmission.sub

# echo "x509userproxy = /user/nivanden/x509up_u23145" >> localSubmission.sub
# echo "use_x509userproxy = True" >> localSubmission.sub
dir=$(pwd)
echo "log = $dir/HTCondorSubmission/logs/${datasetName}_localSubmission_\$(ClusterId)_\$(Process).log" >> HTCondorSubmission/${datasetName}_localSubmission.sub
echo "error = $dir/HTCondorSubmission/err/${datasetName}_localSubmission_\$(ClusterId)_\$(Process).err" >> HTCondorSubmission/${datasetName}_localSubmission.sub
echo "output = $dir/HTCondorSubmission/out/${datasetName}_localSubmission_\$(ClusterId)_\$(Process).out" >> HTCondorSubmission/${datasetName}_localSubmission.sub

echo "queue $1" >> localSubmission.sub
echo "queue $1" >> HTCondorSubmission/${datasetName}_localSubmission.sub


condor_submit localSubmission.sub
# quick change to make it run. Right now no real error checking
condor_submit HTCondorSubmission/${datasetName}_localSubmission.sub
}

#make list of all files in input sample
fileList $input

mkdir "HTCondorSubmission"
if [[ ! -d "HTCondorSubmission" ]]; then
mkdir "HTCondorSubmission"
fi

#loop over new list of files and submit jobs
fileCount=0
submitCount=-1
submit=localSubmission0.sh
fileList=""
jobCount=0
submit=""

while read f; do
fileCount=$((fileCount + 1))
#submit a job for every few files, as specified in the input
if (( $fileCount % $filesPerJob == 0 )) || (( $fileCount == 1 ))
then if (( $fileCount % $filesPerJob == 0 )); then
#submitJob $submit
jobCount=$((jobCount + 1))
fileList=""
submitCount=$((submitCount + 1))
fi
#initialize temporary submission script
submitCount=$((submitCount + 1))
submit="HTCondorSubmission/localSubmission$submitCount.sh"

submit="HTCondorSubmission/${datasetName}_localSubmission${submitCount}.sh"

if [ -e $submit ]; then rm $submit; fi

Expand All @@ -110,7 +108,6 @@ while read f; do
setCMSSW $submit
exportProxy $submit
fi
userDir="/user/$USER/public/heavyNeutrino/$output"
pnfsDir="/pnfs/iihe/cms/store/user/$USER/heavyNeutrino/$output"
outputFile="${skim}_${fileCount}.root"
logFile="logs/${skim}_${fileCount}.txt"
Expand All @@ -119,7 +116,8 @@ while read f; do
mkdir -p ${pnfsDir}
mkdir -p ${pnfsDir}/errs
mkdir -p ${pnfsDir}/logs
echo "cmsRun ${CMSSW_BASE}/src/heavyNeutrino/multilep/test/multilep.py inputFile=$f outputFile=$pnfsDir/$outputFile events=-1 ${extraContent} > $pnfsDir/$logFile 2> $pnfsDir/$errFile" >> $submit
echo "cmsRun ${CMSSW_BASE}/src/heavyNeutrino/multilep/test/multilep.py inputFile=file://$f outputFile=$pnfsDir/$outputFile events=-1 ${extraContent}" >> $submit


done < fileList.txt

Expand Down
2 changes: 1 addition & 1 deletion multilep/test/scripts/makeFileList.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fileList(){
if [[ $input == *"/user/"* ]]; then #private sample
#add all files to list
for file in $input/*
do echo "dcap://maite.iihe.ac.be${file}" >> fileList.txt
do echo "${file}" >> fileList.txt
done
else #official sample

Expand Down
2 changes: 1 addition & 1 deletion multilep/test/submitAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def system(command):

if submitLocal or 'user' in dataset:
print 'Submitting ' + dataset + ' on the local resources:'
if 'user' in dataset: outputDir = dataset.split('/')[-1]
if 'user' in dataset: outputDir = '_'.join(dataset.split('/')[-2:])
else: outputDir = dataset.split('/')[1]

if 'Run201' in dataset: outputDir = os.path.join(outputDir, dataset.split('-')[0].split('/')[-1])
Expand Down
Binary file modified multilep/test/testing/09Aug2019_UL2017-ref.root
Binary file not shown.
Binary file modified multilep/test/testing/12Nov2019_UL2018-ref.root
Binary file not shown.
Binary file modified multilep/test/testing/21Feb2020_UL2016-ref.root
Binary file not shown.
Binary file modified multilep/test/testing/21Feb2020_UL2016_HIPM-ref.root
Binary file not shown.
Binary file modified multilep/test/testing/RunIISummer20UL16MiniAOD-ref.root
Binary file not shown.
Binary file modified multilep/test/testing/RunIISummer20UL16MiniAODAPV-ref.root
Binary file not shown.
Binary file modified multilep/test/testing/RunIISummer20UL17MiniAOD-ref.root
Binary file not shown.
Binary file modified multilep/test/testing/RunIISummer20UL18MiniAOD-ref.root
Binary file not shown.
53 changes: 46 additions & 7 deletions multilep/test/testing/tests.log
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
commit 1502fb3740ff8e30752bf0c24dc326492feecbbc
Author: Liam <liamwezenbeek@hotmail.com>
Date: Tue Oct 4 11:56:41 2022 +0200

Implement LNV tagging for HNL samples
commit 0c8f24aaf75fa9ecbe87e702aaf43b7d86b987cc
Author: NielsVdBossche <niels.vandenbossche@ugent.be>
Date: Fri Jul 28 09:37:43 2023 +0200

testing changes from t2b
diff --git a/multilep/test/testing/09Aug2019_UL2017-ref.root b/multilep/test/testing/09Aug2019_UL2017-ref.root
index 8b08adea..f20377d6 100644
Binary files a/multilep/test/testing/09Aug2019_UL2017-ref.root and b/multilep/test/testing/09Aug2019_UL2017-ref.root differ
diff --git a/multilep/test/testing/12Nov2019_UL2018-ref.root b/multilep/test/testing/12Nov2019_UL2018-ref.root
index c1c8c0db..5773b279 100644
Binary files a/multilep/test/testing/12Nov2019_UL2018-ref.root and b/multilep/test/testing/12Nov2019_UL2018-ref.root differ
diff --git a/multilep/test/testing/21Feb2020_UL2016-ref.root b/multilep/test/testing/21Feb2020_UL2016-ref.root
index 00fef7fa..863a9e9a 100644
Binary files a/multilep/test/testing/21Feb2020_UL2016-ref.root and b/multilep/test/testing/21Feb2020_UL2016-ref.root differ
diff --git a/multilep/test/testing/21Feb2020_UL2016_HIPM-ref.root b/multilep/test/testing/21Feb2020_UL2016_HIPM-ref.root
index 81119b19..c0d19889 100644
Binary files a/multilep/test/testing/21Feb2020_UL2016_HIPM-ref.root and b/multilep/test/testing/21Feb2020_UL2016_HIPM-ref.root differ
diff --git a/multilep/test/testing/RunIISummer20UL18MiniAOD-ref.root b/multilep/test/testing/RunIISummer20UL18MiniAOD-ref.root
index 7bfd2523..98cf1b6e 100644
Binary files a/multilep/test/testing/RunIISummer20UL18MiniAOD-ref.root and b/multilep/test/testing/RunIISummer20UL18MiniAOD-ref.root differ

--------------------------------------------------------------------------------------------------

Expand All @@ -23,21 +38,45 @@ Running test: 21Feb2020_UL2016_HIPM --> OK
--------------------------------------------------------------------------------------------------

Running test: RunIISummer20UL18MiniAOD --> OK
Changed:
_pl_jetE mean: 0.0000 --> 83.9019 rms: 0.0000 --> 55.6031
_pl_jetEta mean: 0.0000 --> -0.1213 rms: 0.0000 --> 1.1988
_pl_jetHadronFlavor mean: 0.0000 --> 0.4457 rms: 0.0000 --> 1.3623
_pl_jetPhi mean: 0.0000 --> 0.1950 rms: 0.0000 --> 1.7236
_pl_jetPt mean: 0.0000 --> 44.6225 rms: 0.0000 --> 22.5646
_pl_nJets mean: 0.0000 --> 0.9200 rms: 0.0000 --> 0.9130

--------------------------------------------------------------------------------------------------

Running test: RunIISummer20UL17MiniAOD --> OK
Changed:
_eventNb mean: 222970355.6000 --> 222970355.6000 rms: 62.4820 --> 62.4179
_pl_jetE mean: 0.0000 --> 106.9979 rms: 0.0000 --> 81.6421
_pl_jetEta mean: 0.0000 --> -0.3299 rms: 0.0000 --> 1.2958
_pl_jetHadronFlavor mean: 0.0000 --> 0.7273 rms: 0.0000 --> 1.7281
_pl_jetPhi mean: 0.0000 --> 0.2121 rms: 0.0000 --> 1.7128
_pl_jetPt mean: 0.0000 --> 51.0534 rms: 0.0000 --> 27.2263
_pl_nJets mean: 0.0000 --> 0.3300 rms: 0.0000 --> 0.6489

--------------------------------------------------------------------------------------------------

Running test: RunIISummer20UL16MiniAOD --> OK
Changed:
_eventNb mean: 145272637.0100 --> 145272637.0100 rms: 77.2010 --> 77.2269
_eventNb mean: 145272637.0100 --> 145272637.0100 rms: 77.2528 --> 77.2269
_pl_jetE mean: 0.0000 --> 108.9045 rms: 0.0000 --> 105.6007
_pl_jetEta mean: 0.0000 --> -0.0042 rms: 0.0000 --> 1.3613
_pl_jetHadronFlavor mean: 0.0000 --> 0.1538 rms: 0.0000 --> 0.7692
_pl_jetPhi mean: 0.0000 --> -0.1486 rms: 0.0000 --> 1.8393
_pl_jetPt mean: 0.0000 --> 44.4887 rms: 0.0000 --> 17.3455
_pl_nJets mean: 0.0000 --> 0.5200 rms: 0.0000 --> 0.7277

--------------------------------------------------------------------------------------------------

Running test: RunIISummer20UL16MiniAODAPV --> OK
Changed:
_eventNb mean: 234787628.0300 --> 234787628.0300 rms: 74.5654 --> 74.6726
_pl_jetE mean: 0.0000 --> 109.0976 rms: 0.0000 --> 91.7862
_pl_jetEta mean: 0.0000 --> -0.1406 rms: 0.0000 --> 1.2906
_pl_jetHadronFlavor mean: 0.0000 --> 0.2667 rms: 0.0000 --> 0.9978
_pl_jetPhi mean: 0.0000 --> 0.0225 rms: 0.0000 --> 1.8042
_pl_jetPt mean: 0.0000 --> 50.8121 rms: 0.0000 --> 28.1359
_pl_nJets mean: 0.0000 --> 0.6000 rms: 0.0000 --> 0.9695
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BRANCH=UL_master
# fi

export SCRAM_ARCH=slc7_amd64_gcc820
RELEASE=CMSSW_10_6_27
RELEASE=CMSSW_10_6_30

# If the release is already available using cmsenv, use it, otherwise set up a new one
if [[ $CMSSW_BASE == *$RELEASE ]] && [[ -d $CMSSW_BASE ]]; then
Expand Down