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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-02-24/3FlavorAna/Systs/NueAcceptSysts.h"

Inheritance diagram for ana::NueAcceptSystSignalKin2018FHC:
ana::ISyst

Public Member Functions

 NueAcceptSystSignalKin2018FHC ()
 
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 * fWeightHistFHC
 

Detailed Description

Definition at line 24 of file NueAcceptSysts.h.

Constructor & Destructor Documentation

ana::NueAcceptSystSignalKin2018FHC::NueAcceptSystSignalKin2018FHC ( )
inline

Definition at line 27 of file NueAcceptSysts.h.

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

27 : ISyst("accept_signalkin_FHC_2018", "Acceptance ND to FD Kinematics Signal FHC 2018"), fWeightHistFHC() {}
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 ana::NueAcceptSystSignalKin2018FHC::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const
overridevirtual

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

FHC

Reimplemented from ana::ISyst.

Definition at line 66 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.

67  {
68  // Check if FHC, otherwise left unaltered
69  if(kIsRHC(sr)) return;
70 
71  // Check if in FD, otherwise left unaltered
72  if(sr->hdr.det != caf::kFARDET) return;
73 
74  // Check if signal or WS
75  if(sr->mc.nnu == 0) return;
76  if(
77  abs(sr->mc.nu[0].pdg) != 12 ||
78  abs(sr->mc.nu[0].pdgorig) != 14 ||
79  !(sr->mc.nu[0].iscc)
80  ) return;
81 
82  if(!fWeightHistFHC){
83 
84  // FD in file from docdb-27935 ExtrapSyst technote
85  // Can be remade with 3FlavorAna/Ana2018/ExtrapSysts/ scripts
86  // Using only correction of the weight with max impact, i.e. Cos weight for FHC and trueQ2 weight for RHC, see technote
87 
88  /// FHC
89  const std::string kWeightsFnameFHC = FindCAFAnaDir()+"/nue/Ana2018/AcceptSysts/FD_KinematicsCorrection_FHC.root";
90  const std::string kWeightNameFHC = "Cos_FD_KinematicsCorrection_FHC";
91 
92  TFile weightsFileFHC (kWeightsFnameFHC.c_str(),"read");
93 
94  if(weightsFileFHC.IsZombie()){
95  std::cerr << "Warning: couldn't open " << kWeightsFnameFHC << std::endl;
96  abort();
97  }
98 
99  fWeightHistFHC = (TH1*) weightsFileFHC.Get(kWeightNameFHC.c_str())->Clone();
100 
101  // disassociate the histogram from files
102  fWeightHistFHC -> SetDirectory(0);
103 
104  weightsFileFHC.Close();
105  }
106 
107  if (kNue2018FDAllSamples(sr))
108  {
109  double kAnaBin = kNue2018AnaBin(sr);
110  double kFDSignalWeight = 1;
111 
112  if(fWeightHistFHC->GetBinContent(kAnaBin) != 0)
113  kFDSignalWeight = fWeightHistFHC->GetBinContent(kAnaBin);
114 
115  weight *= 1+(kFDSignalWeight-1)*sigma;
116  }
117  }
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
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 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::NueAcceptSystSignalKin2018FHC::fWeightHistFHC
mutableprotected

Definition at line 32 of file NueAcceptSysts.h.


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