Classes | |
class | pileupParameters |
Functions | |
def | fillPileupHistogram |
Variables | |
string | action = 'store_true' |
list | amodetagChoices = [ "PROTPHYS","IONPHYS" ] |
list | beamChoices = ['PROTPHYS','IONPHYS'] |
list | beamModeChoices = [ "","stable", "quiet", "either"] |
######################## ## ## ################## ## ## ## ## Main Program ## ## ## ## ################## ## ## ######################## ## | |
list | bxlist = perlsdata[8] |
list | bxlumiinfo = [] |
convert lumiData to lumiDict format #{run:[[cmslsnum,avg]]} | |
list | cmslsnum = perlsdata[1] |
tuple | dbGroup = optparse.OptionGroup(parser, "Database Options") |
debug = options.debugLumi) | |
string | default = 'frontier://LumiCalc/CMS_LUMI_PROD' |
list | deliveredlumi = perlsdata[5] |
tuple | events = open(options.csvInput, 'r') |
tuple | f = open(options.inputfile, 'r') |
tuple | fileparsingResult = csvSelectionParser.csvSelectionParser(options.inputfile) |
finecorrections = None | |
string | help = 'connect string to lumiDB ,default %default' |
tuple | hist |
tuple | histFile = ROOT.TFile.Open(output, 'recreate') |
list | histList = [] |
tuple | inputfilecontent = f.read() |
tuple | inputGroup = optparse.OptionGroup(parser, "Input Options") |
dictionary | inputRange = {int(options.runnumber):None} |
tuple | lumiData = lumiCalcAPI.lumiForRange(schema,inputRange,beamstatus=options.beamstatus,withBXInfo=True,bxAlgo=options.algoname,xingMinLum=options.xingMinLum,withBeamIntensity=False,datatag=None,finecorrections=finecorrections) |
list | output = args[0] |
tuple | parser |
tuple | pieces = sepRE.split(line.strip()) |
tuple | pileupGroup = optparse.OptionGroup(parser, "Pileup Options") |
tuple | pileupHist |
list | recordedlumi = perlsdata[6] |
tuple | rruns = inputRange.keys() |
dictionary | runDict = {} |
tuple | schema = session.nominalSchema() |
tuple | sepRE = re.compile(r'[\s,;:]+') |
tuple | session = svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')]) |
tuple | svc = sessionManager.sessionManager(options.connect,authpath=options.authpath,debugON=options.debug) |
string | VERSION = '2.00' |
list | xingAlgoChoices = [ "OCC1","OCC2","ET"] |
list | xingIdx = [int(myidx) for myidx in pieces[4::2] ] |
list | xingVal = [float(myval) for myval in pieces[5::2] ] |
def estimatePileup2::fillPileupHistogram | ( | bxlumiinfo, | |
pileupHistName, | |||
maxPileupBin, | |||
runNumber = 0 , |
|||
hist = None , |
|||
debug = False |
|||
) |
bxlumiinfo:[[cmslsnum(0),avgdelivered(1),avgrecorded(2),bxlumiarray[3]]] Given luminfo , deadfrac info and run number, will (create if necessary and) fill histogram with expected pileup distribution. If a histogram is created, it is owned by the user and is his/her responsibility to clean up the memory.
Definition at line 18 of file estimatePileup2.py.
00020 : 00021 ''' 00022 bxlumiinfo:[[cmslsnum(0),avgdelivered(1),avgrecorded(2),bxlumiarray[3]]] 00023 00024 Given luminfo , deadfrac info and run number, will (create if necessary 00025 and) fill histogram with expected pileup distribution. If a 00026 histogram is created, it is owned by the user and is his/her 00027 responsibility to clean up the memory.''' 00028 if hist: 00029 maxBin = hist.GetNbinsX() 00030 upper = int( hist.GetBinLowEdge(maxBin) + \ 00031 hist.GetBinWidth(maxBin) + 0.25 ) 00032 else: 00033 histname = '%s_%s' % (pileupHistName, runNumber) 00034 hist = ROOT.TH1D (histname, histname, maxPileupBin + 1, 00035 -0.5,maxPileupBin + 0.5) 00036 upper = maxPileupBin 00037 p=pileupParameters() 00038 for perlsinfo in bxlumiinfo: 00039 cmslsnum=perlsinfo[0] 00040 avgdelivered=perlsinfo[1] 00041 avgrecorded=perlsinfo[2] 00042 bxdata=perlsinfo[3] 00043 bxidx=bxdata[0] 00044 bxvaluelist=bxdata[1] 00045 #calculate livefrac 00046 livetime=1 00047 if avgrecorded<0: 00048 avgrecorded=0 00049 if avgdelivered: 00050 livetime=avgrecorded/avgdelivered 00051 else: 00052 livetime=0 00053 for idx,bxvalue in enumerate(bxvaluelist): 00054 xingIntLumi=bxvalue * p.lumiSectionLen * livetime 00055 if options.minBiasXsec: 00056 mean = bxvalue * options.minBiasXsec * p.rotationTime 00057 else: 00058 mean = bxvalue * p.minBiasXsec * p.rotationTime 00059 if mean > 100: 00060 if runNumber: 00061 print "mean number of pileup events > 100 for run %d, lum %d : m %f l %f" % \ 00062 (runNumber, lumiSection, mean, bxvalue) 00063 else: 00064 print "mean number of pileup events > 100 for lum %d: m %f l %f" % \ 00065 (cmslsnum, mean, bxvalue) 00066 totalProb = 0 00067 for obs in range (upper): 00068 prob = ROOT.TMath.Poisson (obs, mean) 00069 totalProb += prob 00070 hist.Fill (obs, prob * xingIntLumi) 00071 if debug: 00072 xing=bxidx[idx] 00073 print "ls", lumiSection, "xing", xing, "inst", bxvalue, \ 00074 "mean", mean, "totalProb", totalProb, 1 - totalProb 00075 print " hist mean", hist.GetMean() 00076 if totalProb < 1: 00077 hist.Fill (obs, (1 - totalProb) * xingIntLumi) 00078 return hist
string estimatePileup2::action = 'store_true' |
Definition at line 132 of file estimatePileup2.py.
list estimatePileup2::amodetagChoices = [ "PROTPHYS","IONPHYS" ] |
Definition at line 89 of file estimatePileup2.py.
list estimatePileup2::beamChoices = ['PROTPHYS','IONPHYS'] |
Definition at line 8 of file estimatePileup2.py.
list estimatePileup2::beamModeChoices = [ "","stable", "quiet", "either"] |
######################## ## ## ################## ## ## ## ## Main Program ## ## ## ## ################## ## ## ######################## ##
Definition at line 88 of file estimatePileup2.py.
list estimatePileup2::bxlist = perlsdata[8] |
Definition at line 226 of file estimatePileup2.py.
list estimatePileup2::bxlumiinfo = [] |
convert lumiData to lumiDict format #{run:[[cmslsnum,avg]]}
Definition at line 221 of file estimatePileup2.py.
list estimatePileup2::cmslsnum = perlsdata[1] |
Definition at line 223 of file estimatePileup2.py.
Referenced by LumiProducer::fillLSCache(), lumi::TRGDummy2DB::retrieveData(), lumi::TRGWBM2DB::retrieveData(), lumi::LumiDummy2DB::retrieveData(), lumi::HLTDummy2DB::retrieveData(), lumi::HLTV32DB::writeHltData(), lumi::HLTV32DB::writeHltDataToSchema2(), lumi::TRGScalers2DB::writeTrgData(), and lumi::TRGScalers2DB::writeTrgDataToSchema2().
tuple estimatePileup2::dbGroup = optparse.OptionGroup(parser, "Database Options") |
Definition at line 93 of file estimatePileup2.py.
estimatePileup2::debug = options.debugLumi) |
Definition at line 246 of file estimatePileup2.py.
string estimatePileup2::default = 'frontier://LumiCalc/CMS_LUMI_PROD' |
Definition at line 97 of file estimatePileup2.py.
list estimatePileup2::deliveredlumi = perlsdata[5] |
Definition at line 224 of file estimatePileup2.py.
tuple estimatePileup2::events = open(options.csvInput, 'r') |
Definition at line 169 of file estimatePileup2.py.
tuple estimatePileup2::f = open(options.inputfile, 'r') |
Definition at line 202 of file estimatePileup2.py.
tuple estimatePileup2::fileparsingResult = csvSelectionParser.csvSelectionParser(options.inputfile) |
Definition at line 200 of file estimatePileup2.py.
tuple estimatePileup2::finecorrections = None |
Definition at line 152 of file estimatePileup2.py.
string estimatePileup2::help = 'connect string to lumiDB ,default %default' |
Definition at line 98 of file estimatePileup2.py.
00001 fillPileupHistogram(lumiList,options.pileupHistName,options.maxPileupBin, 00002 runNumber = runNumber, 00003 debug = options.debugLumi)
Definition at line 238 of file estimatePileup2.py.
tuple estimatePileup2::histFile = ROOT.TFile.Open(output, 'recreate') |
Definition at line 247 of file estimatePileup2.py.
list estimatePileup2::histList = [] |
Definition at line 235 of file estimatePileup2.py.
tuple estimatePileup2::inputfilecontent = f.read() |
Definition at line 203 of file estimatePileup2.py.
tuple estimatePileup2::inputGroup = optparse.OptionGroup(parser, "Input Options") |
Definition at line 94 of file estimatePileup2.py.
tuple estimatePileup2::inputRange = {int(options.runnumber):None} |
Definition at line 195 of file estimatePileup2.py.
tuple estimatePileup2::lumiData = lumiCalcAPI.lumiForRange(schema,inputRange,beamstatus=options.beamstatus,withBXInfo=True,bxAlgo=options.algoname,xingMinLum=options.xingMinLum,withBeamIntensity=False,datatag=None,finecorrections=finecorrections) |
Definition at line 216 of file estimatePileup2.py.
list estimatePileup2::output = args[0] |
Definition at line 151 of file estimatePileup2.py.
tuple estimatePileup2::parser |
00001 optparse.OptionParser("Usage: %prog [--options] output.root", 00002 description = "Script to estimate pileup distribution using xing instantaneous luminosity information and minimum bias cross section. Output is TH1D stored in root file")
Definition at line 91 of file estimatePileup2.py.
tuple estimatePileup2::pieces = sepRE.split(line.strip()) |
Definition at line 171 of file estimatePileup2.py.
tuple estimatePileup2::pileupGroup = optparse.OptionGroup(parser, "Pileup Options") |
Definition at line 95 of file estimatePileup2.py.
00001 ROOT.TH1D(options.pileupHistName,options.pileupHistName, 00002 options.maxPileupBin + 1, 00003 -0.5, options.maxPileupBin + 0.5)
Definition at line 232 of file estimatePileup2.py.
list estimatePileup2::recordedlumi = perlsdata[6] |
Definition at line 225 of file estimatePileup2.py.
tuple estimatePileup2::rruns = inputRange.keys() |
Definition at line 209 of file estimatePileup2.py.
dictionary estimatePileup2::runDict = {} |
Definition at line 162 of file estimatePileup2.py.
tuple estimatePileup2::schema = session.nominalSchema() |
Definition at line 210 of file estimatePileup2.py.
tuple estimatePileup2::sepRE = re.compile(r'[\s,;:]+') |
Definition at line 168 of file estimatePileup2.py.
tuple estimatePileup2::session = svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')]) |
Definition at line 192 of file estimatePileup2.py.
tuple estimatePileup2::svc = sessionManager.sessionManager(options.connect,authpath=options.authpath,debugON=options.debug) |
Definition at line 157 of file estimatePileup2.py.
string estimatePileup2::VERSION = '2.00' |
Definition at line 2 of file estimatePileup2.py.
list estimatePileup2::xingAlgoChoices = [ "OCC1","OCC2","ET"] |
Definition at line 90 of file estimatePileup2.py.
list estimatePileup2::xingIdx = [int(myidx) for myidx in pieces[4::2] ] |
Definition at line 180 of file estimatePileup2.py.
list estimatePileup2::xingVal = [float(myval) for myval in pieces[5::2] ] |
Definition at line 181 of file estimatePileup2.py.