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, skimEvents=False)
 
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
 
 skimEvents
 
 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,
  skimEvents = False 
)

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,skimEvents=False) :
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  self.skimEvents = skimEvents
119 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ __str__()

def MatrixUtil.InputInfo.__str__ (   self)

Definition at line 209 of file MatrixUtil.py.

References MatrixUtil.InputInfo.dataSet, MatrixUtil.InputInfo.ib_block, RPCRunIOV::RunIOV_Item.run, RPCDQMObject.run, TB06Reco.run, TB06RecoH2.run, Point.run, BeamProfileHLLHC2DBReader::TheBSfromDB.run, BeamProfile2DBReader::TheBSfromDB.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__().

209  def __str__(self):
210  if self.ib_block:
211  return "input from: {0} with run {1}#{2}".format(self.dataSet, self.ib_block, self.run)
212  return "input from: {0} with run {1}".format(self.dataSet, self.run)
213 
214 
215 # merge dictionaries, with prioty on the [0] index

◆ das()

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

Definition at line 120 of file MatrixUtil.py.

References JanAlignmentAlgorithm.events, ME::Header.events, HitEff.events, HitResol.events, MatrixUtil.InputInfo.events, CosmicRateAnalyzer.events, MatrixUtil.InputInfo.ib_blacklist, join(), BeamProfile2DBReader::TheBSfromDB.ls, BeamProfileHLLHC2DBReader::TheBSfromDB.ls, 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, BeamProfile2DBReader::TheBSfromDB.run, BeamProfileHLLHC2DBReader::TheBSfromDB.run, BeamSpotRcdReader::theBSfromDB.run, BeamSpotOnlineRecordsReader::theBSOfromDB.run, ME::Header.run, MatrixUtil.InputInfo.run, HitEff.run, cond::RunInfo_t.run, SiPixelErrorEstimation.run, and MatrixUtil.InputInfo.skimEvents.

120  def das(self, das_options, dataset):
121  if not self.skimEvents and (len(self.run) != 0 or self.ls):
122  queries = self.queries(dataset)
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  elif not self.skimEvents:
133  command = "dasgoclient %s --query '%s'" % (das_options, self.queries(dataset)[0])
134  elif self.skimEvents:
135  from os import getenv
136  if getenv("JENKINS_PREFIX") is not None:
137  # to be sure that whatever happens the files are only those at CERN
138  command = "das-up-to-nevents.py -d %s -e %d -pc -l lumi_ranges.txt"%(dataset,self.events)
139  else:
140  command = "das-up-to-nevents.py -d %s -e %d -l lumi_ranges.txt"%(dataset,self.events)
141  # Run filter on DAS output
142  if self.ib_blacklist:
143  command += " | grep -E -v "
144  command += " ".join(["-e '{0}'".format(pattern) for pattern in self.ib_blacklist])
145  if not self.skimEvents:
146  from os import getenv
147  if getenv("CMSSW_USE_IBEOS","false")=="true":
148  return "export CMSSW_USE_IBEOS=true; " + command + " | ibeos-lfn-sort"
149  return command + " | sort -u"
150  else:
151  return command
152 
static std::string join(char **cmd)
Definition: RemoteFile.cc:21

◆ lumiRanges()

def MatrixUtil.InputInfo.lumiRanges (   self)

◆ lumis()

def MatrixUtil.InputInfo.lumis (   self)

Definition at line 160 of file MatrixUtil.py.

References join(), relativeConstraints.keys, BeamProfileHLLHC2DBReader::TheBSfromDB.ls, BeamProfile2DBReader::TheBSfromDB.ls, BeamSpotRcdReader::theBSfromDB.ls, BeamSpotOnlineRecordsReader::theBSOfromDB.ls, MatrixUtil.InputInfo.ls, and str.

Referenced by MatrixUtil.InputInfo.das().

160  def lumis(self):
161  query_lumis = []
162  if self.ls:
163  for run in sorted(self.ls.keys()):
164  run_lumis = []
165  for rng in self.ls[run]:
166  if isinstance(rng, int):
167  run_lumis.append(str(rng))
168  else:
169  run_lumis.append(str(rng[0])+","+str(rng[1]))
170  query_lumis.append(":".join(run_lumis))
171  return query_lumis
172 
static std::string join(char **cmd)
Definition: RemoteFile.cc:21
#define str(s)

◆ queries()

def MatrixUtil.InputInfo.queries (   self,
  dataset 
)

Definition at line 173 of file MatrixUtil.py.

References MatrixUtil.InputInfo.ib_block, relativeConstraints.keys, BeamProfile2DBReader::TheBSfromDB.ls, BeamProfileHLLHC2DBReader::TheBSfromDB.ls, BeamSpotRcdReader::theBSfromDB.ls, BeamSpotOnlineRecordsReader::theBSOfromDB.ls, MatrixUtil.InputInfo.ls, RPCRunIOV::RunIOV_Item.run, TB06Reco.run, TB06RecoH2.run, RPCDQMObject.run, Point.run, BeamProfile2DBReader::TheBSfromDB.run, BeamProfileHLLHC2DBReader::TheBSfromDB.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().

173  def queries(self, dataset):
174  query_by = "block" if self.ib_block else "dataset"
175  query_source = "{0}#{1}".format(dataset, self.ib_block) if self.ib_block else dataset
176 
177  if self.ls :
178  the_queries = []
179  #for query_run in self.ls.keys():
180  # print "run is %s"%(query_run)
181  # if you have a LS list specified, still query das for the full run (multiple ls queries take forever)
182  # and use step1_lumiRanges.log to run only on LS which respect your selection
183 
184  # DO WE WANT T2_CERN ?
185  return ["file {0}={1} run={2}".format(query_by, query_source, query_run) for query_run in sorted(self.ls.keys())]
186  #return ["file {0}={1} run={2} site=T2_CH_CERN".format(query_by, query_source, query_run) for query_run in self.ls.keys()]
187 
188 
189  #
190  #for a_range in self.ls[query_run]:
191  # # print "a_range is %s"%(a_range)
192  # 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) ]
193  #print the_queries
194  return the_queries
195 
196  site = " site=T2_CH_CERN"
197  if "CMSSW_DAS_QUERY_SITES" in os.environ:
198  if os.environ["CMSSW_DAS_QUERY_SITES"]:
199  site = " site=%s" % os.environ["CMSSW_DAS_QUERY_SITES"]
200  else:
201  site = ""
202  if len(self.run) != 0:
203  return ["file {0}={1} run={2}{3}".format(query_by, query_source, query_run, site) for query_run in self.run]
204  #return ["file {0}={1} run={2} ".format(query_by, query_source, query_run) for query_run in self.run]
205  else:
206  return ["file {0}={1}{2}".format(query_by, query_source, site)]
207  #return ["file {0}={1} ".format(query_by, query_source)]
208 

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

◆ skimEvents

MatrixUtil.InputInfo.skimEvents

Definition at line 118 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.das().

◆ split

MatrixUtil.InputInfo.split

Definition at line 114 of file MatrixUtil.py.