20 std::vector<float> margin = { 0.15, 0.05 };
27 std::vector<int> initFlav = { 12, 14 };
28 std::vector<int> finalFlav = { 12, 14, 16 };
31 std::map<int, std::string> flavString = { {12,
"#nu_{e}"}, {14,
"#nu_{#mu}"},
32 {16,
"#nu_{#tau}"}, {-12,
"#bar{#nu}_{e}"},
33 {-14,
"#bar{#nu}_{#mu}"}, {-16,
"#bar{#nu}_{#tau}"} };
42 TH2D* hSurface =
new TH2D(
UniqueName().c_str(),
";sin^{2} #theta_{24};#Delta m_{41}^{2}",
45 std::vector<float> th34Vals = { 0., 20., 45. };
50 for (
int init : initFlav) {
51 for (
int final : finalFlav) {
53 int i =
sign? init : -1 * init;
54 int f =
sign?
final : -1 *
final;
58 std::vector<float> x3f(nPoints);
59 std::vector<float> y3f(nPoints);
63 y3f[
it] =
calc->
P(i, f, energy);
65 TGraph g3f(x3f.size(), &x3f[0], &y3f[0]);
66 std::ostringstream
title;
67 title <<
"P(" << flavString[
i] <<
" #rightarrow " << flavString[
f] <<
")";
68 g3f.SetTitle(title.str().c_str());
69 g3f.GetXaxis()->SetTitle(
"True E (GeV)");
70 g3f.GetYaxis()->SetTitle(
"Osc. prob.");
72 g3f.SetLineColor(kGray);
75 for (
int yVal = -2; yVal < 3; ++yVal) {
76 double dm =
pow(10, yVal);
78 std::vector<std::string> images;
79 for (
size_t xBin = 1; xBin <= (size_t)xBins.
NBins(); ++xBin) {
80 double ssth24 = hSurface->GetXaxis()->GetBinCenter(xBin);
82 std::vector<float>
x(nPoints);
83 std::vector<std::vector<float>>
y(th34Vals.size(), std::vector<float>(
nPoints));
84 std::vector<std::vector<float>> yDiff(th34Vals.size(), std::vector<float>(
nPoints));
88 for (
size_t itTh34 = 0; itTh34 < th34Vals.size(); ++itTh34) {
90 y[itTh34][
it] =
calc->
P(i, f, energy);
91 yDiff[itTh34][
it] = y[itTh34][
it] - y3f[
it];
94 TCanvas
c(
"c",
"c", 1600, 900);
98 gPad->SetPad(0.01, 0.01, 0.49, 0.99);
100 hSurface->Draw(
"colz");
101 TMarker
m(ssth24, dm, 29);
106 gPad->SetPad(0.51, 0.51, 0.99, 0.99);
108 std::vector<TGraph*>
g;
109 TLegend
l1(0.6, 0.15, 0.85, 0.4);
110 for (
size_t it = 0;
it < y.size(); ++
it) {
111 g.push_back(
new TGraph(x.size(), &x[0], &y[
it][0]));
112 g[
it]->SetLineWidth(3);
113 g[
it]->SetLineColor(colours[
it]);
114 g[
it]->Draw(
"l same");
115 std::ostringstream
name;
116 name <<
"#theta_{34} = " << th34Vals[
it] <<
"#circ";
117 l1.AddEntry(g[it], name.str().c_str(),
"l");
122 gPad->SetPad(0.51, 0.01, 0.99, 0.49);
123 std::vector<TGraph*> gDiff;
124 TLegend l2(0.6, 0.15, 0.85, 0.4);
125 for (
size_t it = 0;
it < yDiff.size(); ++
it) {
126 gDiff.push_back(
new TGraph(x.size(), &x[0], &yDiff[
it][0]));
127 gDiff[
it]->SetLineWidth(3);
128 gDiff[
it]->SetLineColor(colours[
it]);
129 gDiff[
it]->SetTitle(
"");
130 gDiff[
it]->GetXaxis()->SetTitle(
"True E (GeV)");
131 gDiff[
it]->GetYaxis()->SetTitle(
"P(4flav) - P(3flav)");
133 gDiff[
it]->Draw(drawOpts.c_str());
134 std::ostringstream
name;
135 name <<
"#theta_{34} = " << th34Vals[
it] <<
"#circ";
136 l2.AddEntry(gDiff[it], name.str().c_str(),
"l");
141 fileName <<
"plots/cc_oscprob/prob_flav" << i <<
"to" << f
142 <<
"_dm" << dm <<
"_x" << xBin <<
".png";
144 c.SaveAs(fileName.str().c_str());
145 images.push_back(fileName.str());
147 for (TGraph*
tmp : g)
delete tmp;
148 for (TGraph*
tmp : gDiff)
delete tmp;
150 std::ostringstream gifName;
151 gifName <<
"plots/cc_oscprob/prob_flav" << i <<
"to" << f
152 <<
"_dm" << dm <<
".gif";
153 MakeGif(images, gifName.str(), 0.1);
155 std::ostringstream delCmd;
156 delCmd <<
"rm " << pngFile;
157 gSystem->Exec(delCmd.str().c_str());
160 p->
SetProgress(
float(counter)/
float(initFlav.size()*finalFlav.size()*10));
const FitSinSqTheta24Sterile kFitSinSqTheta24Sterile
Represent the binning of a Spectrum's x-axis.
Cuts and Vars for the 2020 FD DiF Study.
void SetNus20Params(osc::OscCalcSterile *calc, std::string type="3flav")
virtual double P(int flavBefore, int flavAfter, double E) override
E in GeV; flavors as PDG codes (so, neg==>antinu)
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
osc::OscCalcSterile * DefaultSterileCalc(int nflavors)
Create a sterile calculator with default assumptions for all parameters.
const std::vector< double > & Edges() const
void SetProgress(double frac)
Update the progress fraction between zero and one.
static Binning LogUniform(int n, double lo, double hi)
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
A simple ascii-art progress bar.
const FitTheta34InDegreesSterile kFitTheta34InDegreesSterile
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
Prevent histograms being added to the current directory.
void Done()
Call this when action is completed.
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
std::string UniqueName()
Return a different string each time, for creating histograms.
const FitDmSq41Sterile kFitDmSq41Sterile
void DrawCCOscillations()