Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:09:15

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 muon_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     # the format of the json.txt file is the one of the CMS certification ("Compact list" according to LumiList)
0031     LuminositySectionsBlockRange = LumiList(findFileInPath("DPGAnalysis/Skims/data/Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON_MuonPhys.txt")).getVLuminosityBlockRange()
0032 
0033     
0034     )
0035 
0036 muon_json_2012 = cms.Sequence( muon_json_2012_pickEvents )