PAT Tools

Complete: 5

Introduction

The Physics Analysis Toolkit ( PAT) provides the user with a large pool of configuration tools to tailor the object and event content as well as the workflow to a corresponding analysis. You can find these tools in the python/tools directory of the CMS.PhysicsTools/PatAlgos package. A description of the most important configuration tools is given below.

The PAT tools are organised in the following categories represented by the files located in the python/tools directory of the PatAlgos package:

  • coreTools.py: tools for the configuration of the common workflow of PAT.
  • cmsswVersionTools.py: tools for CMSSW version dependent configurations.
  • pfTools.py: tools for the configuration of particle flow for PAT.
  • trigTools.py: tools for the configuration of the pat::Trigger objects and the pat::TriggerEvent.
  • trackTools.py: tools for the configuration and production of a pat::TrackCandidate collection.
  • jetTools.py: tools for the configuration of the pat::Jet collection(s).
  • metTools.py: tools for the configuration of the pat::MET collection(s).
  • metUncertaintyTools.py: tool for varying particle energies by energy scale uncertainties and propagating differences to missing Et.
  • tauTools.py: tools for the configuration of the pat::Tau collection(s).
  • muonTools.py: tools for the configuration of the pat::Muon content.
  • electronTools.py: tools for the configuration of the pat::Electron content.
  • photonTools.py: tools for the configuration of the pat::Photon content.
ALERT! Note: unless explicitly stated otherwise each of the tools described below needs the process and the patDefaultSequence to be known beforehand. It can thus only be called after the patSequences_cff file has been loaded successfully.

Core Tools

runOnData( process, names, postfix, outputModules)

Description:

Tool to configure the PAT to run on real data. This tool removes the MC matching (s. below) and adapts the jet energy corrections. 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:

Argument Default Value Meaning
process   the process.
names ['All'] a list of collection names provided as a list of strings. Supported names are given below.
postfix "" you might want to remove the MC matching from a patDefaultSequence, which is accompanied by a postfix (this is mostly the case when using PF2PAT or PF2PAT and PAT in parallel)
outputModules ['out'] Names of all output modules specified to be adapted (default is ['out']).
An empty list [] signals "no output".

supported names:

  • Photons
  • Electrons
  • Muons
  • Taus
  • Jets
  • METs
  • All

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.coreTools import runOnData
runOnData(process)


Implementation Details:

You can find the implementation of this function at Read more coreTools.py.


removeMCMatching( process, names, postfix, outputModules)

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:

Argument Default Value Meaning
process   the process.
names ['All'] a list of collection names provided as a list of strings. Supported names are given below.
postfix "" you might want to remove the MC matching from a patDefaultSequence, which is accompanied by a postfix (this is mostly the case when using PF2PAT or PF2PAT and PAT in parallel)
outputModules ['out'] Names of all output modules specified to be adapted (default is ['out']).
An empty list [] signals "no output".

supported names:

  • Photons
  • Electrons
  • Muons
  • Taus
  • Jets
  • METs
  • All

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.coreTools import removeMCMatching
removeMCMatching(process, ['All'])


Implementation Details:

You can find the implementation of this function at Read more coreTools.py.


CMSSW Version Tools

pickRelValInputFiles( process, cmsswVersion, relVal, dataTier, condition, globalTag, maxVersions, skipFiles, numberOfFiles, debug )

Description:

Tool to pick up CMS.RelVal input files automatically and return them in a vector of strings with the paths to be used in the fileNames parameter of a PoolSource module.

ALERT! Note: Of course, one needs to wait for the according CMS.RelVal samples to be produced. They are announced in the RelVal Samples and Release Testing HN
This does not not work for patch releases, since no CMS.RelVal samples are produced for them.


Arguments:

Argument Default Value Meaning
cmsswVersion the current release (determined automatically from environment) CMSSW release to pick up the CMS.RelVal files from
formerVersion False set to True in order to use the last before the last valid CMSSW release to pick up the CMS.RelVal files from
ALERT! applies also, if cmsswVersion is set explicitly
relVal 'RelValTTbar' RelVal sample to be used
dataTier 'GEN-SIM-RECO' data tier to be used
condition 'startup' identifier of GlobalTag as defined in Configurations/PyReleaseValidation/python/autoCond.py
globalTag determined automatically as defined by condition in Configurations/PyReleaseValidation/python/autoCond.py name of corresponding directory to find the CMS.RelVal files in;
ALERT! automatic determination done for the run release, not the production release of the files;
ALERT! convention of using the "pure" global tag's name is sometimes broken
maxVersions 9 max. versioning number of CMS.RelVal to check
skipFiles 0 number of files to skip for a found CMS.RelVal sample
numberOfFiles 1 number of files to pick up, setting it to 0, returns all found ( skipFiles remains active though)
debug False set to True in order to enable enhanced messages in stdout

TIP In general, the tool's arguments should reflect the directories on CASTOR, where the RelVal files ar found in the following way:
castor/cern.ch/cms/store/relval/[cmsswVersion]/[relVal]/[dataTier]/[globalTag]-v[≤maxVersions]/*/


Example:

A very basic example used for analysing the HLT configuration of the current release:
import FWCore.ParameterSet.Config as cms

process = cms.Process( "HLTPROV" )

# Conditions condition = 'startup' process.load("Configuration.StandardSequences.FrontierConditions_CMS.GlobalTag_cff") from Configuration.PyReleaseValidation.autoCond import autoCond process.GlobalTag.globaltag = cms.string( autoCond[ condition ] )

# Source from PhysicsTools.PatAlgos.tools.cmsswVersionTools import pickRelValInputFiles process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( pickRelValInputFiles() ) ) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32( 1 ) )

# HLT analyzers process.load( "HLTrigger.HLTcore.hltEventAnalyzerAOD_cfi" ) process.hltEventAnalyzerAOD.triggerName = cms.string( '@' ) process.load( "HLTrigger.HLTcore.triggerSummaryAnalyzerAOD_cfi" )

process.p = cms.Path( process.hltEventAnalyzerAOD + process.triggerSummaryAnalyzerAOD )

Implementation Details:

You can find the implementation of this function at Read more cmsswVersionTools.py.


PF Tools

addPFCandidates( process, src, patLabel, cut)

Description:

Tool to add particle flow candidates to the event content. A patPFCandidate collection, a selectedPatPFCandidate collection, a cleanPatPFCandidate collection and a corresponding count filter will be added to the patDefaultSequence and event content.


Arguments:

Argument Default Value Meaning
process   the process.
src   source of the the particle flow candidates (as a module).
patLabel "PFParticles" postfis label of the new patCandidate collections.
cut "" cut string for the selectedPatCandididate collection.

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.pfTools import *
addPFCandidates(process, allHadronicPfCandidates)


Implementation Details:

You can find the implementation of this function at Read more pfTools.py.


switchToPFMET( process, input)

Description:

Tool to switch the input of the pat::MET collection from calo MET to particle flow MET. Type1MET and MuonMET corrections are removed from the patDefaultSequence.


Arguments:

Argument Default Value Meaning
process   the process.
input cms.InputTag("pfMET") input collection label for PATMETProducer. The default value, cms.InputTag("pfMET"), was chosen for PF2PAT. Use cms.InputTag("pfMet") to read from RECO/AOD.

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("CMS.PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.pfTools import *
switchToPFMET(process, input=cms.InputTag('pfMet'))


Implementation Details:

You can find the implementation of this function at Read more pfTools.py.


def usePF2PAT(process, runPF2PAT=True, jetAlgo='AK5', runOnMC=True, postfix="", jetCorrections=('AK5PFchs', ['L1FastJet','L2Relative','L3Absolute']), pvCollection=cms.InputTag('offlinePrimaryVertices'), typeIMetCorrections=False, outputModules=['out']):

usePF2PAT( process, runPF2PAT, jetAlgo, runOnMC, postfix, jetCorrections, pvCollection, typeIMetCorrections, outputModules)

Description:

Tool to switch the input of the all pat::Candidate collections from normal reco objects to particle flow objects. If 'runPF2PAT' is true, PF2PAT will be added in front of the patDefaultSequence.


Arguments:

Argument Default Value Meaning
process   the process.
runPF2PAT True run the PF2PAT sequence before pat::Candidate production.
jetAlgo 'IC5' input label of the jet algorithm to be used.
runOnMC True switch to run on MC or data.
postfix "" technical parameter to identify the resulting sequence and its modules.
jetCorrections ('AK5PFchs', ['L1FastJet','L2Relative','L3Absolute']) JEC set and levels to be used (s. Jet Tools switchJetCollection for details)
pvCollection cms.InputTag('offlinePrimaryVertices') primary vertex collection to be used, also for pile-up determination
typeIMetCorrections False use/produce Type-I corrected MET (s. Jet Tools switchJetCollection for details)
outputModules ['out'] Names of all output modules specified to be adapted (default is ['out']).
An empty list [] signals "no output".

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.pfTools import *
usePF2PAT(process)


Implementation Details:

You can find the implementation of this function at Read more pfTools.py.


Trigger Tools

TIP This documentation refers to the !"PAT versions V08-10-34-05 (61X) and V08-11-07 (62X) (and later). Older tags are documented in this version of this TWiki!

These tools are also explained in more detail in the PAT Trigger SWGuide.

switchOnTrigger( process, ...)

Description:

Tool to switch on PAT trigger information and to add the needed modules to the CMSSW job.


Arguments:

Argument Default Value Meaning
process mandatory the current cms.Process
triggerProducer 'patTrigger' label of the PATTriggerProducer module
triggerEventProducer 'patTriggerEvent' label of the PATTriggerEventProducer module
path '' name of the cms.Path to append the modules to
ALERT! should only be used, if really needed
hltProcess 'HLT' name of the cms.Process, where the HLT was run
wild-card '*' will automaticall pick the most recent one.
outputModule 'out' label of the PoolOutputModule, '' (emty string) indicates no output


Example:

To use the tool add the following lines to your cfg file:
# load the PAT trigger Python tools from PhysicsTools.PatAlgos.tools.trigTools import * # switch on the trigger information switchOnTrigger( process )

Implementation Details:

You can find the implementation of these functions at trigTools.py. ---

switchOnTriggerStandAlone( process, ...)

Description:

Tool to switch on PAT trigger information in stand-alone mode (without pat::TriggerEvent) and to add the needed modules to the CMSSW job.


Arguments:

Argument Default Value Meaning
process mandatory the current cms.Process
triggerProducer 'patTrigger' label of the PATTriggerProducer module
path '' name of the cms.Path to append the modules to
ALERT! should only be used, if really needed
hltProcess 'HLT' name of the cms.Process, where the HLT was run
wild-card '*' will automaticall pick the most recent one.
outputModule 'out' label of the PoolOutputModule, '' (emty string) indicates no output


Example:

To use the tool add the following lines to your cfg file:
# load the PAT trigger Python tools from PhysicsTools.PatAlgos.tools.trigTools import * # switch on the stand-alone trigger information without saving the output switchOnTriggerStandAlone( process, None, '', None, '' )

Implementation Details:

You can find the implementation of these functions at trigTools.py. ---

switchOnTriggerMatching( process, ...)

Description:

Tool to switch on PAT trigger matching information and to add the needed modules to the CMSSW job.
switchOnTrigger(...) is called automatically, if needed.


Arguments:

Argument Default Value Meaning
process mandatory the current cms.Process
triggerMatchers default list of pre-defined trigger matches in this file list of lables of PATTriggerMatcher modules
triggerProducer 'patTrigger' label of the PATTriggerProducer module
triggerEventProducer 'patTriggerEvent' label of the PATTriggerEventProducer module
path '' name of the cms.Path to append the modules to
ALERT! should only be used, if really needed
hltProcess 'HLT' name of the cms.Process, where the HLT was run
wild-card '*' will automaticall pick the most recent one.
outputModule 'out' label of the PoolOutputModule, '' (emty string) indicates no output


Example:

To use the tool add the following lines to your cfg file:
# define a trigger matcher from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcherExamples_cfi import somePatMuonTriggerMatchHLTMu17 process.myMatcher = somePatMuonTriggerMatchHLTMu17.clone() # load the PAT trigger Python tools from PhysicsTools.PatAlgos.tools.trigTools import * # switch on the trigger matching switchOnTriggerMatching( process, [ myMatcher ] )

Implementation Details:

You can find the implementation of these functions at trigTools.py. ---

switchOnTriggerMatchingStandAlone( process, ...)

Description:

Tool to switch on PAT trigger matching information in stand-alone mode (with a pat::TriggerEvent) and to add the needed modules to the CMSSW job.
switchOnTriggerStandAlone(...) is called automatically, if needed.


Arguments:

Argument Default Value Meaning
process mandatory the current cms.Process
triggerMatchers default list of pre-defined trigger matches in this file list of lables of PATTriggerMatcher modules
triggerProducer 'patTrigger' label of the PATTriggerProducer module
path '' name of the cms.Path to append the modules to
ALERT! should only be used, if really needed
hltProcess 'HLT' name of the cms.Process, where the HLT was run
wild-card '*' will automaticall pick the most recent one.
outputModule 'out' label of the PoolOutputModule, '' (emty string) indicates no output


Example:

To use the tool add the following lines to your cfg file:
# define a trigger matcher from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcherExamples_cfi import somePatMuonTriggerMatchHLTMu17 process.myMatcher = somePatMuonTriggerMatchHLTMu17.clone() # load the PAT trigger Python tools from PhysicsTools.PatAlgos.tools.trigTools import * # switch on the stand-alone trigger matching without saving the output switchOnTriggerMatching( process, [ myMatcher ], None, None, '' )

Implementation Details:

You can find the implementation of these functions at trigTools.py. ---

switchOnTriggerMatchEmbedding( process, ...)

Description:

Tool to switch on PAT trigger match embedding and to add the needed modules to the CMSSW job.
switchOnTriggerMatchingStandAlone(...) is called automatically, if needed.

ALERT! Note: This tool currently works only, if the producer for the input PAT objects is run in the same CMSSW job.
TIP Former naming restrictions for these producers are resolved.


Arguments:

Argument Default Value Meaning
process mandatory the current cms.Process
triggerMatchers default list of pre-defined trigger matches in this file list of lables of PATTriggerMatcher modules
triggerProducer 'patTrigger' label of the PATTriggerProducer module
path '' name of the cms.Path to append the modules to
ALERT! should only be used, if really needed
hltProcess 'HLT' name of the cms.Process, where the HLT was run
wild-card '*' will automaticall pick the most recent one.
outputModule 'out' label of the PoolOutputModule, '' (emty string) indicates no output


Example:

To use the tool add the following lines to your cfg file:
# define a trigger matcher from PhysicsTools.PatAlgos.triggerLayer1.triggerMatcherExamples_cfi import somePatMuonTriggerMatchHLTMu17 process.myMatcher = somePatMuonTriggerMatchHLTMu17.clone() # load the PAT trigger Python tools from PhysicsTools.PatAlgos.tools.trigTools import * # switch on the trigger match embedding switchOnTriggerMatchEmbedding( process, [ myMatcher ] )

Implementation Details:

You can find the implementation of these functions at trigTools.py. ---

Track Tools

makeTrackCandidates( process, label, tracks, particleType, preselection, selection, isolation, isoDeposits, mcAs)

Description:

Tool add a pat::TrackCandidate collection to the event content of PAT (including isolation information, isoDeposits and generatorMatch information) to the patDefaultSequence. It also includes a refernce to the original reco::Track collection. This is not one of the PAT default collections, therefore it is left to the user to add it to the event content or not.


Arguments:

Argument Default Value Meaning
process   the process.
label 'TrackCands' label to be used for the pat::TrackCandidate collection.
tracks 'generalTracks' reco intput collection for the pat::TrackCandidate collection as an edm::InputTag.
particleType 'pi+' particle hypothesis for the mass assignment of the reco::Candidate.
preselection 'pt>10' cut selection string for a pre-selection during reco::Candidate production.
selection 'pt>10' cut selection string for the production of selectedPatTrackCands.
isolation see below source(s) of isolation information and corresponding radii in consideration as a list of pairs of a string and a double.
isoDeposits see below isoDeposits to be added to the pat::TrackCandidates as a list of strings.
mcAs 'muon' pat::Candidate collection to replicate the MC match from that will be folded into the pat::TrackCandidate collection.

default values (and supported types) of isolation:

  • 'tracker':03
  • 'ecalTowers':03
  • 'hcalTowers':03
default values (and supported types) of isoDeposits:
  • 'tracker'
  • 'ecalTowers'
  • 'hcalTowers'

  • tau
  • jet
  • met
  • None

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.trackTools import *
makeTrackCandidates(process,
    label        = 'TrackCands',                  
    tracks       = 'generalTracks', 
    particleType = 'pi+',                         
    preselection = 'pt > 10',                     
    selection    = 'pt > 10',                     
    isolation    = {'tracker':0.3, 'ecalTowers':0.4, 'hcalTowers':0.4},                            
    isoDeposits  = [],                            
    mcAs         = 'muon'           
)      


Implementation Details:

You can find the implementation of these functions at trackTools.py.


Jet Tools

switchJetCollection( process, jetCollection, doJTA, doBTagging, jetCorrLabel, doType1MET, genJetCollection, doJetId, jetIdLabel, outputModules)

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.

ALERT! Note: to assign jet corrections (argument jetCorrLabel) of the switched jet collections we follow the conventions used for the jet energy corrections as described on the WorkBookJetAnalysis#JetCorApplication. For your convenience they are listed below. In order NOT to apply any jet energy scale correction just issue the corresponding 'None' for this parameter. When there is no jetCorrLabel specified the doType1MET switch will have no effect.

jet algorithm postfix label for algorithm jet type postfix label for jet type
iterativeCone5 IC5 caloJet Calo
kt4 KT4 jptJet JPT
kt6 KT6    
antikt5 AK5    


Arguments:

Argument Default Value Meaning
process   the process.
jetCollection   label of the input jet collection.
doJTA True do a jet track association and determine the jet charge.
doBTagging True contract b tag information into the pat::Jet collection or not.
jetCorrLabel None correction labels as a pair of a string and a vector of strings of the type ('AK5Calo', ['L2Relative', 'L3Absolute']).
doType1MET True use the specified jet energy scale corrections to perform METType1 corrections from them.
genJetCollection 'ak5GenJets' generator level jet collection to be used for generator matching as edm::InputTag.
doJetID True embed jetId variables to the pat::Jet collection.
jetIdLabel 'ak5' prefix of the value map of the jet id variables to be embedded to the pat::Jet.
btagInfo   list of all the tags whose info you want to keep, default is info all tags, use this only if you want specific taginfo
btagdiscriminators   list of all the btag discriminators that you want to keep, default is all discriminators, use this only if you want specific discrimintors
outputModules ['out'] Names of all output modules specified to be adapted (default is ['out']).
An empty list [] signals "no output".

ALERT! Note:
For the parameter jetCorrLabel the first argument corresponds to the payload for the given jet collection. It should be composed of the jet algorithm in capital letter acronyms and a postfix according to the constituents (e.g. AK5Calo). The second argument should be a vector of strings indicating the JEC levels the should be saved in the jet (e.g. ['L2Relative', 'L3Absolute',]). The following JEC levels may be used in the second argument:

L1FastJet
L1Offset
L2Relative
L3Absolute
L2L3Residual
L5Flavor
L7Parton

For CMSSW_7_1_0:

Argument Default Value Meaning
process   the process.
postfix None postfix from usePF2PAT.
jetSource   label of the input jet collection.
trackSource 'generalTracks' Label of the input collection for tracks to be used in b-tagging.
pvSource 'offlinePrimaryVertices' Label of the input collection for primary vertices used in b-tagging.
svSource 'inclusiveSecondaryVertices' Label of the input collection for IVF vertices used in b-tagging.
algo 'AK4' Jet algorithm of the input collection from which the new patJet collection should be created.
rParam 0.4 Jet size (distance parameter R used in jet clustering.
getJetMCFlavour True Get jet MC truth flavour.
genJetCollection 'ak4GenJets' GenJet collection to match to.
jetCorrections None Add all relevant information about jet energy corrections that you want to be added to your new patJet collection. The format is to be passed on in a python tuple: e.g. (\'AK4Calo\',[\'L2Relative\', \'L3Absolute\'], patMet).
btagdiscriminators ['None'] If you are interested in btagging in general the btag discriminators is all relevant information that you need for a high level analysis. Add here all btag discriminators, that you are interested in as a list of strings. If this list is empty no btag discriminator information will be added to your new patJet collection.
btagInfo ['None'] The btagInfos objects conatin all relevant information from which all discriminators of a certain type have been calculated. Note that this information on the one hand can be very space consuming and on the other hand is not necessary to access the btag discriminator information that has been derived from it. Only in very special cases the btagInfos might really be needed in your analysis. Add here all btagInfos, that you are interested in as a list of strings. If this list is empty no btagInfos will be added to your new patJet collection.
jetTrackAssociation False Add JetTrackAssociation and JetCharge from reconstructed tracks to your new patJet collection. This switch is only of relevance if you don\'t add any btag information to your new patJet collection (btagDiscriminators or btagInfos) and still want this information added to your new patJetCollection. If btag information is added to the new patJet collection this information will be added automatically.
outputModules ['out'] Output module labels. Add a list of all output modules to which you would like the new jet collection to be added, in case you use more than one output module.

ALERT! Note:
For the parameter jetCorections the first argument corresponds to the payload in the CMS Conditions database for the given jet collection; the second argument corresponds to the jet energy correction level that you want to be embedded into your new patJet collection. This should be given as a list of strings. Available values are L1Offset, L1FastJet, L1JPTOffset, L2Relative, L3Absolute, L5Falvour, L7Parton; the third argument indicates whether MET(Type1) corrections should be applied corresponding to the new patJetCollection. If so a new patMet collection will be added to your PAT Tuple in addition to the raw patMet with the MET(Type1) corrections applied. The argument corresponds to the patMet collection to which the MET(Type1) corrections should be applied. If you are not interested in MET(Type1) corrections to this new patJet collection pass None as third argument of the python tuple.


Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.jetTools import *
switchJetCollection(process, 
                    cms.InputTag('ak5PFJets'),   
                    doJTA            = True,            
                    doBTagging       = True,            
                    jetCorrLabel     = ('AK5PF', ['L2Relative', 'L3Absolute']),  
                    doType1MET       = False,            
                    genJetCollection = cms.InputTag("ak5GenJets"),
                    doJetID      = False,
                    jetIdLabel   = "ak5"
                    btagInfo = ['impactParameterTagInfos','secondaryVertexTagInfos']
                    btagdiscriminators=['simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags']
                    ) 


Implementation Details:

You can find the implementation of this function at Read more jetTools.py.


addJetCollection( process, jetCollection, algoLabel, typeLabel, doJTA, doBTagging, jetCorrLabel, doType1MET, doL1Cleaning, doL1Counters, genJetCollection, doJetId, jetIdLabel, standardAlgo, standardType, outputModules)

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.

ALERT! Note: 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. For your convenience they are listed below. For your convenience they are listed below. In order NOT to apply any jet energy scale correction just issue the corresponding 'None' for this parameter. When there is no jetCorrLabel specified the doType1MET switch will have no effect.

jet algorithm postfix label for algorithm jet type postfix label for jet type
iterativeCone5 IC5 caloJet Calo
sisCone5 SC5 particleFlowJet PF
kt4 KT4 jptJet JPT
kt6 KT6    
antikt5 AK5    


Arguments:

Argument Default Value Meaning
process   the process.
jetCollection   label of the input jet collection.
algoLabel   algorithm label for new jet collection (see above for allowed values).
typeLabel   object type label for new jet collection (see above for aloowed values).
doJTA True do a jet track association and determine the jet charge.
doBTagging True contract b tag information into the pat::Jet collection or not.
jetCorrLabel None correction labels as a pair of a string and a vector of strings of the type ('AK5Calo', ['L2Relative', 'L3Absolute']).
doType1MET True use the specified jet energy scale corrections to perform METType1 corrections from them.
doL1Cleaning True produce a cleanPatJetCollection for the new jet collection.
doL1Counters False add pat object counters on the new jet collection to the patDefaultSequence.
genJetCollection 'ak5GenJets' generator level jet collection to be used for generator matching as edm::InputTag.
doJetID True embed jetId variables to the pat::Jet collection.
jetIdLabel 'ak5' prefix of the value map of the jet id variables to be embedded to the pat::Jet.
btagInfo   list of all the tags whose info you want to keep, default is info all tags, use this only if you want specific taginfo
btagdiscriminators   list of all the btag discriminators that you want to keep, default is all discriminators, use this only if you want specific discrimintors
standardAlgo 'AK5' standard algorithm label of the collection from which the clones for the new jet collection will be taken from (note that this jet collection has to be available in the event before hand)
standardType 'Calo' standard constituent type label of the collection from which the clones for the new jet collection will be taken from (note that this jet collection has to be available in the event before hand)
outputModules ['out'] Names of all output modules specified to be adapted (default is ['out']).
An empty list [] signals "no output".

ALERT! Note:
For the parameter jetCorrLabel the first argument corresponds to the payload for the given jet collection. It should be composed of the jet algorithm in capital letter acronyms and a postfix according to the constituents (e.g. AK5Calo). The second argument should be a vector of strings indicating the JEC levels the should be saved in the jet (e.g. ['L2Relative', 'L3Absolute',]). The following JEC levels may be used in the second argument:

L1Offset
L2Relative
L3Absolute
L5Flavor
L7Parton

For CMSSW_7_1_0:

Argument Default Value Meaning
process   the process.
labelName 'UNDEFINED' Label name of the new patJet collection.
postfix None postfix from usePF2PAT.
jetSource   Label of the input collection from which the new patJet collection should be created
trackSource 'generalTracks' Label of the input collection for tracks to be used in b-tagging.
pvSource 'offlinePrimaryVertices' Label of the input collection for primary vertices used in b-tagging.
svSource 'inclusiveSecondaryVertices' Label of the input collection for IVF vertices used in b-tagging.
algo 'AK4' Jet algorithm of the input collection from which the new patJet collection should be created.
rParam 0.4 Jet size (distance parameter R used in jet clustering.
getJetMCFlavour True Get jet MC truth flavour.
genJetCollection 'ak4GenJets' GenJet collection to match to.
jetCorrections None Add all relevant information about jet energy corrections that you want to be added to your new patJet collection. The format is to be passed on in a python tuple: e.g. (\'AK4Calo\',[\'L2Relative\', \'L3Absolute\'], patMet).
btagdiscriminators ['None'] If you are interested in btagging in general the btag discriminators is all relevant information that you need for a high level analysis. Add here all btag discriminators, that you are interested in as a list of strings. If this list is empty no btag discriminator information will be added to your new patJet collection.
btagInfo ['None'] The btagInfos objects conatin all relevant information from which all discriminators of a certain type have been calculated. Note that this information on the one hand can be very space consuming and on the other hand is not necessary to access the btag discriminator information that has been derived from it. Only in very special cases the btagInfos might really be needed in your analysis. Add here all btagInfos, that you are interested in as a list of strings. If this list is empty no btagInfos will be added to your new patJet collection.
jetTrackAssociation False Add JetTrackAssociation and JetCharge from reconstructed tracks to your new patJet collection. This switch is only of relevance if you don\'t add any btag information to your new patJet collection (btagDiscriminators or btagInfos) and still want this information added to your new patJetCollection. If btag information of any form is added to the new patJet collection this information will be added automatically.
outputModules ['out'] Add a list of all output modules to which you would like the new jet collection to be added. Usually this is just one single output module with name \'out\', which corresponds also the default configuration of the tool. There is cases though where you might want to add this collection to more than one output module.

ALERT! Note:
For the parameter jetCorections the first argument corresponds to the payload in the CMS Conditions database for the given jet collection; the second argument corresponds to the jet energy correction levels that you want to be embedded into your new patJet collection. This should be given as a list of strings. Available values are L1Offset, L1FastJet, L1JPTOffset, L2Relative, L3Absolute, L5Falvour, L7Parton; the third argument indicates whether MET(Type1/2) corrections should be applied corresponding to the new patJetCollection. If so a new patMet collection will be added to your PAT Tuple in addition to the raw patMet. This new patMet collection will have the MET(Type1/2) corrections applied. The argument can have the following types: \'type-1\' for type-1 corrected MET; \'type-2\' for type-1 plus type-2 corrected MET; \'\' or \'none\' if no further MET corrections should be applied to your MET. The arguments \'type-1\' and \'type-2\' are not case sensitive.


Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.jetTools import *
addJetCollection(process,cms.InputTag('sisCone5CMS.CaloJets'),
                 'SC5', 'Calo',
                 doJTA        = True,
                 doBTagging   = True,
                 jetCorrLabel = ('SC5Calo', ['L2Relative', 'L3Absolute']),
                 doType1MET   = True,
                 doL1Cleaning = True,                 
                 doL1Counters = False,
                 genJetCollection=cms.InputTag("sisCone5GenJets"),
                 doJetID      = True,
                 jetIdLabel   = "ak5"
                 btagInfo = ['impactParameterTagInfos','secondaryVertexTagInfos']
                 btagdiscriminators=['simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags']
                 )


Implementation Details:

You can find the implementation of this function at Read more jetTools.py.


switchJetCorrLevels( process, jetCorrLabel, postfix)

Description:

Tool to switch the jet energy correction levels of a given jet collection. The tool detects whether L1Offset of L1FastJet corrections are to be applied and adapts the event content accordingly. This tool is also called within the tools switchJetCollection and addJetCollection as descripbed above.

ALERT! Note: as the tool is already called in switchJetCollection_ and addJetCollection there is no need to apply the tool to jet collections created by these tools. You only need to run it yourself if you only want to change the JEC levels for the default jet correction not using the switchJetCollection tool.

ALERT! Note: to assign jet corrections (argument jetCorrLabel) we follow the conventions used for the jet energy corrections as described on the WorkBookJetAnalysis#JetCorApplication. For your convenience they are listed below. In order NOT to apply any jet energy scale correction just issue the corresponding 'None' for this parameter.

jet algorithm postfix label for algorithm jet type postfix label for jet type
iterativeCone5 IC5 caloJet Calo
kt4 KT4 jptJet JPT
kt6 KT6    
antikt5 AK5    


Arguments:

Argument Default Value Meaning
process   the process.
jetCorrLabel None correction labels as a pair of a string and a vector of strings of the type ('AK5Calo', ['L2Relative', 'L3Absolute']).
postfix '' technical parameter when running the jetCorrFactors module several times.

ALERT! Note:
For the parameter jetCorrLabel the first argument corresponds to the payload for the given jet collection. It should be composed of the jet algorithm in capital letter acronyms and a postfix according to the constituents (e.g. AK5Calo). The second argument should be a vector of strings indicating the JEC levels the should be saved in the jet (e.g. ['L2Relative', 'L3Absolute',]). The following JEC levels may be used in the second argument:

L1FastJet
L1Offset
L2Relative
L3Absolute
L2L3Residual
L5Flavor
L7Parton


Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.jetTools import *
switchJetCorrLabel(process, 
                    jetCorrLabel     = ('AK5PF', ['L2Relative', 'L3Absolute']),  
                    ) 


Implementation Details:

You can find the implementation of this function at Read more jetTools.py.


MET Tools

addTcMET( process, postfixLabel)

Description:

Tool to add track-corrected MET (tcMET) to the PAT event content and the patDefaultSequence.


Arguments:

Argument Default Value Meaning
process   the process.
postfixLabel 'TC' label for the added MET collection as a string.

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.metTools import *
addTcMET(process, 'TC')


Implementation Details:

You can find the implementation of these functions at metTools.py.


addPfMET( process, postfixLabel)

Description:

Tool to add particle flow MET to the PAT event content and the patDefaultSequence.


Arguments:

Argument Default Value Meaning
process   the process.
postfixLabel 'PF' label for the added MET collection as a string.

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.metTools import *
addPfMET(process, 'PF')


Implementation Details:

You can find the implementation of these functions at metTools.py.


MET Systematics Tools

runMETCorrectionsAndUncertainties(process, metType, correctionLevel, computeUncertainties, produceIntermediateCorrections, addToPatDefaultSequence, jetCollection, electronCollection, muonCollection, tauCollection, reclusterJets, pfCandCollection, autoJetCleaning, onMiniAOD, runOnData, postfix)

Description:

New version of the tool! can be retrieved from the cms-met private recipe for 74X, included per default for the most recent releases (75X+). Some of the options are currently under PR review for 75X+.


Arguments:

Argument Default Value Meaning
metType "PF" Type of considered MET (only "PF" supported so far, MVA will come soon)
correctionLevel [""] level of correction : available corrections for pfMet are T0, T1, T2, Txy and Smear; irrelevant entry for MVAMet; allowedValues=["T0","T1","T2","Txy","Smear",""]). Keep that order to call the different corrections
computeUncertainties True "enable/disable the uncertainty computation for the main MET output
produceIntermediateCorrections False enable/disable the production of all correction schemes (only for the most common): eg. asking for the T1 and Txy correction gives only T1Txy if the flag is set to false. If set to true, T1 and Txy MET will be created as well. No uncertainties will be computed for the itnermediate METs
electronCollection cms.InputTag('selectedPatElectrons') Input electron collection
photonCollection None Input photon collection
muonCollection cms.InputTag('selectedPatMuons') Input muon collection
tauCollection cms.InputTag('selectedPatTaus') Input tau collection
jetCollection cms.InputTag('selectedPatJets') Input jet collection (used for uncertainty computation)
jetCollectionUnskimmed cms.InputTag('patJets') Input unskimmed jet collection (used for T1 correction computation)
jecUncertaintyFile 'PhysicsTools/PatUtils/data/Summer13_V1_DATA_UncertaintySources_AK5PF.txt' "Extra JES uncertainty file"
pfCandCollection cms.InputTag('particleFlow') "pf Candidate collection"
autoJetCleaning LepClean Enable the jet cleaning for the uncertainty computation: Full for tau/photons/jet cleaning, Partial for jet cleaning, LepClean for jet cleaning with muon and electrons only, None or Manual for no cleaning
addToPatDefaultSequence True Flag to enable/disable that metUncertaintySequence is inserted into patDefaultSequence
onMiniAOD False Switch on miniAOD configuration; to be used when reprocessing miniAODs
runOnData False Switch to data configuration for miniAOD reprocessing. Do not affect the automatic switch of JECs between data and MC in 75X. Do not affect miniAOD production from AOD
postfix '' Technical parameter to identify the resulting sequence and its modules (allows multiple calls in a job)

Expert only use parameters :

Argument Default Value Meaning
jetFlavor AK4PFchs Use AK4PF/AK4PFchs for PFJets
manualJetConfig False Enable the default jet configuration
jetCorrPayload "AK4PF" Use AK4PF/AK4PFCHS for PFJets/PFCHSJets; correction payload used to derive the T1 correction
jetCorLabelUpToL3 cms.InputTag('ak4PFCHSL1FastL2L3Corrector') Use ak4PFL1FastL2L3Corrector (ak4PFCHSL1FastL2L3Corrector) for PFJets with (without) charged hadron subtraction
jetCorLabelL3Res cms.InputTag('ak4PFCHSL1FastL2L3ResidualCorrector') Use ak4PFL1FastL2L3ResidualCorrector (ak4PFCHSL1FastL2L3ResiduaCorrectorl) for PFJets with (without) charged hadron subtraction
jecUncertaintyTag 'SubTotalMC' "Extra JES uncertainty tag"
reclusterJets False "Flag to enable/disable the jet reclustering"

ALERT! Shortcuts. Two functions are defined to simplify the miniAOD processing and reprocessing:

  • runMetCorAndUncForMiniAODProduction(process, metType, jetCollUnksimmed, jetColl, photonColl, electronColl, muonColl, tauColl, pfCandColl, jetCleaning, jecUncertaintyFile)
  • runMetCorAndUncFromMiniAOD(process, metType, jetCollUnksimmed, jetColl, photonColl, electronColl, muonColl, tauColl, pfCandColl, jetCleaning, isData, jecUncertaintyFile)

ALERT! Output : The tool will create a new slimmedMET collection containing the new Type1 and pf MET. The full name of the slimmedMET will depend of the cmssw process name used by the physicist.

ALERT! Note:
The photonCollection parameter is set to None per default, in order to avoid overlap with the electron collection. In case you want to use pat::Photon objects as input, you need to take care that the pat::Electron collection passed as input to the runMEtSystematics function has been cleaned from pat::Photon objects.

ALERT! Caveats

  • Corrections schemes are predefined in the code :
    • e.g Type01Smear says explicitely that T1 T0 and Smearing corrections are called
    • Not all possible correction schemes are defined.
    • People can still reproduce independent corrections schemes by their own with the tool
  • Reprocessing MET using miniAODs as inputs :
    • if the shortcut function is not used, the met uncertainty tool has to be called several times with the different configurations appearing in that same function.
    • a met tool call on top of miniAOD recreates an additional slimmed MET collection.
    • due to the limited amount of informations accessible in miniAODs, not everything can be reprocessed. The raw MET, T1 corrections, Txy corrections as well as all uncertainties can be recomputed on top of miniAODs. Smearing could be, but as for the standard access, is not yet supported for 13 TeV data. The T0 correction cannot be recomputed from miniAOD and is then copied from the input miniAOD. Note that when running on 74X miniAODs, this correction is not
available and then not copied.
    • when using a reprocessed pat::MET, the access of any MET not recomputed (except T0 if running on 75X) will return the T1 MET. This is especially true for the caloMET and smeared METs. This is a known feature that will be corrected in the future. In the meantime, users have to be careful with that.
    • jets are automatically reclustered when running with the miniAOD option.
    • due to the change of format between 74X and 75X, a small inconsistency exists in the uncertainty
names when reading a 74X miniAOD : JER and JES uncertainties are switched
    • in 74X, the genMET will not be copied in the output slimmedMET collection

runMEtUncertainties( process, electronCollection, photonCollection, muonCollection, tauCollection, jetCollection, jetCorrLabel, dRjetCleaning, doSmearJets, jetSmearFileName, jetSmearHistogram, pfCandCollection, jetCorrPayloadName, varyByNsigmas)

Description:

Valid from 53X to 74X default release!
Tool to produce collections of electrons, photons, muons, tau-jets and jets shifted up and down by their respective energy uncertainties. Energy scale uncertainties are assummed to be uncorrelated for particles of different types. The uncertainties are propagated to the missing Et. "Unclustered energy" (jets of Pt < 10 GeV plus PFCandidates not within jets) are varied by +/- 10% and the uncertainty is propagated to the missing Et too.


Arguments:

Argument Default Value Meaning
process   the process.
electronCollection 'cleanPatElectrons' label of the input electron collection.
photonCollection None label of the input photon collection.
muonCollection 'cleanPatMuons' label of the input muon collectio.
tauCollection 'cleanPatTaus' label of the input tau collection.
jetCollection 'cleanPatJets' label of the input jet collection.
dRjetCleaning 0.5 minimum eta-phi separation used to clean jets from leptons.
doApplyType0corr True (as of PhysicsTools/PatUtils V03-09-23). will be False in the future apply/don't apply Type-0 MET corrections
doSmearJets True apply/don't apply jet energy smearing to MC, in order to match jet energy resolution to Data .
jetSmearFileName 'PhysicsTools/PatUtils/data/pfJetResolutionMCtoDataCorrLUT.root' name of ROOT file containing jet smearing factors.
jetSmearHistogram 'pfJetResolutionMCtoDataCorrLUT' name of histogram containing jet smearing factors.
pfCandCollection 'particleFlow' label of the input PFCandidate collection.
varyByNsigmas 1.0 number of standard deviations by which energy scales are varied.
outputModule 'out' label of the PoolOutputModule, '' (emty string) indicates no output

ALERT! Note:
The photonCollection parameter is set to None per default, in order to avoid overlap with the electron collection. In case you want to use pat::Photon objects as input, you need to take care that the pat::Electron collection passed as input to the runMEtSystematics function has been cleaned from pat::Photon objects.

ALERT! Note:
The energies of pat::Jets are smeared by the Data/MC difference in PFJet resolution per default. The smearing factors are taken from JME-10-014 (error weighted average of di-jet assymmetry and photon+jet numbers) and stored in a 2-dimensional histogram with abs(eta) on the x-axis and jet Pt on the y-axis. The jet resolution is varied within uncertainties.

ALERT! Note:
Two pat::MET collections will be produced: patType1CorrectedPFMet has only Type 1 MET corrections applied, patType1p2CorrectedPFMet has Type 1 + 2 corrections applied. Configuration parameters neccessary to produce pat::MET objects are taken from patPFMETCorrections_cff.py

ALERT! Note:
If you are using CMSSW_5_3_11 or later, you might need to add the following two sequences before process.patDefaultSequence in your path.

process.type0PFMEtCorrection process.patPFMETtype0Corr 


Output collections:

Shift Electron Photon Muon Tau Jet MET (Type 1) MET (Type 1+2)
electron energy + shiftedPatElectronsEnUp - - - - patType1CorrectedPFMetElectronEnUp patType1p2CorrectedPFMetElectronEnUp
electron energy - shiftedPatElectronsEnDown - - - - patType1CorrectedPFMetElectronEnDown patType1p2CorrectedPFMetElectronEnDown
muon momentum + - - shiftedPatMuonsEnUp - - patType1CorrectedPFMetMuonEnUp patType1p2CorrectedPFMetMuonEnUp
muon momentum - - - shiftedPatMuonsEnDown - - patType1CorrectedPFMetMuonEnDown patType1p2CorrectedPFMetMuonEnDown
tau energy + - - - shiftedPatTausEnUp - patType1CorrectedPFMetTauEnUp patType1p2CorrectedPFMetTauEnUp
tau energy - - - - shiftedPatTausEnDown - patType1CorrectedPFMetTauEnDown patType1p2CorrectedPFMetTauEnDown
jet resolution + - - - - smearedPatJetsResUp patType1CorrectedPFMetJetResUp patType1p2CorrectedPFMetJetResUp
jet resolution - - - - - smearedPatJetsResDown patType1CorrectedPFMetJetResDown patType1p2CorrectedPFMetJetResDown
jet energy + - - - - shiftedPatJetsEnUpForCorrMEt patType1CorrectedPFMetJetEnUp patType1p2CorrectedPFMetJetEnUp
jet energy - - - - - shiftedPatJetsEnDownForCorrMEt patType1CorrectedPFMetJetEnDown patType1p2CorrectedPFMetJetEnDown
"unclustered energy" + - - - - - patType1CorrectedPFMetUnclusteredEnUp patType1p2CorrectedPFMetUnclusteredEnUp
"unclustered energy" - - - - - - patType1CorrectedPFMetUnclusteredEnDown patType1p2CorrectedPFMetUnclusteredEnDown


Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# switch pat::Jets to use ak5PFJets as input
from PhysicsTools.PatAlgos.tools.jetTools import *
switchJetCollection(
    process,
    cms.InputTag('ak5PFJets'),
    doJTA = True,
    doBTagging = False,
    jetCorrLabel = ( 'AK5PF', cms.vstring([ 'L1FastJet', 'L2Relative', 'L3Absolute' ]) ),
    doType1MET = False,
    doJetID = True,
    jetIdLabel = "ak5",
    outputModule = ''
)

# apply type I/type I + II PFMEt corrections to pat::MET object 
# and estimate systematic uncertainties on MET
from PhysicsTools.PatUtils.tools.metUncertaintyTools import runMEtUncertainties
runMEtUncertainties(process)


Implementation Details:

You can find the implementation of these functions at metUncertaintyTools.py.


Tau Tools

switchToCaloTau( process, pfTauLabel, caloTauLabel)

Description:

Tool to switch from particle flow taus to calo taus as input to the production of the pat::Tau collection.


Arguments:

Argument Default Value Meaning
process   the process.
pfTauLabel 'fixedConePFTauProducer' label of the (original) particle flow tau collection as a string.
caloLabel 'caloRecoTauProducer' label of the (new) calo tau collection as a string.

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.tauTools import *
switchToCaloTau(process)


Implementation Details:

You can find the implementation of these functions at tauTools.py.


switchToPFTauFixedCone( process, pfTauLabelOld, pfTauLabelNew)

Description:

Tool to switch from the standard particle flow taus to the fixed cone particle flow taus as input to the production of the pat::Tau collection.

ALERT! Note: equivalent tools exist for switchToPFTauFixedConeHighEff and switchToPFTauShrinkingCone.


Arguments:

Argument Default Value Meaning
process   the process.
pfTauLabeloOld 'pfRecoTauProducer' label of the original particle flow tau collection as a string.
pfTauLabelNew 'fixedConePFTauProducer' label of the new particle flow tau collection as a string.

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.tauTools import *
switchToPFTauFixedCone(process)


Implementation Details:

You can find the implementation of these functions at tauTools.py.


addTauCollection( process, tauCollection, algoLabel, typeLabel, doPFIsoDeposits)

Description:

Tool to add any other collection of taus which is available in the RECO (AOD) event content. Note NOT to use this tool after having the switchTauCollection tool already applied, as this will lead to undefined states for the added tau collection. If you intend to add a tau collection and to switch the default tau collection in the same cfg file make sure to use the addTauCollection tool before using the switchTauCollection tool.


Arguments:

Argument Default Value Meaning
process   the process.
tauCollection   label of the input tau collection in the RECO (AOD) event content.
algoLabel   algorithm label for new tau collection (see below for allowed values).
typeLabel   object type label for new jet collection (either "Tau" for Calo/TCTaus or "PFTau" for PFTaus; see below).
doPFIsoDeposits True add IsoDeposits computed from particles reconstructed by particle-flow algorithm (NOTE: not implemented for Calo/TCTaus yet)

tauCollection algoLabel typeLabel
caloRecoTauProducer caloReco Tau
fixedConePFTauProducer fixedCone PFTau
shrinkingConePFTauProducer shrinkingCone PFTau
hpsPFTauProducer hps PFTau

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.tauTools import *
addTauCollection(process, tauCollection = cms.InputTag('caloRecoTauProducer'), algoLabel = "caloReco", typeLabel = "Tau")
addTauCollection(process, tauCollection = cms.InputTag('fixedConePFTauProducer'), algoLabel = "fixedCone", typeLabel = "PFTau")


Implementation Details:

You can find the implementation of these functions at tauTools.py.


Muon Tools

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:

Argument Default Value Meaning
process   the process.
isolationTypes ['All'] predefined type of userIsolation as a list of strings.

supported values of isolationTypes:

  • Tracker
  • Ecal
  • Hcal
  • All

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.muonTools import *
addMuonUserIsolation(process)


Implementation Details:

You can find the implementation of these functions at muonTools.py.


Electron Tools

addElectronUserIsolation( process, isolationTypes)

Description:

Tool to add predefined types of userIsolation to the pat::Electron candidate. Have a look to WorkBookPATDataFormats#pat_Lepton to find out how to read out this user-defined isolation from the pat::Electron.


Arguments:

Argument Default Value Meaning
process   the process.
isolationTypes ['All'] predefined type of userIsolation as a list of strings.

supported values of isolationTypes:

  • Tracker
  • Ecal
  • Hcal
  • All

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.electronTools import *
addElectronUserIsolation(process)


Implementation Details:

You can find the implementation of these functions at electronTools.py.


Photon Tools

addPhotonUserIsolation( process, isolationTypes)

Description:

Tool to add predefined types of userIsolation to the pat::Photon candidate. Have a look to WorkBookPATDataFormats#pat_Photon to find out how to read out this user-defined isolation from the pat::Photon.


Arguments:

Argument Default Value Meaning
process   the process.
isolationTypes ['All'] predefined type of userIsolation as a list of strings.

supported values of isolationTypes:

  • Tracker
  • Ecal
  • Hcal
  • All

Example:

To use the tool add the following lines to your cfg file:
# load the standard PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")

# load the coreTools of PAT
from PhysicsTools.PatAlgos.tools.photonTools import *
addPhotonUserIsolation(process)


Implementation Details:

You can find the implementation of these functions at photonTools.py.


Review status

Reviewer/Editor and Date (copy from screen) Comments
RogerWolf - 02 Mar 2010 Updated for PAT course for March 2010

Responsible: RogerWolf
Last reviewed by: RogerWolf - 02 Mar 2010

Edit | Attach | Watch | Print version | History: r60 < r59 < r58 < r57 < r56 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r60 - 2015-07-24 - MatthieuPierreMarionneau
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback