CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
MatrixUtil Namespace Reference

Classes

class  InputInfo
 
class  Matrix
 
class  Steps
 
class  WF
 

Functions

def addForAll
 
def changeRefRelease
 
def expandLsInterval
 
def genvalid
 
def Kby
 
def Mby
 
def merge
 
def remove
 
def selectedLS
 

Variables

tuple data_json2015 = json.load(data_file)
 
tuple jsonFile2015 = findFileInPath("DPGAnalysis/Skims/data/Cert_13TeV_16Dec2015ReReco_Collisions15_25ns_50ns_JSON.txt")
 
dictionary stCond = {'--conditions':'auto:run1_mc'}
 Standard release validation samples ####. More...
 

Function Documentation

def MatrixUtil.addForAll (   steps,
  d 
)

Definition at line 220 of file MatrixUtil.py.

References update.

221 def addForAll(steps,d):
222  for s in steps:
223  steps[s].update(d)
224 
#define update(a, b)
def addForAll
Definition: MatrixUtil.py:220
def MatrixUtil.changeRefRelease (   steps,
  listOfPairs 
)

Definition at line 208 of file MatrixUtil.py.

References python.rootplot.root2matplotlib.replace().

209 def changeRefRelease(steps,listOfPairs):
210  for s in steps:
211  if ('INPUT' in steps[s]):
212  oldD=steps[s]['INPUT'].dataSet
213  for (ref,newRef) in listOfPairs:
214  if ref in oldD:
215  steps[s]['INPUT'].dataSet=oldD.replace(ref,newRef)
216  if '--pileup_input' in steps[s]:
217  for (ref,newRef) in listOfPairs:
218  if ref in steps[s]['--pileup_input']:
219  steps[s]['--pileup_input']=steps[s]['--pileup_input'].replace(ref,newRef)
def changeRefRelease
Definition: MatrixUtil.py:208
def MatrixUtil.expandLsInterval (   lumis)

Definition at line 46 of file MatrixUtil.py.

46 
47 def expandLsInterval(lumis):
48  return range(lumis[0],(lumis[1]+1))
def expandLsInterval
Definition: MatrixUtil.py:46
def MatrixUtil.genvalid (   fragment,
  d,
  suffix = 'all',
  fi = '',
  dataSet = '' 
)

Definition at line 225 of file MatrixUtil.py.

References python.rootplot.root2matplotlib.replace().

226 def genvalid(fragment,d,suffix='all',fi='',dataSet=''):
227  import copy
228  c=copy.copy(d)
229  if suffix:
230  c['-s']=c['-s'].replace('genvalid','genvalid_'+suffix)
231  if fi:
232  c['--filein']='lhe:%d'%(fi,)
233  if dataSet:
234  c['--filein']='das:%s'%(dataSet,)
235  c['cfg']=fragment
236  return c
237 
238 
def genvalid
Definition: MatrixUtil.py:225
def MatrixUtil.Kby (   N,
  s 
)

Definition at line 203 of file MatrixUtil.py.

Referenced by relval_steps.gen2015(), relval_steps.genS(), relval_steps.identitySim(), and relval_steps.lhegensim().

204 def Kby(N,s):
return {'--relval':'%s000,%s'%(N,s)}
def MatrixUtil.Mby (   N,
  s 
)

Definition at line 205 of file MatrixUtil.py.

Referenced by relval_steps.gen2015(), and relval_steps.genS().

206 def Mby(N,s):
207  return {'--relval':'%s000000,%s'%(N,s)}
def MatrixUtil.merge (   dictlist,
  TELL = False 
)

Definition at line 173 of file MatrixUtil.py.

References bookConverter.max.

Referenced by HLTScalersClient.endLuminosityBlock(), DDI::LogicalPart.mergedSpecificsV(), DDExpandedView.mergedSpecificsV(), DAClusterizerInZ.vertices(), and DAClusterizerInZ_vect.vertices().

174 def merge(dictlist,TELL=False):
175  import copy
176  last=len(dictlist)-1
177  if TELL: print last,dictlist
178  if last==0:
179  # ONLY ONE ITEM LEFT
180  return copy.copy(dictlist[0])
181  else:
182  reducedlist=dictlist[0:max(0,last-1)]
183  if TELL: print reducedlist
184  # make a copy of the last item
185  d=copy.copy(dictlist[last])
186  # update with the last but one item
187  d.update(dictlist[last-1])
188  # and recursively do the rest
189  reducedlist.append(d)
190  return merge(reducedlist,TELL)
Definition: merge.py:1
def MatrixUtil.remove (   d,
  key,
  TELL = False 
)

Definition at line 191 of file MatrixUtil.py.

Referenced by HiCoreTools._removeMCMatchingForPATObject(), BTagDifferentialPlot.bookHisto(), EtaPtBin.buildDescriptionString(), gen::BaseHadronizer.cleanLHE(), ValidationMatrix_v2.ReleaseComparison.compare(), customizeTrackingMonitorSeedNumber.customise_trackMon_IterativeTracking_PHASE1(), customizeTrackingMonitorSeedNumber.customise_trackMon_IterativeTracking_PHASE1PU140(), customizeTrackingMonitorSeedNumber.customise_trackMon_IterativeTracking_PHASE1PU70(), AlignmentParameterBuilder.decodeParamSel(), FedRawDataInputSource.deleteFile(), FastTimerService.findFirstLast(), FedRawDataInputSource.grabNextJsonFile(), Pythia8Hadronizer.initializeForExternalPartons(), Pythia8Hadronizer.initializeForInternalPartons(), evf::EvFDaqDirector.preGlobalEndLumi(), ora::Container.realClassName(), HiHelperTools.removeIfInSequence(), helpers.removeIfInSequence(), own_ptr< std::ifstream >.reset(), Vispa.Views.LineDecayView.LineDecayContainer.select(), gen::Pythia6Service.setSLHAFromHeader(), HiCoreTools.RemoveMCMatching.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), and XMLDocument.~XMLDocument().

192 def remove(d,key,TELL=False):
193  import copy
194  e = copy.deepcopy(d)
195  if TELL: print "original dict, BEF: %s"%d
196  del e[key]
197  if TELL: print "copy-removed dict, AFT: %s"%e
198  return e
199 
def MatrixUtil.selectedLS (   list_runs = [],
  maxNum = -1,
  l_json = data_json2015 
)

Definition at line 58 of file MatrixUtil.py.

References bitset_utilities.append().

58 
59 def selectedLS(list_runs=[],maxNum=-1,l_json=data_json2015):
60  # print "maxNum is %s"%(maxNum)
61  if type(list_runs[0]) !=int:
62  print "ERROR: list_runs must be a list of intergers"
63  return None
64  local_dict = {}
65  ls_count = 0
66 
67  for run in list_runs:
68  if str(run) in l_json.keys():
69  # print "run %s is there"%(run)
70  runNumber = run
71  # print "Doing lumi-section selection for run %s: "%(run)
72  for LSsegment in l_json[str(run)] :
73  # print LSsegment
74  ls_count += (LSsegment[-1] - LSsegment[0] + 1)
75  if (ls_count > maxNum) & (maxNum != -1):
76  break
77  # return local_dict
78  if runNumber in local_dict.keys():
79  local_dict[runNumber].append(LSsegment)
80  else:
81  local_dict[runNumber] = [LSsegment]
82  # print "total LS so far %s - grow %s"%(ls_count,local_dict)
83  #local_dict[runNumber] = [1,2,3]
84  else:
85  print "run %s is NOT present in json %s\n\n"%(run, l_json)
86  # print "++ %s"%(local_dict)
87 
88  if ( len(local_dict.keys()) > 0 ) :
89  return local_dict
90  else :
91  print "No luminosity section interval passed the json and your selection; returning None"
92  return None
93 
94 # print "\n\n\n THIS IS WHAT I RETURN: %s \n\n"%( selectedLS([251244,251251]) )
95 
96 
97 
98 
InputInfoNDefault=2000000
def selectedLS
Definition: MatrixUtil.py:58
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...

Variable Documentation

tuple MatrixUtil.data_json2015 = json.load(data_file)

Definition at line 54 of file MatrixUtil.py.

tuple MatrixUtil.jsonFile2015 = findFileInPath("DPGAnalysis/Skims/data/Cert_13TeV_16Dec2015ReReco_Collisions15_25ns_50ns_JSON.txt")

Definition at line 50 of file MatrixUtil.py.

dictionary MatrixUtil.stCond = {'--conditions':'auto:run1_mc'}

Standard release validation samples ####.

Definition at line 202 of file MatrixUtil.py.