Private NanoAOD production and contribution to NanoAOD

How to privately produce nanoAODs running on various datasets from past campaigns

You may want to make ntuples yourself for testing new features, for signal samples with special additional variables or for other particular workflows.

In order to run NANOAOD production, this are the base cmsDriver command for MC and data: myNanoProdMc -s NANO --mc --eventcontent NANOAODSIM --datatier NANOAODSIM  --no_exec  --conditions MyGlobalTag --era MyEraModifiers myNanoProdData -s NANO --data --eventcontent NANOAOD --datatier NANOAOD  --no_exec  --conditions MyGlobalTag --era MyEraModifiers

You should replace MyGlobalTag with the GT you want to use for production (it is used, for instance, to correct jets). You must provide this! If unsure, as a starting point, you can use the same one used in MINIAOD production, that is present in the sample name. Please refer to and for more updated versions.

MyEraModifiers has to be replaced by one of the strings that are summarized under production campaigns. Choose the line that fits your use case; e.g., NanoAODv8 production campaign. In this case the following strings are relevant:

Input dataset GT Era
RunIISummer20UL16MiniAOD/RunIISummer19UL16MiniAOD MC 106X_mcRun2_asymptotic_v15 Run2_2016,run2_nanoAOD_106Xv1
RunIISummer20UL17MiniAOD/RunIISummer19UL17MiniAOD MC 106X_mcRun2_asymptotic_v15 Run2_2017,run2_nanoAOD_106Xv1
RunIISummer20UL18MiniAOD/RunIISummer19UL18MiniAOD MC 106X_mcRun2_asymptotic_v15 Run2_2018,run2_nanoAOD_106Xv1
2016 UL data (Summer19/20) 106X_dataRun2_v32 Run2_2016,run2_nanoAOD_106Xv1
2017 UL data (Summer19/20) 106X_dataRun2_v32 Run2_2017,run2_nanoAOD_106Xv1
2018 UL data (Summer19/20) 106X_dataRun2_v32 Run2_2018,run2_nanoAOD_106Xv1


Moreover, in order to avoid segfault errors in the output module when producing flat ntuples, the following options should be added to the cmsDriver command:

--customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"

as it is done in the merge jobs in central production (Configuration/DataProcessing/python/

Instructions for NanoAODv8 production

Run from CMSSW_10_6_19_patch2 vanilla area, without merging any newer version of the NanoAOD package

JEC in use are:

  • 2016: Summer16_07Aug2017_V11
  • 2017: Fall17_17Nov2017_V32
  • 2018: Autumn18_V8

*2016 RunIISummer19UL16NanoAODv2 MC:* myNanoProdMc2016 -s NANO --mc --eventcontent NANOAODSIM --datatier NANOAODSIM  --no_exec  --conditions 106X_mcRun2_asymptotic_v15 --era Run2_2016,run2_nanoAOD_106Xv1  --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"

*2016 Run2016*-UL2016_MiniAODv1_NanoAODv2-v1 Data:* myNanoProdData2016 -s NANO --data --eventcontent NANOAOD --datatier NANOAOD  --no_exec  --conditions 106X_dataRun2_v32 --era Run2_2016,run2_nanoAOD_106Xv1 --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"

2017 RunIISummer19UL17NanoAODv2 MC: myNanoProdMc2017 -s NANO --mc --eventcontent NANOAODSIM --datatier NANOAODSIM  --no_exec  --conditions 106X_mcRun2_asymptotic_v15 --era Run2_2017,run2_nanoAOD_106Xv1  --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"

2017 Run2017*-UL2017_MiniAODv1_NanoAODv2-v1 Data: myNanoProdData2017 -s NANO --data --eventcontent NANOAOD --datatier NANOAOD  --no_exec  --conditions 106X_dataRun2_v32 --era Run2_2017,run2_nanoAOD_106Xv1 --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"

2018 RunIISummer19UL18NanoAODv2 MC: myNanoProdMc2018 -s NANO --mc --eventcontent NANOAODSIM --datatier NANOAODSIM  --no_exec  --conditions 106X_mcRun2_asymptotic_v15 --era Run2_2018,run2_nanoAOD_106Xv1  --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"

2018 Run2018*-UL2018_MiniAODv1_NanoAODv2-v1 Data: myNanoProdData2018 -s NANO --data --eventcontent NANOAOD --datatier NANOAOD  --no_exec  --conditions 106X_dataRun2_v32 --era Run2_2018,run2_nanoAOD_106Xv1 --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"

How to make NanoAOD via crab

While central production will take care soon of making nanoAOD for all CMS samples there are two use cases for NanoAOD made with crab:

  • test NanoAOD format before production is ready to handle them (expected late 2017)
  • add analysis specific information in the format for a few samples (e.g. signal samples), i.e. run your customized version of NanoAOD

Example config is available here: PhysicsTools /NanoAOD/test/

It is important to modify the input configuration so that it runs a single NanoAODOutputModule and add the following parameter as configuraion of the outputmodule.

    fakeNameForCrab =cms.untracked.bool(True),

How to contribute and request changes

The procedure to contribute to NanoAOD has changed wrt the past. Now, proposing a change in nanoAOD content is now done directly on CMSSW master [and backports if needed]. This approach has many advantages: faster turn-around, detailed validation from analyzer & relevant POG/PAG, easier to backport, wider review

  • First create an issue under nanoaod issues where you describe the proposed change.
    • If a similar issue exists already, comment in the existing issue, clearly telling what you want to add/change and what is the use case.
    • Also, if you want to help in the nanoAOD development but do not know what you can do, have a look at the issues for NanoAOD issues and NanoAOD-Tools issues and tell us there that you are going to implement some of the missing features or fix some of the open issues.

  • Then prepare a PR in the CMSSW-master following the instructions in the following subsection.

Step-by-step instructions for contributing to NanoAOD

  • Get the latest CMSSW IB
  • Checkout PhysicsTools/NanoAOD
  • if your code adds some variable, run the script on a file having the new variable to update the DQM configuration
    • -d -u nano_file_mc.root
    • if necessary, edit the file (e.g. to fix the range or binning of the plot; do not reoder the lines), and then re-run the script again so that the file is formatted properly (e.g. spacing, decimals, etc.)
    • The DQM histograms are located here
  • Test the code and report the increase per size and the increase in the execution time
    • This has to be included in the PR!
    • test size/evt:
python PhysicsTools/NanoAOD/test/ nano_mc2017.root -j test.json -s test_size_report.html -d tes_doc.html
    • test timing by adding the following line:
--customise_commands "process.options.wantSummary = cms.untracked.bool(True)"
in the cmsDriver command and compare the change in timing before and after the change.

NB: The last two steps will be automated very soon.

Important: Please respect the era_modifiers:

Campaign Era modifier
EOY 2016 run2_nanoAOD_94X2016
EOY 2017 run2_nanoAOD_94XMiniAODv1
-//- run2_nanoAOD_94XMiniAODv2
EOY 2018 run2_nanoAOD_102Xv1
UL (nanoAOD-v8) run2_nanoAOD_106Xv1
UL (nanoAOD-v9) run2_nanoAOD_106Xv2
Developments (master) run2_miniAOD_devel

-- LoukasGouskos - 2020-12-29

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2020-12-30 - LoukasGouskos
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 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