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!

Installation

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.

Configuration

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 patLayer1_fromAOD_PF2PAT_full_cfg.py 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 CMS.PhysicsTools.PatAlgos.tools.jetTools 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(
         'rfio:/castor/cern.ch/cms/store/data/BeamCommissioning09/MinimumBias/RAW-RECO/SD_InterestingEvents-Dec19thSkim_341_v1/0006/5A5773A3-B9ED-DE11-A99A-0026189437F8.root',
         'rfio:/castor/cern.ch/cms/store/data/BeamCommissioning09/MinimumBias/RAW-RECO/SD_InterestingEvents-Dec19thSkim_341_v1/0006/CA156CCC-B9ED-DE11-B022-00261894390B.root'
    )
    
    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.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
    process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
    process.hltLevel1GTSeed.L1TechTriggerSeeding = cms.bool(True)
    process.hltLevel1GTSeed.L1SeedsLogicalExpression = cms.string('0 AND (40 OR 41)')
    
    # let it run
    process.p = cms.Path(
        process.hltLevel1GTSeed*
        process.patDefaultSequence
        )
    

Finally run CMSSW:

cmsRun patLayer1_fromAOD_PF2PAT_full_cfg.py 

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 | WYSIWYG | More topic actions
Topic revision: r3 - 2010-04-28 - RogerWolf
 
    • 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