CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
MatrixUtil.InputInfo Class Reference
Inheritance diagram for MatrixUtil.InputInfo:

Public Member Functions

def __init__ (self, dataSet, dataSetParent='', label='', run=[], ls={}, files=1000, events=InputInfoNDefault, split=10, location='CAF', ib_blacklist=None, ib_block=None)
 
def __str__ (self)
 
def das (self, das_options, dataset)
 
def lumiRanges (self)
 
def lumis (self)
 
def queries (self, dataset)
 

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

◆ __init__()

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.

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

Member Function Documentation

◆ __str__()

def MatrixUtil.InputInfo.__str__ (   self)

Definition at line 194 of file MatrixUtil.py.

194  def __str__(self):
195  if self.ib_block:
196  return "input from: {0} with run {1}#{2}".format(self.dataSet, self.ib_block, self.run)
197  return "input from: {0} with run {1}".format(self.dataSet, self.run)
198 
199 
200 # merge dictionaries, with prioty on the [0] index

References MatrixUtil.InputInfo.dataSet, MatrixUtil.InputInfo.ib_block, RPCRunIOV::RunIOV_Item.run, RPCDQMObject.run, TB06Reco.run, TB06RecoH2.run, Point.run, BeamSpotRcdReader::theBSfromDB.run, BeamSpotOnlineHLTRcdReader::theBSOfromDB.run, BeamSpotOnlineLegacyRcdReader::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().

◆ das()

def MatrixUtil.InputInfo.das (   self,
  das_options,
  dataset 
)

Definition at line 119 of file MatrixUtil.py.

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

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

◆ lumiRanges()

def MatrixUtil.InputInfo.lumiRanges (   self)

Definition at line 142 of file MatrixUtil.py.

142  def lumiRanges(self):
143  if len(self.run) != 0:
144  return "echo '{\n"+",".join(('"%d":[[1,268435455]]\n'%(x,) for x in self.run))+"}'"
145  if self.ls :
146  return "echo '{\n"+",".join(('"%d" : %s\n'%( int(x),self.ls[x]) for x in self.ls.keys()))+"}'"
147  return None
148 

References createfilelist.int, join(), relativeConstraints.keys, BeamSpotOnlineLegacyRcdReader::theBSOfromDB.ls, BeamSpotRcdReader::theBSfromDB.ls, BeamSpotOnlineHLTRcdReader::theBSOfromDB.ls, MatrixUtil.InputInfo.ls, RPCRunIOV::RunIOV_Item.run, TB06RecoH2.run, TB06Reco.run, RPCDQMObject.run, Point.run, BeamSpotRcdReader::theBSfromDB.run, BeamSpotOnlineLegacyRcdReader::theBSOfromDB.run, BeamSpotOnlineHLTRcdReader::theBSOfromDB.run, ME::Header.run, MatrixUtil.InputInfo.run, HitEff.run, cond::RunInfo_t.run, and SiPixelErrorEstimation.run.

◆ lumis()

def MatrixUtil.InputInfo.lumis (   self)

Definition at line 149 of file MatrixUtil.py.

149  def lumis(self):
150  query_lumis = []
151  if self.ls:
152  for run in self.ls.keys():
153  run_lumis = []
154  for rng in self.ls[run]: run_lumis.append(str(rng[0])+","+str(rng[1]))
155  query_lumis.append(":".join(run_lumis))
156  return query_lumis
157 

References join(), relativeConstraints.keys, BeamSpotOnlineHLTRcdReader::theBSOfromDB.ls, BeamSpotOnlineLegacyRcdReader::theBSOfromDB.ls, BeamSpotRcdReader::theBSfromDB.ls, MatrixUtil.InputInfo.ls, and str.

Referenced by MatrixUtil.InputInfo.das().

◆ queries()

def MatrixUtil.InputInfo.queries (   self,
  dataset 
)

Definition at line 158 of file MatrixUtil.py.

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

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

Referenced by MatrixUtil.InputInfo.das().

Member Data Documentation

◆ dataSet

MatrixUtil.InputInfo.dataSet

Definition at line 113 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.__str__().

◆ dataSetParent

MatrixUtil.InputInfo.dataSetParent

Definition at line 117 of file MatrixUtil.py.

◆ events

MatrixUtil.InputInfo.events

◆ files

MatrixUtil.InputInfo.files

◆ ib_blacklist

MatrixUtil.InputInfo.ib_blacklist

Definition at line 115 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.das().

◆ ib_block

MatrixUtil.InputInfo.ib_block

Definition at line 116 of file MatrixUtil.py.

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

◆ label

MatrixUtil.InputInfo.label

◆ location

MatrixUtil.InputInfo.location

Definition at line 111 of file MatrixUtil.py.

◆ ls

MatrixUtil.InputInfo.ls

◆ run

MatrixUtil.InputInfo.run

◆ split

MatrixUtil.InputInfo.split

Definition at line 114 of file MatrixUtil.py.

join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
edmLumisInFiles.lumis
lumis
Definition: edmLumisInFiles.py:31
str
#define str(s)
Definition: TestProcessor.cc:53
createfilelist.int
int
Definition: createfilelist.py:10
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
format
edmIntegrityCheck.das
das
Definition: edmIntegrityCheck.py:17