def buildQCDQuarkGluonWeightingSystModule(self, dataPath, ewkPath, normFactorsUp, normFactorsDown, normalizationPoint): # Up variation of fake weighting mySystModulePlus = pseudoMultiCrabCreator.PseudoMultiCrabModule( self._dsetMgr, self._era, self._searchMode, self._optimizationMode, "SystVarFakeWeightingPlus") self._fakeWeightingPlusResult = qcdInvertedResult.QCDInvertedResultManager( dataPath, ewkPath, self._dsetMgr, self._luminosity, self.getModuleInfoString(), normFactorsUp, optionCalculateQCDNormalizationSyst=False, optionUseInclusiveNorm=self._opts.useInclusiveNorm) myModule.addPlots(self._fakeWeightingPlusResult.getShapePlots(), self._fakeWeightingPlusResult.getShapePlotLabels()) self._outputCreator.addModule(mySystModulePlus) # Down variation of fake weighting mySystModuleMinus = pseudoMultiCrabCreator.PseudoMultiCrabModule( dself._dsetMgr, self._era, self._searchMode, self._optimizationMode, "SystVarFakeWeightingMinus") self._fakeWeightingMinusResult = qcdInvertedResult.QCDInvertedResultManager( dataPath, ewkPath, self._dsetMgr, self._myLuminosity, self.getModuleInfoString(), normFactorsDown, optionCalculateQCDNormalizationSyst=False) myModule.addPlots(self._fakeWeightingMinusResult.getShapePlots(), self._fakeWeightingMinusResult.getShapePlotLabels()) self._outputCreator.addModule(mySystModuleMinus)
def doClosureTestPlots(opts, dsetMgr, moduleInfoString, myDir, luminosity, normFactors): # Set here the names of the histograms you want to access #histoNameList = ["MTInvertedTauIdFinalReversedBtag","MTInvertedTauIdFinalReversedBacktoBackDeltaPhi"] #histoNameList = ["shapeTransverseMass"] histoNameList = ["MTInvertedTauIdAfterCollinearCuts"] for histoName in histoNameList: print histoName myBaselineShape = DataDrivenQCDShape( dsetMgr, "Data", "EWK", "baseline/" + histoName.replace("Inverted", "Baseline"), luminosity) myInvertedShape = DataDrivenQCDShape(dsetMgr, "Data", "EWK", "Inverted/" + histoName, luminosity) myInvertedResults = qcdInvertedResult.QCDInvertedShape( myInvertedShape, moduleInfoString, normFactors, optionPrintPurityByBins=False, optionDoNQCDByBinHistograms=True) # Do comparison plots bin-by-bin myInvertedHistos = myInvertedResults.getNQCDHistograms() for i in range(0, len(myInvertedHistos)): doSinglePlot( myBaselineShape.getDataDrivenQCDHistoForSplittedBin(i), myInvertedHistos[i], myDir, histoName + "_bin%d" % i, luminosity) # Do comparison plot for bins summed up doSinglePlot(myBaselineShape.getIntegratedDataDrivenQCDHisto(), myInvertedResults.getResultShape(), myDir, histoName, luminosity) print HighlightStyle() + "doClosureTestPlots is ready" + NormalStyle()
def buildModule(self, dataPath, ewkPath, normFactors, calculateQCDNormalizationSyst, normDataSrc=None, normEWKSrc=None): # Create containers for results myModule = pseudoMultiCrabCreator.PseudoMultiCrabModule( self._dsetMgr, self._era, self._searchMode, self._optimizationMode, self._systematicVariation) # Obtain results self._nominalResult = qcdInvertedResult.QCDInvertedResultManager( dataPath, ewkPath, self._dsetMgr, self._luminosity, self.getModuleInfoString(), normFactors, optionCalculateQCDNormalizationSyst=calculateQCDNormalizationSyst, normDataSrc=normDataSrc, normEWKSrc=normEWKSrc, optionUseInclusiveNorm=self._opts.useInclusiveNorm) # Store results myModule.addPlots(self._nominalResult.getShapePlots(), self._nominalResult.getShapePlotLabels()) self._outputCreator.addModule(myModule)