CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
MatrixUtil.InputInfo Class Reference
Inheritance diagram for MatrixUtil.InputInfo:

Public Member Functions

def __init__
 
def __str__
 
def das
 
def lumiRanges
 
def lumis
 
def queries
 

Public Attributes

 dataSet
 
 dataSetParent
 
 events
 
 files
 
 ib_blacklist
 
 ib_block
 
 label
 
 location
 
 ls
 
 run
 
 split
 

Detailed Description

Definition at line 105 of file MatrixUtil.py.

Constructor & Destructor Documentation

def MatrixUtil.InputInfo.__init__ (   self,
  dataSet,
  dataSetParent = '',
  label = '',
  run = [],
  ls = {},
  files = 1000,
  events = InputInfoNDefault,
  split = 10,
  location = 'CAF',
  ib_blacklist = None,
  ib_block = None 
)

Definition at line 106 of file MatrixUtil.py.

107  def __init__(self,dataSet,dataSetParent='',label='',run=[],ls={},files=1000,events=InputInfoNDefault,split=10,location='CAF',ib_blacklist=None,ib_block=None) :
108  self.run = run
109  self.ls = ls
110  self.files = files
111  self.events = events
112  self.location = location
113  self.label = label
114  self.dataSet = dataSet
115  self.split = split
116  self.ib_blacklist = ib_blacklist
117  self.ib_block = ib_block
118  self.dataSetParent = dataSetParent

Member Function Documentation

def MatrixUtil.InputInfo.__str__ (   self)

Definition at line 198 of file MatrixUtil.py.

References MatrixUtil.InputInfo.dataSet, MatrixUtil.InputInfo.ib_block, RPCRunIOV::RunIOV_Item.run, RPCDQMObject.run, TB06Reco.run, TB06RecoH2.run, Point.run, BeamSpotRcdReader::theBSfromDB.run, BeamSpotOnlineRecordsReader::theBSOfromDB.run, ME::Header.run, MatrixUtil.InputInfo.run, HitEff.run, cond::RunInfo_t.run, and SiPixelErrorEstimation.run.

Referenced by edmStreamStallGrapher.Point.__repr__(), BeautifulSoup.Tag.__repr__(), BeautifulSoup.Tag.__unicode__(), and BeautifulSoup.Tag.prettify().

199  def __str__(self):
200  if self.ib_block:
201  return "input from: {0} with run {1}#{2}".format(self.dataSet, self.ib_block, self.run)
202  return "input from: {0} with run {1}".format(self.dataSet, self.run)
203 
204 
# merge dictionaries, with prioty on the [0] index
def MatrixUtil.InputInfo.das (   self,
  das_options,
  dataset 
)

Definition at line 119 of file MatrixUtil.py.

References MatrixUtil.InputInfo.ib_blacklist, join(), BeamSpotRcdReader::theBSfromDB.ls, BeamSpotOnlineRecordsReader::theBSOfromDB.ls, MatrixUtil.InputInfo.ls, MatrixUtil.InputInfo.lumis(), DB_ME.queries, MatrixUtil.InputInfo.queries(), RPCRunIOV::RunIOV_Item.run, RPCDQMObject.run, TB06Reco.run, TB06RecoH2.run, Point.run, BeamSpotRcdReader::theBSfromDB.run, BeamSpotOnlineRecordsReader::theBSOfromDB.run, ME::Header.run, MatrixUtil.InputInfo.run, HitEff.run, cond::RunInfo_t.run, and SiPixelErrorEstimation.run.

120  def das(self, das_options, dataset):
121  if len(self.run) != 0 or self.ls:
122  queries = self.queries(dataset)[:3]
123  if len(self.run) != 0:
124  command = ";".join(["dasgoclient %s --query '%s'" % (das_options, query) for query in queries])
125  else:
126  lumis = self.lumis()
127  commands = []
128  while queries:
129  commands.append("dasgoclient %s --query 'lumi,%s' --format json | das-selected-lumis.py %s " % (das_options, queries.pop(), lumis.pop()))
130  command = ";".join(commands)
131  command = "({0})".format(command)
132  else:
133  command = "dasgoclient %s --query '%s'" % (das_options, self.queries(dataset)[0])
134 
135  # Run filter on DAS output
136  if self.ib_blacklist:
137  command += " | grep -E -v "
138  command += " ".join(["-e '{0}'".format(pattern) for pattern in self.ib_blacklist])
139  from os import getenv
140  if getenv("CMSSW_USE_IBEOS","false")=="true": return command + " | ibeos-lfn-sort"
141  return command + " | sort -u"
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def MatrixUtil.InputInfo.lumiRanges (   self)

Definition at line 142 of file MatrixUtil.py.

References join(), BeamSpotRcdReader::theBSfromDB.ls, BeamSpotOnlineRecordsReader::theBSOfromDB.ls, MatrixUtil.InputInfo.ls, RPCRunIOV::RunIOV_Item.run, TB06Reco.run, TB06RecoH2.run, RPCDQMObject.run, Point.run, BeamSpotRcdReader::theBSfromDB.run, BeamSpotOnlineRecordsReader::theBSOfromDB.run, ME::Header.run, MatrixUtil.InputInfo.run, HitEff.run, cond::RunInfo_t.run, and SiPixelErrorEstimation.run.

143  def lumiRanges(self):
144  if len(self.run) != 0:
145  return "echo '{\n"+",".join(('"%d":[[1,268435455]]\n'%(x,) for x in self.run))+"}'"
146  if self.ls :
147  return "echo '{\n"+",".join(('"%d" : %s\n'%( int(x),self.ls[x]) for x in self.ls.keys()))+"}'"
148  return None
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def MatrixUtil.InputInfo.lumis (   self)

Definition at line 149 of file MatrixUtil.py.

References join(), BeamSpotRcdReader::theBSfromDB.ls, BeamSpotOnlineRecordsReader::theBSOfromDB.ls, MatrixUtil.InputInfo.ls, and str.

Referenced by MatrixUtil.InputInfo.das().

150  def lumis(self):
151  query_lumis = []
152  if self.ls:
153  for run in self.ls.keys():
154  run_lumis = []
155  for rng in self.ls[run]:
156  if isinstance(rng, int):
157  run_lumis.append(str(rng))
158  else:
159  run_lumis.append(str(rng[0])+","+str(rng[1]))
160  query_lumis.append(":".join(run_lumis))
161  return query_lumis
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
#define str(s)
def MatrixUtil.InputInfo.queries (   self,
  dataset 
)

Definition at line 162 of file MatrixUtil.py.

References MatrixUtil.InputInfo.ib_block, BeamSpotRcdReader::theBSfromDB.ls, BeamSpotOnlineRecordsReader::theBSOfromDB.ls, MatrixUtil.InputInfo.ls, RPCRunIOV::RunIOV_Item.run, TB06RecoH2.run, RPCDQMObject.run, TB06Reco.run, Point.run, BeamSpotRcdReader::theBSfromDB.run, BeamSpotOnlineRecordsReader::theBSOfromDB.run, ME::Header.run, MatrixUtil.InputInfo.run, HitEff.run, cond::RunInfo_t.run, and SiPixelErrorEstimation.run.

Referenced by MatrixUtil.InputInfo.das().

163  def queries(self, dataset):
164  query_by = "block" if self.ib_block else "dataset"
165  query_source = "{0}#{1}".format(dataset, self.ib_block) if self.ib_block else dataset
166 
167  if self.ls :
168  the_queries = []
169  #for query_run in self.ls.keys():
170  # print "run is %s"%(query_run)
171  # if you have a LS list specified, still query das for the full run (multiple ls queries take forever)
172  # and use step1_lumiRanges.log to run only on LS which respect your selection
173 
174  # DO WE WANT T2_CERN ?
175  return ["file {0}={1} run={2}".format(query_by, query_source, query_run) for query_run in self.ls.keys()]
176  #return ["file {0}={1} run={2} site=T2_CH_CERN".format(query_by, query_source, query_run) for query_run in self.ls.keys()]
177 
178 
179  #
180  #for a_range in self.ls[query_run]:
181  # # print "a_range is %s"%(a_range)
182  # the_queries += ["file {0}={1} run={2} lumi={3} ".format(query_by, query_source, query_run, query_ls) for query_ls in expandLsInterval(a_range) ]
183  #print the_queries
184  return the_queries
185 
186  site = " site=T2_CH_CERN"
187  if "CMSSW_DAS_QUERY_SITES" in os.environ:
188  if os.environ["CMSSW_DAS_QUERY_SITES"]:
189  site = " site=%s" % os.environ["CMSSW_DAS_QUERY_SITES"]
190  else:
191  site = ""
192  if len(self.run) != 0:
193  return ["file {0}={1} run={2}{3}".format(query_by, query_source, query_run, site) for query_run in self.run]
194  #return ["file {0}={1} run={2} ".format(query_by, query_source, query_run) for query_run in self.run]
195  else:
196  return ["file {0}={1}{2}".format(query_by, query_source, site)]
197  #return ["file {0}={1} ".format(query_by, query_source)]

Member Data Documentation

MatrixUtil.InputInfo.dataSet

Definition at line 113 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.__str__().

MatrixUtil.InputInfo.dataSetParent

Definition at line 117 of file MatrixUtil.py.

MatrixUtil.InputInfo.events

Definition at line 110 of file MatrixUtil.py.

Referenced by eventsfwlite.Events.__getattr__(), looper.Looper.loop(), and looper.Looper.process().

MatrixUtil.InputInfo.files

Definition at line 109 of file MatrixUtil.py.

Referenced by chain.Chain._guessTreeName(), dataset.BaseDataset.listOfFiles(), dataset.BaseDataset.listOfGoodFiles(), and dataset.BaseDataset.printFiles().

MatrixUtil.InputInfo.ib_blacklist

Definition at line 115 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.das().

MatrixUtil.InputInfo.ib_block

Definition at line 116 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.__str__(), and MatrixUtil.InputInfo.queries().

MatrixUtil.InputInfo.label

Definition at line 112 of file MatrixUtil.py.

Referenced by python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process(), and core.AutoHandle.AutoHandle.ReallyLoad().

MatrixUtil.InputInfo.location

Definition at line 111 of file MatrixUtil.py.

MatrixUtil.InputInfo.ls

Definition at line 108 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.das(), dqm_interfaces.DQMcommunicator.get_root_objects(), dqm_interfaces.DQMcommunicator.get_root_objects_list(), dqm_interfaces.DQMcommunicator.get_root_objects_list_recursive(), dqm_interfaces.DQMcommunicator.get_root_objects_names_list_recursive(), dqm_interfaces.DQMcommunicator.get_root_objects_recursive(), MatrixUtil.InputInfo.lumiRanges(), MatrixUtil.InputInfo.lumis(), MatrixUtil.InputInfo.queries(), and dqm_interfaces.DirWalkerFile.walk().

MatrixUtil.InputInfo.run

Definition at line 107 of file MatrixUtil.py.

Referenced by generateEDF.LumiInfo.__str__(), MatrixUtil.InputInfo.__str__(), DTWorkflow.DTWorkflow.all(), Types.EventID.cppID(), Types.LuminosityBlockID.cppID(), MatrixUtil.InputInfo.das(), personalPlayback.Playback.do_create_lumi(), personalPlayback.Playback.do_exec(), o2olib.O2OTool.execute(), generateEDF.LumiInfo.fixXingInfo(), MatrixUtil.InputInfo.lumiRanges(), MatrixUtil.InputInfo.queries(), and dqm_interfaces.DirWalkerFile.walk().

MatrixUtil.InputInfo.split

Definition at line 114 of file MatrixUtil.py.