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, 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)
 
def lumiRanges (self)
 
def lumis (self)
 
def queries (self)
 

Public Attributes

 dataSet
 
 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,
  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,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 
def __init__(self, dataSet, 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 
)

Definition at line 116 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, HitEff.run, MatrixUtil.InputInfo.run, cond::RunInfo_t.run, and SiPixelErrorEstimation.run.

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

Definition at line 138 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, HitEff.run, MatrixUtil.InputInfo.run, cond::RunInfo_t.run, and SiPixelErrorEstimation.run.

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

Definition at line 145 of file MatrixUtil.py.

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

Referenced by MatrixUtil.InputInfo.das().

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

Definition at line 154 of file MatrixUtil.py.

References MatrixUtil.InputInfo.dataSet, 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, HitEff.run, MatrixUtil.InputInfo.run, cond::RunInfo_t.run, and SiPixelErrorEstimation.run.

Referenced by MatrixUtil.InputInfo.das().

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

Member Data Documentation

MatrixUtil.InputInfo.dataSet

Definition at line 111 of file MatrixUtil.py.

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

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.