WorkBookPAT38xChanges

This page describes the changes to the PAT in CMSSW 3.8.x.

Most up-to-date PAT recipe

The most up-to-date PAT recipe for the 387 analysis release is here:

https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATReleaseNotes38X

For the analyses in 38x, there is a stable version directly from the 387 analysis release, with these global tags for the 36x-derived JEC:

  • Data: GR_R_38X_V15
  • MC: MC_38Y_V14, START38_V14, DESIGN_38_V14
  • As always, for the latest-greatest, see SWGuideFrontierConditions.

Changes related to AOD Deployment

The AOD will now be deployed along with RECO in 3.8.x. This is to facilitate the eventual transitioning of the computing model to use AOD primarily rather than RECO. A few notable changes related to analysis:

  • The number of jet collections was slightly reduced (iterativeCone5 was removed)
  • The raw jet pt was raised from 1 GeV to 3 GeV on output to reduce the event size.
  • The b-tagging "tag infos" are dropped from the AOD.

The PAT will be looking for tag infos in the b-tagging sequence, so if you want to use them, the procedure is to use the switchJetCollection function to re-run the b-tagging sequence to create the TagInfos.

  • For MC:
    from CMS.PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
    switchJetCollection( process,
                         jetCollection=cms.InputTag('ak5CMS.CaloJets'),
                         jetCorrLabel=('AK5Calo', ['L2Relative', 'L3Absolute']))
    
  • For data:
    from CMS.PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
    switchJetCollection( process,
                         jetCollection=cms.InputTag('ak5CMS.CaloJets'),
                         jetCorrLabel=('AK5Calo', ['L2Relative', 'L3Absolute', 'L2L3Residual']))
    

Details with PF2PAT

  • The PF2PAT interaction with the switchJetCollection function is nontrivial, and they don't "commute".
  • The right order is to run PF2PAT before the switchJetCollection.

Details with removing MC matching

  • The removal of MC matching also does not commute with the switchJetCollection function.
  • The right order is to switchJetCollection before running the removeMCMatching script.

Changes related to pat::Jet DataFormats refactorization

The PAT has undergone a restructuring of the pat::Jet. The reason for this is because the pat::Jet is a conglomeration of quite a bit of information, which means that read access to this collection is often quite slow. This is seen as a major disadvantage when using PAT, so this was developed to mitigate the slow read access.

The following objects will now be stored as separate collections, "under the hood" of PAT:

  • BaseTagInfos
  • CMS.CaloTowers
  • PFCandidates
  • GenJets
The collections will all have the same instance label as the jet producer (i.e., patJets, selectedPatJets, cleanPatJets, etc). All of the old tools and selectors will work, however to take advantage of the new ability to slim down the event content considerably, the PATJetSelector has been rewritten to copy the constituents of the pat::Jet for only the jets you select. Thus, it is extremely advantageous to use the PATJetSelector for your selection needs (obviously, this is done by default in PAT).

Changes related to jet energy corrections

Since CMSSW_3_8_7 JEC are retrieved from the data base under the common CMS.GlobalTag. For PAT this means that the following adaptations and simplifications have been applied:

(1)
The module parameters jetCorrFactors_cfi.py has been refactored. It now takes the following parameters:

# 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'
    ), 
    flavorType = cms.string('J') ## alternatively use 'T'
)

(2)
The PAT tools addJetCollection and switchJetCollection: have been changed to take the following parameters:

## uncomment the following lines to add ak7CMS.CaloJets to your PAT output
addJetCollection(process,cms.InputTag('ak7CMS.CaloJets'),
                 'AK7', 'Calo',
                 doJTA        = True,
                 doBTagging   = False,
                 jetCorrLabel = ('AK7Calo', cms.vstring(['L2Relative', 'L3Absolute'])),
                 doType1MET   = True,
                 doL1Cleaning = True,                 
                 doL1Counters = False,
                 genJetCollection=cms.InputTag("ak7GenJets"),
                 doJetID      = True,
                 jetIdLabel   = "ak7"
                 )

## uncomment the following lines to add ak5PFJets to your PAT output
switchJetCollection(process,cms.InputTag('ak5PFJets'),
                 doJTA        = True,
                 doBTagging   = True,
                 jetCorrLabel = ('AK5PF', cms.vstring(['L2Relative', 'L3Absolute'])),
                 doType1MET   = True,
                 genJetCollection=cms.InputTag("ak5GenJets"),
                 doJetID      = True
                 )

These changes can be used with the following minimal tags of PAT SWGuidePATReleaseNotes38X#V08_00_45. These tag will be introduced in the upcoming Analysis Tools release CMSSW_3_8_7.

Needed changes to user code

  • The corrFactor method has been deprecated, replaced now by the jecFactor. We changed the name of this method to make it less ambiguous, and to ensure that any user code that has not been propagated to the new JEC model will fail at compile time rather than at run time (or worse, not at all).
  • The new method to use is here:
          float jecFactor(const std::string& level, const std::string& flavor="none", const std::string& set="") const;
          /// correction factor to the given level for a specific set 
          /// of correction factors, starting from the current level 
          float jecFactor(const unsigned int& level, const JetCorrFactors::Flavor& flavor=JetCorrFactors::NONE, const unsigned int& set=0) const;
    
  • The user should note that the "int" access to the JEC has a mapping that you have defined, so it is slightly dangerous to use unless you are quite careful. The safer method is the string-access which corresponds to the levels that you set in your config file (like L2Relative, L3Absolute, L2L3Residual).

Changes related to PAT trigger Python tools

The PAT trigger Python tools have been reworked completely, starting from SWGuidePATReleaseNotes38X#V08_00_26_new_TriggerTools.

Since their use is very analysis dependent and individual, a recipe for the changes cannot be given. It is rather recommended to review them, using the documentations given in:

-- SalvatoreRoccoRappoccio - 29-Sep-2010

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r10 - 2010-12-07 - 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