Public Member Functions | Protected Attributes | List of all members
ana::UnfoldSVD Class Reference More...

#include "/cvmfs/"

Inheritance diagram for ana::UnfoldSVD:

Public Member Functions

 UnfoldSVD (const ReweightableSpectrum &rt, int reg)
virtual ~UnfoldSVD ()
virtual Spectrum Truth (const Spectrum &reco) override

Protected Attributes

const ReweightableSpectrumfRT
double fReg
 Regularization strength. More...

Detailed Description

Definition at line 10 of file UnfoldSVD.h.

Constructor & Destructor Documentation

ana::UnfoldSVD::UnfoldSVD ( const ReweightableSpectrum rt,
int  reg 

Limitation: rt must be a square matrix

rtReco-vs-True matrix
regLower = smoother

Definition at line 12 of file UnfoldSVD.cxx.

14  : fRT(rt), fReg(reg)
15  {
16  }
const ReweightableSpectrum & fRT
Definition: UnfoldSVD.h:25
double fReg
Regularization strength.
Definition: UnfoldSVD.h:27
ana::UnfoldSVD::~UnfoldSVD ( )

Definition at line 19 of file UnfoldSVD.cxx.

20  {
21  }

Member Function Documentation

Spectrum ana::UnfoldSVD::Truth ( const Spectrum reco)

Implements ana::IUnfold.

Definition at line 24 of file UnfoldSVD.cxx.

References fReg, fRT, ana::Spectrum::GetBinnings(), ana::Spectrum::GetLabels(), MECModelEnuComparisons::i, ana::Spectrum::Integral(), ana::Spectrum::Livetime(), ana::Spectrum::POT(), runNovaSAM::ret, ana::Spectrum::ToTH1(), ana::ReweightableSpectrum::ToTH2(), ana::ReweightableSpectrum::UnWeighted(), and ana::ReweightableSpectrum::WeightingVariable().

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

25  {
26  std::unique_ptr<TH1D> hReco(reco.ToTH1(reco.POT()));
27  std::unique_ptr<TH1D> hMCReco(fRT.UnWeighted().ToTH1(reco.POT()));
28  std::unique_ptr<TH1D> hMCTrue(fRT.WeightingVariable().ToTH1(reco.POT()));
29  std::unique_ptr<TH2D> hRT(fRT.ToTH2(reco.POT()));
31  TSVDUnfold uf(hReco.get(), hMCReco.get(), hMCTrue.get(), hRT.get());
33  std::unique_ptr<TH1D> h_unf(uf.Unfold(fReg));
35  Eigen::ArrayXd ret(h_unf->GetNbinsX()+2);
36  for(int i = 0; i < h_unf->GetNbinsX()+2; ++i) ret[i] = h_unf->GetBinContent(i);
37  // Enforce matching normalization
38  ret *= reco.Integral(reco.POT())/ret.sum();
40  return Spectrum(ret,
41  HistAxis(reco.GetLabels(), reco.GetBinnings()),
42  reco.POT(), reco.Livetime());
43  }
const ReweightableSpectrum & fRT
Definition: UnfoldSVD.h:25
_HistAxis< Var > HistAxis
Definition: HistAxis.h:103
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
Definition: Spectrum.cxx:148
std::vector< float > Spectrum
Definition: Constants.h:610
double fReg
Regularization strength.
Definition: UnfoldSVD.h:27
TH2D * ToTH2(double pot) const

Member Data Documentation

double ana::UnfoldSVD::fReg

Regularization strength.

Definition at line 27 of file UnfoldSVD.h.

Referenced by Truth().

const ReweightableSpectrum& ana::UnfoldSVD::fRT

Definition at line 25 of file UnfoldSVD.h.

Referenced by Truth().

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