-- FudongHe - 2020-12-09

Introduction

Muon working points calibration

Reference

Go through the package

  • Just follow Shunichi's instructions, repeat similar steps with some updates here.

Setup

mkdir build run

# From my side, I find it easier to clone with krb5.
git clone --recursive https://:@gitlab.cern.ch:8443/atlas-mcp/MuonTPPostProcessing.git source

cd source/MuonTPPostProcessing
git checkout fuhe_addPLImprovedWPs
cd ..
setupATLAS; lsetup rucio
asetup AthAnalysis,21.2.156,here
cd ../build; cmake ../source
make
source ../build/x86_64-centos7-gcc62-opt/setup.sh

  • Setting Up after every login

# go to working directory
cd source/
setupATLAS; lsetup rucio
asetup AthAnalysis,21.2.156,here
source ../build/x86_64-centos7-gcc62-opt/setup.sh

1. Prepare input -- optional

# find the v063 containers on CERN-PROD_PERF-MUONS
python $TestArea/ClusterSubmission/python/ListDisk.py --rse CERN-PROD_PERF-MUONS -p v063

  • You will get a file e.g. CERN-PROD_PERF-MUONS_2020-12-02_v063.txt. You can based on this file to prepare input config files to contain the direct paths to files.
# suggest to do this on lxplus -- ClusterSubmission /python/Utils.py  
# e.g On lxplus, the input should look like https://gitlab.cern.ch/atlas-mcp/MuonTPPostProcessing/-/tree/master/MuonTPPostProcessing/data/InputConfCERN/v059
python $TestArea/MuonTPPostProcessing/python/FileManagement/CreateInputConfigs.py -i CERN-PROD_PERF-MUONS_2020-12-02_v063.txt --engine LOCAL -J fuhe --readFromRSE --rse CERN-PROD_PERF-MUONS -o InputConfCERN -v063

2. Generate the root file with histograms

  • Follow the instruction from the tutorial -- generate histograms
  • We need three config files for generating the plots, input config, run config, and histogram config.
  • You have to add your own working points to the run config, like PLIV run config

Test locally

# e.g. run Z mumu MC
WriteTagProbeHistos -i $TestArea/MuonTPPostProcessing/data/InputConfEOS/v064/2017_Zmumu_r10201_p4145.conf  -h $TestArea/MuonTPPostProcessing/data/HistoConf/ZIso/BkgSub_BasicHistos.conf -r $TestArea/MuonTPPostProcessing/data/RunConf/ZIso/ZIso/ZIso_LooseMuonProbes_PLImprovedWPs.conf  -o 2017_zmumu.root -begin 0 -end 3

# e.g. run 2017 data
WriteTagProbeHistos -i $TestArea/MuonTPPostProcessing/data/InputConfEOS/v064/data_2017_B_grp17_v01_p4144.conf  -h $TestArea/MuonTPPostProcessing/data/HistoConf/ZIso/BkgSub_BasicHistos.conf -r $TestArea/MuonTPPostProcessing/data/RunConf/ZIso/ZIso/ZIso_LooseMuonProbes_PLImprovedWPs.conf -o 2017_data.root -begin 0 -end 3

Submit jobs to HTCondor or to local machine

  • I think there are some bugs for the code that submits jobs to HTCondor, you can have a try.
  • For now, I run the production on our local machine by the command below.
python  $TestArea/MuonTPPostProcessing/python/SubmitToBatch.py --jobName PLIV_test -I $TestArea/MuonTPPostProcessing/data/InputConfEOS/v064 -R $TestArea/MuonTPPostProcessing/data/RunConf/ZIso/ZIso/ZIso_LooseMuonProbes_PLImprovedWPs.conf -H $TestArea/MuonTPPostProcessing/data/HistoConf/ZIso/BkgSub_BasicHistos.conf --engine LOCAL
# I see some bugs if I just use "--engine HTCONDOR " flag to submit jobs to Condor.

3. Generate efficiency and its systematic plots.

  • You need a "DSConfig" file to feed the input root files from above step.
  • reference: DSConfig ref
python $TestArea/MuonTPPostProcessing/python/Plotting/GeneratePlots.py -c $TestArea/MuonTPPostProcessing/python/Plotting/DSConfigsCERN/v064_temfit/Z_Rel21_2017.py -t EffPlots SysPlots -a ZmumuTPIso  -o Plots2017

4. Create scale factors

  • You can use the same "DSConfig" as above, but make sure your DSConfig file named by *_2015.py, *_2016.py, *_2017.py, *_2018.py.
  • You will generate 4 SFs for one isolation working point:
python $TestArea/MuonTPPostProcessing/python/SFFileCreation/CreateSF.py -c $TestArea/MuonTPPostProcessing/python/Plotting/DSConfigsCERN/v064_temfit/Z_Rel21_2015.py --InCfgDir $TestArea/MuonTPPostProcessing/data/InputConfEOS/v064  -a ZmumuTPIso -o SFFiles2015  &>log_createSFs_2015 &

python $TestArea/MuonTPPostProcessing/python/SFFileCreation/CreateSF.py -c $TestArea/MuonTPPostProcessing/python/Plotting/DSConfigsCERN/v064_temfit/Z_Rel21_2016.py --InCfgDir $TestArea/MuonTPPostProcessing/data/InputConfEOS/v064  -a ZmumuTPIso -o SFFiles2016  &>log_createSFs_2016 &

python $TestArea/MuonTPPostProcessing/python/SFFileCreation/CreateSF.py -c $TestArea/MuonTPPostProcessing/python/Plotting/DSConfigsCERN/v064_temfit/Z_Rel21_2017.py --InCfgDir $TestArea/MuonTPPostProcessing/data/InputConfEOS/v064  -a ZmumuTPIso -o SFFiles2017  &>log_createSFs_2017 &

python $TestArea/MuonTPPostProcessing/python/SFFileCreation/CreateSF.py -c $TestArea/MuonTPPostProcessing/python/Plotting/DSConfigsCERN/v064_temfit/Z_Rel21_2018.py --InCfgDir $TestArea/MuonTPPostProcessing/data/InputConfEOS/v064  -a ZmumuTPIso -o SFFiles2018  &>log_createSFs_2018 &

5. Apply SF to the histograms

  • Remake the histogram root files with the SF applied
  • You need modify one line "ClosureDir $Dir" to specify your directory of SFs in $TestArea/MuonTPPostProcessing/data/RunConf/ZIsoClosureConfig.conf
  • Note that you just need to rerun the MC, and use the different run configuration compare to step 2

python  $TestArea/MuonTPPostProcessing/python/SubmitToBatch.py --jobName PLIV_test_clo -I $TestArea/MuonTPPostProcessing/data/InputConfEOS/v064 -R $TestArea/MuonTPPostProcessing/data/RunConf/ZIso/ZIsoClosure/ZIso_LooseMuonProbes_PLImprovedWPs.conf -H $TestArea/MuonTPPostProcessing/data/HistoConf/ZIso/BkgSub_BasicHistos.conf --engine LOCAL --maxCurrentJobs 50

6. Generate closure plots

  • The latest (2021.03.17) input histograms without SF are: /afs/cern.ch/work/f/fuhe/public/MCP_ZTP/Closure/WithOutSF
  • The latest (2021.03.17) input histograms with SF are: /afs/cern.ch/work/f/fuhe/public/MCP_ZTP/Closure/WithSF
  • DSConfig files: /afs/cern.ch/work/f/fuhe/public/MCP_ZTP/Closure/Z_Rel21_2017_Closure.py and /afs/cern.ch/work/f/fuhe/public/MCP_ZTP/Closure/Z_Rel21_2017.py

python $TestArea/MuonTPPostProcessing/python/Plotting/GeneratePlots.py -c  /afs/cern.ch/work/f/fuhe/public/MCP_ZTP/Closure/Z_Rel21_2017.py  /afs/cern.ch/work/f/fuhe/public/MCP_ZTP/Closure/Z_Rel21_2017_Closure.py  -t ClosurePlots  -a ZmumuTPIso -o Plots17_sys  &>log_GeneratePlots17_sys&
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2021-03-17 - FudongHe
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback