本文整理匯總了Python中channel.Channel.statErrorType方法的典型用法代碼示例。如果您正苦於以下問題:Python Channel.statErrorType方法的具體用法?Python Channel.statErrorType怎麽用?Python Channel.statErrorType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類channel.Channel
的用法示例。
在下文中一共展示了Channel.statErrorType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: addChannel
# 需要導入模塊: from channel import Channel [as 別名]
# 或者: from channel.Channel import statErrorType [as 別名]
def addChannel(self, variableName, regions, nBins, binLow, binHigh):
"""
Build a channel object from this fitConfig
@param variableName The variable name to use in this channel
@param regions Region to use
@param nBins Number of bins
@param binLow Left edge of lower bin
@param binHight Right edge of upper bin
"""
if variableName == "cuts":
nBins = len(regions)
#binLow = 0.5
binHigh = nBins + binLow
pass
chanObj = Channel(variableName, regions, self.prefix, nBins,
binLow, binHigh, self.statErrThreshold)
# Verify that this name is not already used
for chan in self.channels:
if chan.name == chanObj.name:
log.info("Not gonna add the region, because it exists in fitConfig --> channel-List follows:" )
for chan in self.channels:
print " chan.name = ", chan.name
raise RuntimeError("Channel %s already exists in fitConfig %s. Please use a different name." % (chanObj.name, self.name))
#set channel parent
chanObj.parentTopLvl = self
#set stat error type
chanObj.statErrorType = self.statErrorType
# Channel doesn't have weights so add them
chanObj.setWeights(self.weights)
# Propagate systematics into channel
for (systName, syst) in self.systDict.items():
chanObj.addSystematic(syst)
# Put samples owned by this fitConfig into the channel
for s in self.sampleList:
chanObj.addSample(s.Clone())
# Add channel to the list
self.channels.append(chanObj)
return self.channels[len(self.channels) - 1]