All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
ana::EnergyScaleSyst Class Reference

#include <EnergySysts.h>

Inheritance diagram for ana::EnergyScaleSyst:
ana::ISyst

Public Member Functions

 EnergyScaleSyst (EnergyScaleSystTerm _term, EnergyScaleSystParticle _part, EnergyScaleSystDetector _detector, double _uncertainty, const std::string &name, const std::string &latexName)
 
void Shift (double sigma, caf::SRSliceProxy *sr, double &weight) const override
 Perform the systematic shift. More...
 
- Public Member Functions inherited from ana::ISyst
 ISyst (const std::string &shortName, const std::string &latexName, bool applyPenalty=true, double min=-3, double max=+3)
 
 ISyst (const ISyst &)=delete
 
 ISyst (ISyst &&rhs)=delete
 
virtual ~ISyst ()
 
void operator= (const ISyst &)=delete
 
void operator= (ISyst &&)=delete
 
virtual std::string ShortName () const final
 The name printed out to the screen. More...
 
virtual std::string LatexName () const final
 The name used on plots (ROOT's TLatex syntax) More...
 
virtual double Penalty (double x) const
 
virtual bool ApplyPenalty () const
 Should a penalty be applied for this shift? More...
 
virtual double Min () const
 Return the min/max value for this syst. More...
 
virtual double Max () const
 
virtual int PredInterpMaxNSigma () const
 

Private Attributes

EnergyScaleSystTerm term
 
EnergyScaleSystParticle part
 
EnergyScaleSystDetector detector
 
double uncertainty
 

Detailed Description

Definition at line 33 of file EnergySysts.h.

Constructor & Destructor Documentation

ana::EnergyScaleSyst::EnergyScaleSyst ( EnergyScaleSystTerm  _term,
EnergyScaleSystParticle  _part,
EnergyScaleSystDetector  _detector,
double  _uncertainty,
const std::string &  name,
const std::string &  latexName 
)
inline

Definition at line 36 of file EnergySysts.h.

36  :
37  ISyst(name, latexName), term(_term), part(_part), detector(_detector), uncertainty(_uncertainty) {}
ISyst(const std::string &shortName, const std::string &latexName, bool applyPenalty=true, double min=-3, double max=+3)
Definition: ISyst.cxx:9
EnergyScaleSystParticle part
Definition: EnergySysts.h:43
EnergyScaleSystTerm term
Definition: EnergySysts.h:42
EnergyScaleSystDetector detector
Definition: EnergySysts.h:44
then echo fcl name

Member Function Documentation

void ana::EnergyScaleSyst::Shift ( double  sigma,
caf::SRSliceProxy sr,
double &  weight 
) const
overridevirtual

Perform the systematic shift.

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

Implements ana::ISyst.

Definition at line 6 of file EnergySysts.cxx.

7  {
8  double scale = uncertainty * sigma;
9  auto& det = sr->truth.det;
11  bool nd = (detector == EnergyScaleSystDetector::kSBND && det == caf::kSBND);
12  bool ub = (detector == EnergyScaleSystDetector::kMicroBooNE && det != caf::kSBND && det != caf::kICARUS);
14  bool detector_cut = all || nd || ub || fd;
15  if(!sr->truth.iscc || abs(sr->truth.pdg) != 14 || isnan(sr->fake_reco.nuE) || !detector_cut)
16  return ;
17  double particle_energy = 0.0;
18  switch(part) {
20  particle_energy += sr->fake_reco.lepton.ke;
21  break;
23  for(const auto& hadron: sr->fake_reco.hadrons) {
24  particle_energy += hadron.ke;
25  }
26  break;
28  for(const auto& hadron: sr->fake_reco.hadrons) {
29  if(hadron.pid == 2112) {
30  particle_energy += hadron.ke;
31  }
32  }
33  break;
35  for(const auto& hadron: sr->fake_reco.hadrons) {
36  if(hadron.pid == 111) {
37  particle_energy += hadron.ke;
38  }
39  }
40  break;
42  for(const auto& hadron: sr->fake_reco.hadrons) {
43  auto pid = hadron.pid;
44  if(pid == 2212 || abs(pid) == 211) {
45  particle_energy += hadron.ke;
46  }
47  }
48  break;
49  }
50  switch(term) {
52  break;
54  scale *= std::sqrt(particle_energy);
55  break;
57  scale /= std::sqrt(particle_energy + 0.1);
58  break;
59  }
60  sr->fake_reco.nuE += particle_energy * scale;
61 
62  }
EnergyScaleSystParticle part
Definition: EnergySysts.h:43
T abs(T value)
EnergyScaleSystTerm term
Definition: EnergySysts.h:42
EnergyScaleSystDetector detector
Definition: EnergySysts.h:44

Member Data Documentation

EnergyScaleSystDetector ana::EnergyScaleSyst::detector
private

Definition at line 44 of file EnergySysts.h.

EnergyScaleSystParticle ana::EnergyScaleSyst::part
private

Definition at line 43 of file EnergySysts.h.

EnergyScaleSystTerm ana::EnergyScaleSyst::term
private

Definition at line 42 of file EnergySysts.h.

double ana::EnergyScaleSyst::uncertainty
private

Definition at line 45 of file EnergySysts.h.


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