Public Member Functions | Public Attributes | List of all members
DataMCPair Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-01-24/3FlavorAna/Ana2018/numu/ND_DataMC_Comp_Systs_header.h"

Public Member Functions

 DataMCPair (Selection sel, TangibleAxis tanAxis, SpectrumLoader &loaderData, SpectrumLoader &loaderMC, std::vector< const ISyst * > systs, const Var BinWeight, const Cut &bkg=kNoCut)
 
std::string ShortName () const
 
const char * CName () const
 
void DrawMCSyst (const int iSyst=-1) const
 
void OverlayDataMCSyst (const int iSyst=-1) const
 
void DrawMCNormSyst (const int iSyst=-1) const
 
void OverlayDataMCSystNorm (const int iSyst=-1) const
 
void OverlayDataMCSystExtraData (const DataMCPair &extraData, const std::string dataLegendTitle, const std::string extraLegendTitle, const int iSyst=-1, const int dataColor=kBlack, const int extraColor=kGray+1, const int dataMarker=kFullCircle, const int extraMarker=kFullCircle) const
 
void OverlayDataMCSystNormExtraData (const DataMCPair &extraData, const std::string dataLegendTitle, const std::string extraLegendTitle, const int iSyst=-1, const int dataColor=kBlack, const int extraColor=kGray+1, const int dataMarker=kFullCircle, const int extraMarker=kFullCircle) const
 
TLegend * DrawLegendArea (const int dataColor=kBlack, std::string dataLegendTitle="Data", const int dataMarker=kFullCircle) const
 
TLegend * DrawLegendPOT (const int dataColor=kBlack, std::string dataLegendTitle="Data", const int dataMarker=kFullCircle) const
 
void AddExposureArea () const
 
void AddExposurePOT () const
 
void AestheticsArea () const
 
void AestheticsPOT () const
 
void DrawData (const int color=kBlack, const int marker=kFullCircle) const
 
void DrawMCBkg () const
 
float Purity () const
 
 DataMCPair (Selection sel, TangibleAxis tanAxis, SpectrumLoader &loaderData, SpectrumLoader &loaderMC, std::vector< const ISyst * > systs, const Var BinWeight, const Cut &bkg=kNoCut, const Cut &wrs=kNoCut)
 
std::string ShortName () const
 
void OverlayDataMCSyst (const int iSyst=-1) const
 
void OverlayDataMCSystNorm (const int iSyst=-1) const
 
void DrawMCSyst (const int iSyst=-1) const
 
void DrawMCNormSyst (const int iSyst=-1) const
 
TLegend * DrawLegend () const
 
void AddExposure (bool IsPOT) const
 
void RedrawAxes () const
 
void DrawData () const
 
void DrawMCBkg () const
 
void DrawWrong () const
 
float Purity () const
 

Public Attributes

Selection fSel
 
TangibleAxis fAxis
 
Spectrum fData
 
Spectrum fMC
 
Spectrum fMCBkg
 
std::vector< SpectrumfUps
 
std::vector< SpectrumfDowns
 
std::string fShortName
 
Spectrum fWrong
 

Detailed Description

Definition at line 192 of file hadEFrac_nd_data_mc_systs.C.

Constructor & Destructor Documentation

DataMCPair::DataMCPair ( Selection  sel,
TangibleAxis  tanAxis,
SpectrumLoader loaderData,
SpectrumLoader loaderMC,
std::vector< const ISyst * >  systs,
const Var  BinWeight,
const Cut bkg = kNoCut 
)
inline

Definition at line 196 of file hadEFrac_nd_data_mc_systs.C.

198  :
199  fSel(sel),
200  fAxis(tanAxis),
201  //fData(loaderData, fAxis.fObj, fSel.fObj, kNoShift, kPPFXFluxCVWgt * kXSecCVWgt2017 * kBinWidthWeight),
202  //fMC(loaderMC, fAxis.fObj, fSel.fObj, kNoShift, kPPFXFluxCVWgt * kXSecCVWgt2017 * kBinWidthWeight),
203  //fMCBkg(loaderMC, fAxis.fObj, fSel.fObj && bkg, kNoShift, kPPFXFluxCVWgt * kXSecCVWgt2017 * kBinWidthWeight),
204  fData (loaderData, fAxis.fObj, fSel.fObj , kNoShift, BinWeight),
205  fMC (loaderMC , fAxis.fObj, fSel.fObj , kNoShift, BinWeight),
206  fMCBkg(loaderMC , fAxis.fObj, fSel.fObj && bkg, kNoShift, BinWeight),
207  fShortName(fAxis.fShortName + "_" + fSel.fShortName)
208  {
209  fUps.reserve(systs.size());
210  fDowns.reserve(systs.size());
211  for(const auto& syst:systs){
212  //fUps.emplace_back(loaderMC, fAxis.fObj, fSel.fObj, SystShifts(syst, +1), kPPFXFluxCVWgt * kXSecCVWgt2017 * kBinWidthWeight);
213  //fDowns.emplace_back(loaderMC, fAxis.fObj, fSel.fObj, SystShifts(syst, -1), kPPFXFluxCVWgt * kXSecCVWgt2017 * kBinWidthWeight);
214  fUps .emplace_back(loaderMC, fAxis.fObj, fSel.fObj, SystShifts(syst, +1), BinWeight);
215  fDowns.emplace_back(loaderMC, fAxis.fObj, fSel.fObj, SystShifts(syst, -1), BinWeight);
216  }
217  };
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
std::vector< Spectrum > fUps
std::vector< Spectrum > fDowns
const SystShifts kNoShift
Definition: SystShifts.cxx:22
std::string fShortName
DataMCPair::DataMCPair ( Selection  sel,
TangibleAxis  tanAxis,
SpectrumLoader loaderData,
SpectrumLoader loaderMC,
std::vector< const ISyst * >  systs,
const Var  BinWeight,
const Cut bkg = kNoCut,
const Cut wrs = kNoCut 
)
inline

Definition at line 95 of file ND_DataMC_Comp_Systs_header.h.

97  :
98  fSel(sel),
99  fAxis(tanAxis),
100  fData (loaderData, fAxis.fObj, fSel.fObj , kNoShift, BinWeight),
101  fMC (loaderMC , fAxis.fObj, fSel.fObj , kNoShift, BinWeight),
102  fWrong(loaderMC , fAxis.fObj, fSel.fObj && wrs, kNoShift, BinWeight),
103  fMCBkg(loaderMC , fAxis.fObj, fSel.fObj && bkg, kNoShift, BinWeight),
104  fShortName(fAxis.fShortName + "_" + fSel.fShortName)
105  {
106  fUps.reserve(systs.size());
107  fDowns.reserve(systs.size());
108  for(const auto& syst:systs){
109  fUps .emplace_back(loaderMC, fAxis.fObj, fSel.fObj, SystShifts(syst, +1), BinWeight);
110  fDowns.emplace_back(loaderMC, fAxis.fObj, fSel.fObj, SystShifts(syst, -1), BinWeight);
111  }
112  };
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
std::vector< Spectrum > fUps
std::vector< Spectrum > fDowns
const SystShifts kNoShift
Definition: SystShifts.cxx:22
std::string fShortName

Member Function Documentation

void DataMCPair::AddExposure ( bool  IsPOT) const
inline

Definition at line 284 of file ND_DataMC_Comp_Systs_header.h.

References ana::AutoPlaceLegend(), Bless, om::cout, allTimeWatchdog::endl, Integral(), IsFHC, place(), pot, sFHC, string, and MakeMiniprodValidationCuts::text.

285  {
286  // Format Latex and text placement
287  TLatex text;
288  text.SetTextAlign(22);
289  text.SetTextSize(0.04);
290  // Figure out means and integrals.
291  std::stringstream expo;
292  std::stringstream expoData;
293  std::stringstream expoMC;
294  float pot = fData.POT();
295  float dataMean = (fData.ToTH1(pot)) -> GetMean();
296  float dataMeanError = (fData.ToTH1(pot)) -> GetMeanError();
297  float dataIntegral = (fData.ToTH1(pot)) -> Integral( 0, (fData.ToTH1(pot))->GetNbinsX() );
298  float MCMean = (fMC .ToTH1(pot)) -> GetMean();
299  float MCMeanError = (fMC .ToTH1(pot)) -> GetMeanError();
300  float MCIntegral = (fMC .ToTH1(pot)) -> Integral();
301  // Decide my stringsteams.
302  expoData << fixed << setprecision(3) << "Data mean: " << dataMean << ", Integral: " << dataIntegral;
303  expoMC << fixed << setprecision(3) << "Mont mean: " << MCMean << ", Integral: " << MCIntegral;
304 
305  // Figure out my character strings.
306  std::string sFHC = (IsFHC == true ? "Neutrino beam":"Antineutrino beam");
307  std::string sPOT = (IsPOT == true ? "POT":"Area");
308  // Figure out which quartile I'm looking at.
309  std::string sQnt = "";
310  if ( ShortName().find("Quant1") != std::string::npos) sQnt = "Quartile 1";
311  else if ( ShortName().find("Quant2") != std::string::npos) sQnt = "Quartile 2";
312  else if ( ShortName().find("Quant3") != std::string::npos) sQnt = "Quartile 3";
313  else if ( ShortName().find("Quant4") != std::string::npos) sQnt = "Quartile 4";
314 
315  TLegend* place = AutoPlaceLegend(0.0001, 0.0001, 0.54);
316  if ( !Bless || sQnt != "" ) {
317  place = AutoPlaceLegend(0.0001, 0.0001, 0.525);
318  } else if ( !Bless && sQnt != "" ) {
319  place = AutoPlaceLegend(0.0001, 0.0001, 0.50);
320  }
321  // Print stuff out to the screen...
322  std::cout << "\n\t Looking at " << ShortName() << ", " << sFHC << ", " << sPOT
323  << "\n\t Data Mean / Integral are; " << dataMean << ", " << dataIntegral
324  << "\n\t Mont Mean / Integral are; " << MCMean << ", " << MCIntegral
325  << std::endl;
326 
327  // Decide what I'm putting in the legend
328  std::string Descrip = sPOT+" Normalized";
329  if ( sQnt != "" ) Descrip = "#splitline{"+sPOT+" Normalized}{"+sQnt+"}";
330  if ( !Bless ) {
331  Descrip = "#splitline{"+sPOT+" Normalized}{#splitline{"+expoData.str()+"}{"+expoMC.str()+"}}";
332  if ( sQnt != "" )
333  Descrip = "#splitline{"+sPOT+" Normalized}{#splitline{"+sQnt+"}{#splitline{"+expoData.str()+"}{"+expoMC.str()+"}}}";
334  }
335  // Print the legend
336  text.DrawLatexNDC( place->GetX1(), place->GetY1(), Descrip.c_str() );
337  }
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.
Definition: Spectrum.cxx:148
double Integral(const Spectrum &s, const double pot, int cvnregion)
bool IsFHC
std::string ShortName() const
std::string sFHC
Definition: MakeCutFlow.C:35
#define pot
bool Bless
double POT() const
Definition: Spectrum.h:227
OStream cout
Definition: OStream.cxx:6
TLegend * AutoPlaceLegend(double dx, double dy, double yPin)
Create a legend, maximizing distance from all histograms.
Definition: Plots.cxx:717
short int place(double jd_tt, object *cel_object, observer *location, double delta_t, short int coord_sys, short int accuracy, sky_pos *output)
enum BeamMode string
void DataMCPair::AddExposureArea ( ) const
inline

Definition at line 447 of file hadEFrac_nd_data_mc_systs.C.

References ana::AutoPlaceLegend(), allTimeWatchdog::endl, genie::utils::style::Format(), place(), pot, and MakeMiniprodValidationCuts::text.

448  {
449  std::stringstream expo;
450  std::stringstream expoData;
451  std::stringstream expoMC;
452  float pot = fData.POT();
453  float dataMean = (fData.ToTH1(pot)) -> GetMean();
454  float dataMeanError = (fData.ToTH1(pot)) -> GetMeanError();
455  float MCMean = (fMC.ToTH1(pot)) -> GetMean();
456  float MCMeanError = (fMC.ToTH1(pot)) -> GetMeanError();
457  expo.precision(2);
458  expoData.precision(2);
459  expoMC.precision(2);
460  expo << "ND area norm., "
461  << TString::Format("%.02lf #times 10^{20}", pot/1e20) << " POT " <<endl;
462  //expoData << TString::Format("Data mean: %.02lf #pm %.02lf GeV ", dataMean, dataMeanError) <<endl;
463  //expoMC << TString::Format("MC mean: %.02lf #pm %.02lf GeV ", MCMean, MCMeanError) <<endl;
464  expoData << TString::Format("Data mean: %.02lf GeV ", dataMean) <<endl;
465  expoMC << TString::Format("MC mean: %.02lf GeV ", MCMean ) <<endl;
466 
467  TLatex text;
468  TLegend* place = AutoPlaceLegend(0.0001, 0.0001, 0.52);
469  text.SetTextAlign(22);
470  text.SetTextSize(0.04);
471 
472  // text.DrawLatexNDC(place->GetX1(), place->GetY1(),
473  // (expo.str()).c_str() );
474 
475  text.DrawLatexNDC(place->GetX1(), place->GetY1(),
476  ("#splitline{" + expo.str() + "}{ #splitline{" +
477  expoData.str() + "}{" + expoMC.str() + "}}").c_str()
478  );
479 
480  }
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.
Definition: Spectrum.cxx:148
#define pot
double POT() const
Definition: Spectrum.h:227
TLegend * AutoPlaceLegend(double dx, double dy, double yPin)
Create a legend, maximizing distance from all histograms.
Definition: Plots.cxx:717
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
short int place(double jd_tt, object *cel_object, observer *location, double delta_t, short int coord_sys, short int accuracy, sky_pos *output)
void DataMCPair::AddExposurePOT ( ) const
inline

Definition at line 482 of file hadEFrac_nd_data_mc_systs.C.

References ana::AutoPlaceLegend(), om::cout, genie::utils::style::Format(), place(), pot, and MakeMiniprodValidationCuts::text.

483  {
484  std::stringstream expo;
485  float pot = fData.POT();
486  expo.precision(2);
487  expo << "ND POT norm., "
488  << TString::Format("%.02lf #times 10^{20}", pot/1e20) << " POT";
489  TLatex text;
490  TLegend* place = AutoPlaceLegend(0.0001, 0.0001, 0.56);
491  text.SetTextAlign(22);
492  text.SetTextSize(0.04);
493 
494  text.DrawLatexNDC(place->GetX1(), place->GetY1(), expo.str().c_str());
495 
496  if (ShortName().find("numuE") != std::string::npos) {
497  std::cout << "\n" << ShortName() << "\t Data: " << fData.ToTH1(pot)->Integral()
498  << "\t MC: " << fMC.ToTH1(pot)->Integral() << "\n";
499  }
500  }
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.
Definition: Spectrum.cxx:148
std::string ShortName() const
#define pot
double POT() const
Definition: Spectrum.h:227
OStream cout
Definition: OStream.cxx:6
TLegend * AutoPlaceLegend(double dx, double dy, double yPin)
Create a legend, maximizing distance from all histograms.
Definition: Plots.cxx:717
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
short int place(double jd_tt, object *cel_object, observer *location, double delta_t, short int coord_sys, short int accuracy, sky_pos *output)
void DataMCPair::AestheticsArea ( ) const
inline

Definition at line 502 of file hadEFrac_nd_data_mc_systs.C.

References ana::CenterTitles(), and RedrawAxes().

503  {
504  CenterTitles();
505  RedrawAxes();
506  AddExposureArea();
507  }
void CenterTitles()
void AddExposureArea() const
void DataMCPair::AestheticsPOT ( ) const
inline

Definition at line 509 of file hadEFrac_nd_data_mc_systs.C.

References ana::CenterTitles(), and RedrawAxes().

510  {
511  CenterTitles();
512  RedrawAxes();
513  AddExposurePOT();
514  }
void CenterTitles()
void AddExposurePOT() const
const char* DataMCPair::CName ( ) const
inline

Definition at line 221 of file hadEFrac_nd_data_mc_systs.C.

222  {return ShortName().c_str();};
std::string ShortName() const
void DataMCPair::DrawData ( ) const
inline

Definition at line 362 of file ND_DataMC_Comp_Systs_header.h.

References om::cout, DataCol, DataMar, e, allTimeWatchdog::endl, and Scale().

362  {
363 
364  TH1D* hData = fData.ToTH1(fData.POT());
365  std::cout << "\t Data integral is " << hData->Integral() << ", mean is " << hData->GetMean() << std::endl;
366 
367  if (ShortName().find("NuMuE") != std::string::npos) {
368  hData -> Scale(0.1,"width");
369  }
370  hData -> Scale( 1e-3 );
371  hData->SetMarkerColor( DataCol );
372  hData->SetMarkerStyle( DataMar );
373  hData->SetLineColor ( DataCol );
374  hData->Draw("same");
375  };
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.
Definition: Spectrum.cxx:148
std::string ShortName() const
const int DataMar
const int DataCol
double POT() const
Definition: Spectrum.h:227
OStream cout
Definition: OStream.cxx:6
Float_t e
Definition: plot.C:35
simulatedPeak Scale(1/simulationNormalisationFactor)
void DataMCPair::DrawData ( const int  color = kBlack,
const int  marker = kFullCircle 
) const
inline

Definition at line 516 of file hadEFrac_nd_data_mc_systs.C.

References plot_validation_datamc_2018::color.

517  {
518  TH1D* hData = fData.ToTH1(fData.POT());
519  hData->GetYaxis()->SetTitle("Events / 0.1 GeV"); // only for cust bin neutrino plot
520  hData->SetMarkerColor(color);
521  hData->SetMarkerStyle(marker);
522  hData->SetLineColor(color);
523 
524  hData->Draw("SAME");
525  };
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.
Definition: Spectrum.cxx:148
double POT() const
Definition: Spectrum.h:227
TLegend* DataMCPair::DrawLegend ( ) const
inline

Definition at line 241 of file ND_DataMC_Comp_Systs_header.h.

References ana::AutoPlaceLegend(), DataCol, DataMar, FullPred, IsFHC, MECModelEnuComparisons::leg, PredErr, TotalBkg, and WrongSi.

241  {
242 
243  TLegend* leg = AutoPlaceLegend(0.25, 0.19, 0.68);
244 
245  TH1F* colMC = new TH1F();
246  colMC ->SetLineColor ( FullPred );
247  TH1F* colWrong = new TH1F();
248  colWrong->SetLineColor ( WrongSi );
249  colWrong->SetFillColor ( WrongSi );
250  TH1F* colMCBkg = new TH1F();
251  colMCBkg->SetLineColor ( TotalBkg );
252  colMCBkg->SetFillColor ( TotalBkg );
253  TH1F* colData = new TH1F();
254  colData->SetLineColor ( DataCol );
255  colData->SetMarkerColor( DataCol );
256  colData->SetMarkerStyle( DataMar ) ;
257 
258  leg->AddEntry((TObject*)colData , "Data" , "ple");
259  leg->AddEntry((TObject*)colMC , "Simulation", "l" );
260  TLegendEntry *entryns1=leg->AddEntry("error","1-#sigma syst. range","f");
261  if (IsFHC) leg->AddEntry((TObject*)colWrong, "Wrong Sign: #bar{#nu_{#mu}} CC", "f" );
262  else leg->AddEntry((TObject*)colWrong, "Wrong Sign: #nu_{#mu} CC" , "f" );
263  leg->AddEntry((TObject*)colMCBkg, "Total Background", "f" );
264  entryns1->SetLineColor( PredErr );
265  entryns1->SetFillStyle( 1001 );
266  entryns1->SetFillColor( PredErr );
267  leg->SetTextSize(0.04);
268 
269  leg->SetFillColor(0);
270  leg->SetFillStyle(0);
271 
272  for(const auto& obj:*leg->GetListOfPrimitives())
273  {
274  if(obj->InheritsFrom("TAttFill")){
275  ((TAttFill*)obj)->SetFillStyle(0);
276  //((TAttFill*)obj)->SetFillColor(0);
277  }
278 
279  }
280  leg->Draw();
281  return leg;
282  }
bool IsFHC
const int WrongSi
const int FullPred
const int DataMar
const int DataCol
const int PredErr
TLegend * AutoPlaceLegend(double dx, double dy, double yPin)
Create a legend, maximizing distance from all histograms.
Definition: Plots.cxx:717
const int TotalBkg
TLegend* DataMCPair::DrawLegendArea ( const int  dataColor = kBlack,
std::string  dataLegendTitle = "Data",
const int  dataMarker = kFullCircle 
) const
inline

Definition at line 369 of file hadEFrac_nd_data_mc_systs.C.

References ana::AutoPlaceLegend(), kBlue, kRed, ana::kTotalMCColor, and MECModelEnuComparisons::leg.

372  {
373 
374  TLegend* leg = AutoPlaceLegend(0.36, 0.19, 0.68);
375 
376  TH1F* colMC = new TH1F();
377  colMC->SetLineColor(kTotalMCColor);
378  TH1F* colMCBkg = new TH1F();
379  colMCBkg->SetLineColor(kBlue);
380  TH1F* colData = new TH1F();
381  colData->SetLineColor(dataColor);
382  colData->SetMarkerColor(dataColor);
383  colData->SetMarkerStyle(dataMarker);
384 
385  leg->AddEntry((TObject*)colMC, "Simulated Selected Events", "l");
386  leg->AddEntry((TObject*)colMCBkg, "Simulated Background", "l");
387  leg->AddEntry((TObject*)colData, dataLegendTitle.c_str(), "ple");
388  TLegendEntry *entryns1=leg->AddEntry("error","Shape-only 1-#sigma syst. range","f");
389  entryns1->SetFillStyle(1001);
390  entryns1->SetFillColor(kRed-10);
391  leg->SetTextSize(0.04);
392 
393  leg->SetFillColor(0);
394  leg->SetFillStyle(0);
395 
396  for(const auto& obj:*leg->GetListOfPrimitives())
397  {
398  if(obj->InheritsFrom("TAttFill")){
399  ((TAttFill*)obj)->SetFillStyle(0);
400  //((TAttFill*)obj)->SetFillColor(0);
401  }
402 
403  }
404  leg->Draw();
405  return leg;
406  }
enum BeamMode kRed
TLegend * AutoPlaceLegend(double dx, double dy, double yPin)
Create a legend, maximizing distance from all histograms.
Definition: Plots.cxx:717
const Color_t kTotalMCColor
Definition: Style.h:16
enum BeamMode kBlue
TLegend* DataMCPair::DrawLegendPOT ( const int  dataColor = kBlack,
std::string  dataLegendTitle = "Data",
const int  dataMarker = kFullCircle 
) const
inline

Definition at line 408 of file hadEFrac_nd_data_mc_systs.C.

References ana::AutoPlaceLegend(), kBlue, kRed, ana::kTotalMCColor, and MECModelEnuComparisons::leg.

411  {
412 
413  TLegend* leg = AutoPlaceLegend(0.36, 0.19, 0.68);
414 
415  TH1F* colMC = new TH1F();
416  colMC->SetLineColor(kTotalMCColor);
417  TH1F* colMCBkg = new TH1F();
418  colMCBkg->SetLineColor(kBlue);
419  TH1F* colData = new TH1F();
420  colData->SetLineColor(dataColor);
421  colData->SetMarkerColor(dataColor);
422  colData->SetMarkerStyle(dataMarker);
423 
424  leg->AddEntry((TObject*)colMC, "Simulated Selected Events", "l");
425  leg->AddEntry((TObject*)colMCBkg, "Simulated Background", "l");
426  leg->AddEntry((TObject*)colData, dataLegendTitle.c_str(), "ple");
427  TLegendEntry *entryns1=leg->AddEntry("error","Full 1-#sigma syst. range","f");
428  entryns1->SetFillStyle(1001);
429  entryns1->SetFillColor(kRed-10);
430  leg->SetTextSize(0.04);
431 
432  leg->SetFillColor(0);
433  leg->SetFillStyle(0);
434 
435  for(const auto& obj:*leg->GetListOfPrimitives())
436  {
437  if(obj->InheritsFrom("TAttFill")){
438  ((TAttFill*)obj)->SetFillStyle(0);
439  //((TAttFill*)obj)->SetFillColor(0);
440  }
441 
442  }
443  leg->Draw();
444  return leg;
445  }
enum BeamMode kRed
TLegend * AutoPlaceLegend(double dx, double dy, double yPin)
Create a legend, maximizing distance from all histograms.
Definition: Plots.cxx:717
const Color_t kTotalMCColor
Definition: Style.h:16
enum BeamMode kBlue
void DataMCPair::DrawMCBkg ( ) const
inline

Definition at line 377 of file ND_DataMC_Comp_Systs_header.h.

References om::cout, e, allTimeWatchdog::endl, Scale(), and TotalBkg.

378  {
379  TH1D* hMCBkg = fMCBkg.ToTH1(fData.POT());
380  std::cout << "\t MCBkg integral is " << hMCBkg->Integral() << ", mean is " << hMCBkg->GetMean() << std::endl;
381 
382  if (ShortName().find("NuMuE") != std::string::npos) {
383  hMCBkg -> Scale(0.1,"width");
384  }
385  hMCBkg->Scale( 1e-3 );
386  hMCBkg->SetLineColor( TotalBkg );
387  hMCBkg->SetFillColor( TotalBkg );
388  hMCBkg->Draw("hist same");
389  };
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.
Definition: Spectrum.cxx:148
std::string ShortName() const
double POT() const
Definition: Spectrum.h:227
OStream cout
Definition: OStream.cxx:6
Float_t e
Definition: plot.C:35
simulatedPeak Scale(1/simulationNormalisationFactor)
const int TotalBkg
void DataMCPair::DrawMCBkg ( ) const
inline

Definition at line 527 of file hadEFrac_nd_data_mc_systs.C.

References kBlue.

528  {
529  TH1D* hMCBkg = fMCBkg.ToTH1(fData.POT());
530  hMCBkg->GetYaxis()->SetTitle("Events / 0.1 GeV"); // only for cust bin neutrino plot
531  hMCBkg->SetLineColor(kBlue);
532  hMCBkg->Draw("HIST SAME");
533  };
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.
Definition: Spectrum.cxx:148
double POT() const
Definition: Spectrum.h:227
enum BeamMode kBlue
void DataMCPair::DrawMCNormSyst ( const int  iSyst = -1) const
inline

Definition at line 184 of file ND_DataMC_Comp_Systs_header.h.

References e, FullPred, MECModelEnuComparisons::i, ana::Spectrum::Integral(), ana::kPOT, norm, ana::Spectrum::OverridePOT(), ana::PlotWithSystErrorBand(), ana::Spectrum::POT(), PredErr, and Scale().

184  {
185  // New vectors for area normalized systs
186  std::vector<Spectrum> normUps;
187  std::vector<Spectrum> normDowns;
188 
189  Spectrum tempMC(fMC.ToTH1(fMC.POT()),fMC.POT(),fMC.Livetime());
190  tempMC.OverridePOT( fMC.POT() * fMC.ToTH1(fData.POT())->GetSumOfWeights() / fData.ToTH1(fData.POT())->GetSumOfWeights() );
191 
192  TH1* hNom = tempMC.ToTH1( fData.POT(), kBlack, kSolid, kPOT );
193  if ( ShortName().find("NuMuE") != std::string::npos ) hNom -> Scale(0.1,"width");
194  hNom -> Scale( 1e-3 );
195 
196  if (iSyst >= 0) {
197  // We'll have one entry if there's just one syst to plot.
198  normUps.reserve(1);
199  normDowns.reserve(1);
200  } else {
201  // Otherwise we need all systs.
202  normUps.reserve(fUps.size());
203  normDowns.reserve(fUps.size());
204  }
205 
206  for(size_t i = 0; i < fUps.size(); ++i) {
207  // bail if we want a particular syst and it's not the one we want.
208  if(iSyst >= 0 && (int)i != iSyst) continue;
209  normUps.emplace_back(fUps[i]);
210  Spectrum& norm = normUps.back();
211  norm.OverridePOT(norm.POT() * norm.Integral(1) / tempMC.Integral(1));
212  }
213 
214  for ( size_t i = 0; i < fDowns.size(); ++i)
215  {
216  // bail if we want a particular syst and it's not the one we want.
217  if(iSyst >= 0 && (int)i != iSyst) continue;
218  normDowns.emplace_back(fDowns[i]);
219  Spectrum& norm = normDowns.back();
220  norm.OverridePOT(norm.POT() * norm.Integral(1) / tempMC.Integral(1));
221  }
222 
223  std::vector <TH1*> hUps, hDos;
224  for (const auto& Up:normUps) {
225  // Ups.
226  TH1* hTempUp = Up.ToTH1( fData.POT(), kBlack, kSolid, kPOT );
227  if ( ShortName().find("NuMuE") != std::string::npos ) hTempUp -> Scale(0.1,"width");
228  hTempUp -> Scale( 1e-3 );
229  hUps.push_back( hTempUp );
230  }
231  for (const auto& Do:normDowns) {
232  // Dos.
233  TH1* hTempDo = Do.ToTH1( fData.POT(), kBlack, kSolid, kPOT );
234  if ( ShortName().find("NuMuE") != std::string::npos ) hTempDo -> Scale(0.1,"width");
235  hTempDo -> Scale( 1e-3 );
236  hDos.push_back( hTempDo );
237  }
238  PlotWithSystErrorBand( hNom, hUps, hDos, FullPred, PredErr, 1.5, true );
239  }
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.
Definition: Spectrum.cxx:148
void OverridePOT(double newpot)
DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN&#39;T A BETTER WAY!
Definition: Spectrum.h:233
TGraphAsymmErrors * PlotWithSystErrorBand(IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float headroom, bool newaxis, EBinType bintype, double alpha)
Plot prediction with +/-1sigma error band.
Definition: Plots.cxx:304
const int FullPred
std::string ShortName() const
double Integral(double exposure, double *err=0, EExposureType expotype=kPOT) const
Return total number of events scaled to pot.
Definition: Spectrum.cxx:249
std::vector< Spectrum > fUps
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
ProcessPackage< L > Do
std::vector< Spectrum > fDowns
double POT() const
Definition: Spectrum.h:227
const int PredErr
Float_t norm
Float_t e
Definition: plot.C:35
simulatedPeak Scale(1/simulationNormalisationFactor)
double Livetime() const
Seconds. For informational purposes only. No calculations use this.
Definition: Spectrum.h:230
void DataMCPair::DrawMCNormSyst ( const int  iSyst = -1) const
inline

Definition at line 251 of file hadEFrac_nd_data_mc_systs.C.

References MECModelEnuComparisons::i, ana::Spectrum::Integral(), ana::kTotalMCColor, ana::kTotalMCErrorBandColor, norm, ana::Spectrum::OverridePOT(), ana::PlotWithSystErrorBand(), and ana::Spectrum::POT().

252  {
253  // New vectors for area normalized systs
254  std::vector<Spectrum> normUps;
255  std::vector<Spectrum> normDowns;
256 
257  Spectrum tempMC(fMC.ToTH1(fMC.POT()),fMC.POT(),fMC.Livetime());
258  tempMC.OverridePOT(fMC.POT() * fMC.ToTH1(fData.POT())->GetSumOfWeights() / fData.ToTH1(fData.POT())->GetSumOfWeights());
259 
260  if (iSyst >= 0)
261  {
262  // We'll have one entry if there's just one syst to plot.
263  normUps.reserve(1);
264  normDowns.reserve(1);
265  }
266  else
267  {
268  // Otherwise we need all systs.
269  normUps.reserve(fUps.size());
270  normDowns.reserve(fUps.size());
271  }
272  for(size_t i = 0; i < fUps.size(); ++i)
273  {
274  // bail if we want a particular syst and it's not the one we want.
275  if(iSyst >= 0 && (int)i != iSyst) continue;
276  normUps.emplace_back(fUps[i]);
277  Spectrum& norm = normUps.back();
278  norm.OverridePOT(norm.POT() * norm.Integral(1) / tempMC.Integral(1));
279  }
280  for(size_t i = 0; i < fDowns.size(); ++i)
281  {
282  // bail if we want a particular syst and it's not the one we want.
283  if(iSyst >= 0 && (int)i != iSyst) continue;
284  normDowns.emplace_back(fDowns[i]);
285  Spectrum& norm = normDowns.back();
286  norm.OverridePOT(norm.POT() * norm.Integral(1) / tempMC.Integral(1));
287  }
288  PlotWithSystErrorBand(tempMC, normUps, normDowns, fData.POT(),
290 
291  }
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.
Definition: Spectrum.cxx:148
void OverridePOT(double newpot)
DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN&#39;T A BETTER WAY!
Definition: Spectrum.h:233
TGraphAsymmErrors * PlotWithSystErrorBand(IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float headroom, bool newaxis, EBinType bintype, double alpha)
Plot prediction with +/-1sigma error band.
Definition: Plots.cxx:304
double Integral(double exposure, double *err=0, EExposureType expotype=kPOT) const
Return total number of events scaled to pot.
Definition: Spectrum.cxx:249
std::vector< Spectrum > fUps
const Color_t kTotalMCErrorBandColor
Definition: Style.h:17
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
std::vector< Spectrum > fDowns
double POT() const
Definition: Spectrum.h:227
Float_t norm
const Color_t kTotalMCColor
Definition: Style.h:16
double Livetime() const
Seconds. For informational purposes only. No calculations use this.
Definition: Spectrum.h:230
void DataMCPair::DrawMCSyst ( const int  iSyst = -1) const
inline

Definition at line 159 of file ND_DataMC_Comp_Systs_header.h.

References e, FullPred, ana::kPOT, ana::PlotWithSystErrorBand(), PredErr, and Scale().

160  {
161  TH1* hNom = fMC.ToTH1(fData.POT(), kBlack, kSolid, kPOT);
162  if ( ShortName().find("NuMuE") != std::string::npos ) hNom -> Scale(0.1,"width");
163  hNom -> Scale( 1e-3 );
164  std::vector <TH1*> hUps, hDos;
165  for (const auto& Up:fUps) {
166  // Ups.
167  TH1* hTempUp = Up.ToTH1( fData.POT(), kBlack, kSolid, kPOT );
168  if ( ShortName().find("NuMuE") != std::string::npos ) hTempUp -> Scale(0.1,"width");
169  hTempUp -> Scale( 1e-3 );
170  hUps.push_back( hTempUp );
171  }
172  for (const auto& Do:fDowns) {
173  // Dos.
174  TH1* hTempDo = Do.ToTH1( fData.POT(), kBlack, kSolid, kPOT );
175  if ( ShortName().find("NuMuE") != std::string::npos ) hTempDo -> Scale(0.1,"width");
176  hTempDo -> Scale( 1e-3 );
177  hDos.push_back( hTempDo );
178  }
179 
180  PlotWithSystErrorBand( hNom, hUps, hDos, FullPred, PredErr, 1.5, true );
181  }
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.
Definition: Spectrum.cxx:148
TGraphAsymmErrors * PlotWithSystErrorBand(IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float headroom, bool newaxis, EBinType bintype, double alpha)
Plot prediction with +/-1sigma error band.
Definition: Plots.cxx:304
const int FullPred
std::string ShortName() const
std::vector< Spectrum > fUps
ProcessPackage< L > Do
std::vector< Spectrum > fDowns
double POT() const
Definition: Spectrum.h:227
const int PredErr
Float_t e
Definition: plot.C:35
simulatedPeak Scale(1/simulationNormalisationFactor)
void DataMCPair::DrawMCSyst ( const int  iSyst = -1) const
inline

Definition at line 227 of file hadEFrac_nd_data_mc_systs.C.

References ana::assert(), ana::kTotalMCColor, ana::kTotalMCErrorBandColor, and ana::PlotWithSystErrorBand().

228  {
229  if(iSyst < 0)
232  else
233  {
234  assert(iSyst < fUps.size());
235  PlotWithSystErrorBand(fMC, {fUps[iSyst]}, {fDowns[iSyst]}, fData.POT(),
237  }
238 
239  }
TGraphAsymmErrors * PlotWithSystErrorBand(IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float headroom, bool newaxis, EBinType bintype, double alpha)
Plot prediction with +/-1sigma error band.
Definition: Plots.cxx:304
std::vector< Spectrum > fUps
const Color_t kTotalMCErrorBandColor
Definition: Style.h:17
std::vector< Spectrum > fDowns
double POT() const
Definition: Spectrum.h:227
assert(nhit_max >=nhit_nbins)
const Color_t kTotalMCColor
Definition: Style.h:16
void DataMCPair::DrawWrong ( ) const
inline

Definition at line 391 of file ND_DataMC_Comp_Systs_header.h.

References om::cout, e, allTimeWatchdog::endl, Scale(), and WrongSi.

392  {
393  TH1D* hWrong = fWrong.ToTH1(fData.POT());
394  std::cout << "\t hWrong integral is " << hWrong->Integral() << ", mean is " << hWrong->GetMean() << std::endl;
395 
396  if (ShortName().find("NuMuE") != std::string::npos) {
397  hWrong -> Scale(0.1,"width");
398  }
399  hWrong->Scale( 1e-3 );
400  hWrong->SetLineColor( WrongSi );
401  hWrong->SetFillColor( WrongSi );
402  hWrong->Draw("hist same");
403  };
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.
Definition: Spectrum.cxx:148
const int WrongSi
std::string ShortName() const
double POT() const
Definition: Spectrum.h:227
OStream cout
Definition: OStream.cxx:6
Float_t e
Definition: plot.C:35
simulatedPeak Scale(1/simulationNormalisationFactor)
void DataMCPair::OverlayDataMCSyst ( const int  iSyst = -1) const
inline

Definition at line 118 of file ND_DataMC_Comp_Systs_header.h.

References ana::CenterTitles(), DataCol, DataMar, Draw(), DrawLegend(), MECModelEnuComparisons::leg, and RedrawAxes().

118  {
119 
120  TH1D* hDummy = fData.ToTH1(fData.POT());
121  hDummy->SetMarkerColor(DataCol);
122  hDummy->SetMarkerStyle(DataMar);
123  hDummy->SetLineColor (DataCol);
124  hDummy->Draw();
125 
126  DrawMCSyst(iSyst);
127  DrawMCBkg();
128  DrawWrong();
129  DrawData();
130  hDummy -> Draw( "axis same" );
131  TLegend* leg = DrawLegend();
132  CenterTitles();
133  RedrawAxes();
134  AddExposure( true );
135  };
tree Draw("slc.nhit")
void DrawMCBkg() const
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.
Definition: Spectrum.cxx:148
void AddExposure(bool IsPOT) const
const int DataMar
void DrawMCSyst(const int iSyst=-1) const
const int DataCol
TLegend * DrawLegend() const
double POT() const
Definition: Spectrum.h:227
void CenterTitles()
void DataMCPair::OverlayDataMCSyst ( const int  iSyst = -1) const
inline

Definition at line 240 of file hadEFrac_nd_data_mc_systs.C.

References MECModelEnuComparisons::leg.

241  {
242  DrawData();
243  DrawMCSyst(iSyst);
244  DrawData();
245  DrawMCBkg();
246  TLegend* leg = DrawLegendPOT();
247  AestheticsPOT();
248 
249  };
void DrawMCBkg() const
void DrawMCSyst(const int iSyst=-1) const
void AestheticsPOT() const
TLegend * DrawLegendPOT(const int dataColor=kBlack, std::string dataLegendTitle="Data", const int dataMarker=kFullCircle) const
void DataMCPair::OverlayDataMCSystExtraData ( const DataMCPair extraData,
const std::string  dataLegendTitle,
const std::string  extraLegendTitle,
const int  iSyst = -1,
const int  dataColor = kBlack,
const int  extraColor = kGray+1,
const int  dataMarker = kFullCircle,
const int  extraMarker = kFullCircle 
) const
inline

Definition at line 316 of file hadEFrac_nd_data_mc_systs.C.

References ana::DataMCPair::DrawData(), and MECModelEnuComparisons::leg.

324  {
325 
326  DrawMCSyst(iSyst);
327  DrawData(dataColor, dataMarker);
328  extraData.DrawData(extraColor, extraMarker);
329  DrawMCBkg();
330  TLegend* leg = DrawLegendPOT(dataColor, dataLegendTitle, dataMarker);
331  TH1F* colExtraData = new TH1F();
332  colExtraData->SetMarkerColor(extraColor);
333  colExtraData->SetMarkerStyle(extraMarker);
334  colExtraData->SetLineColor(extraColor);
335  leg->AddEntry((TObject*)colExtraData, extraLegendTitle.c_str(), "ple");
336  AestheticsPOT();
337 
338  };
void DrawMCBkg() const
void DrawMCSyst(const int iSyst=-1) const
void DrawData(const int color=kBlack, EBinType bintype=kBinContent) const
Draw data on plots, mostly for internal use.
Definition: DataMCPair.cxx:214
void AestheticsPOT() const
TLegend * DrawLegendPOT(const int dataColor=kBlack, std::string dataLegendTitle="Data", const int dataMarker=kFullCircle) const
void DataMCPair::OverlayDataMCSystNorm ( const int  iSyst = -1) const
inline

Definition at line 138 of file ND_DataMC_Comp_Systs_header.h.

References ana::CenterTitles(), DataCol, DataMar, DrawLegend(), MECModelEnuComparisons::leg, and RedrawAxes().

138  {
139 
140  TH1D* hDummy = fData.ToTH1(fData.POT());
141  hDummy->SetMarkerColor(DataCol);
142  hDummy->SetMarkerStyle(DataMar);
143  hDummy->SetLineColor (DataCol);
144  hDummy->Draw();
145 
146  DrawMCNormSyst(iSyst);
147  DrawMCBkg();
148  DrawWrong();
149  DrawData();
150  hDummy->Draw( "axis same" );
151  TLegend* leg = DrawLegend();
152  CenterTitles();
153  RedrawAxes();
154  AddExposure( false );
155  };
void DrawMCBkg() const
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.
Definition: Spectrum.cxx:148
void AddExposure(bool IsPOT) const
const int DataMar
const int DataCol
TLegend * DrawLegend() const
double POT() const
Definition: Spectrum.h:227
void CenterTitles()
void DrawMCNormSyst(const int iSyst=-1) const
void DataMCPair::OverlayDataMCSystNorm ( const int  iSyst = -1) const
inline

Definition at line 294 of file hadEFrac_nd_data_mc_systs.C.

References MECModelEnuComparisons::leg.

295  {
296 
297  const int tempcolor=kBlack;
298  const int tempmarker=kFullCircle;
299  TH1D* hDummy = fData.ToTH1(fData.POT());
300  hDummy->GetYaxis()->SetTitle("Events / 0.1 GeV"); // only for cust bin neutrino plot
301  //hDummy->GetYaxis()->SetTitleOffset(1.1);
302  hDummy->SetMarkerColor(tempcolor);
303  hDummy->SetMarkerStyle(tempmarker);
304  hDummy->SetLineColor(tempcolor);
305  hDummy->Draw();
306 
307  DrawMCNormSyst(iSyst);
308  DrawData();
309  DrawMCBkg();
310  TLegend* leg = DrawLegendArea();
311  AestheticsArea();
312  };
void DrawMCBkg() const
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.
Definition: Spectrum.cxx:148
double POT() const
Definition: Spectrum.h:227
TLegend * DrawLegendArea(const int dataColor=kBlack, std::string dataLegendTitle="Data", const int dataMarker=kFullCircle) const
void AestheticsArea() const
void DrawMCNormSyst(const int iSyst=-1) const
void DataMCPair::OverlayDataMCSystNormExtraData ( const DataMCPair extraData,
const std::string  dataLegendTitle,
const std::string  extraLegendTitle,
const int  iSyst = -1,
const int  dataColor = kBlack,
const int  extraColor = kGray+1,
const int  dataMarker = kFullCircle,
const int  extraMarker = kFullCircle 
) const
inline

Definition at line 343 of file hadEFrac_nd_data_mc_systs.C.

References ana::DataMCPair::DrawData(), and MECModelEnuComparisons::leg.

351  {
352 
353 
354  DrawMCNormSyst(iSyst);
355  DrawData(dataColor, dataMarker);
356  extraData.DrawData(extraColor);
357  DrawMCBkg();
358  TLegend* leg = DrawLegendArea(dataColor, dataLegendTitle, dataMarker);
359  TH1F* colExtraData = new TH1F();
360  colExtraData->SetMarkerColor(extraColor);
361  colExtraData->SetMarkerStyle(extraMarker);
362  colExtraData->SetLineColor(extraColor);
363  leg->AddEntry((TObject*)colExtraData, extraLegendTitle.c_str(), "ple");
364  AestheticsArea();
365 
366  };
void DrawMCBkg() const
void DrawData(const int color=kBlack, EBinType bintype=kBinContent) const
Draw data on plots, mostly for internal use.
Definition: DataMCPair.cxx:214
TLegend * DrawLegendArea(const int dataColor=kBlack, std::string dataLegendTitle="Data", const int dataMarker=kFullCircle) const
void AestheticsArea() const
void DrawMCNormSyst(const int iSyst=-1) const
float DataMCPair::Purity ( ) const
inline

Definition at line 407 of file ND_DataMC_Comp_Systs_header.h.

References GetEntries().

408  {
409  return 1 - fMCBkg.ToTH1(fData.POT())->GetEntries() /
410  fMC.ToTH1(fData.POT())->GetEntries();
411  }
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.
Definition: Spectrum.cxx:148
cout<< t1-> GetEntries()
Definition: plottest35.C:29
double POT() const
Definition: Spectrum.h:227
float DataMCPair::Purity ( ) const
inline

Definition at line 535 of file hadEFrac_nd_data_mc_systs.C.

References GetEntries().

536  {
537  return 1 - fMCBkg.ToTH1(fData.POT())->GetEntries() /
538  fMC.ToTH1(fData.POT())->GetEntries();
539  }
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.
Definition: Spectrum.cxx:148
cout<< t1-> GetEntries()
Definition: plottest35.C:29
double POT() const
Definition: Spectrum.h:227
void DataMCPair::RedrawAxes ( ) const
inline

Definition at line 339 of file ND_DataMC_Comp_Systs_header.h.

References string.

340  {
341  // --- Loop through the objects in the pad.
342  for(const auto& obj:*(gPad->GetListOfPrimitives())) {
343  // --- Want to repaint all TH1's.
344  if(obj->InheritsFrom("TH1")) {
345  // --- Check if I have the Reco Energy canvas?
346  std::string XTitle = ((TH1*)obj)->GetXaxis()->GetTitle();
347  std::stringstream YAxisStr;
348  YAxisStr << "10^{3} Events / " << Form("%.2f#times10^{20} POT",fData.POT()/1e20);
349  if ( XTitle.find("Reconstructed Neutrino Energ") != std::string::npos ) {
350  YAxisStr << " / 0.1 GeV";
351  }
352  ((TH1*)obj)->GetYaxis()->SetTitle( YAxisStr.str().c_str() );
353  // Repaint the axes.
354  ((TH1*)obj)->GetXaxis()->Paint();
355  //((TH1*)obj)->GetYaxis()->SetTitleOffset(1.1);
356  ((TH1*)obj)->GetYaxis()->Paint();
357  ((TH1*)obj)->GetZaxis()->Paint();
358  }
359  }
360  }
double POT() const
Definition: Spectrum.h:227
enum BeamMode string
std::string DataMCPair::ShortName ( ) const
inline

Definition at line 114 of file ND_DataMC_Comp_Systs_header.h.

References ana::Tangible< T >::fShortName.

115  {return fShortName;};
std::string DataMCPair::ShortName ( ) const
inline

Definition at line 219 of file hadEFrac_nd_data_mc_systs.C.

References ana::Tangible< T >::fShortName.

220  {return fShortName;};

Member Data Documentation

TangibleAxis DataMCPair::fAxis

Definition at line 542 of file hadEFrac_nd_data_mc_systs.C.

Spectrum DataMCPair::fData

Definition at line 543 of file hadEFrac_nd_data_mc_systs.C.

std::vector<Spectrum> DataMCPair::fDowns

Definition at line 547 of file hadEFrac_nd_data_mc_systs.C.

Spectrum DataMCPair::fMC

Definition at line 544 of file hadEFrac_nd_data_mc_systs.C.

Spectrum DataMCPair::fMCBkg

Definition at line 545 of file hadEFrac_nd_data_mc_systs.C.

Selection DataMCPair::fSel

Definition at line 541 of file hadEFrac_nd_data_mc_systs.C.

std::string DataMCPair::fShortName

Definition at line 548 of file hadEFrac_nd_data_mc_systs.C.

std::vector<Spectrum> DataMCPair::fUps

Definition at line 546 of file hadEFrac_nd_data_mc_systs.C.

Spectrum DataMCPair::fWrong

Definition at line 418 of file ND_DataMC_Comp_Systs_header.h.


The documentation for this class was generated from the following files: