Classes | |
class | ParametersObject |
==============temporarilly here======### More... | |
Variables | |
tuple | allfills = allfills(q) |
tuple | allruns = allruns(schema,requireLumisummary=True,requireTrg=True,requireHlt=True) |
string | connectstr = 'oracle://cms_orcoff_prod/cms_lumi_prod' |
tuple | msg = coral.MessageStream('') |
tuple | q = schema.newQuery() |
tuple | schema = session.nominalSchema() |
tuple | session = svc.connect(connectstr,accessMode=coral.access_ReadOnly) |
tuple | svc = coral.ConnectionService() |
select distinct fillnum from cmsrunsummary there are crazy fill numbers. we assume they are not valid runs
Definition at line 1041 of file lumiQueryAPI.py.
References allfills, nameDealer.cmsrunsummaryTableName(), and data.
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 923 of file lumiQueryAPI.py.
References allruns, nameDealer.cmsrunsummaryTableName(), CommonUtil.count_dups(), data, nameDealer.hltTableName(), nameDealer.lumisummaryTableName(), and nameDealer.trgTableName().
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 1469 of file lumiQueryAPI.py.
References python.multivaluedict.append(), data, and CommonUtil.unpackBlobtoArray().
def lumiQueryAPI.calculateEffective | ( | trgtable, | |
totalrecorded | |||
) |
input: trgtable{hltpath:[l1seed, hltprescale, l1prescale]}, totalrecorded (float) output:{hltpath, recorded}
Definition at line 445 of file lumiQueryAPI.py.
def lumiQueryAPI.calculateTotalRecorded | ( | deadtable | ) |
input: {lsnum:[deadtime, instlumi, bit_0, norbits,prescale]} output: recordedLumi
Definition at line 410 of file lumiQueryAPI.py.
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 1536 of file lumiQueryAPI.py.
def lumiQueryAPI.deliveredLumiForRange | ( | dbsession, | |
parameters, | |||
inputRange, | |||
finecorrections = None |
|||
) |
Takes either single run as a string or dictionary of run ranges
Definition at line 82 of file lumiQueryAPI.py.
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 158 of file lumiQueryAPI.py.
References data, lslengthsec(), and nameDealer.lumisummaryTableName().
def lumiQueryAPI.dumpData | ( | lumidata, | |
filename | |||
) |
input params: lumidata [{'fieldname':value}] filename csvname
Definition at line 401 of file lumiQueryAPI.py.
Referenced by CastorDbXml.dumpObject(), and HcalDbXml.dumpObject().
def lumiQueryAPI.dumpOverview | ( | delivered, | |
recorded, | |||
hltpath = '' |
|||
) |
def lumiQueryAPI.dumpPerLSLumi | ( | lumidata | ) |
Definition at line 514 of file lumiQueryAPI.py.
def lumiQueryAPI.dumpRecordedLumi | ( | lumidata, | |
hltpath = '' |
|||
) |
Definition at line 641 of file lumiQueryAPI.py.
def lumiQueryAPI.filterDeadtable | ( | inTable, | |
lslist | |||
) |
Definition at line 383 of file lumiQueryAPI.py.
def lumiQueryAPI.flatten | ( | obj | ) |
Given nested lists or tuples, returns a single flattened list
Definition at line 864 of file lumiQueryAPI.py.
def lumiQueryAPI.getDeadfractions | ( | deadtable | ) |
inputtable: {lsnum:[deadtime, instlumi, bit_0, norbits,bit_0_prescale]} output: {lsnum:deadfraction}
Definition at line 460 of file lumiQueryAPI.py.
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 1429 of file lumiQueryAPI.py.
References data, and nameDealer.hltTableName().
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 1396 of file lumiQueryAPI.py.
References data, and nameDealer.hltTableName().
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 1678 of file lumiQueryAPI.py.
References nameDealer.cmsrunsummaryTableName(), data, and nameDealer.trghltMapTableName().
def lumiQueryAPI.lsBylsLumi | ( | deadtable | ) |
input: {lsnum:[deadtime, instlumi, bit_0, norbits,prescale...]} output: {lsnum:[instlumi, recordedlumi...]}
Definition at line 60 of file lumiQueryAPI.py.
def lumiQueryAPI.lslengthsec | ( | numorbit, | |
numbx | |||
) |
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 1634 of file lumiQueryAPI.py.
References data, nameDealer.lumidetailTableName(), and nameDealer.lumisummaryTableName().
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 1596 of file lumiQueryAPI.py.
References data, nameDealer.lumidetailTableName(), and nameDealer.lumisummaryTableName().
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 1160 of file lumiQueryAPI.py.
References data, and nameDealer.lumisummaryTableName().
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 1101 of file lumiQueryAPI.py.
References data, and nameDealer.lumisummaryTableName().
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 1242 of file lumiQueryAPI.py.
References data, nameDealer.lumisummaryTableName(), and nameDealer.trgTableName().
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 875 of file lumiQueryAPI.py.
def lumiQueryAPI.printDeliveredLumi | ( | lumidata, | |
mode | |||
) |
Definition at line 395 of file lumiQueryAPI.py.
def lumiQueryAPI.printOverviewData | ( | delivered, | |
recorded, | |||
hltpath = '' |
|||
) |
Definition at line 682 of file lumiQueryAPI.py.
References relativeConstraints.keys.
input lumidata [['runnumber', 'trgtable{}', 'deadtable{}']] deadtable {lsnum:[deadtime, instlumi, bit_0, norbits,prescale]}
Definition at line 475 of file lumiQueryAPI.py.
Definition at line 532 of file lumiQueryAPI.py.
def lumiQueryAPI.recordedLumiForRange | ( | dbsession, | |
parameters, | |||
inputRange, | |||
finecorrections = None |
|||
) |
Takes either single run as a string or dictionary of run ranges
Definition at line 99 of file lumiQueryAPI.py.
References reco.if(), and recordedLumiForRun().
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 216 of file lumiQueryAPI.py.
References nameDealer.cmsrunsummaryTableName(), data, nameDealer.hltTableName(), nameDealer.lumisummaryTableName(), nameDealer.trghltMapTableName(), and nameDealer.trgTableName().
Referenced by recordedLumiForRange().
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 1704 of file lumiQueryAPI.py.
References python.multivaluedict.append(), nameDealer.cmsrunsummaryTableName(), and data.
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 1734 of file lumiQueryAPI.py.
References nameDealer.cmsrunsummaryTableName(), and data.
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 1065 of file lumiQueryAPI.py.
References nameDealer.cmsrunsummaryTableName(), and data.
returns database session
Definition at line 887 of file lumiQueryAPI.py.
def lumiQueryAPI.splitlistToRangeString | ( | inPut | ) |
Definition at line 429 of file lumiQueryAPI.py.
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 1350 of file lumiQueryAPI.py.
References data, and nameDealer.trgTableName().
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 1206 of file lumiQueryAPI.py.
References data, and nameDealer.trgTableName().
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 1314 of file lumiQueryAPI.py.
References data, and nameDealer.trgTableName().
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 996 of file lumiQueryAPI.py.
References python.multivaluedict.append(), data, and nameDealer.lumivalidationTableName().
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 775 of file lumiQueryAPI.py.
References data, nameDealer.lumidetailTableName(), and nameDealer.lumisummaryTableName().
Referenced by dumpOverview().
tuple lumiQueryAPI.allfills = allfills(q) |
Definition at line 1840 of file lumiQueryAPI.py.
Referenced by allfills().
tuple lumiQueryAPI.allruns = allruns(schema,requireLumisummary=True,requireTrg=True,requireHlt=True) |
Definition at line 1782 of file lumiQueryAPI.py.
Referenced by allruns().
string lumiQueryAPI.connectstr = 'oracle://cms_orcoff_prod/cms_lumi_prod' |
Definition at line 1776 of file lumiQueryAPI.py.
Referenced by spf::SherpackFetcher.FnFileGet().
tuple lumiQueryAPI.msg = coral.MessageStream('') |
Definition at line 1771 of file lumiQueryAPI.py.
tuple lumiQueryAPI.q = schema.newQuery() |
Definition at line 1839 of file lumiQueryAPI.py.
Referenced by JetAnaPythia< Jet >.analyze(), TrackParameterAnalyzer.analyze(), DisplayGeom.analyze(), PhotonValidator.analyze(), HLTScalers.analyze(), AlignmentTrackSelector.basicCuts(), HcalPulseShapes.beginRun(), PhysicsTools::AtomicId.build(), CandCombinerBase< OutputCollection, CandPtr >.combine(), AnalyticalCurvilinearJacobian.computeFullJacobian(), Conv4HitsReco.ConversionCandidate(), VVIObjDetails.cosint(), sistripvvi::VVIObjDetails.cosint(), TtFullLepKinSolver.cubic(), TwoBodyDecayModel.curvilinearToCartesianJacobian(), PhysicsTools::VarProcessor.deriv(), FWEveDigitSetScalableMarkerGL.DirectDraw(), lhef.domToLines(), EEQuadrant(), ConfigurationDBHandler.endElement(), lhef::LHEReader::XMLHandler.endElement(), LMFSeqDat.fetchByRunNumber(), TrackAnalyzer.fillHistosForState(), PrimaryVertexAnalyzer4PU.fillTrackHistos(), edm::ParameterSet.fromString(), GammaFunctionGenerator.gammaFrac(), lumi::idDealer.generateNextIDForTable(), EvtPlaneProducer::GenPlane.getAngle(), TiXmlBase.GetEntity(), lumi::idDealer.getIDforTable(), MonitorElement.getQReport(), PrimaryVertexAnalyzer4PU.getSimTrkParameters(), pftools::CaloEllipse.getTheta(), L1MuGMTSortRankUnit.getVeryLowQualityLevel(), gen::Herwig6Instance.give(), ConversionFastHelix.helixStateAtVertex(), FastHelix.helixStateAtVertex(), HLTDeDxFilter.hltFilter(), GflashTrajectory.initializeTrajectory(), JacobianCartesianToCurvilinear.JacobianCartesianToCurvilinear(), JacobianCartesianToLocal.JacobianCartesianToLocal(), JacobianCurvilinearToCartesian.JacobianCurvilinearToCartesian(), JacobianLocalToCartesian.JacobianLocalToCartesian(), reco::TrackProbabilityTagInfo.jetProbability(), JetProbabilityComputer.jetProbability(), JetBProbabilityComputer.jetProbability(), match(), L1MuGMTMerger.merge_rank(), MergeRootfile(), NtpProducer< C >.NtpProducer(), edm::Guid.operator=(), edm::Guid.operator==(), HcalPacker.pack(), trigger::TriggerObject.particle(), RawParticle.PDGcharge(), CastorNominalCoderTemplate.process(), HcalNominalCoderTemplate.process(), HcalBeamMonitor.processEvent(), NtpProducer< C >.produce(), L3MuonCandidateProducerFromMuons.produce(), TtSemiEvtSolutionMaker.produce(), TtHadEvtSolutionMaker.produce(), L2MuonCandidateProducer.produce(), L3MuonCandidateProducer.produce(), FFTJetPileupProcessor.produce(), Herwig6Hadronizer.pythiaStatusCode(), reco::Conversion.quality(), reco::TrackBase.quality(), GSUtilities.quantile(), SusyPostProcessor.QuantilePlots(), RealQuadEquation.RealQuadEquation(), HcalCableMapper.record(), MultiHitGeneratorFromChi2.refit2Hits(), FWOverlapTableView.refreshTable3D(), L1MuDTEtaProcessor.runEtaTrackFinder(), CustomPDGParser.s_charge(), BPhysicsOniaDQM.selGlobalMuon(), MuScleFitMuonSelector.selGlobalMuon(), MuScleFit.selGlobalMuon(), RawParticle.setCharge(), ObjectValidator.setEBRecHitCollection(), ObjectValidator.setEcalChannelStatus(), ObjectValidator.setEcalSeverityLevelAlgo(), ObjectValidator.setEERecHitCollection(), ObjectValidator.setHcalChannelQuality(), ObjectValidator.setHcalSeverityLevelComputer(), CSCCorrelatedLCTDigi.setQuality(), pat::HardEventHypothesis.setQuality(), reco::Conversion.setQuality(), reco::TrackBase.setQuality(), GenEventInfoProduct.setScales(), VVIObjDetails.sincosint(), sistripvvi::VVIObjDetails.sincosint(), VVIObjDetails.sinint(), sistripvvi::VVIObjDetails.sinint(), 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(), TiXmlBase.StringEqual(), edm::service::ELoutput.summarization(), L1MuGMTLFSortRankPtQLUT.TheLookupFunction(), L1MuGMTLFMergeRankEtaQLUT.TheLookupFunction(), L1MuonPixelTrackFitter.valInversePt(), SiStripClusterInfo.variance(), VVIObj.VVIObj(), sistripvvi::VVIObj.VVIObj(), VVIObjF.VVIObjF(), and DCULVRVoltagesDat.writeArrayDB().
tuple lumiQueryAPI.schema = session.nominalSchema() |
Definition at line 1781 of file lumiQueryAPI.py.
tuple lumiQueryAPI.session = svc.connect(connectstr,accessMode=coral.access_ReadOnly) |
Definition at line 1777 of file lumiQueryAPI.py.
tuple lumiQueryAPI.svc = coral.ConnectionService() |
Definition at line 1775 of file lumiQueryAPI.py.