CMS 3D CMS Logo

Classes | Functions | Variables
estimatePileup2 Namespace Reference

Classes

class  pileupParameters
 

Functions

def fillPileupHistogram (bxlumiinfo, pileupHistName, maxPileupBin, runNumber=0, hist=None, debug=False)
 

Variables

 action
 
 algoname
 
 amodetagChoices
 
 args
 
 authpath
 
 basename
 
 beamChoices
 
 beamModeChoices
 

## Main Program

More...
 
 beamstatus
 
 bxAlgo
 
 bxlist
 
 bxlumiinfo
 convert lumiData to lumiDict format #{run:[[cmslsnum,avg]]} More...
 
 choices
 
 cmslsnum
 
 connect
 
 cpp2sqltype
 
 datatag
 
 dbGroup
 
 debug
 
 debugON
 
 default
 
 delivered
 
 deliveredlumi
 
 description
 
 dest
 
 events
 
 extension
 
 f
 
 False
 
 fileparsingResult
 
 finecorrections
 
 help
 
 hist
 
 histFile
 
 histList
 
 inputfilecontent
 
 inputGroup
 
 inputRange
 
 isReadOnly
 
 lumiData
 
 None
 
 options
 
 output
 
 parser
 
 pieces
 
 pileupGroup
 
 pileupHist
 
 recorded
 
 recordedlumi
 
 rruns
 
 run
 
 runDict
 
 runNumber
 
 schema
 
 sepRE
 
 session
 
 svc
 
 True
 
 type
 
 VERSION
 
 withBeamIntensity
 
 withBXInfo
 
 xingAlgoChoices
 
 xingIdx
 
 xingMinLum
 
 xingVal
 

Function Documentation

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 19 of file estimatePileup2.py.

References createfilelist.int.

19  runNumber=0, hist = None, debug = False):
20  '''
21  bxlumiinfo:[[cmslsnum(0),avgdelivered(1),avgrecorded(2),bxlumiarray[3]]]
22 
23  Given luminfo , deadfrac info and run number, will (create if necessary
24  and) fill histogram with expected pileup distribution. If a
25  histogram is created, it is owned by the user and is his/her
26  responsibility to clean up the memory.'''
27  if hist:
28  maxBin = hist.GetNbinsX()
29  upper = int( hist.GetBinLowEdge(maxBin) + \
30  hist.GetBinWidth(maxBin) + 0.25 )
31  else:
32  histname = '%s_%s' % (pileupHistName, runNumber)
33  hist = ROOT.TH1D (histname, histname, maxPileupBin + 1,
34  -0.5,maxPileupBin + 0.5)
35  upper = maxPileupBin
37  for perlsinfo in bxlumiinfo:
38  cmslsnum=perlsinfo[0]
39  avgdelivered=perlsinfo[1]
40  avgrecorded=perlsinfo[2]
41  bxdata=perlsinfo[3]
42  bxidx=bxdata[0]
43  bxvaluelist=bxdata[1]
44  #calculate livefrac
45  livetime=1
46  if avgrecorded<0:
47  avgrecorded=0
48  if avgdelivered:
49  livetime=avgrecorded/avgdelivered
50  else:
51  livetime=0
52  for idx,bxvalue in enumerate(bxvaluelist):
53  xingIntLumi=bxvalue * p.lumiSectionLen * livetime
54  if options.minBiasXsec:
55  mean = bxvalue * options.minBiasXsec * p.rotationTime
56  else:
57  mean = bxvalue * p.minBiasXsec * p.rotationTime
58  if mean > 100:
59  if runNumber:
60  print "mean number of pileup events > 100 for run %d, lum %d : m %f l %f" % \
61  (runNumber, lumiSection, mean, bxvalue)
62  else:
63  print "mean number of pileup events > 100 for lum %d: m %f l %f" % \
64  (cmslsnum, mean, bxvalue)
65  totalProb = 0
66  for obs in range (upper):
67  prob = ROOT.TMath.Poisson (obs, mean)
68  totalProb += prob
69  hist.Fill (obs, prob * xingIntLumi)
70  if debug:
71  xing=bxidx[idx]
72  print "ls", lumiSection, "xing", xing, "inst", bxvalue, \
73  "mean", mean, "totalProb", totalProb, 1 - totalProb
74  print " hist mean", hist.GetMean()
75  if totalProb < 1:
76  hist.Fill (obs, (1 - totalProb) * xingIntLumi)
77  return hist
78 

Variable Documentation

estimatePileup2.action

Definition at line 96 of file estimatePileup2.py.

estimatePileup2.algoname
estimatePileup2.amodetagChoices

Definition at line 89 of file estimatePileup2.py.

estimatePileup2.args

Definition at line 142 of file estimatePileup2.py.

estimatePileup2.authpath

Definition at line 157 of file estimatePileup2.py.

estimatePileup2.basename

Definition at line 197 of file estimatePileup2.py.

estimatePileup2.beamChoices

Definition at line 8 of file estimatePileup2.py.

estimatePileup2.beamModeChoices

## Main Program

Definition at line 88 of file estimatePileup2.py.

estimatePileup2.beamstatus
estimatePileup2.bxAlgo

Definition at line 216 of file estimatePileup2.py.

estimatePileup2.bxlist

Definition at line 226 of file estimatePileup2.py.

estimatePileup2.bxlumiinfo

convert lumiData to lumiDict format #{run:[[cmslsnum,avg]]}

Definition at line 221 of file estimatePileup2.py.

estimatePileup2.choices

Definition at line 111 of file estimatePileup2.py.

estimatePileup2.cmslsnum
estimatePileup2.connect

Definition at line 157 of file estimatePileup2.py.

estimatePileup2.cpp2sqltype

Definition at line 192 of file estimatePileup2.py.

estimatePileup2.datatag

Definition at line 216 of file estimatePileup2.py.

estimatePileup2.dbGroup

Definition at line 93 of file estimatePileup2.py.

estimatePileup2.debug

Definition at line 240 of file estimatePileup2.py.

estimatePileup2.debugON

Definition at line 157 of file estimatePileup2.py.

estimatePileup2.default

Definition at line 97 of file estimatePileup2.py.

estimatePileup2.delivered

Definition at line 179 of file estimatePileup2.py.

estimatePileup2.deliveredlumi

Definition at line 224 of file estimatePileup2.py.

estimatePileup2.description

Definition at line 92 of file estimatePileup2.py.

estimatePileup2.dest

Definition at line 96 of file estimatePileup2.py.

estimatePileup2.events

Definition at line 169 of file estimatePileup2.py.

estimatePileup2.extension

Definition at line 197 of file estimatePileup2.py.

estimatePileup2.f

Definition at line 202 of file estimatePileup2.py.

estimatePileup2.False

Definition at line 216 of file estimatePileup2.py.

estimatePileup2.fileparsingResult

Definition at line 200 of file estimatePileup2.py.

estimatePileup2.finecorrections

Definition at line 152 of file estimatePileup2.py.

estimatePileup2.help

Definition at line 98 of file estimatePileup2.py.

estimatePileup2.hist

Definition at line 238 of file estimatePileup2.py.

estimatePileup2.histFile

Definition at line 247 of file estimatePileup2.py.

estimatePileup2.histList

Definition at line 235 of file estimatePileup2.py.

estimatePileup2.inputfilecontent

Definition at line 203 of file estimatePileup2.py.

estimatePileup2.inputGroup

Definition at line 94 of file estimatePileup2.py.

estimatePileup2.inputRange

Definition at line 195 of file estimatePileup2.py.

estimatePileup2.isReadOnly

Definition at line 192 of file estimatePileup2.py.

estimatePileup2.lumiData

Definition at line 216 of file estimatePileup2.py.

estimatePileup2.None

Definition at line 216 of file estimatePileup2.py.

estimatePileup2.options

Definition at line 142 of file estimatePileup2.py.

estimatePileup2.output

Definition at line 151 of file estimatePileup2.py.

estimatePileup2.parser

Definition at line 91 of file estimatePileup2.py.

estimatePileup2.pieces

Definition at line 171 of file estimatePileup2.py.

estimatePileup2.pileupGroup

Definition at line 95 of file estimatePileup2.py.

estimatePileup2.pileupHist

Definition at line 232 of file estimatePileup2.py.

estimatePileup2.recorded

Definition at line 179 of file estimatePileup2.py.

estimatePileup2.recordedlumi

Definition at line 225 of file estimatePileup2.py.

estimatePileup2.rruns

Definition at line 209 of file estimatePileup2.py.

estimatePileup2.run

Definition at line 178 of file estimatePileup2.py.

estimatePileup2.runDict

Definition at line 162 of file estimatePileup2.py.

estimatePileup2.runNumber

Definition at line 239 of file estimatePileup2.py.

estimatePileup2.schema

Definition at line 210 of file estimatePileup2.py.

estimatePileup2.sepRE

Definition at line 168 of file estimatePileup2.py.

estimatePileup2.session

Definition at line 192 of file estimatePileup2.py.

estimatePileup2.svc

Definition at line 157 of file estimatePileup2.py.

estimatePileup2.True

Definition at line 192 of file estimatePileup2.py.

estimatePileup2.type

Definition at line 115 of file estimatePileup2.py.

estimatePileup2.VERSION

Definition at line 2 of file estimatePileup2.py.

estimatePileup2.withBeamIntensity

Definition at line 216 of file estimatePileup2.py.

estimatePileup2.withBXInfo

Definition at line 216 of file estimatePileup2.py.

estimatePileup2.xingAlgoChoices

Definition at line 90 of file estimatePileup2.py.

estimatePileup2.xingIdx

Definition at line 180 of file estimatePileup2.py.

estimatePileup2.xingMinLum

Definition at line 216 of file estimatePileup2.py.

estimatePileup2.xingVal

Definition at line 181 of file estimatePileup2.py.