Public Member Functions | Protected Attributes | List of all members
ana::SystFromWeight Class Reference

Simple adaptor class to convert a weight Var to an ISyst. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/CAFAna/Systs/SystFromWeight.h"

Inheritance diagram for ana::SystFromWeight:
ana::ISyst

Public Member Functions

 SystFromWeight (const std::string &shortName, const std::string &latexName, const Var &wei)
 
void Shift (double sigma, caf::SRProxy *sr, double &weight) const override
 Perform the systematic shift. More...
 
virtual const std::stringShortName () const final
 The name printed out to the screen. More...
 
virtual const std::stringLatexName () const final
 The name used on plots (ROOT's TLatex syntax) More...
 
virtual void TruthShift (double sigma, caf::SRNeutrinoProxy *nu, double &weight) const
 
virtual bool IsGenieReweight () const
 GENIE reweights can only provide +/-1,2sigma. More...
 

Protected Attributes

Var fWei
 

Detailed Description

Simple adaptor class to convert a weight Var to an ISyst.

This is NOT a systematic useable for making a fit. This class is intended for specific purposes where one wants to systematically distort a MC spectrum by reweighting it, but the interfaces (eg in decomps) only wants a SystShifts.

Definition at line 16 of file SystFromWeight.h.

Constructor & Destructor Documentation

ana::SystFromWeight::SystFromWeight ( const std::string shortName,
const std::string latexName,
const Var wei 
)
inline

Definition at line 19 of file SystFromWeight.h.

22  : ISyst(shortName, latexName), fWei(wei)
23  {
24  }
string shortName
THUMBNAIL BLOCK: We need to make a thumbnail for each.
ISyst(const std::string &shortName, const std::string &latexName)
Definition: ISyst.cxx:10

Member Function Documentation

virtual bool ana::ISyst::IsGenieReweight ( ) const
inlinevirtualinherited

GENIE reweights can only provide +/-1,2sigma.

Reimplemented in ana::SummedSyst.

Definition at line 56 of file ISyst.h.

56 {return false;}
virtual const std::string& ana::ISyst::LatexName ( ) const
inlinefinalvirtualinherited

The name used on plots (ROOT's TLatex syntax)

Definition at line 30 of file ISyst.h.

References ana::ISyst::fLatexName, ana::ISyst::Shift(), sigma(), sr, and ana::weight.

Referenced by ana::PredictionInterp::DebugPlotColz(), GetGENIEShiftLabels(), ana::NuISyst::SaveTo(), SystsGENIEAna(), and WriteSystName().

30 {return fLatexName;}
std::string fLatexName
Definition: ISyst.h:60
void ana::SystFromWeight::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const
inlineoverridevirtual

Perform the systematic shift.

Override this function if your systematic depends on non-SRNeutrino quantities. If it is SRNeutrino-only, implement the other function, and let this default forward to you when necessary.

Parameters
sigmaNumber of sigma to shift record by
srThe record to inspect and alter
weightScale this weight for reweighting systematics

Reimplemented from ana::ISyst.

Definition at line 26 of file SystFromWeight.h.

References ana::assert(), and fWei.

27  {
28  if(sigma == 0) return;
29  assert(sigma == +1);
30  weight *= fWei(sr);
31  }
const Var weight
double sigma(TH1F *hist, double percentile)
assert(nhit_max >=nhit_nbins)
virtual const std::string& ana::ISyst::ShortName ( ) const
inlinefinalvirtualinherited
virtual void ana::ISyst::TruthShift ( double  sigma,
caf::SRNeutrinoProxy nu,
double &  weight 
) const
inlinevirtualinherited

For systematics that deal only with the neutrino truth and not any reconstruction/PID details. Systematics defined this way will work on nuTree-derived spectra too (e.g. denominators of efficiencies).

Reimplemented in demo::DemoSyst1, ana::BeamSyst, ana::GenericSystComponentScale< T >, ana::GenericSystComponentScale< T >, ana::GenericSystComponentScale< T >, and ana::NOvARwgtSyst.

Definition at line 46 of file ISyst.h.

Referenced by ana::ISyst::Shift().

49  {
50  // Implement this function if your systematic depends only
51  // SRNeutrino. Left blank by default, since systematics using other
52  // information can do nothing sensible to the nuTree.
53  }

Member Data Documentation

Var ana::SystFromWeight::fWei
protected

Definition at line 34 of file SystFromWeight.h.

Referenced by Shift().


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