Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ana::GenericSystComponentScale< T > Class Template Reference

Uncertainty in the scale of a single component of the spectrum. More...

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

Inheritance diagram for ana::GenericSystComponentScale< T >:
ana::ISyst

Public Types

enum  ESystType { kLinear, kExponential }
 

Public Member Functions

 GenericSystComponentScale (const std::string &shortName, const std::string &latexName, const _Cut< T > &cut, double oneSigma, ESystType type=kExponential)
 
double OneSigmaScale () const
 Scaling this component between 1/(1+x) and (1+x) is the 1-sigma range. More...
 
const _Cut< T > & GetCut () const
 
void Shift (double sigma, caf::SRProxy *rec, double &weight) const override
 Perform the systematic shift. More...
 
void TruthShift (double sigma, caf::SRNeutrinoProxy *rec, double &weight) const override
 
template<>
void Shift (double sigma, caf::SRProxy *rec, double &weight) const
 Perform the systematic shift. More...
 
template<>
void Shift (double sigma, caf::SRProxy *rec, double &weight) const
 Perform the systematic shift. More...
 
template<>
void TruthShift (double sigma, caf::SRNeutrinoProxy *rec, double &weight) const
 
template<>
void TruthShift (double sigma, caf::SRNeutrinoProxy *rec, double &weight) const
 
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 bool IsGenieReweight () const
 GENIE reweights can only provide +/-1,2sigma. More...
 

Protected Member Functions

void DoShift (double sigma, T *rec, double &weight) const
 

Protected Attributes

_Cut< TfCut
 
double fOneSigma
 
ESystType fType
 

Detailed Description

template<class T>
class ana::GenericSystComponentScale< T >

Uncertainty in the scale of a single component of the spectrum.

Definition at line 9 of file SystComponentScale.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

template<class T >
ana::GenericSystComponentScale< T >::GenericSystComponentScale ( const std::string shortName,
const std::string latexName,
const _Cut< T > &  cut,
double  oneSigma,
ESystType  type = kExponential 
)
inline
Parameters
cutSelect the component to be scaled

Definition at line 15 of file SystComponentScale.h.

20  : ISyst(shortName, latexName),
21  fCut(cut), fOneSigma(oneSigma), fType(type)
22  {
23  }
const Cut cut
Definition: exporter_fd.C:30
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

template<class T >
void ana::GenericSystComponentScale< T >::DoShift ( double  sigma,
T rec,
double &  weight 
) const
protected

Definition at line 13 of file SystComponentScale.cxx.

References std::max(), cet::pow(), and ana::GenericSystComponentScale< T >::Shift().

Referenced by ana::GenericSystComponentScale< T >::GetCut().

14  {
15  if(!fCut(rec)) return;
16 
17  if(fType == kExponential){
18  weight *= pow(1+fOneSigma, sigma);
19  }
20  else{
21  weight *= 1+sigma*fOneSigma;
22  weight = std::max(0., weight);
23  }
24  }
T max(const caf::Proxy< T > &a, T b)
const Var weight
constexpr T pow(T x)
Definition: pow.h:75
caf::StandardRecord * rec
Definition: tutCAFMacro.C:20
double sigma(TH1F *hist, double percentile)
template<class T >
const _Cut<T>& ana::GenericSystComponentScale< T >::GetCut ( ) const
inline
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
template<class T >
double ana::GenericSystComponentScale< T >::OneSigmaScale ( ) const
inline

Scaling this component between 1/(1+x) and (1+x) is the 1-sigma range.

Definition at line 26 of file SystComponentScale.h.

References ana::GenericSystComponentScale< T >::fOneSigma.

template<>
void ana::GenericSystComponentScale< caf::SRProxy >::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const
virtual

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 29 of file SystComponentScale.cxx.

References ana::GenericSystComponentScale< T >::Shift().

30  {
32  }
const Var weight
caf::StandardRecord * rec
Definition: tutCAFMacro.C:20
void DoShift(double sigma, T *rec, double &weight) const
double sigma(TH1F *hist, double percentile)
template<class T >
void ana::GenericSystComponentScale< T >::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const
overridevirtual

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.

Referenced by ana::GenericSystComponentScale< T >::DoShift(), ana::GenericSystComponentScale< T >::GetCut(), and ana::GenericSystComponentScale< T >::Shift().

template<>
void ana::GenericSystComponentScale< caf::SRNeutrinoProxy >::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const
virtual

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 35 of file SystComponentScale.cxx.

References ana::ISyst::Shift(), and ana::GenericSystComponentScale< T >::TruthShift().

36  {
38  }
const Var weight
caf::StandardRecord * rec
Definition: tutCAFMacro.C:20
virtual void Shift(double sigma, caf::SRProxy *sr, double &weight) const
Perform the systematic shift.
Definition: ISyst.cxx:26
double sigma(TH1F *hist, double percentile)
virtual const std::string& ana::ISyst::ShortName ( ) const
inlinefinalvirtualinherited
template<class T >
void ana::GenericSystComponentScale< T >::TruthShift ( double  sigma,
caf::SRNeutrinoProxy nu,
double &  weight 
) const
overridevirtual

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 from ana::ISyst.

Referenced by ana::GenericSystComponentScale< T >::GetCut(), ana::GenericSystComponentScale< T >::Shift(), and ana::GenericSystComponentScale< T >::TruthShift().

template<>
void ana::GenericSystComponentScale< caf::SRProxy >::TruthShift ( double  sigma,
caf::SRNeutrinoProxy nu,
double &  weight 
) const
virtual

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 from ana::ISyst.

Definition at line 41 of file SystComponentScale.cxx.

References ana::GenericSystComponentScale< T >::TruthShift().

42  {
43  // Nothing
44  }
template<>
void ana::GenericSystComponentScale< caf::SRNeutrinoProxy >::TruthShift ( double  sigma,
caf::SRNeutrinoProxy nu,
double &  weight 
) const
virtual

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 from ana::ISyst.

Definition at line 47 of file SystComponentScale.cxx.

48  {
50  }
const Var weight
caf::StandardRecord * rec
Definition: tutCAFMacro.C:20
void DoShift(double sigma, T *rec, double &weight) const
double sigma(TH1F *hist, double percentile)

Member Data Documentation

template<class T >
_Cut<T> ana::GenericSystComponentScale< T >::fCut
protected

Definition at line 36 of file SystComponentScale.h.

Referenced by ana::GenericSystComponentScale< T >::GetCut().

template<class T >
double ana::GenericSystComponentScale< T >::fOneSigma
protected
template<class T >
ESystType ana::GenericSystComponentScale< T >::fType
protected

Definition at line 38 of file SystComponentScale.h.


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