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

References createfilelist.int.

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

Variable Documentation

estimatePileup2.action

Definition at line 97 of file estimatePileup2.py.

estimatePileup2.algoname
estimatePileup2.amodetagChoices

Definition at line 90 of file estimatePileup2.py.

estimatePileup2.args

Definition at line 143 of file estimatePileup2.py.

estimatePileup2.authpath

Definition at line 158 of file estimatePileup2.py.

estimatePileup2.basename

Definition at line 198 of file estimatePileup2.py.

estimatePileup2.beamChoices

Definition at line 9 of file estimatePileup2.py.

estimatePileup2.beamModeChoices

## Main Program

Definition at line 89 of file estimatePileup2.py.

estimatePileup2.beamstatus
estimatePileup2.bxAlgo

Definition at line 217 of file estimatePileup2.py.

estimatePileup2.bxlist

Definition at line 227 of file estimatePileup2.py.

estimatePileup2.bxlumiinfo

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

Definition at line 222 of file estimatePileup2.py.

estimatePileup2.choices

Definition at line 112 of file estimatePileup2.py.

estimatePileup2.cmslsnum
estimatePileup2.connect

Definition at line 158 of file estimatePileup2.py.

estimatePileup2.cpp2sqltype

Definition at line 193 of file estimatePileup2.py.

estimatePileup2.datatag

Definition at line 217 of file estimatePileup2.py.

estimatePileup2.dbGroup

Definition at line 94 of file estimatePileup2.py.

estimatePileup2.debug

Definition at line 241 of file estimatePileup2.py.

estimatePileup2.debugON

Definition at line 158 of file estimatePileup2.py.

estimatePileup2.default

Definition at line 98 of file estimatePileup2.py.

estimatePileup2.delivered

Definition at line 180 of file estimatePileup2.py.

estimatePileup2.deliveredlumi

Definition at line 225 of file estimatePileup2.py.

estimatePileup2.description

Definition at line 93 of file estimatePileup2.py.

estimatePileup2.dest

Definition at line 97 of file estimatePileup2.py.

estimatePileup2.events

Definition at line 170 of file estimatePileup2.py.

estimatePileup2.extension

Definition at line 198 of file estimatePileup2.py.

estimatePileup2.f

Definition at line 203 of file estimatePileup2.py.

estimatePileup2.False

Definition at line 217 of file estimatePileup2.py.

estimatePileup2.fileparsingResult

Definition at line 201 of file estimatePileup2.py.

estimatePileup2.finecorrections

Definition at line 153 of file estimatePileup2.py.

estimatePileup2.help

Definition at line 99 of file estimatePileup2.py.

estimatePileup2.hist

Definition at line 239 of file estimatePileup2.py.

estimatePileup2.histFile

Definition at line 248 of file estimatePileup2.py.

estimatePileup2.histList

Definition at line 236 of file estimatePileup2.py.

estimatePileup2.inputfilecontent

Definition at line 204 of file estimatePileup2.py.

estimatePileup2.inputGroup

Definition at line 95 of file estimatePileup2.py.

estimatePileup2.inputRange

Definition at line 196 of file estimatePileup2.py.

estimatePileup2.isReadOnly

Definition at line 193 of file estimatePileup2.py.

estimatePileup2.lumiData

Definition at line 217 of file estimatePileup2.py.

estimatePileup2.None

Definition at line 217 of file estimatePileup2.py.

estimatePileup2.options

Definition at line 143 of file estimatePileup2.py.

estimatePileup2.output

Definition at line 152 of file estimatePileup2.py.

estimatePileup2.parser

Definition at line 92 of file estimatePileup2.py.

estimatePileup2.pieces

Definition at line 172 of file estimatePileup2.py.

estimatePileup2.pileupGroup

Definition at line 96 of file estimatePileup2.py.

estimatePileup2.pileupHist

Definition at line 233 of file estimatePileup2.py.

estimatePileup2.recorded

Definition at line 180 of file estimatePileup2.py.

estimatePileup2.recordedlumi

Definition at line 226 of file estimatePileup2.py.

estimatePileup2.rruns

Definition at line 210 of file estimatePileup2.py.

estimatePileup2.run

Definition at line 179 of file estimatePileup2.py.

estimatePileup2.runDict

Definition at line 163 of file estimatePileup2.py.

estimatePileup2.runNumber

Definition at line 240 of file estimatePileup2.py.

estimatePileup2.schema

Definition at line 211 of file estimatePileup2.py.

estimatePileup2.sepRE

Definition at line 169 of file estimatePileup2.py.

estimatePileup2.session

Definition at line 193 of file estimatePileup2.py.

estimatePileup2.svc

Definition at line 158 of file estimatePileup2.py.

estimatePileup2.True

Definition at line 193 of file estimatePileup2.py.

estimatePileup2.type

Definition at line 116 of file estimatePileup2.py.

estimatePileup2.VERSION

Definition at line 2 of file estimatePileup2.py.

estimatePileup2.withBeamIntensity

Definition at line 217 of file estimatePileup2.py.

estimatePileup2.withBXInfo

Definition at line 217 of file estimatePileup2.py.

estimatePileup2.xingAlgoChoices

Definition at line 91 of file estimatePileup2.py.

estimatePileup2.xingIdx

Definition at line 181 of file estimatePileup2.py.

estimatePileup2.xingMinLum

Definition at line 217 of file estimatePileup2.py.

estimatePileup2.xingVal

Definition at line 182 of file estimatePileup2.py.