35 IPrediction* pred_genie_e = LoadFromFile<PredictionNoExtrap>(inFile.c_str(),
"pred_genie_e").
release();
36 Spectrum* spec_data_e = LoadFromFile<Spectrum>(inFile.c_str(),
"spec_data_e").
release();
37 Spectrum* spec_cos_e = LoadFromFile<Spectrum>(inFile.c_str(),
"spec_cos_e").
release();
39 IPrediction* pred_genie_cvn = LoadFromFile<PredictionNoExtrap>(inFile.c_str(),
"pred_genie_cvn").
release();
40 Spectrum* spec_data_cvn = LoadFromFile<Spectrum>(inFile.c_str(),
"spec_data_cvn").
release();
41 Spectrum* spec_cos_cvn = LoadFromFile<Spectrum>(inFile.c_str(),
"spec_cos_cvn").
release();
43 IPrediction* pred_genie_nhits = LoadFromFile<PredictionNoExtrap>(inFile.c_str(),
"pred_genie_nhits").
release();
44 Spectrum* spec_data_nhits = LoadFromFile<Spectrum>(inFile.c_str(),
"spec_data_nhits").
release();
45 Spectrum* spec_cos_nhits = LoadFromFile<Spectrum>(inFile.c_str(),
"spec_cos_nhits").
release();
50 TFile*
outFile =
new TFile(saveName.c_str(),
"RECREATE");
51 TCanvas*
canv =
new TCanvas(
"canv",
"",800,600);
57 TH1* hDataE = spec_data_e->
ToTH1(spec_data_e->
POT());
62 TH1* hDataCVN = spec_data_cvn->
ToTH1(spec_data_cvn->
POT());
67 TH1* hDataNHits = spec_data_nhits->
ToTH1(spec_data_nhits->
POT());
73 TLegend*
leg =
new TLegend(0.5,0.6,0.88,0.88);
82 hDataE->SetMarkerStyle(8);
83 hDataE->SetMarkerSize(1);
84 hDataE->SetMarkerColor(1);
85 hDataE->SetLineColor(1);
86 hSigE->SetLineColor(kAzure+2);
87 hBeamBgE->SetLineColor(
kGreen+2);
91 leg->AddEntry(hDataE,
"Data",
"p");
92 leg->AddEntry(hSigE,
"Signal",
"l");
93 leg->AddEntry(hBeamBgE,
"Beam background",
"l");
94 leg->AddEntry(hCosE,
"Cosmic background",
"l");
96 THStack* stackE =
new THStack(
"stackE",
"");
98 stackE->Add(hBeamBgE);
104 stackE->Draw(
"hist nostack same");
107 canv->Write(
"SidebandDataMCEnergy");
111 hSigE->SetFillColor(kAzure+2);
112 hBeamBgE->SetFillColor(
kGreen+2);
113 hCosE->SetFillColor(
kOrange+2);
114 stackE->SetMaximum(200);
115 stackE->Draw(
"hist");
116 stackE->GetXaxis()->SetTitle(
"Energy Deposited (GeV)");
117 hDataE->Draw(
"same");
120 canv->Write(
"SidebandDataMCEnergyStack");
123 hDataCVN->SetMarkerStyle(8);
124 hDataCVN->SetMarkerSize(1);
125 hDataCVN->SetMarkerColor(1);
126 hDataCVN->SetLineColor(1);
127 hSigCVN->SetLineColor(kAzure+2);
128 hBeamBgCVN->SetLineColor(
kGreen+2);
129 hCosCVN->SetLineColor(
kOrange+2);
132 leg->AddEntry(hDataCVN,
"Data",
"p");
133 leg->AddEntry(hSigCVN,
"Signal",
"l");
134 leg->AddEntry(hBeamBgCVN,
"Beam background",
"l");
135 leg->AddEntry(hCosCVN,
"Cosmic background",
"l");
137 THStack* stackCVN =
new THStack(
"stackCVN",
"");
138 stackCVN->Add(hCosCVN);
139 stackCVN->Add(hBeamBgCVN);
140 stackCVN->Add(hSigCVN);
145 stackCVN->Draw(
"hist nostack same");
148 canv->Write(
"SidebandDataMCCVN");
152 hSigCVN->SetFillColor(kAzure+2);
153 hBeamBgCVN->SetFillColor(
kGreen+2);
154 hCosCVN->SetFillColor(
kOrange+2);
155 stackCVN->SetMaximum(60);
156 stackCVN->Draw(
"hist");
157 stackCVN->GetXaxis()->SetTitle(
"CVNnc Identifier");
158 hDataCVN->Draw(
"same");
161 canv->Write(
"SidebandDataMCCVNncStack");
164 hDataNHits->SetMarkerStyle(8);
165 hDataNHits->SetMarkerSize(1);
166 hDataNHits->SetMarkerColor(1);
167 hDataNHits->SetLineColor(1);
168 hSigNHits->SetLineColor(kAzure+2);
169 hBeamBgNHits->SetLineColor(
kGreen+2);
170 hCosNHits->SetLineColor(
kOrange+2);
173 leg->AddEntry(hDataNHits,
"Data",
"p");
174 leg->AddEntry(hSigNHits,
"Signal",
"l");
175 leg->AddEntry(hBeamBgNHits,
"Beam background",
"l");
176 leg->AddEntry(hCosNHits,
"Cosmic background",
"l");
178 THStack* stackNHits =
new THStack(
"stackNHits",
"");
179 stackNHits->Add(hCosNHits);
180 stackNHits->Add(hBeamBgNHits);
181 stackNHits->Add(hSigNHits);
186 stackNHits->Draw(
"hist nostack same");
189 canv->Write(
"SidebandDataMCNHits");
193 hSigNHits->SetFillColor(kAzure+2);
194 hBeamBgNHits->SetFillColor(
kGreen+2);
195 hCosNHits->SetFillColor(
kOrange+2);
196 stackNHits->SetMaximum(60);
197 stackNHits->Draw(
"hist");
198 stackNHits->GetXaxis()->SetTitle(
"Number of Hits");
199 hDataNHits->Draw(
"same");
202 canv->Write(
"SidebandDataMCNHitsStack");
Cuts and Vars for the 2020 FD DiF Study.
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
Adapt the PMNS_Sterile calculator to standard interface.
void SetAngles(osc::OscCalcSterile *calc)
Representation of a spectrum in any variable, with associated POT.
Charged-current interactions.
osc::OscCalcSterile * DefaultSterileCalc(int nflavors)
Create a sterile calculator with default assumptions for all parameters.
void PlotNus18Sideband(std::string inFile)
Neutral-current interactions.
Both neutrinos and antineutrinos.
Standard interface to all prediction techniques.
All neutrinos, any flavor.
double Livetime() const
Seconds. For informational purposes only. No calculations use this.