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 1044 of file lumiQueryAPI.py.

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

1044 def allfills(queryHandle,filtercrazy=True):
1045  '''select distinct fillnum from cmsrunsummary
1046  there are crazy fill numbers. we assume they are not valid runs
1047  '''
1048  result=[]
1049  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
1050  queryHandle.addToOutputList('distinct FILLNUM','fillnum')
1051 
1052  if filtercrazy:
1053  queryCondition='FILLNUM>:zero and FILLNUM<:crazybig'
1054  queryBind=coral.AttributeList()
1055  queryBind.extend('zero','unsigned int')
1056  queryBind.extend('crazybig','unsigned int')
1057  queryBind['zero'].setData(int(0))
1058  queryBind['crazybig'].setData(int(29701))
1059  queryHandle.setCondition(queryCondition,queryBind)
1060  queryResult=coral.AttributeList()
1061  queryResult.extend('fillnum','unsigned int')
1062  queryHandle.defineOutput(queryResult)
1063  cursor=queryHandle.execute()
1064  while next(cursor):
1065  result.append(cursor.currentRow()['fillnum'].data())
1066  result.sort()
1067  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 926 of file lumiQueryAPI.py.

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

926 def allruns(schemaHandle,requireRunsummary=True,requireLumisummary=False,requireTrg=False,requireHlt=False):
927  '''
928  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.
929  '''
930  if not requireRunsummary and not requireLumiummary and not requireTrg and not requireHlt:
931  print 'must require at least one table'
932  raise
933  runresult=[]
934  runlist=[]
935  numdups=0
936  if requireRunsummary:
937  numdups=numdups+1
938  queryHandle=schemaHandle.newQuery()
939  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
940  queryHandle.addToOutputList("RUNNUM","run")
941  #queryBind=coral.AttributeList()
942  result=coral.AttributeList()
943  result.extend("run","unsigned int")
944  queryHandle.defineOutput(result)
945  cursor=queryHandle.execute()
946  while next(cursor):
947  r=cursor.currentRow()['run'].data()
948  runlist.append(r)
949  del queryHandle
950  if requireLumisummary:
951  numdups=numdups+1
952  queryHandle=schemaHandle.newQuery()
953  queryHandle.addToTableList(nameDealer.lumisummaryTableName())
954  queryHandle.addToOutputList("distinct RUNNUM","run")
955  #queryBind=coral.AttributeList()
956  result=coral.AttributeList()
957  result.extend("run","unsigned int")
958  queryHandle.defineOutput(result)
959  cursor=queryHandle.execute()
960  while next(cursor):
961  r=cursor.currentRow()['run'].data()
962  runlist.append(r)
963  del queryHandle
964  if requireTrg:
965  numdups=numdups+1
966  queryHandle=schemaHandle.newQuery()
967  queryHandle.addToTableList(nameDealer.trgTableName())
968  queryHandle.addToOutputList("distinct RUNNUM","run")
969  #queryBind=coral.AttributeList()
970  result=coral.AttributeList()
971  result.extend("run","unsigned int")
972  queryHandle.defineOutput(result)
973  cursor=queryHandle.execute()
974  while next(cursor):
975  r=cursor.currentRow()['run'].data()
976  runlist.append(r)
977  del queryHandle
978  if requireHlt:
979  numdups=numdups+1
980  queryHandle=schemaHandle.newQuery()
981  queryHandle.addToTableList(nameDealer.hltTableName())
982  queryHandle.addToOutputList("distinct RUNNUM","run")
983  #queryBind=coral.AttributeList()
984  result=coral.AttributeList()
985  result.extend("run","unsigned int")
986  queryHandle.defineOutput(result)
987  cursor=queryHandle.execute()
988  while next(cursor):
989  r=cursor.currentRow()['run'].data()
990  runlist.append(r)
991  del queryHandle
992  dupresult=CommonUtil.count_dups(runlist)
993  for dup in dupresult:
994  if dup[1]==numdups:
995  runresult.append(dup[0])
996  runresult.sort()
997  return runresult
998 
def trgTableName()
Definition: nameDealer.py:52
def lumisummaryTableName()
Definition: nameDealer.py:25
def hltTableName()
Definition: nameDealer.py:55
def count_dups(l)
Definition: CommonUtil.py:137
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 1472 of file lumiQueryAPI.py.

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

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

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

Definition at line 413 of file lumiQueryAPI.py.

413 def calculateTotalRecorded (deadtable):
414  """
415  input: {lsnum:[deadtime, instlumi, bit_0, norbits,prescale]}
416  output: recordedLumi
417  """
418  recordedLumi = 0.0
419  for myls, d in deadtable.items():
420  instLumi = d[1]
421  #deadfrac = float (d[0])/float (d[2]*3564)
422  #print myls, float (d[2])
423  if float (d[2]) == 0.0:
424  deadfrac = 1.0
425  else:
426  deadfrac = float (d[0])/(float (d[2])*float (d[-1]))
427  lstime = lslengthsec (d[3], 3564)
428  recordedLumi += instLumi* (1.0-deadfrac)*lstime
429  return recordedLumi
430 
431 
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 1539 of file lumiQueryAPI.py.

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

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

References createfilelist.int.

85 def deliveredLumiForRange (dbsession, parameters,inputRange,finecorrections=None):
86  '''Takes either single run as a string or dictionary of run ranges'''
87  lumidata = []
88  runs=[]
89  if isinstance(inputRange, str):
90  runs.append(int(inputRange))
91  else:
92  runs=inputRange.runs()
93  for r in sorted(runs):
94  if parameters.verbose:
95  print "run", run
96  c=None
97  if finecorrections:
98  c=finecorrections[r]
99  lumidata.append( deliveredLumiForRun (dbsession, parameters,r,finecorrections=c) )
100  return lumidata
101 
def deliveredLumiForRange(dbsession, parameters, inputRange, finecorrections=None)
Definition: lumiQueryAPI.py:85
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 161 of file lumiQueryAPI.py.

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

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

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

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

Definition at line 754 of file lumiQueryAPI.py.

References xingLuminosityForRun().

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

Definition at line 517 of file lumiQueryAPI.py.

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

Definition at line 644 of file lumiQueryAPI.py.

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

Definition at line 386 of file lumiQueryAPI.py.

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

Definition at line 867 of file lumiQueryAPI.py.

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

Definition at line 463 of file lumiQueryAPI.py.

References objects.autophobj.float.

463 def getDeadfractions (deadtable):
464  """
465  inputtable: {lsnum:[deadtime, instlumi, bit_0, norbits,bit_0_prescale]}
466  output: {lsnum:deadfraction}
467  """
468  result = {}
469  for myls, d in deadtable.items():
470  #deadfrac = float (d[0])/ (float (d[2])*float (3564))
471  if float (d[2]) == 0.0: ##no beam
472  deadfrac = -1.0
473  else:
474  deadfrac = float (d[0])/ (float (d[2])*float(d[-1]))
475  result[myls] = deadfrac
476  return result
477 
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 1432 of file lumiQueryAPI.py.

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

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

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

1399 def hltBypathByrun(queryHandle,runnum,hltpath):
1400  '''
1401  select cmslsnum,inputcount,acceptcount,prescale from hlt where runnum=:runnum and pathname=:pathname
1402  output: {cmslsnum:[inputcount,acceptcount,prescale]}
1403  '''
1404  result={}
1405  queryHandle.addToTableList(nameDealer.hltTableName())
1406  queryCondition=coral.AttributeList()
1407  queryCondition.extend('runnum','unsigned int')
1408  queryCondition.extend('pathname','string')
1409  queryCondition['runnum'].setData(int(runnum))
1410  queryCondition['pathname'].setData(hltpath)
1411  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1412  queryHandle.addToOutputList('INPUTCOUNT','inputcount')
1413  queryHandle.addToOutputList('ACCEPTCOUNT','acceptcount')
1414  queryHandle.addToOutputList('PRESCALE','prescale')
1415  queryHandle.setCondition('RUNNUM=:runnum and PATHNAME=:pathname',queryCondition)
1416  queryResult=coral.AttributeList()
1417  queryResult.extend('cmslsnum','unsigned int')
1418  queryResult.extend('inputcount','unsigned int')
1419  queryResult.extend('acceptcount','unsigned int')
1420  queryResult.extend('prescale','unsigned int')
1421  queryHandle.defineOutput(queryResult)
1422  cursor=queryHandle.execute()
1423  while next(cursor):
1424  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1425  inputcount=cursor.currentRow()['inputcount'].data()
1426  acceptcount=cursor.currentRow()['acceptcount'].data()
1427  prescale=cursor.currentRow()['prescale'].data()
1428  if cmslsnum not in result:
1429  result[cmslsnum]=[inputcount,acceptcount,prescale]
1430  return result
1431 
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 1681 of file lumiQueryAPI.py.

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

1681 def hlttrgMappingByrun(queryHandle,runnum):
1682  '''
1683  select m.hltpathname,m.l1seed from cmsrunsummary r,trghltmap m where r.runnum=:runnum and m.hltkey=r.hltkey
1684  output: {hltpath:l1seed}
1685  '''
1686  result={}
1687  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName(),'r')
1688  queryHandle.addToTableList(nameDealer.trghltMapTableName(),'m')
1689  queryCondition=coral.AttributeList()
1690  queryCondition.extend('runnum','unsigned int')
1691  queryCondition['runnum'].setData(int(runnum))
1692  queryHandle.addToOutputList('m.HLTPATHNAME','hltpathname')
1693  queryHandle.addToOutputList('m.L1SEED','l1seed')
1694  queryHandle.setCondition('r.RUNNUM=:runnum and m.HLTKEY=r.HLTKEY',queryCondition)
1695  queryResult=coral.AttributeList()
1696  queryResult.extend('hltpathname','string')
1697  queryResult.extend('l1seed','string')
1698  queryHandle.defineOutput(queryResult)
1699  cursor=queryHandle.execute()
1700  while next(cursor):
1701  hltpathname=cursor.currentRow()['hltpathname'].data()
1702  l1seed=cursor.currentRow()['l1seed'].data()
1703  if hltpathname not in result:
1704  result[hltpathname]=l1seed
1705  return result
1706 
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 63 of file lumiQueryAPI.py.

References objects.autophobj.float.

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

Definition at line 58 of file lumiQueryAPI.py.

Referenced by deliveredLumiForRun().

58 def lslengthsec (numorbit, numbx):
59  #print numorbit, numbx
60  l = numorbit * numbx * 25.0e-09
61  return l
62 
def lslengthsec(numorbit, numbx)
Definition: lumiQueryAPI.py:58
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 1637 of file lumiQueryAPI.py.

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

1637 def lumidetailAllalgosByrun(queryHandle,runnum):
1638  '''
1639  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
1640  output: {algoname:{cmslsnum:[bxlumivalue,bxlumierror,bxlumiquality,startorbit]}}
1641  '''
1642  result={}
1643  queryHandle.addToTableList(nameDealer.lumidetailTableName(),'d')
1644  queryHandle.addToTableList(nameDealer.lumisummaryTableName(),'s')
1645  queryCondition=coral.AttributeList()
1646  queryCondition.extend('runnum','unsigned int')
1647  queryCondition['runnum'].setData(int(runnum))
1648  queryHandle.addToOutputList('s.CMSLSNUM','cmslsnum')
1649  queryHandle.addToOutputList('d.BXLUMIVALUE','bxlumivalue')
1650  queryHandle.addToOutputList('d.BXLUMIERROR','bxlumierror')
1651  queryHandle.addToOutputList('d.BXLUMIQUALITY','bxlumiquality')
1652  queryHandle.addToOutputList('d.ALGONAME','algoname')
1653  queryHandle.addToOutputList('s.STARTORBIT','startorbit')
1654  queryHandle.setCondition('s.RUNNUM=:runnum and s.LUMISUMMARY_ID=d.LUMISUMMARY_ID',queryCondition)
1655  queryResult=coral.AttributeList()
1656  queryResult.extend('cmslsnum','unsigned int')
1657  queryResult.extend('bxlumivalue','blob')
1658  queryResult.extend('bxlumierror','blob')
1659  queryResult.extend('bxlumiquality','blob')
1660  queryResult.extend('algoname','string')
1661  queryResult.extend('startorbit','unsigned int')
1662  queryHandle.addToOrderList('startorbit')
1663  queryHandle.addToOrderList('algoname')
1664  queryHandle.defineOutput(queryResult)
1665  cursor=queryHandle.execute()
1666  while next(cursor):
1667  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1668  bxlumivalue=cursor.currentRow()['bxlumivalue'].data()
1669  bxlumierror=cursor.currentRow()['bxlumierror'].data()
1670  bxlumiquality=cursor.currentRow()['bxlumiquality'].data()
1671  algoname=cursor.currentRow()['algoname'].data()
1672  startorbit=cursor.currentRow()['startorbit'].data()
1673  if algoname not in result:
1674  dataPerAlgo={}
1675  dataPerAlgo[cmslsnum]=[bxlumivalue,bxlumierror,bxlumiquality,startorbit]
1676  result[algoname]=dataPerAlgo
1677  else:
1678  result[algoname][cmslsnum]=[bxlumivalue,bxlumierror,bxlumiquality,startorbit]
1679  return result
1680 
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 1599 of file lumiQueryAPI.py.

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

1599 def lumidetailByrunByAlgo(queryHandle,runnum,algoname='OCC1'):
1600  '''
1601  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
1602  output: [[cmslsnum,bxlumivalue,bxlumierror,bxlumiquality,startorbit]]
1603  since the output is ordered by time, it has to be in seq list format
1604  '''
1605  result=[]
1606  queryHandle.addToTableList(nameDealer.lumidetailTableName(),'d')
1607  queryHandle.addToTableList(nameDealer.lumisummaryTableName(),'s')
1608  queryCondition=coral.AttributeList()
1609  queryCondition.extend('runnum','unsigned int')
1610  queryCondition.extend('algoname','string')
1611  queryCondition['runnum'].setData(int(runnum))
1612  queryCondition['algoname'].setData(algoname)
1613  queryHandle.addToOutputList('s.CMSLSNUM','cmslsnum')
1614  queryHandle.addToOutputList('d.BXLUMIVALUE','bxlumivalue')
1615  queryHandle.addToOutputList('d.BXLUMIERROR','bxlumierror')
1616  queryHandle.addToOutputList('d.BXLUMIQUALITY','bxlumiquality')
1617  queryHandle.addToOutputList('s.STARTORBIT','startorbit')
1618  queryHandle.setCondition('s.runnum=:runnum and d.algoname=:algoname and s.lumisummary_id=d.lumisummary_id',queryCondition)
1619  queryResult=coral.AttributeList()
1620  queryResult.extend('cmslsnum','unsigned int')
1621  queryResult.extend('bxlumivalue','blob')
1622  queryResult.extend('bxlumierror','blob')
1623  queryResult.extend('bxlumiquality','blob')
1624  queryResult.extend('startorbit','unsigned int')
1625  queryHandle.addToOrderList('s.STARTORBIT')
1626  queryHandle.defineOutput(queryResult)
1627  cursor=queryHandle.execute()
1628  while next(cursor):
1629  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1630  bxlumivalue=cursor.currentRow()['bxlumivalue'].data()
1631  bxlumierror=cursor.currentRow()['bxlumierror'].data()
1632  bxlumiquality=cursor.currentRow()['bxlumiquality'].data()
1633  startorbit=cursor.currentRow()['startorbit'].data()
1634  result.append([cmslsnum,bxlumivalue,bxlumierror,bxlumiquality,startorbit])
1635  return result
1636 
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 1163 of file lumiQueryAPI.py.

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

1163 def lumisumByrun(queryHandle,runnum,lumiversion,beamstatus=None,beamenergy=None,beamenergyfluctuation=0.09,finecorrections=None):
1164  '''
1165  beamenergy unit : GeV
1166  beamenergyfluctuation : fraction allowed to fluctuate around beamenergy value
1167  select instlumi from lumisummary where runnum=:runnum and lumiversion=:lumiversion
1168  output: float sum(instlumi)
1169  Note: the output is the raw result, need to apply LS length in time(sec)
1170  '''
1171  result=[]
1172  queryHandle.addToTableList(nameDealer.lumisummaryTableName())
1173  queryCondition=coral.AttributeList()
1174  queryCondition.extend('runnum','unsigned int')
1175  queryCondition.extend('lumiversion','string')
1176 
1177  queryCondition['runnum'].setData(int(runnum))
1178  queryCondition['lumiversion'].setData(lumiversion)
1179  queryHandle.addToOutputList('INSTLUMI','instlumi')
1180  conditionstring='RUNNUM=:runnum and LUMIVERSION=:lumiversion'
1181  if beamstatus and len(beamstatus)!=0:
1182  conditionstring=conditionstring+' and BEAMSTATUS=:beamstatus'
1183  queryCondition.extend('beamstatus','string')
1184  queryCondition['beamstatus'].setData(beamstatus)
1185  if beamenergy and beamenergy!=0.0:
1186  minBeamenergy=float(beamenergy*(1.0-beamenergyfluctuation))
1187  maxBeamenergy=float(beamenergy*(1.0+beamenergyfluctuation))
1188  conditionstring=conditionstring+' and BEAMENERGY>:minBeamenergy and BEAMENERGY<:maxBeamenergy'
1189  queryCondition.extend('minBeamenergy','float')
1190  queryCondition.extend('maxBeamenergy','float')
1191  queryCondition['minBeamenergy'].setData(float(minBeamenergy))
1192  queryCondition['maxBeamenergy'].setData(float(maxBeamenergy))
1193  queryHandle.setCondition(conditionstring,queryCondition)
1194  queryResult=coral.AttributeList()
1195  queryResult.extend('instlumi','float')
1196  queryHandle.defineOutput(queryResult)
1197  cursor=queryHandle.execute()
1198  while next(cursor):
1199  instlumi=cursor.currentRow()['instlumi'].data()
1200  if instlumi:
1201  if finecorrections:
1202  instlumi=lumiCorrections.applyfinecorrection(instlumi,finecorrections[0],finecorrections[1],finecorrections[2])
1203  result.append(instlumi)
1204  if result:
1205  return sum(result)
1206  else:
1207  return 0.0
1208 
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 1104 of file lumiQueryAPI.py.

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

1104 def lumisummaryByrun(queryHandle,runnum,lumiversion,beamstatus=None,beamenergy=None,beamenergyfluctuation=0.09,finecorrections=None):
1105  '''
1106  one can impose beamstatus, beamenergy selections at the SQL query level or process them later from the general result
1107  select cmslsnum,instlumi,numorbit,startorbit,beamstatus,beamenery from lumisummary where runnum=:runnum and lumiversion=:lumiversion order by startorbit;
1108  output: [[cmslsnum,instlumi,numorbit,startorbit,beamstatus,beamenergy,cmsalive]]
1109  Note: the non-cmsalive LS are included in the result
1110  '''
1111  result=[]
1112  queryHandle.addToTableList(nameDealer.lumisummaryTableName())
1113  queryCondition=coral.AttributeList()
1114  queryCondition.extend('runnum','unsigned int')
1115  queryCondition.extend('lumiversion','string')
1116  conditionstring='RUNNUM=:runnum and LUMIVERSION=:lumiversion'
1117  queryCondition['runnum'].setData(int(runnum))
1118  queryCondition['lumiversion'].setData(lumiversion)
1119  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1120  queryHandle.addToOutputList('INSTLUMI','instlumi')
1121  queryHandle.addToOutputList('NUMORBIT','numorbit')
1122  queryHandle.addToOutputList('STARTORBIT','startorbit')
1123  queryHandle.addToOutputList('BEAMSTATUS','beamstatus')
1124  queryHandle.addToOutputList('BEAMENERGY','beamenergy')
1125  queryHandle.addToOutputList('CMSALIVE','cmsalive')
1126  if beamstatus and len(beamstatus)!=0:
1127  conditionstring=conditionstring+' and BEAMSTATUS=:beamstatus'
1128  queryCondition.extend('beamstatus','string')
1129  queryCondition['beamstatus'].setData(beamstatus)
1130  if beamenergy:
1131  minBeamenergy=float(beamenergy*(1.0-beamenergyfluctuation))
1132  maxBeamenergy=float(beamenergy*(1.0+beamenergyfluctuation))
1133  conditionstring=conditionstring+' and BEAMENERGY>:minBeamenergy and BEAMENERGY<:maxBeamenergy'
1134  queryCondition.extend('minBeamenergy','float')
1135  queryCondition.extend('maxBeamenergy','float')
1136  queryCondition['minBeamenergy'].setData(float(minBeamenergy))
1137  queryCondition['maxBeamenergy'].setData(float(maxBeamenergy))
1138  queryResult=coral.AttributeList()
1139  queryResult.extend('cmslsnum','unsigned int')
1140  queryResult.extend('instlumi','float')
1141  queryResult.extend('numorbit','unsigned int')
1142  queryResult.extend('startorbit','unsigned int')
1143  queryResult.extend('beamstatus','string')
1144  queryResult.extend('beamenergy','float')
1145  queryResult.extend('cmsalive','unsigned int')
1146  queryHandle.defineOutput(queryResult)
1147  queryHandle.setCondition(conditionstring,queryCondition)
1148  queryHandle.addToOrderList('startorbit')
1149  cursor=queryHandle.execute()
1150  while next(cursor):
1151  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1152  instlumi=cursor.currentRow()['instlumi'].data()
1153  if finecorrections:
1154  instlumi=lumiCorrections.applyfinecorrection(instlumi,finecorrections[0],finecorrections[1],finecorrections[2])
1155  numorbit=cursor.currentRow()['numorbit'].data()
1156  startorbit=cursor.currentRow()['startorbit'].data()
1157  beamstatus=cursor.currentRow()['beamstatus'].data()
1158  beamenergy=cursor.currentRow()['beamenergy'].data()
1159  cmsalive=cursor.currentRow()['cmsalive'].data()
1160  result.append([cmslsnum,instlumi,numorbit,startorbit,beamstatus,beamenergy,cmsalive])
1161  return result
1162 
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 1245 of file lumiQueryAPI.py.

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

1245 def lumisummarytrgbitzeroByrun(queryHandle,runnum,lumiversion,beamstatus=None,beamenergy=None,beamenergyfluctuation=0.09,finecorrections=None):
1246  '''
1247  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;
1248  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.
1249  output: {cmslsnum:[instlumi,numorbit,startorbit,beamstatus,beamenergy,bitzerocount,deadtime,bitname,prescale]}
1250  Note: only cmsalive LS are included in the result. Therefore, this function cannot be used for calculating delivered!
1251  '''
1252  result={}
1253  queryHandle.addToTableList(nameDealer.trgTableName(),'t')
1254  queryHandle.addToTableList(nameDealer.lumisummaryTableName(),'l')
1255  queryCondition=coral.AttributeList()
1256  queryCondition.extend('bitnum','unsigned int')
1257  queryCondition.extend('runnum','unsigned int')
1258  queryCondition.extend('lumiversion','string')
1259  queryCondition['bitnum'].setData(int(0))
1260  queryCondition['runnum'].setData(int(runnum))
1261  queryCondition['lumiversion'].setData(lumiversion)
1262 
1263  queryHandle.addToOutputList('l.CMSLSNUM','cmslsnum')
1264  queryHandle.addToOutputList('l.INSTLUMI','instlumi')
1265  queryHandle.addToOutputList('l.NUMORBIT','numorbit')
1266  queryHandle.addToOutputList('l.STARTORBIT','startorbit')
1267  queryHandle.addToOutputList('l.BEAMSTATUS','beamstatus')
1268  queryHandle.addToOutputList('l.BEAMENERGY','beamenergy')
1269  queryHandle.addToOutputList('t.TRGCOUNT','trgcount')
1270  queryHandle.addToOutputList('t.DEADTIME','deadtime')
1271  queryHandle.addToOutputList('t.BITNAME','bitname')
1272  queryHandle.addToOutputList('t.PRESCALE','prescale')
1273  conditionstring='t.BITNUM=:bitnum and l.RUNNUM=:runnum and l.LUMIVERSION=:lumiversion and l.RUNNUM=t.RUNNUM and t.CMSLSNUM=l.CMSLSNUM'
1274  if beamstatus and len(beamstatus)!=0:
1275  conditionstring=conditionstring+' and l.BEAMSTATUS=:beamstatus'
1276  queryCondition.extend('beamstatus','string')
1277  queryCondition['beamstatus'].setData(beamstatus)
1278  if beamenergy and beamenergy!=0.0:
1279  minBeamenergy=float(beamenergy*(1-beamenergyfluctuation))
1280  maxBeamenergy=float(beamenergy*(1+beamenergyfluctuation))
1281  conditionstring=conditionstring+' and l.BEAMENERGY>:minBeamenergy and l.BEAMENERGY<:maxBeamenergy'
1282  queryCondition.extend('minBeamenergy','float')
1283  queryCondition.extend('maxBeamenergy','float')
1284  queryCondition['minBeamenergy'].setData(float(minBeamenergy))
1285  queryCondition['maxBeamenergy'].setData(float(maxBeamenergy))
1286  queryHandle.setCondition(conditionstring,queryCondition)
1287  queryResult=coral.AttributeList()
1288  queryResult.extend('cmslsnum','unsigned int')
1289  queryResult.extend('instlumi','float')
1290  queryResult.extend('numorbit','unsigned int')
1291  queryResult.extend('startorbit','unsigned int')
1292  queryResult.extend('beamstatus','string')
1293  queryResult.extend('beamenergy','float')
1294  queryResult.extend('trgcount','unsigned int')
1295  queryResult.extend('deadtime','unsigned int')
1296  queryResult.extend('bitname','string')
1297  queryResult.extend('prescale','unsigned int')
1298  queryHandle.defineOutput(queryResult)
1299  cursor=queryHandle.execute()
1300  while next(cursor):
1301  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1302  instlumi=cursor.currentRow()['instlumi'].data()
1303  if finecorrections:
1304  instlumi=lumiCorrections.applyfinecorrection(instlumi,finecorrections[0],finecorrections[1],finecorrections[2])
1305  numorbit=cursor.currentRow()['numorbit'].data()
1306  startorbit=cursor.currentRow()['startorbit'].data()
1307  beamstatus=cursor.currentRow()['beamstatus'].data()
1308  beamenergy=cursor.currentRow()['beamenergy'].data()
1309  trgcount=cursor.currentRow()['trgcount'].data()
1310  deadtime=cursor.currentRow()['deadtime'].data()
1311  bitname=cursor.currentRow()['bitname'].data()
1312  prescale=cursor.currentRow()['prescale'].data()
1313  if cmslsnum not in result:
1314  result[cmslsnum]=[instlumi,numorbit,startorbit,beamstatus,beamenergy,trgcount,deadtime,bitname,prescale]
1315  return result
1316 
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 878 of file lumiQueryAPI.py.

References createfilelist.int.

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

Definition at line 398 of file lumiQueryAPI.py.

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

Definition at line 685 of file lumiQueryAPI.py.

References relativeConstraints.keys.

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

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

Definition at line 535 of file lumiQueryAPI.py.

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

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

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

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

Referenced by recordedLumiForRange().

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

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

1707 def runsByfillrange(queryHandle,minFill,maxFill):
1708  '''
1709  find all runs in the fill range inclusive
1710  select runnum,fillnum from cmsrunsummary where fillnum>=:minFill and fillnum<=:maxFill
1711  output: fillDict={fillnum:[runlist]}
1712  '''
1713  result={}
1714  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
1715  queryCondition=coral.AttributeList()
1716  queryCondition.extend('minFill','unsigned int')
1717  queryCondition.extend('maxFill','unsigned int')
1718  queryCondition['minFill'].setData(int(minFill))
1719  queryCondition['maxFill'].setData(int(maxFill))
1720  queryHandle.addToOutputList('RUNNUM','runnum')
1721  queryHandle.addToOutputList('FILLNUM','fillnum')
1722  queryHandle.setCondition('FILLNUM>=:minFill and FILLNUM<=:maxFill',queryCondition)
1723  queryResult=coral.AttributeList()
1724  queryResult.extend('runnum','unsigned int')
1725  queryResult.extend('fillnum','unsigned int')
1726  queryHandle.defineOutput(queryResult)
1727  cursor=queryHandle.execute()
1728  while next(cursor):
1729  runnum=cursor.currentRow()['runnum'].data()
1730  fillnum=cursor.currentRow()['fillnum'].data()
1731  if fillnum not in result:
1732  result[fillnum]=[runnum]
1733  else:
1734  result[fillnum].append(runnum)
1735  return result
1736 
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 1737 of file lumiQueryAPI.py.

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

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

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

1068 def runsummaryByrun(queryHandle,runnum):
1069  '''
1070  select fillnum,sequence,hltkey,to_char(starttime),to_char(stoptime) from cmsrunsummary where runnum=:runnum
1071  output: [fillnum,sequence,hltkey,starttime,stoptime]
1072  '''
1073  t=lumiTime.lumiTime()
1074  result=[]
1075  queryHandle.addToTableList(nameDealer.cmsrunsummaryTableName())
1076  queryCondition=coral.AttributeList()
1077  queryCondition.extend('runnum','unsigned int')
1078  queryCondition['runnum'].setData(int(runnum))
1079  queryHandle.addToOutputList('FILLNUM','fillnum')
1080  queryHandle.addToOutputList('SEQUENCE','sequence')
1081  queryHandle.addToOutputList('HLTKEY','hltkey')
1082  queryHandle.addToOutputList('to_char(STARTTIME,\''+t.coraltimefm+'\')','starttime')
1083  queryHandle.addToOutputList('to_char(STOPTIME,\''+t.coraltimefm+'\')','stoptime')
1084  queryHandle.setCondition('RUNNUM=:runnum',queryCondition)
1085  queryResult=coral.AttributeList()
1086  queryResult.extend('fillnum','unsigned int')
1087  queryResult.extend('sequence','string')
1088  queryResult.extend('hltkey','string')
1089  queryResult.extend('starttime','string')
1090  queryResult.extend('stoptime','string')
1091  queryHandle.defineOutput(queryResult)
1092  cursor=queryHandle.execute()
1093  while next(cursor):
1094  result.append(cursor.currentRow()['fillnum'].data())
1095  result.append(cursor.currentRow()['sequence'].data())
1096  result.append(cursor.currentRow()['hltkey'].data())
1097  result.append(cursor.currentRow()['starttime'].data())
1098  result.append(cursor.currentRow()['stoptime'].data())
1099  #if len(result)!=5:
1100  # print 'wrong runsummary result'
1101  # raise
1102  return result
1103 
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 890 of file lumiQueryAPI.py.

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

Definition at line 432 of file lumiQueryAPI.py.

433  result = []
434  first = inPut[0]
435  last = inPut[0]
436  result.append ([inPut[0]])
437  counter = 0
438  for i in inPut[1:]:
439  if i == last+1:
440  result[counter].append (i)
441  else:
442  counter += 1
443  result.append ([i])
444  last = i
445  return ', '.join (['['+str (min (x))+'-'+str (max (x))+']' for x in result])
446 
447 
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 1353 of file lumiQueryAPI.py.

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

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

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

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

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

1317 def trgBybitnameByrun(queryHandle,runnum,bitname):
1318  '''
1319  select cmslsnum,trgcount,deadtime,bitnum,prescale from trg where runnum=:runnum and bitname=:bitname;
1320  output: {cmslsnum:[trgcount,deadtime,bitnum,prescale]}
1321  '''
1322  result={}
1323  queryHandle.addToTableList(nameDealer.trgTableName())
1324  queryCondition=coral.AttributeList()
1325  queryCondition.extend('runnum','unsigned int')
1326  queryCondition.extend('bitname','string')
1327  queryCondition['runnum'].setData(int(runnum))
1328  queryCondition['bitname'].setData(bitname)
1329  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1330  queryHandle.addToOutputList('TRGCOUNT','trgcount')
1331  queryHandle.addToOutputList('DEADTIME','deadtime')
1332  queryHandle.addToOutputList('BITNUM','bitnum')
1333  queryHandle.addToOutputList('PRESCALE','prescale')
1334  queryHandle.setCondition('RUNNUM=:runnum and BITNAME=:bitname',queryCondition)
1335  queryResult=coral.AttributeList()
1336  queryResult.extend('cmslsnum','unsigned int')
1337  queryResult.extend('trgcount','unsigned int')
1338  queryResult.extend('deadtime','unsigned long long')
1339  queryResult.extend('bitnum','unsigned int')
1340  queryResult.extend('prescale','unsigned int')
1341  queryHandle.defineOutput(queryResult)
1342  cursor=queryHandle.execute()
1343  while next(cursor):
1344  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1345  trgcount=cursor.currentRow()['trgcount'].data()
1346  deadtime=cursor.currentRow()['deadtime'].data()
1347  bitnum=cursor.currentRow()['bitnum'].data()
1348  prescale=cursor.currentRow()['prescale'].data()
1349  if cmslsnum not in result:
1350  result[cmslsnum]=[trgcount,deadtime,bitnum,prescale]
1351  return result
1352 
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 999 of file lumiQueryAPI.py.

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

999 def validation(queryHandle,run=None,cmsls=None):
1000  '''retrieve validation data per run or all
1001  input: run. if not run, retrive all; if cmslsnum selection list pesent, filter out unselected result
1002  output: {run:[[cmslsnum,status,comment]]}
1003  '''
1004  result={}
1005  queryHandle.addToTableList(nameDealer.lumivalidationTableName())
1006  queryHandle.addToOutputList('RUNNUM','runnum')
1007  queryHandle.addToOutputList('CMSLSNUM','cmslsnum')
1008  queryHandle.addToOutputList('FLAG','flag')
1009  queryHandle.addToOutputList('COMMENT','comment')
1010  if run:
1011  queryCondition='RUNNUM=:runnum'
1012  queryBind=coral.AttributeList()
1013  queryBind.extend('runnum','unsigned int')
1014  queryBind['runnum'].setData(run)
1015  queryHandle.setCondition(queryCondition,queryBind)
1016  queryResult=coral.AttributeList()
1017  queryResult.extend('runnum','unsigned int')
1018  queryResult.extend('cmslsnum','unsigned int')
1019  queryResult.extend('flag','string')
1020  queryResult.extend('comment','string')
1021  queryHandle.defineOutput(queryResult)
1022  cursor=queryHandle.execute()
1023  while next(cursor):
1024  runnum=cursor.currentRow()['runnum'].data()
1025  if runnum not in result:
1026  result[runnum]=[]
1027  cmslsnum=cursor.currentRow()['cmslsnum'].data()
1028  flag=cursor.currentRow()['flag'].data()
1029  comment=cursor.currentRow()['comment'].data()
1030  result[runnum].append([cmslsnum,flag,comment])
1031  if run and cmsls and len(cmsls)!=0:
1032  selectedresult={}
1033  for runnum,perrundata in result.items():
1034  for lsdata in perrundata:
1035  if lsdata[0] not in cmsls:
1036  continue
1037  if runnum not in selectedresult:
1038  selectedresult[runnum]=[]
1039  selectedresult[runnum].append(lsdata)
1040  return selectedresult
1041  else:
1042  return result
1043 
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 778 of file lumiQueryAPI.py.

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

Referenced by dumpOverview().

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

Variable Documentation

lumiQueryAPI.accessMode

Definition at line 1780 of file lumiQueryAPI.py.

Referenced by cond::CredentialStore.openSession().

lumiQueryAPI.allfills

Definition at line 1843 of file lumiQueryAPI.py.

Referenced by allfills().

lumiQueryAPI.allruns

Definition at line 1785 of file lumiQueryAPI.py.

Referenced by allruns().

lumiQueryAPI.connectstr

Definition at line 1779 of file lumiQueryAPI.py.

lumiQueryAPI.msg

Definition at line 1774 of file lumiQueryAPI.py.

lumiQueryAPI.q

Definition at line 1842 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(), NamedCandCombinerBase.combine(), CandCombinerBase< OutputCollection, CandPtr >.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(), L2MuonCandidateProducer.produce(), TrackListMerger.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(), CMSmplIonisationWithDeltaModel.SampleSecondaries(), 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(), L1MuGMTLFMergeRankEtaQLUT.SpecificLookup_rank_etaq(), L1MuGMTLFSortRankEtaQLUT.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 1785 of file lumiQueryAPI.py.

lumiQueryAPI.requireLumisummary

Definition at line 1785 of file lumiQueryAPI.py.

lumiQueryAPI.requireTrg

Definition at line 1785 of file lumiQueryAPI.py.

lumiQueryAPI.schema

Definition at line 1784 of file lumiQueryAPI.py.

lumiQueryAPI.session

Definition at line 1780 of file lumiQueryAPI.py.

lumiQueryAPI.svc

Definition at line 1778 of file lumiQueryAPI.py.

lumiQueryAPI.True

Definition at line 1785 of file lumiQueryAPI.py.