1 import os,coral,datetime,fnmatch,time
2 from RecoLuminosity.LumiDB
import nameDealer,revisionDML,dataDML,lumiTime,CommonUtil,selectionParser,hltTrgSeedMapper,normFunctors,lumiParameters
12 output [[run(0),l1key(1),amodetag(2),egev(3),hltkey(4),fillnum(5),fillscheme(6),starttime(7),stoptime(8)]] 15 for run
in sorted(irunlsdict):
18 result.append(runinfo)
23 output: {run:[l1key(0),amodetag(1),egev(2),hltkey(3),fillnum(4),fillscheme(5),starttime(6),stoptime(7)]} 28 for [run,l1key,amodetag,hltkey,fillnum,fillscheme]
in seqresult:
30 startT=idresult[run][3]
31 stopT=idresult[run][4]
32 result[run]=[l1key,amodetag,egev,hltkey,fillnum,fillscheme,startT,stopT]
35 def fillInRange(schema,fillmin=1000,fillmax=9999,amodetag='PROTPHYS',startT=None,stopT=None):
41 def fillrunMap(schema,fillnum=None,runmin=None,runmax=None,startT=None,stopT=None,l1keyPattern=None,hltkeyPattern=None,amodetag=None):
43 output: {fill:[runnum,...]} 45 return dataDML.fillrunMap(schema,fillnum=fillnum,runmin=runmin,runmax=runmax,startT=startT,stopT=stopT,l1keyPattern=l1keyPattern,hltkeyPattern=hltkeyPattern,amodetag=amodetag)
47 def runList(schema,datatagid,runmin=None,runmax=None,fillmin=None,fillmax=None,startT=None,stopT=None,l1keyPattern=None,hltkeyPattern=None,amodetag=None,nominalEnergy=None,energyFlut=0.2,requiretrg=True,requirehlt=True,preselectedruns=None,lumitype='HF'):
49 output: [runnumber,...] 51 return dataDML.runList(schema,datatagid,runmin=runmin,runmax=runmax,fillmin=fillmin,fillmax=fillmax,startT=startT,stopT=stopT,l1keyPattern=l1keyPattern,hltkeyPattern=hltkeyPattern,amodetag=amodetag,nominalEnergy=nominalEnergy,energyFlut=energyFlut,requiretrg=requiretrg,requirehlt=requirehlt,lumitype=lumitype)
55 input: runlist [run], (required) 56 datatag: data version (optional) 57 output : {runnumber,[(hltpath,l1seedexpr,l1bitname)...]} 63 for hltpath
in sorted(hlttrgmap):
64 l1seedexpr=hlttrgmap[hltpath]
72 result[run].
append((hltpath,l1seedexpr,l1bitname))
75 def beamForRange(schema,inputRange,withBeamIntensity=False,minIntensity=0.1,tableName=None,branchName=None):
78 inputRange: {run:[cmsls]} (required) 79 output : {runnumber:[(lumicmslnum,cmslsnum,beamenergy,beamstatus,[(ibx,b1,b2)])...](4)} 83 if branchName
is None:
86 for run
in inputRange.keys():
87 lslist=inputRange[run]
88 if lslist
is not None and len(lslist)==0:
91 lumidataid=dataDML.guessLumiDataIdByRun(schema,run,tableName)
92 if lumidataid
is None:
95 lumidata=
dataDML.beamInfoById(schema,lumidataid,withBeamIntensity=withBeamIntensity,minIntensity=minIntensity)
98 perrundata=lumidata[1]
102 for perlsdata
in perrundata:
103 lumilsnum=perlsdata[0]
104 cmslsnum=perlsdata[1]
105 if lslist
is not None and cmslsnum
not in lslist:
107 beamstatus=perlsdata[2]
108 beamenergy=perlsdata[3]
110 if withBeamIntensity:
111 beamintInfolist=perlsdata[4]
112 result[run].
append((lumilsnum,cmslsnum,beamstatus,beamenergy,beamintInfolist))
115 def beamForIds(schema,irunlsdict,dataidmap,withBeamIntensity=False,minIntensity=0.1):
118 inputRange: {run:[cmsls]} (required) 119 dataidmap: {run:(lumiid,trgid,hltid)} 120 output : {runnumber:[(lumicmslnum(0),cmslsnum(1),beamenergy(2),beamstatus(3),ncollidingbx(4),[(ibx,b1,b2)])...](5)} 123 for run
in irunlsdict.keys():
125 lslist=irunlsdict[run]
126 if lslist
is not None and len(lslist)==0:
128 if run
not in dataidmap:
130 lumidataid=dataidmap[run][0]
131 if lumidataid
is None:
134 lumidata=
dataDML.beamInfoById(schema,lumidataid,withBeamIntensity=withBeamIntensity,minIntensity=minIntensity)
136 if lumidata
and lumidata[1]:
137 perrundata=lumidata[1]
138 for perlsdata
in perrundata:
139 lumilsnum=perlsdata[0]
140 cmslsnum=perlsdata[1]
141 if lslist
is not None and cmslsnum
not in lslist:
143 beamstatus=perlsdata[2]
144 beamenergy=perlsdata[3]
145 ncollidingbunches=perlsdata[4]
147 if withBeamIntensity:
148 beamintInfolist=perlsdata[5]
149 result[run].
append((lumilsnum,cmslsnum,beamstatus,beamenergy,ncollidingbunches,beamintInfolist))
152 def hltForIds(schema,irunlsdict,dataidmap,hltpathname=None,hltpathpattern=None,withL1Pass=False,withHLTAccept=False):
155 irunlsdict: {run:[cmsls]} (required) 156 dataidmap: {run:(lumiid,trgid,hltid)} 157 hltpathname: exact match hltpathname (optional) 158 hltpathpattern: regex match hltpathpattern (optional) 159 withL1Pass: with L1 pass count 160 withHLTAccept: with HLT accept 161 output: {runnumber:[(cmslsnum,[(hltpath,hltprescale,l1pass,hltaccept),...]),(cmslsnum,[])})} 164 for run
in irunlsdict.keys():
165 lslist=irunlsdict[run]
166 if lslist
is not None and len(lslist)==0:
169 if run
not in dataidmap:
171 hltdataid=dataidmap[run][2]
172 if hltdataid
is None:
175 hltdata=
dataDML.hltLSById(schema,hltdataid,hltpathname=hltpathname,hltpathpattern=hltpathpattern,withL1Pass=withL1Pass,withHLTAccept=withHLTAccept)
178 if hltdata
and hltdata[1]:
180 for cmslsnum
in sorted(hltdata[1]):
181 if lslist
is not None and cmslsnum
not in lslist:
184 for perpathdata
in hltdata[1][cmslsnum]:
185 pathname=perpathdata[0]
186 prescale=perpathdata[1]
190 l1pass=perpathdata[2]
192 hltaccept=perpathdata[3]
193 lsdata.append((pathname,prescale,l1pass,hltaccept))
194 result[run].
append((cmslsnum,lsdata))
197 def trgForIds(schema,irunlsdict,dataidmap,trgbitname=None,trgbitnamepattern=None,withL1Count=False,withPrescale=False):
200 irunlsdict {run:[cmsls]} (required) 201 dataidmap: {run:(lumiid,trgid,hltid)} 202 trgbitname exact match trgbitname (optional) 203 trgbitnamepattern match trgbitname (optional) 205 result {run:[[cmslsnum(0),deadfrac(1),deadtimecount(2),bitzero_count(3),bitzero_prescale(4),[(bitname,prescale,counts,mask)](5)]]} 208 for run
in irunlsdict.keys():
210 lslist=irunlsdict[run]
211 if lslist
is not None and len(lslist)==0:
214 if run
not in dataidmap:
216 trgdataid=dataidmap[run][1]
217 if trgdataid
is None:
222 trgdata=
dataDML.trgLSById(schema,trgdataid,trgbitname=trgbitname,trgbitnamepattern=trgbitnamepattern,withL1Count=withL1Count,withPrescale=withPrescale)
225 if trgdata
and trgdata[1]:
227 for cmslsnum
in sorted(trgdata[1]):
228 if lslist
is not None and cmslsnum
not in lslist:
232 deadtimecount=trgdata[1][cmslsnum][0]
237 deadfrac=trgdata[1][cmslsnum][3]
238 if deadfrac<0
or deadfrac>1.0:
240 allbitsinfo=trgdata[1][cmslsnum][4]
241 lsdata.append(cmslsnum)
242 lsdata.append(deadfrac)
243 lsdata.append(deadtimecount)
244 lsdata.append(bitzerocount)
245 lsdata.append(bitzeroprescale)
246 lsdata.append(allbitsinfo)
247 result[run].
append(lsdata)
250 def instLumiForIds(schema,irunlsdict,dataidmap,runsummaryMap,beamstatusfilter=None,timeFilter=None,withBXInfo=False,bxAlgo=None,xingMinLum=None,withBeamIntensity=False,lumitype='HF'):
252 FROM ROOT FILE NO CORRECTION AT ALL 254 irunlsdict: {run:[cmsls]} 255 dataidmap: {run:(lumiid,trgid,hltid)} 256 runsummaryMap: {run:[l1key(0),amodetag(1),egev(2),hltkey(3),fillnum(4),fillscheme(5),starttime(6),stoptime(7)]} 257 beamstatus: LS filter on beamstatus (optional) 258 timeFilter: (minLSBegTime,maxLSBegTime) 259 withBXInfo: get per bunch info (optional) 260 bxAlgo: algoname for bx values (optional) ['OCC1','OCC2','ET'] 261 xingMinLum: None means apply no cut 262 withBeamIntensity: get beam intensity info (optional) 263 lumitype: luminosity measurement source 265 result {run:[lumilsnum(0),cmslsnum(1),timestamp(2),beamstatus(3),beamenergy(4),instlumi(5),instlumierr(6),startorbit(7),numorbit(8),(bxidx,bxvalues,bxerrs)(9),(bxidx,b1intensities,b2intensities)(10),fillnum(11)]}} 268 {run:None} None means selected run not in lumiDB, 269 {run:[]} [] means no lumi data for this run in lumiDB 270 {run:cmslsnum(1)==0} means either not cmslsnum or iscms but not selected 271 instlumi unit in Hz/ub 273 if lumitype
not in [
'HF',
'PIXEL']:
274 raise ValueError(
'unknown lumitype '+lumitype)
284 for run
in irunlsdict.keys():
286 lslist=irunlsdict[run]
287 if lslist
is not None and len(lslist)==0:
290 fillnum=runsummaryMap[run][4]
291 runstarttimeStr=runsummaryMap[run][6]
292 if run
not in dataidmap:
295 (lumidataid,trgid,hltid )=dataidmap[run]
296 if lumidataid
is None:
299 (lumirunnum,perlsresult)=
dataDML.lumiLSById(schema,lumidataid,beamstatus=beamstatusfilter,withBXInfo=withBXInfo,bxAlgo=bxAlgo,withBeamIntensity=withBeamIntensity,tableName=lumilstableName)
302 for lumilsnum
in perlsresult.keys():
303 perlsdata=perlsresult[lumilsnum]
304 cmslsnum=perlsdata[0]
305 if lslist
is not None and cmslsnum
not in lslist:
307 numorbit=perlsdata[6]
308 startorbit=perlsdata[7]
309 orbittime=c.OrbitToTime(runstarttimeStr,startorbit,begorbit=0,customfm=
'%m/%d/%y %H:%M:%S')
312 if orbittime<timeFilter[0]:
continue 314 if orbittime>timeFilter[1]:
continue 316 instlumi=perlsdata[1]*1000.0
317 instlumierr=perlsdata[2]*1000.0
319 instlumi=perlsdata[1]
320 instlumierr=perlsdata[2]
321 beamstatus=perlsdata[4]
322 beamenergy=perlsdata[5]
333 bxvalueArray=bxinfo[0]
336 for idx,bxval
in enumerate(bxvalueArray):
338 bxidxlist.append(idx)
339 bxvaluelist.append(bxval)
340 bxerrorlist.append(bxerrArray[idx])
342 bxidxlist=range(0,len(bxvalueArray))
343 bxvaluelist=bxvalueArray.tolist()
344 bxerrorlist=bxerrArray.tolist()
347 bxdata=(bxidxlist,bxvaluelist,bxerrorlist)
348 if withBeamIntensity:
349 beaminfo=perlsdata[9]
353 if beaminfo[0]
and beaminfo[1]
and beaminfo[2]:
354 bxindexarray=beaminfo[0]
355 beam1intensityarray=beaminfo[1]
356 beam2intensityarray=beaminfo[2]
357 bxindexlist=bxindexarray.tolist()
358 b1intensitylist=beam1intensityarray.tolist()
359 b2intensitylist=beam2intensityarray.tolist()
361 del beam1intensityarray[:]
362 del beam2intensityarray[:]
363 beamdata=(bxindexlist,b1intensitylist,b2intensitylist)
364 lsresult.append([lumilsnum,cmslsnum,orbittime,beamstatus,beamenergy,instlumi,instlumierr,startorbit,numorbit,bxdata,beamdata,fillnum])
369 def deliveredLumiForIds(schema,irunlsdict,dataidmap,runsummaryMap,beamstatusfilter=None,timeFilter=None,normmap=None,withBXInfo=False,bxAlgo=None,xingMinLum=None,withBeamIntensity=False,lumitype='HF',minbiasXsec=None):
371 delivered lumi (including calibration,time integral) 373 irunlsdict: {run:[lsnum]}, where [lsnum]==None means all ; [lsnum]==[] means selected ls 374 dataidmap : {run:(lumiid,trgid,hltid)} 375 runsummaryMap: {run:[l1key(0),amodetag(1),egev(2),hltkey(3),fillnum(4),fillscheme(5),starttime(6),stoptime(7)]} 376 beamstatus: LS filter on beamstatus 377 normmap: {since:[corrector(0),{paramname:paramvalue}(1),amodetag(2),egev(3),comment(4)]} if normmap empty, means without-correction , if notnormmap means without-correction 378 withBXInfo: get per bunch info (optional) 379 bxAlgo: algoname for bx values (optional) ['OCC1','OCC2','ET'] 380 xingMinLum: cut on bx lumi value (optional) 381 withBeamIntensity: get beam intensity info (optional) 382 lumitype: luminosity source 384 result {run:[lumilsnum(0),cmslsnum(1),timestamp(2),beamstatus(3),beamenergy(4),deliveredlumi(5),calibratedlumierr(6),(bxidxlist,bxvalues,bxerrs)(7),(bxidx,b1intensities,b2intensities)(8),fillnum(9),pu(10)]} 387 {run:None} None means no run in lumiDB, 388 {run:[]} [] means no lumi for this run in lumiDB 389 {run:cmslsnum(1)==0} means either not cmslsnum or iscms but not selected 395 instresult=
instLumiForIds(schema,irunlsdict,dataidmap,runsummaryMap,beamstatusfilter=beamstatusfilter,timeFilter=timeFilter,withBXInfo=withBXInfo,bxAlgo=bxAlgo,withBeamIntensity=withBeamIntensity,lumitype=lumitype)
402 allsince=normmap.keys()
404 correctorname=
'fPoly' 405 correctionparams={
'a0':1.0}
407 fillschemePatternMap={}
408 if lumitype==
'PIXEL':
409 correctorname=
'fPolyScheme' 411 for run,perrundata
in instresult.items():
412 if perrundata
is None:
416 if normmap
and intglumimap
and run
in intglumimap
and intglumimap[run]:
417 intglumi=intglumimap[run]
419 if normmap
and lumirundata
and run
in lumirundata
and lumirundata[run][2]:
420 nBXs=lumirundata[run][2]
422 if normmap
and runsummaryMap
and run
in runsummaryMap
and runsummaryMap[run][5]:
423 fillschemeStr=runsummaryMap[run][5]
425 lastsince=allsince[0]
426 for since
in allsince:
429 correctorname=normmap[lastsince][0]
430 correctionparams=normmap[lastsince][1]
432 correctioninput=[0.,intglumi,nBXs,fillschemeStr,fillschemePatternMap]
434 for perlsdata
in perrundata:
435 lumilsnum=perlsdata[0]
436 cmslsnum=perlsdata[1]
437 timestamp=perlsdata[2]
439 beamenergy=perlsdata[4]
440 instluminonorm=perlsdata[5]
441 correctioninput[0]=instluminonorm
443 fillnum=perlsdata[11]
444 instcorrectedlumi=totcorrectionFac*instluminonorm
445 numorbit=perlsdata[8]
447 lslen=lumip.lslengthsec()
448 deliveredlumi=instcorrectedlumi*lslen
449 calibratedbxdata=
None 452 if nBXs
and minbiasXsec:
453 pu=(instcorrectedlumi/nBXs)*minbiasXsec/lumip.rotationRate
455 (bxidxData,bxvaluesData,bxerrsData)=perlsdata[9]
461 for idx,bxval
in enumerate(bxvaluesData):
462 correctedbxintlumi=totcorrectionFac*bxval
463 correctedbxintlumierr=totcorrectionFac*bxerrsData[idx]
464 if correctedbxintlumi>xingMinLum:
465 bxidxList.append(bxidxData[idx])
466 bxvalueList.append(correctedbxintlumi)
467 bxerrList.append(correctedbxintlumierr)
468 calibratedbxdata=(bxidxList,bxvalueList,bxerrList)
470 calibratedbxvalue=[totcorrectionFac*x
for x
in bxvaluesData]
471 calibratedlumierr=[totcorrectionFac*x
for x
in bxerrsData]
472 calibratedbxdata=(bxidxData,calibratedbxvalue,calibratedlumierr)
473 if withBeamIntensity:
474 beamdata=perlsdata[10]
475 calibratedlumierr=0.0
476 result[run].
append([lumilsnum,cmslsnum,timestamp,bs,beamenergy,deliveredlumi,calibratedlumierr,calibratedbxdata,beamdata,fillnum,pu])
480 def lumiForIds(schema,irunlsdict,dataidmap,runsummaryMap,beamstatusfilter=None,timeFilter=None,normmap=None,withBXInfo=False,bxAlgo=None,xingMinLum=None,withBeamIntensity=False,lumitype='HF',minbiasXsec=None):
482 delivered/recorded lumi (including calibration,time integral) 484 irunlsdict: {run:[lsnum]}, where [lsnum]==None means all ; [lsnum]==[] means no selected ls 485 dataidmap : {run:(lumiid,trgid,hltid)} 486 runsummaryMap: {run:[l1key(0),amodetag(1),egev(2),hltkey(3),fillnum(4),fillscheme(5),starttime(6),stoptime(7)]} 487 beamstatus: LS filter on beamstatus 489 withBXInfo: get per bunch info (optional) 490 bxAlgo: algoname for bx values (optional) ['OCC1','OCC2','ET'] 491 xingMinLum: cut on bx lumi value (optional) 492 withBeamIntensity: get beam intensity info (optional) 493 lumitype: luminosity source 495 result {run:[[lumilsnum(0),cmslsnum(1),timestamp(2),beamstatus(3),beamenergy(4),deliveredlumi(5),recordedlumi(6),calibratedlumierror(7),(bxidx,bxvalues,bxerrs)(8),(bxidx,b1intensities,b2intensities)(9),fillnum(10),ncollidingbunches(11)]...]} 497 {run:None} None means no run in lumiDB, 498 {run:[]} [] means no lumi for this run in lumiDB 499 {run:[....deliveredlumi(5),recordedlumi(6)None]} means no trigger in lumiDB 500 {run:cmslsnum(1)==0} means either not cmslsnum or is cms but not selected, therefore set recordedlumi=0,efflumi=0 503 deliveredresult=
deliveredLumiForIds(schema,irunlsdict,dataidmap,runsummaryMap,beamstatusfilter=beamstatusfilter,timeFilter=timeFilter,normmap=normmap,withBXInfo=withBXInfo,bxAlgo=bxAlgo,xingMinLum=xingMinLum,withBeamIntensity=withBeamIntensity,lumitype=lumitype,minbiasXsec=minbiasXsec)
504 trgresult=
trgForIds(schema,irunlsdict,dataidmap)
505 for run
in deliveredresult.keys():
506 perrundata=deliveredresult[run]
507 if perrundata
is None or len(perrundata)==0:
510 if run
in trgresult
and trgresult[run]:
511 alltrgls=[x[0]
for x
in trgresult[run]]
512 for perlsdata
in perrundata:
513 if not perlsdata:
continue 514 perlsdata.insert(6,
None)
515 if not alltrgls:
continue 516 cmslsnum=perlsdata[1]
521 trglsidx=alltrgls.index(cmslsnum)
522 deadfrac=trgresult[run][trglsidx][1]
523 if deadfrac<0
or deadfrac>1.0: deadfrac=1.0
524 deliveredlumi=perlsdata[5]
525 recordedlumi=(1.0-deadfrac)*deliveredlumi
529 perlsdata[6]=recordedlumi
530 return deliveredresult
532 def effectiveLumiForIds(schema,irunlsdict,dataidmap,runsummaryMap=None,beamstatusfilter=None,timeFilter=None,normmap=None,hltpathname=None,hltpathpattern=None,withBXInfo=False,bxAlgo=None,xingMinLum=None,withBeamIntensity=False,lumitype='HF',minbiasXsec=None):
534 delivered/recorded/eff lumi in selected hlt path (including calibration,time integral) 536 irunlsdict: {run:[lsnum]}, where [lsnum]==None means all ; [lsnum]==[] means selected ls 537 dataidmap : {run:(lumiid,trgid,hltid)} 538 runsummaryMap: {run:[l1key(0),amodetag(1),egev(2),hltkey(3),fillnum(4),fillscheme(5),starttime(6),stoptime(7)]} 539 beamstatusfilter: LS filter on beamstatus 540 normmap: {since:[corrector(0),{paramname:paramvalue}(1),amodetag(2),egev(3),comment(4)]} if normmap empty, means without-correction , if notnormmap means without-correction 541 hltpathname: selected hltpathname 542 hltpathpattern: regex select hltpaths 543 withBXInfo: get per bunch info (optional) 544 bxAlgo: algoname for bx values (optional) ['OCC1','OCC2','ET'] 545 xingMinLum: cut on bx lumi value (optional) 546 withBeamIntensity: get beam intensity info (optional) 547 lumitype: luminosity source 549 result {run:[lumilsnum(0),cmslsnum(1),timestamp(2),beamstatus(3),beamenergy(4),deliveredlumi(5),recordedlumi(6),calibratedlumierror(7),{hltpath:[l1name,l1prescale,hltprescale,efflumi]}(8),bxdata(9),beamdata(10),fillnum(11),ncollidingbunches(12)]} 550 {run:None} None means no run in lumiDB, 551 {run:[]} [] means no lumi for this run in lumiDB 552 {run:[....deliveredlumi(5),recorded(6)==None,]} means no trigger in lumiDB 553 {run:[....deliveredlumi(5),recorded(6),calibratedlumierror(7)==None]} means no hlt in lumiDB 557 deliveredresult=
deliveredLumiForIds(schema,irunlsdict,dataidmap,runsummaryMap,beamstatusfilter=beamstatusfilter,timeFilter=timeFilter,normmap=normmap,withBXInfo=withBXInfo,bxAlgo=bxAlgo,xingMinLum=xingMinLum,withBeamIntensity=withBeamIntensity,lumitype=lumitype,minbiasXsec=minbiasXsec)
558 trgresult=
trgForIds(schema,irunlsdict,dataidmap,withPrescale=
True)
559 hltresult=
hltForIds(schema,irunlsdict,dataidmap,hltpathname=hltpathname,hltpathpattern=hltpathpattern,withL1Pass=
False,withHLTAccept=
False)
560 for run
in deliveredresult.keys():
561 perrundata=deliveredresult[run]
562 if perrundata
is None or len(perrundata)==0:
565 if run
in trgresult
and trgresult[run]:
566 alltrgls=[x[0]
for x
in trgresult[run]]
568 if run
in hltresult
and hltresult[run]:
569 allhltls=[x[0]
for x
in hltresult[run]]
574 for perlsdata
in perrundata:
575 if not perlsdata:
continue 576 perlsdata.insert(6,
None)
577 perlsdata.insert(8,
None)
578 if not alltrgls:
continue 579 cmslsnum=perlsdata[1]
585 trglsidx=alltrgls.index(cmslsnum)
586 deadfrac=trgresult[run][trglsidx][1]
587 l1bitinfo=trgresult[run][trglsidx][5]
588 if deadfrac<0
or deadfrac>1.0:deadfrac=1.0
589 deliveredlumi=perlsdata[5]
590 recordedlumi=(1.0-deadfrac)*deliveredlumi
594 perlsdata[6]=recordedlumi
595 if not allhltls:
continue 597 hltlsidx=allhltls.index(cmslsnum)
603 for thisbitinfo
in l1bitinfo:
604 thisbitname=thisbitinfo[0]
605 thisbitprescale=thisbitinfo[2]
606 trgprescalemap[
'"'+thisbitname+
'"']=thisbitprescale
609 hltpathdata=hltresult[run][hltlsidx][1]
611 for pathidx,thispathinfo
in enumerate(hltpathdata):
612 thispathname=thispathinfo[0]
613 thisprescale=thispathinfo[1]
618 thisl1seed=hlttrgmap[thispathname]
627 l1prescale=trgprescalemap[l1bits[0]]
632 l1p=trgprescalemap[bit]
634 if l1p!=0
and l1p<pmin:
639 if l1p!=0
and l1p>pmax:
649 if l1prescale
and thisprescale:
650 efflumi=recordedlumi/(
float(l1prescale)*
float(thisprescale))
651 efflumidict[thispathname]=[l1bitname,l1prescale,thisprescale,efflumi]
652 elif l1prescale
and thisprescale==0:
653 efflumidict[thispathname]=[l1bitname,l1prescale,thisprescale,efflumi]
655 efflumidict[thispathname]=[
None,0,thisprescale,efflumi]
656 perlsdata[8]=efflumidict
657 return deliveredresult
def runList(schema, datatagid, runmin=None, runmax=None, fillmin=None, fillmax=None, startT=None, stopT=None, l1keyPattern=None, hltkeyPattern=None, amodetag=None, nominalEnergy=None, energyFlut=0.2, requiretrg=True, requirehlt=True, preselectedruns=None, lumitype=None)
def effectiveLumiForIds(schema, irunlsdict, dataidmap, runsummaryMap=None, beamstatusfilter=None, timeFilter=None, normmap=None, hltpathname=None, hltpathpattern=None, withBXInfo=False, bxAlgo=None, xingMinLum=None, withBeamIntensity=False, lumitype='HF', minbiasXsec=None)
def lumisummaryv2TableName()
def hltpathsForRange(schema, runlist, hltpathname=None, hltpathpattern=None)
def beamForRange(schema, inputRange, withBeamIntensity=False, minIntensity=0.1, tableName=None, branchName=None)
def normFunctionCaller(funcName, args, kwds)
def runsummaryMap(schema, irunlsdict, dataidmap, lumitype='HF')
def lumiLSById(schema, dataid, beamstatus=None, withBXInfo=False, bxAlgo='OCC1', withBeamIntensity=False, tableName=None)
def lumiForIds(schema, irunlsdict, dataidmap, runsummaryMap, beamstatusfilter=None, timeFilter=None, normmap=None, withBXInfo=False, bxAlgo=None, xingMinLum=None, withBeamIntensity=False, lumitype='HF', minbiasXsec=None)
def hltForIds(schema, irunlsdict, dataidmap, hltpathname=None, hltpathpattern=None, withL1Pass=False, withHLTAccept=False)
def intglumiForRange(schema, runlist)
def beamForIds(schema, irunlsdict, dataidmap, withBeamIntensity=False, minIntensity=0.1)
def fillrunMap(schema, fillnum=None, runmin=None, runmax=None, startT=None, stopT=None, l1keyPattern=None, hltkeyPattern=None, amodetag=None)
def fillInRange(schema, fillmin=1000, fillmax=9999, amodetag='PROTPHYS', startT=None, stopT=None)
def pixellumisummaryv2TableName()
def fillrunMap(schema, fillnum=None, runmin=None, runmax=None, startT=None, stopT=None, l1keyPattern=None, hltkeyPattern=None, amodetag=None)
def lumiRunByIds(schema, dataidMap, lumitype='HF')
def hltLSById(schema, dataid, hltpathname=None, hltpathpattern=None, withL1Pass=False, withHLTAccept=False)
def trgLSById(schema, dataid, trgbitname=None, trgbitnamepattern=None, withL1Count=False, withPrescale=False)
def instLumiForIds(schema, irunlsdict, dataidmap, runsummaryMap, beamstatusfilter=None, timeFilter=None, withBXInfo=False, bxAlgo=None, xingMinLum=None, withBeamIntensity=False, lumitype='HF')
def hlttrgMappingByrun(schema, runnum, hltpathname=None, hltpathpattern=None)
def trgForIds(schema, irunlsdict, dataidmap, trgbitname=None, trgbitnamepattern=None, withL1Count=False, withPrescale=False)
def runsummary(schema, runnum, sessionflavor='')
def beamInfoById(schema, dataid, withBeamIntensity=False, minIntensity=0.1)
def fillInRange(schema, fillmin, fillmax, amodetag, startT, stopT)
def pixellumidataTableName()
def findUniqueSeed(hltPath, ExprStr)
def runsummary(schema, irunlsdict)
Lumi data management and calculation API # # Author: Zhen Xie #.
def deliveredLumiForIds(schema, irunlsdict, dataidmap, runsummaryMap, beamstatusfilter=None, timeFilter=None, normmap=None, withBXInfo=False, bxAlgo=None, xingMinLum=None, withBeamIntensity=False, lumitype='HF', minbiasXsec=None)
def fillschemePatternMap(schema, lumitype)
def runList(schema, datatagid, runmin=None, runmax=None, fillmin=None, fillmax=None, startT=None, stopT=None, l1keyPattern=None, hltkeyPattern=None, amodetag=None, nominalEnergy=None, energyFlut=0.2, requiretrg=True, requirehlt=True, preselectedruns=None, lumitype='HF')