Misc. CMSSW notes / howtos

How to list L1 Trigger decisions from EDM file?

Using FWLite and pyROOT:

import ROOT
from DataFormats.FWLite import Events, Handle

events = Events ('myEdmFile.root')

handle = Handle ('L1GlobalTriggerObjectMapRecord')
label = ("hltL1GtObjectMap")


for event in events:

        l1trig = handle.product()
        for i in range(128):
                        trg = l1trig.getObjectMap(i)
                        print trg.algoBitNumber(), trg.algoName(), trg.algoGtlResult()
                except ReferenceError:

How to skim dataset for HLT path(s)?

Using an HLT filter and standard PoolOutputModule:

import HLTrigger.HLTfilters.hltHighLevel_cfi as hlt
process.filter = hlt.hltHighLevel.clone(
    HLTPaths = ['HLT_HT250_v*'],
    throw = False

process.skim = cms.Path(process.filter)

process.output = cms.OutputModule("PoolOutputModule",
    fileName = cms.untracked.string('output.root'),
    SelectEvents = cms.untracked.PSet(
        SelectEvents = cms.vstring('skim')

process.out = cms.EndPath(process.output)

Misc. CRAB related notes / howtos

DBS Publication problem with pile-up Input Files?

Recent versions of CRAB (at least since 2.7.9) support option

crab -publishNoInp
which ignores any input files in the publication process. However, and old school solution is to hack the crab_fjr files with a following script:

import os,sys

# directory where crab_fjr files reside
input_dir = sys.argv[1]

for file in os.listdir(input_dir):
        if file.find("crab_fjr")==-1 : continue
        import re
        chop1 = re.compile('<Inputs>.*?</Inputs>',re.DOTALL)
        chop2 = re.compile('<InputFile>.*?</InputFile>',re.DOTALL)
        f = open(input_dir+"/"+file)
        data = f.read()
        data = chop1.sub('',data)
        data = chop2.sub('',data)
        f = open ('tmp','w')
        os.system('mv tmp '+input_dir+'/'+file)

Invalidate dataset in DBS

With the command:

DBSInvalidateDataset.py --DBSURL=<dbs_url_for_publication> --datasetPath=.... --files

where dbs url for private publication is:

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2012-02-14 - AndrzejZuranski
    • 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-2021 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