CMS 3D CMS Logo

Classes | Functions | Variables
lumiQueryAPI Namespace Reference

Classes

class  ParametersObject
 ==============temporarilly here======### More...
 

Functions

def allfills (queryHandle, filtercrazy=True)
 
def allruns (schemaHandle, requireRunsummary=True, requireLumisummary=False, requireTrg=False, requireHlt=False)
 ==============real api=====### More...
 
def beamIntensityForRun (query, parameters, runnum)
 
def calculateEffective (trgtable, totalrecorded)
 
def calculateTotalRecorded (deadtable)
 
def calibratedDetailForRunLimitresult (query, parameters, runnum, algoname='OCC1', finecorrection=None)
 
def deliveredLumiForRange (dbsession, parameters, inputRange, finecorrections=None)
 
def deliveredLumiForRun (dbsession, parameters, runnum, finecorrections=None)
 
def dumpData (lumidata, filename)
 
def dumpOverview (delivered, recorded, hltpath='')
 
def dumpPerLSLumi (lumidata)
 
def dumpRecordedLumi (lumidata, hltpath='')
 
def filterDeadtable (inTable, lslist)
 
def flatten (obj)
 
def getDeadfractions (deadtable)
 
def hltAllpathByrun (queryHandle, runnum)
 
def hltBypathByrun (queryHandle, runnum, hltpath)
 
def hlttrgMappingByrun (queryHandle, runnum)
 
def lsBylsLumi (deadtable)
 
def lslengthsec (numorbit, numbx)
 
def lumidetailAllalgosByrun (queryHandle, runnum)
 
def lumidetailByrunByAlgo (queryHandle, runnum, algoname='OCC1')
 
def lumisumByrun (queryHandle, runnum, lumiversion, beamstatus=None, beamenergy=None, beamenergyfluctuation=0.09, finecorrections=None)
 
def lumisummaryByrun (queryHandle, runnum, lumiversion, beamstatus=None, beamenergy=None, beamenergyfluctuation=0.09, finecorrections=None)
 
def lumisummarytrgbitzeroByrun (queryHandle, runnum, lumiversion, beamstatus=None, beamenergy=None, beamenergyfluctuation=0.09, finecorrections=None)
 
def mergeXingLumi (triplet, xingLumiDict)
 
def printDeliveredLumi (lumidata, mode)
 
def printOverviewData (delivered, recorded, hltpath='')
 
def printPerLSLumi (lumidata, isVerbose=False)
 
def printRecordedLumi (lumidata, isVerbose=False, hltpath='')
 
def recordedLumiForRange (dbsession, parameters, inputRange, finecorrections=None)
 
def recordedLumiForRun (dbsession, parameters, runnum, lslist=None, finecorrections=None)
 
def runsByfillrange (queryHandle, minFill, maxFill)
 
def runsByTimerange (queryHandle, minTime, maxTime)
 
def runsummaryByrun (queryHandle, runnum)
 
def setupSession (connectString, siteconfpath, parameters, debug=False)
 
def splitlistToRangeString (inPut)
 
def trgAllbitsByrun (queryHandle, runnum)
 
def trgbitzeroByrun (queryHandle, runnum)
 
def trgBybitnameByrun (queryHandle, runnum, bitname)
 
def validation (queryHandle, run=None, cmsls=None)
 
def xingLuminosityForRun (dbsession, runnum, parameters, lumiXingDict={}, maxLumiSection=None, finecorrections=None)
 

Variables

 accessMode
 
 allfills
 
 allruns
 
 connectstr
 
 msg
 
 q
 
 requireHlt
 
 requireLumisummary
 
 requireTrg
 
 schema
 
 session
 
 svc
 
 True
 

Function Documentation

def lumiQueryAPI.allfills (   queryHandle,
  filtercrazy = True 
)
select distinct fillnum from cmsrunsummary
there are crazy fill numbers. we assume they are not valid runs

Definition at line 1045 of file lumiQueryAPI.py.

References allfills, nameDealer.cmsrunsummaryTableName(), data, createfilelist.int, and GetRecoTauVFromDQM_MC_cff.next.

1045 def allfills(queryHandle,filtercrazy=True):
1046  '''select distinct fillnum from cmsrunsummary
1047  there are crazy fill numbers. we assume they are not valid runs
1048  '''
1049  result=[]
1050  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
1051  queryHandle.addToOutputList('distinct FILLNUM','fillnum')
1052 
1053  if filtercrazy:
1054  queryCondition='FILLNUM>:zero and FILLNUM<:crazybig'
1055  queryBind=coral.AttributeList()
1056  queryBind.extend('zero','unsigned int')
1057  queryBind.extend('crazybig','unsigned int')
1058  queryBind['zero'].setData(int(0))
1059  queryBind['crazybig'].setData(int(29701))
1060  queryHandle.setCondition(queryCondition,queryBind)
1061  queryResult=coral.AttributeList()
1062  queryResult.extend('fillnum','unsigned int')
1063  queryHandle.defineOutput(queryResult)
1064  cursor=queryHandle.execute()
1065  while next(cursor):
1066  result.append(cursor.currentRow()['fillnum'].data())
1067  result.sort()
1068  return result
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def cmsrunsummaryTableName()
Definition: nameDealer.py:16
def lumiQueryAPI.allruns (   schemaHandle,
  requireRunsummary = True,
  requireLumisummary = False,
  requireTrg = False,
  requireHlt = False 
)

==============real api=====###

find all runs in the DB. By default requires cmsrunsummary table contain the run. The condition can be loosed in situation where db loading failed on certain data portions.

Definition at line 927 of file lumiQueryAPI.py.

References allruns, nameDealer.cmsrunsummaryTableName(), CommonUtil.count_dups(), data, nameDealer.hltTableName(), nameDealer.lumisummaryTableName(), GetRecoTauVFromDQM_MC_cff.next, edm.print(), and nameDealer.trgTableName().

927 def allruns(schemaHandle,requireRunsummary=True,requireLumisummary=False,requireTrg=False,requireHlt=False):
928  '''
929  find all runs in the DB. By default requires cmsrunsummary table contain the run. The condition can be loosed in situation where db loading failed on certain data portions.
930  '''
931  if not requireRunsummary and not requireLumiummary and not requireTrg and not requireHlt:
932  print('must require at least one table')
933  raise RuntimeError('one table')
934  runresult=[]
935  runlist=[]
936  numdups=0
937  if requireRunsummary:
938  numdups=numdups+1
939  queryHandle=schemaHandle.newQuery()
940  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
941  queryHandle.addToOutputList("RUNNUM","run")
942  #queryBind=coral.AttributeList()
943  result=coral.AttributeList()
944  result.extend("run","unsigned int")
945  queryHandle.defineOutput(result)
946  cursor=queryHandle.execute()
947  while next(cursor):
948  r=cursor.currentRow()['run'].data()
949  runlist.append(r)
950  del queryHandle
951  if requireLumisummary:
952  numdups=numdups+1
953  queryHandle=schemaHandle.newQuery()
954  queryHandle.addToTableList(nameDealer.lumisummaryTableName())
955  queryHandle.addToOutputList("distinct RUNNUM","run")
956  #queryBind=coral.AttributeList()
957  result=coral.AttributeList()
958  result.extend("run","unsigned int")
959  queryHandle.defineOutput(result)
960  cursor=queryHandle.execute()
961  while next(cursor):
962  r=cursor.currentRow()['run'].data()
963  runlist.append(r)
964  del queryHandle
965  if requireTrg:
966  numdups=numdups+1
967  queryHandle=schemaHandle.newQuery()
968  queryHandle.addToTableList(nameDealer.trgTableName())
969  queryHandle.addToOutputList("distinct RUNNUM","run")
970  #queryBind=coral.AttributeList()
971  result=coral.AttributeList()
972  result.extend("run","unsigned int")
973  queryHandle.defineOutput(result)
974  cursor=queryHandle.execute()
975  while next(cursor):
976  r=cursor.currentRow()['run'].data()
977  runlist.append(r)
978  del queryHandle
979  if requireHlt:
980  numdups=numdups+1
981  queryHandle=schemaHandle.newQuery()
982  queryHandle.addToTableList(nameDealer.hltTableName())
983  queryHandle.addToOutputList("distinct RUNNUM","run")
984  #queryBind=coral.AttributeList()
985  result=coral.AttributeList()
986  result.extend("run","unsigned int")
987  queryHandle.defineOutput(result)
988  cursor=queryHandle.execute()
989  while next(cursor):
990  r=cursor.currentRow()['run'].data()
991  runlist.append(r)
992  del queryHandle
993  dupresult=CommonUtil.count_dups(runlist)
994  for dup in dupresult:
995  if dup[1]==numdups:
996  runresult.append(dup[0])
997  runresult.sort()
998  return runresult
999 
def trgTableName()
Definition: nameDealer.py:52
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def lumisummaryTableName()
Definition: nameDealer.py:25
def hltTableName()
Definition: nameDealer.py:55
def count_dups(l)
Definition: CommonUtil.py:138
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def cmsrunsummaryTableName()
Definition: nameDealer.py:16
def lumiQueryAPI.beamIntensityForRun (   query,
  parameters,
  runnum 
)
select CMSBXINDEXBLOB,BEAMINTENSITYBLOB_1,BEAMINTENSITYBLOB_2 from LUMISUMMARY where runnum=146315 and LUMIVERSION='0001'

output : result {startorbit: [(bxidx,beam1intensity,beam2intensity)]}

Definition at line 1473 of file lumiQueryAPI.py.

References mps_setup.append, data, createfilelist.int, GetRecoTauVFromDQM_MC_cff.next, and CommonUtil.unpackBlobtoArray().

1473 def beamIntensityForRun(query,parameters,runnum):
1474  '''
1475  select CMSBXINDEXBLOB,BEAMINTENSITYBLOB_1,BEAMINTENSITYBLOB_2 from LUMISUMMARY where runnum=146315 and LUMIVERSION='0001'
1476 
1477  output : result {startorbit: [(bxidx,beam1intensity,beam2intensity)]}
1478  '''
1479  result={} #{startorbit:[(bxidx,occlumi,occlumierr,beam1intensity,beam2intensity)]}
1480 
1481  lumisummaryOutput=coral.AttributeList()
1482  lumisummaryOutput.extend('cmslsnum','unsigned int')
1483  lumisummaryOutput.extend('startorbit','unsigned int')
1484  lumisummaryOutput.extend('bxindexblob','blob');
1485  lumisummaryOutput.extend('beamintensityblob1','blob');
1486  lumisummaryOutput.extend('beamintensityblob2','blob');
1487  condition=coral.AttributeList()
1488  condition.extend('runnum','unsigned int')
1489  condition.extend('lumiversion','string')
1490  condition['runnum'].setData(int(runnum))
1491  condition['lumiversion'].setData(parameters.lumiversion)
1492 
1493  query.addToTableList(parameters.lumisummaryname)
1494  query.addToOutputList('CMSLSNUM','cmslsnum')
1495  query.addToOutputList('STARTORBIT','startorbit')
1496  query.addToOutputList('CMSBXINDEXBLOB','bxindexblob')
1497  query.addToOutputList('BEAMINTENSITYBLOB_1','beamintensityblob1')
1498  query.addToOutputList('BEAMINTENSITYBLOB_2','beamintensityblob2')
1499  query.setCondition('RUNNUM=:runnum AND LUMIVERSION=:lumiversion',condition)
1500  query.defineOutput(lumisummaryOutput)
1501  cursor=query.execute()
1502  while next(cursor):
1503  #cmslsnum=cursor.currentRow()['cmslsnum'].data()
1504  startorbit=cursor.currentRow()['startorbit'].data()
1505  bxidx=[]
1506  bb1=[]
1507  bb2=[]
1508  bxindexblob=None
1509  beamintensityblob1=None
1510  beamintensityblob2=None
1511  if not cursor.currentRow()["bxindexblob"].isNull():
1512  bxindexblob=cursor.currentRow()['bxindexblob'].data()
1513  if bxindexblob and bxindexblob.readline()!=None:
1514  bxidx=CommonUtil.unpackBlobtoArray(bxindexblob,'h')
1515  if not cursor.currentRow()['beamintensityblob1'].isNull():
1516  beamintensityblob1=cursor.currentRow()['beamintensityblob1'].data()
1517  if beamintensityblob1 and beamintensityblob1.readline()!=None:
1518  bb1=CommonUtil.unpackBlobtoArray(beamintensityblob1,'f')
1519  if not cursor.currentRow()['beamintensityblob2'].isNull():
1520  beamintensityblob2=cursor.currentRow()['beamintensityblob2'].data()
1521  if beamintensityblob2 and beamintensityblob2.readline()!=None:
1522  bb2=CommonUtil.unpackBlobtoArray(beamintensityblob2,'f')
1523  if startorbit not in result:
1524  result[startorbit]=[]
1525  for idx,bxidxvalue in enumerate(bxidx):
1526  try:
1527  b1intensity=bb1[idx]
1528  except IndexError:
1529  b1intensity=0.0
1530  try:
1531  b2intensity=bb2[idx]
1532  except IndexError:
1533  b2intensity=0.0
1534  result[startorbit].append((bxidxvalue,b1intensity,b2intensity))
1535  del bxidx[:]
1536  del bb1[:]
1537  del bb2[:]
1538  return result
1539 
def unpackBlobtoArray(iblob, itemtypecode)
Definition: CommonUtil.py:230
def beamIntensityForRun(query, parameters, runnum)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.calculateEffective (   trgtable,
  totalrecorded 
)
input: trgtable{hltpath:[l1seed, hltprescale, l1prescale]}, totalrecorded (float)
output:{hltpath, recorded}

Definition at line 449 of file lumiQueryAPI.py.

449 def calculateEffective (trgtable, totalrecorded):
450  """
451  input: trgtable{hltpath:[l1seed, hltprescale, l1prescale]}, totalrecorded (float)
452  output:{hltpath, recorded}
453  """
454  #print 'inputtrgtable', trgtable
455  result = {}
456  for hltpath, data in trgtable.items():
457  if len (data) == 3:
458  result[hltpath] = totalrecorded/ (data[1]*data[2])
459  else:
460  result[hltpath] = 0.0
461  return result
462 
463 
def calculateEffective(trgtable, totalrecorded)
def lumiQueryAPI.calculateTotalRecorded (   deadtable)
input: {lsnum:[deadtime, instlumi, bit_0, norbits,prescale]}
output: recordedLumi

Definition at line 414 of file lumiQueryAPI.py.

414 def calculateTotalRecorded (deadtable):
415  """
416  input: {lsnum:[deadtime, instlumi, bit_0, norbits,prescale]}
417  output: recordedLumi
418  """
419  recordedLumi = 0.0
420  for myls, d in deadtable.items():
421  instLumi = d[1]
422  #deadfrac = float (d[0])/float (d[2]*3564)
423  #print myls, float (d[2])
424  if float (d[2]) == 0.0:
425  deadfrac = 1.0
426  else:
427  deadfrac = float (d[0])/(float (d[2])*float (d[-1]))
428  lstime = lslengthsec (d[3], 3564)
429  recordedLumi += instLumi* (1.0-deadfrac)*lstime
430  return recordedLumi
431 
432 
def calculateTotalRecorded(deadtable)
def lumiQueryAPI.calibratedDetailForRunLimitresult (   query,
  parameters,
  runnum,
  algoname = 'OCC1',
  finecorrection = None 
)
select 
s.cmslsnum,d.bxlumivalue,d.bxlumierror,d.bxlumiquality,d.algoname from LUMIDETAIL d,LUMISUMMARY s where s.runnum=133885 and d.algoname='OCC1' and s.lumisummary_id=d.lumisummary_id order by s.startorbit,s.cmslsnum
result={(startorbit,cmslsnum):[(index,lumivalue,lumierr),]}

Definition at line 1540 of file lumiQueryAPI.py.

References data, SiStripPI.max, and GetRecoTauVFromDQM_MC_cff.next.

1540 def calibratedDetailForRunLimitresult(query,parameters,runnum,algoname='OCC1',finecorrection=None):
1541  '''select
1542  s.cmslsnum,d.bxlumivalue,d.bxlumierror,d.bxlumiquality,d.algoname from LUMIDETAIL d,LUMISUMMARY s where s.runnum=133885 and d.algoname='OCC1' and s.lumisummary_id=d.lumisummary_id order by s.startorbit,s.cmslsnum
1543  result={(startorbit,cmslsnum):[(index,lumivalue,lumierr),]}
1544  '''
1545  result={}
1546  detailOutput=coral.AttributeList()
1547  detailOutput.extend('cmslsnum','unsigned int')
1548  detailOutput.extend('startorbit','unsigned int')
1549  detailOutput.extend('bxlumivalue','blob')
1550  detailOutput.extend('bxlumierror','blob')
1551  detailCondition=coral.AttributeList()
1552  detailCondition.extend('runnum','unsigned int')
1553  detailCondition.extend('algoname','string')
1554  detailCondition['runnum'].setData(runnum)
1555  detailCondition['algoname'].setData(algoname)
1556 
1557  query.addToTableList(parameters.lumisummaryname,'s')
1558  query.addToTableList(parameters.lumidetailname,'d')
1559  query.addToOutputList('s.CMSLSNUM','cmslsnum')
1560  query.addToOutputList('s.STARTORBIT','startorbit')
1561  query.addToOutputList('d.BXLUMIVALUE','bxlumivalue')
1562  query.addToOutputList('d.BXLUMIERROR','bxlumierror')
1563  query.addToOutputList('d.BXLUMIQUALITY','bxlumiquality')
1564  query.setCondition('s.RUNNUM=:runnum and d.ALGONAME=:algoname and s.LUMISUMMARY_ID=d.LUMISUMMARY_ID',detailCondition)
1565  query.defineOutput(detailOutput)
1566  cursor=query.execute()
1567  while next(cursor):
1568  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1569  bxlumivalue=cursor.currentRow()['bxlumivalue'].data()
1570  bxlumierror=cursor.currentRow()['bxlumierror'].data()
1571  startorbit=cursor.currentRow()['startorbit'].data()
1572  bxlumivalueArray=array.array('f')
1573  bxlumivalueArray.fromstring(bxlumivalue.readline())
1574  bxlumierrorArray=array.array('f')
1575  bxlumierrorArray.fromstring(bxlumierror.readline())
1576  xingLum=[]
1577  #apply selection criteria
1578  maxlumi=0.0
1579  if len(bxlumivalueArray)!=0:
1580  maxlumi=max(bxlumivalueArray)
1581  avginstlumi=0.0
1582  if len(bxlumivalueArray)!=0:
1583  avginstlumi=sum(bxlumivalueArray)
1584  for index,lum in enumerate(bxlumivalueArray):
1585  lumierror = bxlumierrorArray[index]
1586  if lum<max(parameters.xingMinLum,maxlumi*0.2):
1587  continue
1588  mynorm=parameters.normFactor
1589  if finecorrection:
1590  lum=lumiCorrections.applyfinecorrectionBX(lum,avginstlumi*mynorm,mynorm,finecorrection[0],finecorrection[1],finecorrection[2])
1591  lumierror=lumiCorrections.applyfinecorrectionBX(lumierror,avginstlumi*mynorm,mynorm,finecorrection[0],finecorrection[1],finecorrection[2])
1592  else:
1593  lum*=mynorm
1594  lumierror*=mynorm
1595  xingLum.append( (index,lum,lumierror) )
1596  if len(xingLum)!=0:
1597  result[(startorbit,cmslsnum)]=xingLum
1598  return result
1599 
def calibratedDetailForRunLimitresult(query, parameters, runnum, algoname='OCC1', finecorrection=None)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.deliveredLumiForRange (   dbsession,
  parameters,
  inputRange,
  finecorrections = None 
)
Takes either single run as a string or dictionary of run ranges

Definition at line 86 of file lumiQueryAPI.py.

References createfilelist.int, and edm.print().

86 def deliveredLumiForRange (dbsession, parameters,inputRange,finecorrections=None):
87  '''Takes either single run as a string or dictionary of run ranges'''
88  lumidata = []
89  runs=[]
90  if isinstance(inputRange, str):
91  runs.append(int(inputRange))
92  else:
93  runs=inputRange.runs()
94  for r in sorted(runs):
95  if parameters.verbose:
96  print("run", run)
97  c=None
98  if finecorrections:
99  c=finecorrections[r]
100  lumidata.append( deliveredLumiForRun (dbsession, parameters,r,finecorrections=c) )
101  return lumidata
102 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def deliveredLumiForRange(dbsession, parameters, inputRange, finecorrections=None)
Definition: lumiQueryAPI.py:86
def lumiQueryAPI.deliveredLumiForRun (   dbsession,
  parameters,
  runnum,
  finecorrections = None 
)
select sum (INSTLUMI), count (INSTLUMI) from lumisummary where runnum = 124025 and lumiversion = '0001';
select INSTLUMI,NUMORBIT  from lumisummary where runnum = 124025 and lumiversion = '0001'
query result unit E27cm^-2 (= 1 / mb)

optional corrections=None/(constfactor,afterglowfactor,nonlinearfactor)

Definition at line 162 of file lumiQueryAPI.py.

References data, lslengthsec(), nameDealer.lumisummaryTableName(), GetRecoTauVFromDQM_MC_cff.next, and edm.print().

162 def deliveredLumiForRun (dbsession, parameters, runnum, finecorrections=None ):
163  """
164  select sum (INSTLUMI), count (INSTLUMI) from lumisummary where runnum = 124025 and lumiversion = '0001';
165  select INSTLUMI,NUMORBIT from lumisummary where runnum = 124025 and lumiversion = '0001'
166  query result unit E27cm^-2 (= 1 / mb)
167 
168  optional corrections=None/(constfactor,afterglowfactor,nonlinearfactor)
169  """
170  #if parameters.verbose:
171  # print 'deliveredLumiForRun : norm : ', parameters.norm, ' : run : ', runnum
172  #output ['run', 'totalls', 'delivered', 'beammode']
173  delivered = 0.0
174  totalls = 0
175  try:
176  conditionstring="RUNNUM = :runnum AND LUMIVERSION = :lumiversion"
177  dbsession.transaction().start (True)
178  schema = dbsession.nominalSchema()
179  query = schema.tableHandle (nameDealer.lumisummaryTableName()).newQuery()
180  query.addToOutputList("INSTLUMI",'instlumi')
181  query.addToOutputList ("NUMORBIT", "norbits")
182  queryBind = coral.AttributeList()
183  queryBind.extend ("runnum", "unsigned int")
184  queryBind.extend ("lumiversion", "string")
185  queryBind["runnum"].setData (int (runnum))
186  queryBind["lumiversion"].setData (parameters.lumiversion)
187  #print parameters.beammode
188  if len(parameters.beammode)!=0:
189  conditionstring=conditionstring+' and BEAMSTATUS=:beamstatus'
190  queryBind.extend('beamstatus','string')
191  queryBind['beamstatus'].setData(parameters.beammode)
192  result = coral.AttributeList()
193  result.extend ("instlumi", "float")
194  result.extend ("norbits", "unsigned int")
195  query.defineOutput (result)
196  query.setCondition (conditionstring,queryBind)
197  cursor = query.execute()
198  while next(cursor):
199  instlumi = cursor.currentRow()['instlumi'].data()
200  norbits = cursor.currentRow()['norbits'].data()
201  if finecorrections is not None:
202  instlumi=lumiCorrections.applyfinecorrection(instlumi,finecorrections[0],finecorrections[1],finecorrections[2])
203  if instlumi is not None and norbits is not None:
204  lstime = lslengthsec(norbits, parameters.NBX)
205  delivered=delivered+instlumi*parameters.norm*lstime
206  totalls+=1
207  del query
208  dbsession.transaction().commit()
209  lumidata = []
210  if delivered == 0.0:
211  lumidata = [str (runnum), 'N/A', 'N/A', 'N/A']
212  else:
213  lumidata = [str (runnum), str (totalls), '%.3f'%delivered, parameters.beammode]
214  return lumidata
215  except Exception as e:
216  print(str (e))
217  dbsession.transaction().rollback()
218  del dbsession
219 
def deliveredLumiForRun(dbsession, parameters, runnum, finecorrections=None)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def lumisummaryTableName()
Definition: nameDealer.py:25
def lslengthsec(numorbit, numbx)
Definition: lumiQueryAPI.py:59
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.dumpData (   lumidata,
  filename 
)
input params: lumidata [{'fieldname':value}]
              filename csvname

Definition at line 405 of file lumiQueryAPI.py.

Referenced by CastorDbXml.dumpObject(), and HcalDbXml.dumpObject().

405 def dumpData (lumidata, filename):
406  """
407  input params: lumidata [{'fieldname':value}]
408  filename csvname
409  """
410 
411  r = csvReporter.csvReporter(filename)
412  r.writeRows(lumidata)
413 
def dumpData(lumidata, filename)
def lumiQueryAPI.dumpOverview (   delivered,
  recorded,
  hltpath = '' 
)

Definition at line 755 of file lumiQueryAPI.py.

References xingLuminosityForRun().

755 def dumpOverview (delivered, recorded, hltpath = ''):
756  #toprowlabels = ['run', 'delivered', 'recorded', 'hltpath']
757  datatable = []
758  for runidx, deliveredrowdata in enumerate (delivered):
759  rowdata = []
760  rowdata += [deliveredrowdata[0], deliveredrowdata[2]]
761  if deliveredrowdata[1] == 'N/A': #run does not exist
762  rowdata += ['N/A', 'N/A']
763  datatable.append (rowdata)
764  continue
765  recordedLumi = calculateTotalRecorded (recorded[runidx][2])
766  lumiinPaths = calculateEffective (recorded[runidx][1], recordedLumi)
767  if hltpath != '' and hltpath != 'all':
768  if hltpath in lumiinPaths:
769  rowdata += [recordedLumi, lumiinPaths[hltpath]]
770  else:
771  rowdata += [recordedLumi, 'N/A']
772  else:
773  rowdata += [recordedLumi, recordedLumi]
774  datatable.append (rowdata)
775  return datatable
776 
777 
def dumpOverview(delivered, recorded, hltpath='')
def lumiQueryAPI.dumpPerLSLumi (   lumidata)

Definition at line 518 of file lumiQueryAPI.py.

518 def dumpPerLSLumi (lumidata):
519  datatodump = []
520  for perrundata in lumidata:
521  runnumber = perrundata[0]
522  deadtable = perrundata[2]
523  lumiresult = lsBylsLumi (deadtable)
524  for lsnum, dataperls in lumiresult.items():
525  rowdata = []
526  if len (dataperls) == 0:
527  rowdata += [str (runnumber), str (lsnum), 'N/A', 'N/A']
528  else:
529  rowdata += [str (runnumber), str (lsnum), dataperls[0], dataperls[1]]
530  if len (dataperls) > 2:
531  rowdata.extend ( flatten (dataperls[2:]) )
532  datatodump.append (rowdata)
533  return datatodump
534 
535 
def dumpPerLSLumi(lumidata)
def lumiQueryAPI.dumpRecordedLumi (   lumidata,
  hltpath = '' 
)

Definition at line 645 of file lumiQueryAPI.py.

645 def dumpRecordedLumi (lumidata, hltpath = ''):
646  #labels = ['Run', 'HLT path', 'Recorded']
647  datatodump = []
648  for dataperRun in lumidata:
649  runnum = dataperRun[0]
650  if len (dataperRun[1]) == 0:
651  rowdata = []
652  rowdata += [str (runnum)]+2*['N/A']
653  datatodump.append (rowdata)
654  continue
655  perlsdata = dataperRun[2]
656  recordedLumi = 0.0
657  #norbits = perlsdata.values()[0][3]
658  recordedLumi = calculateTotalRecorded (perlsdata)
659  trgdict = dataperRun[1]
660  effective = calculateEffective (trgdict, recordedLumi)
661  if hltpath in trgdict and hltpath in effective:
662  rowdata = []
663  l1bit = trgdict[hltpath][0]
664  if len (trgdict[hltpath]) != 3:
665  rowdata += [str (runnum), hltpath, 'N/A']
666  else:
667  hltprescale = trgdict[hltpath][1]
668  l1prescale = trgdict[hltpath][2]
669  rowdata += [str (runnum), hltpath, effective[hltpath]]
670  datatodump.append (rowdata)
671  continue
672 
673  for trg, trgdata in trgdict.items():
674  #print trg, trgdata
675  rowdata = []
676  rowdata += [str (runnum)]
677  l1bit = trgdata[0]
678  if len (trgdata) == 3:
679  rowdata += [trg, effective[trg]]
680  else:
681  rowdata += [trg, 'N/A']
682  datatodump.append (rowdata)
683  return datatodump
684 
685 
def dumpRecordedLumi(lumidata, hltpath='')
def lumiQueryAPI.filterDeadtable (   inTable,
  lslist 
)

Definition at line 387 of file lumiQueryAPI.py.

387 def filterDeadtable (inTable, lslist):
388  result = {}
389  if lslist is None:
390  return inTable
391  if len (lslist) == 0: #if request no ls, then return nothing
392  return result
393  for existingLS in inTable.keys():
394  if existingLS in lslist:
395  result[existingLS] = inTable[existingLS]
396  return result
397 
398 
def filterDeadtable(inTable, lslist)
def lumiQueryAPI.flatten (   obj)
Given nested lists or tuples, returns a single flattened list

Definition at line 868 of file lumiQueryAPI.py.

868 def flatten (obj):
869  '''Given nested lists or tuples, returns a single flattened list'''
870  result = []
871  for piece in obj:
872  if hasattr (piece, '__iter__') and not isinstance (piece, str):
873  result.extend( flatten (piece) )
874  else:
875  result.append (piece)
876  return result
877 
878 
def flatten(obj)
def lumiQueryAPI.getDeadfractions (   deadtable)
inputtable: {lsnum:[deadtime, instlumi, bit_0, norbits,bit_0_prescale]}
output: {lsnum:deadfraction}

Definition at line 464 of file lumiQueryAPI.py.

References objects.autophobj.float.

464 def getDeadfractions (deadtable):
465  """
466  inputtable: {lsnum:[deadtime, instlumi, bit_0, norbits,bit_0_prescale]}
467  output: {lsnum:deadfraction}
468  """
469  result = {}
470  for myls, d in deadtable.items():
471  #deadfrac = float (d[0])/ (float (d[2])*float (3564))
472  if float (d[2]) == 0.0: ##no beam
473  deadfrac = -1.0
474  else:
475  deadfrac = float (d[0])/ (float (d[2])*float(d[-1]))
476  result[myls] = deadfrac
477  return result
478 
def getDeadfractions(deadtable)
def lumiQueryAPI.hltAllpathByrun (   queryHandle,
  runnum 
)
select cmslsnum,inputcount,acceptcount,prescale,pathname from hlt where runnum=:runnum
this can be changed to blob query later
output: {cmslsnum:{pathname:[inputcount,acceptcount,prescale]}}

Definition at line 1433 of file lumiQueryAPI.py.

References data, nameDealer.hltTableName(), createfilelist.int, and GetRecoTauVFromDQM_MC_cff.next.

1433 def hltAllpathByrun(queryHandle,runnum):
1434  '''
1435  select cmslsnum,inputcount,acceptcount,prescale,pathname from hlt where runnum=:runnum
1436  this can be changed to blob query later
1437  output: {cmslsnum:{pathname:[inputcount,acceptcount,prescale]}}
1438  '''
1439  result={}
1440  queryHandle.addToTableList(nameDealer.hltTableName())
1441  queryCondition=coral.AttributeList()
1442  queryCondition.extend('runnum','unsigned int')
1443  queryCondition['runnum'].setData(int(runnum))
1444  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1445  queryHandle.addToOutputList('INPUTCOUNT','inputcount')
1446  queryHandle.addToOutputList('ACCEPTCOUNT','acceptcount')
1447  queryHandle.addToOutputList('PRESCALE','prescale')
1448  queryHandle.addToOutputList('PATHNAME','pathname')
1449  queryHandle.setCondition('RUNNUM=:runnum',queryCondition)
1450  queryResult=coral.AttributeList()
1451  queryResult.extend('cmslsnum','unsigned int')
1452  queryResult.extend('inputcount','unsigned int')
1453  queryResult.extend('acceptcount','unsigned int')
1454  queryResult.extend('prescale','unsigned int')
1455  queryResult.extend('pathname','string')
1456  queryHandle.defineOutput(queryResult)
1457  cursor=queryHandle.execute()
1458  while next(cursor):
1459  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1460  inputcount=cursor.currentRow()['inputcount'].data()
1461  acceptcount=cursor.currentRow()['acceptcount'].data()
1462  prescale=cursor.currentRow()['prescale'].data()
1463  pathname=cursor.currentRow()['pathname'].data()
1464  if cmslsnum not in result:
1465  dataperLS={}
1466  dataperLS[pathname]=[inputcount,acceptcount,prescale]
1467  result[cmslsnum]=dataperLS
1468  else:
1469  result[cmslsnum][pathname]=[inputcount,acceptcount,prescale]
1470  return result
1471 
1472 
def hltTableName()
Definition: nameDealer.py:55
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def hltAllpathByrun(queryHandle, runnum)
def lumiQueryAPI.hltBypathByrun (   queryHandle,
  runnum,
  hltpath 
)
select cmslsnum,inputcount,acceptcount,prescale from hlt where runnum=:runnum and pathname=:pathname
output: {cmslsnum:[inputcount,acceptcount,prescale]}

Definition at line 1400 of file lumiQueryAPI.py.

References data, nameDealer.hltTableName(), createfilelist.int, and GetRecoTauVFromDQM_MC_cff.next.

1400 def hltBypathByrun(queryHandle,runnum,hltpath):
1401  '''
1402  select cmslsnum,inputcount,acceptcount,prescale from hlt where runnum=:runnum and pathname=:pathname
1403  output: {cmslsnum:[inputcount,acceptcount,prescale]}
1404  '''
1405  result={}
1406  queryHandle.addToTableList(nameDealer.hltTableName())
1407  queryCondition=coral.AttributeList()
1408  queryCondition.extend('runnum','unsigned int')
1409  queryCondition.extend('pathname','string')
1410  queryCondition['runnum'].setData(int(runnum))
1411  queryCondition['pathname'].setData(hltpath)
1412  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1413  queryHandle.addToOutputList('INPUTCOUNT','inputcount')
1414  queryHandle.addToOutputList('ACCEPTCOUNT','acceptcount')
1415  queryHandle.addToOutputList('PRESCALE','prescale')
1416  queryHandle.setCondition('RUNNUM=:runnum and PATHNAME=:pathname',queryCondition)
1417  queryResult=coral.AttributeList()
1418  queryResult.extend('cmslsnum','unsigned int')
1419  queryResult.extend('inputcount','unsigned int')
1420  queryResult.extend('acceptcount','unsigned int')
1421  queryResult.extend('prescale','unsigned int')
1422  queryHandle.defineOutput(queryResult)
1423  cursor=queryHandle.execute()
1424  while next(cursor):
1425  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1426  inputcount=cursor.currentRow()['inputcount'].data()
1427  acceptcount=cursor.currentRow()['acceptcount'].data()
1428  prescale=cursor.currentRow()['prescale'].data()
1429  if cmslsnum not in result:
1430  result[cmslsnum]=[inputcount,acceptcount,prescale]
1431  return result
1432 
def hltBypathByrun(queryHandle, runnum, hltpath)
def hltTableName()
Definition: nameDealer.py:55
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.hlttrgMappingByrun (   queryHandle,
  runnum 
)
select m.hltpathname,m.l1seed from cmsrunsummary r,trghltmap m where r.runnum=:runnum and m.hltkey=r.hltkey
output: {hltpath:l1seed}

Definition at line 1682 of file lumiQueryAPI.py.

References nameDealer.cmsrunsummaryTableName(), data, createfilelist.int, GetRecoTauVFromDQM_MC_cff.next, and nameDealer.trghltMapTableName().

1682 def hlttrgMappingByrun(queryHandle,runnum):
1683  '''
1684  select m.hltpathname,m.l1seed from cmsrunsummary r,trghltmap m where r.runnum=:runnum and m.hltkey=r.hltkey
1685  output: {hltpath:l1seed}
1686  '''
1687  result={}
1688  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName(),'r')
1689  queryHandle.addToTableList(nameDealer.trghltMapTableName(),'m')
1690  queryCondition=coral.AttributeList()
1691  queryCondition.extend('runnum','unsigned int')
1692  queryCondition['runnum'].setData(int(runnum))
1693  queryHandle.addToOutputList('m.HLTPATHNAME','hltpathname')
1694  queryHandle.addToOutputList('m.L1SEED','l1seed')
1695  queryHandle.setCondition('r.RUNNUM=:runnum and m.HLTKEY=r.HLTKEY',queryCondition)
1696  queryResult=coral.AttributeList()
1697  queryResult.extend('hltpathname','string')
1698  queryResult.extend('l1seed','string')
1699  queryHandle.defineOutput(queryResult)
1700  cursor=queryHandle.execute()
1701  while next(cursor):
1702  hltpathname=cursor.currentRow()['hltpathname'].data()
1703  l1seed=cursor.currentRow()['l1seed'].data()
1704  if hltpathname not in result:
1705  result[hltpathname]=l1seed
1706  return result
1707 
def hlttrgMappingByrun(queryHandle, runnum)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def cmsrunsummaryTableName()
Definition: nameDealer.py:16
def trghltMapTableName()
Definition: nameDealer.py:76
def lumiQueryAPI.lsBylsLumi (   deadtable)
input: {lsnum:[deadtime, instlumi, bit_0, norbits,prescale...]}
output: {lsnum:[instlumi, recordedlumi...]}

Definition at line 64 of file lumiQueryAPI.py.

References objects.autophobj.float.

64 def lsBylsLumi (deadtable):
65  """
66  input: {lsnum:[deadtime, instlumi, bit_0, norbits,prescale...]}
67  output: {lsnum:[instlumi, recordedlumi...]}
68  """
69  result = {}
70  for myls, deadArray in deadtable.items():
71  lstime = lslengthsec (deadArray[3], 3564)
72  instlumi = deadArray[1] * lstime
73  if float( deadArray[2] ) == 0.0:
74  deadfrac = 1.0
75  else:
76  deadfrac = float (deadArray[0]) / (float (deadArray[2])*float(deadArray[4]))
77  recordedLumi = instlumi * (1.0 - deadfrac)
78  myLsList = [instlumi, recordedLumi]
79  #print myls,instlumi,recordedLumi,lstime,deadfrac
80  if len (deadArray) > 5:
81  myLsList.extend (deadArray[5:])
82  result[myls] = myLsList
83  return result
84 
85 
def lsBylsLumi(deadtable)
Definition: lumiQueryAPI.py:64
def lumiQueryAPI.lslengthsec (   numorbit,
  numbx 
)

Definition at line 59 of file lumiQueryAPI.py.

Referenced by deliveredLumiForRun().

59 def lslengthsec (numorbit, numbx):
60  #print numorbit, numbx
61  l = numorbit * numbx * 25.0e-09
62  return l
63 
def lslengthsec(numorbit, numbx)
Definition: lumiQueryAPI.py:59
def lumiQueryAPI.lumidetailAllalgosByrun (   queryHandle,
  runnum 
)
select s.cmslsnum,d.bxlumivalue,d.bxlumierror,d.bxlumiquality,d.algoname,s.startorbit from LUMIDETAIL d,LUMISUMMARY s where s.runnum=:runnumber and s.lumisummary_id=d.lumisummary_id order by s.startorbit,d.algoname
output: {algoname:{cmslsnum:[bxlumivalue,bxlumierror,bxlumiquality,startorbit]}}

Definition at line 1638 of file lumiQueryAPI.py.

References data, createfilelist.int, nameDealer.lumidetailTableName(), nameDealer.lumisummaryTableName(), and GetRecoTauVFromDQM_MC_cff.next.

1638 def lumidetailAllalgosByrun(queryHandle,runnum):
1639  '''
1640  select s.cmslsnum,d.bxlumivalue,d.bxlumierror,d.bxlumiquality,d.algoname,s.startorbit from LUMIDETAIL d,LUMISUMMARY s where s.runnum=:runnumber and s.lumisummary_id=d.lumisummary_id order by s.startorbit,d.algoname
1641  output: {algoname:{cmslsnum:[bxlumivalue,bxlumierror,bxlumiquality,startorbit]}}
1642  '''
1643  result={}
1644  queryHandle.addToTableList(nameDealer.lumidetailTableName(),'d')
1645  queryHandle.addToTableList(nameDealer.lumisummaryTableName(),'s')
1646  queryCondition=coral.AttributeList()
1647  queryCondition.extend('runnum','unsigned int')
1648  queryCondition['runnum'].setData(int(runnum))
1649  queryHandle.addToOutputList('s.CMSLSNUM','cmslsnum')
1650  queryHandle.addToOutputList('d.BXLUMIVALUE','bxlumivalue')
1651  queryHandle.addToOutputList('d.BXLUMIERROR','bxlumierror')
1652  queryHandle.addToOutputList('d.BXLUMIQUALITY','bxlumiquality')
1653  queryHandle.addToOutputList('d.ALGONAME','algoname')
1654  queryHandle.addToOutputList('s.STARTORBIT','startorbit')
1655  queryHandle.setCondition('s.RUNNUM=:runnum and s.LUMISUMMARY_ID=d.LUMISUMMARY_ID',queryCondition)
1656  queryResult=coral.AttributeList()
1657  queryResult.extend('cmslsnum','unsigned int')
1658  queryResult.extend('bxlumivalue','blob')
1659  queryResult.extend('bxlumierror','blob')
1660  queryResult.extend('bxlumiquality','blob')
1661  queryResult.extend('algoname','string')
1662  queryResult.extend('startorbit','unsigned int')
1663  queryHandle.addToOrderList('startorbit')
1664  queryHandle.addToOrderList('algoname')
1665  queryHandle.defineOutput(queryResult)
1666  cursor=queryHandle.execute()
1667  while next(cursor):
1668  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1669  bxlumivalue=cursor.currentRow()['bxlumivalue'].data()
1670  bxlumierror=cursor.currentRow()['bxlumierror'].data()
1671  bxlumiquality=cursor.currentRow()['bxlumiquality'].data()
1672  algoname=cursor.currentRow()['algoname'].data()
1673  startorbit=cursor.currentRow()['startorbit'].data()
1674  if algoname not in result:
1675  dataPerAlgo={}
1676  dataPerAlgo[cmslsnum]=[bxlumivalue,bxlumierror,bxlumiquality,startorbit]
1677  result[algoname]=dataPerAlgo
1678  else:
1679  result[algoname][cmslsnum]=[bxlumivalue,bxlumierror,bxlumiquality,startorbit]
1680  return result
1681 
def lumidetailAllalgosByrun(queryHandle, runnum)
def lumidetailTableName()
Definition: nameDealer.py:34
def lumisummaryTableName()
Definition: nameDealer.py:25
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.lumidetailByrunByAlgo (   queryHandle,
  runnum,
  algoname = 'OCC1' 
)
select s.cmslsnum,d.bxlumivalue,d.bxlumierror,d.bxlumiquality,s.startorbit from LUMIDETAIL d,LUMISUMMARY s where s.runnum=:runnum and d.algoname=:algoname and s.lumisummary_id=d.lumisummary_id order by s.startorbit
output: [[cmslsnum,bxlumivalue,bxlumierror,bxlumiquality,startorbit]]
since the output is ordered by time, it has to be in seq list format

Definition at line 1600 of file lumiQueryAPI.py.

References data, createfilelist.int, nameDealer.lumidetailTableName(), nameDealer.lumisummaryTableName(), and GetRecoTauVFromDQM_MC_cff.next.

1600 def lumidetailByrunByAlgo(queryHandle,runnum,algoname='OCC1'):
1601  '''
1602  select s.cmslsnum,d.bxlumivalue,d.bxlumierror,d.bxlumiquality,s.startorbit from LUMIDETAIL d,LUMISUMMARY s where s.runnum=:runnum and d.algoname=:algoname and s.lumisummary_id=d.lumisummary_id order by s.startorbit
1603  output: [[cmslsnum,bxlumivalue,bxlumierror,bxlumiquality,startorbit]]
1604  since the output is ordered by time, it has to be in seq list format
1605  '''
1606  result=[]
1607  queryHandle.addToTableList(nameDealer.lumidetailTableName(),'d')
1608  queryHandle.addToTableList(nameDealer.lumisummaryTableName(),'s')
1609  queryCondition=coral.AttributeList()
1610  queryCondition.extend('runnum','unsigned int')
1611  queryCondition.extend('algoname','string')
1612  queryCondition['runnum'].setData(int(runnum))
1613  queryCondition['algoname'].setData(algoname)
1614  queryHandle.addToOutputList('s.CMSLSNUM','cmslsnum')
1615  queryHandle.addToOutputList('d.BXLUMIVALUE','bxlumivalue')
1616  queryHandle.addToOutputList('d.BXLUMIERROR','bxlumierror')
1617  queryHandle.addToOutputList('d.BXLUMIQUALITY','bxlumiquality')
1618  queryHandle.addToOutputList('s.STARTORBIT','startorbit')
1619  queryHandle.setCondition('s.runnum=:runnum and d.algoname=:algoname and s.lumisummary_id=d.lumisummary_id',queryCondition)
1620  queryResult=coral.AttributeList()
1621  queryResult.extend('cmslsnum','unsigned int')
1622  queryResult.extend('bxlumivalue','blob')
1623  queryResult.extend('bxlumierror','blob')
1624  queryResult.extend('bxlumiquality','blob')
1625  queryResult.extend('startorbit','unsigned int')
1626  queryHandle.addToOrderList('s.STARTORBIT')
1627  queryHandle.defineOutput(queryResult)
1628  cursor=queryHandle.execute()
1629  while next(cursor):
1630  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1631  bxlumivalue=cursor.currentRow()['bxlumivalue'].data()
1632  bxlumierror=cursor.currentRow()['bxlumierror'].data()
1633  bxlumiquality=cursor.currentRow()['bxlumiquality'].data()
1634  startorbit=cursor.currentRow()['startorbit'].data()
1635  result.append([cmslsnum,bxlumivalue,bxlumierror,bxlumiquality,startorbit])
1636  return result
1637 
def lumidetailByrunByAlgo(queryHandle, runnum, algoname='OCC1')
def lumidetailTableName()
Definition: nameDealer.py:34
def lumisummaryTableName()
Definition: nameDealer.py:25
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.lumisumByrun (   queryHandle,
  runnum,
  lumiversion,
  beamstatus = None,
  beamenergy = None,
  beamenergyfluctuation = 0.09,
  finecorrections = None 
)
beamenergy unit : GeV
beamenergyfluctuation : fraction allowed to fluctuate around beamenergy value
select instlumi from lumisummary where runnum=:runnum and lumiversion=:lumiversion
output: float sum(instlumi)
Note: the output is the raw result, need to apply LS length in time(sec)

Definition at line 1164 of file lumiQueryAPI.py.

References data, objects.autophobj.float, createfilelist.int, nameDealer.lumisummaryTableName(), and GetRecoTauVFromDQM_MC_cff.next.

1164 def lumisumByrun(queryHandle,runnum,lumiversion,beamstatus=None,beamenergy=None,beamenergyfluctuation=0.09,finecorrections=None):
1165  '''
1166  beamenergy unit : GeV
1167  beamenergyfluctuation : fraction allowed to fluctuate around beamenergy value
1168  select instlumi from lumisummary where runnum=:runnum and lumiversion=:lumiversion
1169  output: float sum(instlumi)
1170  Note: the output is the raw result, need to apply LS length in time(sec)
1171  '''
1172  result=[]
1173  queryHandle.addToTableList(nameDealer.lumisummaryTableName())
1174  queryCondition=coral.AttributeList()
1175  queryCondition.extend('runnum','unsigned int')
1176  queryCondition.extend('lumiversion','string')
1177 
1178  queryCondition['runnum'].setData(int(runnum))
1179  queryCondition['lumiversion'].setData(lumiversion)
1180  queryHandle.addToOutputList('INSTLUMI','instlumi')
1181  conditionstring='RUNNUM=:runnum and LUMIVERSION=:lumiversion'
1182  if beamstatus and len(beamstatus)!=0:
1183  conditionstring=conditionstring+' and BEAMSTATUS=:beamstatus'
1184  queryCondition.extend('beamstatus','string')
1185  queryCondition['beamstatus'].setData(beamstatus)
1186  if beamenergy and beamenergy!=0.0:
1187  minBeamenergy=float(beamenergy*(1.0-beamenergyfluctuation))
1188  maxBeamenergy=float(beamenergy*(1.0+beamenergyfluctuation))
1189  conditionstring=conditionstring+' and BEAMENERGY>:minBeamenergy and BEAMENERGY<:maxBeamenergy'
1190  queryCondition.extend('minBeamenergy','float')
1191  queryCondition.extend('maxBeamenergy','float')
1192  queryCondition['minBeamenergy'].setData(float(minBeamenergy))
1193  queryCondition['maxBeamenergy'].setData(float(maxBeamenergy))
1194  queryHandle.setCondition(conditionstring,queryCondition)
1195  queryResult=coral.AttributeList()
1196  queryResult.extend('instlumi','float')
1197  queryHandle.defineOutput(queryResult)
1198  cursor=queryHandle.execute()
1199  while next(cursor):
1200  instlumi=cursor.currentRow()['instlumi'].data()
1201  if instlumi:
1202  if finecorrections:
1203  instlumi=lumiCorrections.applyfinecorrection(instlumi,finecorrections[0],finecorrections[1],finecorrections[2])
1204  result.append(instlumi)
1205  if result:
1206  return sum(result)
1207  else:
1208  return 0.0
1209 
def lumisummaryTableName()
Definition: nameDealer.py:25
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumisumByrun(queryHandle, runnum, lumiversion, beamstatus=None, beamenergy=None, beamenergyfluctuation=0.09, finecorrections=None)
def lumiQueryAPI.lumisummaryByrun (   queryHandle,
  runnum,
  lumiversion,
  beamstatus = None,
  beamenergy = None,
  beamenergyfluctuation = 0.09,
  finecorrections = None 
)
one can impose beamstatus, beamenergy selections at the SQL query level or process them later from the general result
select cmslsnum,instlumi,numorbit,startorbit,beamstatus,beamenery from lumisummary where runnum=:runnum and lumiversion=:lumiversion order by startorbit;
output: [[cmslsnum,instlumi,numorbit,startorbit,beamstatus,beamenergy,cmsalive]]
Note: the non-cmsalive LS are included in the result

Definition at line 1105 of file lumiQueryAPI.py.

References data, objects.autophobj.float, createfilelist.int, nameDealer.lumisummaryTableName(), and GetRecoTauVFromDQM_MC_cff.next.

1105 def lumisummaryByrun(queryHandle,runnum,lumiversion,beamstatus=None,beamenergy=None,beamenergyfluctuation=0.09,finecorrections=None):
1106  '''
1107  one can impose beamstatus, beamenergy selections at the SQL query level or process them later from the general result
1108  select cmslsnum,instlumi,numorbit,startorbit,beamstatus,beamenery from lumisummary where runnum=:runnum and lumiversion=:lumiversion order by startorbit;
1109  output: [[cmslsnum,instlumi,numorbit,startorbit,beamstatus,beamenergy,cmsalive]]
1110  Note: the non-cmsalive LS are included in the result
1111  '''
1112  result=[]
1113  queryHandle.addToTableList(nameDealer.lumisummaryTableName())
1114  queryCondition=coral.AttributeList()
1115  queryCondition.extend('runnum','unsigned int')
1116  queryCondition.extend('lumiversion','string')
1117  conditionstring='RUNNUM=:runnum and LUMIVERSION=:lumiversion'
1118  queryCondition['runnum'].setData(int(runnum))
1119  queryCondition['lumiversion'].setData(lumiversion)
1120  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1121  queryHandle.addToOutputList('INSTLUMI','instlumi')
1122  queryHandle.addToOutputList('NUMORBIT','numorbit')
1123  queryHandle.addToOutputList('STARTORBIT','startorbit')
1124  queryHandle.addToOutputList('BEAMSTATUS','beamstatus')
1125  queryHandle.addToOutputList('BEAMENERGY','beamenergy')
1126  queryHandle.addToOutputList('CMSALIVE','cmsalive')
1127  if beamstatus and len(beamstatus)!=0:
1128  conditionstring=conditionstring+' and BEAMSTATUS=:beamstatus'
1129  queryCondition.extend('beamstatus','string')
1130  queryCondition['beamstatus'].setData(beamstatus)
1131  if beamenergy:
1132  minBeamenergy=float(beamenergy*(1.0-beamenergyfluctuation))
1133  maxBeamenergy=float(beamenergy*(1.0+beamenergyfluctuation))
1134  conditionstring=conditionstring+' and BEAMENERGY>:minBeamenergy and BEAMENERGY<:maxBeamenergy'
1135  queryCondition.extend('minBeamenergy','float')
1136  queryCondition.extend('maxBeamenergy','float')
1137  queryCondition['minBeamenergy'].setData(float(minBeamenergy))
1138  queryCondition['maxBeamenergy'].setData(float(maxBeamenergy))
1139  queryResult=coral.AttributeList()
1140  queryResult.extend('cmslsnum','unsigned int')
1141  queryResult.extend('instlumi','float')
1142  queryResult.extend('numorbit','unsigned int')
1143  queryResult.extend('startorbit','unsigned int')
1144  queryResult.extend('beamstatus','string')
1145  queryResult.extend('beamenergy','float')
1146  queryResult.extend('cmsalive','unsigned int')
1147  queryHandle.defineOutput(queryResult)
1148  queryHandle.setCondition(conditionstring,queryCondition)
1149  queryHandle.addToOrderList('startorbit')
1150  cursor=queryHandle.execute()
1151  while next(cursor):
1152  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1153  instlumi=cursor.currentRow()['instlumi'].data()
1154  if finecorrections:
1155  instlumi=lumiCorrections.applyfinecorrection(instlumi,finecorrections[0],finecorrections[1],finecorrections[2])
1156  numorbit=cursor.currentRow()['numorbit'].data()
1157  startorbit=cursor.currentRow()['startorbit'].data()
1158  beamstatus=cursor.currentRow()['beamstatus'].data()
1159  beamenergy=cursor.currentRow()['beamenergy'].data()
1160  cmsalive=cursor.currentRow()['cmsalive'].data()
1161  result.append([cmslsnum,instlumi,numorbit,startorbit,beamstatus,beamenergy,cmsalive])
1162  return result
1163 
def lumisummaryTableName()
Definition: nameDealer.py:25
def lumisummaryByrun(queryHandle, runnum, lumiversion, beamstatus=None, beamenergy=None, beamenergyfluctuation=0.09, finecorrections=None)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.lumisummarytrgbitzeroByrun (   queryHandle,
  runnum,
  lumiversion,
  beamstatus = None,
  beamenergy = None,
  beamenergyfluctuation = 0.09,
  finecorrections = None 
)
select l.cmslsnum,l.instlumi,l.numorbit,l.startorbit,l.beamstatus,l.beamenery,t.trgcount,t.deadtime,t.bitname,t.prescale from trg t,lumisummary l where t.bitnum=:bitnum and l.runnum=:runnum and l.lumiversion=:lumiversion and l.runnum=t.runnum and t.cmslsnum=l.cmslsnum; 
Everything you ever need to know about bitzero and avg luminosity. Since we do not know if joint query is better of sperate, support both.
output: {cmslsnum:[instlumi,numorbit,startorbit,beamstatus,beamenergy,bitzerocount,deadtime,bitname,prescale]}
Note: only cmsalive LS are included in the result. Therefore, this function cannot be used for calculating delivered!

Definition at line 1246 of file lumiQueryAPI.py.

References data, objects.autophobj.float, createfilelist.int, nameDealer.lumisummaryTableName(), GetRecoTauVFromDQM_MC_cff.next, and nameDealer.trgTableName().

1246 def lumisummarytrgbitzeroByrun(queryHandle,runnum,lumiversion,beamstatus=None,beamenergy=None,beamenergyfluctuation=0.09,finecorrections=None):
1247  '''
1248  select l.cmslsnum,l.instlumi,l.numorbit,l.startorbit,l.beamstatus,l.beamenery,t.trgcount,t.deadtime,t.bitname,t.prescale from trg t,lumisummary l where t.bitnum=:bitnum and l.runnum=:runnum and l.lumiversion=:lumiversion and l.runnum=t.runnum and t.cmslsnum=l.cmslsnum;
1249  Everything you ever need to know about bitzero and avg luminosity. Since we do not know if joint query is better of sperate, support both.
1250  output: {cmslsnum:[instlumi,numorbit,startorbit,beamstatus,beamenergy,bitzerocount,deadtime,bitname,prescale]}
1251  Note: only cmsalive LS are included in the result. Therefore, this function cannot be used for calculating delivered!
1252  '''
1253  result={}
1254  queryHandle.addToTableList(nameDealer.trgTableName(),'t')
1255  queryHandle.addToTableList(nameDealer.lumisummaryTableName(),'l')
1256  queryCondition=coral.AttributeList()
1257  queryCondition.extend('bitnum','unsigned int')
1258  queryCondition.extend('runnum','unsigned int')
1259  queryCondition.extend('lumiversion','string')
1260  queryCondition['bitnum'].setData(int(0))
1261  queryCondition['runnum'].setData(int(runnum))
1262  queryCondition['lumiversion'].setData(lumiversion)
1263 
1264  queryHandle.addToOutputList('l.CMSLSNUM','cmslsnum')
1265  queryHandle.addToOutputList('l.INSTLUMI','instlumi')
1266  queryHandle.addToOutputList('l.NUMORBIT','numorbit')
1267  queryHandle.addToOutputList('l.STARTORBIT','startorbit')
1268  queryHandle.addToOutputList('l.BEAMSTATUS','beamstatus')
1269  queryHandle.addToOutputList('l.BEAMENERGY','beamenergy')
1270  queryHandle.addToOutputList('t.TRGCOUNT','trgcount')
1271  queryHandle.addToOutputList('t.DEADTIME','deadtime')
1272  queryHandle.addToOutputList('t.BITNAME','bitname')
1273  queryHandle.addToOutputList('t.PRESCALE','prescale')
1274  conditionstring='t.BITNUM=:bitnum and l.RUNNUM=:runnum and l.LUMIVERSION=:lumiversion and l.RUNNUM=t.RUNNUM and t.CMSLSNUM=l.CMSLSNUM'
1275  if beamstatus and len(beamstatus)!=0:
1276  conditionstring=conditionstring+' and l.BEAMSTATUS=:beamstatus'
1277  queryCondition.extend('beamstatus','string')
1278  queryCondition['beamstatus'].setData(beamstatus)
1279  if beamenergy and beamenergy!=0.0:
1280  minBeamenergy=float(beamenergy*(1-beamenergyfluctuation))
1281  maxBeamenergy=float(beamenergy*(1+beamenergyfluctuation))
1282  conditionstring=conditionstring+' and l.BEAMENERGY>:minBeamenergy and l.BEAMENERGY<:maxBeamenergy'
1283  queryCondition.extend('minBeamenergy','float')
1284  queryCondition.extend('maxBeamenergy','float')
1285  queryCondition['minBeamenergy'].setData(float(minBeamenergy))
1286  queryCondition['maxBeamenergy'].setData(float(maxBeamenergy))
1287  queryHandle.setCondition(conditionstring,queryCondition)
1288  queryResult=coral.AttributeList()
1289  queryResult.extend('cmslsnum','unsigned int')
1290  queryResult.extend('instlumi','float')
1291  queryResult.extend('numorbit','unsigned int')
1292  queryResult.extend('startorbit','unsigned int')
1293  queryResult.extend('beamstatus','string')
1294  queryResult.extend('beamenergy','float')
1295  queryResult.extend('trgcount','unsigned int')
1296  queryResult.extend('deadtime','unsigned int')
1297  queryResult.extend('bitname','string')
1298  queryResult.extend('prescale','unsigned int')
1299  queryHandle.defineOutput(queryResult)
1300  cursor=queryHandle.execute()
1301  while next(cursor):
1302  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1303  instlumi=cursor.currentRow()['instlumi'].data()
1304  if finecorrections:
1305  instlumi=lumiCorrections.applyfinecorrection(instlumi,finecorrections[0],finecorrections[1],finecorrections[2])
1306  numorbit=cursor.currentRow()['numorbit'].data()
1307  startorbit=cursor.currentRow()['startorbit'].data()
1308  beamstatus=cursor.currentRow()['beamstatus'].data()
1309  beamenergy=cursor.currentRow()['beamenergy'].data()
1310  trgcount=cursor.currentRow()['trgcount'].data()
1311  deadtime=cursor.currentRow()['deadtime'].data()
1312  bitname=cursor.currentRow()['bitname'].data()
1313  prescale=cursor.currentRow()['prescale'].data()
1314  if cmslsnum not in result:
1315  result[cmslsnum]=[instlumi,numorbit,startorbit,beamstatus,beamenergy,trgcount,deadtime,bitname,prescale]
1316  return result
1317 
def trgTableName()
Definition: nameDealer.py:52
def lumisummaryTableName()
Definition: nameDealer.py:25
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumisummarytrgbitzeroByrun(queryHandle, runnum, lumiversion, beamstatus=None, beamenergy=None, beamenergyfluctuation=0.09, finecorrections=None)
def lumiQueryAPI.mergeXingLumi (   triplet,
  xingLumiDict 
)
Given general xing information and a xingLumiDict, the xing
luminosity information is merged with the general information

Definition at line 879 of file lumiQueryAPI.py.

References createfilelist.int.

879 def mergeXingLumi (triplet, xingLumiDict):
880  '''Given general xing information and a xingLumiDict, the xing
881  luminosity information is merged with the general information'''
882  runNumber = triplet[0]
883  deadTable = triplet[2]
884  for lumi, lumiList in six.iteritems(deadTable):
885  key = ( int(runNumber), int(lumi) )
886  xingLumiValues = xingLumiDict.get (key)
887  if xingLumiValues:
888  lumiList.append( flatten (xingLumiValues) )
889 
890 
def mergeXingLumi(triplet, xingLumiDict)
def lumiQueryAPI.printDeliveredLumi (   lumidata,
  mode 
)

Definition at line 399 of file lumiQueryAPI.py.

References edm.print().

399 def printDeliveredLumi (lumidata, mode):
400  labels = [ ('Run', 'Delivered LS', 'Delivered'+u' (/\u03bcb)'.encode ('utf-8'), 'Beam Mode')]
401  print(tablePrinter.indent (labels+lumidata, hasHeader = True, separateRows = False,
402  prefix = '| ', postfix = ' |', justify = 'right',
403  delim = ' | ', wrapfunc = lambda x: wrap_onspace (x, 20) ))
404 
def printDeliveredLumi(lumidata, mode)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def lumiQueryAPI.printOverviewData (   delivered,
  recorded,
  hltpath = '' 
)

Definition at line 686 of file lumiQueryAPI.py.

References relativeConstraints.keys, and edm.print().

686 def printOverviewData (delivered, recorded, hltpath = ''):
687  if len (hltpath) == 0 or hltpath == 'all':
688  toprowlabels = [ ('Run', 'Delivered LS', 'Delivered'+u' (/\u03bcb)'.encode ('utf-8'), 'Selected LS', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8') )]
689  lastrowlabels = [ ('Delivered LS', 'Delivered'+u' (/\u03bcb)'.encode ('utf-8'), 'Selected LS', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8') ) ]
690  else:
691  toprowlabels = [ ('Run', 'Delivered LS', 'Delivered'+u' (/\u03bcb)'.encode ('utf-8'), 'Selected LS', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8'), 'Effective'+u' (/\u03bcb) '.encode ('utf-8')+hltpath )]
692  lastrowlabels = [ ('Delivered LS', 'Delivered'+u' (/\u03bcb)'.encode ('utf-8'), 'Selected LS', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8'), 'Effective '+u' (/\u03bcb) '.encode ('utf-8')+hltpath)]
693  datatable = []
694  totaldata = []
695  totalDeliveredLS = 0
696  totalSelectedLS = 0
697  totalDelivered = 0.0
698  totalRecorded = 0.0
699  totalRecordedInPath = 0.0
700  totaltable = []
701  for runidx, deliveredrowdata in enumerate (delivered):
702  rowdata = []
703  rowdata += [deliveredrowdata[0], deliveredrowdata[1], deliveredrowdata[2]]
704  if deliveredrowdata[1] == 'N/A': #run does not exist
705  if hltpath != '' and hltpath != 'all':
706  rowdata += ['N/A', 'N/A', 'N/A']
707  else:
708  rowdata += ['N/A', 'N/A']
709  datatable.append (rowdata)
710  continue
711  totalDeliveredLS += int (deliveredrowdata[1])
712  totalDelivered += float (deliveredrowdata[2])
713  selectedls = recorded[runidx][2].keys()
714  #print 'runidx ', runidx, deliveredrowdata
715  #print 'selectedls ', selectedls
716  if len (selectedls) == 0:
717  selectedlsStr = '[]'
718  recordedLumi = 0
719  if hltpath != '' and hltpath != 'all':
720  rowdata += [selectedlsStr, 'N/A', 'N/A']
721  else:
722  rowdata += [selectedlsStr, 'N/A']
723  else:
724  selectedlsStr = splitlistToRangeString (selectedls)
725  recordedLumi = calculateTotalRecorded (recorded[runidx][2])
726  lumiinPaths = calculateEffective (recorded[runidx][1], recordedLumi)
727  if hltpath != '' and hltpath != 'all':
728  if hltpath in lumiinPaths:
729  rowdata += [selectedlsStr, '%.3f'% (recordedLumi), '%.3f'% (lumiinPaths[hltpath])]
730  totalRecordedInPath += lumiinPaths[hltpath]
731  else:
732  rowdata += [selectedlsStr, '%.3f'% (recordedLumi), 'N/A']
733  else:
734  #rowdata += [selectedlsStr, '%.3f'% (recordedLumi), '%.3f'% (recordedLumi)]
735  rowdata += [selectedlsStr, '%.3f'% (recordedLumi)]
736  totalSelectedLS += len (selectedls)
737  totalRecorded += recordedLumi
738  datatable.append (rowdata)
739 
740  if hltpath != '' and hltpath != 'all':
741  totaltable = [[str (totalDeliveredLS), '%.3f'% (totalDelivered), str (totalSelectedLS),
742  '%.3f'% (totalRecorded), '%.3f'% (totalRecordedInPath)]]
743  else:
744  totaltable = [[str (totalDeliveredLS), '%.3f'% (totalDelivered), str (totalSelectedLS),
745  '%.3f'% (totalRecorded)]]
746  print(tablePrinter.indent (toprowlabels+datatable, hasHeader = True, separateRows = False, prefix = '| ',
747  postfix = ' |', justify = 'right', delim = ' | ',
748  wrapfunc = lambda x: wrap_onspace (x, 20)))
749  print(' == = Total : ')
750  print(tablePrinter.indent (lastrowlabels+totaltable, hasHeader = True, separateRows = False, prefix = '| ',
751  postfix = ' |', justify = 'right', delim = ' | ',
752  wrapfunc = lambda x: wrap_onspace (x, 20)))
753 
754 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def printOverviewData(delivered, recorded, hltpath='')
def lumiQueryAPI.printPerLSLumi (   lumidata,
  isVerbose = False 
)
input lumidata  [['runnumber', 'trgtable{}', 'deadtable{}']]
deadtable {lsnum:[deadtime, instlumi, bit_0, norbits,prescale]}

Definition at line 479 of file lumiQueryAPI.py.

References edm.print().

479 def printPerLSLumi (lumidata, isVerbose = False):
480  '''
481  input lumidata [['runnumber', 'trgtable{}', 'deadtable{}']]
482  deadtable {lsnum:[deadtime, instlumi, bit_0, norbits,prescale]}
483  '''
484  datatoprint = []
485  totalrow = []
486  labels = [ ('Run', 'LS', 'Delivered', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8'))]
487  lastrowlabels = [ ('Selected LS', 'Delivered'+u' (/\u03bcb)'.encode ('utf-8'), 'Recorded'+u' (/\u03bcb)'.encode ('utf-8'))]
488  totalDeliveredLS = 0
489  totalSelectedLS = 0
490  totalDelivered = 0.0
491  totalRecorded = 0.0
492 
493  for perrundata in lumidata:
494  runnumber = perrundata[0]
495  deadtable = perrundata[2]
496  lumiresult = lsBylsLumi (deadtable)
497  totalSelectedLS = totalSelectedLS+len (deadtable)
498  for lsnum, dataperls in lumiresult.items():
499  rowdata = []
500  if len (dataperls) == 0:
501  rowdata += [str (runnumber), str (lsnum), 'N/A', 'N/A']
502  else:
503  rowdata += [str (runnumber), str (lsnum), '%.3f' % (dataperls[0]), '%.3f' % (dataperls[1])]
504  totalDelivered = totalDelivered+dataperls[0]
505  totalRecorded = totalRecorded+dataperls[1]
506  datatoprint.append (rowdata)
507  totalrow.append ([str (totalSelectedLS), '%.3f'% (totalDelivered), '%.3f'% (totalRecorded)])
508  print(' == = ')
509  print(tablePrinter.indent (labels+datatoprint, hasHeader = True, separateRows = False, prefix = '| ',
510  postfix = ' |', justify = 'right', delim = ' | ',
511  wrapfunc = lambda x: wrap_onspace_strict (x, 22)))
512  print(' == = Total : ')
513  print(tablePrinter.indent (lastrowlabels+totalrow, hasHeader = True, separateRows = False, prefix = '| ',
514  postfix = ' |', justify = 'right', delim = ' | ',
515  wrapfunc = lambda x: wrap_onspace (x, 20)))
516 
517 
def printPerLSLumi(lumidata, isVerbose=False)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def lumiQueryAPI.printRecordedLumi (   lumidata,
  isVerbose = False,
  hltpath = '' 
)

Definition at line 536 of file lumiQueryAPI.py.

References edm.print().

536 def printRecordedLumi (lumidata, isVerbose = False, hltpath = ''):
537  datatoprint = []
538  totalrow = []
539  labels = [ ('Run', 'HLT path', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8'))]
540  lastrowlabels = [ ('Selected LS', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8'))]
541  if len (hltpath) != 0 and hltpath != 'all':
542  lastrowlabels = [ ('Selected LS', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8'),
543  'Effective '+u' (/\u03bcb) '.encode ('utf-8')+hltpath)]
544  if isVerbose:
545  labels = [ ('Run', 'HLT-path', 'L1-bit', 'L1-presc', 'HLT-presc', 'Recorded'+u' (/\u03bcb)'.encode ('utf-8'))]
546  totalSelectedLS = 0
547  totalRecorded = 0.0
548  totalRecordedInPath = 0.0
549 
550  for dataperRun in lumidata:
551  runnum = dataperRun[0]
552  if len (dataperRun[1]) == 0:
553  rowdata = []
554  rowdata += [str (runnum)]+2*['N/A']
555  datatoprint.append (rowdata)
556  continue
557  perlsdata = dataperRun[2]
558  totalSelectedLS = totalSelectedLS+len (perlsdata)
559  recordedLumi = 0.0
560  #norbits = perlsdata.values()[0][3]
561  recordedLumi = calculateTotalRecorded (perlsdata)
562  totalRecorded = totalRecorded+recordedLumi
563  trgdict = dataperRun[1]
564  effective = calculateEffective (trgdict, recordedLumi)
565  if hltpath in trgdict and hltpath in effective:
566  rowdata = []
567  l1bit = trgdict[hltpath][0]
568  if len (trgdict[hltpath]) != 3:
569  if not isVerbose:
570  rowdata += [str (runnum), hltpath, 'N/A']
571  else:
572  rowdata += [str (runnum), hltpath, l1bit, 'N/A', 'N/A', 'N/A']
573  else:
574  if not isVerbose:
575  rowdata += [str (runnum), hltpath, '%.3f'% (effective[hltpath])]
576  else:
577  hltprescale = trgdict[hltpath][1]
578  l1prescale = trgdict[hltpath][2]
579  rowdata += [str (runnum), hltpath, l1bit, str (l1prescale), str (hltprescale),
580  '%.3f'% (effective[hltpath])]
581  totalRecordedInPath = totalRecordedInPath+effective[hltpath]
582  datatoprint.append (rowdata)
583  continue
584 
585  for trg, trgdata in trgdict.items():
586  #print trg, trgdata
587  rowdata = []
588  if trg == trgdict.keys()[0]:
589  rowdata += [str (runnum)]
590  else:
591  rowdata += ['']
592  l1bit = trgdata[0]
593  if len (trgdata) == 3:
594  if not isVerbose:
595  rowdata += [trg, '%.3f'% (effective[trg])]
596  else:
597  hltprescale = trgdata[1]
598  l1prescale = trgdata[2]
599  rowdata += [trg, l1bit, str (l1prescale), str (hltprescale), '%.3f'% (effective[trg])]
600  else:
601  if not isVerbose:
602  rowdata += [trg, 'N/A']
603  else:
604  rowdata += [trg, l1bit, 'N/A', 'N/A', '%.3f'% (effective[trg])]
605  datatoprint.append (rowdata)
606  #print datatoprint
607  print(' == = ')
608  print(tablePrinter.indent (labels+datatoprint, hasHeader = True, separateRows = False, prefix = '| ',
609  postfix = ' |', justify = 'right', delim = ' | ',
610  wrapfunc = lambda x: wrap_onspace_strict (x, 22)))
611 
612  if len (hltpath) != 0 and hltpath != 'all':
613  totalrow.append ([str (totalSelectedLS), '%.3f'% (totalRecorded), '%.3f'% (totalRecordedInPath)])
614  else:
615  totalrow.append ([str (totalSelectedLS), '%.3f'% (totalRecorded)])
616  print(' == = Total : ')
617  print(tablePrinter.indent (lastrowlabels+totalrow, hasHeader = True, separateRows = False, prefix = '| ',
618  postfix = ' |', justify = 'right', delim = ' | ',
619  wrapfunc = lambda x: wrap_onspace (x, 20)))
620  if isVerbose:
621  deadtoprint = []
622  deadtimelabels = [ ('Run', 'Lumi section : Dead fraction')]
623 
624  for dataperRun in lumidata:
625  runnum = dataperRun[0]
626  if len (dataperRun[1]) == 0:
627  deadtoprint.append ([str (runnum), 'N/A'])
628  continue
629  perlsdata = dataperRun[2]
630  #print 'perlsdata 2 : ', perlsdata
631  deadT = getDeadfractions (perlsdata)
632  t = ''
633  for myls, de in deadT.items():
634  if de<0:
635  t += str (myls)+':nobeam '
636  else:
637  t += str (myls)+':'+'%.5f'% (de)+' '
638  deadtoprint.append ([str (runnum), t])
639  print(' == = ')
640  print(tablePrinter.indent (deadtimelabels+deadtoprint, hasHeader = True, separateRows = True, prefix = '| ',
641  postfix = ' |', justify = 'right', delim = ' | ',
642  wrapfunc = lambda x: wrap_onspace (x, 80)))
643 
644 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def printRecordedLumi(lumidata, isVerbose=False, hltpath='')
def lumiQueryAPI.recordedLumiForRange (   dbsession,
  parameters,
  inputRange,
  finecorrections = None 
)
Takes either single run as a string or dictionary of run ranges

Definition at line 103 of file lumiQueryAPI.py.

References createfilelist.int, mps_monitormerge.items, edm.print(), and recordedLumiForRun().

103 def recordedLumiForRange (dbsession, parameters, inputRange,finecorrections=None):
104  '''Takes either single run as a string or dictionary of run ranges'''
105  lumidata = []
106  if isinstance(inputRange,str):
107  run=int(inputRange)
108  if finecorrections and finecorrections[run]:
109  lumiDataPiece = recordedLumiForRun (dbsession, parameters,inputRange,lslist=None,finecorrections=finecorrections[run])
110  else:
111  lumiDataPiece = recordedLumiForRun(dbsession, parameters,run)
112  if parameters.lumiXing:
113  # get the xing information for the run
114  if finecorrections and finecorrections[run]:
115  xingLumiDict = xingLuminosityForRun (dbsession, inputRange,
116  parameters,finecorrections=finecorrections[run])
117  else:
118  xingLumiDict = xingLuminosityForRun (dbsession, inputRange,
119  parameters)
120  mergeXingLumi (lumiDataPiece, xingLumiDict)
121  lumidata.append (lumiDataPiece)
122  else:
123  # we want to collapse the lists so that every run is considered once.
124  runLsDict = {}
125  maxLumiSectionDict = {}
126  for (run, lslist) in sorted (inputRange.runsandls().items() ):
127  if(len(lslist)!=0):
128  maxLumiSectionDict[run] = max ( max (lslist),
129  maxLumiSectionDict.get(run,0) )
130  runLsDict.setdefault (run, []).append (lslist)
131  for run, metaLsList in sorted (six.iteritems(runLsDict)):
132  if parameters.verbose:
133  print("run", run)
134  runLumiData = []
135  for lslist in metaLsList:
136  if finecorrections and finecorrections[run]:
137  runLumiData.append( recordedLumiForRun (dbsession, parameters,run,lslist=lslist,finecorrections=finecorrections[run]) )
138 
139  else:
140  runLumiData.append( recordedLumiForRun (dbsession, parameters,run,lslist=lslist) )
141  if parameters.lumiXing:
142  # get the xing information once for the whole run
143  if finecorrections and finecorrections[run]:
144  xingLumiDict = xingLuminosityForRun (dbsession, run,
145  parameters,
146  maxLumiSection = \
147  maxLumiSectionDict[run],
148  finecorrections=finecorrections[run])
149  else:
150  xingLumiDict = xingLuminosityForRun (dbsession, run,
151  parameters,
152  maxLumiSection = \
153  maxLumiSectionDict[run])
154  # merge it with every piece of lumi data for this run
155  for lumiDataPiece in runLumiData:
156  mergeXingLumi (lumiDataPiece, xingLumiDict)
157  lumidata.append (lumiDataPiece)
158  else:
159  lumidata.extend( runLumiData )
160  return lumidata
161 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def recordedLumiForRange(dbsession, parameters, inputRange, finecorrections=None)
def recordedLumiForRun(dbsession, parameters, runnum, lslist=None, finecorrections=None)
def lumiQueryAPI.recordedLumiForRun (   dbsession,
  parameters,
  runnum,
  lslist = None,
  finecorrections = None 
)
lslist = [] means take none in the db
lslist = None means to take all in the db
output: ['runnumber', 'trgtable{}', 'deadtable{}']

Definition at line 220 of file lumiQueryAPI.py.

References nameDealer.cmsrunsummaryTableName(), data, nameDealer.hltTableName(), mps_monitormerge.items, nameDealer.lumisummaryTableName(), GetRecoTauVFromDQM_MC_cff.next, edm.print(), nameDealer.trghltMapTableName(), and nameDealer.trgTableName().

Referenced by recordedLumiForRange().

220 def recordedLumiForRun (dbsession, parameters, runnum, lslist=None,finecorrections=None):
221  """
222  lslist = [] means take none in the db
223  lslist = None means to take all in the db
224  output: ['runnumber', 'trgtable{}', 'deadtable{}']
225  """
226  recorded = 0.0
227  lumidata = [] #[runnumber, trgtable, deadtable]
228  trgtable = {} #{hltpath:[l1seed, hltprescale, l1prescale]}
229  deadtable = {} #{lsnum:[deadtime, instlumi, bit_0, norbits,bitzero_prescale]}
230  lumidata.append (runnum)
231  lumidata.append (trgtable)
232  lumidata.append (deadtable)
233  collectedseeds = [] #[ (hltpath, l1seed)]
234  conditionstring='trghltmap.HLTKEY = cmsrunsummary.HLTKEY AND cmsrunsummary.RUNNUM = :runnumber'
235  try:
236  dbsession.transaction().start (True)
237  schema = dbsession.nominalSchema()
238  query = schema.newQuery()
239  query.addToTableList (nameDealer.cmsrunsummaryTableName(), 'cmsrunsummary')
240  query.addToTableList (nameDealer.trghltMapTableName(), 'trghltmap')#small table first
241  queryCondition = coral.AttributeList()
242  queryCondition.extend ("runnumber", "unsigned int")
243  queryCondition["runnumber"].setData (int (runnum))
244  query.setCondition (conditionstring,queryCondition)
245  query.addToOutputList ("trghltmap.HLTPATHNAME", "hltpathname")
246  query.addToOutputList ("trghltmap.L1SEED", "l1seed")
247  result = coral.AttributeList()
248  result.extend ("hltpathname", "string")
249  result.extend ("l1seed", "string")
250  query.defineOutput (result)
251  cursor = query.execute()
252  while next(cursor):
253  hltpathname = cursor.currentRow()["hltpathname"].data()
254  l1seed = cursor.currentRow()["l1seed"].data()
255  collectedseeds.append ( (hltpathname, l1seed))
256  #print 'collectedseeds ', collectedseeds
257  del query
258  dbsession.transaction().commit()
259  #loop over hltpath
260  for (hname, sname) in collectedseeds:
261  l1bitname = hltTrgSeedMapper.findUniqueSeed (hname, sname)
262  #print 'found unque seed ', hname, l1bitname
263  if l1bitname:
264  lumidata[1][hname] = []
265  lumidata[1][hname].append (l1bitname.replace ('\"', ''))
266  dbsession.transaction().start (True)
267  schema = dbsession.nominalSchema()
268  hltprescQuery = schema.tableHandle (nameDealer.hltTableName()).newQuery()
269  hltprescQuery.addToOutputList ("PATHNAME", "hltpath")
270  hltprescQuery.addToOutputList ("PRESCALE", "hltprescale")
271  hltprescCondition = coral.AttributeList()
272  hltprescCondition.extend ('runnumber', 'unsigned int')
273  hltprescCondition.extend ('cmslsnum', 'unsigned int')
274  hltprescCondition.extend ('inf', 'unsigned int')
275  hltprescResult = coral.AttributeList()
276  hltprescResult.extend ('hltpath', 'string')
277  hltprescResult.extend ('hltprescale', 'unsigned int')
278  hltprescQuery.defineOutput (hltprescResult)
279  hltprescCondition['runnumber'].setData (int (runnum))
280  hltprescCondition['cmslsnum'].setData (1)
281  hltprescCondition['inf'].setData (0)
282  hltprescQuery.setCondition ("RUNNUM = :runnumber and CMSLSNUM = :cmslsnum and PRESCALE != :inf",hltprescCondition)
283  cursor = hltprescQuery.execute()
284  while next(cursor):
285  hltpath = cursor.currentRow()['hltpath'].data()
286  hltprescale = cursor.currentRow()['hltprescale'].data()
287  if hltpath in lumidata[1]:
288  lumidata[1][hltpath].append (hltprescale)
289 
290  cursor.close()
291  del hltprescQuery
292  dbsession.transaction().commit()
293  dbsession.transaction().start (True)
294  schema = dbsession.nominalSchema()
295  query = schema.newQuery()
296  query.addToTableList (nameDealer.trgTableName(), 'trg')
297  query.addToTableList (nameDealer.lumisummaryTableName(), 'lumisummary')#small table first--right-most
298  queryCondition = coral.AttributeList()
299  queryCondition.extend ("runnumber", "unsigned int")
300  queryCondition.extend ("lumiversion", "string")
301  queryCondition["runnumber"].setData (int (runnum))
302  queryCondition["lumiversion"].setData (parameters.lumiversion)
303  conditionstring='lumisummary.RUNNUM =:runnumber and lumisummary.LUMIVERSION =:lumiversion AND lumisummary.CMSLSNUM=trg.CMSLSNUM and lumisummary.RUNNUM=trg.RUNNUM'
304  if len(parameters.beammode)!=0:
305  conditionstring=conditionstring+' and lumisummary.BEAMSTATUS=:beamstatus'
306  queryCondition.extend('beamstatus','string')
307  queryCondition['beamstatus'].setData(parameters.beammode)
308  query.setCondition(conditionstring,queryCondition)
309  query.addToOutputList ("lumisummary.CMSLSNUM", "cmsls")
310  query.addToOutputList ("lumisummary.INSTLUMI", "instlumi")
311  query.addToOutputList ("lumisummary.NUMORBIT", "norbits")
312  query.addToOutputList ("trg.TRGCOUNT", "trgcount")
313  query.addToOutputList ("trg.BITNAME", "bitname")
314  query.addToOutputList ("trg.DEADTIME", "trgdeadtime")
315  query.addToOutputList ("trg.PRESCALE", "trgprescale")
316  query.addToOutputList ("trg.BITNUM", "trgbitnum")
317 
318  result = coral.AttributeList()
319  result.extend ("cmsls", "unsigned int")
320  result.extend ("instlumi", "float")
321  result.extend ("norbits", "unsigned int")
322  result.extend ("trgcount", "unsigned int")
323  result.extend ("bitname", "string")
324  result.extend ("trgdeadtime", "unsigned long long")
325  result.extend ("trgprescale", "unsigned int")
326  result.extend ("trgbitnum", "unsigned int")
327  trgprescalemap = {}
328  query.defineOutput (result)
329  cursor = query.execute()
330  while next(cursor):
331  cmsls = cursor.currentRow()["cmsls"].data()
332  instlumi = cursor.currentRow()["instlumi"].data()*parameters.norm
333  if finecorrections:
334  instlumi=lumiCorrections.applyfinecorrection(instlumi,finecorrections[0],finecorrections[1],finecorrections[2])
335  norbits = cursor.currentRow()["norbits"].data()
336  trgcount = cursor.currentRow()["trgcount"].data()
337  trgbitname = cursor.currentRow()["bitname"].data()
338  trgdeadtime = cursor.currentRow()["trgdeadtime"].data()
339  trgprescale = cursor.currentRow()["trgprescale"].data()
340  trgbitnum = cursor.currentRow()["trgbitnum"].data()
341  if cmsls == 1:
342  if trgbitname not in trgprescalemap:
343  trgprescalemap[trgbitname] = trgprescale
344  if trgbitnum == 0:
345  if cmsls not in deadtable:
346  deadtable[cmsls] = []
347  deadtable[cmsls].append (trgdeadtime)
348  deadtable[cmsls].append (instlumi)
349  deadtable[cmsls].append (trgcount)
350  deadtable[cmsls].append (norbits)
351  deadtable[cmsls].append (trgprescale)
352  cursor.close()
353  del query
354  dbsession.transaction().commit()
355 
356  #
357  #consolidate results
358  #
359  #trgtable
360  #print 'trgprescalemap', trgprescalemap
361  #print lumidata[1]
362  for hpath, trgdataseq in lumidata[1].items():
363  bitn = trgdataseq[0]
364  if bitn in trgprescalemap and len (trgdataseq) == 2:
365  lumidata[1][hpath].append (trgprescalemap[bitn])
366  #filter selected cmsls
367  lumidata[2] = filterDeadtable (deadtable, lslist)
368  if not parameters.noWarnings:
369  if len(lumidata[2])!=0:
370  for lumi, deaddata in lumidata[2].items():
371  if deaddata[1] == 0.0 and deaddata[2]!=0 and deaddata[0]!=0:
372  print('[Warning] : run %s :ls %d has 0 instlumi but trigger has data' % (runnum, lumi))
373  if (deaddata[2] == 0 or deaddata[0] == 0) and deaddata[1]!=0.0:
374  print('[Warning] : run %s :ls %d has 0 dead counts or 0 zerobias bit counts, but inst!=0' % (runnum, lumi))
375  #print 'lumidata[2] ', lumidata[2]
376  except Exception as e:
377  print(str (e))
378  dbsession.transaction().rollback()
379  del dbsession
380  #print 'before return lumidata ', lumidata
381  ## if parameters.lumiXing:
382  ## xingLumiDict = xingLuminosityForRun (dbsession, runnum, parameters)
383  ## mergeXingLumi (lumidata, xingLumiDict)
384  return lumidata
385 
386 
def trgTableName()
Definition: nameDealer.py:52
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def lumisummaryTableName()
Definition: nameDealer.py:25
def recordedLumiForRun(dbsession, parameters, runnum, lslist=None, finecorrections=None)
def hltTableName()
Definition: nameDealer.py:55
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def cmsrunsummaryTableName()
Definition: nameDealer.py:16
def trghltMapTableName()
Definition: nameDealer.py:76
def lumiQueryAPI.runsByfillrange (   queryHandle,
  minFill,
  maxFill 
)
find all runs in the fill range inclusive
select runnum,fillnum from cmsrunsummary where fillnum>=:minFill and fillnum<=:maxFill
output: fillDict={fillnum:[runlist]}

Definition at line 1708 of file lumiQueryAPI.py.

References mps_setup.append, nameDealer.cmsrunsummaryTableName(), data, createfilelist.int, and GetRecoTauVFromDQM_MC_cff.next.

1708 def runsByfillrange(queryHandle,minFill,maxFill):
1709  '''
1710  find all runs in the fill range inclusive
1711  select runnum,fillnum from cmsrunsummary where fillnum>=:minFill and fillnum<=:maxFill
1712  output: fillDict={fillnum:[runlist]}
1713  '''
1714  result={}
1715  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
1716  queryCondition=coral.AttributeList()
1717  queryCondition.extend('minFill','unsigned int')
1718  queryCondition.extend('maxFill','unsigned int')
1719  queryCondition['minFill'].setData(int(minFill))
1720  queryCondition['maxFill'].setData(int(maxFill))
1721  queryHandle.addToOutputList('RUNNUM','runnum')
1722  queryHandle.addToOutputList('FILLNUM','fillnum')
1723  queryHandle.setCondition('FILLNUM>=:minFill and FILLNUM<=:maxFill',queryCondition)
1724  queryResult=coral.AttributeList()
1725  queryResult.extend('runnum','unsigned int')
1726  queryResult.extend('fillnum','unsigned int')
1727  queryHandle.defineOutput(queryResult)
1728  cursor=queryHandle.execute()
1729  while next(cursor):
1730  runnum=cursor.currentRow()['runnum'].data()
1731  fillnum=cursor.currentRow()['fillnum'].data()
1732  if fillnum not in result:
1733  result[fillnum]=[runnum]
1734  else:
1735  result[fillnum].append(runnum)
1736  return result
1737 
def runsByfillrange(queryHandle, minFill, maxFill)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def cmsrunsummaryTableName()
Definition: nameDealer.py:16
def lumiQueryAPI.runsByTimerange (   queryHandle,
  minTime,
  maxTime 
)
find all runs in the time range inclusive
the selected run must have started after minTime and finished by maxTime
select runnum,to_char(startTime),to_char(stopTime) from cmsrunsummary where startTime>=timestamp(minTime) and stopTime<=timestamp(maxTime);
input: minTime,maxTime in python obj datetime.datetime
output: {runnum:[starttime,stoptime]} return in python obj datetime.datetime

Definition at line 1738 of file lumiQueryAPI.py.

References nameDealer.cmsrunsummaryTableName(), data, and GetRecoTauVFromDQM_MC_cff.next.

1738 def runsByTimerange(queryHandle,minTime,maxTime):
1739  '''
1740  find all runs in the time range inclusive
1741  the selected run must have started after minTime and finished by maxTime
1742  select runnum,to_char(startTime),to_char(stopTime) from cmsrunsummary where startTime>=timestamp(minTime) and stopTime<=timestamp(maxTime);
1743  input: minTime,maxTime in python obj datetime.datetime
1744  output: {runnum:[starttime,stoptime]} return in python obj datetime.datetime
1745  '''
1746  t=lumiTime.lumiTime()
1747  result={}
1748  coralminTime=coral.TimeStamp(minTime.year,minTime.month,minTime.day,minTime.hour,minTime.minute,minTime.second,0)
1749  coralmaxTime=coral.TimeStamp(maxTime.year,maxTime.month,maxTime.day,maxTime.hour,maxTime.minute,maxTime.second,0)
1750  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
1751  queryCondition=coral.AttributeList()
1752  queryCondition.extend('minTime','time stamp')
1753  queryCondition.extend('maxTime','time stamp')
1754  queryCondition['minTime'].setData(coralminTime)
1755  queryCondition['maxTime'].setData(coralmaxTime)
1756  queryHandle.addToOutputList('RUNNUM','runnum')
1757  queryHandle.addToOutputList('TO_CHAR(STARTTIME,\''+t.coraltimefm+'\')','starttime')
1758  queryHandle.addToOutputList('TO_CHAR(STOPTIME,\''+t.coraltimefm+'\')','stoptime')
1759  queryHandle.setCondition('STARTTIME>=:minTime and STOPTIME<=:maxTime',queryCondition)
1760  queryResult=coral.AttributeList()
1761  queryResult.extend('runnum','unsigned int')
1762  queryResult.extend('starttime','string')
1763  queryResult.extend('stoptime','string')
1764  queryHandle.defineOutput(queryResult)
1765  cursor=queryHandle.execute()
1766  while next(cursor):
1767  runnum=cursor.currentRow()['runnum'].data()
1768  starttimeStr=cursor.currentRow()['starttime'].data()
1769  stoptimeStr=cursor.currentRow()['stoptime'].data()
1770  if runnum not in result:
1771  result[runnum]=[t.StrToDatetime(starttimeStr),t.StrToDatetime(stoptimeStr)]
1772  return result
1773 
def runsByTimerange(queryHandle, minTime, maxTime)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def cmsrunsummaryTableName()
Definition: nameDealer.py:16
def lumiQueryAPI.runsummaryByrun (   queryHandle,
  runnum 
)
select fillnum,sequence,hltkey,to_char(starttime),to_char(stoptime) from cmsrunsummary where runnum=:runnum
output: [fillnum,sequence,hltkey,starttime,stoptime]

Definition at line 1069 of file lumiQueryAPI.py.

References nameDealer.cmsrunsummaryTableName(), data, createfilelist.int, and GetRecoTauVFromDQM_MC_cff.next.

1069 def runsummaryByrun(queryHandle,runnum):
1070  '''
1071  select fillnum,sequence,hltkey,to_char(starttime),to_char(stoptime) from cmsrunsummary where runnum=:runnum
1072  output: [fillnum,sequence,hltkey,starttime,stoptime]
1073  '''
1074  t=lumiTime.lumiTime()
1075  result=[]
1076  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
1077  queryCondition=coral.AttributeList()
1078  queryCondition.extend('runnum','unsigned int')
1079  queryCondition['runnum'].setData(int(runnum))
1080  queryHandle.addToOutputList('FILLNUM','fillnum')
1081  queryHandle.addToOutputList('SEQUENCE','sequence')
1082  queryHandle.addToOutputList('HLTKEY','hltkey')
1083  queryHandle.addToOutputList('to_char(STARTTIME,\''+t.coraltimefm+'\')','starttime')
1084  queryHandle.addToOutputList('to_char(STOPTIME,\''+t.coraltimefm+'\')','stoptime')
1085  queryHandle.setCondition('RUNNUM=:runnum',queryCondition)
1086  queryResult=coral.AttributeList()
1087  queryResult.extend('fillnum','unsigned int')
1088  queryResult.extend('sequence','string')
1089  queryResult.extend('hltkey','string')
1090  queryResult.extend('starttime','string')
1091  queryResult.extend('stoptime','string')
1092  queryHandle.defineOutput(queryResult)
1093  cursor=queryHandle.execute()
1094  while next(cursor):
1095  result.append(cursor.currentRow()['fillnum'].data())
1096  result.append(cursor.currentRow()['sequence'].data())
1097  result.append(cursor.currentRow()['hltkey'].data())
1098  result.append(cursor.currentRow()['starttime'].data())
1099  result.append(cursor.currentRow()['stoptime'].data())
1100  #if len(result)!=5:
1101  # print 'wrong runsummary result'
1102  # raise
1103  return result
1104 
def runsummaryByrun(queryHandle, runnum)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def cmsrunsummaryTableName()
Definition: nameDealer.py:16
def lumiQueryAPI.setupSession (   connectString,
  siteconfpath,
  parameters,
  debug = False 
)
returns database session

Definition at line 891 of file lumiQueryAPI.py.

891 def setupSession (connectString, siteconfpath, parameters, debug = False):
892  '''returns database session'''
893  connectparser = connectstrParser.connectstrParser (connectString)
894  connectparser.parse()
895  usedefaultfrontierconfig = False
896  cacheconfigpath = ''
897  if connectparser.needsitelocalinfo():
898  if not siteconfpath:
899  cacheconfigpath = os.environ['CMS_PATH']
900  if cacheconfigpath:
901  cacheconfigpath = os.path.join (cacheconfigpath, 'SITECONF', 'local', 'JobConfig', 'site-local-config.xml')
902  else:
903  usedefaultfrontierconfig = True
904  else:
905  cacheconfigpath = siteconfpath
906  cacheconfigpath = os.path.join (cacheconfigpath, 'site-local-config.xml')
908  if usedefaultfrontierconfig:
909  ccp.parseString (parameters.defaultfrontierConfigString)
910  else:
911  ccp.parse (cacheconfigpath)
912  connectString = connectparser.fullfrontierStr (connectparser.schemaname(), ccp.parameterdict())
913  svc = coral.ConnectionService()
914  if debug :
915  msg = coral.MessageStream ('')
916  msg.setMsgVerbosity (coral.message_Level_Debug)
917  parameters.verbose = True
918  session = svc.connect (connectString, accessMode = coral.access_ReadOnly)
919  session.typeConverter().setCppTypeForSqlType ("unsigned int", "NUMBER (10)")
920  session.typeConverter().setCppTypeForSqlType ("unsigned long long", "NUMBER (20)")
921  return session, svc
922 
923 
924 
def setupSession(connectString, siteconfpath, parameters, debug=False)
def lumiQueryAPI.splitlistToRangeString (   inPut)

Definition at line 433 of file lumiQueryAPI.py.

434  result = []
435  first = inPut[0]
436  last = inPut[0]
437  result.append ([inPut[0]])
438  counter = 0
439  for i in inPut[1:]:
440  if i == last+1:
441  result[counter].append (i)
442  else:
443  counter += 1
444  result.append ([i])
445  last = i
446  return ', '.join (['['+str (min (x))+'-'+str (max (x))+']' for x in result])
447 
448 
def splitlistToRangeString(inPut)
def lumiQueryAPI.trgAllbitsByrun (   queryHandle,
  runnum 
)
all you ever want to know about trigger
select cmslsnum,trgcount,deadtime,bitnum,bitname,prescale from trg where runnum=:runnum order by  bitnum,cmslsnum
this can be changed to blob query later
output: {cmslsnum:{bitname:[bitnum,trgcount,deadtime,prescale]}}

Definition at line 1354 of file lumiQueryAPI.py.

References data, createfilelist.int, GetRecoTauVFromDQM_MC_cff.next, and nameDealer.trgTableName().

1354 def trgAllbitsByrun(queryHandle,runnum):
1355  '''
1356  all you ever want to know about trigger
1357  select cmslsnum,trgcount,deadtime,bitnum,bitname,prescale from trg where runnum=:runnum order by bitnum,cmslsnum
1358  this can be changed to blob query later
1359  output: {cmslsnum:{bitname:[bitnum,trgcount,deadtime,prescale]}}
1360  '''
1361  result={}
1362  queryHandle.addToTableList(nameDealer.trgTableName())
1363  queryCondition=coral.AttributeList()
1364  queryCondition.extend('runnum','unsigned int')
1365  queryCondition['runnum'].setData(int(runnum))
1366  queryHandle.addToOutputList('cmslsnum')
1367  queryHandle.addToOutputList('trgcount')
1368  queryHandle.addToOutputList('deadtime')
1369  queryHandle.addToOutputList('bitnum')
1370  queryHandle.addToOutputList('bitname')
1371  queryHandle.addToOutputList('prescale')
1372  queryHandle.setCondition('runnum=:runnum',queryCondition)
1373  queryResult=coral.AttributeList()
1374  queryResult.extend('cmslsnum','unsigned int')
1375  queryResult.extend('trgcount','unsigned int')
1376  queryResult.extend('deadtime','unsigned long long')
1377  queryResult.extend('bitnum','unsigned int')
1378  queryResult.extend('bitname','string')
1379  queryResult.extend('prescale','unsigned int')
1380  queryHandle.defineOutput(queryResult)
1381  queryHandle.addToOrderList('bitnum')
1382  queryHandle.addToOrderList('cmslsnum')
1383  cursor=queryHandle.execute()
1384  while next(cursor):
1385  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1386  trgcount=cursor.currentRow()['trgcount'].data()
1387  deadtime=cursor.currentRow()['deadtime'].data()
1388  bitnum=cursor.currentRow()['bitnum'].data()
1389  bitname=cursor.currentRow()['bitname'].data()
1390  prescale=cursor.currentRow()['prescale'].data()
1391  if cmslsnum not in result:
1392  dataperLS={}
1393  dataperLS[bitname]=[bitnum,trgcount,deadtime,prescale]
1394  result[cmslsnum]=dataperLS
1395  else:
1396  result[cmslsnum][bitname]=[bitnum,trgcount,deadtime,prescale]
1397  return result
1398 
1399 
def trgTableName()
Definition: nameDealer.py:52
def trgAllbitsByrun(queryHandle, runnum)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.trgbitzeroByrun (   queryHandle,
  runnum 
)
select cmslsnum,trgcount,deadtime,bitname,prescale from trg where runnum=:runnum and bitnum=0;
output: {cmslsnum:[trgcount,deadtime,bitname,prescale]}

Definition at line 1210 of file lumiQueryAPI.py.

References data, createfilelist.int, GetRecoTauVFromDQM_MC_cff.next, and nameDealer.trgTableName().

1210 def trgbitzeroByrun(queryHandle,runnum):
1211  '''
1212  select cmslsnum,trgcount,deadtime,bitname,prescale from trg where runnum=:runnum and bitnum=0;
1213  output: {cmslsnum:[trgcount,deadtime,bitname,prescale]}
1214  '''
1215  result={}
1216  queryHandle.addToTableList(nameDealer.trgTableName())
1217  queryCondition=coral.AttributeList()
1218  queryCondition.extend('runnum','unsigned int')
1219  queryCondition.extend('bitnum','unsigned int')
1220  queryCondition['runnum'].setData(int(runnum))
1221  queryCondition['bitnum'].setData(int(0))
1222  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1223  queryHandle.addToOutputList('TRGCOUNT','trgcount')
1224  queryHandle.addToOutputList('DEADTIME','deadtime')
1225  queryHandle.addToOutputList('BITNAME','bitname')
1226  queryHandle.addToOutputList('PRESCALE','prescale')
1227  queryHandle.setCondition('RUNNUM=:runnum and BITNUM=:bitnum',queryCondition)
1228  queryResult=coral.AttributeList()
1229  queryResult.extend('cmslsnum','unsigned int')
1230  queryResult.extend('trgcount','unsigned int')
1231  queryResult.extend('deadtime','unsigned int')
1232  queryResult.extend('bitname','string')
1233  queryResult.extend('prescale','unsigned int')
1234  queryHandle.defineOutput(queryResult)
1235  cursor=queryHandle.execute()
1236  while next(cursor):
1237  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1238  trgcount=cursor.currentRow()['trgcount'].data()
1239  deadtime=cursor.currentRow()['deadtime'].data()
1240  bitname=cursor.currentRow()['bitname'].data()
1241  prescale=cursor.currentRow()['prescale'].data()
1242  if cmslsnum not in result:
1243  result[cmslsnum]=[trgcount,deadtime,bitname,prescale]
1244  return result
1245 
def trgbitzeroByrun(queryHandle, runnum)
def trgTableName()
Definition: nameDealer.py:52
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.trgBybitnameByrun (   queryHandle,
  runnum,
  bitname 
)
select cmslsnum,trgcount,deadtime,bitnum,prescale from trg where runnum=:runnum and bitname=:bitname;
output: {cmslsnum:[trgcount,deadtime,bitnum,prescale]}

Definition at line 1318 of file lumiQueryAPI.py.

References data, createfilelist.int, GetRecoTauVFromDQM_MC_cff.next, and nameDealer.trgTableName().

1318 def trgBybitnameByrun(queryHandle,runnum,bitname):
1319  '''
1320  select cmslsnum,trgcount,deadtime,bitnum,prescale from trg where runnum=:runnum and bitname=:bitname;
1321  output: {cmslsnum:[trgcount,deadtime,bitnum,prescale]}
1322  '''
1323  result={}
1324  queryHandle.addToTableList(nameDealer.trgTableName())
1325  queryCondition=coral.AttributeList()
1326  queryCondition.extend('runnum','unsigned int')
1327  queryCondition.extend('bitname','string')
1328  queryCondition['runnum'].setData(int(runnum))
1329  queryCondition['bitname'].setData(bitname)
1330  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1331  queryHandle.addToOutputList('TRGCOUNT','trgcount')
1332  queryHandle.addToOutputList('DEADTIME','deadtime')
1333  queryHandle.addToOutputList('BITNUM','bitnum')
1334  queryHandle.addToOutputList('PRESCALE','prescale')
1335  queryHandle.setCondition('RUNNUM=:runnum and BITNAME=:bitname',queryCondition)
1336  queryResult=coral.AttributeList()
1337  queryResult.extend('cmslsnum','unsigned int')
1338  queryResult.extend('trgcount','unsigned int')
1339  queryResult.extend('deadtime','unsigned long long')
1340  queryResult.extend('bitnum','unsigned int')
1341  queryResult.extend('prescale','unsigned int')
1342  queryHandle.defineOutput(queryResult)
1343  cursor=queryHandle.execute()
1344  while next(cursor):
1345  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1346  trgcount=cursor.currentRow()['trgcount'].data()
1347  deadtime=cursor.currentRow()['deadtime'].data()
1348  bitnum=cursor.currentRow()['bitnum'].data()
1349  prescale=cursor.currentRow()['prescale'].data()
1350  if cmslsnum not in result:
1351  result[cmslsnum]=[trgcount,deadtime,bitnum,prescale]
1352  return result
1353 
def trgTableName()
Definition: nameDealer.py:52
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def trgBybitnameByrun(queryHandle, runnum, bitname)
def lumiQueryAPI.validation (   queryHandle,
  run = None,
  cmsls = None 
)
retrieve validation data per run or all
input: run. if not run, retrive all; if cmslsnum selection list pesent, filter out unselected result
output: {run:[[cmslsnum,status,comment]]}

Definition at line 1000 of file lumiQueryAPI.py.

References mps_setup.append, data, nameDealer.lumivalidationTableName(), and GetRecoTauVFromDQM_MC_cff.next.

1000 def validation(queryHandle,run=None,cmsls=None):
1001  '''retrieve validation data per run or all
1002  input: run. if not run, retrive all; if cmslsnum selection list pesent, filter out unselected result
1003  output: {run:[[cmslsnum,status,comment]]}
1004  '''
1005  result={}
1006  queryHandle.addToTableList(nameDealer.lumivalidationTableName())
1007  queryHandle.addToOutputList('RUNNUM','runnum')
1008  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1009  queryHandle.addToOutputList('FLAG','flag')
1010  queryHandle.addToOutputList('COMMENT','comment')
1011  if run:
1012  queryCondition='RUNNUM=:runnum'
1013  queryBind=coral.AttributeList()
1014  queryBind.extend('runnum','unsigned int')
1015  queryBind['runnum'].setData(run)
1016  queryHandle.setCondition(queryCondition,queryBind)
1017  queryResult=coral.AttributeList()
1018  queryResult.extend('runnum','unsigned int')
1019  queryResult.extend('cmslsnum','unsigned int')
1020  queryResult.extend('flag','string')
1021  queryResult.extend('comment','string')
1022  queryHandle.defineOutput(queryResult)
1023  cursor=queryHandle.execute()
1024  while next(cursor):
1025  runnum=cursor.currentRow()['runnum'].data()
1026  if runnum not in result:
1027  result[runnum]=[]
1028  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1029  flag=cursor.currentRow()['flag'].data()
1030  comment=cursor.currentRow()['comment'].data()
1031  result[runnum].append([cmslsnum,flag,comment])
1032  if run and cmsls and len(cmsls)!=0:
1033  selectedresult={}
1034  for runnum,perrundata in result.items():
1035  for lsdata in perrundata:
1036  if lsdata[0] not in cmsls:
1037  continue
1038  if runnum not in selectedresult:
1039  selectedresult[runnum]=[]
1040  selectedresult[runnum].append(lsdata)
1041  return selectedresult
1042  else:
1043  return result
1044 
def validation(queryHandle, run=None, cmsls=None)
def lumivalidationTableName()
Definition: nameDealer.py:85
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def lumiQueryAPI.xingLuminosityForRun (   dbsession,
  runnum,
  parameters,
  lumiXingDict = {},
  maxLumiSection = None,
  finecorrections = None 
)
Given a run number and a minimum xing luminosity value,
returns a dictionary (keyed by (run, lumi section)) where the
value is a list of tuples of (xingID, xingLum).

- For all xing luminosities, simply set minLumValue to 0.

- If you want one dictionary for several runs, pass it in to
  "lumiXingDict"

select 
s.cmslsnum, d.bxlumivalue, d.bxlumierror, d.bxlumiquality, d.algoname from LUMIDETAIL d, LUMISUMMARY s where s.runnum = 133885 and d.algoname = 'OCC1' and s.lumisummary_id = d.lumisummary_id order by s.startorbit, s.cmslsnum

Definition at line 779 of file lumiQueryAPI.py.

References data, nameDealer.lumidetailTableName(), nameDealer.lumisummaryTableName(), GetRecoTauVFromDQM_MC_cff.next, and edm.print().

Referenced by dumpOverview().

779  maxLumiSection = None, finecorrections=None):
780  '''Given a run number and a minimum xing luminosity value,
781  returns a dictionary (keyed by (run, lumi section)) where the
782  value is a list of tuples of (xingID, xingLum).
783 
784  - For all xing luminosities, simply set minLumValue to 0.
785 
786  - If you want one dictionary for several runs, pass it in to
787  "lumiXingDict"
788 
789  select
790  s.cmslsnum, d.bxlumivalue, d.bxlumierror, d.bxlumiquality, d.algoname from LUMIDETAIL d, LUMISUMMARY s where s.runnum = 133885 and d.algoname = 'OCC1' and s.lumisummary_id = d.lumisummary_id order by s.startorbit, s.cmslsnum
791  '''
792  try:
793  runnum = int (runnum)
794  dbsession.transaction().start (True)
795  schema = dbsession.schema (parameters.lumischema)
796  if not schema:
797  raise RuntimeError('cannot connect to schema '+ parameters.lumischema)
798  detailOutput = coral.AttributeList()
799  detailOutput.extend ('startorbit', 'unsigned int')
800  detailOutput.extend ('cmslsnum', 'unsigned int')
801  detailOutput.extend ('bxlumivalue', 'blob')
802  detailOutput.extend ('bxlumierror', 'blob')
803  detailOutput.extend ('bxlumiquality', 'blob')
804  detailOutput.extend ('algoname', 'string')
805  detailCondition = coral.AttributeList()
806  detailCondition.extend ('runnum', 'unsigned int')
807  detailCondition.extend ('algoname', 'string')
808  detailCondition['runnum'].setData (runnum)
809  detailCondition['algoname'].setData ('OCC1')
810  query = schema.newQuery()
811  query.addToTableList(nameDealer.lumisummaryTableName(), 's')
812  query.addToTableList(nameDealer.lumidetailTableName(), 'd')
813  query.addToOutputList ('s.STARTORBIT', 'startorbit')
814  query.addToOutputList ('s.CMSLSNUM', 'cmslsnum')
815  query.addToOutputList ('d.BXLUMIVALUE', 'bxlumivalue')
816  query.addToOutputList ('d.BXLUMIERROR', 'bxlumierror')
817  query.addToOutputList ('d.BXLUMIQUALITY', 'bxlumiquality')
818  query.addToOutputList ('d.ALGONAME', 'algoname')
819  query.setCondition ('s.RUNNUM =:runnum and d.ALGONAME =:algoname and s.LUMISUMMARY_ID=d.LUMISUMMARY_ID',detailCondition)
820  query.addToOrderList ('s.CMSLSNUM')
821  query.defineOutput (detailOutput)
822  cursor = query.execute()
823  count = 0
824  while next(cursor):
825  ## ## Note: If you are going to break out of this loop early,
826  ## ## make sure you call cursor.close():
827  ##
828  ## if count > 20 :
829  ## cursor.close()
830  ## break
831  ## count += 1
832  cmslsnum = cursor.currentRow()['cmslsnum'].data()
833  algoname = cursor.currentRow()['algoname'].data()
834  bxlumivalue = cursor.currentRow()['bxlumivalue'].data()
835  startorbit = cursor.currentRow()['startorbit'].data()
836 
837  if maxLumiSection and maxLumiSection < cmslsnum:
838  cursor.close()
839  break
840 
841  xingArray = array.array ('f')
842  xingArray.fromstring( bxlumivalue.readline() )
843  numPrinted = 0
844  xingLum = []
845  avginstlumi=0.0
846  if len(xingArray)!=0:
847  avginstlumi=sum(xingArray)
848  for index, lum in enumerate (xingArray):
849  mynorm=parameters.normFactor
850  if finecorrections:
851  lum=lumiCorrections.applyfinecorrectionBX(lum,avginstlumi*mynorm,mynorm,finecorrections[0],finecorrections[1],finecorrections[2])
852  else:
853  lum*=mynorm
854  if lum < parameters.xingMinLum:
855  continue
856  xingLum.append( (index, lum) )
857  lumiXingDict[ (runnum, cmslsnum) ] = xingLum
858  del query
859  dbsession.transaction().commit()
860  return lumiXingDict
861  except Exception as e:
862  print(str (e))
863  print("whoops")
864  dbsession.transaction().rollback()
865  del dbsession
866 
867 
def lumidetailTableName()
Definition: nameDealer.py:34
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def lumisummaryTableName()
Definition: nameDealer.py:25
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82

Variable Documentation

lumiQueryAPI.accessMode

Definition at line 1781 of file lumiQueryAPI.py.

Referenced by cond::CredentialStore.openSession().

lumiQueryAPI.allfills

Definition at line 1844 of file lumiQueryAPI.py.

Referenced by allfills().

lumiQueryAPI.allruns

Definition at line 1786 of file lumiQueryAPI.py.

Referenced by allruns().

lumiQueryAPI.connectstr

Definition at line 1780 of file lumiQueryAPI.py.

lumiQueryAPI.msg

Definition at line 1775 of file lumiQueryAPI.py.

lumiQueryAPI.q

Definition at line 1843 of file lumiQueryAPI.py.

Referenced by QIE10Task._process(), DigiTask._process(), ParticleLevelProducer.addGenJet(), JetAnaPythia< Jet >.analyze(), TrackParameterAnalyzer.analyze(), DisplayGeom.analyze(), PhotonValidator.analyze(), HLTScalers.analyze(), hcaldqm::utilities.aveTS_v10(), hcaldqm::utilities.aveTSDB(), AlignmentTrackSelector.basicCuts(), DQMStore.book_(), PhysicsTools::AtomicId.build(), HcalDigitizer.buildHBHEQIECells(), HcalDigitizer.buildHFQIECells(), reco::Candidate.Candidate(), HFPreRecHit.charge(), CandCombinerBase< OutputCollection, CandPtr >.combine(), NamedCandCombinerBase.combine(), AnalyticalCurvilinearJacobian.computeFullJacobian(), Conv4HitsReco.ConversionCandidate(), VVIObjDetails.cosint(), sistripvvi::VVIObjDetails.cosint(), TtFullLepKinSolver.cubic(), TwoBodyDecayModel.curvilinearToCartesianJacobian(), PhysicsTools::VarProcessor.deriv(), FWEveDigitSetScalableMarkerGL.DirectDraw(), phase1PixelTopology.divu52(), lhef.domToLines(), EEQuadrant(), ConfigurationDBHandler.endElement(), lhef::LHEReader::XMLHandler.endElement(), LMFSeqDat.fetchByRunNumber(), dqm::TrackAnalyzer.fillHistosForState(), PrimaryVertexValidation.fillTrackHistos(), edm::ParameterSet.fromString(), GammaFunctionGenerator.gammaFrac(), lumi::idDealer.generateNextIDForTable(), reco::GenParticle.GenParticle(), hi::GenPlane.getAngle(), QIE8Simulator.getCharge(), cond::persistency::IOV::Table.getGroups(), lumi::idDealer.getIDforTable(), cond::persistency::IOV::Table.getLastIov(), PVValHelper.getMedian(), cond::persistency::TAG::Table.getMetadata(), MonitorElement.getQReport(), cond::persistency::IOV::Table.getSize(), pftools::CaloEllipse.getTheta(), cond::persistency::PAYLOAD::Table.getType(), L1MuGMTSortRankUnit.getVeryLowQualityLevel(), gen::Herwig6Instance.give(), ConversionFastHelix.helixStateAtVertex(), FastHelix.helixStateAtVertex(), HLTDeDxFilter.hltFilter(), GflashTrajectory.initializeTrajectory(), SeedFromConsecutiveHitsStraightLineCreator.initialKinematic(), CSCUpgradeMotherboard.intersection(), JacobianCartesianToLocal.JacobianCartesianToLocal(), JacobianLocalToCartesian.JacobianLocalToCartesian(), reco::TrackProbabilityTagInfo.jetProbability(), TemplatedJetProbabilityComputer< Container, Base >.jetProbability(), TemplatedJetBProbabilityComputer< Container, Base >.jetProbability(), reco::LeafCandidate.LeafCandidate(), DatabasePDG.LoadParticles(), L1MuGMTLFMergeRankPtQLUT.LookupFunctionPacked(), L1MuGMTLFSortRankPtQLUT.LookupFunctionPacked(), L1MuGMTLFMergeRankEtaQLUT.LookupFunctionPacked(), L1MuGMTLFSortRankEtaQLUT.LookupFunctionPacked(), SteppingHelixPropagator.makeAtomStep(), match(), L1MuGMTMerger.merge_rank(), MergeRootfile(), NtpProducer< C >.NtpProducer(), edm::Guid.operator=(), edm::Guid.operator==(), HcalPacker.pack(), OniaPhotonConversionProducer.PackFlags(), reco::Particle.Particle(), trigger::TriggerObject.particle(), ParticlePropagator.ParticlePropagator(), RawParticle.PDGcharge(), HBHEChannelInfo.peakChargeTS(), CastorNominalCoderTemplate.process(), HcalNominalCoderTemplate.process(), CastorDigiMonitor.processEvent(), PseudoTopProducer.produce(), NtpProducer< C >.produce(), L3MuonCandidateProducerFromMuons.produce(), TtSemiEvtSolutionMaker.produce(), TtHadEvtSolutionMaker.produce(), TrackListMerger.produce(), L2MuonCandidateProducer.produce(), L3MuonCandidateProducer.produce(), OniaPhotonConversionProducer.produce(), FFTJetPileupProcessor.produce(), ME0MuonConverter.produce(), edm::LimitedTaskQueue.push(), edm::LimitedTaskQueue.pushAndPause(), edm::LimitedTaskQueue.pushAndWait(), Herwig6Hadronizer.pythiaStatusCode(), reco::Conversion.quality(), reco::TrackBase.quality(), GSUtilities.quantile(), SusyPostProcessor.QuantilePlots(), RealQuadEquation.RealQuadEquation(), HFPreRecAlgo.reconstruct(), HFFlexibleTimeCheck.reconstruct(), HcalCableMapper.record(), MultiHitGeneratorFromChi2.refit2Hits(), FWOverlapTableView.refreshTable3D(), edm::LimitedTaskQueue::Resumer.resume(), MultiTrackSelector.run(), QIE8Simulator.run(), L1MuDTEtaProcessor.runEtaTrackFinder(), L1MuBMEtaProcessor.runEtaTrackFinder(), CustomPDGParser.s_charge(), cond::persistency::GLOBAL_TAG::Table.select(), cond::persistency::TAG::Table.select(), cond::persistency::RUN_INFO::Table.select(), cond::persistency::GLOBAL_TAG_MAP::Table.select(), cond::persistency::PAYLOAD::Table.select(), cond::persistency::IOV::Table.select(), BPhysicsOniaDQM.selGlobalMuon(), MuScleFitMuonSelector.selGlobalMuon(), MuScleFit.selGlobalMuon(), RawParticle.setCharge(), ObjectValidator.setEBRecHitCollection(), ObjectValidator.setEcalChannelStatus(), ObjectValidator.setEcalSeverityLevelAlgo(), ObjectValidator.setEERecHitCollection(), ObjectValidator.setHcalChannelQuality(), ObjectValidator.setHcalSeverityLevelComputer(), AlgoMuon.setQ(), ME0TriggerDigi.setQuality(), CSCCorrelatedLCTDigi.setQuality(), pat::HardEventHypothesis.setQuality(), reco::Conversion.setQuality(), reco::TrackBase.setQuality(), HBHEChannelInfo.setSample(), GenEventInfoProduct.setScales(), VVIObjDetails.sincosint(), sistripvvi::VVIObjDetails.sincosint(), VVIObjDetails.sinint(), sistripvvi::VVIObjDetails.sinint(), HelixExtrapolatorToLine2Order.solve3rdOrder(), L1MuGMTSortRankUnit.sort_rank(), L1MuGMTLFMergeRankPtQLUT.SpecificLookup(), L1MuGMTLFSortRankPtQLUT.SpecificLookup(), L1MuGMTLFMergeRankEtaQLUT.SpecificLookup(), L1MuGMTLFSortRankEtaQLUT.SpecificLookup(), L1MuGMTLFMergeRankEtaQLUT.SpecificLookup_flag(), L1MuGMTLFSortRankEtaQLUT.SpecificLookup_rank_etaq(), L1MuGMTLFMergeRankEtaQLUT.SpecificLookup_rank_etaq(), L1MuGMTLFMergeRankPtQLUT.SpecificLookup_rank_ptq(), L1MuGMTLFSortRankPtQLUT.SpecificLookup_rank_ptq(), L1MuGMTLFSortRankEtaQLUT.SpecificLookup_vlq(), TauValidation.spinEffectsZH(), PhysicsTools.split(), ConversionFastHelix.straightLineStateAtVertex(), FastHelix.straightLineStateAtVertex(), L1MuGMTLFSortRankPtQLUT.TheLookupFunction(), L1MuGMTLFMergeRankEtaQLUT.TheLookupFunction(), L1TMuonBarrelKalmanAlgo.twosCompToBits(), reco::InverseCrosstalkMatrix.unfold(), RctRawToDigi.unpackCTP7(), L1MuonPixelTrackFitter.valInversePt(), SiStripClusterInfo.variance(), reco::VertexCompositeCandidate.VertexCompositeCandidate(), reco::VertexCompositePtrCandidate.VertexCompositePtrCandidate(), VVIObj.VVIObj(), sistripvvi::VVIObj.VVIObj(), VVIObjF.VVIObjF(), DCULVRVoltagesDat.writeArrayDB(), and cms::DDCMSDetElementCreator.~DDCMSDetElementCreator().

lumiQueryAPI.requireHlt

Definition at line 1786 of file lumiQueryAPI.py.

lumiQueryAPI.requireLumisummary

Definition at line 1786 of file lumiQueryAPI.py.

lumiQueryAPI.requireTrg

Definition at line 1786 of file lumiQueryAPI.py.

lumiQueryAPI.schema

Definition at line 1785 of file lumiQueryAPI.py.

lumiQueryAPI.session

Definition at line 1781 of file lumiQueryAPI.py.

lumiQueryAPI.svc

Definition at line 1779 of file lumiQueryAPI.py.

lumiQueryAPI.True

Definition at line 1786 of file lumiQueryAPI.py.