CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
muon_json_2012.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 muon_json_2012_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_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON_MuonPhys.txt")).getVLuminosityBlockRange()
32 
33 
34  )
35 
36 muon_json_2012 = cms.Sequence( muon_json_2012_pickEvents )
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
double split
Definition: MVATrainer.cc:139