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

104  def __init__(self,dataSet,dataSetParent='',label='',run=[],ls={},files=1000,events=InputInfoNDefault,split=10,location='CAF',ib_blacklist=None,ib_block=None) :
105  self.run = run
106  self.ls = ls
107  self.files = files
108  self.events = events
109  self.location = location
110  self.label = label
111  self.dataSet = dataSet
112  self.split = split
113  self.ib_blacklist = ib_blacklist
114  self.ib_block = ib_block
115  self.dataSetParent = dataSetParent
116 
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:104

Member Function Documentation

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

Definition at line 117 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.

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

Definition at line 140 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.

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

Definition at line 147 of file MatrixUtil.py.

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

Referenced by MatrixUtil.InputInfo.das().

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

Definition at line 156 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().

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

Member Data Documentation

MatrixUtil.InputInfo.dataSet

Definition at line 111 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.__str__().

MatrixUtil.InputInfo.dataSetParent

Definition at line 115 of file MatrixUtil.py.

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

Definition at line 113 of file MatrixUtil.py.

Referenced by MatrixUtil.InputInfo.das().

MatrixUtil.InputInfo.ib_block

Definition at line 114 of file MatrixUtil.py.

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

MatrixUtil.InputInfo.label
MatrixUtil.InputInfo.location

Definition at line 109 of file MatrixUtil.py.

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

Definition at line 112 of file MatrixUtil.py.