cms-tau-pog / TauFW

Analysis framework for tau analysis at CMS using NanoAOD
9 stars 40 forks source link

Add corrections for Run3 - 2023 + update sample config #60

Closed pmastrap closed 4 months ago

pmastrap commented 4 months ago

In this PR:

This PR is completed with the addition of PU reweight by @IzaakWN.

N.B. Also Muon SFs are a place holder for now, they need to be replaced by the central ones when available. They might be provided only in correctionlib format, hence by that time we should implement reading corrections via json files.

IzaakWN commented 4 months ago

Working on PU reweighting for 2023 today...

One comment regarding sample list. I would propose to organize all TauPOG-specific sample lists (for v10 on EOS) in a single subfolder:

samples/
...
├── nanoaod_sumw_2022_postEE.json
├── nanoaod_sumw_2022_preEE.json
├── PODAS23
│   ├── samples_2022_postEE.py
│   └── samples_2022_preEE.py
├── samples_2022_postEE.py
├── samples_2022_preEE.py
├── samples_2023C.py
├── samples_2023D.py
├── samples_UL2016_postVFP_nanoV10.py
├── samples_UL2016_preVFP_nanoV10.py
├── samples_UL2017_nanoV10.py
├── samples_UL2018_nanoV10.py
...
└── tutorial
    ├── samples_2022_postEE.py
    └── samples_UL2018.py

to

samples/
...
├── nanoaod_sumw_2022_postEE.json
├── nanoaod_sumw_2022_preEE.json
├── TauPOG
│   ├── samples_UL2016_postVFP_nanoV10.py
│   ├── samples_UL2016_preVFP_nanoV10.py
│   ├── samples_UL2017_nanoV10.py
│   ├── samples_UL2018_nanoV10.py
│   ├── samples_2022_postEE.py
│   ├── samples_2022_preEE.py
│   ├── samples_2023C.py
│   └── samples_2023D.py
...
└── tutorial
    ├── samples_2022_postEE.py
    └── samples_UL2018.py

What do you think, @pmastrap, @cardinia? (Of course, we plan to reorganize the samples lists into a new global configuration, so in the end it will be moved to a different top directory.)

IzaakWN commented 4 months ago

Added data & MC profiles for 2023. Comparison plots are here: https://ineuteli.web.cern.ch/ineuteli/pileup/2023/, which in turn can be compared to https://twiki.cern.ch/twiki/bin/view/CMSPublic/LumiPublicResults#Interactions_per_crossing_pi_AN2 (for 80 mb at least. :p). I will compare to pileup correctioblib JSON later.

Instructions to obtain the MC profiles:

pico.py channel pileup PileUp # link channel to module
pico.py submit -c pileup -y UL2016 --dtype mc
pico.py hadd -c pileup -y UL2016 --dtype mc --force
cd $CMSSW_BASE/src/TauFW/PicoProducer/data/pileup
python3 getPileupProfiles.py -y 2023C -c pileup -t mc -i /eos/user/i/ineuteli/analysis/2023C/*/*pileup.root
python3 getPileupProfiles.py -y 2023D -c pileup -t mc -i /eos/user/i/ineuteli/analysis/2023D/*/*pileup.root

Instructions to obtain the data profiles:

cd $CMSSW_BASE/src/TauFW/PicoProducer/data/pileup
python3 getPileupProfiles.py -y 2023C -c pileup -t data --json /eos/user/c/cmsdqm/www/CAF/certification/Collisions23/Cert_Collisions2023_eraC_367095_368823_Golden.json --pileup /eos/user/c/cmsdqm/www/CAF/certification/Collisions23/PileUp/BCD/pileup_JSON.txt -v2
python3 getPileupProfiles.py -y 2023D -c pileup -t data --json /eos/user/c/cmsdqm/www/CAF/certification/Collisions23/Cert_Collisions2023_eraD_369803_370790_Golden.json --pileup /eos/user/c/cmsdqm/www/CAF/certification/Collisions23/PileUp/BCD/pileup_JSON.txt -v2

which actually runs

pileupCalc.py -i /eos/user/c/cmsdqm/www/CAF/certification/Collisions23/Cert_Collisions2023_eraC_367095_368823_Golden.json --inputLumiJSON /eos/user/c/cmsdqm/www/CAF/certification/Collisions23/PileUp/BCD/pileup_JSON.txt --calcMode true --maxPileupBin 100 --numPileupBins 100 --minBiasXsec 69200 Data_PileUp_2023C_69p2.root
pileupCalc.py -i /eos/user/c/cmsdqm/www/CAF/certification/Collisions23/Cert_Collisions2023_eraD_369803_370790_Golden.json --inputLumiJSON /eos/user/c/cmsdqm/www/CAF/certification/Collisions23/PileUp/BCD/pileup_JSON.txt --calcMode true --maxPileupBin 100 --numPileupBins 100 --minBiasXsec 69200 Data_PileUp_2023D_69p2.root

Note I get many errors for run 368489, like the following:

Run 368489, LumiSection 1081 not found in Lumi/Pileup input file. Check your files!
cardinia commented 4 months ago

Working on PU reweighting for 2023 today...

One comment regarding sample list. I would propose to organize all TauPOG-specific sample lists (for v10 on EOS) in a single subfolder:

samples/
...
├── nanoaod_sumw_2022_postEE.json
├── nanoaod_sumw_2022_preEE.json
├── PODAS23
│   ├── samples_2022_postEE.py
│   └── samples_2022_preEE.py
├── samples_2022_postEE.py
├── samples_2022_preEE.py
├── samples_2023C.py
├── samples_2023D.py
├── samples_UL2016_postVFP_nanoV10.py
├── samples_UL2016_preVFP_nanoV10.py
├── samples_UL2017_nanoV10.py
├── samples_UL2018_nanoV10.py
...
└── tutorial
    ├── samples_2022_postEE.py
    └── samples_UL2018.py

to

samples/
...
├── nanoaod_sumw_2022_postEE.json
├── nanoaod_sumw_2022_preEE.json
├── TauPOG
│   ├── samples_UL2016_postVFP_nanoV10.py
│   ├── samples_UL2016_preVFP_nanoV10.py
│   ├── samples_UL2017_nanoV10.py
│   ├── samples_UL2018_nanoV10.py
│   ├── samples_2022_postEE.py
│   ├── samples_2022_preEE.py
│   ├── samples_2023C.py
│   └── samples_2023D.py
...
└── tutorial
    ├── samples_2022_postEE.py
    └── samples_UL2018.py

What do you think, @pmastrap, @cardinia? (Of course, we plan to reorganize the samples lists into a new global configuration, so in the end it will be moved to a different top directory.)

Hi @IzaakWN , maybe for the time being I'd leave the structure as is and change directly when the configuration is changed as a whole. It would expedite the SF measurements and save some time for people who are not following the developments closely.

pmastrap commented 4 months ago

Working on PU reweighting for 2023 today...

One comment regarding sample list. I would propose to organize all TauPOG-specific sample lists (for v10 on EOS) in a single subfolder:

samples/
...
├── nanoaod_sumw_2022_postEE.json
├── nanoaod_sumw_2022_preEE.json
├── PODAS23
│   ├── samples_2022_postEE.py
│   └── samples_2022_preEE.py
├── samples_2022_postEE.py
├── samples_2022_preEE.py
├── samples_2023C.py
├── samples_2023D.py
├── samples_UL2016_postVFP_nanoV10.py
├── samples_UL2016_preVFP_nanoV10.py
├── samples_UL2017_nanoV10.py
├── samples_UL2018_nanoV10.py
...
└── tutorial
    ├── samples_2022_postEE.py
    └── samples_UL2018.py

to

samples/
...
├── nanoaod_sumw_2022_postEE.json
├── nanoaod_sumw_2022_preEE.json
├── TauPOG
│   ├── samples_UL2016_postVFP_nanoV10.py
│   ├── samples_UL2016_preVFP_nanoV10.py
│   ├── samples_UL2017_nanoV10.py
│   ├── samples_UL2018_nanoV10.py
│   ├── samples_2022_postEE.py
│   ├── samples_2022_preEE.py
│   ├── samples_2023C.py
│   └── samples_2023D.py
...
└── tutorial
    ├── samples_2022_postEE.py
    └── samples_UL2018.py

What do you think, @pmastrap, @cardinia? (Of course, we plan to reorganize the samples lists into a new global configuration, so in the end it will be moved to a different top directory.)

I agree, it looks more organised.

pmastrap commented 4 months ago

@IzaakWN @cardinia I added some other minor changes and tested on a DY file for 2023C.

IzaakWN commented 4 months ago

@IzaakWN @cardinia I added some other minor changes and tested on a DY file for 2023C.

Perfect, thanks for testing! :ok_hand:

Hi @IzaakWN , maybe for the time being I'd leave the structure as is and change directly when the configuration is changed as a whole. It would expedite the SF measurements and save some time for people who are not following the developments closely.

Let's do the reorganizing later indeed. I also realized that the new 2023 sample lists are not TauPOG specific, but general DAS samples.

I sign off; this can be merged.