hRawYieldsBkgSecPeak.Write() hRawYieldsTrue.Write() hRawYieldsSecPeakTrue.Write() hRelDiffRawYieldsFitTrue.Write() hRelDiffRawYieldsSecPeakFitTrue.Write() hEv.Write() if not args.isMC: dirSB = TDirectoryFile('SandBDiffNsigma', 'SandBDiffNsigma') dirSB.Write() dirSB.cd() for iS, _ in enumerate(nSigma4SandB): hRawYieldsSignalDiffSigma[iS].Write() hRawYieldsBkgDiffSigma[iS].Write() hRawYieldsSoverBDiffSigma[iS].Write() hRawYieldsSignifDiffSigma[iS].Write() dirSB.Close() outFile.Close() outFileNamePDF = args.outFileName.replace('.root', '.pdf') outFileNameResPDF = outFileNamePDF.replace('.pdf', '_Residuals.pdf') for iCanv, (cM, cR) in enumerate(zip(cMass, cResiduals)): if iCanv == 0 and nCanvases > 1: cM.SaveAs(f'{outFileNamePDF}[') cM.SaveAs(outFileNamePDF) if iCanv == nCanvases - 1 and nCanvases > 1: cM.SaveAs(f'{outFileNamePDF}]') if not args.isMC: if iCanv == 0 and nCanvases > 1: cR.SaveAs(f'{outFileNameResPDF}[') cR.SaveAs(outFileNameResPDF) if iCanv == nCanvases - 1 and nCanvases > 1:
hAcc[-1].SetDirectory(0) hEffAcc[-1].SetDirectory(0) outFile.cd() outDir = TDirectoryFile(meson, meson) outDir.Write() outDir.cd() hSgn[-1].Write() hSgnMin[-1].Write() hSgnMax[-1].Write() for iPt, _ in enumerate(hMassSignal): hMassSignal[iPt].Write() hMassSignalMin[iPt].Write() hMassSignalMax[iPt].Write() hBkg[-1].Write() for iPt, _ in enumerate(hMassSignal): hMassBkg[iPt].Write() hMassBkgMin[iPt].Write() hMassBkgMax[iPt].Write() hSignif[-1].Write() hSignifMin[-1].Write() hSignifMax[-1].Write() hSoverB[-1].Write() hSoverBMin[-1].Write() hSoverBMax[-1].Write() hEff[-1].Write() hAcc[-1].Write() hEffAcc[-1].Write() outDir.Close() outFile.Close()