CMS 3D CMS Logo

Functions | Variables

lumiPlot Namespace Reference

Functions

def parseInputFiles

Variables

string action = 'store'
dictionary actiontofilebasemap = {'time':'lumivstime','run':'lumivsrun','fill':'lumivsfill','perday':'lumiperday','instpeakperday':'lumipeak'}
list allowedActions = ['run','time','fill','perday','instpeakperday']
list allowedscales = ['linear','log','both']
list amodetagChoices = [ "PROTPHYS","IONPHYS",'PAPHYS' ]
list beamChoices = ['PROTPHYS','IONPHYS','PAPHYS']
list beamModeChoices = [ "stable", "quiet", "either"]
tuple begT = datetime.datetime.combine(datetime.date.fromordinal(newFirstDay),midnight)
 begtime = options.begintime
tuple begTStr = lut.DatetimeToStr(begT,customfm='%m/%d/%y %H:%M:%S')
 choices = allowedActions,
list cmslsnum = lsdata[1]
tuple config = ConfigParser.RawConfigParser()
tuple currentdir = os.getcwd()
 parse figure configuration if found
tuple dataidmap = revisionDML.dataIdsByTagId(session.nominalSchema(),datatagid,runlist=rruns,withcomment=False)
 datatagname = options.datatag
 resolve data ids
tuple daybeg = str(daydata[0][0])
list daydata = daydict[day]
tuple daydel = sum([t[2] for t in daydata if t[2]])
dictionary daydict = {}
tuple dayend = str(daydata[-1][0])
int daymax_ls = 0
int daymax_run = 0
float daymax_val = 0.0
tuple daynumber = lsTS.date()
tuple dayrec = sum([t[3] for t in daydata if t[3]])
string default = 'frontier://LumiCalc/CMS_LUMI_PROD'
list dellum = lsdata[5]
list dellumi = lsdata[5]
string dest = 'connect'
 input/output file names
list effdict = perlsdata[8]
 endtime = options.endtime
tuple f = open(ip,'r')
tuple fig = Figure(figsize=(figureparams['sizex'],figureparams['sizey']),dpi=figureparams['dpi'])
dictionary figureparams = {'sizex':7.5,'sizey':5.7,'dpi':135}
dictionary fillrunMap = {}
tuple GrunsummaryData = lumiCalcAPI.runsummaryMap(session.nominalSchema(),irunlsdict)
string help = 'connect string to lumiDB'
 hltname = options.hltpath
 hltpat = None
 inplot = options.inplot
 process old plot csv files,if any, skipping #commentlines
list inplots = []
list instlum = lsdata[5]
dictionary irunlsdict = {}
 find runs need to read from DB
list labels = ['Delivered','Recorded']
 lastDrawnFill = None
 lastDrawnRun = None
tuple locallumiconfig = os.path.join(currentdir,rcparamfile)
tuple logfig = Figure(figsize=(figureparams['sizex'],figureparams['sizey']),dpi=figureparams['dpi'])
tuple lslength = lumip.lslengthsec()
list lsTS = lsdata[2]
tuple lumibyls = lumiCalcAPI.lumiForIds(session.nominalSchema(),irunlsdict,dataidmap,runsummaryMap=GrunsummaryData,beamstatusfilter=pbeammode,normmap=normvalueDict,lumitype='HF')
list lumilsnum = lsdata[0]
tuple lumip = lumiParameters.ParametersObject()
tuple lut = lumiTime.lumiTime()
tuple m = matplotRender.matplotRender(fig)
 maxDrawnDay = None
tuple midnight = datetime.time()
tuple mlog = matplotRender.matplotRender(logfig)
tuple mpllumiconfig = os.path.join(mplrcdir,rcparamfile)
tuple mplrcdir = matplotlib.get_configdir()
 newFirstDay = None
 newFirstFill = None
 newFirstRun = None
int normid = 0
tuple normmap = normDML.normIdByType(session.nominalSchema(),lumitype='HF',defaultonly=True)
string normname = 'NONE'
dictionary normvalueDict = {}
tuple options = parser.parse_args()
 outplotfilename = options.outplot
string outtextfilename = '.csv'
tuple parser
 parse arguments
dictionary pathdict = {}
tuple pathnames = effdict.keys()
 pbeammode = None
dictionary rawdata = {}
list rawxdata = []
dictionary rawydata = {}
string rcparamfile = '.lumiplotrc'
tuple reader = csv.reader(f,delimiter=',')
list reclum = lsdata[6]
list reclumi = lsdata[6]
string referenceLabel = 'Delivered'
 ######################## ## ## ################## ## ## ## ## Main Program ## ## ## ## ################## ## ## ######################## ##
 reqHlt = False
 reqTrg = False
 required = False,
list resultlines = []
list rruns = []
list rundata = lumibyls[run]
tuple runlist = lumiCalcAPI.runList(session.nominalSchema(),options.fillnum,runmin=None,runmax=None,startT=begTStr,stopT=endtime,l1keyPattern=None,hltkeyPattern=None,amodetag=options.amodetag,nominalEnergy=options.beamenergy,energyFlut=options.beamfluctuation,requiretrg=reqTrg,requirehlt=reqHlt)
tuple session = svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
int starttime = 0
int stoptime = 0
tuple svc
tuple thisfillnumber = fillrunMap.keys()
int totcmsls = 0
int totlumils = 0
 type = int,

Function Documentation

def lumiPlot::parseInputFiles (   inputfilename)
output ({run:[cmsls,cmsls,...]},[[resultlines]])

Definition at line 14 of file lumiPlot.py.

00015                                   :
00016     '''
00017     output ({run:[cmsls,cmsls,...]},[[resultlines]])
00018     '''
00019     selectedrunlsInDB={}
00020     resultlines=[]
00021     p=inputFilesetParser.inputFilesetParser(inputfilename)
00022     runlsbyfile=p.runsandls()
00023     selectedProcessedRuns=p.selectedRunsWithresult()
00024     selectedNonProcessedRuns=p.selectedRunsWithoutresult()
00025     resultlines=p.resultlines()
00026     for runinfile in selectedNonProcessedRuns:
00027         selectedrunlsInDB[runinfile]=runlsbyfile[runinfile]
    return (selectedrunlsInDB,resultlines)

Variable Documentation

string lumiPlot::action = 'store'

Definition at line 85 of file lumiPlot.py.

dictionary lumiPlot::actiontofilebasemap = {'time':'lumivstime','run':'lumivsrun','fill':'lumivsfill','perday':'lumiperday','instpeakperday':'lumipeak'}

Definition at line 44 of file lumiPlot.py.

list lumiPlot::allowedActions = ['run','time','fill','perday','instpeakperday']

Definition at line 39 of file lumiPlot.py.

list lumiPlot::allowedscales = ['linear','log','both']

Definition at line 41 of file lumiPlot.py.

list lumiPlot::amodetagChoices = [ "PROTPHYS","IONPHYS",'PAPHYS' ]

Definition at line 43 of file lumiPlot.py.

list lumiPlot::beamChoices = ['PROTPHYS','IONPHYS','PAPHYS']

Definition at line 40 of file lumiPlot.py.

list lumiPlot::beamModeChoices = [ "stable", "quiet", "either"]

Definition at line 42 of file lumiPlot.py.

tuple lumiPlot::begT = datetime.datetime.combine(datetime.date.fromordinal(newFirstDay),midnight)

Definition at line 289 of file lumiPlot.py.

lumiPlot::begtime = options.begintime

Definition at line 242 of file lumiPlot.py.

tuple lumiPlot::begTStr = lut.DatetimeToStr(begT,customfm='%m/%d/%y %H:%M:%S')

Definition at line 290 of file lumiPlot.py.

Definition at line 223 of file lumiPlot.py.

list lumiPlot::cmslsnum = lsdata[1]

Definition at line 550 of file lumiPlot.py.

tuple lumiPlot::config = ConfigParser.RawConfigParser()

Definition at line 57 of file lumiPlot.py.

tuple lumiPlot::currentdir = os.getcwd()

parse figure configuration if found

Definition at line 48 of file lumiPlot.py.

tuple lumiPlot::dataidmap = revisionDML.dataIdsByTagId(session.nominalSchema(),datatagid,runlist=rruns,withcomment=False)

Definition at line 351 of file lumiPlot.py.

lumiPlot::datatagname = options.datatag

resolve data ids

Definition at line 348 of file lumiPlot.py.

tuple lumiPlot::daybeg = str(daydata[0][0])

Definition at line 493 of file lumiPlot.py.

Definition at line 492 of file lumiPlot.py.

tuple lumiPlot::daydel = sum([t[2] for t in daydata if t[2]])

Definition at line 495 of file lumiPlot.py.

dictionary lumiPlot::daydict = {}

Definition at line 481 of file lumiPlot.py.

tuple lumiPlot::dayend = str(daydata[-1][0])

Definition at line 494 of file lumiPlot.py.

Definition at line 521 of file lumiPlot.py.

Definition at line 520 of file lumiPlot.py.

Definition at line 519 of file lumiPlot.py.

tuple lumiPlot::daynumber = lsTS.date()

Definition at line 489 of file lumiPlot.py.

tuple lumiPlot::dayrec = sum([t[3] for t in daydata if t[3]])

Definition at line 496 of file lumiPlot.py.

string lumiPlot::default = 'frontier://LumiCalc/CMS_LUMI_PROD'

Definition at line 87 of file lumiPlot.py.

list lumiPlot::dellum = lsdata[5]

Definition at line 487 of file lumiPlot.py.

list lumiPlot::dellumi = lsdata[5]

Definition at line 554 of file lumiPlot.py.

string lumiPlot::dest = 'connect'

input/output file names

general switches

correction switches

graphic switches

Definition at line 84 of file lumiPlot.py.

list lumiPlot::effdict = perlsdata[8]

Definition at line 410 of file lumiPlot.py.

tuple lumiPlot::endtime = options.endtime

Definition at line 243 of file lumiPlot.py.

tuple lumiPlot::f = open(ip,'r')

Definition at line 259 of file lumiPlot.py.

tuple lumiPlot::fig = Figure(figsize=(figureparams['sizex'],figureparams['sizey']),dpi=figureparams['dpi'])

Definition at line 375 of file lumiPlot.py.

dictionary lumiPlot::figureparams = {'sizex':7.5,'sizey':5.7,'dpi':135}

Definition at line 53 of file lumiPlot.py.

Definition at line 273 of file lumiPlot.py.

tuple lumiPlot::GrunsummaryData = lumiCalcAPI.runsummaryMap(session.nominalSchema(),irunlsdict)

Definition at line 344 of file lumiPlot.py.

string lumiPlot::help = 'connect string to lumiDB'

Definition at line 86 of file lumiPlot.py.

lumiPlot::hltname = options.hltpath

Definition at line 384 of file lumiPlot.py.

Definition at line 385 of file lumiPlot.py.

lumiPlot::inplot = options.inplot

process old plot csv files,if any, skipping #commentlines

Definition at line 255 of file lumiPlot.py.

tuple lumiPlot::inplots = []

Definition at line 251 of file lumiPlot.py.

list lumiPlot::instlum = lsdata[5]

Definition at line 514 of file lumiPlot.py.

dictionary lumiPlot::irunlsdict = {}

find runs need to read from DB

Definition at line 267 of file lumiPlot.py.

list lumiPlot::labels = ['Delivered','Recorded']

Definition at line 38 of file lumiPlot.py.

Definition at line 276 of file lumiPlot.py.

tuple lumiPlot::lastDrawnRun = None

Definition at line 274 of file lumiPlot.py.

Definition at line 52 of file lumiPlot.py.

tuple lumiPlot::logfig = Figure(figsize=(figureparams['sizex'],figureparams['sizey']),dpi=figureparams['dpi'])

Definition at line 377 of file lumiPlot.py.

tuple lumiPlot::lslength = lumip.lslengthsec()

Definition at line 241 of file lumiPlot.py.

list lumiPlot::lsTS = lsdata[2]

Definition at line 486 of file lumiPlot.py.

tuple lumiPlot::lumibyls = lumiCalcAPI.lumiForIds(session.nominalSchema(),irunlsdict,dataidmap,runsummaryMap=GrunsummaryData,beamstatusfilter=pbeammode,normmap=normvalueDict,lumitype='HF')

Definition at line 381 of file lumiPlot.py.

list lumiPlot::lumilsnum = lsdata[0]

Definition at line 485 of file lumiPlot.py.

Referenced by lumi::LumiDummy2DB::retrieveData().

Definition at line 235 of file lumiPlot.py.

Definition at line 376 of file lumiPlot.py.

tuple lumiPlot::maxDrawnDay = None

Definition at line 275 of file lumiPlot.py.

tuple lumiPlot::midnight = datetime.time()

Definition at line 288 of file lumiPlot.py.

Definition at line 378 of file lumiPlot.py.

Definition at line 51 of file lumiPlot.py.

tuple lumiPlot::mplrcdir = matplotlib.get_configdir()

Definition at line 50 of file lumiPlot.py.

Definition at line 277 of file lumiPlot.py.

Definition at line 279 of file lumiPlot.py.

Definition at line 278 of file lumiPlot.py.

tuple lumiPlot::normid = 0

Definition at line 359 of file lumiPlot.py.

tuple lumiPlot::normmap = normDML.normIdByType(session.nominalSchema(),lumitype='HF',defaultonly=True)

Definition at line 364 of file lumiPlot.py.

tuple lumiPlot::normname = 'NONE'

Definition at line 358 of file lumiPlot.py.

Definition at line 360 of file lumiPlot.py.

tuple lumiPlot::options = parser.parse_args()

Definition at line 225 of file lumiPlot.py.

list lumiPlot::outplotfilename = options.outplot

Definition at line 229 of file lumiPlot.py.

Definition at line 232 of file lumiPlot.py.

Initial value:
00001 argparse.ArgumentParser(prog=os.path.basename(sys.argv[0]),
00002                                      description="Plot luminosity as function of the time variable of choice",
00003                                      formatter_class=argparse.ArgumentDefaultsHelpFormatter)

parse arguments

basic arguments

Definition at line 80 of file lumiPlot.py.

dictionary lumiPlot::pathdict = {}

Definition at line 407 of file lumiPlot.py.

tuple lumiPlot::pathnames = effdict.keys()
string lumiPlot::pbeammode = None

Definition at line 247 of file lumiPlot.py.

dictionary lumiPlot::rawdata = {}
list lumiPlot::rawxdata = []

Definition at line 539 of file lumiPlot.py.

dictionary lumiPlot::rawydata = {}

Definition at line 540 of file lumiPlot.py.

string lumiPlot::rcparamfile = '.lumiplotrc'

Definition at line 49 of file lumiPlot.py.

tuple lumiPlot::reader = csv.reader(f,delimiter=',')

Definition at line 260 of file lumiPlot.py.

list lumiPlot::reclum = lsdata[6]

Definition at line 488 of file lumiPlot.py.

list lumiPlot::reclumi = lsdata[6]

Definition at line 555 of file lumiPlot.py.

string lumiPlot::referenceLabel = 'Delivered'

######################## ## ## ################## ## ## ## ## Main Program ## ## ## ## ################## ## ## ######################## ##

Definition at line 37 of file lumiPlot.py.

Definition at line 270 of file lumiPlot.py.

Definition at line 269 of file lumiPlot.py.

Definition at line 116 of file lumiPlot.py.

Definition at line 250 of file lumiPlot.py.

tuple lumiPlot::rruns = []

Definition at line 268 of file lumiPlot.py.

Definition at line 399 of file lumiPlot.py.

tuple lumiPlot::runlist = lumiCalcAPI.runList(session.nominalSchema(),options.fillnum,runmin=None,runmax=None,startT=begTStr,stopT=endtime,l1keyPattern=None,hltkeyPattern=None,amodetag=options.amodetag,nominalEnergy=options.beamenergy,energyFlut=options.beamfluctuation,requiretrg=reqTrg,requirehlt=reqHlt)

Definition at line 292 of file lumiPlot.py.

tuple lumiPlot::session = svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])

Definition at line 240 of file lumiPlot.py.

Definition at line 537 of file lumiPlot.py.

Definition at line 538 of file lumiPlot.py.

Initial value:
00001 sessionManager.sessionManager(options.connect,
00002                                       authpath=options.authpath,
00003                                       siteconfpath=options.siteconfpath,
00004                                       debugON=options.debug)

Definition at line 236 of file lumiPlot.py.

tuple lumiPlot::thisfillnumber = fillrunMap.keys()

Definition at line 536 of file lumiPlot.py.

Definition at line 544 of file lumiPlot.py.

Definition at line 543 of file lumiPlot.py.

tuple lumiPlot::type = int,

Definition at line 131 of file lumiPlot.py.