processingClasses.py 文件源码

python
阅读 15 收藏 0 点赞 0 评论 0

项目:OVERWATCH 作者: raymondEhlers 项目源码 文件源码
def __init__(self, runDir, fileMode, hltMode = None):
        self.runDir = runDir
        self.runNumber = int(runDir.replace("Run", ""))
        self.prettyName = "Run {0}".format(self.runNumber)
        # Need to rework the qa container 
        #self.qaContainer = qa.qaFunctionContainer
        self.mode = fileMode
        self.subsystems = BTrees.OOBTree.BTree()
        self.hltMode = hltMode

        # Try to retrieve the HLT mode if it was not passed
        runInfoFilePath = os.path.join(processingParameters["dirPrefix"], self.runDir, "runInfo.yaml")
        if not hltMode:
            try:
                with open(runInfoFilePath, "rb") as f:
                    runInfo = yaml.load(f.read())

                self.hltMode = runInfo["hltMode"]
            except IOError as e:
                # File does not exist
                # HLT mode will have to be unknown
                self.hltMode = "U"

        # Run Information
        # Since this is only information to save, only write it if the file doesn't exist
        if not os.path.exists(runInfoFilePath):
            runInfo = {}
            # "U" for unknown
            runInfo["hltMode"] = hltMode if hltMode else "U"

            # Write information
            if not os.path.exists(os.path.dirname(runInfoFilePath)):
                os.makedirs(os.path.dirname(runInfoFilePath))
            with open(runInfoFilePath, "wb") as f:
                yaml.dump(runInfo, f)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号