當前位置: 首頁>>代碼示例>>Python>>正文


Python Channel.addSystematic方法代碼示例

本文整理匯總了Python中channel.Channel.addSystematic方法的典型用法代碼示例。如果您正苦於以下問題:Python Channel.addSystematic方法的具體用法?Python Channel.addSystematic怎麽用?Python Channel.addSystematic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在channel.Channel的用法示例。


在下文中一共展示了Channel.addSystematic方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: addChannel

# 需要導入模塊: from channel import Channel [as 別名]
# 或者: from channel.Channel import addSystematic [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]
開發者ID:lawrenceleejr,項目名稱:ZeroLeptonAnalysis,代碼行數:49,代碼來源:fitConfig.py


注:本文中的channel.Channel.addSystematic方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。