plot_ehade_quantbound.C
Go to the documentation of this file.
1 #include "includes.h"
2 
3 using namespace ana;
4 
5 
6 void plot_ehade_quantbound(bool fhc = true){
7 
8 
9  const int nBins= 19;
10  const int nQuant= 4;
11 
14 
15  // int color_pal = kCool;
16  int color_pal = kFuchsia;
17  Style_t line = kSolid;
18  Color_t color;
19 
20 
21  if(fhc){
22  horn = "fhc", name = "FHC";
23  color = kBlue-7;
24  }
25  if(!fhc){
26  horn = "rhc", name = "RHC";
27  color = kMagenta+1;
28  }
29 
30  std::string filename = "/nova/ana/nu_mu_ana/Ana2018/Quantiles/quantiles__" + horn + "_full__numu2018.root";
31  TFile* infile = TFile::Open(pnfs2xrootd(filename).c_str());
32  TH2* quanthist = (TH2*)infile->Get("FDSpec2D");
33  std::vector< std::vector<double> > QuantBounds = GetQuantileBins(quanthist, kNumuCCOptimisedAxis, kHadEFracAxis, nQuant, 1);
34 
35 
36  std::vector< TH1* > hist_bound;
37  for(int thisQuant = 0; thisQuant < nQuant; thisQuant++){
38  TH1* h_temp = quanthist->ProjectionX();
39  h_temp -> Clear();
40  for(int bin = 1; bin <= nBins; bin++){
41  double bound = QuantBounds[bin][thisQuant];
42  h_temp -> SetBinContent(bin, bound);
43  }
44  hist_bound.push_back(h_temp);
45  }
46 
47 
48  gStyle->SetPalette(color_pal);
49  gStyle->SetPadRightMargin(0.11);
50 
51  new TCanvas("canvas");
52  gPad->SetFillStyle(0);
53  quanthist -> Scale(0.1,"width");
54  quanthist -> Draw("colz");
55  quanthist->GetYaxis()->SetTitle("E_{had} / E_{#nu}");
56  quanthist->GetXaxis()->CenterTitle();
57  quanthist->GetYaxis()->CenterTitle();
58  for(int thisQuant = 1; thisQuant < nQuant; thisQuant++){
59  hist_bound[thisQuant] -> SetLineColor(color);
60  hist_bound[thisQuant] -> Draw("histsame][");
61  }
62  TLegend *legend = new TLegend(0.15,0.70,0.30,0.85);
63  legend->AddEntry(hist_bound[1], Form("%s", name.c_str()),"l");
64  legend->SetTextSize(0.05); //no border for legend
65  legend->SetBorderSize(0); //no border for legend
66  legend->SetFillStyle(0); //fill colour is transparent
67  legend->Draw();
68  gPad->Update();
69 
70  TString outname = "quantiles__" + horn + "_full__numu2018";
71  gPad-> Print(outname + ".pdf");
72  gPad-> Print(outname + ".png");
73 
74 }
const XML_Char * name
Definition: expat.h:151
tree Draw("slc.nhit")
int nBins
Definition: plotROC.py:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const HistAxis kHadEFracAxis("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kHadEFrac)
HistAxis that implements Hadronic Energy fraction binning used by L.Vinton to derive Hadronic Energy ...
Definition: HistAxes.h:30
std::vector< std::vector< double > > GetQuantileBins(TH2 *quantileHist, const HistAxis &independentAxis, const HistAxis &quantileAxis, const unsigned int &numQuantiles, const bool verbose)
Returns a 2D vector First index is the independentAxis bin number Second index is the high bin edge f...
string filename
Definition: shutoffs.py:106
void plot_ehade_quantbound(bool fhc=true)
std::string pnfs2xrootd(std::string loc, bool unauth)
Definition: UtilsExt.cxx:237
string infile
hmean SetLineColor(4)
float bin[41]
Definition: plottest35.C:14
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39;...
Definition: HistAxes.h:24
cout<< "--"<< endl;for(Int_t iP=1;iP<=hyz->GetNbinsX();iP++){for(Int_t iC=1;iC<=hyz->GetNbinsY();iC++){if(hyv->GetBinContent(iP, iC)>-999){goal_hyv-> SetBinContent(iP, iC,-(dy[iP-1][iC-1]))
void Print(std::string prefix, std::string name, std::string suffix="")
Definition: nue_pid_effs.C:68
const int nQuant
Definition: varsandcuts.h:4
enum BeamMode kBlue
simulatedPeak Scale(1/simulationNormalisationFactor)
enum BeamMode string