PF2PAT + PAT on real data

Complete: 1

Disclaimer: The information below follow my (M.B.) best knowledge how to run PF2PAT+PAT on real data, but I have not big experience on running on real CMS data in general. Therefore, any constructive remarks are highly welcome!


It is assumed that you have already installed PF2PAT+PAT according to instruction published here

It is important to note that you need PF2PAT+PAT from the same release which was used to reconstruct data or newer.


To run PF2PAT followed by PAT on data you should modify the standard example configuration file as described below.

Note: It is assumed that you have PF2PAT+PAT already installed and that you are in your CMSSW working area and the environment is set with cmsenv (CMSSW ≥ 3_5_3)

Go to PAT test directory

cd PhysicsTools/PatAlgos/test

Open the file with your favourite text editor and modify the following:

  • Use a correct global tag. To do this you should override the default one by adding the following line to the cfg file:
    process.GlobalTag.globaltag = cms.string('GR09_R_35X_V4::All')
    In the above example the global tag to run 35X on data'09 is used. To find which global tag is sufficient to your release visit this TWki page.
    Note: The global tag should correspond with CMSSW version you use to read data not with the one used to produce it (even if it looks illogical!). Therefore, be careful with re-reco: it is possible that you will do it using different conditions that the one used for original data set. The global tag should be close to the one used to produce data.

  • Switch off a matching to generated objects by setting the runOnMC flag in the usePF2PAT function to False as follows:
    usePF2PAT(process, runPF2PAT=True, jetAlgo='IC5', runOnMC=False)

  • Apply sufficient JES corrections (MC-derived) and remove jet tag infos
    from import *
    switchJECSet(process, "900GeV")
    process.patJets.addTagInfos = False
    In the above example the JES corrections for 900GeV collisions are applied. Other possibilities are: '2360GeV'.
    Note: For coming 7TeV data you can use default JES corrections i.e. Summer09 at 7TeV. In this case you do not need do anything.

  • Define list of files you want to read, e.g.:
    process.source.fileNames = cms.untracked.vstring(
    More about available data'09 samples here.
    Note: In case of Crab usage the list is created automatically by setting dataset name, so it does not need to be defined in the cfg file.

  • Trigger bits: If desired, you can select events with fired the BSC "physics bits" like this:
    # configure HLT
    process.hltLevel1GTSeed.L1TechTriggerSeeding = cms.bool(True)
    process.hltLevel1GTSeed.L1SeedsLogicalExpression = cms.string('0 AND (40 OR 41)')
    # let it run
    process.p = cms.Path(

Finally run CMSSW:


You get an output file named patLayer1_fromAOD_PF2PAT_full.root, which contains the PAT objects for analysis.

Have fun analysing real data smile

-- MichalBluj - 30-Mar-2010
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2010-03-30 - MichalBluj
    • 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-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback