Public Member Functions | List of all members
demo::DemoSyst2 Class Reference
Inheritance diagram for demo::DemoSyst2:
ana::ISyst

Public Member Functions

 DemoSyst2 ()
 
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...
 

Detailed Description

Definition at line 98 of file demoSysts.C.

Constructor & Destructor Documentation

demo::DemoSyst2::DemoSyst2 ( )
inline

Definition at line 101 of file demoSysts.C.

102  : ISyst("DemoSyst2", "Demo syst ##2")
103  {}
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 demo::DemoSyst2::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 107 of file demoSysts.C.

References caf::Proxy< caf::StandardRecord >::energy, caf::Proxy< caf::SRNumuEnergy >::hadcalE, caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nnu, caf::Proxy< caf::SRTruthBranch >::nu, and caf::Proxy< caf::SREnergyBranch >::numu.

108  {
109  // if no truth info, we can't do anything
110  if (sr->mc.nnu != 1)
111  return;
112 
113  unsigned int nNeutron = 0;
114  for (const auto & particle : sr->mc.nu[0].prim)
115  {
116  if (particle.pdg != 2112)
117  continue;
118 
119  // only increase if they were less than 50 MeV to begin with
120  if (particle.visEinslcBirks + particle.daughterVisEinslcBirks >= 0.050)
121  continue;
122 
123  nNeutron++;
124  }
125 
126  // now adjust the numu energy.
127  // we're going to add 25 MeV of visible energy for each neutron
128  // for the +1sigma shift (and subtract it for -1sigma, etc.)
129  double addedE = sigma * 0.025 * nNeutron;
130  if (sr->energy.numu.hadcalE + addedE < 0)
131  addedE = -sr->energy.numu.hadcalE; // don't let the shift make a negative energy deposit
132 
133  sr->energy.numu.hadcalE += addedE; // this goes into the numu energy estimator function
134 
135  }
caf::Proxy< caf::SRNumuEnergy > numu
Definition: SRProxy.h:214
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
caf::Proxy< caf::SREnergyBranch > energy
Definition: SRProxy.h:2136
caf::Proxy< float > hadcalE
Definition: SRProxy.h:169
double sigma(TH1F *hist, double percentile)
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
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  }

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