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

#include "/cvmfs/"

Inheritance diagram for ana::NueAcceptSystSignalKin2020RHC:

Public Member Functions

 NueAcceptSystSignalKin2020RHC (int extrap=ana::kExtrapEmpty, std::string shortName="accept_signalkin_RHC_2020", std::string latexName="Acceptance ND to FD Kinematics Signal RHC 2020")
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

int extrapVar
TH1 * fWeightHistRHC

Detailed Description

Definition at line 77 of file NueAcceptSysts.h.

Constructor & Destructor Documentation

ana::NueAcceptSystSignalKin2020RHC::NueAcceptSystSignalKin2020RHC ( int  extrap = ana::kExtrapEmpty,
std::string  shortName = "accept_signalkin_RHC_2020",
std::string  latexName = "Acceptance ND to FD Kinematics Signal RHC 2020" 

Definition at line 80 of file NueAcceptSysts.h.

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

80 : ISyst(shortName, latexName), extrapVar(extrap), fWeightHistRHC() {}
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

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::NueAcceptSystSignalKin2020RHC::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 271 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, ana::kExtrapEmpty, ana::kExtrapPt, caf::kFARDET, ana::kIsRHC, ana::kNue2020AnaBin, ana::kNue2020FDAllSamples, caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nnu, caf::Proxy< caf::SRTruthBranch >::nu, and string.

272  {
273  // Check if RHC, otherwise left unaltered
274  if(!kIsRHC(sr)) return;
276  // Check if in FD, otherwise left unaltered
277  if(sr->hdr.det != caf::kFARDET) return;
279  // Check if signal or WS
280  if(sr->mc.nnu == 0) return;
281  if(
282  abs(sr->[0].pdg) != 12 ||
283  abs(sr->[0].pdgorig) != 14 ||
284  !(sr->[0].iscc)
285  ) return;
287  if(!fWeightHistRHC){
289  // FD in file from docdb-43917 ExtrapSyst technote
290  // Can be remade with 3FlavorAna/Ana2020/AcceptSysts/ scripts
291  // Using only correction of the weight with max impact, which is pT/p for RHC without pT extrap and cos for RHC with pT extrap, see technote
293  /// RHC
294  std::string kWeightsFnameRHC;
295  std::string kWeightNameRHC;
298  kWeightsFnameRHC = FindCAFAnaDir()+"/data/3flavor/FD_KinematicsCorrection_RHC.root";
299  kWeightNameRHC = "PtP_FD_KinematicsCorrection_RHC";
300  }
301  else if(extrapVar == ana::kExtrapPt){
302  kWeightsFnameRHC = FindCAFAnaDir()+"/data/3flavor/FD_KinematicsCorrection_pTExtrap_RHC.root";
303  kWeightNameRHC = "Cos_FD_KinematicsCorrection_RHC";
304  }
305  else{
306  std::cerr << "Error: Only pT extrap and no extrap options are available for acceptance syst!" << std::endl;
307  abort();
308  }
310  TFile weightsFileRHC (kWeightsFnameRHC.c_str(),"read");
312  if(weightsFileRHC.IsZombie()){
313  std::cerr << "Warning: couldn't open " << kWeightsFnameRHC << std::endl;
314  abort();
315  }
317  fWeightHistRHC = (TH1*) weightsFileRHC.Get(kWeightNameRHC.c_str())->Clone();
319  //disassociate the histogram from files
320  fWeightHistRHC -> SetDirectory(0);
322  weightsFileRHC.Close();
323  }
325  if (kNue2020FDAllSamples(sr))
326  {
327  double kAnaBin = kNue2020AnaBin(sr) + 1; //Need to add +1 to get the right bin# for GetBinContent unlike kNue2020Axis where we Fill the histogram
328  double kFDSignalWeight = 1;
330  if(fWeightHistRHC->GetBinContent(kAnaBin) != 0)
331  kFDSignalWeight = fWeightHistRHC->GetBinContent(kAnaBin);
333  weight *= 1+(kFDSignalWeight-1)*sigma;
334  }
335  }
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
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 Var kNue2020AnaBin([](const caf::SRProxy *sr){int selBin=kNue2020SelectionBin(sr);float nuE=kNueEnergy2020(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 Ana2020, official Binning.
Definition: NueCuts2020.h:191
const Cut kNue2020FDAllSamples
Definition: NueCuts2020.h:84
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

int ana::NueAcceptSystSignalKin2020RHC::extrapVar

Definition at line 85 of file NueAcceptSysts.h.

TH1* ana::NueAcceptSystSignalKin2020RHC::fWeightHistRHC

Definition at line 86 of file NueAcceptSysts.h.

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