def dataDML.addCorrToBranch | ( | schema, | |
corrname, | |||
a1, | |||
optionalcorrdata, | |||
branchinfo | |||
) |
input: branchinfo(corrrevisionid,branchname) optionalcorrdata {'a2':a2,'drift':drif} output: (revision_id,entry_id,data_id)
Definition at line 1922 of file dataDML.py.
References revisionDML.addEntry(), revisionDML.addRevision(), revisionDML.bookNewEntry(), revisionDML.bookNewRevision(), and revisionDML.entryInBranch().
def dataDML.addHLTRunDataToBranch | ( | schema, | |
runnumber, | |||
hltrundata, | |||
branchinfo | |||
) |
input: hltrundata [pathnameclob(0),datasource(1)] output: (revision_id,entry_id,data_id)
Definition at line 2019 of file dataDML.py.
References revisionDML.addEntry(), revisionDML.addRevision(), revisionDML.bookNewEntry(), revisionDML.bookNewRevision(), revisionDML.entryInBranch(), and nameDealer.hltdataTableName().
def dataDML.addLumiRunDataToBranch | ( | schema, | |
runnumber, | |||
lumirundata, | |||
branchinfo, | |||
tableName | |||
) |
input: lumirundata [datasource,nominalenergy,ncollidingbunches,starttime,stoptime,nls] branchinfo (branch_id,branch_name) tableName lumiruntablename output: (revision_id,entry_id,data_id)
Definition at line 1953 of file dataDML.py.
References revisionDML.addEntry(), revisionDML.addRevision(), revisionDML.bookNewEntry(), revisionDML.bookNewRevision(), and revisionDML.entryInBranch().
def dataDML.addNormToBranch | ( | schema, | |
normname, | |||
amodetag, | |||
norm1, | |||
egev1, | |||
optionalnormdata, | |||
branchinfo | |||
) |
input: branchinfo(normrevisionid,branchname) optionalnormdata {'norm_occ2':norm_occ2,'norm_et':norm_et,'norm_pu':norm_pu,'constfactor':constfactor} output: (revision_id,entry_id,data_id)
Definition at line 1884 of file dataDML.py.
References revisionDML.addEntry(), revisionDML.addRevision(), revisionDML.bookNewEntry(), revisionDML.bookNewRevision(), revisionDML.entryInBranch(), and nameDealer.luminormTableName().
def dataDML.addTrgRunDataToBranch | ( | schema, | |
runnumber, | |||
trgrundata, | |||
branchinfo | |||
) |
input: trgrundata [datasource(0),bitzeroname(1),bitnameclob(2)] bitnames clob, bitnames separated by ',' output: (revision_id,entry_id,data_id)
Definition at line 1992 of file dataDML.py.
References revisionDML.addEntry(), revisionDML.addRevision(), revisionDML.bookNewEntry(), revisionDML.bookNewRevision(), revisionDML.entryInBranch(), and nameDealer.trgdataTableName().
def dataDML.allfillschemes | ( | schema | ) |
result (runnum,[(lumilsnum(0),cmslsnum(1),beamstatus(2),beamenergy(3),ncollidingbunches(4),beaminfolist(5),..]) beaminfolist=[(bxidx,beam1intensity,beam2intensity)]
Definition at line 1183 of file dataDML.py.
References data, nameDealer.lumidataTableName(), nameDealer.lumisummaryv2TableName(), and CommonUtil.unpackBlobtoArray().
Referenced by lumiCalcAPI.beamForIds(), and lumiCalcAPI.beamForRange().
def dataDML.beamstatusByIds | ( | schema, | |
dataidMap | |||
) |
input dataidMap : {run:lumidataid} result {runnum:{cmslsnum:beamstatus}}
Definition at line 911 of file dataDML.py.
References data, and nameDealer.lumisummaryv2TableName().
def dataDML.bulkInsertHltLSData | ( | session, | |
runnumber, | |||
data_id, | |||
hltlsdata, | |||
bulksize = 500 |
|||
) |
input: hltlsdata {cmslsnum:[inputcountBlob,acceptcountBlob,prescaleBlob]}
Definition at line 2158 of file dataDML.py.
References nameDealer.lshltTableName().
def dataDML.bulkInsertLumiLSSummary | ( | session, | |
runnumber, | |||
data_id, | |||
lumilsdata, | |||
tableName, | |||
bulksize = 500 , |
|||
withDetails = True |
|||
) |
input: lumilsdata {lumilsnum:[cmslsnum,instlumi,instlumierror,instlumiquality,beamstatus,beamenergy,numorbit,startorbit,cmsbxindexblob,beam1intensity,beam2intensity,bxlumivalue_occ1,bxlumierror_occ1,bxlumiquality_occ1,bxlumivalue_occ2,bxlumierror_occ2,bxlumiquality_occ2,bxlumivalue_et,bxlumierror_et,bxlumiquality_et]}
Definition at line 2195 of file dataDML.py.
def dataDML.bulkInsertTrgLSData | ( | session, | |
runnumber, | |||
data_id, | |||
trglsdata, | |||
bulksize = 500 |
|||
) |
insert trg per-LS data for given run and data_id, this operation can be split in transaction chuncks input: trglsdata {cmslsnum:[deadtime,bitzerocount,bitzeroprescale,trgcountBlob,trgprescaleBlob]} result nrows inserted if nrows==0, then this insertion failed
Definition at line 2118 of file dataDML.py.
References nameDealer.lstrgTableName().
def dataDML.dataentryIdByRun | ( | schema, | |
runnum, | |||
branchfilter | |||
) |
select el.entry_id,et.entry_id,eh.entry_id,el.revision_id,et.revision_id,eh.revision_id from lumidataentiries el,trgdataentries et,hltdataentries eh where el.name=et.name and et.name=eh.name and el.name=:entryname; check on entryrev return [lumientryid,trgentryid,hltentryid]
Definition at line 1797 of file dataDML.py.
References data, nameDealer.entryTableName(), nameDealer.hltdataTableName(), nameDealer.lumidataTableName(), and nameDealer.trgdataTableName().
def dataDML.fillInRange | ( | schema, | |
fillmin, | |||
fillmax, | |||
amodetag, | |||
startT, | |||
stopT | |||
) |
select fillnum,runnum,starttime from cmsrunsummary where [where fillnum>=:fillmin and fillnum<=:fillmax and amodetag=:amodetag] output: [fill]
Definition at line 89 of file dataDML.py.
References python.multivaluedict.append(), nameDealer.cmsrunsummaryTableName(), data, and join().
Referenced by MuonPFAnalyzer.analyze(), and lumiCalcAPI.fillInRange().
def dataDML.fillrunMap | ( | schema, | |
fillnum = None , |
|||
runmin = None , |
|||
runmax = None , |
|||
startT = None , |
|||
stopT = None , |
|||
l1keyPattern = None , |
|||
hltkeyPattern = None , |
|||
amodetag = None |
|||
) |
select fillnum,runnum,starttime from cmsrunsummary [where fillnum=:fillnum and runnum>=runmin and runnum<=runmax and amodetag=:amodetag ] output: {fill:[runnum,...]}
Definition at line 160 of file dataDML.py.
References python.multivaluedict.append(), nameDealer.cmsrunsummaryTableName(), data, and join().
Referenced by lumiCalcAPI.fillrunMap().
def dataDML.fillschemePatternMap | ( | schema, | |
lumitype | |||
) |
output:(patternStr:correctionFac)
Definition at line 1563 of file dataDML.py.
References data, and nameDealer.fillschemeTableName().
Referenced by lumiCalcAPI.deliveredLumiForIds().
def dataDML.guesscorrIdByName | ( | schema, | |
tagname = None |
|||
) |
LumiDB DML API # # Author: Zhen Xie #.
select data_id from lumicorrectionss [where entry_name=:tagname] result lumicorrectionsdataid
Definition at line 16 of file dataDML.py.
def dataDML.guessDataIdByRun | ( | schema, | |
runnum, | |||
tablename, | |||
revfilter = None |
|||
) |
select max data_id of the given run. In current design, it's the most recent data of the run
Definition at line 1611 of file dataDML.py.
Referenced by guessDataIdForRange().
def dataDML.guessDataIdForRange | ( | schema, | |
inputRange, | |||
tablename | |||
) |
input: inputRange [run] output: {run:lumiid} select data_id,runnum from hltdata where runnum<=runmax and runnum>=:runmin
Definition at line 1642 of file dataDML.py.
References data, guessDataIdByRun(), max(), and min.
def dataDML.guessHltDataIdByRunInBranch | ( | schema, | |
runnum, | |||
tablename, | |||
branchName | |||
) |
Definition at line 1605 of file dataDML.py.
References revisionDML.entryInBranch(), revisionDML.latestDataRevisionOfEntry(), and revisionDML.revisionsInBranchName().
def dataDML.guessLumiDataIdByRunInBranch | ( | schema, | |
runnum, | |||
tablename, | |||
branchName | |||
) |
Definition at line 1593 of file dataDML.py.
References revisionDML.entryInBranch(), revisionDML.latestDataRevisionOfEntry(), and revisionDML.revisionsInBranchName().
def dataDML.guessnormIdByContext | ( | schema, | |
amodetag, | |||
egev1 | |||
) |
get norm dataids by amodetag, egev if there are duplicates, pick max(dataid).Bypass full version lookups select data_id from luminorm where amodetag=:amodetag and egev_1=:egev1
Definition at line 1730 of file dataDML.py.
References data, nameDealer.luminormTableName(), and max().
def dataDML.guessnormIdByName | ( | schema, | |
normname | |||
) |
get norm dataids by name, if there are duplicates, pick max(dataid).Bypass full version lookups select data_id from luminorms where entry_name=:normname result luminormdataid
Definition at line 1765 of file dataDML.py.
References data, nameDealer.luminormTableName(), and max().
def dataDML.guessTrgDataIdByRunInBranch | ( | schema, | |
runnum, | |||
tablename, | |||
branchName | |||
) |
Definition at line 1599 of file dataDML.py.
References revisionDML.entryInBranch(), revisionDML.latestDataRevisionOfEntry(), and revisionDML.revisionsInBranchName().
def dataDML.hltLSById | ( | schema, | |
dataid, | |||
hltpathname = None , |
|||
hltpathpattern = None , |
|||
withL1Pass = False , |
|||
withHLTAccept = False |
|||
) |
result (runnum, {cmslsnum:[(pathname,prescale,1lpass,hltaccept)](0)]}
Definition at line 1428 of file dataDML.py.
References data, hltRunById(), nameDealer.lshltTableName(), and CommonUtil.unpackBlobtoArray().
Referenced by lumiCalcAPI.hltForIds().
def dataDML.hltRunById | ( | schema, | |
dataid, | |||
hltpathname = None , |
|||
hltpathpattern = None |
|||
) |
result [runnum(0),datasource(1),npath(2),hltnamedict(3)] output : npath : total number of hltpath in DB hltnamedict : list of all selected paths [(hltpathidx,hltname),(hltpathidx,hltname)]
Definition at line 1324 of file dataDML.py.
References data, and nameDealer.hltdataTableName().
Referenced by hltLSById().
def dataDML.hlttrgMappingByrun | ( | schema, | |
runnum, | |||
hltpathname = None , |
|||
hltpathpattern = None |
|||
) |
select m.hltpathname,m.l1seed from cmsrunsummary r,trghltmap m where r.runnum=:runnum and m.hltkey=r.hltkey and [m.hltpathname=:hltpathname] output: {hltpath:l1seed}
Definition at line 1381 of file dataDML.py.
References nameDealer.cmsrunsummaryTableName(), data, and nameDealer.trghltMapTableName().
Referenced by lumiCalcAPI.effectiveLumiForIds(), and lumiCalcAPI.hltpathsForRange().
input: runsummarydata [l1key,amodetag,egev,sequence,hltkey,fillnum,starttime,stoptime] output:
Definition at line 2046 of file dataDML.py.
References nameDealer.cmsrunsummaryTableName().
def dataDML.insertTrgHltMap | ( | schema, | |
hltkey, | |||
trghltmap | |||
) |
input: trghltmap {hltpath:l1seed} output:
Definition at line 2088 of file dataDML.py.
References nameDealer.trghltMapTableName().
def dataDML.intglumiForRange | ( | schema, | |
runlist | |||
) |
output: {run:intglumi_in_fb}
Definition at line 1527 of file dataDML.py.
References data, nameDealer.intglumiv2TableName(), max(), and min.
Referenced by lumiCalcAPI.deliveredLumiForIds().
def dataDML.latestdataIdByEntry | ( | schema, | |
entryid, | |||
datatype, | |||
branchfilter | |||
) |
select l.data_id,rl.revision_id from lumidatatable l,lumirevisions rl where l.data_id=rl.data_id and l.entry_id=:entryid check revision_id is in branch
Definition at line 1836 of file dataDML.py.
References data, nameDealer.hltdataTableName(), nameDealer.lumidataTableName(), max(), nameDealer.revmapTableName(), and nameDealer.trgdataTableName().
def dataDML.lumiBXByAlgo | ( | schema, | |
dataid, | |||
algoname | |||
) |
result {lumilsnum:[cmslsnum,numorbit,startorbit,bxlumivalue,bxlumierr,bxlumiqlty]}
Definition at line 1274 of file dataDML.py.
References data, and nameDealer.lumisummaryv2TableName().
def dataDML.lumicorrById | ( | schema, | |
correctiondataid | |||
) |
select entry_name,a1,a2,drift from lumicorrections where DATA_ID=:dataid output: {tagname:(data_id(0),a1(1),a2(2),driftcoeff(3))}
Definition at line 49 of file dataDML.py.
References data.
def dataDML.lumiLSById | ( | schema, | |
dataid, | |||
beamstatus = None , |
|||
withBXInfo = False , |
|||
bxAlgo = 'OCC1' , |
|||
withBeamIntensity = False , |
|||
tableName = None |
|||
) |
input: beamstatus: filter on beam status flag output: result (runnum,{lumilsnum,[cmslsnum(0),instlumi(1),instlumierr(2),instlumiqlty(3),beamstatus(4),beamenergy(5),numorbit(6),startorbit(7),(bxvalueArray,bxerrArray)(8),(bxindexArray,beam1intensityArray,beam2intensityArray)(9)]})
Definition at line 1076 of file dataDML.py.
References data, nameDealer.lumisummaryv2TableName(), and CommonUtil.unpackBlobtoArray().
Referenced by lumiCalcAPI.instLumiForIds().
def dataDML.luminormById | ( | schema, | |
dataid | |||
) |
select entry_name,amodetag,norm_1,egev_1,norm_2,egev_2 from luminorms where DATA_ID=:dataid output: {norm_name:(amodetag(0),norm_1(1),egev_1(2),norm_occ2(3),norm_et(4),norm_pu(5),constfactor(6))}
select entry_name,amodetag,norm_1,egev_1,norm_2,egev_2 from luminorms where DATA_ID=:dataid result (normname(0),amodetag(1),egev(2),norm(3),norm_occ2(4),norm_et(5),norm_pu(6),constfactor(7))
Definition at line 546 of file dataDML.py.
References data, and nameDealer.luminormTableName().
def dataDML.lumiRunById | ( | schema, | |
lumidataid, | |||
lumitype = 'HF' |
|||
) |
input: lumidataid output: (runnum(0),datasource(1),nominalegev(2),ncollidingbunches(3),starttimestr(4),stoptimestr(5),nls(6))
Definition at line 951 of file dataDML.py.
References data, nameDealer.lumidataTableName(), and nameDealer.pixellumidataTableName().
Referenced by lumiRunByIds().
def dataDML.lumiRunByIds | ( | schema, | |
dataidMap, | |||
lumitype = 'HF' |
|||
) |
input dataidMap : {run:lumidataid} result {runnum: (datasource(0),nominalegev(1),ncollidingbunches(2),starttime(3),stoptime(4),nls(5)}
Definition at line 895 of file dataDML.py.
References lumiRunById().
Referenced by lumiCalcAPI.deliveredLumiForIds(), and lumiCalcAPI.runsummaryMap().
def dataDML.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 |
|||
) |
select r.runnum,l.starttime,l.stoptime,l.data_id,t.data_id,h.data_id from cmsrunsummary r,tagruns tag,lumidata l,trgdata t,hltdata h where l.runnum=tag.runnum and r.runnum=l.runnum and l.runnum=t.runnum and t.runnum=h.runnum and r.fillnum>=:fillmin and r.fillnum<=fillmax and r.runnum>:runmin and r.runnum<:runmax and r.amodetag=:amodetag and regexp_like(r.l1key,:l1keypattern) and regexp_like(hltkey,:hltkeypattern) and l.nominalEnergy>=:nominalEnergy*(1-energyFlut) and l.nominalEnergy<=:nominalEnergy*(1+energyFlut) and tag.tagid<=:tagid and l.starttime is not null and l.stoptime is not null output: {runnum:[lumiid,trgid,hltid]}
Definition at line 240 of file dataDML.py.
References nameDealer.cmsrunsummaryTableName(), data, nameDealer.hltdataTableName(), nameDealer.lumidataTableName(), nameDealer.pixellumidataTableName(), nameDealer.pixeltagRunsTableName(), nameDealer.tagRunsTableName(), and nameDealer.trgdataTableName().
Referenced by lumiCalcAPI.runList().
def dataDML.runsummary | ( | schema, | |
runnum, | |||
sessionflavor = '' |
|||
) |
select l1key,amodetag,hltkey,fillnum,fillscheme from cmsrunsummary where runnum=:runnum output: [l1key(0),amodetag(1),hltkey(3),fillnum(4),fillscheme(5)]
Definition at line 413 of file dataDML.py.
References nameDealer.cmsrunsummaryTableName(), and data.
Referenced by SiStripFineDelayHit.produce(), and lumiCalcAPI.runsummary().
def dataDML.trgLSById | ( | schema, | |
dataid, | |||
trgbitname = None , |
|||
trgbitnamepattern = None , |
|||
withL1Count = False , |
|||
withPrescale = False |
|||
) |
output: (runnum,{cmslsnum:[deadtimecount(0),bitzerocount(1),bitzeroprescale(2),deadfrac(3),[(bitname,trgcount,prescale,mask)](4)]})
Definition at line 788 of file dataDML.py.
References python.multivaluedict.append(), data, nameDealer.lstrgTableName(), trgRunById(), and CommonUtil.unpackBlobtoArray().
Referenced by lumiCalcAPI.trgForIds().
def dataDML.trgRunById | ( | schema, | |
dataid, | |||
trgbitname = None , |
|||
trgbitnamepattern = None |
|||
) |
query: select RUNNUM,SOURCE,BITZERONAME,BITNAMECLOB,ALGOMASK_H,ALGOMASK_L,TECHMASK from trgdata where DATA_ID=:dataid output: [runnum(0),datasource(1),bitzeroname(2),bitnamedict(3),algomask_h(4),algomask_l(5),techmask(6)] -- runnumber -- original source database name -- deadtime norm bitname -- bitnamedict [(bitidx,bitname),...]
Definition at line 720 of file dataDML.py.
References data, and nameDealer.trgdataTableName().
Referenced by trgLSById().
tuple dataDML.branchinfo = (branchid,'DATA') |
Definition at line 2346 of file dataDML.py.
Referenced by TrackerMap.TrackerMap().
tuple dataDML.datainfo = revisionDML.createBranch(schema,'DATA','TRUNK',comment='hold data') |
Definition at line 2334 of file dataDML.py.
tuple dataDML.hltdata = generateDummyData.hlt(schema,20) |
Definition at line 2362 of file dataDML.py.
Definition at line 2364 of file dataDML.py.
Definition at line 2363 of file dataDML.py.
Referenced by lumi::RevisionDML.insertHltRunData(), and lumi::HLTV32DB.writeHltDataToSchema2().
tuple dataDML.hlttrgmap = generateDummyData.hlttrgmap(schema) |
Definition at line 2350 of file dataDML.py.
tuple dataDML.latestNorms = revisionDML.latestDataRevisionOfEntry(schema,nameDealer.luminormTableName(),luminormentry_id,normrevlist) |
Definition at line 2373 of file dataDML.py.
tuple dataDML.latestrevision = revisionDML.latestDataRevisionOfEntry(schema,nameDealer.lumidataTableName(),lumientry_id,revlist) |
Definition at line 2381 of file dataDML.py.
tuple dataDML.lumidummydata = generateDummyData.lumiSummary(schema,20) |
Definition at line 2352 of file dataDML.py.
tuple dataDML.lumientry_id = revisionDML.entryInBranch(schema,nameDealer.lumidataTableName(),'1211','DATA') |
Definition at line 2380 of file dataDML.py.
list dataDML.lumilsdata = lumidummydata[1] |
Definition at line 2354 of file dataDML.py.
tuple dataDML.luminormentry_id = revisionDML.entryInBranch(schema,nameDealer.luminormTableName(),'pp7TeV','NORM') |
Definition at line 2372 of file dataDML.py.
list dataDML.lumirundata = [lumidummydata[0]] |
Definition at line 2353 of file dataDML.py.
Referenced by lumi::RevisionDML.insertLumiRunData(), and lumi::Lumi2DB.writeAllLumiDataToSchema2().
string dataDML.myconstr = 'oracle://devdb10/cms_xiezhen_dev' |
Definition at line 2322 of file dataDML.py.
tuple dataDML.normbranchinfo = (normbranchid,'NORM') |
Definition at line 2342 of file dataDML.py.
tuple dataDML.norminfo = revisionDML.createBranch(schema,'NORM','TRUNK',comment='hold normalization factor') |
Definition at line 2336 of file dataDML.py.
tuple dataDML.normrevlist = revisionDML.revisionsInBranchName(schema,'NORM') |
Definition at line 2371 of file dataDML.py.
tuple dataDML.revlist = revisionDML.revisionsInBranchName(schema,'DATA') |
Definition at line 2378 of file dataDML.py.
tuple dataDML.runsummarydata = generateDummyData.runsummary(schema,'PROTPHYS',3500) |
Definition at line 2348 of file dataDML.py.
tuple dataDML.schema = session.nominalSchema() |
Definition at line 2325 of file dataDML.py.
tuple dataDML.session = svc.openSession(isReadOnly=False,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')]) |
Definition at line 2324 of file dataDML.py.
tuple dataDML.svc = sessionManager.sessionManager(myconstr,authpath='/afs/cern.ch/user/x/xiezhen',debugON=False) |
Definition at line 2323 of file dataDML.py.
tuple dataDML.tables = lumidbDDL.createTables(schema) |
Definition at line 2329 of file dataDML.py.
Referenced by ora::SchemaUtils.cleanUp(), and FFTJetLookupTableESProducer< CT >.produce().
tuple dataDML.trgdata = generateDummyData.trg(schema,20) |
Definition at line 2357 of file dataDML.py.
tuple dataDML.trgentry_id = revisionDML.entryInBranch(schema,nameDealer.trgdataTableName(),'1222','DATA') |
Definition at line 2386 of file dataDML.py.
Definition at line 2359 of file dataDML.py.
Definition at line 2358 of file dataDML.py.
Referenced by lumi::RevisionDML.insertTrgRunData(), and lumi::TRGScalers2DB.writeTrgDataToSchema2().
tuple dataDML.trunkinfo = revisionDML.createBranch(schema,'TRUNK',None,comment='main') |
Definition at line 2332 of file dataDML.py.