PAT Recipes (Archive)

On this page you will find the installation recipes for the most important releases of the past.

CMSSW_6_2_X (devUpgrade)

TIPThis is the current development release cycle CMS upgrade studies.

Important Notes:

This release cycle is under development. Please use the highest available release of this series.
For further information about the use of PAT have a look below.

For this release cycle we have fully switched to the unscheduled processing mode, which will simplify the use of tools enormously. Have a look this TWiki or the talks by Benedikt and by Roger to find out more about the implications of the unscheduled processing mode. For further information about the use of PAT have a look below:

User Information:

ALERT! All PAT Python tools have been adapted to the unscheduled processing mode
Please make sure to have the corresponding

process.options.allowUnscheduled = cms.untracked.bool( True )
in your configuration file.

Development:


See the corresponding Release Notes for details.

CMSSW_6_1_X

Important Notes:

For this release cycle we have partially switched to the unscheduled processing mode, which will simplify the use of tools enormously. Have a look this TWiki or the talks by Benedikt and by Roger to find out more about the implications of the unscheduled processing mode. For further information about the use of PAT have a look below:

User Information:

ALERT! Almost all PAT Python tools have been adapted to the unscheduled processing mode %BR% Please make sure to have the corresponding

process.options.allowUnscheduled = cms.untracked.bool( True )
in your configuration file.

ALERT! The unscheduled processing mode is still under development for PFBRECO.

Development:

The CVS branch B6_1_X is fully compatible with CMSSW_6_1_X backports.
ALERT! Please note, that the CMSSW_6_0_X release cycle is depricated.


See the corresponding Release Notes for details.

CMSSW_5_2_X

To obey RECO stability in a closed release series like CMSSW_5_2_X, fixes, which are supposed to be included into upcoming CMSSW_5_2_X release are kept minimal to the tag V08-09-11. You can recognize them by changes only on the 4th digit (like: V08-09-11-05). As CMSSW_5_3_X is still fully compatible with CMSSW_5_2_X on the level of AnalysisTools you can always check out the latest recipes as linked from this section on top of any CMSSW_5_2_X and CMSSW_5_3_X release to profit from newest developments.

Important Notes:

The currently recommended analysis release is CMSSW_5_2_6..
For further information about the use of PAT have a look below:

User Information

The most up to date tau discriminators are not compatible with the closed CMSSW_5_2_X release. For this reasone they can not be integrated in future CMSSW_5_2_X releases. You can nevertheless use them following the recipe given below on top of each CMSSW_5_2_X PAT recipe beyond V08-09-08 :

cvs co -r V01-04-17 RecoTauTag/RecoTau
cvs co -r V01-04-03 RecoTauTag/Configuration
cvs co -r V00-04-01 CondFormats/EgammaObjects

This recipe is taken from https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuidePFTauID#Recommended_tags_for_2012_data_a. Then rerun the tau discriminator sequences as shown below.

When running on 51X MC within this release cycle apply the following recipe to adapt PAT to the different event contents in the 51X data formats:

from PhysicsTools.PatAlgos.tools.cmsswVersionTools import run52xOn51xTrigger
run52xOn51xTrigger( process )
process.load("RecoTauTag.Configuration.RecoPFTauTag_cff")

and add the following line to your process.path:

## let it run
process.p = cms.Path(
    process.PFTau *
    process.patDefaultSequence
    )

The trigger tool is available from the checkout recipe corresponding to PatAlgos tag V08-09-04 on, which was integrated into CMSSW_5_2_5.

Development:

The HEAD of the CVS branch B5_2_X is not fully compatible with CMSSW_5_2_X. developments.
ALERT! Please note, that the CMSSW_5_1_X release cycle is depricated.


See the corresponding Release Notes for details.

CMSSW_4_4_X (pro2011)

TIPThis is the stable production release cycle for analysis users using 2011 data and MC.

Important Notes:

The recommended analysis release is CMSSW_4_4_5.
For further information about the use of PAT have a look below:

User Information

Development:


See the corresponding Release Notes for details.

CMSSW_4_2_X

Development Tags: Please use the highest available release of this series.

Important Notes: The latest release of this series is CMSSW_4_2_8_patch7. Please use this release or more recent IBs for your development. For further information about the use of PAT have a look below:

User Information

Development:

The CVS branch B4_2_X is currently fully compatible with CMSSW_4_2_X developments.


See the corresponding Release Notes for details.

CMSSW_3_9_X

Development Tags: Please use the highest available release of this series.

Important Notes: The latest release of this series is CMSSW_3_9_9_patch1. Please use this release or more recent IBs for your development. For further information about the use of PAT have a look below:

User Information

Development:

The CVS branch B3_9_X is currently fully compatible with CMSSW_3_9_X developments.


See the corresponding Release Notes for details.

CMSSW_3_8_X

Development Tags: Please use the highest available release of this series.

Important Notes: The latest release of this series is CMSSW_3_8_6. Please use this release or more recent IBs for your development. For further information about the use of PAT have a look below:

User Information

From CMSSW_3_8_6 on a transition took place of the JEC derived by the CMS.JetMET POG from a text file based paradigm to DB. In this transition the PAT JetCorrFactors class had to be rewritten. This overhauling simplified the configuration of JEC factors in PAT significantly. Recent changes are summarised below:

ALERT! Note:
The parameters of the jetCorrFactors module changed to:

import FWCore.ParameterSet.Config as cms

# module to produce jet correction factors associated in a valuemap
patJetCorrFactors = cms.EDProducer("JetCorrFactorsProducer",
    ## the use of emf in the JEC is not yet implemented
    emf = cms.bool(False),
    ## input collection of jets
    src = cms.InputTag("ak5CMS.CaloJets"),
    ## payload postfix for testing
    payload = cms.string('AK5Calo'),
    ## correction levels
    levels = cms.vstring(
        ## tags for the individual jet corrections; when
        ## not available the string should be set to 'none'    
        'L2Relative', 'L3Absolute', 'L2L3Residual', 'L5Flavor', 'L7Parton'
    ), 
    flavorType = cms.string('J') ## alternatively use 'T'
)

The JEC levels to be added to the pat::Jet are governed by the parameter levels. The set of JEC factors has become part of the Global Tag. Therefore no extra parameter for these is needed any more. The parameter flavorType governs the sample for L5Flavor corrections (if available), which can be obtained as derived from a ttbar sample (T) or from a dijet sample ('J'). The available JEC levels have been renamed as indicated in the table below:

old JEC label new JEC label old flavor label new flavor label
raw Uncorrected glu gluon
off L1Offset uds uds
rel L2Relative c charm
abs L3Absolute b bottom
emf L4Emf
had L5Flavor
ue L6UE
part L7Parton

The JEC labels correspond to the official JEC labels used by JetMET. The flavor labels are case insensitive!

ALERT! Note:

Please note that this release is incompatible with former PAT tuples. We recommend you to produce PAT objects on the fly or to create new PAT tuples in one go with the arriving new reprocessed data and the Fall10 MC production.

ALERT! Note:

The following member functions of the pat::Jet have changed name:

old function name new function name
hasCorrFactors jecSetsAvailable
hasCorrFactorSet jecSetAvailable
corrFactorSetLabels availableJECSets
corrStep currentJECLevel
corrFlavour currentJECFlavor
corrFactor jecFactor

ALERT! Note:

  • The function switchJECParameters in jetTools.py turned obsolete and has been removed.
  • The parameter jetCorrLabel of the function addJetCollection in jetTools.py has changed from type ('AK5', 'Calo') to ('AK5Calo', ['L2Relative', 'L3Absolute']).
  • The parameter jetCorrLabel of the function switchJetCollection in jetTools.py has changed from type ('AK5', 'Calo') to ('AK5Calo', ['L2Relative', 'L3Absolute']).

You can find more details on SWGuidePATTools#Jet_Tools.

ALERT! Note:

  • L2L3Residual corrections are provided by JetMET ONLY FOR AK5 JETS.
  • The L2L3Residual corrections are part of the current default configuration. These corrections should be applied TO DATA ONLY though and not for the simulation. Please configure your PAT tuples accordingly!
  • Per default jets will be corrected to L2L3Residual if this correction is available from the configuration of the module and to L3Absolute else. If none of the two is available the jets will remain uncorrected. All other JEC constants to correct to a given level of JEC will be saved to the patJet as usual.

All changes indicated above are active from the PatAlgos cvs tag V08-00-45 on. All tags indicated there are prepared to go into the next AT release CMSSW_3_8_7, which currently is in preparation.

ALERT! Note:

Please note that these changes go with GlobalTags starting from tag postfix V14 (e.g. START38_V14::All) onwards. With previous GlobalTags the new JEC factors as implemented in PAT will not be fully functional, which might lead to exceptions!

Changes of the AOD Data Tier:

It has been observed that the TagInfos of commonly used b-tag algorithms are not saved on the AOD any more. In case of problems during PAT tuple production switch off the embedding of TagInfos into the patJets. To do this add the following to your configuration file:

addTagInfos=False
tagInfoSources =cms.VInputTag()

Changes of the PAT Trigger Tools and Event:

Please note that also the PAT trigger event and the PAT Trigger tools changed a bit. You can find the according changes here. A complete introduction and news about recent changes have been given during our last PAT Tutorial at FNAL. You can find the agenda here.

Development:

The cvs branch B3_8_X is currently fully compatible with CMSSW_3_8_X developments.


See the corresponding Release Notes for details.

CMSSW_3_7_X

Production Tags: Please use the highest available release of this series.

Important Notes: The latest release of this series is CMSSW_3_7_1. Please use this release for your development. For further information about the use of PAT have a look below:

User Information

Development:

The cvs branch B3_7_X is meant for approved CMSSW_3_7_X backports.


See the corresponding Release Notes for details.

CMSSW_3_6_X

Production Tags: Please use the highest available release of this series as the currently Recommended Analysis Release.

Important Notes: The latest release for this release series is CMSSW_3_6_3. For further information about the use of PAT have a look below:

User Information

ALERT! Note: When runnig on data there is a remaining small difference after applying the L2 and L3 correction as derived from MC when looking on data. You will find the reference here. The resulting difference is of the order of 2%. This differecne originates from differences MC and data in the derivation of the L2 corrections. Depending on your analysis you migth want to correct for this small difference. The CMS.JetMET provides as an exceptional patch for this slittle difference a L2L3Residual correction, which is not part of the official JEC scheme. To apply this add the following lines to your code at the analysis level! when working with L2L3Corrected ("abs") jets with PAT:

// in your begin job or where ever you want to initialize the JetCorrector
edm::FileInPath fipRes("CondFormats/JetMETObjects/data/Spring10DataV1_L2L3Residual_AK5Calo.txt");
JetCorrectorParameters *ResJetCorPar = new JetCorrectorParameters(fipRes.fullPath());
vector<JetCorrectorParameters> vParam;
vParam.push_back(*ResJetCorPar);
FactorizedJetCorrector* JEC = new FactorizedJetCorrector(vParam);
...
// in your jet loop
JEC->setJetEta(myL2L3CorrectedPATJet->eta());
JEC->setJetPt(myL2L3CorrectedPATJet->pt());
pat::Jet rescaledJet = *myL2L3CorrectedPATJet;
rescaledJet.scaleEnergy(JEC ? JEC->getCorrection() : 1.);

Note that this correction is exceptional and therefore not part of the common JEC scheme. It will therefore not be added to the canon of std JetMET correction retrievable within PAT. You will have to apply it yourself on the analysis level. Also note that this is to be applied to Data ONLY. You should not apply this residual correction to your MC samples.

ALERT! Note: In case you run over RE-RECO'ed input files you will miss the ak5GenJets reco::GenJets collection due to technical reasons during the re-reconstruction. This will result in errors of this kind:

cms::Exception caught in cmsRun
---- EventProcessorFailure BEGIN
EventProcessingStopped
---- ScheduleExecutionFailure BEGIN
ProcessingStopped
---- ProductNotFound BEGIN
getByLabel: Found zero products matching all criteria
Looking for type: std::vector<reco::GenJet>
Looking for module label: ak5GenJets
Looking for productInstanceName:

Add the following lines then to your config file:

## in your cfg
## Needed for redoing the ak5GenJets
process.load("RecoJets.Configuration.GenJetParticles_cff")
process.load("RecoJets.Configuration.RecoGenJets_cff")

## in you process path
process.p = cms.Path(process.genJetParticles *
                     process.ak5GenJets *
                     process.patDefaultSequence
                     # + process.content
)

or use the most actial version of the cmsswVersionTools.py and the function run36xOn35xInput as described below:

from CMS.PhysicsTools.PatAlgos.tools.cmsswVersionTools import *
run36xOn35xInput(process)

ALERT! Note: To use the Workbook examples please check out (minimally) these tags given at SWGuidePATReleaseNotes36X#V07_13_15_01.

ALERT! Note: The CMSSW_3_6_X release series includes the following changes in the use of b-tag discriminants on the RECO data tier when using CMSSW_3_6_X input files:

RECO: CMSSW_3_5_X RECO: CMSSW_3_6_X
softElectronByPtBJetTags only available for default jet collection
softElectronByIP3dBJetTags only available for default jet collection
simpleSecondaryVertexBJetTags does not exist
does not exist simpleSecondaryVertexHighEffBJetTags
does not exist simpleSecondaryVertexHighPurBJetTags

When running on CMSSW_3_5_X input files the PAT configuration needs to be adapted to these changes. Please exploit the cmsswVersionTools.py for this purpose. It includes the following version functions relevant for the user:

  • run36xOn35xInput(process): run PAT witin the CMSSW_3_6_X releasze series on CMSSW_3_5_X input files.
  • addJetCollection35X: add jet collection, when running on a CMSSW_3_5_X input file.
  • switchJetCollection35X: switch jet collection, when running on a CMSSW_3_5_X input file.

An example how to do this is given below:

from CMS.PhysicsTools.PatAlgos.tools.cmsswVersionTools import *

## uncomment this line to run on an 35X input sample
run36xOn35xInput(process)

## uncomment the following lines to add jets from a
## 35X input sample
addJetCollection35X(process,cms.InputTag('ak7CMS.CaloJets'),
                 'AK7', 'Calo',
                 doJTA        = True,
                 doBTagging   = False,
                 jetCorrLabel = ('AK7', 'Calo'),
                 doType1MET   = True,
                 doL1Cleaning = True,                 
                 doL1Counters = False,
                 genJetCollection=cms.InputTag("ak7GenJets"),
                 doJetID      = True,
                 jetIdLabel   = "ak7"
                 )

## uncomment the following lines to switch the jet
## collection from a 35X input sample
switchJetCollection35X(process,cms.InputTag('ak5PFJets'),
                 doJTA        = True,
                 doBTagging   = True,
                 jetCorrLabel = None,
                 doType1MET   = True,
                 genJetCollection=cms.InputTag("ak5GenJets"),
                 doJetID      = True
                 )

You can find it back in the patTuple_standard_cfg.py file. All tools are also accesible within the SWGuideConfigEditor.

Development:

See the Release Notes for details and installation recipes.


See the corresponding Release Notes for details.

CMSSW_3_5_X

Production Tags: This branch was turned into a legacy branch. Please move on to the CMSSW_3_6_X release series to use the currently recommended analysis release.

Important Notes: The latest release for this release series is CMSSW_3_5_8. Note that this release is available for SLC5 only. For further information about the use of PAT have a look below:

User Information

For the CMSSW_3_5_X release series a complete overhauling of the PAT collection and module labels has been undertaken. Old collection labels have the correspondence as detailed for the pat::Photon below:

old label new label
allLayer1Photons patPhotons
allLayer1Electrons patElectrons
allLayer1Muons patMuons
allLayer1Taus patTaus
allLayer1Jets patJets
layer1METs patMETs

Correspondingly you will find the following replacements (as given here for the pat::Photon):

  • selectedPatPhotons ( selectedLayer1Photon )
  • cleanPatPhotons ( cleanLayer1Photon )
  • countPatPhotons ( countLayer1Photons )

The standard collection is ak5 calo jets. Additional jet collections keep the jet algorithm and the type of constituents as postfix in their collection labels.

Development:

See the Release Notes for details and installation recipes.


See the corresponding Release Notes for details.

CMSSW_3_4_X

Production Tags: This branch was turned into a legacy branch. Please move on to the CMSSW_3_6_X release series to use the currently recommended analysis release.

Important Notes: The latest release for this release series is CMSSW_3_4_2. Note that this release is available for SLC5 only. For further information about the use of PAT have a look below:

General information:

For CMSSW_3_4_2 a small bug sneaked into one of the cfg files in in the PatAlgos/test/ directory. To correct for this please use the cvs command as indicated below. This is only related to this very cfg file. There is no further issues you have to be aware of.

cvs co -r 1.24.2.1 PhysicsTools/PatAlgos/test/patLayer1_fromAOD_full_cfg.py

There is also an additional feature which is available in the Selector framework, which allows the user to call the selectors without additional arguments. Add the following packages to your release area to make use of these features:

addpkg PhysicsTools/SelectorUtils V00-00-05
addpkg PhysicsTools/PatExamples V00-01-11 

Bug fixes for tcMET and Muon Corrected MET:

A bug has been found in the way that electrons are treated in track corrected MET (tcMET). There have also been developments in the muon corrected MET that improve both the resolution and the mean of the corrected MET. For more details have a look to this MET Working group contribution and to this weekly meeting presentation.

The bug fixes have been integrated in release CMSSW_3_5_0_patch1 and beyond. Users using the PAT working in the CMSSW_3_4_X release series will have to check out the following tags to be able to access the bug fixed tcMET and updated muon corrections to the caloMET:

cvs co -r V03-01-16-01   DataFormats/METReco                              
cvs co -r V04-01-05-05   JetMETCorrections/Type1MET                                               
cvs co -r V00-06-16      RecoMET/Configuration                            
cvs co -r V02-08-23-02   RecoMET/METAlgorithms                            
cvs co -r V03-01-13-03   RecoMET/METProducers   

The user will also have to re-run the muon corrected caloMET and tcMET producers. To do so, one has to add the following lines to one's configuration files:

process.load("JetMETCorrections.Type1MET.MuonMETValueMapProducer_cff") 
process.load("JetMETCorrections.Type1MET.MuonTCMETValueMapProducer_cff")
process.load("JetMETCorrections.Type1MET.MetMuonCorrections_cff") 
process.load("RecoMET.METProducers.TCMET_cfi") 
process.fixedMETSequence = cms.Sequence(
    process.muonMETValueMapProducer * 
    process.muonTCMETValueMapProducer * 
    process.corMetGlobalMuons * 
    process.tcMet
)

The fixedMETSequence will have to be run before the defalult PAT sequences:

process.p = cms.Path(
    process.fixedMETSequence*
    process.patDefaultSequence
)

To have tcMET available via the PAT, remember to include the following lines:

from CMS.PhysicsTools.PatAlgos.tools.metTools import *
addTcMET(process, 'TC')

The usual boilerplate about requisite global tags, etc applies.

Further development:

CMSSW_3_4_2 contains latest PAT developments up to V07-10-09. There is no further developments expected on this release series. For the very latest developments and fixes that have been backported to this branch have a look at the Release Notes for details.


See the corresponding Release Notes for details.

CMSSW_3_3_X

Production Tags:

Standard users should use PAT as it comes with the release. You should use these tags for your analysis!

Important Notes: For further information about the use of PAT have a look below:

User Information

  • To change the JES correction (e.g. between 10TeV and 7TeV) for different input samples just add the following lines to your configuration file
    process.jetCorrFactors.corrSample = 'Summer09_7TeV' ## 'Summer09' for 10TeV
    Per default the Summer09 (10TeV) corrections are applied.
  • With PAT in 33X we provide tools to run on 31X input samples. Please have a look at the latest version of cmsswVersionTools.py to see, which tools are available. You can find an example how to use them in patLayer1_fromAOD_full_cfg.py in the test directory of the PatAlgos package.

  • When running on RECO samples within the 31X release series please add the following lines to your configuration file:
         from CMS.PhysicsTools.PatAlgos.tools.cmsswVersionTools import *
    
         # run the 3.3.x software on Summer 09 MC from 3.1.x:
         #   - change the name from "ak" (3.3.x) to "antikt) (3.1.x)
         #   - run jet ID (not run in 3.1.x)
         run33xOn31xMC( process,
                        jetSrc = cms.InputTag("antikt5CMS.CaloJets"),
                        jetIdTag = "antikt5"
                        )
         ...
    

  • When running on AOD samples within the 31X release series please add the following lines to your configuration file:
         from CMS.PhysicsTools.PatAlgos.tools.cmsswVersionTools import *
    
         # run the 3.3.x software on Summer 09 MC from 3.1.x:
         #   - change the name from "ak" (3.3.x) to "antikt) (3.1.x)
         #   - run jet ID (not run in 3.1.x)
         run33xOn31xMC( process,
                        jetSrc = cms.InputTag("antikt5CMS.CaloJets"),
                        jetIdTag = "antikt5"
                        )
    
         restrictInputToAOD31X(process)
         ...
    

Development:

  • There is no more development in this branch.


See the corresponding Release Notes for details.

CMSSW_3_1_X

Production Tags:

Standard users should use PAT as it comes with the release. You should use these tags for your analysis!

Important Notes:

For further information about the use of PAT have a look below:

October Exercise:

  • To run over the 7TeV sample with the 7TeV JEC with PAT please do the following when using CMSSW_3_1_4 plain
    cd CMSSW_3_1_4/src
    cmsenv
    addpkg PhysicsTools/PatAlgos
    addpkg CondFormats/JetMETObjects V01-08-08-02
    addpkg JetMETCorrections/Configuration V01-08-21-01
    cvs up -r B3_1_X_CMS.OctoberX7TeV PhysicsTools/PatAlgos/python/recoLayer0/jetCorrFactors_cfi.py
    cvs up -r B3_1_X_CMS.OctoberX7TeV PhysicsTools/PatAlgos/python/recoLayer0/jetMETCorrections_cff.py
    
  • For the October exercise you should use the release CMSSW_3_1_4 plain!
  • For preparations to the October exercise use the tags given on the 31X Release Notes for V07_08_25

Development:

  • There is no more development in this branch.


See the corresponding Release Notes for details.

CMSSW_2_2_X

Production Tags:

Standard users should use PAT as it comes with the release. You should use these tags for your analysis!

Important Notes:

For further information about the use of PAT have a look below:

Update to the new structure:

Since CMSSW_2_2_10 a re-structured version of PAT has been released (PATv2), which has been tested and validated by a selected number of prototype analyses of all PAGs. You can find some helpful information about PATv2 listed below:

In any case it is worth and instructive to have a look into the given exmaple files in CMS.PhysicsTools/PatAlgos/test and to gain an overview of the configuration file structure in PhysicsTools/PatAlgos/python.

Summer08 Samples:

When using PAT (version 2) with samples from Summer08 or Fall08, please add the following lines to your main cfg.py file:

 process.patDefaultSequence.remove(process.patPFCandidateIsoDepositSelection)
 process.patDefaultSequence.remove(process.patPFTauIsolation) 

in addition to the run22XonSummer08AODSIM tool:

 ## Necessary fixes to run 2.2.X on 2.1.X data
 from CMS.PhysicsTools.PatAlgos.tools.cmsswVersionTools import run22XonSummer08AODSIM
 run22XonSummer08AODSIM(process)

Pat Tuples:

Note that there is no agreement on any patTuple format common for the EWK/Top/SUSY PAGs on the PAT version 2 output, yet. Nevertheless the standard output of PAT version 2 should already be very close to the former patTuple.


See the corresponding Release Notes for details.

-- RogerWolf - 14 May 2009

Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r13 - 2014-10-22 - VolkerAdler
 
    • 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