Beispiel #1
0
 def __init__(self, reconstructedHist, migrationMatrix):
     super(UnfoldingTUnfold, self).__init__(reconstructedHist,
                                            migrationMatrix)
     ### Be careful of underflow/overflow bins, may want to set to zero for all?
     self.tunfold = ROOT.TUnfoldDensity(
         cloneTNamedUUIDName(migrationMatrix),
         ROOT.TUnfold.kHistMapOutputVert)
     errCode = self.tunfold.SetInput(cloneTNamedUUIDName(reconstructedHist))
     if errCode >= 10000:
         print(
             "Warning: TUnfold doesn't think input data can make unfolding work"
         )
Beispiel #2
0
 def binArrayToHist(self, a, th2=False):
     if th2:
         result = cloneTNamedUUIDName(self.migrationMatrix)
         result.Reset()
         nBins = result.GetNbinsX()
         assert (hist.GetNbinsY() == nBins)
         assert (a.shape == (nBins, nBins))
         for iBin in range(1, nBins + 1):
             for jBin in range(1, nBins + 1):
                 result.SetBinContent(iBin, jBin, a[iBin - 1][jBin - 1])
         return result
     else:
         result = cloneTNamedUUIDName(self.reconstructedHist)
         result.Reset()
         nBins = result.GetNbinsX()
         for iBin in range(1, nBins + 1):
             result.SetBinContent(iBin, a[iBin - 1])
         return result
Beispiel #3
0
 def getMigrationMatrix(self):
     return cloneTNamedUUIDName(self.migrationMatrix)
Beispiel #4
0
 def getReconstructedHist(self):
     return cloneTNamedUUIDName(self.reconstructedHist)
Beispiel #5
0
 def getCovarianceMatrix(self):
     return cloneTNamedUUIDName(self.covarianceMatrix)
Beispiel #6
0
 def getResult(self):
     return cloneTNamedUUIDName(self.resultHist)