Esempio n. 1
0
    def setupChains(self) :
        self.chains = dict( [(item,r.TChain("chain%d"%iItem)) for iItem,item in enumerate([self.mainTree]+self.otherTreesToKeepWhenSkimming)])
        for (dirName,treeName),chain in self.chains.iteritems() :
            for infile in self.inputFiles : chain.Add("%s/%s/%s"%(infile, dirName, treeName))
            r.SetOwnership(chain, False)

        if not self.quietMode :
            nFiles = len(self.inputFiles)
            nEventsString = str(self.chains[self.mainTree].GetEntries()) if configuration.computeEntriesForReport() else "(number not computed)"
            print utils.hyphens
            print "The %d \"%s\" input file%s:"%(nFiles, self.name, "s" if nFiles>1 else '')
            print '\n'.join(self.inputFiles[:2]+["..."][:len(self.inputFiles)-1]+self.inputFiles[2:][-2:])
            print "contain%s %s events."%(("s" if nFiles==1 else ""), nEventsString)
            print utils.hyphens
Esempio n. 2
0
    def setupChains(self) :
        assert self.mainTree not in self.otherTreesToKeepWhenSkimming
        self.chains = dict( [(item,r.TChain("%s/%s"%item)) for item in [self.mainTree]+self.otherTreesToKeepWhenSkimming])
        for (dirName,treeName),chain in self.chains.iteritems() :
            for infile in self.inputFiles : chain.Add(infile[0])
            r.SetOwnership(chain, False)

        if self.inputFiles and not self.quietMode:
            nFiles = len(self.inputFiles)
            nEventsString = ( str(self.chains[self.mainTree].GetEntries()) if configuration.computeEntriesForReport() else
                              "%d (expected)"%self.nExpect if configuration.computeEntriesAtMakeFileList() else
                              "(number not computed)" )
            filesLines = ( '\n'.join(zip(*self.inputFiles)[0]) if len(self.inputFiles) < 5 else
                           '\n'.join(zip(*self.inputFiles[:2])[0]+("...",)[:len(self.inputFiles)-1]+zip(*self.inputFiles[2:][-2:])[0]) )
            plural = nFiles>1
            print utils.hyphens
            print "The %d \"%s\" input file%s:"%(nFiles, self.name, ['','s'][plural])
            print filesLines
            print "contain%s %s events."%(['s',''][plural], nEventsString)
            if self.skip :
                print "Skipping first %d events"%self.skip
            print utils.hyphens