Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:06:46

0001 import FWCore.ParameterSet.Config as cms
0002 from   FWCore.PythonUtilities.LumiList import LumiList
0003 from   os import environ
0004 from   os.path import exists, join
0005 
0006 def findFileInPath(theFile):
0007     for s in environ["CMSSW_SEARCH_PATH"].split(":"):
0008         attempt = join(s,theFile)
0009         if exists(attempt):
0010             return attempt                                                 
0011     return None
0012 
0013 #--------------------------------------------------
0014 #   Pick a set of events
0015 #   defined by a set of run:luminositysection
0016 #--------------------------------------------------
0017 
0018 dcsonly_json_2012_pickEvents = cms.EDFilter(
0019     "PickEvents",
0020 
0021     # chose between two definitions for the selection:
0022     #    run/lumiSection -based with input from a json file (what THIS example does)
0023     #    run/event -based with input from a json file (the historical PickEvents)
0024 
0025     IsRunLsBased  = cms.bool(True),
0026 
0027     # the file listrunev is unused, in this example
0028     RunEventList = cms.untracked.string('DPGAnalysis/Skims/data/listrunev'),
0029 
0030     LuminositySectionsBlockRange = LumiList(findFileInPath("DPGAnalysis/Skims/data/json_DCSONLY.txt")).getVLuminosityBlockRange()
0031     
0032     )
0033 
0034 dcsonly_json_2012 = cms.Sequence( dcsonly_json_2012_pickEvents )