Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ana::nueccinc::NueCCIncCrossSectionAnalysis Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/NDAna/nuecc_inc/NueCCIncCrossSectionAnalysis.h"

Public Member Functions

 NueCCIncCrossSectionAnalysis (SpectrumLoaderBase &lLoad, HistAxis yAxis, HistAxis xAxis, HistAxis zAxis, HistAxis recoAxis2D, NuTruthHistAxis efficiencyAxis2D, NuTruthHistAxis efficiencyAxis1D, HistAxis pidAxis, Binning fluxBins, Cut selection, NuTruthCut isSig, TVector3 min, TVector3 max, SystShifts shift, NuTruthVar weiNT, Var wei)
 
virtual ~NueCCIncCrossSectionAnalysis ()
 
 NueCCIncCrossSectionAnalysis (Spectrum sAnalysis3D, Spectrum sTemplate3D, Spectrum sAnalysisSig1D, Spectrum sAnalysisSigNuTree1D, Spectrum sAnalysisSig2D, Spectrum sAnalysisSigNuTree2D, Spectrum sUnfolding1D, Spectrum sUnfolding2D, TVector3 sFidMin, TVector3 sFidMax, Spectrum *sFlux, bool loadFromFile)
 
TH1F * getTemplate (int xbin, int ybin, Binning binningx, Binning binnningy, Binning binningz)
 
TH1F * getFullTemplate ()
 
TH3F * getTemplate3D (Binning binningx, Binning binnningy, Binning binningz)
 
TH3F * getTemplateShapeOnly3D (Binning binningx, Binning binningy, Binning binningz, double integral)
 
TH1F * getTemplateShapeOnly1D (double integral)
 
Spectrum getAnalysisSpectrumOnly ()
 
TH1F * getEfficiency1D ()
 
TH1F * getEfficiency1D (Binning binningx, Binning binningy, std::string outaxis)
 
TH2F * getEfficiency2D (Binning binningx, Binning binningy)
 
TH3F * getAnalysis3D (Binning binningx, Binning binnningy, Binning binningz)
 
TH2F * getAnalysis2D (Binning binningx, Binning binnningy, Binning binningz)
 
TH1F * getAnalysis1D (Binning binningx, Binning binnningy, Binning binningz, std::string outaxis)
 
TH1F * getFlux1D ()
 
TH2F * getUnfoldingMatrix (std::string dimension)
 
TH1F * getSelectedSignalPrediction1D ()
 
TH2F * getSelectedSignalPrediction2D (Binning binningx, Binning binningy)
 
TH1F * getTrueSignalPrediction1D ()
 
TH2F * getTrueSignalPrediction2D (Binning binningx, Binning binningy)
 
TH1F * ConvertTo1DHistFrom2DHist (TH2F *hist)
 
TH2F * ConvertTo2DHistFrom1DHist (TH2F *hSample2D, TH1F *hist)
 
TH1F * UnfoldHist (TH1F *data_hist_1D, TH2F *hUnfoldingMatrix, int iterations)
 
TH1F * doUnfolding1D (TH1F *datahist, int iterations)
 
TH2F * doUnfolding2D (TH2F *datahist, int iterations)
 
std::unique_ptr< NueCCIncCrossSectionAnalysisAddEnhancedSample (std::vector< Spectrum > sample, Binning xbins, Binning ybins, Binning zbins, Binning bins2D, Binning pidbins)
 
void SaveTo (TDirectory *dir) const
 
Spectrum returnAnalysisSpectrum ()
 
Spectrum returnTemplateSpectrum ()
 
Spectrum returnAnalysisSigSpectrum1D ()
 
Spectrum returnAnalysisSigNuTreeSpectrum1D ()
 
Spectrum returnAnalysisSigSpectrum2D ()
 
Spectrum returnAnalysisSigNuTreeSpectrum2D ()
 
Spectrum returnUnfoldingSpectrum1D ()
 
Spectrum returnUnfoldingSpectrum2D ()
 
Spectrum returnFluxSpectrum ()
 
std::vector< TVector3 > returnFiducialVectors ()
 

Static Public Member Functions

static std::unique_ptr< NueCCIncCrossSectionAnalysisLoadFrom (TDirectory *dir)
 

Private Member Functions

 NueCCIncCrossSectionAnalysis (Spectrum analysis3D, Spectrum template3D, Spectrum analysisSig1D, Spectrum analysisSigNT1D, Spectrum analysisSig2D, Spectrum analysisSigNT2D, Spectrum unfolding1D, Spectrum unfolding2D, TVector3 min, TVector3 max, Spectrum *flux)
 
SpectrumSpectrumTemplate ()
 
std::vector< Spectrum * > SpectrumEfficiency (std::string dimension)
 
SpectrumSpectrumAnalysis ()
 
SpectrumSpectrumFlux ()
 
SpectrumSpectrumUnfolding (std::string dimension)
 
std::vector< TVector3 > GetFiducialVolume ()
 

Private Attributes

Spectrum fAnalysis3D
 
Spectrum fTemplate3D
 
Spectrum fAnalysisSig1D
 
Spectrum fAnalysisSigNuTree1D
 
Spectrum fAnalysisSig2D
 
Spectrum fAnalysisSigNuTree2D
 
Spectrum fUnfolding1D
 
Spectrum fUnfolding2D
 
TVector3 fFidMin
 
TVector3 fFidMax
 
SpectrumfFlux
 

Detailed Description

Definition at line 26 of file NueCCIncCrossSectionAnalysis.h.

Constructor & Destructor Documentation

ana::nueccinc::NueCCIncCrossSectionAnalysis::NueCCIncCrossSectionAnalysis ( SpectrumLoaderBase lLoad,
HistAxis  yAxis,
HistAxis  xAxis,
HistAxis  zAxis,
HistAxis  recoAxis2D,
NuTruthHistAxis  efficiencyAxis2D,
NuTruthHistAxis  efficiencyAxis1D,
HistAxis  pidAxis,
Binning  fluxBins,
Cut  selection,
NuTruthCut  isSig,
TVector3  min,
TVector3  max,
SystShifts  shift,
NuTruthVar  weiNT,
Var  wei 
)

Definition at line 28 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::DeriveFlux().

Referenced by AddEnhancedSample(), LoadFrom(), and ~NueCCIncCrossSectionAnalysis().

45  :
46  fAnalysis3D(lLoad, xAxis,yAxis,zAxis,selection,shift,wei),
47  fTemplate3D(lLoad, xAxis,yAxis,pidAxis,selection,shift,wei),
48  fAnalysisSig1D(lLoad,
49  HistAxisFromNuTruthHistAxis(efficiencyAxis1D),
50  selection && CutFromNuTruthCut(isSig),
51  shift, wei),
53  efficiencyAxis1D,
54  isSig,
55  shift, weiNT),
56  fAnalysisSig2D(lLoad,HistAxisFromNuTruthHistAxis(efficiencyAxis2D),
57  selection && CutFromNuTruthCut(isSig),
58  shift, wei),
59  fAnalysisSigNuTree2D(lLoad,efficiencyAxis2D,
60  isSig,
61  shift, weiNT),
62  fUnfolding1D(lLoad,zAxis,HistAxisFromNuTruthHistAxis(efficiencyAxis1D),
63  selection && CutFromNuTruthCut(isSig),shift,wei),
64  fUnfolding2D(lLoad,recoAxis2D,
65  HistAxisFromNuTruthHistAxis(efficiencyAxis2D),
66  selection && CutFromNuTruthCut(isSig),shift,wei),
67  fFidMin(min),
68  fFidMax(max)
69  {
70  fFlux =
71  (Spectrum*)DeriveFlux(lLoad, fluxBins, 12, &fFidMin,
72  &fFidMax, shift, weiNT);
73  }
HistAxis HistAxisFromNuTruthHistAxis(NuTruthHistAxis ntha, double _default)
Definition: HistAxis.cxx:9
std::vector< float > Spectrum
Definition: Constants.h:610
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
Spectrum * DeriveFlux(SpectrumLoaderBase &loader, const Binning &bins, int pdg, const TVector3 *min, const TVector3 *max, const SystShifts &shift, const NuTruthVar weight)
Definition: Flux.cxx:58
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
Cut CutFromNuTruthCut(const NuTruthCut &stc)
Definition: Cut.cxx:7
virtual ana::nueccinc::NueCCIncCrossSectionAnalysis::~NueCCIncCrossSectionAnalysis ( )
inlinevirtual
ana::nueccinc::NueCCIncCrossSectionAnalysis::NueCCIncCrossSectionAnalysis ( Spectrum  sAnalysis3D,
Spectrum  sTemplate3D,
Spectrum  sAnalysisSig1D,
Spectrum  sAnalysisSigNuTree1D,
Spectrum  sAnalysisSig2D,
Spectrum  sAnalysisSigNuTree2D,
Spectrum  sUnfolding1D,
Spectrum  sUnfolding2D,
TVector3  sFidMin,
TVector3  sFidMax,
Spectrum sFlux,
bool  loadFromFile 
)

Definition at line 76 of file NueCCIncCrossSectionAnalysis.cxx.

88  :
89  fAnalysis3D(sAnalysis3D),
90  fTemplate3D(sTemplate3D),
91  fAnalysisSig1D(sAnalysisSig1D),
92  fAnalysisSigNuTree1D(sAnalysisSigNuTree1D),
93  fAnalysisSig2D(sAnalysisSig2D),
94  fAnalysisSigNuTree2D(sAnalysisSigNuTree2D),
95  fUnfolding1D(sUnfolding1D),
96  fUnfolding2D(sUnfolding2D),
97  fFidMin(sFidMin),
98  fFidMax(sFidMax),
99  fFlux(sFlux)
100  {}
ana::nueccinc::NueCCIncCrossSectionAnalysis::NueCCIncCrossSectionAnalysis ( Spectrum  analysis3D,
Spectrum  template3D,
Spectrum  analysisSig1D,
Spectrum  analysisSigNT1D,
Spectrum  analysisSig2D,
Spectrum  analysisSigNT2D,
Spectrum  unfolding1D,
Spectrum  unfolding2D,
TVector3  min,
TVector3  max,
Spectrum flux 
)
inlineprivate

Definition at line 120 of file NueCCIncCrossSectionAnalysis.h.

References GetFiducialVolume(), SpectrumAnalysis(), SpectrumEfficiency(), SpectrumFlux(), SpectrumTemplate(), SpectrumUnfolding(), and string.

131  : fAnalysis3D(analysis3D),
132  fTemplate3D(template3D),
133  fAnalysisSig1D(analysisSig1D),
134  fAnalysisSigNuTree1D(analysisSigNT1D),
135  fAnalysisSig2D(analysisSig2D),
136  fAnalysisSigNuTree2D(analysisSigNT2D),
137  fUnfolding1D(unfolding1D),
138  fUnfolding2D(unfolding2D),
139  fFidMin(min),
140  fFidMax(max),
141  fFlux(flux)
142  {}
Loaders::FluxType flux
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68

Member Function Documentation

std::unique_ptr< NueCCIncCrossSectionAnalysis > ana::nueccinc::NueCCIncCrossSectionAnalysis::AddEnhancedSample ( std::vector< Spectrum sample,
Binning  xbins,
Binning  ybins,
Binning  zbins,
Binning  bins2D,
Binning  pidbins 
)

Definition at line 634 of file NueCCIncCrossSectionAnalysis.cxx.

References flux, GetFiducialVolume(), NueCCIncCrossSectionAnalysis(), ana::Spectrum::POT(), SpectrumAnalysis(), SpectrumEfficiency(), SpectrumFlux(), SpectrumTemplate(), SpectrumUnfolding(), ana::Spectrum::ToTH1(), xbins, and ybins.

Referenced by ~NueCCIncCrossSectionAnalysis().

640  {
643  std::vector<Spectrum*> vEff1D =
645  std::vector<Spectrum*> vEff2D =
647  Spectrum unfolding1D =
649  Spectrum unfolding2D =
651 
652  std::vector<Spectrum> vEfficiency1D = {*(vEff1D[0]),*(vEff1D[1])};
653  std::vector<Spectrum> vEfficiency2D = {*(vEff2D[0]),*(vEff2D[1])};
654 
656  std::vector<TVector3> fidvol =
658 
659  double pot_nominal = analysis3D.POT();
660  double pot_enhanced = sample[0].POT();
661 
662  //order for the sample vector is
663  //{analysis_spectra, template_spectra,fAnalysisSig1D,fAnalysisSigNuTree1D,
664  // fAnalysisSig2D,fAnalysisSigNuTree2D,fUnfolding1D,fUnfolding2D}
665 
666  TH1F* hAnalysis3D = (TH1F*)analysis3D.ToTH1(pot_nominal);
667  TH1F* hTemplate3D = (TH1F*)template3D.ToTH1(pot_nominal);
668  TH1F* vEffNum1D = (TH1F*)vEfficiency1D[0].ToTH1(pot_nominal);
669  TH1F* vEffDenom1D = (TH1F*)vEfficiency1D[1].ToTH1(pot_nominal);
670  TH1F* vEffNum2D = (TH1F*)vEfficiency2D[0].ToTH1(pot_nominal);
671  TH1F* vEffDenom2D = (TH1F*)vEfficiency2D[1].ToTH1(pot_nominal);
672  TH1F* hUnfolding1D= (TH1F*)unfolding1D.ToTH1(pot_nominal);
673  TH1F* hUnfolding2D= (TH1F*)unfolding2D.ToTH1(pot_nominal);
674 
675  vEffNum1D->Add((TH1F*)sample[0].ToTH1(pot_enhanced));
676  vEffDenom1D->Add((TH1F*)sample[1].ToTH1(pot_enhanced));
677  vEffNum2D->Add((TH1F*)sample[2].ToTH1(pot_enhanced));
678  vEffDenom2D->Add((TH1F*)sample[3].ToTH1(pot_enhanced));
679  hUnfolding1D->Add((TH1F*)sample[4].ToTH1(pot_enhanced));
680  hUnfolding2D->Add((TH1F*)sample[5].ToTH1(pot_enhanced));
681 
682  Spectrum* sAnalysis3D = new Spectrum(hAnalysis3D,{"","",""},
683  {xbins,ybins,zbins},
684  pot_nominal,0);
685  Spectrum* sTemplate3D = new Spectrum(hTemplate3D,{"","",""},
686  {xbins,ybins,pidbins},
687  pot_nominal,0);
688  Spectrum* sEffNum1D = new Spectrum(vEffNum1D,pot_nominal,0);
689  Spectrum* sEffDenom1D = new Spectrum(vEffDenom1D,pot_nominal,0);
690  Spectrum* sEffNum2D = new Spectrum(vEffNum2D,{"",""},
691  {xbins,ybins},
692  pot_nominal,0);
693  Spectrum* sEffDenom2D = new Spectrum(vEffDenom2D,{"",""},
694  {xbins,ybins},
695  pot_nominal,0);
696  Spectrum* sUnfolding1D = new Spectrum(hUnfolding1D,pot_nominal,0);
697  Spectrum* sUnfolding2D = new Spectrum(hUnfolding2D,
698  {"",""},
699  {bins2D,bins2D},pot_nominal,0);
700 
701  return std::unique_ptr<NueCCIncCrossSectionAnalysis>
702  (new NueCCIncCrossSectionAnalysis(*sAnalysis3D, *sTemplate3D,
703  *sEffNum1D,*sEffDenom1D,
704  *sEffNum2D,*sEffDenom2D,
705  *sUnfolding1D,*sUnfolding2D,
706  fidvol[0],fidvol[1],flux));
707 
708  }
NueCCIncCrossSectionAnalysis(SpectrumLoaderBase &lLoad, HistAxis yAxis, HistAxis xAxis, HistAxis zAxis, HistAxis recoAxis2D, NuTruthHistAxis efficiencyAxis2D, NuTruthHistAxis efficiencyAxis1D, HistAxis pidAxis, Binning fluxBins, Cut selection, NuTruthCut isSig, TVector3 min, TVector3 max, SystShifts shift, NuTruthVar weiNT, Var wei)
const Binning zbins
Definition: NumuCCIncBins.h:21
Loaders::FluxType flux
const Binning pidbins
Definition: NueCCIncBins.h:38
const int xbins
Definition: MakePlots.C:82
std::vector< float > Spectrum
Definition: Constants.h:610
const int ybins
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::ConvertTo1DHistFrom2DHist ( TH2F *  hist)

Definition at line 514 of file NueCCIncCrossSectionAnalysis.cxx.

References MECModelEnuComparisons::i, ana::UniqueName(), and febshutoff_auto::val.

Referenced by doUnfolding2D(), and ~NueCCIncCrossSectionAnalysis().

515  {
516  int numBins = hist->GetYaxis()->GetNbins() *
517  hist->GetXaxis()->GetNbins();
518 
519  TH1F* hHolder = new TH1F(ana::UniqueName().c_str(),"",
520  numBins,0,numBins);
521  for(int i = 0; i < hHolder->GetNbinsX() ;++i){
522  const int ix = i/ hist->GetYaxis()->GetNbins();
523  const int iy = i % hist->GetYaxis()->GetNbins();
524  const double val = hist->GetBinContent(ix+1, iy+1);
525  const double err = hist->GetBinError (ix+1, iy+1);
526  hHolder->SetBinContent(i+1,val);
527  hHolder->SetBinError(i+1,err);
528  }//loop over all kinematic bins
529  return hHolder;
530  }
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
TH2F * ana::nueccinc::NueCCIncCrossSectionAnalysis::ConvertTo2DHistFrom1DHist ( TH2F *  hSample2D,
TH1F *  hist 
)

Definition at line 532 of file NueCCIncCrossSectionAnalysis.cxx.

References MECModelEnuComparisons::i, ana::UniqueName(), and febshutoff_auto::val.

Referenced by doUnfolding2D(), and ~NueCCIncCrossSectionAnalysis().

534  {
535  TH2F* hResult = (TH2F*)hSample2D->Clone(ana::UniqueName().c_str());
536 
537  for(int i = 0; i < hist->GetNbinsX(); ++i){
538  const double val = hist->GetBinContent(i+1);
539  const double err = hist->GetBinError(i+1);
540  const int ix = i/ hResult->GetYaxis()->GetNbins();
541  const int iy = i % hResult->GetYaxis()->GetNbins();
542 
543  hResult->SetBinContent(ix+1, iy+1, val);
544  hResult->SetBinError (ix+1, iy+1, err);
545  }
546 
547  return hResult;
548  }
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::doUnfolding1D ( TH1F *  datahist,
int  iterations 
)

Definition at line 592 of file NueCCIncCrossSectionAnalysis.cxx.

References SpectrumUnfolding(), ana::Spectrum::ToTH2(), and UnfoldHist().

Referenced by ~NueCCIncCrossSectionAnalysis().

593  {
594  Spectrum* unfolding =
596 
597  TH2F* hUnfoldingMatrix = (TH2F*)unfolding->ToTH2(8.09e20);
598 
599  TH1F* unfolded_data_hist_1D =
600  NueCCIncCrossSectionAnalysis::UnfoldHist(datahist,hUnfoldingMatrix,
601  iterations);
602 
603  return unfolded_data_hist_1D;
604  }
TH1F * UnfoldHist(TH1F *data_hist_1D, TH2F *hUnfoldingMatrix, int iterations)
std::vector< float > Spectrum
Definition: Constants.h:610
Long64_t iterations[nThreads]
Definition: PhotonSim_mp.C:71
TH2F * ana::nueccinc::NueCCIncCrossSectionAnalysis::doUnfolding2D ( TH2F *  datahist,
int  iterations 
)

Definition at line 608 of file NueCCIncCrossSectionAnalysis.cxx.

References ConvertTo1DHistFrom2DHist(), ConvertTo2DHistFrom1DHist(), SpectrumUnfolding(), ana::Spectrum::ToTH2(), and UnfoldHist().

Referenced by ~NueCCIncCrossSectionAnalysis().

609  {
610  Spectrum* unfolding =
612 
613  TH2F* hUnfoldingMatrix = (TH2F*)unfolding->ToTH2(8.09e20);
614 
615  TH1F* data_hist_1D =
617 
618  TH1F* unfolded_data_hist_1D =
619  NueCCIncCrossSectionAnalysis::UnfoldHist(data_hist_1D,hUnfoldingMatrix,
620  iterations);
621 
622  TH2F* hResult =
624  unfolded_data_hist_1D);
625 
626  return hResult;
627 
628  }
TH2F * ConvertTo2DHistFrom1DHist(TH2F *hSample2D, TH1F *hist)
TH1F * UnfoldHist(TH1F *data_hist_1D, TH2F *hUnfoldingMatrix, int iterations)
std::vector< float > Spectrum
Definition: Constants.h:610
Long64_t iterations[nThreads]
Definition: PhotonSim_mp.C:71
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getAnalysis1D ( Binning  binningx,
Binning  binnningy,
Binning  binningz,
std::string  outaxis 
)

Definition at line 375 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::kBinContent, ana::kPOT, SpectrumAnalysis(), string, ana::ToTH3(), and ana::UniqueName().

Referenced by ~NueCCIncCrossSectionAnalysis().

379  {
380  //outaxis == "X", "Y", "Z"
382  TH3F* hResult3D = (TH3F*)ana::ToTH3(*analysis3D,8.09e20,
384  binningx,binningy,
385  binningz,ana::EBinType::kBinContent);
386  std::vector<TH1F*> hResult;
387  std::string axis_name;
388  if(outaxis == "X"){
389  hResult.push_back((TH1F*)hResult3D->ProjectionX
390  (ana::UniqueName().c_str()));
391  axis_name = "Reco. cos #theta_{e}";
392  }
393  else if(outaxis == "Y"){
394  hResult.push_back((TH1F*)hResult3D->ProjectionY
395  (ana::UniqueName().c_str()));
396  axis_name = "Reco. Electron Energy, E_{e} (GeV)";
397  }
398  else if(outaxis == "Z"){
399  hResult.push_back((TH1F*)hResult3D->ProjectionZ
400  (ana::UniqueName().c_str()));
401  axis_name = "Reco. Neutrino Energy, E_{#nu} (GeV)";
402  }
403  hResult[0]->SetName(ana::UniqueName().c_str());
404  hResult[0]->SetTitle("");
405  hResult[0]->GetYaxis()->SetTitle("Events/8.09 #times 10^{20} POT");
406  hResult[0]->GetYaxis()->CenterTitle();
407  hResult[0]->GetXaxis()->SetTitle(axis_name.c_str());
408  hResult[0]->GetXaxis()->CenterTitle();
409  return hResult[0];
410  }
std::vector< float > Spectrum
Definition: Constants.h:610
Regular histogram.
Definition: UtilsExt.h:30
TH3 * ToTH3(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
Same as ToTH2, but with 3 dimensions.
Definition: UtilsExt.cxx:162
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
enum BeamMode string
TH2F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getAnalysis2D ( Binning  binningx,
Binning  binnningy,
Binning  binningz 
)

Definition at line 358 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::kBinContent, ana::kPOT, SpectrumAnalysis(), ana::ToTH3(), and ana::UniqueName().

Referenced by ~NueCCIncCrossSectionAnalysis().

361  {
363  TH3F* hResult3D = (TH3F*)ana::ToTH3(*analysis3D,8.09e20,
365  binningx,binningy,
366  binningz,ana::EBinType::kBinContent);
367  TH2F* hResult2D = (TH2F*)hResult3D->Project3D("yx");
368  hResult2D->SetName(ana::UniqueName().c_str());
369  hResult3D->SetTitle("");
370  hResult3D->GetYaxis()->CenterTitle();
371  hResult3D->GetXaxis()->CenterTitle();
372  return hResult2D;
373  }
std::vector< float > Spectrum
Definition: Constants.h:610
Regular histogram.
Definition: UtilsExt.h:30
TH3 * ToTH3(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
Same as ToTH2, but with 3 dimensions.
Definition: UtilsExt.cxx:162
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
TH3F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getAnalysis3D ( Binning  binningx,
Binning  binnningy,
Binning  binningz 
)

Definition at line 342 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::kBinContent, ana::kPOT, SpectrumAnalysis(), and ana::ToTH3().

Referenced by ~NueCCIncCrossSectionAnalysis().

345  {
347  TH3F* hResult3D = (TH3F*)ana::ToTH3(*analysis3D,8.09e20,
349  binningx,binningy,
350  binningz,ana::EBinType::kBinContent);
351  hResult3D->SetTitle("");
352  hResult3D->GetYaxis()->CenterTitle();
353  hResult3D->GetXaxis()->CenterTitle();
354  hResult3D->GetZaxis()->CenterTitle();
355  return hResult3D;
356  }
std::vector< float > Spectrum
Definition: Constants.h:610
Regular histogram.
Definition: UtilsExt.h:30
TH3 * ToTH3(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
Same as ToTH2, but with 3 dimensions.
Definition: UtilsExt.cxx:162
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::getAnalysisSpectrumOnly ( )
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getEfficiency1D ( )

Definition at line 270 of file NueCCIncCrossSectionAnalysis.cxx.

References SpectrumEfficiency().

Referenced by ~NueCCIncCrossSectionAnalysis().

271  {
272  std::vector<Spectrum*> calc_efficiency =
274 
275  TH1F* hNumerator = (TH1F*)calc_efficiency[0]->ToTH1(8.09e20);
276  TH1F* hDenominator = (TH1F*)calc_efficiency[1]->ToTH1(8.09e20);
277 
278  hNumerator->Divide(hDenominator);
279  hNumerator->SetTitle("");
280  hNumerator->GetYaxis()->SetTitle("Efficiency");
281  hNumerator->GetYaxis()->CenterTitle();
282  hNumerator->GetXaxis()->CenterTitle();
283 
284  return hNumerator;
285  }
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getEfficiency1D ( Binning  binningx,
Binning  binningy,
std::string  outaxis 
)

Definition at line 287 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::kBinContent, ana::kPOT, SpectrumEfficiency(), ana::ToTH2(), and ana::UniqueName().

290  {
291  std::vector<Spectrum*> calc_efficiency =
293 
294  TH2F* hNumerator = (TH2F*)ana::ToTH2(*calc_efficiency[0],8.09e20,
296  binningx,binningy,
298  TH2F* hDenominator = (TH2F*)ana::ToTH2(*calc_efficiency[1],8.09e20,
300  binningx,binningy,
302 
303  hNumerator->Divide(hDenominator);
304  hNumerator->SetTitle("");
305  hNumerator->GetYaxis()->SetTitle("Efficiency");
306  hNumerator->GetYaxis()->CenterTitle();
307  hNumerator->GetXaxis()->CenterTitle();
308 
309  if(outaxis == "Y")
310  return (TH1F*)hNumerator->ProjectionY(ana::UniqueName().c_str());
311  if(outaxis == "X")
312  return (TH1F*)hNumerator->ProjectionX(ana::UniqueName().c_str());
313  else
314  return (TH1F*)hNumerator->ProjectionY(ana::UniqueName().c_str());
315  }
Regular histogram.
Definition: UtilsExt.h:30
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
TH2 * ToTH2(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
For use with Var2D.
Definition: UtilsExt.cxx:115
TH2F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getEfficiency2D ( Binning  binningx,
Binning  binningy 
)

Definition at line 318 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::kBinContent, ana::kPOT, SpectrumEfficiency(), and ana::ToTH2().

Referenced by ~NueCCIncCrossSectionAnalysis().

320  {
321  std::vector<Spectrum*> calc_efficiency =
323 
324  TH2F* hNumerator = (TH2F*)ana::ToTH2(*calc_efficiency[0],8.09e20,
326  binningx,binningy,
328  TH2F* hDenominator = (TH2F*)ana::ToTH2(*calc_efficiency[1],8.09e20,
330  binningx,binningy,
332 
333  hNumerator->Divide(hDenominator);
334  hNumerator->SetTitle("");
335  hNumerator->GetZaxis()->SetTitle("Efficiency");
336  hNumerator->GetYaxis()->CenterTitle();
337  hNumerator->GetXaxis()->CenterTitle();
338 
339  return hNumerator;
340  }
Regular histogram.
Definition: UtilsExt.h:30
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
TH2 * ToTH2(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
For use with Var2D.
Definition: UtilsExt.cxx:115
std::vector< TVector3 > ana::nueccinc::NueCCIncCrossSectionAnalysis::GetFiducialVolume ( )
private
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getFlux1D ( )

Definition at line 413 of file NueCCIncCrossSectionAnalysis.cxx.

References flux, SpectrumFlux(), and ana::Spectrum::ToTH1().

Referenced by ~NueCCIncCrossSectionAnalysis().

413  {
415  TH1F* hResult = (TH1F*)flux->ToTH1(8.09e20);
416  hResult->GetYaxis()->SetTitle("Flux / 8.09 #times 10^{20} POT / m^{2}");
417  hResult->GetYaxis()->CenterTitle();
418  hResult->GetXaxis()->CenterTitle();
419  return hResult;
420  }
Loaders::FluxType flux
std::vector< float > Spectrum
Definition: Constants.h:610
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getFullTemplate ( )

Definition at line 181 of file NueCCIncCrossSectionAnalysis.cxx.

References SpectrumTemplate(), and ana::Spectrum::ToTH1().

Referenced by ~NueCCIncCrossSectionAnalysis().

181  {
182  const Spectrum* template3D =
184  TH1F* hResult = (TH1F*)template3D->ToTH1(8.09e20);
185  hResult->SetTitle("");
186  hResult->GetYaxis()->SetTitle("Events/8.09 #times 10^{20} POT");
187  hResult->GetXaxis()->SetTitle("Electron Kinematic * Electron PID Bins");
188  hResult->GetYaxis()->CenterTitle();
189  hResult->GetXaxis()->CenterTitle();
190  return hResult;
191  }
std::vector< float > Spectrum
Definition: Constants.h:610
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getSelectedSignalPrediction1D ( )

Definition at line 444 of file NueCCIncCrossSectionAnalysis.cxx.

References efficiency(), and SpectrumEfficiency().

Referenced by ~NueCCIncCrossSectionAnalysis().

445  {
446  std::vector<Spectrum*> efficiency =
448 
449  TH1F* hResult = (TH1F*)efficiency[0]->ToTH1(8.09e20);
450  hResult->SetTitle("");
451  hResult->GetYaxis()->SetTitle("Selected Signal Events/8.09 #times 10^{20}POT");
452  hResult->GetYaxis()->CenterTitle();
453  hResult->GetXaxis()->CenterTitle();
454 
455  return hResult;
456  }
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
void efficiency()
Definition: efficiency.C:58
TH2F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getSelectedSignalPrediction2D ( Binning  binningx,
Binning  binningy 
)

Definition at line 459 of file NueCCIncCrossSectionAnalysis.cxx.

References efficiency(), ana::kBinContent, ana::kPOT, SpectrumEfficiency(), and ana::ToTH2().

Referenced by ~NueCCIncCrossSectionAnalysis().

461  {
462  std::vector<Spectrum*> efficiency =
464 
465  TH2F* hResult = (TH2F*)ana::ToTH2(*efficiency[0],8.09e20,
467  binningx,binningy,
469 
470  hResult->SetTitle("");
471  hResult->GetYaxis()->SetTitle("Selected Signal Events/8.09 #times 10^{20}POT");
472  hResult->GetYaxis()->CenterTitle();
473  hResult->GetXaxis()->CenterTitle();
474 
475  return hResult;
476  }
Regular histogram.
Definition: UtilsExt.h:30
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
void efficiency()
Definition: efficiency.C:58
TH2 * ToTH2(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
For use with Var2D.
Definition: UtilsExt.cxx:115
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplate ( int  xbin,
int  ybin,
Binning  binningx,
Binning  binnningy,
Binning  binningz 
)

Definition at line 160 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::kBinContent, ana::kPOT, SpectrumTemplate(), ana::ToTH3(), and ana::UniqueName().

Referenced by ~NueCCIncCrossSectionAnalysis().

164  {
165  const Spectrum* template3D =
167  TH3F* hResult3D = (TH3F*)ana::ToTH3(*template3D,8.09e20,
169  binningx,binningy,
170  binningz,ana::EBinType::kBinContent);
171  TH1F* hResult = (TH1F*)hResult3D->ProjectionZ(ana::UniqueName().c_str(),
172  xbin,xbin,ybin,ybin);
173  hResult->SetTitle("");
174  hResult->GetYaxis()->SetTitle("Events/8.09 #times 10^{20} POT");
175  hResult->GetXaxis()->SetTitle("Electron PID Bins");
176  hResult->GetYaxis()->CenterTitle();
177  hResult->GetXaxis()->CenterTitle();
178  return hResult;
179  }
std::vector< float > Spectrum
Definition: Constants.h:610
Regular histogram.
Definition: UtilsExt.h:30
TH3 * ToTH3(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
Same as ToTH2, but with 3 dimensions.
Definition: UtilsExt.cxx:162
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
TH3F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplate3D ( Binning  binningx,
Binning  binnningy,
Binning  binningz 
)

Definition at line 193 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::kBinContent, ana::kPOT, SpectrumTemplate(), and ana::ToTH3().

Referenced by ~NueCCIncCrossSectionAnalysis().

196  {
197  const Spectrum* template3D =
199  TH3F* hResult3D = (TH3F*)ana::ToTH3(*template3D,8.09e20,
201  binningx,binningy,
202  binningz,ana::EBinType::kBinContent);
203  return hResult3D;
204  }
std::vector< float > Spectrum
Definition: Constants.h:610
Regular histogram.
Definition: UtilsExt.h:30
TH3 * ToTH3(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
Same as ToTH2, but with 3 dimensions.
Definition: UtilsExt.cxx:162
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplateShapeOnly1D ( double  integral)

Definition at line 237 of file NueCCIncCrossSectionAnalysis.cxx.

References ana::Spectrum::GetBinnings(), ana::Spectrum::GetLabels(), febshutoff_auto::integral, ana::Spectrum::Integral(), ana::Spectrum::OverridePOT(), ana::Spectrum::POT(), SpectrumTemplate(), ana::Spectrum::ToTH1(), and ana::UniqueName().

Referenced by ~NueCCIncCrossSectionAnalysis().

238  {
239  const Spectrum* template3D =
241 
242  TH1* h1D = template3D->ToTH1(template3D->POT());
243  h1D->SetName(ana::UniqueName().c_str());
244  Spectrum hHolder = ana::Spectrum(h1D,
245  template3D->GetLabels(),
246  template3D->GetBinnings(),
247  template3D->POT(),
248  0);
249 
250  hHolder.OverridePOT(template3D->POT() * template3D->Integral(1)/integral);
251 
252  TH1F* hResult1D = (TH1F*)hHolder.ToTH1(8.09e20);
253  hResult1D->SetName(ana::UniqueName().c_str());
254 
255  // Spectrum spect = *template3D;
256  //spect.OverridePOT(template3D->POT() * template3D->Integral(1)/integral);
257  //TH1F* hResult1D = (TH1F*)spect.ToTH1(8.09e20);
258  return hResult1D;
259  }
std::vector< float > Spectrum
Definition: Constants.h:610
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
TH3F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getTemplateShapeOnly3D ( Binning  binningx,
Binning  binningy,
Binning  binningz,
double  integral 
)

Definition at line 206 of file NueCCIncCrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, ana::Spectrum::GetBinnings(), ana::Spectrum::GetLabels(), febshutoff_auto::integral, ana::Spectrum::Integral(), ana::kBinContent, ana::kPOT, ana::Spectrum::OverridePOT(), ana::Spectrum::POT(), SpectrumTemplate(), ana::Spectrum::ToTH1(), ana::ToTH3(), and ana::UniqueName().

Referenced by ~NueCCIncCrossSectionAnalysis().

210  {
211  const Spectrum* template3D =
213  TH1* h1D = template3D->ToTH1(template3D->POT());
214  h1D->SetName(ana::UniqueName().c_str());
215  Spectrum hHolder = ana::Spectrum(h1D,
216  template3D->GetLabels(),
217  template3D->GetBinnings(),
218  template3D->POT(),
219  0);
220  //_Spectrum (TH1 *h, const std::vector< std::string > &labels, const std::vector< Binning > &bins, double pot, double livetime)
221 
222  hHolder.OverridePOT(template3D->POT() * template3D->Integral(1)/integral);
223 
224  TH3F* hResult3D =
225  (TH3F*)ana::ToTH3(hHolder,
226  8.09e20,
228  binningx,binningy,
229  binningz,ana::EBinType::kBinContent);
230 
231  hResult3D->SetName(ana::UniqueName().c_str());
232  std::cout << template3D->Integral(8.09e20) << "\t"
233  << hHolder.Integral(8.09e20) << std::endl;
234  return hResult3D;
235  }
std::vector< float > Spectrum
Definition: Constants.h:610
Regular histogram.
Definition: UtilsExt.h:30
OStream cout
Definition: OStream.cxx:6
TH3 * ToTH3(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
Same as ToTH2, but with 3 dimensions.
Definition: UtilsExt.cxx:162
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getTrueSignalPrediction1D ( )

Definition at line 478 of file NueCCIncCrossSectionAnalysis.cxx.

References efficiency(), and SpectrumEfficiency().

Referenced by ~NueCCIncCrossSectionAnalysis().

479  {
480  std::vector<Spectrum*> efficiency =
482 
483  TH1F* hResult = (TH1F*)efficiency[1]->ToTH1(8.09e20);
484  hResult->SetTitle("");
485  hResult->GetYaxis()->SetTitle("True Signal Events/8.09 #times 10^{20}POT");
486  hResult->GetYaxis()->CenterTitle();
487  hResult->GetXaxis()->CenterTitle();
488 
489  return hResult;
490  }
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
void efficiency()
Definition: efficiency.C:58
TH2F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getTrueSignalPrediction2D ( Binning  binningx,
Binning  binningy 
)

Definition at line 493 of file NueCCIncCrossSectionAnalysis.cxx.

References efficiency(), ana::kBinContent, ana::kPOT, SpectrumEfficiency(), and ana::ToTH2().

Referenced by ~NueCCIncCrossSectionAnalysis().

495  {
496  std::vector<Spectrum*> efficiency =
498 
499  TH2F* hResult = (TH2F*)ana::ToTH2(*efficiency[1],8.09e20,
501  binningx,binningy,
503 
504  hResult->SetTitle("");
505  hResult->GetYaxis()->SetTitle("True Signal Events/8.09 #times 10^{20}POT");
506  hResult->GetYaxis()->CenterTitle();
507  hResult->GetXaxis()->CenterTitle();
508 
509  return hResult;
510  }
Regular histogram.
Definition: UtilsExt.h:30
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
void efficiency()
Definition: efficiency.C:58
TH2 * ToTH2(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
For use with Var2D.
Definition: UtilsExt.cxx:115
TH2F * ana::nueccinc::NueCCIncCrossSectionAnalysis::getUnfoldingMatrix ( std::string  dimension)

Definition at line 422 of file NueCCIncCrossSectionAnalysis.cxx.

References SpectrumUnfolding(), and ana::Spectrum::ToTH2().

Referenced by ~NueCCIncCrossSectionAnalysis().

423  {
424  Spectrum* unfolding =
426 
427  TH2F* hResult = (TH2F*)unfolding->ToTH2(8.09e20);
428 
429  if(dimension == "1D"){
430  hResult->GetXaxis()->SetTitle("Reco. Neutrino Energy (GeV)");
431  hResult->GetXaxis()->SetTitle("True Neutrino Energy (GeV)");
432  }
433  if(dimension == "2D"){
434  hResult->GetXaxis()->SetTitle("Reco. Electron Kinematics");
435  hResult->GetXaxis()->SetTitle("True Electron Kinematics");
436  }
437 
438  hResult->GetYaxis()->CenterTitle();
439  hResult->GetXaxis()->CenterTitle();
440 
441  return hResult;
442  }
std::vector< float > Spectrum
Definition: Constants.h:610
std::unique_ptr< NueCCIncCrossSectionAnalysis > ana::nueccinc::NueCCIncCrossSectionAnalysis::LoadFrom ( TDirectory *  dir)
static

Definition at line 736 of file NueCCIncCrossSectionAnalysis.cxx.

References flux, NueCCIncCrossSectionAnalysis(), and runNovaSAM::release.

Referenced by ~NueCCIncCrossSectionAnalysis(), ana::nueccinc::NueCCIncCrossSectionTemplates::~NueCCIncCrossSectionTemplates(), and ana::nueccinc::NueCCIncEnhancedSamples::~NueCCIncEnhancedSamples().

737  {
738  Spectrum* analysis = ana::LoadFrom<Spectrum>
739  (dir->GetDirectory("fAnalysis3D")).release();
740 
741  Spectrum* templates = ana::LoadFrom<Spectrum>
742  (dir->GetDirectory("fTemplate3D")).release();
743 
744  Spectrum* mcsig1D= ana::LoadFrom<Spectrum>
745  (dir->GetDirectory("fAnalysisSig1D")).release();
746 
747  Spectrum* mcsignutree1D = ana::LoadFrom<Spectrum>
748  (dir->GetDirectory("fAnalysisSigNuTree1D")).release();
749 
750  Spectrum* mcsig2D= ana::LoadFrom<Spectrum>
751  (dir->GetDirectory("fAnalysisSig2D")).release();
752 
753  Spectrum* mcsignutree2D = ana::LoadFrom<Spectrum>
754  (dir->GetDirectory("fAnalysisSigNuTree2D")).release();
755 
756  Spectrum* unfolding1D = ana::LoadFrom<Spectrum>
757  (dir->GetDirectory("fUnfolding1D")).release();
758 
759  Spectrum* unfolding2D = ana::LoadFrom<Spectrum>
760  (dir->GetDirectory("fUnfolding2D")).release();
761 
762  TVector3* min = (TVector3*)dir->Get("fFidMin");
763 
764  TVector3* max = (TVector3*)dir->Get("fFidMax");
765 
766  Spectrum* flux = ana::LoadFrom<Spectrum>
767  (dir->GetDirectory("fFlux")).release();
768 
769  return std::unique_ptr<NueCCIncCrossSectionAnalysis>(
770  new NueCCIncCrossSectionAnalysis(*analysis,*templates,*mcsig1D,*mcsignutree1D,*mcsig2D,*mcsignutree2D,*unfolding1D,*unfolding2D,*min, *max, flux));
771  }
NueCCIncCrossSectionAnalysis(SpectrumLoaderBase &lLoad, HistAxis yAxis, HistAxis xAxis, HistAxis zAxis, HistAxis recoAxis2D, NuTruthHistAxis efficiencyAxis2D, NuTruthHistAxis efficiencyAxis1D, HistAxis pidAxis, Binning fluxBins, Cut selection, NuTruthCut isSig, TVector3 min, TVector3 max, SystShifts shift, NuTruthVar weiNT, Var wei)
Loaders::FluxType flux
std::vector< float > Spectrum
Definition: Constants.h:610
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
TDirectory * dir
Definition: macro.C:5
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnAnalysisSigNuTreeSpectrum1D ( )

Definition at line 791 of file NueCCIncCrossSectionAnalysis.cxx.

References fillBadChanDBTables::result, and SpectrumEfficiency().

Referenced by ~NueCCIncCrossSectionAnalysis().

792  {
793  std::vector<Spectrum*> result =
795  return(*(result[1]));
796  }
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnAnalysisSigNuTreeSpectrum2D ( )

Definition at line 803 of file NueCCIncCrossSectionAnalysis.cxx.

References fillBadChanDBTables::result, and SpectrumEfficiency().

Referenced by ~NueCCIncCrossSectionAnalysis().

804  {
805  std::vector<Spectrum*> result =
807  return(*(result[1]));
808  }
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnAnalysisSigSpectrum1D ( )

Definition at line 784 of file NueCCIncCrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, fillBadChanDBTables::result, and SpectrumEfficiency().

Referenced by ~NueCCIncCrossSectionAnalysis().

785  {
786  std::vector<Spectrum*> result =
788  std::cout << result.size() << std::endl;
789  return(*(result[0]));
790  }
OStream cout
Definition: OStream.cxx:6
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnAnalysisSigSpectrum2D ( )

Definition at line 797 of file NueCCIncCrossSectionAnalysis.cxx.

References fillBadChanDBTables::result, and SpectrumEfficiency().

Referenced by ~NueCCIncCrossSectionAnalysis().

798  {
799  std::vector<Spectrum*> result =
801  return(*(result[0]));
802  }
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnAnalysisSpectrum ( )
std::vector< TVector3 > ana::nueccinc::NueCCIncCrossSectionAnalysis::returnFiducialVectors ( )
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnFluxSpectrum ( )

Definition at line 821 of file NueCCIncCrossSectionAnalysis.cxx.

References fillBadChanDBTables::result, and SpectrumFlux().

Referenced by ~NueCCIncCrossSectionAnalysis().

822  {
823  Spectrum* result =
825  return(*result);
826  }
std::vector< float > Spectrum
Definition: Constants.h:610
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnTemplateSpectrum ( )
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnUnfoldingSpectrum1D ( )

Definition at line 809 of file NueCCIncCrossSectionAnalysis.cxx.

References fillBadChanDBTables::result, and SpectrumUnfolding().

Referenced by ~NueCCIncCrossSectionAnalysis().

810  {
811  Spectrum* result =
813  return(*result);
814  }
std::vector< float > Spectrum
Definition: Constants.h:610
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::returnUnfoldingSpectrum2D ( )

Definition at line 815 of file NueCCIncCrossSectionAnalysis.cxx.

References fillBadChanDBTables::result, and SpectrumUnfolding().

Referenced by ~NueCCIncCrossSectionAnalysis().

816  {
817  Spectrum* result =
819  return(*result);
820  }
std::vector< float > Spectrum
Definition: Constants.h:610
void ana::nueccinc::NueCCIncCrossSectionAnalysis::SaveTo ( TDirectory *  dir) const

Definition at line 714 of file NueCCIncCrossSectionAnalysis.cxx.

References fAnalysis3D, fAnalysisSig1D, fAnalysisSig2D, fAnalysisSigNuTree1D, fAnalysisSigNuTree2D, fFidMax, fFidMin, fFlux, fTemplate3D, fUnfolding1D, fUnfolding2D, ana::Spectrum::SaveTo(), and tmp.

Referenced by ~NueCCIncCrossSectionAnalysis(), ana::nueccinc::NueCCIncCrossSectionTemplates::~NueCCIncCrossSectionTemplates(), and ana::nueccinc::NueCCIncEnhancedSamples::~NueCCIncEnhancedSamples().

714  {
715  TDirectory *tmp = gDirectory;
716  dir->cd();
717  TObjString("NueCCIncCrossSectionAnalysis").Write("type");
718 
719 
720  fAnalysis3D.SaveTo(dir->mkdir("fAnalysis3D"));
721  fTemplate3D.SaveTo(dir->mkdir("fTemplate3D"));
722  fAnalysisSig1D.SaveTo(dir->mkdir("fAnalysisSig1D"));
723  fAnalysisSigNuTree1D.SaveTo(dir->mkdir("fAnalysisSigNuTree1D"));
724  fAnalysisSig2D.SaveTo(dir->mkdir("fAnalysisSig2D"));
725  fAnalysisSigNuTree2D.SaveTo(dir->mkdir("fAnalysisSigNuTree2D"));
726  fUnfolding1D.SaveTo(dir->mkdir("fUnfolding1D"));
727  fUnfolding2D.SaveTo(dir->mkdir("fUnfolding2D"));
728  fFidMin.Write("fFidMin");
729  fFidMax.Write("fFidMax");
730  fFlux->SaveTo(dir->mkdir("fFlux"));
731  tmp->cd();
732  return;
733  }
Float_t tmp
Definition: plot.C:36
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
TDirectory * dir
Definition: macro.C:5
Spectrum * ana::nueccinc::NueCCIncCrossSectionAnalysis::SpectrumAnalysis ( )
private
std::vector< Spectrum * > ana::nueccinc::NueCCIncCrossSectionAnalysis::SpectrumEfficiency ( std::string  dimension)
private
Spectrum * ana::nueccinc::NueCCIncCrossSectionAnalysis::SpectrumFlux ( )
private
Spectrum * ana::nueccinc::NueCCIncCrossSectionAnalysis::SpectrumTemplate ( )
private
Spectrum * ana::nueccinc::NueCCIncCrossSectionAnalysis::SpectrumUnfolding ( std::string  dimension)
private

Definition at line 138 of file NueCCIncCrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, fUnfolding1D, and fUnfolding2D.

Referenced by AddEnhancedSample(), doUnfolding1D(), doUnfolding2D(), getUnfoldingMatrix(), NueCCIncCrossSectionAnalysis(), returnUnfoldingSpectrum1D(), and returnUnfoldingSpectrum2D().

139  {
140  if( dimension == "1D")
141  return &fUnfolding1D;
142  if( dimension == "2D")
143  return &fUnfolding2D;
144  else{
145  std::cout << dimension << "\tNot a supported option\n" <<
146  "Returning the 2D Unfolding Matrix Regardless" << std::endl;
147  return &fUnfolding2D;
148  }
149  }
OStream cout
Definition: OStream.cxx:6
TH1F * ana::nueccinc::NueCCIncCrossSectionAnalysis::UnfoldHist ( TH1F *  data_hist_1D,
TH2F *  hUnfoldingMatrix,
int  iterations 
)

Definition at line 551 of file NueCCIncCrossSectionAnalysis.cxx.

References MECModelEnuComparisons::i, std::sqrt(), and ana::UniqueName().

Referenced by doUnfolding1D(), doUnfolding2D(), and ~NueCCIncCrossSectionAnalysis().

554  {
555  //Holder until I can figure out what is wrong with including RooUnfold
556  TH1D* true_mc_spect =
557  (TH1D*)hUnfoldingMatrix->ProjectionY(ana::UniqueName().c_str());
558  TH1D* reco_mc_spect =
559  (TH1D*)hUnfoldingMatrix->ProjectionX(ana::UniqueName().c_str());
560  TH1D* data_in = (TH1D*)data_hist_1D->Clone(ana::UniqueName().c_str());
561  TH2D* hResponse = (TH2D*)hUnfoldingMatrix->Clone(ana::UniqueName().c_str());
562  /*
563  RooUnfoldResponse ResponseMatrix(0,0,hUnfoldingMatrix, "ResponseMatrix");
564  ResponseMatrix.UseOverflow(0);
565  RooUnfoldSvd unfold(&ResponseMatrix, data_hist_1D, iterations);
566  TH1F* hResult = (TH1F*)unfold.Hreco();
567 
568  return hResult;
569  */
570 
571  TSVDUnfold *tsvdunf = new TSVDUnfold( data_in,reco_mc_spect,
572  true_mc_spect,hResponse);
573  TH1F* hResult = (TH1F*)tsvdunf->Unfold(iterations);
574  TH2D* hCovMat = tsvdunf->GetBCov();
575 
576  for(int i = 1; i < hResult->GetNbinsX(); i++){
577  hResult->SetBinError(i,sqrt(hCovMat->GetBinContent(i,i)));
578  }
579 
580 
581  delete true_mc_spect;
582  delete reco_mc_spect;
583  delete data_in;
584  delete hResponse;
585  delete tsvdunf;
586 
587  return hResult;
588 
589  }
T sqrt(T number)
Definition: d0nt_math.hpp:156
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
Long64_t iterations[nThreads]
Definition: PhotonSim_mp.C:71

Member Data Documentation

Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::fAnalysis3D
private

Definition at line 151 of file NueCCIncCrossSectionAnalysis.h.

Referenced by SaveTo(), and SpectrumAnalysis().

Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::fAnalysisSig1D
private
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::fAnalysisSig2D
private
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::fAnalysisSigNuTree1D
private
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::fAnalysisSigNuTree2D
private
TVector3 ana::nueccinc::NueCCIncCrossSectionAnalysis::fFidMax
private

Definition at line 161 of file NueCCIncCrossSectionAnalysis.h.

Referenced by GetFiducialVolume(), and SaveTo().

TVector3 ana::nueccinc::NueCCIncCrossSectionAnalysis::fFidMin
private

Definition at line 160 of file NueCCIncCrossSectionAnalysis.h.

Referenced by GetFiducialVolume(), and SaveTo().

Spectrum* ana::nueccinc::NueCCIncCrossSectionAnalysis::fFlux
private

Definition at line 163 of file NueCCIncCrossSectionAnalysis.h.

Referenced by SaveTo(), and SpectrumFlux().

Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::fTemplate3D
private

Definition at line 152 of file NueCCIncCrossSectionAnalysis.h.

Referenced by SaveTo(), and SpectrumTemplate().

Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::fUnfolding1D
private
Spectrum ana::nueccinc::NueCCIncCrossSectionAnalysis::fUnfolding2D
private

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