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

References createfilelist.int, and edm.print().

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

Variable Documentation

estimatePileup2.action

Definition at line 98 of file estimatePileup2.py.

estimatePileup2.algoname
estimatePileup2.amodetagChoices

Definition at line 91 of file estimatePileup2.py.

estimatePileup2.args

Definition at line 144 of file estimatePileup2.py.

estimatePileup2.authpath

Definition at line 159 of file estimatePileup2.py.

estimatePileup2.basename

Definition at line 199 of file estimatePileup2.py.

estimatePileup2.beamChoices

Definition at line 10 of file estimatePileup2.py.

estimatePileup2.beamModeChoices

## Main Program

Definition at line 90 of file estimatePileup2.py.

estimatePileup2.beamstatus
estimatePileup2.bxAlgo

Definition at line 218 of file estimatePileup2.py.

estimatePileup2.bxlist

Definition at line 228 of file estimatePileup2.py.

estimatePileup2.bxlumiinfo

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

Definition at line 223 of file estimatePileup2.py.

estimatePileup2.choices

Definition at line 113 of file estimatePileup2.py.

estimatePileup2.cmslsnum
estimatePileup2.connect

Definition at line 159 of file estimatePileup2.py.

estimatePileup2.cpp2sqltype

Definition at line 194 of file estimatePileup2.py.

estimatePileup2.datatag

Definition at line 218 of file estimatePileup2.py.

estimatePileup2.dbGroup

Definition at line 95 of file estimatePileup2.py.

estimatePileup2.debug

Definition at line 242 of file estimatePileup2.py.

estimatePileup2.debugON

Definition at line 159 of file estimatePileup2.py.

estimatePileup2.default

Definition at line 99 of file estimatePileup2.py.

estimatePileup2.delivered

Definition at line 181 of file estimatePileup2.py.

estimatePileup2.deliveredlumi

Definition at line 226 of file estimatePileup2.py.

estimatePileup2.description

Definition at line 94 of file estimatePileup2.py.

estimatePileup2.dest

Definition at line 98 of file estimatePileup2.py.

estimatePileup2.events

Definition at line 171 of file estimatePileup2.py.

estimatePileup2.extension

Definition at line 199 of file estimatePileup2.py.

estimatePileup2.f

Definition at line 204 of file estimatePileup2.py.

estimatePileup2.False

Definition at line 218 of file estimatePileup2.py.

estimatePileup2.fileparsingResult

Definition at line 202 of file estimatePileup2.py.

estimatePileup2.finecorrections

Definition at line 154 of file estimatePileup2.py.

estimatePileup2.help

Definition at line 100 of file estimatePileup2.py.

estimatePileup2.hist

Definition at line 240 of file estimatePileup2.py.

estimatePileup2.histFile

Definition at line 249 of file estimatePileup2.py.

estimatePileup2.histList

Definition at line 237 of file estimatePileup2.py.

estimatePileup2.inputfilecontent

Definition at line 205 of file estimatePileup2.py.

estimatePileup2.inputGroup

Definition at line 96 of file estimatePileup2.py.

estimatePileup2.inputRange

Definition at line 197 of file estimatePileup2.py.

estimatePileup2.isReadOnly

Definition at line 194 of file estimatePileup2.py.

estimatePileup2.lumiData

Definition at line 218 of file estimatePileup2.py.

estimatePileup2.None

Definition at line 218 of file estimatePileup2.py.

estimatePileup2.options

Definition at line 144 of file estimatePileup2.py.

estimatePileup2.output

Definition at line 153 of file estimatePileup2.py.

estimatePileup2.parser

Definition at line 93 of file estimatePileup2.py.

estimatePileup2.pieces

Definition at line 173 of file estimatePileup2.py.

estimatePileup2.pileupGroup

Definition at line 97 of file estimatePileup2.py.

estimatePileup2.pileupHist

Definition at line 234 of file estimatePileup2.py.

estimatePileup2.recorded

Definition at line 181 of file estimatePileup2.py.

estimatePileup2.recordedlumi

Definition at line 227 of file estimatePileup2.py.

estimatePileup2.rruns

Definition at line 211 of file estimatePileup2.py.

estimatePileup2.run

Definition at line 180 of file estimatePileup2.py.

estimatePileup2.runDict

Definition at line 164 of file estimatePileup2.py.

estimatePileup2.runNumber

Definition at line 241 of file estimatePileup2.py.

estimatePileup2.schema

Definition at line 212 of file estimatePileup2.py.

estimatePileup2.sepRE

Definition at line 170 of file estimatePileup2.py.

estimatePileup2.session

Definition at line 194 of file estimatePileup2.py.

estimatePileup2.svc

Definition at line 159 of file estimatePileup2.py.

estimatePileup2.True

Definition at line 194 of file estimatePileup2.py.

estimatePileup2.type

Definition at line 117 of file estimatePileup2.py.

estimatePileup2.VERSION

Definition at line 3 of file estimatePileup2.py.

estimatePileup2.withBeamIntensity

Definition at line 218 of file estimatePileup2.py.

estimatePileup2.withBXInfo

Definition at line 218 of file estimatePileup2.py.

estimatePileup2.xingAlgoChoices

Definition at line 92 of file estimatePileup2.py.

estimatePileup2.xingIdx

Definition at line 182 of file estimatePileup2.py.

estimatePileup2.xingMinLum

Definition at line 218 of file estimatePileup2.py.

estimatePileup2.xingVal

Definition at line 183 of file estimatePileup2.py.