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

#include "/cvmfs/"

Inheritance diagram for ana::NueAcceptSystSignalKin2018RHC:

Public Member Functions

 NueAcceptSystSignalKin2018RHC ()
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 * fWeightHistRHC

Detailed Description

Definition at line 64 of file NueAcceptSysts.h.

Constructor & Destructor Documentation

ana::NueAcceptSystSignalKin2018RHC::NueAcceptSystSignalKin2018RHC ( )

Definition at line 67 of file NueAcceptSysts.h.

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

67 : ISyst("accept_signalkin_RHC_2018", "Acceptance ND to FD Kinematics Signal RHC 2018"), fWeightHistRHC() {}
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::NueAcceptSystSignalKin2018RHC::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 218 of file NueAcceptSysts.cxx.

References abs(), om::cerr, plot_validation_datamc::Clone(), caf::Proxy< caf::SRHeader >::det, allTimeWatchdog::endl, ana::FindCAFAnaDir(), caf::Proxy< caf::StandardRecord >::hdr, caf::kFARDET, ana::kIsRHC, ana::kNue2018AnaBin, ana::kNue2018FDAllSamples, caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nnu, caf::Proxy< caf::SRTruthBranch >::nu, and string.

219  {
220  // Check if RHC, otherwise left unaltered
221  if(!kIsRHC(sr)) return;
223  // Check if in FD, otherwise left unaltered
224  if(sr->hdr.det != caf::kFARDET) return;
226  // Check if signal or WS
227  if(sr->mc.nnu == 0) return;
228  if(
229  abs(sr->[0].pdg) != 12 ||
230  abs(sr->[0].pdgorig) != 14 ||
231  !(sr->[0].iscc)
232  ) return;
234  if(!fWeightHistRHC){
236  // FD in file from docdb-27935 ExtrapSyst technote
237  // Can be remade with CAFAna/nue/Ana2018/ExtrapSysts/ scripts
238  // Using only correction of the weight with max impact, i.e. Cos weight for FHC and trueQ2 weight for RHC, see technote
240  /// RHC
241  const std::string kWeightsFnameRHC = FindCAFAnaDir()+"/nue/Ana2018/AcceptSysts/FD_KinematicsCorrection_RHC.root";
242  const std::string kWeightNameRHC = "trueQ2_FD_KinematicsCorrection_RHC";
244  TFile weightsFileRHC (kWeightsFnameRHC.c_str(),"read");
246  if(weightsFileRHC.IsZombie()){
247  std::cerr << "Warning: couldn't open " << kWeightsFnameRHC << std::endl;
248  abort();
249  }
251  fWeightHistRHC = (TH1*) weightsFileRHC.Get(kWeightNameRHC.c_str())->Clone();
253  //disassociate the histogram from files
254  fWeightHistRHC -> SetDirectory(0);
256  weightsFileRHC.Close();
257  }
259  if (kNue2018FDAllSamples(sr))
260  {
261  double kAnaBin = kNue2018AnaBin(sr);
262  double kFDSignalWeight = 1;
264  if(fWeightHistRHC->GetBinContent(kAnaBin) != 0)
265  kFDSignalWeight = fWeightHistRHC->GetBinContent(kAnaBin);
267  weight *= 1+(kFDSignalWeight-1)*sigma;
268  }
269  }
Far Detector at Ash River.
Definition: SREnums.h:11
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
const Var kNue2018AnaBin([](const caf::SRProxy *sr){int selBin=kNue2018SelectionBin(sr);float nuE=kNueEnergy2018(sr);int nuEBin=nuE/0.5;assert(nuEBin<=8 &&"An event with nuE > 4.5 should never happen");int anaBin=9 *selBin+nuEBin;return anaBin;})
Use this Analysis Binning for Ana2018, official Binning.
Definition: NueCuts2018.h:171
double sigma(TH1F *hist, double percentile)
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
const Cut kIsRHC([](const caf::SRProxy *sr){return sr->spill.isRHC;})
Definition: Vars.h:16
const Cut kNue2018FDAllSamples
Definition: NueCuts2018.h:77
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 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

TH1* ana::NueAcceptSystSignalKin2018RHC::fWeightHistRHC

Definition at line 72 of file NueAcceptSysts.h.

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