Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ana::TrivialCrossSectionAnalysis Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-01/CAFAna/XSec/TrivialCrossSectionAnalysis.h"

Inheritance diagram for ana::TrivialCrossSectionAnalysis:
ana::ICrossSectionAnalysis

Public Types

enum  UnfoldMethod_t {
  kNone, kIterative, kTikhonov, kSVD,
  kMaxEnt, RooUnfold, TUnfold
}
 enum for unfolding methods More...
 

Public Member Functions

 TrivialCrossSectionAnalysis ()
 default constructor. Do nothing More...
 
 TrivialCrossSectionAnalysis (const Cut &, const HistAxis *, const NuTruthCut &, const NuTruthHistAxis *, TVector3, TVector3, const Binning *, std::vector< Cut >, int, bool)
 minimum working constructor. Other properties need to be set manually after More...
 
void InitPPFXUniverses (SpectrumLoaderBase *, std::vector< Var >, std::vector< NuTruthVar >)
 
void InitGenieUniverses (SpectrumLoaderBase *, std::vector< SystShifts >)
 
void InitSystematicSpectra (XSecSysts::Syst_t, SpectrumLoaderBase *)
 
void InitSystematicSpectra (XSecSysts::Syst_t, SpectrumLoaderBase *, const Var *, const NuTruthVar *, const SystShifts *)
 
TH1 * RelativeUncertainty (XSecSysts::Syst_t) override
 Function that calculates relative uncertainty on the cross section result. More...
 
std::pair< TH1 *, TH1 * > TotalErrors () override
 
std::pair< TH1 *, TH1 * > FluxError () override
 Function that calculates the up (first) and down (second) error on the flux estimation. More...
 
TH1 * Flux (XSecSysts::Syst_t) override
 
TH1 * Efficiency (XSecSysts::Syst_t) override
 
std::pair< TH1 *, TH1 * > GenieError ()
 Function that calculates the up (first) and down (second) error on the genie universes. More...
 
TH1 * Purity (XSecSysts::Syst_t) override
 Function that returns the purity of the specified sample. More...
 
void SaveTo (TDirectory *, const std::string &name) const override
 
ICrossSectionAnalysisClone () const override
 
TrivialCrossSectionAnalysisoperator= (const TrivialCrossSectionAnalysis &)
 
TrivialCrossSectionAnalysisoperator= (TrivialCrossSectionAnalysis &&)
 
 TrivialCrossSectionAnalysis (const TrivialCrossSectionAnalysis &)
 
 TrivialCrossSectionAnalysis (TrivialCrossSectionAnalysis &&)
 
 ~TrivialCrossSectionAnalysis ()
 
const CrossSectionSpectraGetCrossSectionSpectra (XSecSysts::Syst_t)
 
const SpectrumSignalEstimate (XSecSysts::Syst_t)
 
const TargetCountGetTarget ()
 
const TVector3 * GetFidMax ()
 
const TVector3 * GetFixMin ()
 
void SetWeight (XSecSysts::Syst_t, const Var *)
 
void SetNuTruthWeight (XSecSysts::Syst_t, const NuTruthVar *)
 
void SetSystShifts (XSecSysts::Syst_t, const SystShifts *)
 
void InitSystematicSpectra (XSecSysts::Syst_t, CrossSectionSpectra *)
 
void InitSystematicSpectra (XSecSysts::Syst_t, SpectrumLoaderBase *, ISignalEstimator *)
 
void InitSystematicSpectra (XSecSysts::Syst_t, ReweightableSpectrum *, ISignalEstimator *, Spectrum *, Spectrum *, Spectrum *, Spectrum *, Spectrum *)
 
void InitDataSpectrum (SpectrumLoaderBase *)
 
void SetData (Spectrum *)
 
void SetSelectionCut (const Cut *)
 
void SetSignalCut (const NuTruthCut *)
 
void SetAxis (const HistAxis *)
 
void SetAxisNT (const NuTruthHistAxis *)
 
void SetTarget (TargetCount)
 
void SetFidMax (TVector3)
 
void SetFidMin (TVector3)
 
void SetUnfoldingMethod (UnfoldMethod_t)
 
void SetUnfoldingReg (double)
 
void SetPOT (double)
 
void CalculateCrossSections ()
 
const TH1 * UnfoldedSignal (XSecSysts::Syst_t)
 
TH1 * GetCrossSection (XSecSysts::Syst_t)
 
double NTargets ()
 
int NDimensions ()
 

Static Public Member Functions

static std::unique_ptr< TrivialCrossSectionAnalysisLoadFrom (TDirectory *, const std::string &name)
 
static Spectrum GetGeniePrediction ()
 

Protected Member Functions

TH1 * CrossSection (XSecSysts::Syst_t)
 
TH1 * ToHist (const Spectrum &, double=-1)
 
void DivideByBinWidth (TH1 *)
 
void DX (TH1 *)
 
void DXDY (TH1 *)
 
void DXDYDZ (TH1 *)
 
bool HasENuBinning () const
 
bool HasPDG () const
 
bool HasWeights () const
 
bool HasNuTruthWeights () const
 
bool HasSystShifts () const
 
bool HasData () const
 
bool HasSpectra () const
 
bool HasXSecs () const
 
bool HasUnfoldMethod () const
 
bool HasUnfoldReg () const
 
bool HasDimensions () const
 
bool HasSignalCut () const
 
bool HasSelectionCut () const
 
bool HasRecoAxis () const
 
bool HasTruthAxis () const
 
bool HasFiducialVolume () const
 
bool CanFillSpectra () const
 
bool CanCalculateCrossSection () const
 
CutCopy (const Cut *)
 
NuTruthCutCopy (const NuTruthCut *)
 
HistAxisCopy (const HistAxis *)
 
NuTruthHistAxisCopy (const NuTruthHistAxis *)
 
VarCopy (const Var *)
 
NuTruthVarCopy (const NuTruthVar *)
 
SystShiftsCopy (const SystShifts *)
 

Protected Attributes

std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
 
std::map< XSecSysts::Syst_t, const Var * > fWeights
 
std::map< XSecSysts::Syst_t, const NuTruthVar * > fNuTruthWeights
 
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
 
std::map< XSecSysts::Syst_t, TH1 * > fXSec
 
const SpectrumfData = NULL
 
TargetCount fTarget
 
TVector3 fFidMax
 
TVector3 fFidMin
 
const CutfSelectionCut = NULL
 
const HistAxisfRecoAxis = NULL
 
const NuTruthCutfSignalCut = NULL
 
const NuTruthHistAxisfTruthAxis = NULL
 
UnfoldMethod_t fUnfoldMethod = kNone
 
double fUnfoldReg = 0
 
int fPDG = 0
 
const BinningfENuBinning = NULL
 
int fNDims = 0
 
bool fIsDifferential
 
double fPOT
 

Private Member Functions

 TrivialCrossSectionAnalysis (Spectrum *, std::map< XSecSysts::Syst_t, CrossSectionSpectra * >, Multiverse *, Multiverse *, Multiverse *, Multiverse *, Multiverse *, TVector3 *, TVector3 *, TVectorD *, bool)
 

Private Attributes

bool fHasGenieMultiverses = false
 
bool fHasPPFXMultiverses = false
 
std::vector< TH1 * > fPPFXXSec
 
std::vector< TH1 * > fGenieXSec
 
MultiversefGenieMVEffNum = NULL
 
MultiversefGenieMVEffDenom = NULL
 
MultiversefPPFXMVFlux = NULL
 
MultiversefPPFXMVEffNum = NULL
 
MultiversefPPFXMVEffDenom = NULL
 
std::vector< CutfBkgdCuts
 

Detailed Description

Definition at line 9 of file TrivialCrossSectionAnalysis.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

ana::TrivialCrossSectionAnalysis::TrivialCrossSectionAnalysis ( )
inline
ana::TrivialCrossSectionAnalysis::TrivialCrossSectionAnalysis ( const Cut selection_cut,
const HistAxis reco_axis,
const NuTruthCut signal_cut,
const NuTruthHistAxis truth_axis,
TVector3  fid_max,
TVector3  fid_min,
const Binning enu_binning,
std::vector< Cut bkgd_cuts,
int  pdg,
bool  is_differential 
)

minimum working constructor. Other properties need to be set manually after

Definition at line 129 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fENuBinning, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, ana::ICrossSectionAnalysis::fIsDifferential, ana::ICrossSectionAnalysis::fNDims, ana::ICrossSectionAnalysis::fPDG, ana::ICrossSectionAnalysis::fRecoAxis, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fTarget, ana::ICrossSectionAnalysis::fTruthAxis, ana::LabelsAndBins::NDimensions(), and make_root_from_grid_output::pdg.

139  : fBkgdCuts(bkgd_cuts)
140  {
141  this->fPDG = pdg;
142  this->fENuBinning = enu_binning;
143  this->fFidMax = fid_max;
144  this->fFidMin = fid_min;
145  this->fTarget = TargetCount(fFidMin, fFidMax, 1e6);
146  this->fSelectionCut = new Cut(selection_cut);
147  this->fSignalCut = new NuTruthCut(signal_cut);
148  this->fRecoAxis = reco_axis;
149  this->fTruthAxis = truth_axis;
150  this->fNDims = fRecoAxis->NDimensions();
151  this->fIsDifferential = is_differential;
152  }
_Cut< caf::SRNeutrinoProxy > NuTruthCut
Cut designed to be used over the nuTree, ie all neutrinos, not just those that got slices...
Definition: Cut.h:104
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
Definition: Cut.h:96
unsigned int NDimensions() const
Definition: LabelsAndBins.h:66
const NuTruthHistAxis * fTruthAxis
ana::TrivialCrossSectionAnalysis::TrivialCrossSectionAnalysis ( const TrivialCrossSectionAnalysis rhs)

Definition at line 633 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::Copy(), ana::ICrossSectionAnalysis::fData, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, fGenieMVEffDenom, fGenieMVEffNum, fGenieXSec, ana::ICrossSectionAnalysis::fIsDifferential, ana::ICrossSectionAnalysis::fNDims, fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, fPPFXXSec, ana::ICrossSectionAnalysis::fRecoAxis, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fSystShifts, ana::ICrossSectionAnalysis::fTarget, ana::ICrossSectionAnalysis::fTruthAxis, ana::ICrossSectionAnalysis::fUnfoldMethod, ana::ICrossSectionAnalysis::fUnfoldReg, ana::ICrossSectionAnalysis::fWeights, ana::ICrossSectionAnalysis::fXSecSpectra, genie, ana::weight, and xsec.

634  {
635  std::for_each(rhs.fXSecSpectra.begin(), rhs.fXSecSpectra.end(),
636  [this](std::pair<XSecSysts::Syst_t, CrossSectionSpectra*> xsec)
637  {
638  this->fXSecSpectra
639  .insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra*>
640  (xsec.first,
641  new CrossSectionSpectra(*xsec.second)));
642  });
643 
644  std::for_each(rhs.fWeights.begin(), rhs.fWeights.end(),
645  [this](std::pair<XSecSysts::Syst_t, const Var *> weight)
646  {
647  this->fWeights
648  .insert(std::pair<XSecSysts::Syst_t, const Var *>
649  (weight.first,
650  Copy(weight.second)));
651  });
652 
653  std::for_each(rhs.fSystShifts.begin(), rhs.fSystShifts.end(),
654  [this](std::pair<XSecSysts::Syst_t, const SystShifts *> shift)
655  {
656  this->fSystShifts
657  .insert(std::pair<XSecSysts::Syst_t, const SystShifts *>
658  (shift.first,
659  Copy(shift.second)));
660  });
661 
662  this->fTarget = rhs.fTarget;
663  this->fFidMax = rhs.fFidMax;
664  this->fFidMin = rhs.fFidMin;
665  this->fSelectionCut = Copy(rhs.fSelectionCut);
666  this->fSignalCut = Copy(rhs.fSignalCut);
667  this->fRecoAxis = Copy(rhs.fRecoAxis);
668  this->fTruthAxis = Copy(rhs.fTruthAxis);
669  this->fUnfoldMethod = rhs.fUnfoldMethod;
670  this->fUnfoldReg = rhs.fUnfoldReg;
671  this->fNDims = rhs.fNDims;
672  this->fIsDifferential = rhs.fIsDifferential;
673  if(rhs.fPPFXXSec.size() != 0) {
674  std::for_each(rhs.fPPFXXSec.begin(), rhs.fPPFXXSec.end(),
675  [this](TH1 * ppfx)
676  {
677  this->fPPFXXSec.push_back((TH1*) ppfx->Clone());
678  });
679  }
680  if(rhs.fGenieXSec.size() != 0) {
681  std::for_each(rhs.fGenieXSec.begin(), rhs.fGenieXSec.end(),
682  [this](TH1 * genie)
683  {
684  this->fGenieXSec.push_back((TH1*) genie->Clone());
685  });
686  }
687  this->fGenieMVEffNum = new Multiverse(*rhs.fGenieMVEffNum);
688  this->fGenieMVEffDenom = new Multiverse(*rhs.fGenieMVEffDenom);
689  this->fPPFXMVFlux = new Multiverse(*rhs.fPPFXMVFlux);
690  this->fPPFXMVEffNum = new Multiverse(*rhs.fPPFXMVEffNum);
691  this->fPPFXMVEffDenom = new Multiverse(*rhs.fPPFXMVEffDenom);
692  this->fData = new Spectrum(*rhs.fData);
693  }
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
const Var weight
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
std::vector< float > Spectrum
Definition: Constants.h:610
Double_t xsec[nknots]
Definition: testXsec.C:47
std::map< XSecSysts::Syst_t, const Var * > fWeights
TGraph * genie
Definition: Xsec_final.C:116
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
const NuTruthHistAxis * fTruthAxis
ana::TrivialCrossSectionAnalysis::TrivialCrossSectionAnalysis ( TrivialCrossSectionAnalysis &&  rhs)

Definition at line 563 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fData, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, fGenieMVEffDenom, fGenieMVEffNum, fGenieXSec, ana::ICrossSectionAnalysis::fIsDifferential, ana::ICrossSectionAnalysis::fNDims, fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, fPPFXXSec, ana::ICrossSectionAnalysis::fRecoAxis, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fSystShifts, ana::ICrossSectionAnalysis::fTarget, ana::ICrossSectionAnalysis::fTruthAxis, ana::ICrossSectionAnalysis::fUnfoldMethod, ana::ICrossSectionAnalysis::fUnfoldReg, ana::ICrossSectionAnalysis::fWeights, ana::ICrossSectionAnalysis::fXSecSpectra, genie, ana::weight, and xsec.

564  {
565  std::for_each(rhs.fXSecSpectra.begin(), rhs.fXSecSpectra.end(),
566  [this](std::pair<XSecSysts::Syst_t, CrossSectionSpectra*> xsec)
567  {
568  this->fXSecSpectra
569  .insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra*>
570  (xsec.first,
571  xsec.second));
572  xsec.second = NULL;
573  });
574 
575  std::for_each(rhs.fWeights.begin(), rhs.fWeights.end(),
576  [this](std::pair<XSecSysts::Syst_t, const Var *> weight)
577  {
578  this->fWeights
579  .insert(std::pair<XSecSysts::Syst_t, const Var *>
580  (weight.first,
581  weight.second));
582  weight.second = NULL;
583  });
584 
585  std::for_each(rhs.fSystShifts.begin(), rhs.fSystShifts.end(),
586  [this](std::pair<XSecSysts::Syst_t, const SystShifts *> shift)
587  {
588  this->fSystShifts
589  .insert(std::pair<XSecSysts::Syst_t, const SystShifts *>
590  (shift.first,
591  shift.second));
592  shift.second = NULL;
593  });
594 
595  this->fTarget = rhs.fTarget;
596  this->fFidMax = rhs.fFidMax;
597  this->fFidMin = rhs.fFidMin;
598  this->fSelectionCut = rhs.fSelectionCut; rhs.fSelectionCut = NULL;
599  this->fRecoAxis = rhs.fRecoAxis; rhs.fRecoAxis = NULL;
600  this->fSignalCut = rhs.fSignalCut; rhs.fSignalCut = NULL;
601  this->fTruthAxis = rhs.fTruthAxis; rhs.fTruthAxis = NULL;
602  this->fUnfoldMethod = rhs.fUnfoldMethod;
603  this->fUnfoldReg = rhs.fUnfoldReg;
604  this->fNDims = rhs.fNDims;
605  this->fIsDifferential = rhs.fIsDifferential;
606  if(rhs.fPPFXXSec.size() != 0) {
607  std::for_each(rhs.fPPFXXSec.begin(), rhs.fPPFXXSec.end(),
608  [this](TH1 * ppfx)
609  {
610  this->fPPFXXSec.push_back(ppfx);
611  ppfx = NULL;
612  });
613  }
614  if(rhs.fGenieXSec.size() != 0) {
615  std::for_each(rhs.fGenieXSec.begin(), rhs.fGenieXSec.end(),
616  [this](TH1 * genie)
617  {
618  this->fGenieXSec.push_back(genie);
619  genie = NULL;
620  });
621  }
622 
623  this->fGenieMVEffNum = rhs.fGenieMVEffNum; rhs.fGenieMVEffNum = NULL;
624  this->fGenieMVEffDenom = rhs.fGenieMVEffDenom; rhs.fGenieMVEffDenom = NULL;
625  this->fPPFXMVFlux = rhs.fPPFXMVFlux; rhs.fPPFXMVFlux = NULL;
626  this->fPPFXMVEffNum = rhs.fPPFXMVEffNum; rhs.fPPFXMVEffNum = NULL;
627  this->fPPFXMVEffDenom = rhs.fPPFXMVEffDenom; rhs.fPPFXMVEffDenom = NULL;
628  this->fData = rhs.fData; rhs.fData = NULL;
629  }
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
const Var weight
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
Double_t xsec[nknots]
Definition: testXsec.C:47
std::map< XSecSysts::Syst_t, const Var * > fWeights
TGraph * genie
Definition: Xsec_final.C:116
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
const NuTruthHistAxis * fTruthAxis
ana::TrivialCrossSectionAnalysis::~TrivialCrossSectionAnalysis ( )

Definition at line 739 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fData, fGenieMVEffDenom, fGenieMVEffNum, fGenieXSec, fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, fPPFXXSec, and makeTrainCVSamples::int.

Referenced by TrivialCrossSectionAnalysis().

740  {
741  for(int ipxsec = 0; ipxsec < (int) fPPFXXSec.size(); ipxsec++) {
742  delete fPPFXXSec[ipxsec];
743  }
744  for(int igxsec = 0; igxsec < (int) fGenieXSec.size(); igxsec++) {
745  delete fGenieXSec[igxsec];
746  }
747  delete fData;
748  delete fGenieMVEffNum;
749  delete fGenieMVEffDenom;
750  delete fPPFXMVEffNum;
751  delete fPPFXMVEffDenom;
752  delete fPPFXMVFlux;
753  }
ana::TrivialCrossSectionAnalysis::TrivialCrossSectionAnalysis ( Spectrum data,
std::map< XSecSysts::Syst_t, CrossSectionSpectra * >  _fXSecSpectra,
Multiverse ppfx_mv_flux,
Multiverse ppfx_mv_eff_num,
Multiverse ppfx_mv_eff_denom,
Multiverse genie_mv_eff_num,
Multiverse genie_mv_eff_denom,
TVector3 *  _fFidMax,
TVector3 *  _fFidMin,
TVectorD ndims,
bool  isdifferential 
)
private

Definition at line 697 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fData, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, fGenieMVEffDenom, fGenieMVEffNum, ana::ICrossSectionAnalysis::fIsDifferential, ana::ICrossSectionAnalysis::fNDims, fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, ana::ICrossSectionAnalysis::fXSecSpectra, and xsec.

708  {
709  this->fData = data;
710  std::for_each(_fXSecSpectra.begin(), _fXSecSpectra.end(),
711  [this](std::pair<XSecSysts::Syst_t, CrossSectionSpectra*> xsec)
712  {
713  this->fXSecSpectra
714  .insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra*>
715  (xsec.first,
716  xsec.second));
717  });
718  this->fFidMax = *_fFidMax;
719  this->fFidMin = *_fFidMin;
720  this->fNDims = (*ndims)[0];
721  this->fIsDifferential = isdifferential;
722  this->fGenieMVEffNum = genie_mv_eff_num;
723  this->fGenieMVEffDenom = genie_mv_eff_denom;
724  this->fPPFXMVFlux = ppfx_mv_flux;
725  this->fPPFXMVEffNum = ppfx_mv_eff_num;
726  this->fPPFXMVEffDenom = ppfx_mv_eff_denom;
727 
728  for(std::pair<XSecSysts::Syst_t, CrossSectionSpectra *> xsec : _fXSecSpectra)
729  if(xsec.second != NULL)
730  xsec.second = NULL;
731  genie_mv_eff_num = NULL;
732  genie_mv_eff_denom = NULL;
733  ppfx_mv_flux = NULL;
734  ppfx_mv_eff_num = NULL;
735  ppfx_mv_eff_denom = NULL;
736  }
const XML_Char const XML_Char * data
Definition: expat.h:268
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
Double_t xsec[nknots]
Definition: testXsec.C:47

Member Function Documentation

void ana::ICrossSectionAnalysis::CalculateCrossSections ( )
inherited

Definition at line 25 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::CrossSection(), ana::ICrossSectionAnalysis::fXSec, ana::ICrossSectionAnalysis::fXSecSpectra, and xsec.

Referenced by demo_trivial_xsec_analysis().

26  {
27  std::for_each(fXSecSpectra.begin(), fXSecSpectra.end(),
28  [this](std::pair<XSecSysts::Syst_t, CrossSectionSpectra*> xsec)
29  {
30  this->fXSec
31  .insert(std::pair<XSecSysts::Syst_t, TH1 *>
32  (xsec.first,
33  CrossSection(xsec.first)));
34  });
35  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
TH1 * CrossSection(XSecSysts::Syst_t)
Double_t xsec[nknots]
Definition: testXsec.C:47
std::map< XSecSysts::Syst_t, TH1 * > fXSec
bool ana::ICrossSectionAnalysis::CanCalculateCrossSection ( ) const
protectedinherited
bool ana::ICrossSectionAnalysis::CanFillSpectra ( ) const
protectedinherited

Definition at line 109 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::HasFiducialVolume(), ana::ICrossSectionAnalysis::HasNuTruthWeights(), ana::ICrossSectionAnalysis::HasRecoAxis(), ana::ICrossSectionAnalysis::HasSelectionCut(), ana::ICrossSectionAnalysis::HasSignalCut(), ana::ICrossSectionAnalysis::HasSystShifts(), ana::ICrossSectionAnalysis::HasTruthAxis(), and ana::ICrossSectionAnalysis::HasWeights().

Referenced by InitGenieUniverses(), InitPPFXUniverses(), InitSystematicSpectra(), and ana::ICrossSectionAnalysis::InitSystematicSpectra().

ICrossSectionAnalysis * ana::TrivialCrossSectionAnalysis::Clone ( ) const
overridevirtual

Analyzers override. This needs to be overridden in derived class wherein member pointers are copied explicitly with 'new' to protect against memory leaks when using copy constructors

Implements ana::ICrossSectionAnalysis.

Definition at line 413 of file TrivialCrossSectionAnalysis.cxx.

References TrivialCrossSectionAnalysis().

Referenced by RelativeUncertainty(), and TrivialCrossSectionAnalysis().

414  {
415  return new TrivialCrossSectionAnalysis(*this);
416  }
TrivialCrossSectionAnalysis()
default constructor. Do nothing
Cut * ana::ICrossSectionAnalysis::Copy ( const Cut ptr)
protectedinherited

Definition at line 39 of file ICrossSectionAnalysis.cxx.

Referenced by ana::ICrossSectionAnalysis::Copy(), operator=(), and TrivialCrossSectionAnalysis().

40  {
41  if(ptr)
42  return new Cut(*ptr);
43  else
44  return NULL;
45  }
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
Definition: Cut.h:96
NuTruthCut * ana::ICrossSectionAnalysis::Copy ( const NuTruthCut ptr)
protectedinherited

Definition at line 49 of file ICrossSectionAnalysis.cxx.

50  {
51  if(ptr)
52  return new NuTruthCut(*ptr);
53  else
54  return NULL;
55  }
_Cut< caf::SRNeutrinoProxy > NuTruthCut
Cut designed to be used over the nuTree, ie all neutrinos, not just those that got slices...
Definition: Cut.h:104
HistAxis * ana::ICrossSectionAnalysis::Copy ( const HistAxis ptr)
protectedinherited

Definition at line 59 of file ICrossSectionAnalysis.cxx.

60  {
61  if(ptr)
62  return new HistAxis(*ptr);
63  else
64  return NULL;
65  }
_HistAxis< Var > HistAxis
Definition: HistAxis.h:103
NuTruthHistAxis * ana::ICrossSectionAnalysis::Copy ( const NuTruthHistAxis ptr)
protectedinherited

Definition at line 69 of file ICrossSectionAnalysis.cxx.

70  {
71  if(ptr)
72  return new NuTruthHistAxis(*ptr);
73  else
74  return NULL;
75  }
_HistAxis< NuTruthVar > NuTruthHistAxis
Definition: HistAxis.h:106
NuTruthVar * ana::ICrossSectionAnalysis::Copy ( const Var ptr)
protectedinherited

Definition at line 79 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::Copy().

80  {
81  if(ptr)
82  return new Var(*ptr);
83  else
84  return NULL;
85  }
_Var< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:74
NuTruthVar* ana::ICrossSectionAnalysis::Copy ( const NuTruthVar )
protectedinherited
SystShifts * ana::ICrossSectionAnalysis::Copy ( const SystShifts ptr)
protectedinherited

Definition at line 99 of file ICrossSectionAnalysis.cxx.

100  {
101  if(ptr)
102  return new SystShifts(*ptr);
103  else
104  return NULL;
105  }
TH1 * ana::ICrossSectionAnalysis::CrossSection ( XSecSysts::Syst_t  syst)
protectedinherited

Definition at line 531 of file ICrossSectionAnalysis.cxx.

References ana::assert(), ana::ICrossSectionAnalysis::CanCalculateCrossSection(), ana::ICrossSectionAnalysis::DivideByBinWidth(), e, ana::ICrossSectionAnalysis::Efficiency(), efficiency(), ana::ICrossSectionAnalysis::fIsDifferential, flux, ana::ICrossSectionAnalysis::Flux(), ana::ICrossSectionAnalysis::NTargets(), ana::ICrossSectionAnalysis::UnfoldedSignal(), and xsec.

Referenced by ana::ICrossSectionAnalysis::CalculateCrossSections().

532  {
534  "CrossSectionAnalysis not ready for cross section calculation" );
535 
536  const TH1 * unfolded_signal_est = UnfoldedSignal(syst);
537  const TH1 * efficiency = Efficiency(syst);
538  TH1 * flux = Flux(syst);
539  flux->Scale(1e-4); // Convert nu/m^2 to nu/cm^2
540  double ntargets = NTargets();
541  TH1 * xsec = (TH1*) unfolded_signal_est->Clone();
542  xsec->Divide(efficiency);
543  xsec->Divide(flux);
544  xsec->Scale(1./ntargets);
545  if(fIsDifferential)
546  DivideByBinWidth(xsec);
547  return xsec;
548  }
virtual TH1 * Flux(XSecSysts::Syst_t)=0
Loaders::FluxType flux
const TH1 * UnfoldedSignal(XSecSysts::Syst_t)
virtual TH1 * Efficiency(XSecSysts::Syst_t)=0
Double_t xsec[nknots]
Definition: testXsec.C:47
assert(nhit_max >=nhit_nbins)
Float_t e
Definition: plot.C:35
void efficiency()
Definition: efficiency.C:58
void ana::ICrossSectionAnalysis::DivideByBinWidth ( TH1 *  xsec)
protectedinherited

Definition at line 621 of file ICrossSectionAnalysis.cxx.

References om::cout, ana::ICrossSectionAnalysis::DX(), ana::ICrossSectionAnalysis::DXDY(), ana::ICrossSectionAnalysis::DXDYDZ(), allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fNDims.

Referenced by ana::ICrossSectionAnalysis::CrossSection().

622  {
623  TH1 * binning;
624  switch(fNDims) {
625  case(1) : {
626  binning = (TH1D*) xsec->Clone();
627  DX(binning);
628  break;
629  }
630  case(2) : {
631  binning = (TH2D*) xsec->Clone();
632  DXDY(binning);
633  break;
634  }
635  case(3) : {
636  binning = (TH3D*) xsec->Clone();
637  DXDYDZ(binning);
638  break;
639  }
640  default : {
641  std::cout << "Dimension of measurement undetermined." << std::endl;
642  abort();
643  }
644  } // end of switch-case
645  }
Double_t xsec[nknots]
Definition: testXsec.C:47
OStream cout
Definition: OStream.cxx:6
void ana::ICrossSectionAnalysis::DX ( TH1 *  binning)
protectedinherited

Definition at line 649 of file ICrossSectionAnalysis.cxx.

References MECModelEnuComparisons::i, and makeTrainCVSamples::int.

Referenced by ana::ICrossSectionAnalysis::DivideByBinWidth().

650  {
651  for(int i = 1; i <= (int) binning->GetNbinsX(); i++) {
652  binning->SetBinContent(i, binning->GetXaxis()->GetBinWidth(i));
653  }
654  }
void ana::ICrossSectionAnalysis::DXDY ( TH1 *  binning)
protectedinherited

Definition at line 658 of file ICrossSectionAnalysis.cxx.

References dx, dy, MECModelEnuComparisons::i, makeTrainCVSamples::int, and calib::j.

Referenced by ana::ICrossSectionAnalysis::DivideByBinWidth().

659  {
660  for(int i = 1; i <= (int) binning->GetNbinsX(); i++) {
661  double dx = binning->GetXaxis()->GetBinWidth(i);
662  for(int j = 1; j <= (int) binning->GetNbinsY(); j++) {
663  double dy = binning->GetYaxis()->GetBinWidth(j);
664  binning->SetBinContent(i, j, dx * dy);
665  }
666  }
667  }
double dy[NP][NC]
double dx[NP][NC]
const double j
Definition: BetheBloch.cxx:29
void ana::ICrossSectionAnalysis::DXDYDZ ( TH1 *  binning)
protectedinherited

Definition at line 671 of file ICrossSectionAnalysis.cxx.

References dx, dy, dz, MECModelEnuComparisons::i, makeTrainCVSamples::int, and calib::j.

Referenced by ana::ICrossSectionAnalysis::DivideByBinWidth().

672  {
673  for(int i = 1; i <= (int) binning->GetNbinsX(); i++) {
674  double dx = binning->GetXaxis()->GetBinWidth(i);
675  for(int j = 1; j <= (int) binning->GetNbinsY(); j++) {
676  double dy = binning->GetYaxis()->GetBinWidth(j);
677  for(int k = 1; k <= (int) binning->GetNbinsZ(); k++) {
678  double dz = binning->GetZaxis()->GetBinWidth(k);
679  binning->SetBinContent(i, j, k, dx * dy * dz);
680  }
681  }
682  }
683  }
double dy[NP][NC]
double dx[NP][NC]
double dz[NP][NC]
const double j
Definition: BetheBloch.cxx:29
TH1 * ana::TrivialCrossSectionAnalysis::Efficiency ( XSecSysts::Syst_t  syst)
overridevirtual

Function that calculates the efficiency that will be used in the cross section calculation

Implements ana::ICrossSectionAnalysis.

Definition at line 274 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fPOT, ana::ICrossSectionAnalysis::fXSecSpectra, num, and ana::ICrossSectionAnalysis::ToHist().

Referenced by TrivialCrossSectionAnalysis().

275  {
276  TH1 * num = ToHist(*fXSecSpectra[syst]->GetSelectedSignalTrueSpace(), fPOT);
277  TH1 * denom = ToHist(*fXSecSpectra[syst]->GetTrueSignalTrueSpace(), fPOT);
278  num->Divide(num, denom, 1, 1, "B"); // calculate binomial errors
279  return num;
280  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
int num
Definition: f2_nu.C:119
TH1 * ToHist(const Spectrum &, double=-1)
TH1 * ana::TrivialCrossSectionAnalysis::Flux ( XSecSysts::Syst_t  syst)
overridevirtual

Function that calculates the flux object that will be used in the cross section calculation

Implements ana::ICrossSectionAnalysis.

Definition at line 267 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fPOT, ana::ICrossSectionAnalysis::fXSecSpectra, GetFlux(), and ana::ICrossSectionAnalysis::ToHist().

Referenced by GenieError(), and TrivialCrossSectionAnalysis().

268  {
269  return ToHist(*fXSecSpectra[syst]->GetFlux(), fPOT);
270  }
GFluxI * GetFlux(void)
Definition: gAtmoEvGen.cxx:441
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
TH1 * ToHist(const Spectrum &, double=-1)
std::pair< TH1 *, TH1 * > ana::TrivialCrossSectionAnalysis::FluxError ( )
overridevirtual

Function that calculates the up (first) and down (second) error on the flux estimation.

Implements ana::ICrossSectionAnalysis.

Definition at line 251 of file TrivialCrossSectionAnalysis.cxx.

References ana::Multiverse::Divide(), fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, ana::ICrossSectionAnalysis::fXSec, ana::Multiverse::GetMinusOneSigmaShift(), ana::Multiverse::GetPlusOneSigmaShift(), ana::XSecSysts::kNominal, and ana::ICrossSectionAnalysis::UnfoldedSignal().

Referenced by TotalErrors(), and TrivialCrossSectionAnalysis().

252  {
253  // xsec is proportional to 1/efficiency so efficiency denom goes up in the
254  // numerator
255  Multiverse * ppfx_xsec = new Multiverse(*fPPFXMVEffDenom);
256  ppfx_xsec->Divide(*fPPFXMVEffNum, true);
257  ppfx_xsec->Divide(*fPPFXMVFlux);
258  *ppfx_xsec *= *UnfoldedSignal(XSecSysts::kNominal);
259 
260  return std::pair<TH1 *, TH1 *>
261  (ppfx_xsec->GetPlusOneSigmaShift(fXSec[XSecSysts::kNominal]),
262  ppfx_xsec->GetMinusOneSigmaShift(fXSec[XSecSysts::kNominal]));
263  }
const TH1 * UnfoldedSignal(XSecSysts::Syst_t)
std::map< XSecSysts::Syst_t, TH1 * > fXSec
std::pair< TH1 *, TH1 * > ana::TrivialCrossSectionAnalysis::GenieError ( )

Function that calculates the up (first) and down (second) error on the genie universes.

Definition at line 236 of file TrivialCrossSectionAnalysis.cxx.

References ana::Multiverse::Divide(), fGenieMVEffDenom, fGenieMVEffNum, Flux(), ana::ICrossSectionAnalysis::fXSec, ana::Multiverse::GetMinusOneSigmaShift(), ana::Multiverse::GetPlusOneSigmaShift(), ana::XSecSysts::kNominal, and ana::ICrossSectionAnalysis::UnfoldedSignal().

Referenced by TotalErrors(), and TrivialCrossSectionAnalysis().

237  {
238  // xsec is proportional to 1/efficiency so efficiency denom goes up in the
239  // numerator
240  Multiverse * genie_xsec = new Multiverse(*fGenieMVEffDenom);
241  genie_xsec->Divide(*fGenieMVEffNum, true);
242  *genie_xsec /= *Flux(XSecSysts::kNominal);
243  *genie_xsec *= *UnfoldedSignal(XSecSysts::kNominal);
244  return std::pair<TH1 *, TH1 *>
245  (genie_xsec->GetPlusOneSigmaShift(fXSec[XSecSysts::kNominal]),
246  genie_xsec->GetMinusOneSigmaShift(fXSec[XSecSysts::kNominal]));
247  }
TH1 * Flux(XSecSysts::Syst_t) override
const TH1 * UnfoldedSignal(XSecSysts::Syst_t)
std::map< XSecSysts::Syst_t, TH1 * > fXSec
TH1 * ana::ICrossSectionAnalysis::GetCrossSection ( XSecSysts::Syst_t  syst)
inherited

Definition at line 524 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fXSec.

Referenced by ana::PlotAllCrossSectionOverENu(), and ana::PlotAllCrossSectionResult().

525  {
526  return (TH1 *) fXSec[syst]->Clone();
527  }
std::map< XSecSysts::Syst_t, TH1 * > fXSec
const CrossSectionSpectra * ana::ICrossSectionAnalysis::GetCrossSectionSpectra ( XSecSysts::Syst_t  syst)
inherited

Definition at line 420 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fXSecSpectra.

Referenced by ana::PlotAllRecoTrue(), and ana::PlotAllSelectionDecomposition().

421  {
422  return fXSecSpectra[syst];
423  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
const TVector3 * ana::ICrossSectionAnalysis::GetFidMax ( )
inherited

Definition at line 434 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fFidMax.

435  {
436  return &fFidMax;
437  }
const TVector3 * ana::ICrossSectionAnalysis::GetFixMin ( )
inherited

Definition at line 441 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fFidMin.

442  {
443  return &fFidMin;
444  }
static Spectrum ana::ICrossSectionAnalysis::GetGeniePrediction ( )
staticinherited

Static function to get the genie prediction of the cross section from the CAF trees – a per nucleon measurement

const TargetCount * ana::ICrossSectionAnalysis::GetTarget ( )
inherited

Definition at line 427 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fTarget.

428  {
429  return &fTarget;
430  }
bool ana::ICrossSectionAnalysis::HasData ( ) const
protectedinherited

Definition at line 188 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fData.

Referenced by SaveTo().

189  {
190  if(fData)
191  return true;
192  else {
193  std::cout << "CrossSectionAnalysis object does not have data" << std::endl;
194  return false;
195  }
196  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasDimensions ( ) const
protectedinherited

Definition at line 284 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fNDims.

Referenced by ana::ICrossSectionAnalysis::CanCalculateCrossSection().

285  {
286  if(fNDims != 0)
287  return true;
288  else {
289  std::cout << "Measurement dimensions not set" << std::endl;
290  return false;
291  }
292  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasENuBinning ( ) const
protectedinherited

Definition at line 164 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fENuBinning.

Referenced by ana::ICrossSectionAnalysis::InitSystematicSpectra().

165  {
166  if(fENuBinning)
167  return true;
168  else {
169  std::cout << "Binning not initialized" << std::endl;
170  return false;
171  }
172  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasFiducialVolume ( ) const
protectedinherited

Definition at line 344 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, ana::ICrossSectionAnalysis::fFidMax, and ana::ICrossSectionAnalysis::fFidMin.

Referenced by ana::ICrossSectionAnalysis::CanCalculateCrossSection(), and ana::ICrossSectionAnalysis::CanFillSpectra().

345  {
346  if((fFidMax.X() != 0 &&
347  fFidMax.Y() != 0 &&
348  fFidMax.Z() != 0) ||
349  (fFidMin.X() != 0 &&
350  fFidMin.Y() != 0 &&
351  fFidMin.Z() != 0))
352  return true;
353  else {
354  std::cout << "Fiducial volume not defined" << std::endl;
355  return false;
356  }
357  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasNuTruthWeights ( ) const
protectedinherited

Definition at line 224 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fNuTruthWeights.

Referenced by ana::ICrossSectionAnalysis::CanFillSpectra().

225  {
226  if(!fNuTruthWeights.empty())
227  return true;
228  else {
229  std::cout << "NuTruthWeights not initialized" << std::endl;
230  return false;
231  }
232  }
std::map< XSecSysts::Syst_t, const NuTruthVar * > fNuTruthWeights
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasPDG ( ) const
protectedinherited

Definition at line 176 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fPDG.

Referenced by ana::ICrossSectionAnalysis::InitSystematicSpectra().

177  {
178  if(fPDG != 0)
179  return true;
180  else {
181  std::cout << "Particle PDG not set" << std::endl;
182  return false;
183  }
184  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasRecoAxis ( ) const
protectedinherited

Definition at line 320 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fRecoAxis.

Referenced by ana::ICrossSectionAnalysis::CanFillSpectra(), and ana::ICrossSectionAnalysis::InitDataSpectrum().

321  {
322  if(fRecoAxis)
323  return true;
324  else {
325  std::cout << "Reco axis not initialized" << std::endl;
326  return false;
327  }
328  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasSelectionCut ( ) const
protectedinherited

Definition at line 308 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fSelectionCut.

Referenced by ana::ICrossSectionAnalysis::CanFillSpectra(), and ana::ICrossSectionAnalysis::InitDataSpectrum().

309  {
310  if(fSelectionCut)
311  return true;
312  else {
313  std::cout << "Selection Cut not defined" << std::endl;
314  return false;
315  }
316  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasSignalCut ( ) const
protectedinherited

Definition at line 296 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fSignalCut.

Referenced by ana::ICrossSectionAnalysis::CanFillSpectra().

297  {
298  if(fSignalCut)
299  return true;
300  else {
301  std::cout << "Signal cut not defined" << std::endl;
302  return false;
303  }
304  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasSpectra ( ) const
protectedinherited

Definition at line 200 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fXSecSpectra.

Referenced by ana::ICrossSectionAnalysis::CanCalculateCrossSection().

201  {
202  if(!fXSecSpectra.empty())
203  return true;
204  else {
205  std::cout << "CrossSectionAnalysis object does not have MC spectra" << std::endl;
206  return false;
207  }
208  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasSystShifts ( ) const
protectedinherited

Definition at line 236 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fSystShifts.

Referenced by ana::ICrossSectionAnalysis::CanFillSpectra().

237  {
238  if(!fSystShifts.empty())
239  return true;
240  else {
241  std::cout << "SystShifts not initialized" << std::endl;
242  return false;
243  }
244  }
OStream cout
Definition: OStream.cxx:6
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
bool ana::ICrossSectionAnalysis::HasTruthAxis ( ) const
protectedinherited

Definition at line 332 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fTruthAxis.

Referenced by ana::ICrossSectionAnalysis::CanFillSpectra().

333  {
334  if(fTruthAxis)
335  return true;
336  else {
337  std::cout << "Truth axis not initialized" << std::endl;
338  return false;
339  }
340  }
OStream cout
Definition: OStream.cxx:6
const NuTruthHistAxis * fTruthAxis
bool ana::ICrossSectionAnalysis::HasUnfoldMethod ( ) const
protectedinherited

Definition at line 260 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fUnfoldMethod.

Referenced by ana::ICrossSectionAnalysis::CanCalculateCrossSection().

261  {
262  if(fUnfoldMethod != 0)
263  return true;
264  else {
265  std::cout << "Unfolding method not set: " << fUnfoldMethod << std::endl;
266  return false;
267  }
268  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasUnfoldReg ( ) const
protectedinherited

Definition at line 272 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fUnfoldReg.

Referenced by ana::ICrossSectionAnalysis::CanCalculateCrossSection().

273  {
274  if(fUnfoldReg != 0)
275  return true;
276  else {
277  std::cout << "Unfolding reg not set" << std::endl;
278  return false;
279  }
280  }
OStream cout
Definition: OStream.cxx:6
bool ana::ICrossSectionAnalysis::HasWeights ( ) const
protectedinherited

Definition at line 212 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fWeights.

Referenced by ana::ICrossSectionAnalysis::CanFillSpectra().

213  {
214  if(!fWeights.empty())
215  return true;
216  else {
217  std::cout << "Weights not initialized" << std::endl;
218  return false;
219  }
220  }
OStream cout
Definition: OStream.cxx:6
std::map< XSecSysts::Syst_t, const Var * > fWeights
bool ana::ICrossSectionAnalysis::HasXSecs ( ) const
protectedinherited

Definition at line 248 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, and ana::ICrossSectionAnalysis::fXSec.

249  {
250  if(!fXSec.empty())
251  return true;
252  else {
253  std::cout << "CrossSectionAnalysis object has not caluclated cross sections" << std::endl;
254  return false;
255  }
256  }
OStream cout
Definition: OStream.cxx:6
std::map< XSecSysts::Syst_t, TH1 * > fXSec
void ana::ICrossSectionAnalysis::InitDataSpectrum ( SpectrumLoaderBase loader)
inherited

Definition at line 143 of file ICrossSectionAnalysis.cxx.

References ana::assert(), ana::ICrossSectionAnalysis::fData, ana::ICrossSectionAnalysis::fRecoAxis, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::HasRecoAxis(), ana::ICrossSectionAnalysis::HasSelectionCut(), ana::kNoShift, and ana::kUnweighted.

Referenced by demo_trivial_xsec_analysis().

144  {
145  assert( HasRecoAxis() &&
146  HasSelectionCut() &&
147  "Analysis not ready to fill data spectrum" );
148 
149  fData = new Spectrum(*loader,
150  *fRecoAxis,
151  *fSelectionCut,
152  kNoShift,
153  kUnweighted);
154  }
loader
Definition: demo0.py:10
std::vector< float > Spectrum
Definition: Constants.h:610
const SystShifts kNoShift
Definition: SystShifts.cxx:21
assert(nhit_max >=nhit_nbins)
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
Definition: Var.h:96
void ana::TrivialCrossSectionAnalysis::InitGenieUniverses ( SpectrumLoaderBase loader,
std::vector< SystShifts genie_shifts 
)

Definition at line 60 of file TrivialCrossSectionAnalysis.cxx.

References ana::assert(), ana::ICrossSectionAnalysis::CanFillSpectra(), ana::CutFromNuTruthCut(), fGenieMVEffDenom, fGenieMVEffNum, fHasGenieMultiverses, ana::ICrossSectionAnalysis::fNuTruthWeights, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fTruthAxis, ana::ICrossSectionAnalysis::fWeights, ana::HistAxisFromNuTruthHistAxis(), and ana::XSecSysts::kNominal.

Referenced by demo_trivial_xsec_analysis(), and TrivialCrossSectionAnalysis().

62  {
64  "CrossSectionAnalysis object not yet ready to setup genie multiverses." );
65  fGenieMVEffNum = new Multiverse(*loader,
68  genie_shifts,
70  fGenieMVEffDenom = new Multiverse(*loader,
71  *fTruthAxis,
72  *fSignalCut,
73  genie_shifts,
75  fHasGenieMultiverses = true;
76  }
std::map< XSecSysts::Syst_t, const NuTruthVar * > fNuTruthWeights
HistAxis HistAxisFromNuTruthHistAxis(NuTruthHistAxis ntha, double _default)
Definition: HistAxis.cxx:9
loader
Definition: demo0.py:10
std::map< XSecSysts::Syst_t, const Var * > fWeights
assert(nhit_max >=nhit_nbins)
const NuTruthHistAxis * fTruthAxis
Cut CutFromNuTruthCut(const NuTruthCut &stc)
Definition: Cut.cxx:7
void ana::TrivialCrossSectionAnalysis::InitPPFXUniverses ( SpectrumLoaderBase loader,
std::vector< Var ppfx_weights,
std::vector< NuTruthVar ppfx_weights_nt 
)

Definition at line 80 of file TrivialCrossSectionAnalysis.cxx.

References ana::assert(), ana::ICrossSectionAnalysis::CanFillSpectra(), ana::CutFromNuTruthCut(), ana::DeriveFlux(), ana::ICrossSectionAnalysis::fENuBinning, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, fHasPPFXMultiverses, ana::ICrossSectionAnalysis::fNuTruthWeights, ana::ICrossSectionAnalysis::fPDG, fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fSystShifts, ana::ICrossSectionAnalysis::fTruthAxis, ana::ICrossSectionAnalysis::fWeights, ana::HistAxisFromNuTruthHistAxis(), MECModelEnuComparisons::i, makeTrainCVSamples::int, and ana::XSecSysts::kNominal.

Referenced by demo_trivial_xsec_analysis(), and TrivialCrossSectionAnalysis().

83  {
85  "CrossSectionAnalysis object not yet ready to setup PPFX multiverses.");
86  std::vector<Spectrum *> mv_flux;
87  for(int i = 0; i < (int) ppfx_weights.size(); i++) {
88  mv_flux.push_back(DeriveFlux(*loader,
89  *fENuBinning,
90  fPDG,
91  &fFidMin,
92  &fFidMax,
94  ppfx_weights_nt[i]));
95  }
96  fPPFXMVFlux = new Multiverse(mv_flux);
97  fPPFXMVEffNum = new Multiverse(*loader,
101  ppfx_weights,
102  *fWeights[XSecSysts::kNominal]);
103  fPPFXMVEffDenom = new Multiverse(*loader,
104  *fTruthAxis,
105  *fSignalCut,
107  ppfx_weights_nt,
108  *fNuTruthWeights[XSecSysts::kNominal]);
109 
110  // make sure we transferred ownership completely to the multiverse object
111  for(int i = 0; i < (int) ppfx_weights.size(); i++) {
112  mv_flux[i] = NULL;
113  }
114  fHasPPFXMultiverses = true;
115  }
std::map< XSecSysts::Syst_t, const NuTruthVar * > fNuTruthWeights
HistAxis HistAxisFromNuTruthHistAxis(NuTruthHistAxis ntha, double _default)
Definition: HistAxis.cxx:9
loader
Definition: demo0.py:10
std::map< XSecSysts::Syst_t, const Var * > fWeights
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
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
assert(nhit_max >=nhit_nbins)
const NuTruthHistAxis * fTruthAxis
Cut CutFromNuTruthCut(const NuTruthCut &stc)
Definition: Cut.cxx:7
void ana::TrivialCrossSectionAnalysis::InitSystematicSpectra ( XSecSysts::Syst_t  syst,
SpectrumLoaderBase loader 
)

Function to initialize a systemtic cross section spectra with the already-provided weights, and shifts

Definition at line 16 of file TrivialCrossSectionAnalysis.cxx.

References ana::assert(), ana::ICrossSectionAnalysis::CanFillSpectra(), fBkgdCuts, ana::ICrossSectionAnalysis::fENuBinning, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, ana::ICrossSectionAnalysis::fNuTruthWeights, ana::ICrossSectionAnalysis::fPDG, ana::ICrossSectionAnalysis::fRecoAxis, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fSystShifts, ana::ICrossSectionAnalysis::fTruthAxis, ana::ICrossSectionAnalysis::fWeights, and ana::ICrossSectionAnalysis::fXSecSpectra.

Referenced by demo_trivial_xsec_analysis(), InitSystematicSpectra(), and TrivialCrossSectionAnalysis().

18  {
20  "TrivialCrossSectionAnalysis object not yet ready to setup systematic spectra." );
21 
22  fXSecSpectra.insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra *>
23  (syst,
24  new CrossSectionSpectra(*loader,
25  *fRecoAxis,
26  *fTruthAxis,
28  *fSignalCut,
29  new TrivialSignalEstimator(loader,
30  fRecoAxis,
32  fBkgdCuts,
33  *fSystShifts[syst],
34  *fWeights[syst]),
35  fFidMax,
36  fFidMin,
37  *fENuBinning,
38  fPDG,
39  *fWeights[syst],
40  *fNuTruthWeights[syst],
41  *fSystShifts[syst])));
42  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
std::map< XSecSysts::Syst_t, const NuTruthVar * > fNuTruthWeights
loader
Definition: demo0.py:10
std::map< XSecSysts::Syst_t, const Var * > fWeights
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
assert(nhit_max >=nhit_nbins)
const NuTruthHistAxis * fTruthAxis
void ana::TrivialCrossSectionAnalysis::InitSystematicSpectra ( XSecSysts::Syst_t  syst,
SpectrumLoaderBase loader,
const Var weight,
const NuTruthVar weight_nt,
const SystShifts shift 
)

Function to fully initialize a systemtic cross section spectra and corresponding weights and shifts

Definition at line 46 of file TrivialCrossSectionAnalysis.cxx.

References InitSystematicSpectra(), ana::ICrossSectionAnalysis::SetNuTruthWeight(), ana::ICrossSectionAnalysis::SetSystShifts(), and ana::ICrossSectionAnalysis::SetWeight().

51  {
52  SetWeight(syst, weight);
53  SetNuTruthWeight(syst, weight_nt);
54  SetSystShifts(syst, shift);
56  }
const Var weight
void SetWeight(XSecSysts::Syst_t, const Var *)
void SetSystShifts(XSecSysts::Syst_t, const SystShifts *)
loader
Definition: demo0.py:10
void SetNuTruthWeight(XSecSysts::Syst_t, const NuTruthVar *)
void InitSystematicSpectra(XSecSysts::Syst_t, SpectrumLoaderBase *)
void ana::ICrossSectionAnalysis::InitSystematicSpectra ( XSecSysts::Syst_t  syst,
CrossSectionSpectra xsec 
)
inherited

Definition at line 361 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fXSecSpectra.

363  {
364  fXSecSpectra.insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra *>
365  (syst, xsec));
366  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
Double_t xsec[nknots]
Definition: testXsec.C:47
void ana::ICrossSectionAnalysis::InitSystematicSpectra ( XSecSysts::Syst_t  syst,
SpectrumLoaderBase loader,
ISignalEstimator signal_est 
)
inherited

Definition at line 370 of file ICrossSectionAnalysis.cxx.

References ana::assert(), ana::ICrossSectionAnalysis::CanFillSpectra(), ana::ICrossSectionAnalysis::fENuBinning, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, ana::ICrossSectionAnalysis::fNuTruthWeights, ana::ICrossSectionAnalysis::fPDG, ana::ICrossSectionAnalysis::fRecoAxis, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fSystShifts, ana::ICrossSectionAnalysis::fTruthAxis, ana::ICrossSectionAnalysis::fWeights, ana::ICrossSectionAnalysis::fXSecSpectra, ana::ICrossSectionAnalysis::HasENuBinning(), and ana::ICrossSectionAnalysis::HasPDG().

373  {
374 
375  assert( CanFillSpectra() &&
376  HasENuBinning() &&
377  HasPDG() &&
378  "CrossSectionAnalysis object not yet ready to setup systematic spectra." );
379  fXSecSpectra.insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra *>
380  (syst,
381  new CrossSectionSpectra(*loader,
382  *fRecoAxis,
383  *fTruthAxis,
384  *fSelectionCut,
385  *fSignalCut,
386  signal_est,
387  fFidMax,
388  fFidMin,
389  *fENuBinning,
390  fPDG,
391  *fWeights[syst],
392  *fNuTruthWeights[syst],
393  *fSystShifts[syst])));
394  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
std::map< XSecSysts::Syst_t, const NuTruthVar * > fNuTruthWeights
loader
Definition: demo0.py:10
std::map< XSecSysts::Syst_t, const Var * > fWeights
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
assert(nhit_max >=nhit_nbins)
const NuTruthHistAxis * fTruthAxis
void ana::ICrossSectionAnalysis::InitSystematicSpectra ( XSecSysts::Syst_t  syst,
ReweightableSpectrum reco_true,
ISignalEstimator signal_est,
Spectrum flux,
Spectrum mc_selected,
Spectrum sig_selected_truth,
Spectrum sig_selected_reco,
Spectrum sig_truth 
)
inherited

Definition at line 398 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fXSecSpectra.

406  {
407  fXSecSpectra.insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra *>
408  (syst,
409  new CrossSectionSpectra(reco_true,
410  signal_est,
411  flux,
412  mc_selected,
413  sig_selected_truth,
414  sig_selected_reco,
415  sig_truth)));
416  }
Loaders::FluxType flux
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
std::unique_ptr< TrivialCrossSectionAnalysis > ana::TrivialCrossSectionAnalysis::LoadFrom ( TDirectory *  dir,
const std::string name 
)
static

Definition at line 284 of file TrivialCrossSectionAnalysis.cxx.

References ana::assert(), dir, ana::XSecSysts::GetAllSystematics(), ana::XSecSysts::LabelFromSystematic(), ana::CrossSectionSpectra::LoadFrom(), ana::Multiverse::LoadFrom(), ana::Spectrum::LoadFrom(), POT, runNovaSAM::release, runNovaSAM::ret, systs, getGoodRuns4SAM::tag, TrivialCrossSectionAnalysis(), and xsec.

Referenced by demo_trivial_xsec_analysis(), and TrivialCrossSectionAnalysis().

285  {
286  dir = dir->GetDirectory(name.c_str()); // switch to subdir
287  assert(dir);
288 
289  TObjString * ptag = (TObjString*) dir->Get("type");
290  assert(ptag);
291 
292  const TString tag = ptag->GetString();
293  assert(tag == "TrivialCrossSectionAnalysis" && "Type does not match TrivialCrossSectionAnalysis");
294  delete ptag;
295 
296  Spectrum * data = Spectrum::LoadFrom(dir, "fData").release();
297  std::map<XSecSysts::Syst_t, CrossSectionSpectra *> xsec_spectra;
298  std::vector<XSecSysts::Syst_t> systs
300 
301  for(XSecSysts::Syst_t syst : systs) {
302  xsec_spectra.
303  insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra *>
304  (syst,
306  }
307 
308  TVector3 * fidmax = (TVector3*) dir->Get("fFidMax");
309  TVector3 * fidmin = (TVector3*) dir->Get("fFidMin");
310  TVectorD * ndims = (TVectorD*) dir->Get("ndims");
311  Multiverse * genie_mv_eff_num = NULL;
312  Multiverse * genie_mv_eff_denom = NULL;
313  Multiverse * ppfx_mv_eff_num = NULL;
314  Multiverse * ppfx_mv_eff_denom= NULL;
315  Multiverse * ppfx_mv_flux = NULL;
316  bool isdifferential = false;
317  if(dir->GetDirectory("fIsDifferential"))
318  isdifferential = true;
319  if(dir->GetDirectory("fGenieMVEffNum")) {
320  genie_mv_eff_num =
321  Multiverse::LoadFrom(dir, "fGenieMVEffNum").release();
322  }
323  if(dir->GetDirectory("fGenieMVEffDenom")) {
324  genie_mv_eff_denom =
325  Multiverse::LoadFrom(dir, "fGenieMVEffDenom").release();
326  }
327  if(dir->GetDirectory("fPPFXMVFlux")) {
328  ppfx_mv_flux =
329  Multiverse::LoadFrom(dir, "fPPFXMVFlux").release();
330  }
331  if(dir->GetDirectory("fPPFXMVEffNum")) {
332  ppfx_mv_eff_num =
333  Multiverse::LoadFrom(dir, "fPPFXMVEffNum").release();
334  }
335  if(dir->GetDirectory("fPPFXMVEffDenom")) {
336  ppfx_mv_eff_denom =
337  Multiverse::LoadFrom(dir, "fPPFXMVEffDenom").release();
338  }
339 
340  std::unique_ptr<TrivialCrossSectionAnalysis> ret
341  ( new TrivialCrossSectionAnalysis(data,
342  xsec_spectra,
343  ppfx_mv_flux,
344  ppfx_mv_eff_num,
345  ppfx_mv_eff_denom,
346  genie_mv_eff_num,
347  genie_mv_eff_denom,
348  fidmax,
349  fidmin,
350  ndims,
351  isdifferential));
352  double POT = ret->fData->POT();
353  ret->SetPOT(POT);
354  for(std::pair<XSecSysts::Syst_t, CrossSectionSpectra *> xsec : xsec_spectra)
355  if(xsec.second)
356  xsec.second = NULL;
357  data = NULL;
358  genie_mv_eff_num = NULL;
359  genie_mv_eff_denom = NULL;
360  ppfx_mv_flux = NULL;
361  ppfx_mv_eff_num = NULL;
362  ppfx_mv_eff_denom = NULL;
363  fidmax = NULL;
364  fidmin = NULL;
365  ndims = NULL;
366 
367  delete dir;
368 
369  return ret;
370  }
static TString LabelFromSystematic(Syst_t)
Definition: XSecSysts.cxx:25
const XML_Char * name
Definition: expat.h:151
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
const XML_Char const XML_Char * data
Definition: expat.h:268
static std::unique_ptr< CrossSectionSpectra > LoadFrom(TDirectory *, const std::string &)
TrivialCrossSectionAnalysis()
default constructor. Do nothing
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Spectrum.cxx:535
static std::vector< Syst_t > GetAllSystematics()
Definition: XSecSysts.cxx:9
std::vector< float > Spectrum
Definition: Constants.h:610
Double_t xsec[nknots]
Definition: testXsec.C:47
static std::unique_ptr< Multiverse > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Multiverse.cxx:573
std::vector< double > POT
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
int ana::ICrossSectionAnalysis::NDimensions ( )
inherited

Definition at line 589 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fNDims.

590  {
591  return fNDims;
592  }
double ana::ICrossSectionAnalysis::NTargets ( )
inherited

Definition at line 582 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fTarget, and ana::TargetCount::NNucleons().

Referenced by ana::ICrossSectionAnalysis::CrossSection().

583  {
584  return fTarget.NNucleons();
585  }
double NNucleons() const
Number of nucleons (mass * avogadro&#39;s number)
Definition: TargetCount.h:31
TrivialCrossSectionAnalysis & ana::TrivialCrossSectionAnalysis::operator= ( const TrivialCrossSectionAnalysis rhs)

Definition at line 421 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::Copy(), ana::ICrossSectionAnalysis::fData, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, fGenieMVEffDenom, fGenieMVEffNum, fGenieXSec, ana::ICrossSectionAnalysis::fIsDifferential, ana::ICrossSectionAnalysis::fNDims, fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, fPPFXXSec, ana::ICrossSectionAnalysis::fRecoAxis, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fSystShifts, ana::ICrossSectionAnalysis::fTarget, ana::ICrossSectionAnalysis::fTruthAxis, ana::ICrossSectionAnalysis::fUnfoldMethod, ana::ICrossSectionAnalysis::fUnfoldReg, ana::ICrossSectionAnalysis::fWeights, ana::ICrossSectionAnalysis::fXSecSpectra, genie, ana::weight, and xsec.

Referenced by TrivialCrossSectionAnalysis().

422  {
423  if ( this == &rhs )
424  return *this;
425  std::for_each(rhs.fXSecSpectra.begin(), rhs.fXSecSpectra.end(),
426  [this](std::pair<XSecSysts::Syst_t, CrossSectionSpectra*> xsec)
427  {
428  this->fXSecSpectra
429  .insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra*>
430  (xsec.first,
431  new CrossSectionSpectra(*xsec.second)));
432  });
433 
434  std::for_each(rhs.fWeights.begin(), rhs.fWeights.end(),
435  [this](std::pair<XSecSysts::Syst_t, const Var *> weight)
436  {
437  this->fWeights
438  .insert(std::pair<XSecSysts::Syst_t, const Var *>
439  (weight.first,
440  Copy(weight.second)));
441  });
442 
443  std::for_each(rhs.fSystShifts.begin(), rhs.fSystShifts.end(),
444  [this](std::pair<XSecSysts::Syst_t, const SystShifts *> shift)
445  {
446  this->fSystShifts
447  .insert(std::pair<XSecSysts::Syst_t, const SystShifts *>
448  (shift.first,
449  Copy(shift.second)));
450  });
451 
452  this->fTarget = rhs.fTarget;
453  this->fFidMax = rhs.fFidMax;
454  this->fFidMin = rhs.fFidMin;
455  this->fSelectionCut = Copy(rhs.fSelectionCut);
456  this->fRecoAxis = Copy(rhs.fRecoAxis);
457  this->fSignalCut = Copy(rhs.fSignalCut);
458  this->fTruthAxis = Copy(rhs.fTruthAxis);
459  this->fUnfoldMethod = rhs.fUnfoldMethod;
460  this->fUnfoldReg = rhs.fUnfoldReg;
461  this->fNDims = rhs.fNDims;
462  this->fIsDifferential = rhs.fIsDifferential;
463  if(rhs.fPPFXXSec.size() != 0) {
464  std::for_each(rhs.fPPFXXSec.begin(), rhs.fPPFXXSec.end(),
465  [this](TH1 * ppfx)
466  {
467  this->fPPFXXSec.push_back((TH1*) ppfx->Clone());
468  });
469  }
470  if(rhs.fGenieXSec.size() != 0) {
471  std::for_each(rhs.fGenieXSec.begin(), rhs.fGenieXSec.end(),
472  [this](TH1 * genie)
473  {
474  this->fGenieXSec.push_back((TH1*) genie->Clone());
475  });
476  }
477 
478  this->fGenieMVEffNum = new Multiverse(*rhs.fGenieMVEffNum);
479  this->fGenieMVEffDenom = new Multiverse(*rhs.fGenieMVEffDenom);
480  this->fPPFXMVFlux = new Multiverse(*rhs.fPPFXMVFlux);
481  this->fPPFXMVEffNum = new Multiverse(*rhs.fPPFXMVEffNum);
482  this->fPPFXMVEffDenom = new Multiverse(*rhs.fPPFXMVEffDenom);
483  this->fData = new Spectrum(*rhs.fData);
484  return *this;
485  }
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
const Var weight
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
std::vector< float > Spectrum
Definition: Constants.h:610
Double_t xsec[nknots]
Definition: testXsec.C:47
std::map< XSecSysts::Syst_t, const Var * > fWeights
TGraph * genie
Definition: Xsec_final.C:116
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
const NuTruthHistAxis * fTruthAxis
TrivialCrossSectionAnalysis & ana::TrivialCrossSectionAnalysis::operator= ( TrivialCrossSectionAnalysis &&  rhs)

Definition at line 490 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fData, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, fGenieMVEffDenom, fGenieMVEffNum, fGenieXSec, ana::ICrossSectionAnalysis::fIsDifferential, ana::ICrossSectionAnalysis::fNDims, fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, fPPFXXSec, ana::ICrossSectionAnalysis::fRecoAxis, ana::ICrossSectionAnalysis::fSelectionCut, ana::ICrossSectionAnalysis::fSignalCut, ana::ICrossSectionAnalysis::fSystShifts, ana::ICrossSectionAnalysis::fTarget, ana::ICrossSectionAnalysis::fTruthAxis, ana::ICrossSectionAnalysis::fUnfoldMethod, ana::ICrossSectionAnalysis::fUnfoldReg, ana::ICrossSectionAnalysis::fWeights, ana::ICrossSectionAnalysis::fXSecSpectra, genie, ana::weight, and xsec.

491  {
492  if ( this == &rhs )
493  return *this;
494  std::for_each(rhs.fXSecSpectra.begin(), rhs.fXSecSpectra.end(),
495  [this](std::pair<XSecSysts::Syst_t, CrossSectionSpectra*> xsec)
496  {
497  this->fXSecSpectra
498  .insert(std::pair<XSecSysts::Syst_t, CrossSectionSpectra*>
499  (xsec.first,
500  xsec.second));
501  xsec.second = NULL;
502  });
503 
504  std::for_each(rhs.fWeights.begin(), rhs.fWeights.end(),
505  [this](std::pair<XSecSysts::Syst_t, const Var *> weight)
506  {
507  this->fWeights
508  .insert(std::pair<XSecSysts::Syst_t, const Var *>
509  (weight.first,
510  weight.second));
511  weight.second = NULL;
512  });
513 
514  std::for_each(rhs.fSystShifts.begin(), rhs.fSystShifts.end(),
515  [this](std::pair<XSecSysts::Syst_t, const SystShifts *> shift)
516  {
517  this->fSystShifts
518  .insert(std::pair<XSecSysts::Syst_t, const SystShifts *>
519  (shift.first,
520  shift.second));
521  shift.second = NULL;
522  });
523 
524  this->fTarget = rhs.fTarget;
525  this->fFidMax = rhs.fFidMax;
526  this->fFidMin = rhs.fFidMin;
527  this->fSelectionCut = rhs.fSelectionCut; rhs.fSelectionCut = NULL;
528  this->fRecoAxis = rhs.fRecoAxis; rhs.fRecoAxis = NULL;
529  this->fSignalCut = rhs.fSignalCut; rhs.fSignalCut = NULL;
530  this->fTruthAxis = rhs.fTruthAxis; rhs.fTruthAxis = NULL;
531  this->fUnfoldMethod = rhs.fUnfoldMethod;
532  this->fUnfoldReg = rhs.fUnfoldReg;
533  this->fNDims = rhs.fNDims;
534  this->fIsDifferential = rhs.fIsDifferential;
535  if(rhs.fPPFXXSec.size() != 0) {
536  std::for_each(rhs.fPPFXXSec.begin(), rhs.fPPFXXSec.end(),
537  [this](TH1 * ppfx)
538  {
539  this->fPPFXXSec.push_back(ppfx);
540  ppfx = NULL;
541  });
542  }
543  if(rhs.fGenieXSec.size() != 0) {
544  std::for_each(rhs.fGenieXSec.begin(), rhs.fGenieXSec.end(),
545  [this](TH1 * genie)
546  {
547  this->fGenieXSec.push_back(genie);
548  genie = NULL;
549  });
550  }
551 
552  this->fGenieMVEffNum = rhs.fGenieMVEffNum; rhs.fGenieMVEffNum = NULL;
553  this->fGenieMVEffDenom = rhs.fGenieMVEffDenom; rhs.fGenieMVEffDenom = NULL;
554  this->fPPFXMVFlux = rhs.fPPFXMVFlux; rhs.fPPFXMVFlux = NULL;
555  this->fPPFXMVEffNum = rhs.fPPFXMVEffNum; rhs.fPPFXMVEffNum = NULL;
556  this->fPPFXMVEffDenom = rhs.fPPFXMVEffDenom; rhs.fPPFXMVEffDenom = NULL;
557  this->fData = rhs.fData; rhs.fData = NULL;
558  return *this;
559  }
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
const Var weight
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
Double_t xsec[nknots]
Definition: testXsec.C:47
std::map< XSecSysts::Syst_t, const Var * > fWeights
TGraph * genie
Definition: Xsec_final.C:116
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
const NuTruthHistAxis * fTruthAxis
TH1 * ana::TrivialCrossSectionAnalysis::Purity ( XSecSysts::Syst_t  syst)
overridevirtual

Function that returns the purity of the specified sample.

Implements ana::ICrossSectionAnalysis.

Definition at line 119 of file TrivialCrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fPOT, ana::ICrossSectionAnalysis::fXSecSpectra, num, and ana::ICrossSectionAnalysis::ToHist().

Referenced by TrivialCrossSectionAnalysis().

120  {
121  TH1 * num = ToHist(*fXSecSpectra[syst]->GetSelectedSignalRecoSpace(), fPOT);
122  TH1 * denom = ToHist(*fXSecSpectra[syst]->GetSelectedAllRecoSpace(), fPOT);
123  num->Divide(num, denom, 1, 1, "B"); // calculate binomial errors
124  return num;
125  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
int num
Definition: f2_nu.C:119
TH1 * ToHist(const Spectrum &, double=-1)
TH1 * ana::TrivialCrossSectionAnalysis::RelativeUncertainty ( XSecSysts::Syst_t  syst)
overridevirtual

Function that calculates relative uncertainty on the cross section result.

Implements ana::ICrossSectionAnalysis.

Definition at line 217 of file TrivialCrossSectionAnalysis.cxx.

References Clone(), cv, delta, stan::math::fabs(), ana::ICrossSectionAnalysis::fXSec, MECModelEnuComparisons::i, calib::j, ana::XSecSysts::kNominal, and shutoffs::rel.

Referenced by TotalErrors(), and TrivialCrossSectionAnalysis().

218  {
219  TH1 * rel = (TH1*) fXSec[XSecSysts::kNominal]->Clone();
220  double shift, cv, delta;
221  for(int i = 1; i <= rel->GetNbinsX(); i++) {
222  for(int j = 1; j <= rel->GetNbinsY(); j++) {
223  for(int k = 1; k <= rel->GetNbinsZ(); k++) {
224  cv = fXSec[XSecSysts::kNominal]->GetBinContent(i, j, k);
225  shift = fXSec[syst]->GetBinContent(i, j, k);
226  delta = fabs(shift - cv);
227  rel->SetBinContent(i, j, k, delta / cv);
228  }
229  }
230  }
231  return rel;
232  }
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
double delta
Definition: runWimpSim.h:98
ICrossSectionAnalysis * Clone() const override
const std::string cv[Ncv]
const double j
Definition: BetheBloch.cxx:29
string rel
Definition: shutoffs.py:11
std::map< XSecSysts::Syst_t, TH1 * > fXSec
void ana::TrivialCrossSectionAnalysis::SaveTo ( TDirectory *  dir,
const std::string name 
) const
overridevirtual

Analyzers override. Override to enable saving your analysis to a root file

Implements ana::ICrossSectionAnalysis.

Definition at line 374 of file TrivialCrossSectionAnalysis.cxx.

References dir, ana::ICrossSectionAnalysis::fData, ana::ICrossSectionAnalysis::fFidMax, ana::ICrossSectionAnalysis::fFidMin, fGenieMVEffDenom, fGenieMVEffNum, fHasGenieMultiverses, fHasPPFXMultiverses, ana::ICrossSectionAnalysis::fIsDifferential, ana::ICrossSectionAnalysis::fNDims, fPPFXMVEffDenom, fPPFXMVEffNum, fPPFXMVFlux, ana::ICrossSectionAnalysis::fXSecSpectra, ana::ICrossSectionAnalysis::HasData(), ana::XSecSysts::LabelFromSystematic(), ana::Multiverse::SaveTo(), ana::Spectrum::SaveTo(), tmp, and xsec.

Referenced by demo_trivial_xsec_analysis(), and TrivialCrossSectionAnalysis().

375  {
376  TDirectory * tmp = gDirectory;
377 
378  dir = dir->mkdir(name.c_str()); // switch to subdir
379  dir->cd();
380 
381  TObjString("TrivialCrossSectionAnalysis").Write("type");
382  if(fIsDifferential)
383  TObjString("true").Write("fIsDifferential");
384  for(std::pair<XSecSysts::Syst_t, CrossSectionSpectra *> xsec : fXSecSpectra) {
385  if(xsec.second)
386  xsec.second->SaveTo(dir, XSecSysts::LabelFromSystematic(xsec.first).Data());
387  }
388  fFidMax.Write("fFidMax");
389  fFidMin.Write("fFidMin");
390  TVectorD ndims(1);
391  ndims[0] = fNDims;
392  ndims.Write("ndims");
394  fGenieMVEffNum->SaveTo(dir, "fGenieMVEffNum");
395  fGenieMVEffDenom->SaveTo(dir, "fGenieMVEffDenom");
396  }
397  if(fHasPPFXMultiverses) {
398  fPPFXMVEffNum->SaveTo(dir, "fPPFXMVEffNum");
399  fPPFXMVEffDenom->SaveTo(dir, "fPPFXMVEffDenom");
400  fPPFXMVFlux->SaveTo(dir, "fPPFXMVFlux");
401  }
402  if(HasData())
403  fData->SaveTo(dir, "fData");
404 
405  dir->Write();
406  delete dir;
407 
408  tmp->cd();
409  }
static TString LabelFromSystematic(Syst_t)
Definition: XSecSysts.cxx:25
const XML_Char * name
Definition: expat.h:151
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Multiverse.cxx:550
Float_t tmp
Definition: plot.C:36
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
Double_t xsec[nknots]
Definition: testXsec.C:47
TDirectory * dir
Definition: macro.C:5
void ana::ICrossSectionAnalysis::SetAxis ( const HistAxis axis)
inherited
void ana::ICrossSectionAnalysis::SetAxisNT ( const NuTruthHistAxis axis)
inherited
void ana::ICrossSectionAnalysis::SetData ( Spectrum data)
inherited

Definition at line 158 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fData.

159  {
160  fData = data;
161  }
const XML_Char const XML_Char * data
Definition: expat.h:268
void ana::ICrossSectionAnalysis::SetFidMax ( TVector3  fidmax)
inherited

Definition at line 510 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fFidMax.

511  {
512  fFidMax = fidmax;
513  }
void ana::ICrossSectionAnalysis::SetFidMin ( TVector3  fidmin)
inherited

Definition at line 517 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fFidMin.

518  {
519  fFidMin = fidmin;
520  }
void ana::ICrossSectionAnalysis::SetNuTruthWeight ( XSecSysts::Syst_t  syst,
const NuTruthVar nt_var 
)
inherited

Definition at line 457 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fNuTruthWeights.

Referenced by InitSystematicSpectra().

459  {
460  fNuTruthWeights.insert(std::pair<XSecSysts::Syst_t, const NuTruthVar *>
461  (syst, new NuTruthVar(*nt_var)));
462  }
_Var< caf::SRNeutrinoProxy > NuTruthVar
Var designed to be used over the nuTree, ie all neutrinos, not just those that got slices...
Definition: Var.h:82
std::map< XSecSysts::Syst_t, const NuTruthVar * > fNuTruthWeights
void ana::ICrossSectionAnalysis::SetPOT ( double  POT)
inherited

Definition at line 18 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fPOT, and POT.

19  {
20  fPOT = POT;
21  }
std::vector< double > POT
void ana::ICrossSectionAnalysis::SetSelectionCut ( const Cut cut)
inherited

Definition at line 475 of file ICrossSectionAnalysis.cxx.

References cut, and ana::ICrossSectionAnalysis::fSelectionCut.

476  {
477  fSelectionCut = cut;
478  }
const Cut cut
Definition: exporter_fd.C:30
void ana::ICrossSectionAnalysis::SetSignalCut ( const NuTruthCut cut)
inherited

Definition at line 482 of file ICrossSectionAnalysis.cxx.

References cut, and ana::ICrossSectionAnalysis::fSignalCut.

483  {
484  fSignalCut = cut;
485  }
const Cut cut
Definition: exporter_fd.C:30
void ana::ICrossSectionAnalysis::SetSystShifts ( XSecSysts::Syst_t  syst,
const SystShifts shift 
)
inherited

Definition at line 466 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fSystShifts.

Referenced by InitSystematicSpectra().

468  {
469  fSystShifts.insert(std::pair<XSecSysts::Syst_t, const SystShifts *>
470  (syst, new SystShifts(*shift)));
471  }
std::map< XSecSysts::Syst_t, const SystShifts * > fSystShifts
void ana::ICrossSectionAnalysis::SetTarget ( TargetCount  target)
inherited

Definition at line 503 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fTarget.

504  {
505  fTarget = target;
506  }
const XML_Char * target
Definition: expat.h:268
void ana::ICrossSectionAnalysis::SetUnfoldingMethod ( UnfoldMethod_t  method)
inherited

Definition at line 687 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fUnfoldMethod.

Referenced by demo_trivial_xsec_analysis().

688  {
689  this->fUnfoldMethod = method;
690  }
void ana::ICrossSectionAnalysis::SetUnfoldingReg ( double  reg)
inherited

Definition at line 694 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fUnfoldReg.

Referenced by demo_trivial_xsec_analysis().

695  {
696  this->fUnfoldReg = reg;
697  }
void ana::ICrossSectionAnalysis::SetWeight ( XSecSysts::Syst_t  syst,
const Var var 
)
inherited

Definition at line 448 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fWeights.

Referenced by InitSystematicSpectra().

450  {
451  fWeights.insert(std::pair<XSecSysts::Syst_t, const Var *>
452  (syst, new Var(*var)));
453  }
_Var< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:74
std::map< XSecSysts::Syst_t, const Var * > fWeights
const Spectrum * ana::ICrossSectionAnalysis::SignalEstimate ( XSecSysts::Syst_t  syst)
inherited

Definition at line 136 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fData, and ana::ICrossSectionAnalysis::fXSecSpectra.

Referenced by ana::PlotAllSignalEstimates(), and ana::ICrossSectionAnalysis::UnfoldedSignal().

137  {
138  return fXSecSpectra[syst]->GetSignalEstimator()->Signal(fData);
139  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
TH1 * ana::ICrossSectionAnalysis::ToHist ( const Spectrum spec,
double  POT = -1 
)
protectedinherited

Definition at line 596 of file ICrossSectionAnalysis.cxx.

References om::cout, allTimeWatchdog::endl, ana::ICrossSectionAnalysis::fNDims, ana::Spectrum::POT(), ana::Spectrum::ToTH1(), ana::Spectrum::ToTH2(), and ana::Spectrum::ToTH3().

Referenced by Efficiency(), Flux(), Purity(), and ana::ICrossSectionAnalysis::UnfoldedSignal().

598  {
599  if(POT < 0)
600  POT = spec.POT();
601 
602  switch(fNDims) {
603  case(1) : {
604  return spec.ToTH1(POT);
605  }
606  case(2) : {
607  return spec.ToTH2(POT);
608  }
609  case(3) : {
610  return spec.ToTH3(POT);
611  }
612  default : {
613  std::cout << "Dimension of measurement undetermined." << std::endl;
614  abort();
615  }
616  } // end switch case
617  }
OStream cout
Definition: OStream.cxx:6
std::vector< double > POT
std::pair< TH1 *, TH1 * > ana::TrivialCrossSectionAnalysis::TotalErrors ( )
overridevirtual

Function that calculates total uncertainty on the cross section result Returns pair of histograms. First and second in pair are up and down shifts respectively

Implements ana::ICrossSectionAnalysis.

Definition at line 156 of file TrivialCrossSectionAnalysis.cxx.

References delta, FluxError(), ana::ICrossSectionAnalysis::fXSec, GenieError(), ana::XSecSysts::GetAllSystematics(), MECModelEnuComparisons::i, makeTrainCVSamples::int, calib::j, ana::XSecSysts::kNominal, RelativeUncertainty(), and systs.

Referenced by TrivialCrossSectionAnalysis().

157  {
158  // load file systematic shifts
159  std::vector<XSecSysts::Syst_t> systs = XSecSysts::GetAllSystematics();
160  std::vector<TH1 *> shifts;
161  for(XSecSysts::Syst_t syst : systs) {
162  shifts.push_back(RelativeUncertainty(syst));
163  }
164  // genie and ppfx shifts
165  std::pair<TH1 *, TH1 *> flux_error = FluxError();
166  std::pair<TH1 *, TH1 *> genie_error = GenieError();
167  TH1 * flux_up = flux_error.first;
168  TH1 * flux_down = flux_error.second;
169  TH1 * genie_up = genie_error.first;
170  TH1 * genie_down = genie_error.second;
171 
172  TH1 * nominal = fXSec[XSecSysts::kNominal];
173  TH1 * errup = (TH1*) nominal->Clone();
174  TH1 * errdown = (TH1*) nominal->Clone();
175  double up, down, delta;
176 
177  for(int i = 1; i <= nominal->GetNbinsX(); i++) {
178  for(int j = 1; j <= nominal->GetNbinsY(); j++) {
179  for(int k = 1; k <= nominal->GetNbinsZ(); k++) {
180  double totalup = 0;
181  double totaldown = 0;
182  // process file systematics
183  for(int ishift = 0; ishift < (int) shifts.size(); ishift++) {
184  delta =
185  shifts[ishift]->GetBinContent(i, j, k) - nominal->GetBinContent(i, j, k);
186  if(delta > 0) {
187  up = delta;
188  down = 0;
189  }
190  else {
191  up = 0;
192  down = delta;
193  }
194  totalup += up * up;
195  totaldown += down * down;
196  }
197  // now genie and ppfx universes
198  up = genie_up->GetBinContent(i, j, k) - nominal->GetBinContent(i, j, k);
199  down = genie_down->GetBinContent(i, j, k) - nominal->GetBinContent(i, j, k);
200  totalup += up * up;
201  totaldown += down * down;
202 
203  up = flux_up->GetBinContent(i, j, k) - nominal->GetBinContent(i, j, k);
204  down = flux_down->GetBinContent(i, j, k) - nominal->GetBinContent(i, j, k);
205  totalup += up * up;
206  totaldown += down * down;
207  errup->SetBinContent(i, j, k, totalup);
208  errdown->SetBinContent(i, j, k, totaldown);
209  }
210  }
211  }
212  return std::pair<TH1 *, TH1 *> (errup, errdown);
213  }
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
double delta
Definition: runWimpSim.h:98
TH1 * RelativeUncertainty(XSecSysts::Syst_t) override
Function that calculates relative uncertainty on the cross section result.
std::pair< TH1 *, TH1 * > GenieError()
Function that calculates the up (first) and down (second) error on the genie universes.
static std::vector< Syst_t > GetAllSystematics()
Definition: XSecSysts.cxx:9
std::pair< TH1 *, TH1 * > FluxError() override
Function that calculates the up (first) and down (second) error on the flux estimation.
const double j
Definition: BetheBloch.cxx:29
std::map< XSecSysts::Syst_t, TH1 * > fXSec
const TH1 * ana::ICrossSectionAnalysis::UnfoldedSignal ( XSecSysts::Syst_t  syst)
inherited

Definition at line 552 of file ICrossSectionAnalysis.cxx.

References ana::ICrossSectionAnalysis::fUnfoldMethod, ana::ICrossSectionAnalysis::fUnfoldReg, ana::ICrossSectionAnalysis::fXSecSpectra, ana::kMaxEnt, ana::kSVD, ana::kTikhonov, ana::ICrossSectionAnalysis::SignalEstimate(), ana::ICrossSectionAnalysis::ToHist(), ana::UnfoldIterative::Truth(), ana::UnfoldSVD::Truth(), and ana::UnfoldTikhonov::Truth().

Referenced by ana::ICrossSectionAnalysis::CrossSection(), FluxError(), GenieError(), and ana::PlotAllUnfoldedSignalEstimates().

553  {
554  const ReweightableSpectrum * recotrue = fXSecSpectra[syst]->GetRecoTrue();
555  const Spectrum * signal = SignalEstimate(syst);
556 
557  switch(fUnfoldMethod) {
558  case(UnfoldMethod_t::kTikhonov) : {
559  UnfoldTikhonov unfold(*recotrue, fUnfoldReg);
560  return ToHist(unfold.Truth(*signal));
561 
562  }
563  case(UnfoldMethod_t::kSVD) : {
564  UnfoldSVD unfold(*recotrue, fUnfoldReg);
565  return ToHist(unfold.Truth(*signal));
566 
567  }
568  case(UnfoldMethod_t::kMaxEnt) : {
569  UnfoldMaxEnt unfold(*recotrue, fUnfoldReg);
570  return ToHist(unfold.Truth(*signal));
571 
572  }
573  default : {
574  UnfoldIterative unfold(*recotrue, fUnfoldReg);
575  return ToHist(unfold.Truth(*signal));
576  }
577  } // end switch-case
578  }
std::map< XSecSysts::Syst_t, CrossSectionSpectra * > fXSecSpectra
std::vector< float > Spectrum
Definition: Constants.h:610
TH1 * ToHist(const Spectrum &, double=-1)
const Spectrum * SignalEstimate(XSecSysts::Syst_t)

Member Data Documentation

std::vector<Cut> ana::TrivialCrossSectionAnalysis::fBkgdCuts
private

Definition at line 106 of file TrivialCrossSectionAnalysis.h.

Referenced by InitSystematicSpectra().

const Spectrum* ana::ICrossSectionAnalysis::fData = NULL
protectedinherited
const Binning* ana::ICrossSectionAnalysis::fENuBinning = NULL
protectedinherited
TVector3 ana::ICrossSectionAnalysis::fFidMax
protectedinherited
TVector3 ana::ICrossSectionAnalysis::fFidMin
protectedinherited
Multiverse* ana::TrivialCrossSectionAnalysis::fGenieMVEffDenom = NULL
private
Multiverse* ana::TrivialCrossSectionAnalysis::fGenieMVEffNum = NULL
private
std::vector<TH1 *> ana::TrivialCrossSectionAnalysis::fGenieXSec
private
bool ana::TrivialCrossSectionAnalysis::fHasGenieMultiverses = false
private

Definition at line 96 of file TrivialCrossSectionAnalysis.h.

Referenced by InitGenieUniverses(), and SaveTo().

bool ana::TrivialCrossSectionAnalysis::fHasPPFXMultiverses = false
private

Definition at line 97 of file TrivialCrossSectionAnalysis.h.

Referenced by InitPPFXUniverses(), and SaveTo().

bool ana::ICrossSectionAnalysis::fIsDifferential
protectedinherited
int ana::ICrossSectionAnalysis::fNDims = 0
protectedinherited
std::map<XSecSysts::Syst_t, const NuTruthVar *> ana::ICrossSectionAnalysis::fNuTruthWeights
protectedinherited
int ana::ICrossSectionAnalysis::fPDG = 0
protectedinherited
double ana::ICrossSectionAnalysis::fPOT
protectedinherited
Multiverse* ana::TrivialCrossSectionAnalysis::fPPFXMVEffDenom = NULL
private
Multiverse* ana::TrivialCrossSectionAnalysis::fPPFXMVEffNum = NULL
private
Multiverse* ana::TrivialCrossSectionAnalysis::fPPFXMVFlux = NULL
private
std::vector<TH1 *> ana::TrivialCrossSectionAnalysis::fPPFXXSec
private
const HistAxis* ana::ICrossSectionAnalysis::fRecoAxis = NULL
protectedinherited
const Cut* ana::ICrossSectionAnalysis::fSelectionCut = NULL
protectedinherited
const NuTruthCut* ana::ICrossSectionAnalysis::fSignalCut = NULL
protectedinherited
std::map<XSecSysts::Syst_t, const SystShifts *> ana::ICrossSectionAnalysis::fSystShifts
protectedinherited
TargetCount ana::ICrossSectionAnalysis::fTarget
protectedinherited
const NuTruthHistAxis* ana::ICrossSectionAnalysis::fTruthAxis = NULL
protectedinherited
UnfoldMethod_t ana::ICrossSectionAnalysis::fUnfoldMethod = kNone
protectedinherited
double ana::ICrossSectionAnalysis::fUnfoldReg = 0
protectedinherited
std::map<XSecSysts::Syst_t, const Var *> ana::ICrossSectionAnalysis::fWeights
protectedinherited
std::map<XSecSysts::Syst_t, TH1 *> ana::ICrossSectionAnalysis::fXSec
protectedinherited
std::map<XSecSysts::Syst_t, CrossSectionSpectra * > ana::ICrossSectionAnalysis::fXSecSpectra
protectedinherited

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