UFLX2MuMu / Ntupliser

X2MuMu Ntupliser
1 stars 2 forks source link

Update PU weight file for 2018 #57

Closed bortigno closed 5 years ago

bortigno commented 5 years ago

Working on branch issue-57-update-up-2018.

Checking what I did for 2017 in the issue #6 to remind myself how to do it.

One small modification is that in 10_2_11_patch1 the pileupCalc.py script has a small bug (an extra parenthesis) in line 253, so I had to find where it was (which pileupCalc.py) then copy it to my working dir, fixing the bug and run it from my local dir, using the following options:

python pileupCalcLocal.py 
   -i data/JSON/Cert_314472-325175_13TeV_17SeptEarlyReReco2018ABC_PromptEraD_Collisions18_JSON.txt 
  --inputLumi=data/Pileup/PU_data_2018.txt 
  --calcMode=true 
  --minBiasXsec 69200 
  --maxPileupBin 99 
  --numPileupBins 99 data/Pileup/PU_data_2018.root

Where the data/Pileup/PU_data_2018.txt comes from https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions18/13TeV/PileUp/pileup_latest.txt The uncertainty use here is 2.5% following this twiki recommendation: https://twiki.cern.ch/twiki/bin/view/CMS/TWikiLUM#CurRec based on LUM-18-002. So I created the systematics files using the following cross sections:

69200 (1+0.025) = 70930 69200 (1-0.025) = 67470

python pileupCalcLocal.py 
  -i data/JSON/Cert_314472-325175_13TeV_17SeptEarlyReReco2018ABC_PromptEraD_Collisions18_JSON.txt 
  --inputLumi=data/Pileup/PU_data_2018.txt 
  --calcMode=true 
  --minBiasXsec 70930 
  --maxPileupBin 99 
  --numPileupBins 99 data/Pileup/PU_data_2018_up_v0.root

and

python pileupCalcLocal.py 
  -i data/JSON/Cert_314472-325175_13TeV_17SeptEarlyReReco2018ABC_PromptEraD_Collisions18_JSON.txt --inputLumi=data/Pileup/PU_data_2018.txt 
  --calcMode=true 
  --minBiasXsec 67470 
  --maxPileupBin 99 
  --numPileupBins 99 data/Pileup/PU_data_2018_down_v0.root

The MC scenario I took from GitHub: https://github.com/cms-sw/cmssw/blob/CMSSW_10_2_X/SimGeneral/MixingModule/python/mix_2018_25ns_JuneProjectionFull18_PoissonOOTPU_cfi.py

following the recommendation of this twiki: https://twiki.cern.ch/twiki/bin/view/CMS/PileupScenariosRun2

and used it to modify the script GeneratePU.py and ran it producing the file data/Pileup/PU_wgt_2018_Autumn18_v0.root

To do:

bortigno commented 5 years ago

Found big stupid bug. I branched out from master instead of master_2018_102X. Fixed now merging master_2018_102X to the branch issue-57-update-up-2018. It seems that merge was easy without conflicts. Though I found another problem: the muon_SF json in the *_cff.py is still poiting to the 2017 version. Reopened #55.

Things seem to be not kosher in this branch, maybe the branch merge didn't work as well as I thought.

bortigno commented 5 years ago

Fortunately I discovered that I just forgot to "git pull" the master_2018_102X.

Now I tried to merge the master back to issue-57-update-pu-2018 but the automatic merge failed. I need to solve conflicts on python/Analyzer_data_cff.py and python/Analyzer_MC_cff.py

This is the distribution of the MC PU_wgt on a signal sample:

h1_pu_weight_2018.pdf

Don't see pathologies.

Comparing the MC nVertices distribution with the data PU disrtibution it is clear that it didn't work Screenshot 2019-04-03 at 15 38 31

Looking at the PU profile saved in Generate.py for the MC, it does not look similar to the one that I get looking at the nVerticies in the MC tuples:

Screenshot 2019-04-03 at 16 12 40

I think the right thing to do is to compared nPU in the MC with the nVertices in the data. In that case there is a much better agreement.

Screenshot 2019-04-03 at 16 24 24

bortigno commented 5 years ago

Merged in PR #64