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

#include "/cvmfs/"

Inheritance diagram for ana::NueExtrapSystSignalKin2017:

Public Member Functions

 NueExtrapSystSignalKin2017 ()
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

TH1 * fWeightHist

Detailed Description

Definition at line 21 of file NueExtrapSysts.h.

Constructor & Destructor Documentation

ana::NueExtrapSystSignalKin2017::NueExtrapSystSignalKin2017 ( )

Definition at line 24 of file NueExtrapSysts.h.

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

24 : ISyst("extrap_signalkin", "Extrapolation ND to FD Kinematics Signal"), fWeightHist() {}
ISyst(const std::string &shortName, const std::string &latexName)
Definition: ISyst.cxx:10

Member Function Documentation

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

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

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::NueExtrapSystSignalKin2017::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const

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.

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 45 of file NueExtrapSysts.cxx.

References abs(), om::cerr, plot_validation_datamc::Clone(), caf::Proxy< caf::SRHeader >::det, allTimeWatchdog::endl, ana::FindCAFAnaDir(), GetXaxis(), caf::Proxy< caf::StandardRecord >::hdr, ana::kCVNe, caf::kNEARDET, ana::kRecoQ2, caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nnu, caf::Proxy< caf::SRTruthBranch >::nu, and string.

46  {
47  //Check if in ND, otherwise no reweighting
48  if(sr->hdr.det != caf::kNEARDET) return;
50  //Check if muon neutrino
51  if(sr->mc.nnu == 0) return;
52  if(abs(sr->[0].pdg) != 14) return;
54  //Check if affecting nue background
55  if(kCVNe(sr) >= 0.5) return;
57  if(!fWeightHist){
59  //Weights in file from docdb-22478 ND to FD kinematics technote
60  //Can be remade with CAFAna/nue/Ana2017/NDtoFDkin/ scripts
61  //Using only the weight with max impact, i.e. trueQ2 weight, see technote
62  const std::string kWeightsFname = FindCAFAnaDir()+"/data/nue/NDtoFD_kin_combo_weights.root";
63  const std::string kWeightName = "trueQ2_weight_AllSamples";
65  TFile weightsFile (kWeightsFname.c_str(),"read");
66  if(weightsFile.IsZombie()){
67  std::cerr << "Warning: couldn't open " << kWeightsFname << std::endl;
68  abort();
69  }
71  fWeightHist = (TH1*) weightsFile.Get(kWeightName.c_str())->Clone();
73  //disassociate the weight histogram from file
74  fWeightHist -> SetDirectory(0);
76  weightsFile.Close();
77  }
79  double kKinVar = kRecoQ2(sr);
80  double kKinWeight = 1;
82  if(kKinVar >= fWeightHist->GetXaxis()->GetXmin() &&
83  kKinVar <= fWeightHist->GetXaxis()->GetXmax() ){
84  kKinWeight = fWeightHist->GetBinContent(fWeightHist->GetXaxis()->FindBin(kKinVar));
85  }
86  else if(kKinVar > fWeightHist->GetXaxis()->GetXmax()){
87  kKinWeight = fWeightHist->GetBinContent(fWeightHist->GetNbinsX());
88  }
89  else if(kKinVar < fWeightHist->GetXaxis()->GetXmin()){
90  kKinWeight = fWeightHist->GetBinContent(1);
91  }
93  weight *= 1+(kKinWeight-1)*sigma;
94  }
Near Detector underground.
Definition: SREnums.h:10
const ana::Var kRecoQ2([](const caf::SRProxy *sr){const double M_mu_sqrd=util::sqr(0.1056);double E_mu=kMuE(sr);double p_mu=sqrt(util::sqr(E_mu)-M_mu_sqrd);return 2 *kCCE(sr)*(E_mu-p_mu *kCosNumi(sr))-M_mu_sqrd;})
Reconstructed four-momentum transfer invariant (Q^2)
Definition: NumuVars.h:146
const Var kCVNe
Definition: Vars.cxx:35
const Var weight
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
OStream cerr
Definition: OStream.cxx:7
void abs(TH1 *hist)
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
correl_xv GetXaxis() -> SetDecimals()
double sigma(TH1F *hist, double percentile)
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
caf::Proxy< caf::Det_t > det
Definition: SRProxy.h:232
enum BeamMode string
virtual const std::string& ana::ISyst::ShortName ( ) const
virtual void ana::ISyst::TruthShift ( double  sigma,
caf::SRNeutrinoProxy nu,
double &  weight 
) const

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 ana::BeamSyst, demo::DemoSyst1, ana::GenericSystComponentScale< T >, ana::GenericSystComponentScale< T >, ana::GenericSystComponentScale< T >, ana::ReinteractionSyst, 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

TH1* ana::NueExtrapSystSignalKin2017::fWeightHist

Definition at line 29 of file NueExtrapSysts.h.

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