CMS 3D CMS Logo

golden_json_2015.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from FWCore.PythonUtilities.LumiList import LumiList
3 from os import environ
4 from os.path import exists, join
5 
6 def findFileInPath(theFile):
7  for s in environ["CMSSW_SEARCH_PATH"].split(":"):
8  attempt = join(s,theFile)
9  if exists(attempt):
10  return attempt
11  return None
12 
13 #--------------------------------------------------
14 # Pick a set of events
15 # defined by a set of run:luminositysection
16 #--------------------------------------------------
17 
18 golden_json_2015_pickEvents = cms.EDFilter(
19  "PickEvents",
20 
21  # chose between two definitions for the selection:
22  # run/lumiSection -based with input from a json file (what THIS example does)
23  # run/event -based with input from a json file (the historical PickEvents)
24 
25  IsRunLsBased = cms.bool(True),
26 
27  # the file listrunev is unused, in this example
28  RunEventList = cms.untracked.string('DPGAnalysis/Skims/data/listrunev'),
29 
30  # the format of the json.txt file is the one of the CMS certification ("Compact list" according to LumiList)
31  LuminositySectionsBlockRange = LumiList(findFileInPath("DPGAnalysis/Skims/data/Cert_13TeV_16Dec2015ReReco_Collisions15_25ns_50ns_JSON.txt")).getVLuminosityBlockRange()
32 
33  )
34 
35 golden_json_2015 = cms.Sequence( golden_json_2015_pickEvents )
LumiList
Definition: LumiList.py:1
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
submitPVValidationJobs.split
def split(sequence, size)
Definition: submitPVValidationJobs.py:352
golden_json_2015.findFileInPath
def findFileInPath(theFile)
Definition: golden_json_2015.py:6