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

#include "/cvmfs/"

Inheritance diagram for ana::NueAcceptSystSignalKin2020FHC:

Public Member Functions

 NueAcceptSystSignalKin2020FHC (int extrap=ana::kExtrapEmpty, std::string shortName="accept_signalkin_FHC_2020", std::string latexName="Acceptance ND to FD Kinematics Signal FHC 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 * fWeightHistFHC

Detailed Description

Definition at line 37 of file NueAcceptSysts.h.

Constructor & Destructor Documentation

ana::NueAcceptSystSignalKin2020FHC::NueAcceptSystSignalKin2020FHC ( int  extrap = ana::kExtrapEmpty,
std::string  shortName = "accept_signalkin_FHC_2020",
std::string  latexName = "Acceptance ND to FD Kinematics Signal FHC 2020" 

Definition at line 40 of file NueAcceptSysts.h.

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

40 : ISyst(shortName, latexName), extrapVar(extrap), fWeightHistFHC() {}
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::NueAcceptSystSignalKin2020FHC::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 119 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.

120  {
121  // Check if FHC, otherwise left unaltered
122  if(kIsRHC(sr)) return;
124  // Check if in FD, otherwise left unaltered
125  if(sr->hdr.det != caf::kFARDET) return;
127  // Check if signal or WS
128  if(sr->mc.nnu == 0) return;
129  if(
130  abs(sr->[0].pdg) != 12 ||
131  abs(sr->[0].pdgorig) != 14 ||
132  !(sr->[0].iscc)
133  ) return;
135  if(!fWeightHistFHC){
137  // FD in file from docdb-43917 ExtrapSyst technote
138  // Can be remade with 3FlavorAna/Ana2020/AcceptSysts/ scripts
139  // Using only correction of the weight with max impact, which is PtP weight for FHC with pT extrap and trueQ2 without pT extrap, see technote
141  /// FHC
142  std::string kWeightsFnameFHC;
143  std::string kWeightNameFHC;
146  kWeightsFnameFHC = FindCAFAnaDir()+"/data/3flavor/FD_KinematicsCorrection_FHC.root";
147  kWeightNameFHC = "trueQ2_FD_KinematicsCorrection_FHC";
148  }
149  else if(extrapVar == ana::kExtrapPt){
150  kWeightsFnameFHC = FindCAFAnaDir()+"/data/3flavor/FD_KinematicsCorrection_pTExtrap_FHC.root";
151  kWeightNameFHC = "PtP_FD_KinematicsCorrection_FHC";
152  }
153  else{
154  std::cerr << "Error: Only pT extrap or no extrap options are available for acceptance syst!" << std::endl;
155  abort();
156  }
158  TFile weightsFileFHC (kWeightsFnameFHC.c_str(),"read");
160  if(weightsFileFHC.IsZombie()){
161  std::cerr << "Warning: couldn't open " << kWeightsFnameFHC << std::endl;
162  abort();
163  }
165  fWeightHistFHC = (TH1*) weightsFileFHC.Get(kWeightNameFHC.c_str())->Clone();
167  // disassociate the histogram from files
168  fWeightHistFHC -> SetDirectory(0);
170  weightsFileFHC.Close();
171  }
173  if (kNue2020FDAllSamples(sr))
174  {
175  double kAnaBin = kNue2020AnaBin(sr) +1 ; //Need to add +1 to get the right bin# for GetBinContent unlike kNue2020Axis where we Fill the histogram
176  double kFDSignalWeight = 1;
178  if(fWeightHistFHC->GetBinContent(kAnaBin) != 0)
179  kFDSignalWeight = fWeightHistFHC->GetBinContent(kAnaBin);
181  weight *= 1+(kFDSignalWeight-1)*sigma;
182  }
183  }
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::NueAcceptSystSignalKin2020FHC::extrapVar

Definition at line 45 of file NueAcceptSysts.h.

TH1* ana::NueAcceptSystSignalKin2020FHC::fWeightHistFHC

Definition at line 46 of file NueAcceptSysts.h.

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