Skip to content

Commit e25c6d4

Browse files
authored
feat: PFNano for Run2022 re-reco data and Run 3 Summer22(EE) MC (#49)
* PFNano for Run2022 re-reco data and Run 3 Summer22(EE) MC * delete promptReco config file * move fakeNameforCrab modifier to cmsDriver command
1 parent 3e3f6c3 commit e25c6d4

8 files changed

+80
-102
lines changed

README.md

+33-27
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
**You are currently viewing a development branch**
44
Uses PUPPI Jets as default for Run3.
55

6-
Tested with data (Run2022C onwards), MC for Run3 (Run3Summer22 made with 124X), MC for Run3 (Run3Winter22 made with 122X).
6+
Tested with data (up to including Re-reco Run2022D), MC for Run3 (Run3Summer22 and Run3Summer22EE, nanoAODv11).
77

8-
Run2022 data _before_ RunC is still WIP and will not run with this exact setup.
8+
For RunE, a different global tag compared to ABCD is needed and already defined, but could have not been tested due to the MINIAOD samples not yet produced (February 9th, 2023). Run FG are currently WIP.
99

1010
If you are searching for a recipe to run with Run2 samples, please have a look at the master branch (106X).
1111

@@ -16,16 +16,16 @@ This format can be used with [fastjet](http://fastjet.fr) directly.
1616

1717
## Recipe
1818

19-
For 2022 data and MC **NanoAOD (Pre-)v10** according to the [XPOG](https://gitlab.cern.ch/cms-nanoAOD/nanoaod-doc/-/wikis/Releases/NanoAODv10) and [PPD](https://twiki.cern.ch/twiki/bin/view/CMS/PdmVRun3Analysis) recommendations:
19+
For 2022 data and MC **NanoAOD v11** according to the [XPOG](https://gitlab.cern.ch/cms-nanoAOD/nanoaod-doc/-/wikis/Releases/NanoAODv11) and [PPD](https://twiki.cern.ch/twiki/bin/view/CMS/PdmVRun3Analysis) recommendations:
2020

2121
```
22-
cmsrel CMSSW_12_4_8
23-
cd CMSSW_12_4_8/src
22+
cmsrel CMSSW_12_6_0_patch1
23+
cd CMSSW_12_6_0_patch1/src
2424
cmsenv
2525
git clone https://github.com/cms-jet/PFNano.git PhysicsTools/PFNano
2626
cd PhysicsTools/PFNano
2727
git fetch
28-
git switch 12_4_8
28+
git switch 12_6_0
2929
cd ../..
3030
scram b -j 10
3131
cd PhysicsTools/PFNano/test
@@ -58,7 +58,7 @@ In general, whenever `_add_DeepJet` is specified (does not apply to `AK8JetsOnly
5858
All python config files were produced with `cmsDriver.py`.
5959

6060
Two imporant parameters that one needs to verify in the central nanoAOD documentation are `--conditions` and `--era`.
61-
- `--era` options from [WorkBookNanoAOD](https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookNanoAOD) or [XPOG](https://gitlab.cern.ch/cms-nanoAOD/nanoaod-doc/-/wikis/Releases/NanoAODv10)
61+
- `--era` options from [WorkBookNanoAOD](https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookNanoAOD) or [XPOG](https://gitlab.cern.ch/cms-nanoAOD/nanoaod-doc/-/wikis/Releases/NanoAODv11)
6262
- `--conditions` can be found here [PdMV](https://twiki.cern.ch/twiki/bin/view/CMS/PdmV)
6363

6464
@BTV-Commissioning-Team: the recommended PFNano customization for data is `PFnano_customizeData_add_DeepJet` and for MC `PFnano_customizeMC_add_DeepJet_and_Truth`.
@@ -68,29 +68,29 @@ Two imporant parameters that one needs to verify in the central nanoAOD document
6868

6969

7070
```
71-
cmsDriver.py nano_data_2022 --data --eventcontent NANOAODSIM --datatier NANOAODSIM --step NANO \
72-
--conditions 124X_dataRun3_Prompt_v4 --era Run3 \
73-
--customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)));process.MessageLogger.cerr.FwkReport.reportEvery=100" --nThreads 4 \
74-
-n -1 --filein /store/data/Run2022C/DoubleMuon/MINIAOD/PromptReco-v1/000/355/863/00000/ab45899e-f1b8-49e7-be41-ee694b17b31d.root --fileout file:nano_data2022.root \
75-
--customise="PhysicsTools/NanoAOD/V10/nano_cff.nanoAOD_customizeV10,PhysicsTools/PFNano/pfnano_cff.PFnano_customizeData_add_DeepJet" --no_exec
71+
cmsDriver.py nano_data_2022ABCD --data --eventcontent NANOAOD --datatier NANOAOD --step NANO \
72+
--conditions 124X_dataRun3_v11 --era Run3,run3_nanoAOD_124 \
73+
--customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)));process.MessageLogger.cerr.FwkReport.reportEvery=1000;process.NANOAODoutput.fakeNameForCrab = cms.untracked.bool(True)" --nThreads 4 \
74+
-n -1 --filein "/store/data/Run2022C/DoubleMuon/MINIAOD/10Dec2022-v1/2820000/dea1757f-d2ef-467a-9062-714775d00e45.root" --fileout file:nano_data2022ABCD.root \
75+
--customise="PhysicsTools/PFNano/pfnano_cff.PFnano_customizeData_add_DeepJet" --no_exec
7676
```
7777
<br>
7878

7979
```
8080
cmsDriver.py nano_mc_Run3 --mc --eventcontent NANOAODSIM --datatier NANOAODSIM --step NANO \
81-
--conditions 124X_mcRun3_2022_realistic_v11 --era Run3 \
82-
--customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)));process.MessageLogger.cerr.FwkReport.reportEvery=100" --nThreads 4 \
83-
-n -1 --filein /store/relval/CMSSW_12_4_8/RelValTTbar_SemiLeptonic_PU_13p6/MINIAODSIM/PU_124X_mcRun3_2022_realistic_v11_summer22-v1/2580000/23bf3611-4033-4c70-9bf7-5ae65290e14f.root --fileout file:nano_mcRun3.root \
84-
--customise="PhysicsTools/NanoAOD/V10/nano_cff.nanoAOD_customizeV10,PhysicsTools/PFNano/pfnano_cff.PFnano_customizeMC_add_DeepJet_and_Truth" --no_exec
81+
--conditions 126X_mcRun3_2022_realistic_v2 --era Run3,run3_nanoAOD_124 \
82+
--customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)));process.MessageLogger.cerr.FwkReport.reportEvery=1000;process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True)" --nThreads 4 \
83+
-n -1 --filein "/store/mc/Run3Summer22MiniAODv3/QCD_PT-15to20_MuEnrichedPt5_TuneCP5_13p6TeV_pythia8/MINIAODSIM/124X_mcRun3_2022_realistic_v12-v1/30000/8590bc1e-abd3-4be4-a068-16f4cb6b4994.root" --fileout file:nano_mcRun3.root \
84+
--customise="PhysicsTools/PFNano/pfnano_cff.PFnano_customizeMC_add_DeepJet_and_Truth" --no_exec
8585
```
8686
<br>
8787

8888
```
89-
cmsDriver.py nano_mc_Run3_122X --mc --eventcontent NANOAODSIM --datatier NANOAODSIM --step NANO \
90-
--conditions 124X_mcRun3_2022_realistic_v11 --era Run3,run3_nanoAOD_122 \
91-
--customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)));process.MessageLogger.cerr.FwkReport.reportEvery=100" --nThreads 4 \
92-
-n -1 --filein /store/mc/Run3Winter22MiniAOD/TTTo2L2Nu_CP5_13p6TeV_powheg-pythia8/MINIAODSIM/122X_mcRun3_2021_realistic_v9-v2/2550000/0d44f6e9-6961-4d60-b2c1-0e21c1249100.root --fileout file:nano_mcRun3_122X.root \
93-
--customise="PhysicsTools/NanoAOD/V10/nano_cff.nanoAOD_customizeV10,PhysicsTools/PFNano/pfnano_cff.PFnano_customizeMC_add_DeepJet_and_Truth" --no_exec
89+
cmsDriver.py nano_mc_Run3_EE --mc --eventcontent NANOAODSIM --datatier NANOAODSIM --step NANO \
90+
--conditions 126X_mcRun3_2022_realistic_postEE_v1 --era Run3,run3_nanoAOD_124 \
91+
--customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)));process.MessageLogger.cerr.FwkReport.reportEvery=1000;process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True)" --nThreads 4 \
92+
-n -1 --filein "/store/mc/Run3Summer22EEMiniAODv3/QCD_PT-80to120_MuEnrichedPt5_TuneCP5_13p6TeV_pythia8/MINIAODSIM/124X_mcRun3_2022_realistic_postEE_v1-v1/2550000/eddaff63-eb30-4155-afdc-3db5b07105b8.root" --fileout file:nano_mcRun3_EE.root \
93+
--customise="PhysicsTools/PFNano/pfnano_cff.PFnano_customizeMC_add_DeepJet_and_Truth" --no_exec
9494
```
9595

9696
</details>
@@ -99,9 +99,9 @@ cmsDriver.py nano_mc_Run3_122X --mc --eventcontent NANOAODSIM --datatier NANOAOD
9999
## Submission to CRAB
100100

101101
For crab submission a handler script `crabby.py`, a crab baseline template `template_crab.py` and an example
102-
submission yaml card `card_example_data.yml` are provided. Fill out the individual entries for each new submission, e.g. dataset from DAS. @BTV-Commissioning-Team: this is also the file to put "BTV_Run3_2022_Comm_v1" for the output folder.
102+
submission yaml card `card_example_data.yml` are provided. Fill out the individual entries for each new submission, e.g. dataset from DAS. @BTV-Commissioning-Team: this is also the file to put "BTV_Run3_2022_Comm_v2" for the output folder.
103103

104-
- A single campaign (data/mc, year, config, output path) should be configured statically in a copy of `card_example_data.yml`.
104+
- A single campaign (data/mc, year, config, output path) should be configured statically in a copy of `card_example_dataABCD.yml`.
105105
- To submit:
106106
```
107107
source /cvmfs/grid.cern.ch/centos7-umd4-ui-4_200423/etc/profile.d/setup-c7-ui-example.sh
@@ -111,17 +111,17 @@ submission yaml card `card_example_data.yml` are provided. Fill out the individu
111111
cd CMSSW_12_4_8/src
112112
cmsenv
113113
cd PhysicsTools/PFNano/test
114-
python3 crabby.py -c card_example_data.yml --make --submit
114+
python3 crabby.py -c card_example_dataABCD.yml --make --submit
115115
```
116116

117117

118118
Or alternatively, split creation and submission of config which allows manual inspection before submission:
119119
```
120-
python3 crabby.py -c card_example_data.yml --make
120+
python3 crabby.py -c card_example_dataABCD.yml --make
121121
```
122122
then inspect manually if configuration is correct, and if all is fine:
123123
```
124-
python3 crabby.py -c card_example_data.yml --submit
124+
python3 crabby.py -c card_example_dataABCD.yml --submit
125125
```
126126
- Add `--test True` to disable publication on otherwise publishable config and produce a single file per dataset
127127

@@ -130,9 +130,15 @@ submission yaml card `card_example_data.yml` are provided. Fill out the individu
130130

131131
When processing data, a lumi mask should be applied. The so called golden JSON should be applicable in most cases. Should also be checked here https://twiki.cern.ch/twiki/bin/view/CMS/PdmV
132132

133+
* Golden JSON re-reco
134+
```
135+
# 2022: TBA
136+
```
137+
138+
133139
* Golden JSON prompt
134140
```
135-
# 2022: /eos/user/c/cmsdqm/www/CAF/certification/Collisions22/Cert_Collisions2022_355100_357900_Golden.json
141+
# 2022: /eos/user/c/cmsdqm/www/CAF/certification/Collisions22/Cert_Collisions2022_355100_362760_Golden.json
136142
```
137143

138144

python/pfnano_cff.py

-18
Original file line numberDiff line numberDiff line change
@@ -7,107 +7,89 @@
77
def PFnano_customizeMC(process):
88
addPFCands(process, True)
99
add_BTV(process, True, keepInputs=['DeepCSV','DDX'])
10-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
1110
return process
1211

1312
def PFnano_customizeMC_add_DeepJet(process):
1413
addPFCands(process, True)
1514
add_BTV(process, True, keepInputs=['DeepCSV','DeepJet','DDX'])
16-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
1715
return process
1816

1917
def PFnano_customizeMC_add_DeepJet_and_Truth(process):
2018
addPFCands(process, True)
2119
add_BTV(process, True, keepInputs=['DeepCSV','DeepJet','DDX'], storeAK4Truth="yes")
22-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
2320
return process
2421

2522
def PFnano_customizeMC_allPF(process):
2623
addPFCands(process, True, True)
2724
add_BTV(process, True, keepInputs=['DeepCSV','DDX'])
28-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
2925
return process
3026

3127
def PFnano_customizeMC_allPF_add_DeepJet(process):
3228
addPFCands(process, True, True)
3329
add_BTV(process, True, keepInputs=['DeepCSV','DeepJet','DDX'])
34-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
3530
return process
3631

3732
def PFnano_customizeMC_allPF_add_DeepJet_and_Truth(process):
3833
addPFCands(process, True, True)
3934
add_BTV(process, True, keepInputs=['DeepCSV','DeepJet','DDX'], storeAK4Truth="yes")
40-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
4135
return process
4236

4337
def PFnano_customizeMC_AK4JetsOnly(process):
4438
addPFCands(process, True, False, True)
4539
add_BTV(process, True, True, keepInputs=['DeepCSV'])
46-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
4740
return process
4841

4942
def PFnano_customizeMC_AK4JetsOnly_add_DeepJet(process):
5043
addPFCands(process, True, False, True)
5144
add_BTV(process, True, True, keepInputs=['DeepCSV','DeepJet'])
52-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
5345
return process
5446

5547
def PFnano_customizeMC_AK8JetsOnly(process):
5648
addPFCands(process, True, False, False, True)
5749
add_BTV(process, True, False, True, keepInputs=['DDX'])
58-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
5950
return process
6051

6152
def PFnano_customizeMC_noInputs(process):
6253
add_BTV(process, True, keepInputs=[])
63-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
6454
return process
6555

6656

6757
#### DATA customization
6858
def PFnano_customizeData(process):
6959
addPFCands(process, False)
7060
add_BTV(process, False, keepInputs=['DeepCSV','DDX'])
71-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
7261
return process
7362

7463
def PFnano_customizeData_add_DeepJet(process):
7564
addPFCands(process, False)
7665
add_BTV(process, False, keepInputs=['DeepCSV','DeepJet','DDX'])
77-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
7866
return process
7967

8068
def PFnano_customizeData_allPF(process):
8169
addPFCands(process, False, True)
8270
add_BTV(process, False, keepInputs=['DeepCSV','DDX'])
83-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
8471
return process
8572

8673
def PFnano_customizeData_allPF_add_DeepJet(process):
8774
addPFCands(process, False, True)
8875
add_BTV(process, False, keepInputs=['DeepCSV','DeepJet','DDX'])
89-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
9076
return process
9177

9278
def PFnano_customizeData_AK4JetsOnly(process):
9379
addPFCands(process, False, False, True)
9480
add_BTV(process, False, True, keepInputs=['DeepCSV'])
95-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
9681
return process
9782

9883
def PFnano_customizeData_AK4JetsOnly_add_DeepJet(process):
9984
addPFCands(process, False, False, True)
10085
add_BTV(process, False, True, keepInputs=['DeepCSV','DeepJet'])
101-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
10286
return process
10387

10488
def PFnano_customizeData_AK8JetsOnly(process):
10589
addPFCands(process, False, False, False, True)
10690
add_BTV(process, False, False, True, keepInputs=['DDX'])
107-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
10891
return process
10992

11093
def PFnano_customizeData_noInputs(process):
11194
add_BTV(process, False, keepInputs=[])
112-
process.NANOAODSIMoutput.fakeNameForCrab = cms.untracked.bool(True) # needed for crab publication
11395
return process

test/card_example_data.yml test/card_example_dataABCD.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ campaign:
33
crab_template: template_crab.py
44

55
# User specific
6-
workArea: data22_pub_yml # New each time
6+
workArea: data22abcd_pub_yml # New each time
77
storageSite: T2_DE_RWTH # Make sure you have write access
88
outLFNDirBase: /store/user/anstein/PFNano # Change username and path
99
voGroup: dcms # or leave empty
1010

1111
# Campaign specific
12-
tag_extension: BTV_Run3_2022_Comm_v1 # Will get appended after the current tag
12+
tag_extension: BTV_Run3_2022_Comm_v2 # Will get appended after the current tag
1313
tag_mod: # Will modify name in-place for MC eg. "PFNanoAODv1" will replace MiniAODv2 -> PFNanoAODv1
1414
# If others shall be able to access dataset via DAS (important when collaborating for commissioning!)
1515
publication: True
16-
config: nano_data_2022_NANO.py
16+
config: nano_data_2022ABCD_NANO.py
1717
# Specify if running on data
1818
data: True
1919
# data: False
@@ -23,5 +23,5 @@ campaign:
2323
# do NOT submit too many tasks at the same time, despite it looking more convenient to you
2424
# wait for tasks to finish before submitting entire campaigns,
2525
# it's better to request one dataset at a time (taking fairshare into account)
26-
datasets: /DoubleMuon/Run2022C-PromptReco-v1/MINIAOD
27-
26+
datasets: /DoubleMuon/Run2022C-10Dec2022-v1/MINIAOD
27+

test/card_example_mc.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ campaign:
33
crab_template: template_crab.py
44

55
# User specific
6-
workArea: summer22_124X_pub_yml # New each time
6+
workArea: summer22_126X_pub_yml # New each time
77
storageSite: T2_DE_RWTH # Make sure you have write access
88
outLFNDirBase: /store/user/anstein/PFNano # Change username and path
99
voGroup: dcms # or leave empty
1010

1111
# Campaign specific
12-
tag_extension: BTV_Run3_2022_Comm_v1 # Will get appended after the current tag
12+
tag_extension: BTV_Run3_2022_Comm_v2 # Will get appended after the current tag
1313
tag_mod: # Will modify name in-place for MC eg. "PFNanoAODv1" will replace MiniAODv2 -> PFNanoAODv1
1414
# If others shall be able to access dataset via DAS (important when collaborating for commissioning!)
1515
publication: True
@@ -23,5 +23,5 @@ campaign:
2323
# do NOT submit too many tasks at the same time, despite it looking more convenient to you
2424
# wait for tasks to finish before submitting entire campaigns,
2525
# it's better to request one dataset at a time (taking fairshare into account)
26-
datasets: /RelValTTbar_SemiLeptonic_PU_13p6/CMSSW_12_4_8-PU_124X_mcRun3_2022_realistic_v11_summer22-v1/MINIAODSIM
27-
26+
datasets: /QCD_PT-15to20_MuEnrichedPt5_TuneCP5_13p6TeV_pythia8/Run3Summer22MiniAODv3-124X_mcRun3_2022_realistic_v12-v1/MINIAODSIM
27+

test/card_example_mc122X.yml test/card_example_mcEE.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ campaign:
33
crab_template: template_crab.py
44

55
# User specific
6-
workArea: winter22_122X_pub_yml # New each time
6+
workArea: summer22ee_126X_pub_yml # New each time
77
storageSite: T2_DE_RWTH # Make sure you have write access
88
outLFNDirBase: /store/user/anstein/PFNano # Change username and path
99
voGroup: dcms # or leave empty
1010

1111
# Campaign specific
12-
tag_extension: BTV_Run3_2022_Comm_v1 # Will get appended after the current tag
12+
tag_extension: BTV_Run3_2022_Comm_v2 # Will get appended after the current tag
1313
tag_mod: # Will modify name in-place for MC eg. "PFNanoAODv1" will replace MiniAODv2 -> PFNanoAODv1
1414
# If others shall be able to access dataset via DAS (important when collaborating for commissioning!)
1515
publication: True
16-
config: nano_mc_Run3_122X_NANO.py
16+
config: nano_mc_Run3_EE_NANO.py
1717
# Specify if running on data
1818
# data: True
1919
data: False
@@ -23,5 +23,5 @@ campaign:
2323
# do NOT submit too many tasks at the same time, despite it looking more convenient to you
2424
# wait for tasks to finish before submitting entire campaigns,
2525
# it's better to request one dataset at a time (taking fairshare into account)
26-
datasets: /QCD_Pt_80to120_TuneCP5_13p6TeV_pythia8/Run3Winter22MiniAOD-122X_mcRun3_2021_realistic_v9-v2/MINIAODSIM
27-
26+
datasets: /QCD_PT-80to120_MuEnrichedPt5_TuneCP5_13p6TeV_pythia8/Run3Summer22EEMiniAODv3-124X_mcRun3_2022_realistic_postEE_v1-v1/MINIAODSIM
27+

0 commit comments

Comments
 (0)