CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
generateEDF.LumiInfoCont Class Reference
Inheritance diagram for generateEDF.LumiInfoCont:

Public Member Functions

def __init__ (self, filename, **kwargs)
 
def __str__ (self)
 
def iteritems (self)
 
def keys (self)
 
def max (self, key)
 
def min (self, key)
 

Public Attributes

 allowNoXing
 
 invunits
 Now that everything is setup, switch integrated ## luminosity to more reasonable units. More...
 
 maxIntLum
 
 maxRun
 
 minIntLum
 
 minMaxKeys
 
 minRun
 
 noWarnings
 
 totalRecLum
 
 xingInfo
 

Private Member Functions

def _integrateContainer (self)
 

Private Attributes

 _max
 
 _min
 

Detailed Description

LumiInfoCont Class

Definition at line 110 of file generateEDF.py.

Constructor & Destructor Documentation

◆ __init__()

def generateEDF.LumiInfoCont.__init__ (   self,
  filename,
**  kwargs 
)

Definition at line 112 of file generateEDF.py.

112  def __init__ (self, filename, **kwargs):
113  print("loading luminosity information from '%s'." % filename)
114  source = open (filename, 'r')
115  self.minMaxKeys = ['totInstLum', 'aveInstLum', 'numXings',
116  'delivered', 'recorded']
117  self._min = {}
118  self._max = {}
119  self.totalRecLum = 0.
120  self.xingInfo = False
121  self.allowNoXing = kwargs.get ('ignore')
122  self.noWarnings = kwargs.get ('noWarnings')
123  self.minRun = 0
124  self.maxRun = 0
125  self.minIntLum = 0
126  self.maxIntLum = 0
127 
128  for key in self.minMaxKeys:
129  self._min[key] = -1
130  self._max[key] = 0
131  for line in source:
132  try:
133  lumi = LumiInfo (line)
134  except:
135  continue
136  self[lumi.key] = lumi
137  self.totalRecLum += lumi.recorded
138  if not self.xingInfo and lumi.xingInfo:
139  self.xingInfo = True
140  if lumi.xingInfo:
141  #print "yes", lumi.keyString
142  if not self.xingInfo:
143  print("huh?")
144  for key in self.minMaxKeys:
145  val = getattr (lumi, key)
146  if val < self._min[key] or self._min[key] < 0:
147  self._min[key] = val
148  if val > self._max[key] or not self._max[key]:
149  self._max[key] = val
150  source.close()
151 
156  self.invunits = 'nb'
157  lumFactor = 1e3
158  if self.totalRecLum > 1e9:
159  lumFactor = 1e9
160  self.invunits = 'fb'
161  elif self.totalRecLum > 1e6:
162  lumFactor = 1e6
163  self.invunits = 'pb'
164  # use lumFactor to make everything consistent
165  #print "units", self.invunits, "factor", lumFactor
166  self.totalRecLum /= lumFactor
167  for lumis in self.values():
168  lumis.delivered /= lumFactor
169  lumis.recorded /= lumFactor
170  # Probably want to rename this next subroutine, but I'll leave
171  # it alone for now...
172  self._integrateContainer()
173 
174 
175 

References print().

Member Function Documentation

◆ __str__()

def generateEDF.LumiInfoCont.__str__ (   self)

◆ _integrateContainer()

def generateEDF.LumiInfoCont._integrateContainer (   self)
private

Definition at line 199 of file generateEDF.py.

199  def _integrateContainer (self):
200  # calculate numbers for recorded integrated luminosity
201  total = 0.
202  for key, lumi in self.items():
203  total += lumi.recorded
204  lumi.totalRecorded = total
205  lumi.fracRecorded = old_div(total, self.totalRecLum)
206  # calculate numbers for average xing instantaneous luminosity
207  if not self.xingInfo:
208  # nothing to do here
209  return
210  xingKeyList = []
211  maxAveInstLum = 0.
212  for key, lumi in self.items():
213  if not lumi.xingInfo and not lumi.fixXingInfo():
214  if not self.noWarnings:
215  print("Do not have lumi xing info for %s" % lumi.keyString)
216  if not self.allowNoXing:
217  print("Setting no Xing info flag")
218  self.xingInfo = False
219  return
220  continue
221  xingKeyList.append( (lumi.aveInstLum, key) )
222  if lumi.aveInstLum > maxAveInstLum:
223  maxAveInstLum = lumi.aveInstLum
224  xingKeyList.sort()
225  total = 0.
226  for tup in xingKeyList:
227  lumi = self[tup[1]]
228  total += lumi.recorded
229  lumi.totalAXILrecorded = total
230  lumi.fracAXILrecorded = old_div(total, self.totalRecLum)
231  lumi.fracAXIL = old_div(lumi.aveInstLum, maxAveInstLum)
232 
233 

References generateEDF.LumiInfoCont.allowNoXing, PixelDCSObject< T >.items, EcalContainer< EcalScDetId, Item >.items(), Items.items(), DictTypes.SortedKeysDict.items(), EcalContainer< ESDetId, Item >.items(), EcalContainer< DetId, T >.items(), EcalContainer< EEDetId, Item >.items(), EcalContainer< DetIdT, T >.items(), EcalContainer< EBDetId, Item >.items(), EcalContainer< EcalTrigTowerDetId, Item >.items(), AlignmentSurfaceDeformations.items(), betterConfigParser.AdaptedDict.items(), edm::ErrorObj.items(), FWTableViewManager.items(), betterConfigParser.BetterConfigParser.items(), svgfig.SVG.items(), generateEDF.LumiInfoCont.noWarnings, print(), generateEDF.LumiInfoCont.totalRecLum, generateEDF.LumiInfo.xingInfo, and generateEDF.LumiInfoCont.xingInfo.

◆ iteritems()

def generateEDF.LumiInfoCont.iteritems (   self)

Definition at line 195 of file generateEDF.py.

195  def iteritems (self):
196  return sorted (dict.iteritems (self))
197 
198 

◆ keys()

def generateEDF.LumiInfoCont.keys (   self)

Definition at line 191 of file generateEDF.py.

191  def keys (self):
192  return sorted (dict.keys (self))
193 
194 

Referenced by psClasses.queueList.__init__(), psClasses.queueList.smallestQueue(), and psClasses.queueList.thinerQueue().

◆ max()

def generateEDF.LumiInfoCont.max (   self,
  key 
)

Definition at line 187 of file generateEDF.py.

187  def max (self, key):
188  return self._max[key]
189 
190 

References GeometryComparisonPlotter._max, generateEDF.LumiInfoCont._max, CompareToMedian._max, and CompareLastFilledBin._max.

◆ min()

def generateEDF.LumiInfoCont.min (   self,
  key 
)

Definition at line 183 of file generateEDF.py.

183  def min (self, key):
184  return self._min[key]
185 
186 

References GeometryComparisonPlotter._min, generateEDF.LumiInfoCont._min, CompareToMedian._min, and CompareLastFilledBin._min.

Member Data Documentation

◆ _max

generateEDF.LumiInfoCont._max
private

Definition at line 118 of file generateEDF.py.

Referenced by generateEDF.LumiInfoCont.max().

◆ _min

generateEDF.LumiInfoCont._min
private

Definition at line 117 of file generateEDF.py.

Referenced by generateEDF.LumiInfoCont.min().

◆ allowNoXing

generateEDF.LumiInfoCont.allowNoXing

Definition at line 121 of file generateEDF.py.

Referenced by generateEDF.LumiInfoCont._integrateContainer().

◆ invunits

generateEDF.LumiInfoCont.invunits

Now that everything is setup, switch integrated ## luminosity to more reasonable units.

##

the default is '1/mb', but that's just silly.

Definition at line 156 of file generateEDF.py.

◆ maxIntLum

generateEDF.LumiInfoCont.maxIntLum

Definition at line 126 of file generateEDF.py.

◆ maxRun

generateEDF.LumiInfoCont.maxRun

Definition at line 124 of file generateEDF.py.

◆ minIntLum

generateEDF.LumiInfoCont.minIntLum

Definition at line 125 of file generateEDF.py.

◆ minMaxKeys

generateEDF.LumiInfoCont.minMaxKeys

Definition at line 115 of file generateEDF.py.

◆ minRun

generateEDF.LumiInfoCont.minRun

Definition at line 123 of file generateEDF.py.

◆ noWarnings

generateEDF.LumiInfoCont.noWarnings

Definition at line 122 of file generateEDF.py.

Referenced by generateEDF.LumiInfoCont._integrateContainer().

◆ totalRecLum

generateEDF.LumiInfoCont.totalRecLum

Definition at line 119 of file generateEDF.py.

Referenced by generateEDF.LumiInfoCont._integrateContainer().

◆ xingInfo

generateEDF.LumiInfoCont.xingInfo

Definition at line 120 of file generateEDF.py.

Referenced by generateEDF.LumiInfoCont._integrateContainer().

min
T min(T a, T b)
Definition: MathUtil.h:58
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103