17 #include "TLegendEntry.h" 24 #include "CAFAna/Core/Cut.h" 26 #include "CAFAna/Cuts/NueCutsFirstAna.h" 45 std::stringstream
out;
46 out << std::setprecision(3);
52 potstr = coef+
"x10^{"+power+
"}";
54 TLatex*
tex =
new TLatex(.625, .85,
"#scale[0.8]{"+potstr+
" POT-equiv "+tag+
"}");
58 tex->SetTextSize(0.043);
60 tex->SetTextAlign(12);
65 std::stringstream
out;
66 out << std::setprecision(3);
73 TLatex*
prelim =
new TLatex(.9, .95,
"NOvA Preliminary");
74 prelim->SetTextColor(kAzure);
76 prelim->SetTextSize(2/30.);
77 prelim->SetTextAlign(32);
89 spects[
i][
j] = LoadFromFile<Spectrum>(
inFile,(
sels[
i].suffix+
"_" 96 TFile
fout((
"plot_pid_output_"+cStr+
".root").c_str(),
"RECREATE");
98 for (
unsigned int i = 0 ;
i <
kNSels ; ++
i ){
99 for (
unsigned int j = 0 ;
j < 5 ; ++
j ){
102 TCanvas *
c =
new TCanvas(theSuffix.c_str(),theSuffix.c_str());
107 THStack *hs =
new THStack(
"hs",
"");
108 for (
int k =
j+5;k <
kNPlots;k = k+5 ){
113 h[
j]->SetMarkerStyle(kFullCircle);
114 h[
j+5]->SetLineColor(
PDGcolor[
"Electron"]);
116 h[
j+15]->SetLineColor(
PDGcolor[
"Gamma"]);
118 h[
j+25]->SetLineColor(
PDGcolor[
"Proton"]);
123 h[
j]->Draw(
"ep same");
125 hs->GetYaxis()->SetTitle((
"Prongs / "+
ToString(h[
i]->GetBinWidth(1))+
" PID").c_str());
127 hs->GetXaxis()->CenterTitle();
128 hs->GetYaxis()->CenterTitle();
139 TLegend *
l =
new TLegend(0.35,0.5,0.7,0.8);
140 l->AddEntry(h[
j],
"Data",
"lpe");
141 l->AddEntry(h[j+25],
"True Proton",
"f");
142 l->AddEntry(h[j+20],
"True Pion",
"f");
143 l->AddEntry(h[j+15],
"True Photon",
"f");
144 l->AddEntry(h[j+10],
"True Muon",
"f");
145 l->AddEntry(h[j+5],
"True Electron",
"f");
150 c->Print((
"pidPlot_"+cStr+
"_"+
sels[
i].suffix+
"_"+
plots[j].suffix+
".root").c_str());
151 c->Print((
"pidPlot_"+cStr+
"_"+
sels[
i].suffix+
"_"+
plots[j].suffix+
".pdf").c_str());
153 c->Print((
"pidPlot_"+cStr+
"_"+
sels[
i].suffix+
"_"+
plots[j].suffix+
"_log.pdf").c_str());
Cuts and Vars for the 2020 FD DiF Study.
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.
const unsigned int kNSels
const unsigned int kNPlots
void plot_pid(const std::string inFile, bool isFHC=1)
Representation of a spectrum in any variable, with associated POT.
const XML_Char int const XML_Char * value
std::map< std::string, Color_t > PDGcolor
const std::vector< Plot > plots
std::vector< double > POT
std::string ToString(double value)
void HCtag(TString tag, double pot)
void FillWithDimColor(TH1 *h, bool usealpha, float dim)