Exemple #1
0
    def WriteResultsToOutputFile(self):
        """Write histograms and number of events to file."""

        if self.rootOutput:
            self.rootOutput.cd()

            tree = grtf_tools.ConvertDictToTTree(self.numEvents, "NumEvents")
            tree.Write()

            grtf_tools.RecurseOutput(self.histos, self.rootOutput)

            self.rootOutput.Close()
        else:
            print "Unable to find output file. Tree not saved!"
Exemple #2
0
    def WriteResultsToOutputFile(self):
        """
        Write percentage failures to screen, and write histograms and numebr of events to file.
        """

        if self.rootOutput:
            self.rootOutput.cd()

            self.WritePercentages(self.percentages["ByPos"], "ByPos")

            tree = grtf_tools.ConvertDictToTTree(self.numEvents, "NumEvents")
            tree.Write()

            for histo in self.listOfHistosAndOtherObjects:
                histo.Write()

            grtf_tools.RecurseOutput(self.histos, self.rootOutput)

            self.rootOutput.Close()
        else:
            print "Unable to find output file. Tree not saved!"