8#include "InitUtils.hpp"
19 InitUtils::SetROOTPreferences(PlotSaveFormat::kPNG,
22 gROOT->SetBatch(kTRUE);
29 TFile f(cache,
"READ");
31 std::cerr <<
"compute-regions: no scatter cache at " << cache
32 <<
"; run strip-sum-scatter first" << std::endl;
35 if (TNamed *fp =
static_cast<TNamed *
>(f.Get(
"fingerprint"))) {
36 std::cout <<
"compute-regions: cache " << cache << std::endl;
37 std::cout <<
" fingerprint " << fp->GetTitle() << std::endl;
43 std::cout <<
"compute-regions: beam component per strip; (a,n) region = "
46 <<
" conditional sigma above the ridge, (a,a') the beam's "
51 std::cout <<
"compute-regions: bivariate Gaussian mixture per strip; "
57 Int_t nOk = 0, nTried = 0;
60 TH2F *h =
static_cast<TH2F *
>(f.Get(Form(
"scatter_r%d", reac)));
66 std::map<Int_t, std::pair<Double_t, Double_t>>::const_iterator it =
69 y_lo = it->second.first;
70 y_hi = it->second.second;
78 std::cout <<
" [region] reac " << reac <<
": no region -- " << fit.
why
96 std::cout << Form(
" [region] reac %2d: beam (%.3f, %.3f) s(%.3f, %.3f) "
97 "rho %+.2f | (a,n) band %.1f..%.1f sigma above the "
98 "ridge: %.0f in region; (a,a') in region %.0f",
108 << Form(
" [region] reac %2d: beam (%.3f, %.3f) s(%.3f, %.3f) "
109 "rho %+.2f | (a,n) (%.3f, %.3f) s(%.3f, %.3f) rho %+.2f "
110 "| attributed %.0f, in region %.0f; (a,a') in region %.0f",
124 std::cout <<
"compute-regions: regions for " << nOk <<
" of " << nTried
125 <<
" reaction strips" << std::endl;
126 return nOk > 0 ? 0 : 1;
The dataset configuration, and how it is layered.
The reaction search: strip-sum scatters, beam gating and tagging.
static TString ResultsDir()
Absolute path to the directory receiving generated output.
static TString CacheName()
Filename of the scatter cache for this configuration.
const DatasetConfig & cfg
The active dataset's configuration, flat block.
RegionFit FitMixture(TH2F *scatter, Int_t reac, Double_t x_lo, Double_t x_hi, Double_t y_lo, Double_t y_hi)
Fit the two-component mixture to one strip's scatter.
TCutG * EllipseCut(const char *name, const Gauss2D &g, Double_t nsigma, Int_t npts=64)
Closed polygon of a component's Mahalanobis contour.
TCutG * RidgeBandCut(const char *name, const Gauss2D &beam, Double_t nsig_lo, Double_t nsig_hi, Double_t x_lo, Double_t x_hi, Double_t y_lo, Double_t y_hi)
Closed polygon of a band above the beam ridge.
void SaveFigures(TH2F *scatter, Int_t reac, const RegionFit &fit, TCutG *an, TCutG *aa, const TString &subdir)
Save the diagnostic figures for a strip's regions.
RegionFit FitBeam(TH2F *scatter, Int_t reac, Double_t x_lo, Double_t x_hi, Double_t y_lo, Double_t y_hi)
Fit the beam component alone, with no reaction component.
Double_t CountInside(TH2F *scatter, TCutG *cut, const RegionFit &fit)
Count scatter events inside a cut.
void Save(Int_t reac, TCutG *cut_an, TCutG *cut_aa, Double_t n_an_assigned=-1.0)
Write a strip's two region cuts.
void SaveFit(Int_t reac, const RegionFit &fit)
Store the fitted components beside the (a,n) cut.
Double_t rho
x-y correlation, in [-1, 1].
Result of fitting the two-component mixture to one strip's scatter.
TString why
Why the fit failed; set only when ok is false.
Bool_t ok
Whether the fit succeeded. Check this first.
Gauss2D reac
The reaction population above the ridge.
Gauss2D beam
The beam-like population, pinned from its own core.
Everything governing the reaction search in the strip-sum scatters.
Double_t X_DISPLAY_MIN
Display-only windows for the strip-sum scatters (a.u.): the histograms are built over the fixed Scatt...
AnRegionMode AN_REGION_MODE
Double_t AN_RIDGE_NSIGMA_HI
Double_t AN_RIDGE_NSIGMA_LO
Double_t AN_REGION_NSIGMA
compute-regions: the (a,n) region is the reaction component's AN_REGION_NSIGMA Mahalanobis ellipse fr...
Double_t AA_REGION_NSIGMA
std::map< Int_t, std::pair< Double_t, Double_t > > Y_DISPLAY_RANGE
Per-reaction-strip y-axis display windows, overriding Y_DISPLAY_MIN/MAX for individual strips (displa...