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 1931 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 2028 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 1962 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 1893 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 2001 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 1192 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 920 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 2167 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 2204 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 2127 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 1806 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 1572 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.
References data, and bookConverter.max.
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 1620 of file dataDML.py.
References data, and bookConverter.max.
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 1651 of file dataDML.py.
References data, guessDataIdByRun(), bookConverter.max, and min().
def dataDML.guessHltDataIdByRunInBranch | ( | schema, | |
runnum, | |||
tablename, | |||
branchName | |||
) |
Definition at line 1614 of file dataDML.py.
References revisionDML.entryInBranch(), revisionDML.latestDataRevisionOfEntry(), and revisionDML.revisionsInBranchName().
def dataDML.guessLumiDataIdByRunInBranch | ( | schema, | |
runnum, | |||
tablename, | |||
branchName | |||
) |
Definition at line 1602 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 1739 of file dataDML.py.
References data, nameDealer.luminormTableName(), and bookConverter.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 1774 of file dataDML.py.
References data, nameDealer.luminormTableName(), and bookConverter.max.
def dataDML.guessTrgDataIdByRunInBranch | ( | schema, | |
runnum, | |||
tablename, | |||
branchName | |||
) |
Definition at line 1608 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 1437 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 1333 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 1390 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 2055 of file dataDML.py.
References nameDealer.cmsrunsummaryTableName().
def dataDML.insertTrgHltMap | ( | schema, | |
hltkey, | |||
trghltmap | |||
) |
input: trghltmap {hltpath:l1seed} output:
Definition at line 2097 of file dataDML.py.
References nameDealer.trghltMapTableName().
def dataDML.intglumiForRange | ( | schema, | |
runlist | |||
) |
output: {run:intglumi_in_fb}
Definition at line 1536 of file dataDML.py.
References data, nameDealer.intglumiv2TableName(), bookConverter.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 1845 of file dataDML.py.
References data, nameDealer.hltdataTableName(), nameDealer.lumidataTableName(), bookConverter.max, nameDealer.revmapTableName(), and nameDealer.trgdataTableName().
def dataDML.lumiBXByAlgo | ( | schema, | |
dataid, | |||
algoname | |||
) |
result {lumilsnum:[cmslsnum,numorbit,startorbit,bxlumivalue,bxlumierr,bxlumiqlty]}
Definition at line 1283 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 1085 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 555 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 960 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 904 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,tag.trgdataid,tag.hltdataid 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 422 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 797 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 729 of file dataDML.py.
References data, and nameDealer.trgdataTableName().
Referenced by trgLSById().
tuple dataDML.branchinfo = (branchid,'DATA') |
Definition at line 2355 of file dataDML.py.
Referenced by TrackerMap.TrackerMap().
tuple dataDML.datainfo = revisionDML.createBranch(schema,'DATA','TRUNK',comment='hold data') |
Definition at line 2343 of file dataDML.py.
tuple dataDML.hltdata = generateDummyData.hlt(schema,20) |
Definition at line 2371 of file dataDML.py.
Definition at line 2373 of file dataDML.py.
Definition at line 2372 of file dataDML.py.
Referenced by lumi::RevisionDML.insertHltRunData(), and lumi::HLTV32DB.writeHltDataToSchema2().
tuple dataDML.hlttrgmap = generateDummyData.hlttrgmap(schema) |
Definition at line 2359 of file dataDML.py.
tuple dataDML.latestNorms = revisionDML.latestDataRevisionOfEntry(schema,nameDealer.luminormTableName(),luminormentry_id,normrevlist) |
Definition at line 2382 of file dataDML.py.
tuple dataDML.latestrevision = revisionDML.latestDataRevisionOfEntry(schema,nameDealer.lumidataTableName(),lumientry_id,revlist) |
Definition at line 2390 of file dataDML.py.
tuple dataDML.lumidummydata = generateDummyData.lumiSummary(schema,20) |
Definition at line 2361 of file dataDML.py.
tuple dataDML.lumientry_id = revisionDML.entryInBranch(schema,nameDealer.lumidataTableName(),'1211','DATA') |
Definition at line 2389 of file dataDML.py.
list dataDML.lumilsdata = lumidummydata[1] |
Definition at line 2363 of file dataDML.py.
tuple dataDML.luminormentry_id = revisionDML.entryInBranch(schema,nameDealer.luminormTableName(),'pp7TeV','NORM') |
Definition at line 2381 of file dataDML.py.
list dataDML.lumirundata = [lumidummydata[0]] |
Definition at line 2362 of file dataDML.py.
Referenced by lumi::RevisionDML.insertLumiRunData(), and lumi::Lumi2DB.writeAllLumiDataToSchema2().
string dataDML.myconstr = 'oracle://devdb10/cms_xiezhen_dev' |
Definition at line 2331 of file dataDML.py.
tuple dataDML.normbranchinfo = (normbranchid,'NORM') |
Definition at line 2351 of file dataDML.py.
tuple dataDML.norminfo = revisionDML.createBranch(schema,'NORM','TRUNK',comment='hold normalization factor') |
Definition at line 2345 of file dataDML.py.
tuple dataDML.normrevlist = revisionDML.revisionsInBranchName(schema,'NORM') |
Definition at line 2380 of file dataDML.py.
tuple dataDML.revlist = revisionDML.revisionsInBranchName(schema,'DATA') |
Definition at line 2387 of file dataDML.py.
tuple dataDML.runsummarydata = generateDummyData.runsummary(schema,'PROTPHYS',3500) |
Definition at line 2357 of file dataDML.py.
tuple dataDML.schema = session.nominalSchema() |
Definition at line 2334 of file dataDML.py.
tuple dataDML.session = svc.openSession(isReadOnly=False,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')]) |
Definition at line 2333 of file dataDML.py.
tuple dataDML.svc = sessionManager.sessionManager(myconstr,authpath='/afs/cern.ch/user/x/xiezhen',debugON=False) |
Definition at line 2332 of file dataDML.py.
tuple dataDML.tables = lumidbDDL.createTables(schema) |
Definition at line 2338 of file dataDML.py.
Referenced by ora::SchemaUtils.cleanUp(), and FFTJetLookupTableESProducer< CT >.produce().
tuple dataDML.trgdata = generateDummyData.trg(schema,20) |
Definition at line 2366 of file dataDML.py.
tuple dataDML.trgentry_id = revisionDML.entryInBranch(schema,nameDealer.trgdataTableName(),'1222','DATA') |
Definition at line 2395 of file dataDML.py.
Definition at line 2368 of file dataDML.py.
Definition at line 2367 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 2341 of file dataDML.py.