Ejemplo n.º 1
0
    def setupSteps(self, withBook = True, minimal = False) :
        r.gROOT.cd()
        current = r.gDirectory
        priorFilters = []

        for step in self.steps :
            step.setOutputFileStem(self.outputFileStem)
            step.setInputFileStem(self.inputFileStem)
            step.priorFilters = set(priorFilters)
            if step.isSelector and step.name not in ['master','label'] : priorFilters.append((step.name,step.moreNames))
            if self.quietMode : step.makeQuiet()

            if withBook : 
                current = current.mkdir(step.name)
                step.book = autoBook(current)

            if minimal : continue
            step.tracer = keyTracer(None) if self.trace and (step.isSelector or issubclass(type(step),wrappedChain.calculable)) else None
            assert step.isSelector ^ hasattr(step,"uponAcceptance"), "Step %s must implement 1 and only 1 of {select,uponAcceptance}"%step.name
            if step.disabled : continue
            step.setup(self.chains[self.mainTree], self.mainTree[0])
Ejemplo n.º 2
0
 def setup(self,*_) :
     '''Make a new book for each weight'''
     dir = r.gDirectory.GetDirectory("")
     self.book._autoBook__directory.cd()
     for i in range(self.N): self.books.append(autoBook("w%d"%i))
     dir.cd()