PAT ¡Tutorial, ¡June ¡2010 ¡
Lecture 2.1: Manipulating the PAT event content and workflow - - PowerPoint PPT Presentation
Lecture 2.1: Manipulating the PAT event content and workflow - - PowerPoint PPT Presentation
Lecture 2.1: Manipulating the PAT event content and workflow Andreas Hinzmann Annapaola de Cosa PAT Tutorial, June 2010 How to configure the workflow of PAT PAT provides many tools to facilitate user specified
PAT ¡Tutorial, ¡June ¡2010 ¡
How to configure the workflow of PAT
2 ¡
PAT provides many tools to facilitate user specified modifications of the Workflow and EventContent These tools have been conceived to be common to different kind of analysis and, at the same time, to be customized according to the specific analysis requirement. They are well documented in SWGuidePATTools. You can simply add them at the end of your PAT configuration file (you will see how to use them in the exercise section)
We can divide PAT tools in categories according to their action on workflow :
- Configure the input (restrictInputToAOD, switchToPFMET)
- Configure the workflow (removeMCMatching, addMuonUserIsolation,
addJetCollection, switchJetCollection)
- Configure the output (removeAllPATObjectsBut, removeSpecificPATObjects,
addTcMET, addPfMET )
In the next slides we will see in more details some of these tools. Please, refer to the SWGuidePATTools for the complete list of all available tools !
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Input
3 ¡
Switch to AOD-only input
restrictInputToAOD(process, names) Description: Tool to remove the pre-object production steps (as described on WorkBookPATWorkflow), which rely only on the RECO (and not the AOD) event content and the corresponding information to be contracted into the pat::Candidates. Use this tool to produce pat::Candidates from AOD input only. You can apply the tool to a single collection (specifying its name), a vector of collections
- r all collections (when specifying ['All']). Capital letters must be obeyed.
Arguments: process names
supported names: * Photons * Electrons * Muons * Taus * Jets * METs * All
coreTools.py ¡
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Workflow
4 ¡
Manage MC matching infos
removeMCMatching(process, names) Description: Tool to remove the MC matching from the pat::Candidates. Use this tool to produce pat::Candidates from data or from events without generator level
- information. You can apply the tool to a single collection (specifying its name), a
vector of collections or all collections (when specifying ['All']). Capital letters must be obeyed. Arguments: process names
supported names: * Photons * Electrons * Muons * Taus * Jets * METs * All
coreTools.py ¡
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Workflow
5 ¡
UserIsolation
addMuonUserIsolation(process, isolationTypes) Description: Tool to add predefined types of userIsolation to the pat::Muon
- candidate. Have a look to WorkBookPATDataFormats#pat_Lepton to find out how
to read out this user-defined isolation from the pat::Muon. Arguments: process isolationTypes
Supported isolationTypes: * Tracker * Ecal * Hcal * All
Analogous tools are available to add userIsolation to pat::Electrons and pat::Photons Look at SWGuidePATTools Twiki page ¡ muonTools.py ¡
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Workflow
6 ¡
Add Jet Collections to the Event Content
addJetCollection(process, jetCollection, algoLabel, typeLabel, doJTA, doBTagging, jetCorrLabel, doType1MET, doL1Cleaning, doL1Counters, genJetCollection, doJetId, jetIdLabel) Description: Tool to add any other jet collection which is available in the RECO (AOD) event content. Note NOT to use this tool after having the switchJetCollection tool already applied, as this will lead to undefined states for the added jet collection. If you intend to add a jet collection and to switch the default jet collection in the same cfg file make sure to use the addJetCollection tool before using the switchJetCollection tool. See next slide to visualize infos on the arguments jetTools.py ¡
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Workflow
7 ¡
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Workflow
8 ¡
Switch default Jet Collection
switchJetCollection(process, jetCollection, doJTA, doBTagging, jetCorrLabel, doType1MET, genJetCollection, doJetId, jetIdLabel) Description: Tool to switch the default jet collection to any other jet collection which is available in the RECO (AOD) event content. Note NOT to use the addJetCollection tool after having used this tool, as this will lead to undefined states for the added jet collection tool. If you intend to add a jet collection and to switch the default jet collection in the same cfg file make sure to use the addJetCollection tool before using the switchJetCollection tool. See next slide to visualize infos on the arguments jetTools.py ¡
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Workflow
9 ¡
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Workflow
10 ¡
Jet Collections
switchJetCollection, always should be called AFTER addJetCollection. Both to assign jet corrections (argument jetCorrLabel) as well as for the postfix label (arguments algoLabel and typeLabel) of the added jet collection we follow the conventions used for the jet energy corrections as described on the WorkBookJetAnalysis#JetCorApplication. They are listed below :
PAT ¡Tutorial, ¡June ¡2010 ¡
Configure Output
11 ¡
OutputModule EventContent
Event content management via the edm::OutputModule:
Drop all collections from the Event Content and add vecʼs to the outputCommands to keep what we are interesting in
PAT ¡Tutorial, ¡June ¡2010 ¡
12 ¡
Modify the EventContent – remove collections
Configure Output
Configure the input ¡
removeAllPATObjectsBut(process, names, outputInProcess) Description: Tool to remove all production steps of all pat::Candidate collections but the given ones from the patDefaultSequence. You can apply this tool to a single collection (specifying its name) or a vector of collections. Capital letters must be
- beyed.
Note: this automatically disables the PAT cleaning, since the cleaning relies on looking for overlaps amongst different collections. It thus needs human reconfiguration in cases where one or more collections have been removed. It will hence remove the "cleaned" collections in favour of the "selected" collections
Arguments: process names
- utputInProcess
coreTools.py ¡
supported names: * Photons * Electrons * Muons * Taus * Jets * METs * All
PAT ¡Tutorial, ¡June ¡2010 ¡
13 ¡
Modify the EventContent – remove collections
Configure Output
Configure the input ¡
removeSpecificPATObjects(process, names, outputInProcess) Description: Tool to remove all production steps of specific pat::Candidate collections from the patDefaultSequence. You can apply the tool to a single collection (specifying its name) or a vector of collections. Capital letters must be
- beyed.
Note: this automatically disables the PAT cleaning, since the cleaning relies on looking for overlaps amongst different collections. It thus needs human reconfiguration in cases where one or more collections have been removed. It will hence remove the "cleaned" collections in favour of the "selected" collections
Arguments: process names
- utputInProcess
coreTools.py ¡
supported names: * Photons * Electrons * Muons * Taus * Jets * METs * All
PAT ¡Tutorial, ¡June ¡2010 ¡
14 ¡
Browsing configuration How to learn more about PAT Workflow and EventContent
The PAT workflow is defined in python configuration files. We can learn how it is structured inspecting it by looking at which are the modules involved and in which way they are related to each other, at which values parameters are set and so on. Some tools have been implemented to investigate workflow configuration and the pat::Tuple produced:
- edmConfigEditor
- edmDumpEventContent
NOTE: You will learn more about the usage of these tools in the 5th exercise section:
SWGuidePATConfigExercise https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATConfigExercise
PAT ¡Tutorial, ¡June ¡2010 ¡
15 ¡
Editing configuration How to configure PAT Workflow and EventContent
PAT provides a set of tools common to different kinds of analysis. They facilitate to perform the configuration. The production of an user-defined PAT analysis consists of three steps:
- 1. Start from the standard configuration file.
- 2. Apply the PAT tools to change the configuration of the standard configuring file
according to the specific needs of your analysis.
- 3. Replace parameter values according to the needs of your analysis.
To browse and edit configuration file you can use a graphical tool: the edmConfigEditor
PAT ¡Tutorial, ¡June ¡2010 ¡
16 ¡
To get more informations about the ConfigEditor refer to:
the SWGuidePATConfigExercise page: https://twiki.cern.ch/ twiki/bin/view/CMS/SWGuidePATConfigExercise
the apposite Twiki: https://twiki.cern.ch/twiki/bin/view/CMS/ SWGuidePATConfigEditor
The edmConfigEditor
How can you run it?
cmsrel CMSSW_3_6_2 cd CMSSW_3_6_2/src edmConfigEditor
PAT ¡Tutorial, ¡June ¡2010 ¡
The edmConfigEditor
17 ¡
Which are the steps to make PAT configuration?
- 1. Import standard
configuration
- 2. Apply PAT tool
- 3. Replace
parameters
- 0. Create a New configuration file
PAT ¡Tutorial, ¡June ¡2010 ¡
Exercise n°5
18 ¡
You are ready to go to Exercise 5 section:
https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATConfigExercise
where you will learn:
- how to configure a patTuple according to your personal needs,
- how to use the edmConfigEditor to do so,
- more about the patTools.