|
29 | 29 | TF1, |
30 | 30 | TH1, |
31 | 31 | TH1F, |
| 32 | + RooArgSet, |
| 33 | + RooConstVar, |
32 | 34 | TCanvas, |
33 | 35 | TFile, |
34 | 36 | TLegend, |
@@ -181,7 +183,8 @@ def _roofit_mass(self, level, hist, ipt, pdfnames, param_names, fitcfg, fixed_si |
181 | 183 | fixed_sigma, fixed_sigma_val, |
182 | 184 | roows=roows, plot=True) |
183 | 185 | except ValueError: |
184 | | - self.logger.error(f"Could not do fitting on {level} for pt {self.bins_candpt[ipt]} - {self.bins_candpt[ipt+1]}") |
| 186 | + self.logger.error("Could not do fitting on %d for pt %.1f - %.1f", |
| 187 | + level, self.bins_candpt[ipt], self.bins_candpt[ipt+1]) |
185 | 188 | return None, None, None, None, None |
186 | 189 | frame.SetTitle(f"inv. mass for p_{{T}} {self.bins_candpt[ipt]} - {self.bins_candpt[ipt + 1]} GeV/c") |
187 | 190 | c = TCanvas() |
@@ -389,12 +392,14 @@ def fit(self): |
389 | 392 | if roo_res: |
390 | 393 | (sig, sig_err, _, _, |
391 | 394 | signif, signif_err, s_over_b, s_over_b_err |
392 | | - ) = calc_signif(roo_ws, roo_res, self.p_pdfnames, self.p_param_names, mean_sgn, sigma_sgn) |
| 395 | + ) = calc_signif(roo_ws, roo_res, self.p_pdfnames, self.p_param_names, |
| 396 | + mean_sgn, sigma_sgn) |
393 | 397 | fileout.cd() |
394 | 398 | one = RooConstVar("one", "constant 1.0", 1.0) |
395 | 399 | bkg_pdf = roo_ws.pdf(self.p_pdfnames["pdf_bkg"]) |
396 | 400 | sig_pdf = roo_ws.pdf(self.p_pdfnames["pdf_sig"]) |
397 | | - for pdf, outlabel in zip((bkg_pdf, sig_pdf, model), ("bkg", "sgn", "total")): |
| 401 | + for pdf, outlabel in zip((bkg_pdf, sig_pdf, model), ("bkg", "sgn", "total"), |
| 402 | + strict=False): |
398 | 403 | if not pdf: |
399 | 404 | continue |
400 | 405 | obs = pdf.getObservables(dh) |
@@ -451,7 +456,8 @@ def efficiency(self): |
451 | 456 | print(self.n_fileff) |
452 | 457 | lfileeff = TFile.Open(self.n_fileff) |
453 | 458 | lfileeff.ls() |
454 | | - fileouteff = TFile.Open(f"{self.d_resultsallpmc}/{self.efficiency_filename}{self.case}{self.typean}.root", "recreate") |
| 459 | + fileouteff = TFile.Open(f"{self.d_resultsallpmc}/{self.efficiency_filename}{self.case}{self.typean}.root", |
| 460 | + "recreate") |
455 | 461 | cEff = TCanvas("cEff", "The Fit Canvas") |
456 | 462 | cEff.SetCanvasSize(1900, 1500) |
457 | 463 | cEff.SetWindowSize(500, 500) |
|
0 commit comments