CMS Xrootd Demonstrator Applications

This page catalogs the various applications we have used for the various Xrootd demonstrator tests

JPE

This application is designed to be minimal and "analysis-like". It reads one CMSSW product and creates a histogram of the jet energies.

import FWCore.ParameterSet.Config as cms

process = cms.Process("Ana")
process.load("FWCore.MessageService.MessageLogger_cfi")
#############   Set the number of events #############
process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(-1)
)

process.source = cms.Source("PoolSource",
  fileNames = cms.untracked.vstring("root://brian@cmsdca0.fnal.gov//store/relval/CMSSW_3_9_0_pre3/EG/RECO/GR_R_38X_V9_RelVal_col_10_special-v2/0000/0200947B-0AB7-DF11-998B-001A92971B20.root";, "root://brian@cmsdca0.fnal.gov//store/relval/CMSSW_3_9_0_pre3/EG/RECO/GR_R_38X_V9_RelVal_col_10_special-v2/0000/686115F6-E7B6-DF11-BC87-00248C55CC7F.root";, "root://brian@cmsdca0.fnal.gov//store/relval/CMSSW_3_9_0_pre3/EG/RECO/GR_R_38X_V9_RelVal_col_10_special-v2/0000/18475378-0AB7-DF11-88F3-00261894382D.root";, "root://brian@cmsdca0.fnal.gov//store/relval/CMSSW_3_9_0_pre3/EG/RECO/GR_R_38X_V9_RelVal_col_10_special-v2/0000/0CC3CAE9-0BB7-DF11-9847-0030486792B6.root";),
  duplicateCheckMode  = cms.untracked.string('noDuplicateCheck'),
)

#############   Calo Jets  ###########################
process.calo = cms.EDAnalyzer("CaloJetPlotsExample",
    JetAlgorithm  = cms.string('iterativeCone5CaloJets'),
    HistoFileName = cms.string('JPE.root'),
    NJets         = cms.int32(2)
)
#############   Path       ###########################
#process.p = cms.Path(process.calo)
#############   Format MessageLogger #################
process.MessageLogger.cerr.FwkReport.reportEvery = 10000

process.Timing = cms.Service("Timing",
    useJobReport = cms.untracked.bool(True),
    summaryOnly = cms.untracked.bool(True),
)

test_few

This application pulls in about 7 CMSSW data products. Because it has additional branches, it has a higher CPU utilization than the above one.

import FWCore.ParameterSet.Config as cms

process = cms.Process("test_33")
process.load("FWCore.MessageService.MessageLogger_cfi")
#############   Set the number of events #############
process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(3000)
)

process.source = cms.Source("PoolSource",
                            fileNames = cms.untracked.vstring('root://xrootd.unl.edu//store/user/bbockelm.nocern/little_390.root'),
                            )

process.o = cms.OutputModule('PoolOutputModule',
  fileName=cms.untracked.string('file:JPE.root'),
  outputCommands = cms.untracked.vstring('drop *',
      "keep *_generalTracks_*_*",
      "keep *_globalMuons_*_*",
       "keep *_MuonTrackPoints_*_*",
      "keep *_TrackTrackPoints_*_*"),
  fastCloning = cms.untracked.bool(False),
)

process.SiteLocalConfigService = cms.Service("SiteLocalConfigService",
  overrideSourceCacheHintDir = cms.untracked.string("application-only"),
)

#############   Path       ###########################
process.out = cms.EndPath(process.o)

#############   Format MessageLogger #################
process.MessageLogger.cerr.FwkReport.reportEvery = 1000

PAT tuple creation

PAT tuple creation is a common activity for physics groups. The below recipe only works for CMSSW_3_6_3.

For versions of CMSSW where this PAT recipe doesn't work (often, PAT code lags behind the latest framework release), we just take the branches read by the below code and replay those. We can't compare the CPU usage, but we can compare the I/O patterns.

# This is an example PAT configuration showing the usage of PAT on minbias data

# Starting with a skeleton process which gets imported with the following line
from PhysicsTools.PatAlgos.patTemplate_cfg import *

from PhysicsTools.PatAlgos.tools.coreTools import *

## global tag for data
process.GlobalTag.globaltag = cms.string('GR_R_36X_V12::All')

# add pf met
from PhysicsTools.PatAlgos.tools.metTools import *
removeMCMatching(process, ['All'])
addPfMET(process, 'PF')



# get the 900 GeV jet corrections
from PhysicsTools.PatAlgos.tools.jetTools import *
switchJECSet( process, "Spring10")


# require physics declared
process.load('HLTrigger.special.hltPhysicsDeclared_cfi')
process.hltPhysicsDeclared.L1GtReadoutRecordTag = 'gtDigis'

# require scraping filter
process.scrapingVeto = cms.EDFilter("FilterOutScraping",
                                    applyfilter = cms.untracked.bool(True),
                                    debugOn = cms.untracked.bool(False),
                                    numtrack = cms.untracked.uint32(10),
                                    thresh = cms.untracked.double(0.25)
                                    )


# 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')

# switch on PAT trigger
from PhysicsTools.PatAlgos.tools.trigTools import switchOnTrigger
switchOnTrigger( process )

process.primaryVertexFilter = cms.EDFilter("GoodVertexFilter",
                                           vertexCollection = cms.InputTag('offlinePrimaryVertices'),
                                           minimumNDOF = cms.uint32(4) ,
                                           maxAbsZ = cms.double(24), 
                                           maxd0 = cms.double(2) 
                                           )

# turn off impact parameter wrt PV (will be using wrt beam spot instead):
process.patMuons.usePV = cms.bool(False)
process.patElectrons.usePV = cms.bool(False)

# for electron alignment correction:
from RecoEgamma.EgammaTools.correctedElectronsProducer_cfi import *
process.load('RecoEgamma.EgammaTools.correctedElectronsProducer_cfi')
process.patElectrons.electronSource = "gsfElectrons::PAT"
process.load('RecoEgamma.ElectronIdentification.electronIdSequence_cff')

# HBHE Noise Filter
process.load('CommonTools.RecoAlgos.HBHENoiseFilter_cfi')

# spike cleaning
from RecoEcal.EgammaClusterProducers.ecalRecHitFlags_cfi import *
from RecoEcal.EgammaClusterProducers.hybridSuperClusters_cfi import *

# Select jets
process.selectedPatJets.cut = cms.string('pt > 10')
#process.selecedPatJets.cut = cms.string('fabs(eta) < 2.4')
#process.selectedPatJetsAK5PF.cut = cms.string('pt > 10')

# Add the files 
readFiles = cms.untracked.vstring()
readFiles.extend( [
'root://xrootd.unl.edu//store/data/Run2010A/Mu/RECO/Jun14thReReco_v1/0000/FA7D9E5C-AB78-DF11-A4A9-00237DA15C66.root'
        ] );
process.source.fileNames = readFiles

process.source.inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*")

# let it run

#print
#print "============== Warning =============="
#print "technical trigger filter:    DISABLED"
#print "physics declare bit filter:  DISABLED"
#print "primary vertex filter:       DISABLED"

process.p = cms.Path(
    process.hltLevel1GTSeed*
    process.scrapingVeto*
    #process.hltPhysicsDeclared*
    process.primaryVertexFilter*
    process.HBHENoiseFilter*
    process.gsfElectrons*
    process.eIdSequence*
    process.patDefaultSequence
    )


# rename output file
process.out.fileName = cms.untracked.string('reco_7TeV_firstdata_361_pat.root')

# reduce verbosity
process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(100)

# process all the events
process.maxEvents.input = 2000
process.options.wantSummary = True

from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
from PhysicsTools.PatAlgos.patEventContent_cff import patExtraAodEventContent
from PhysicsTools.PatAlgos.patEventContent_cff import patTriggerEventContent
process.out.outputCommands = patEventContentNoCleaning
process.out.outputCommands += patExtraAodEventContent
process.out.outputCommands += patTriggerEventContent
process.out.outputCommands += [
        'keep recoPFCandidates_particleFlow_*_*',
        ##'keep *_softMuonTagInfos_*_*',
    ##'keep *_softMuonBJetTags_*_*',
   'keep *_generalTracks_*_*',
   'keep *_globalMuons_*_*',
   'keep *_flavorHistoryFilter_*_*',
   'keep *_offlinePrimaryVertices_*_*',
   'keep CaloTowersSorted_towerMaker_*_*',
        'keep *_ecalRecHit_*_*',
        ]
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2010-09-07 - BrianBockelman
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main 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