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 104 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 105 of file MatrixUtil.py.

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

Member Function Documentation

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

Definition at line 118 of file MatrixUtil.py.

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

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

Definition at line 141 of file MatrixUtil.py.

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

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

Definition at line 148 of file MatrixUtil.py.

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

Referenced by MatrixUtil.InputInfo.das().

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

Definition at line 157 of file MatrixUtil.py.

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

Referenced by MatrixUtil.InputInfo.das().

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

Member Data Documentation

MatrixUtil.InputInfo.dataSet

Definition at line 112 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.__str__().

MatrixUtil.InputInfo.dataSetParent

Definition at line 116 of file MatrixUtil.py.

MatrixUtil.InputInfo.events
MatrixUtil.InputInfo.files
MatrixUtil.InputInfo.ib_blacklist

Definition at line 114 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.das().

MatrixUtil.InputInfo.ib_block

Definition at line 115 of file MatrixUtil.py.

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

MatrixUtil.InputInfo.label
MatrixUtil.InputInfo.location

Definition at line 110 of file MatrixUtil.py.

MatrixUtil.InputInfo.ls
MatrixUtil.InputInfo.run
MatrixUtil.InputInfo.split

Definition at line 113 of file MatrixUtil.py.