Classes | Functions | Variables
syst_variations.h File Reference
#include "CAFAna/Core/SystShifts.h"
#include "CAFAna/Core/Loaders.h"
#include "CAFAna/Cuts/Cuts.h"
#include "3FlavorAna/Cuts/NueCuts2017.h"
#include "3FlavorAna/Cuts/NumuCuts2017.h"
#include "3FlavorAna/Cuts/QuantileCuts.h"
#include "3FlavorAna/Systs/NueExtrapSysts.h"
#include "CAFAna/Systs/XSecSysts.h"
#include "CAFAna/Systs/XSecSystLists.h"
#include "CAFAna/Systs/BeamSysts.h"
#include "3FlavorAna/Vars/Binnings.h"
#include "CAFAna/Vars/GenieWeights.h"
#include "3FlavorAna/Vars/HistAxes.h"
#include "CAFAna/Vars/PPFXWeights.h"
#include "CAFAna/Analysis/Prod3Loaders.h"
#include "3FlavorAna/Systs/EnergySysts.h"
#include "3FlavorAna/Systs/EnergySysts2017.h"
#include "3FlavorAna/Systs/JointAna2017Systs.h"
#include <TFile.h>
#include <TString.h>
#include <vector>
#include <iostream>

Go to the source code of this file.

Classes

struct  ShiDef
 
struct  SNameDef
 
struct  ExtrapDef
 

Functions

ana::LoadersGetLoaders2017 (const TString option, const TString period="full")
 
ana::LoadersGetLoaders2017FakeData (const TString option, const TString period="full")
 
void SwapNDDataLoader (Loaders *loaders, const TString option, const TString period="full")
 
std::vector< const ISyst * > GetSystematics2017 (const TString option)
 
std::vector< ShiDefGetShifts2017 (const TString option)
 
std::vector< SNameDefGetShiftNames2017 (const TString opt="all")
 
const HistAxis axis_muEn ("Reconstructed Muon Energy (GeV)", kNumuCCEOptimisedBinning, kMuE)
 
const HistAxis axis_HadEFrac ("Hadronic Energy Fraction", Binning::Simple(50, 0.0, 1.01), kHadEFrac)
 
const HistAxis axis_nue_3bin ("Nue Energy / CVN", kNue2DBinning, tempEnergyCVN2D)
 
const HistAxis axis_nue_1bin ("Reconstructed neutrino energy (GeV)", kNueSAEnergyBinning, kNueEnergy2017)
 
std::vector< ExtrapDefGetExtrapolationDefs (const TString analysis, const TString period)
 

Variables

const Cut cut_numund = kNumuCutND2017
 
const HistAxis axis_numu = kNumuCCOptimisedAxis
 
const Cut cut_nuend = kNue2017NDCVNSsb
 
const HistAxis axis_numu_for_nuesig = kNumuCCOptimisedAxis
 
const Cut cut_nuefd_all = kNue2017FDAllSamples
 
const Cut cut_nuefd_core = kNue2017FD
 
const Cut cut_numufd = kNumuCutFD2017
 
const Var tempEnergyCVN2D = Var2D(kCVNe,kCVNNLBinning,kNueEnergy2017,kNueSAEnergyBinning)
 
const HistAxis axis_nue_4bin = kNue2017Axis
 

Function Documentation

const HistAxis axis_HadEFrac ( "Hadronic Energy Fraction"  ,
Binning::Simple(50, 0.0, 1.01)  ,
kHadEFrac   
)
const HistAxis axis_muEn ( "Reconstructed Muon Energy (GeV)"  ,
kNumuCCEOptimisedBinning  ,
kMuE   
)
const HistAxis axis_nue_1bin ( "Reconstructed neutrino energy (GeV)"  ,
kNueSAEnergyBinning  ,
kNueEnergy2017   
)
const HistAxis axis_nue_3bin ( "Nue Energy / CVN"  ,
kNue2DBinning  ,
tempEnergyCVN2D   
)

Referenced by GetExtrapolationDefs().

std::vector<ExtrapDef> GetExtrapolationDefs ( const TString  analysis,
const TString  period 
)

Definition at line 378 of file syst_variations.h.

References axis_nue_3bin(), axis_nue_4bin, axis_numu, om::cerr, om::cout, cut_nuefd_all, cut_nuefd_core, cut_nuend, cut_numufd, allTimeWatchdog::endl, MECModelEnuComparisons::i, inFile, ana::kHadEFracAxis, ana::kNoCut, ana::kNumuCCOptimisedAxis, ana::QuantileCutsFromTH2(), runNovaSAM::ret, and art::to_string().

Referenced by make_predictions_systs(), make_predictions_systs_fakedata(), and plot_prediction_systs().

378  {
379  std::vector <ExtrapDef> ret;
380  if(analysis.Contains("nue")){
381  ret.push_back ({"EnergyCVN2D_3bin",axis_nue_3bin, cut_nuefd_core, cut_nuend, cut_numund});
382  ret.push_back ({"EnergyCVN2D", axis_nue_4bin, cut_nuefd_all, cut_nuend, cut_numund});
383  //ret.push_back ({"Energy_1bin", axis_nue_1bin, cut_nuefd_core, cut_nuend, cut_numund});
384  }
385  else if(analysis.Contains("numu")){
386 // TString fdspecfile = "/nova/app/users/karlwarb/Tag_S17-10-09/Workspace/NuMuSystematics/FDQuantileHists/final_" + period + "_FD_histo_for_quantile_cuts.root";
387  TString fdspecfile = "/nova/ana/nu_mu_ana/Ana2017/Quantiles/final_" + period + "_FD_histo_for_quantile_cuts.root";
388  TFile* inFile = TFile::Open(fdspecfile);
389  if(inFile->IsZombie()) {
390  std::cout << "Problem with file " << fdspecfile << std::endl;
391  abort();
392  }
393  gDirectory->cd("dir_FDSpec2D");
394  TH2 *FDSpec2D = (TH2*)inFile->FindObjectAny("FDSpec2D");
395  double nquantiles = 4;
396  std::vector<Cut> HadEFracQuantCuts = QuantileCutsFromTH2(FDSpec2D, kNumuCCOptimisedAxis,
397  kHadEFracAxis, nquantiles);
398  for(int i=0;i< nquantiles; ++i){
399  ret.push_back({"Energy_Quant" +std::to_string(i+1), axis_numu ,
400  cut_numufd && HadEFracQuantCuts[i], kNoCut, cut_numund && HadEFracQuantCuts[i]});
401  //ret.push_back({"MuonEn_Quant" +std::to_string(i+1), axis_muEn ,
402  // cut_numufd && HadEFracQuantCuts[i], kNoCut, cut_numund && HadEFracQuantCuts[i]});
403  //ret.push_back({"HadEFrac_Quant"+std::to_string(i+1), axis_HadEFrac,
404  // cut_numufd && HadEFracQuantCuts[i], kNoCut, cut_numund && HadEFracQuantCuts[i]})
405 
406  }
407  ret.push_back({"Energy", axis_numu, cut_numufd, kNoCut, cut_numund});
408  }
409  else {
410  std:: cerr << "Please mention nue or numu in analysis" << std::endl;
411  }
412 
413  return ret;
414  }
const Cut cut_nuefd_all
const Cut cut_numund
const HistAxis kHadEFracAxis("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kHadEFrac)
HistAxis that implements Hadronic Energy fraction binning used by L.Vinton to derive Hadronic Energy ...
Definition: HistAxes.h:30
OStream cerr
Definition: OStream.cxx:7
const HistAxis axis_nue_3bin("Nue Energy / CVN", kNue2DBinning, tempEnergyCVN2D)
const HistAxis axis_nue_4bin
const Cut cut_nuend
const Cut cut_numufd
ifstream inFile
Definition: AnaPlotMaker.h:34
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39;...
Definition: HistAxes.h:24
OStream cout
Definition: OStream.cxx:6
const HistAxis axis_numu
std::vector< Cut > QuantileCutsFromTH2(TH2 *quantileHist, const HistAxis &independentAxis, const HistAxis &quantileAxis, const unsigned int &numQuantiles, const bool verbose)
: Do the same as the QuantileCuts function but taking in the TH2 instead of making it...
const Cut cut_nuefd_core
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
ana::Loaders* GetLoaders2017 ( const TString  option,
const TString  period = "full" 
)

Definition at line 31 of file syst_variations.h.

References om::cout, ana::Loaders::DisableLoader(), allTimeWatchdog::endl, ana::Loaders::GetLoaderPath(), ana::kBeam, ana::Loaders::kData, ana::kDecaf, caf::kFARDET, ana::Loaders::kFluxSwap, ana::kFullCAF, ana::Loaders::kMC, caf::kNEARDET, ana::Loaders::kNonSwap, ana::kNueConcat, ana::kNumuConcat, ana::Loaders::kRHC, ana::Loaders::kTauSwap, loaders, DCS_db_parser::period, ana::Loaders::SetLoaderPath(), canMan::sign(), and string.

Referenced by make_predictions_systs().

31  {
32 
33  Loaders * loaders = new Loaders();
34 
35  auto caftype = ana::ECAFType::kDecaf ;
36 
37  if (option.Contains("cafs")) caftype = ana::ECAFType::kFullCAF;
38  if (option.Contains("nueconcat")) caftype = ana::ECAFType::kNueConcat;
39  if (option.Contains("numuconcat")) caftype = ana::ECAFType::kNumuConcat;
40 
41  if(option.Contains("CalibrationUp")) loaders = new Prod3AbsCalibLoaders(caftype, +1, period.Data());
42  else if(option.Contains("CalibrationDown")) loaders = new Prod3AbsCalibLoaders(caftype, -1, period.Data());
43  else if(option.Contains("CalibShape")) loaders = new Prod3CalibShapeLoaders(caftype, period.Data());
44  else if(option.Contains("Cherenkov")) loaders = new Prod3CherenkovLoaders(caftype, period.Data());
45  else if(option.Contains("LightLevelUp")) loaders = new Prod3LightLevelLoaders(caftype,+1, period.Data());
46  else if(option.Contains("LightLevelDown")) loaders = new Prod3LightLevelLoaders(caftype,-1,period.Data());
47  else if(option.Contains("LightLevelNom")) loaders = new Prod3LightLevelLoaders(caftype, 0,period.Data());
48  else if(option.Contains("RelativeCalib")){
49  int sign = (option.Contains("Up") ? +1:-1);
50  loaders = new Prod3AbsCalibLoaders(caftype, sign, period.Data());
51  auto temploaders = new Prod3AbsCalibLoaders(caftype, - sign, period.Data());
52  auto oppositeNDMC = temploaders->GetLoaderPath(caf::kNEARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap);
53  loaders->SetLoaderPath(oppositeNDMC, caf::kNEARDET, Loaders::kData, ana::kBeam, Loaders::kNonSwap);
54  std::cout << "Swapped calibration loader" << oppositeNDMC << std::endl;
55  delete temploaders;
56  }
57  else if (option.Contains("NoTau") ) {
59  if (option.Contains("2sigmaNoTau") ){
60  std::string posneg = (option.Contains("Up")) ? "pos" : "neg";
61  std::string NonSwa = "prod_decaf_R17-03-01-prod3reco.m_fd_genie_nonswap_fhc_nova_v08_full_calib-shift-fd-xyview-"+posneg+"-offset-2sigma_nue_or_numu_or_nus_contain_v1";
62  std::string FluSwa = "prod_decaf_R17-03-01-prod3reco.m_fd_genie_fluxswap_fhc_nova_v08_full_calib-shift-fd-xyview-"+posneg+"-offset-2sigma_nue_or_numu_or_nus_contain_v1";
63  loaders->SetLoaderPath( NonSwa, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap );
64  loaders->SetLoaderPath( FluSwa, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kFluxSwap );
65  }
66  }
67  else loaders = new Prod3NomLoaders (caftype, period.Data());
68 
69  if(option.Contains("RHC")) {
70  std::cout << "\nWARNING using RHC datasets with the 2017 FHC-optimized analysis "
71  << "\nThis is unofficial!! You've been warned\n\n";
72  loaders = new Prod3NomLoaders(caftype, period.Data(), "full", Loaders::kRHC);
73  }
74 
75  return loaders;
76 }
Near Detector underground.
Definition: SREnums.h:10
For nominal spectra and reweighting systs (xsec/flux)
Definition: Prod3Loaders.h:40
Far Detector at Ash River.
Definition: SREnums.h:11
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
const Color_t kMC
void DisableLoader(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Definition: Loaders.cxx:65
std::string GetLoaderPath(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap) const
Definition: Loaders.cxx:89
OStream cout
Definition: OStream.cxx:6
std::vector< Loaders * > loaders
Definition: syst_header.h:386
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
def sign(x)
Definition: canMan.py:197
enum BeamMode string
ana::Loaders* GetLoaders2017FakeData ( const TString  option,
const TString  period = "full" 
)

Definition at line 80 of file syst_variations.h.

References om::cerr, om::cout, allTimeWatchdog::endl, exit(), ana::Loaders::GetLoaderPath(), ana::kBeam, ana::Loaders::kData, ana::kDecaf, ana::Loaders::kMC, caf::kNEARDET, ana::Loaders::kNonSwap, ana::kNueConcat, ana::kNumuConcat, ana::Loaders::kRHC, loaders, DCS_db_parser::period, and ana::Loaders::SetLoaderPath().

Referenced by make_predictions_systs_fakedata().

80  {
81 
82  Loaders * loaders, *temploaders;
83 
84  auto caftype = ana::ECAFType::kDecaf ;
85 
86  if (option.Contains("nueconcat")) caftype = ana::ECAFType::kNueConcat;
87  if (option.Contains("numuconcat")) caftype = ana::ECAFType::kNumuConcat;
88 
89  if(option.Contains("LightLevel")) loaders = new Prod3LightLevelLoaders(caftype, 0,period.Data());
90  else loaders = new Prod3NomLoaders (caftype, period.Data());
91 
92  if(option.Contains("Nom")) {
93  std::cerr << "You picked fake data = nominal MC. "
94  <<"This is a silly in and out test, and all your ratios will be one. "
95  <<"\nEdit the code if this is truly what you want" << std::endl;
96  exit(1);
97  }
98 
99  if(option.Contains("CalibrationUp")) temploaders = new Prod3AbsCalibLoaders(caftype, +1, period.Data());
100  else if(option.Contains("CalibrationDown")) temploaders = new Prod3AbsCalibLoaders(caftype, -1, period.Data());
101  else if(option.Contains("CalibShape")) temploaders = new Prod3CalibShapeLoaders(caftype, period.Data());
102  else if(option.Contains("Cherenkov")) temploaders = new Prod3CherenkovLoaders(caftype, period.Data());
103  else if(option.Contains("LightLevelUp")) temploaders = new Prod3LightLevelLoaders(caftype,+1, period.Data());
104  else if(option.Contains("LightLevelDown")) temploaders = new Prod3LightLevelLoaders(caftype,-1,period.Data());
105  else temploaders = new Prod3NomLoaders (caftype, period.Data());
106 
107  if(option.Contains("RHC")) temploaders = new Prod3NomLoaders(caftype, period.Data(), "full", Loaders::kRHC);
108 
109  auto shiftedMCpath = temploaders->GetLoaderPath(caf::kNEARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap);
110  loaders->SetLoaderPath(shiftedMCpath, caf::kNEARDET, Loaders::kData, ana::kBeam, Loaders::kNonSwap);
111  std::cout << "Swapped real data loader for " << shiftedMCpath << std::endl;
112  return loaders;
113 }
Near Detector underground.
Definition: SREnums.h:10
For nominal spectra and reweighting systs (xsec/flux)
Definition: Prod3Loaders.h:40
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
const Color_t kMC
OStream cerr
Definition: OStream.cxx:7
std::string GetLoaderPath(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap) const
Definition: Loaders.cxx:89
OStream cout
Definition: OStream.cxx:6
std::vector< Loaders * > loaders
Definition: syst_header.h:386
exit(0)
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
std::vector<SNameDef> GetShiftNames2017 ( const TString  opt = "all")

Definition at line 267 of file syst_variations.h.

References plot_validation_datamc::c, ana::getAna2017SummedSmallXsecSysts(), ana::GetGenieKnobSyst(), ana::GetPPFXPrincipals(), GetSystematics2017(), MECModelEnuComparisons::i, ana::k2ndClassCurrs, ana::kBeamAllTransport, ana::kDirectHadEScaleSyst2017, ana::kDirectRelHadEScaleSyst2017, ana::kJointAna2017, ana::kMAQEGenieReducedSyst2017, ana::kMECq0ShapeSyst2017, ana::kMuEScaleSyst2017, ana::kNueExtrapSystBkg2017, ana::kNueExtrapSystSignalKin2017, ana::kNumuAna2017, ana::kRadCorrNue, ana::kRadCorrNuebar, ana::kRelMuEScaleSyst2017, ana::kRPACCQEEnhSyst2017, ana::kRPARESSyst2017, gen_hdf5record::names, MECModelEnuComparisons::opt, and systs.

Referenced by plot_prediction_systs(), and reduce_the_predfile_nue_numu().

267  {
268 
269  std::vector <SNameDef> names;
270 
271  if(opt=="test"){
272  names.push_back( { "RPA2018",{"noShift"} });
273  names.push_back( { "SumSmallXSecJoint2017",{"plusOne","minusOne","plusTwo","minusTwo"}});
274 // names.push_back( { "extrap_signalkin",{"plusOne","minusOne","plusTwo","minusTwo"}});
275 // names.push_back( { "extrap_bkg",{"plusOne","minusOne","plusTwo","minusTwo"}});
276  }
277  if(opt=="Calibration" || opt.Contains("all")) names.push_back( { "Calibration", {"plusOne","minusOne"} } );
278  //if(opt=="Calibration" || opt.Contains("all")) names.push_back( { "Calibration",{"plusOne","minusOne","plusTwo","minusTwo"} } );
279  if(opt=="RelativeCalib" || opt.Contains("all")) names.push_back( { "RelativeCalib",{"plusTwo","minusTwo"} } );
280  if(opt=="CalibShape" || opt.Contains("all")) names.push_back( { "CalibShape", {"plusOne"} });
281  if(opt=="Cherenkov" || opt.Contains("all")) names.push_back( { "Cherenkov", {"plusOne"} });
282  if(opt=="Lightlevel" || opt.Contains("all")) names.push_back( { "Lightlevel", {"plusOne","minusOne"} });
283 // if(opt=="RPA2018" || opt.Contains("all")) names.push_back( { "RPA2018",{"noShift"} } );
284 
285  if(opt.Contains("all") && opt.Contains("Reduced") ) {
286  std::vector <const ISyst*> systs;
287  const ISyst* s;
288  if(!opt.Contains("Super") ) {
289  systs = {&kMECq0ShapeSyst2017,
291  GetGenieKnobSyst(rwgt::fReweightMaCCRES),
292  GetGenieKnobSyst(rwgt::fReweightMaNCRES),
293  GetGenieKnobSyst(rwgt::fReweightMvCCRES),
295  &kDISvnCC1pi,
297  &kRadCorrNue,
301  for (int i =0; i<5; i++){
302  systs.push_back(GetPPFXPrincipals(i));
303  }
304  }
305  // Some nue specific ones...
306  if(opt.Contains("Nue") ) {
307  systs.push_back(&kNueExtrapSystSignalKin2017);
308  systs.push_back(&kNueExtrapSystBkg2017);
309  }
310  if(opt.Contains("Numu") ) {
311  systs.push_back(&kMuEScaleSyst2017);
312  systs.push_back(&kRelMuEScaleSyst2017);
313  systs.push_back(&kDirectHadEScaleSyst2017);
314  systs.push_back(&kDirectRelHadEScaleSyst2017);
316  }
317  // Want kBeamAll
318  systs.push_back(&kBeamAllTransport);
319  // Fill names with the systs we've just added..
320  for (auto const & syst:systs)
321  names.push_back( { syst->ShortName(),{"plusOne","minusOne","plusTwo","minusTwo"}} );
322  }
323  if(opt=="all"){
324  for( auto c:{"BeamTransport","BeamAllTransport","PPFXSyst","NumuEnergySyst","NueExtrapSyst","AllSmall","XSecSyst"} ){ //nue wants XSec to be last
325  auto systs = GetSystematics2017(c);
326  for (auto const & syst:systs)
327  names.push_back( { syst->ShortName(),{"plusOne","minusOne","plusTwo","minusTwo"}} );
328  }//end beam or xsec
329  }
330  else {
331  auto systs = GetSystematics2017(opt);
332  for (auto const & syst:systs)
333  names.push_back( { syst->ShortName(),{"plusOne","minusOne","plusTwo","minusTwo"}} );
334  }
335  return names;
336 }
BeamSyst * GetPPFXPrincipals(int PCIdx)
Definition: BeamSysts.cxx:72
const NOvARwgtSyst k2ndClassCurrs("2ndclasscurr","Second class currents", novarwgt::kSimpleSecondClassCurrentsSystKnob)
Second-class current syst. See documentation in NOvARwgt.
Definition: XSecSysts.h:71
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
const NOvARwgtSyst kMAQEGenieReducedSyst2017(genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE))++"_reduced", genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE))++"_reduced", novarwgt::kMAQEGenieReducedSyst2017)
2017 &#39;reduced&#39; M_A^QE shift. See documentation in NOvARwgt.
Definition: XSecSysts.h:47
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
const NOvARwgtSyst kRadCorrNuebar("radcorrnuebar","Radiative corrections for #bar{#nu}_{e}", novarwgt::kSimpleRadiativeCorrNuebarXsecSystKnob)
Radiative corrections syst (nuebars). See documentation in NOvARwgt.
Definition: XSecSysts.h:67
const MuEScaleSyst2017 kMuEScaleSyst2017(0.0074, 0.0012)
const NOvARwgtSyst kRPACCQEEnhSyst2017("RPAShapeenh2017","RPA shape: higher-Q^{2} enhancement (2017)", novarwgt::kRPACCQEEnhSyst2017)
Definition: RPASysts.h:11
const XML_Char * s
Definition: expat.h:262
const RelMuEScaleSyst2017 kRelMuEScaleSyst2017(0.0045, 10.5)
const BeamSyst kBeamAllTransport((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"totErr","beamTransportComb","Combined Beam Transport Systematics")
All Beam Transport systematics combined in quadratures.
Definition: BeamSysts.h:135
const DirectHadEScaleSyst2017 kDirectHadEScaleSyst2017(0.05)
const NueExtrapSystSignalKin2017 kNueExtrapSystSignalKin2017
const SummedSyst * getAna2017SummedSmallXsecSysts(const EAnaType2017 ana)
const NueExtrapSystBkg2017 kNueExtrapSystBkg2017
const DirectRelHadEScaleSyst2017 kDirectRelHadEScaleSyst2017(0.05)
const NOvARwgtSyst kMECq0ShapeSyst2017("MECq0Shape","MEC q_{0} shape", novarwgt::kMECq0ShapeSyst2017)
Definition: MECSysts.h:41
const NOvARwgtSyst kRPARESSyst2017("RPAShapeRES2017","RPA shape: resonance events", novarwgt::kRPARESSyst2017)
Definition: RPASysts.h:20
const NOvARwgtSyst * GetGenieKnobSyst(rwgt::ReweightLabel_t knobIdx, std::string altName, std::string altLabel)
Convenience function to get a GENIE knob syst. (Allows using the GENIE knob name & description as the...
Definition: XSecSysts.cxx:119
const NOvARwgtSyst kRadCorrNue("radcorrnue","Radiative corrections for #nu_{e}", novarwgt::kSimpleRadiativeCorrNueXsecSystKnob)
Radiative corrections syst (nues). See documentation in NOvARwgt.
Definition: XSecSysts.h:64
std::vector< const ISyst * > GetSystematics2017(const TString option)
std::vector<ShiDef> GetShifts2017 ( const TString  option)

Definition at line 213 of file syst_variations.h.

References abs(), om::cout, allTimeWatchdog::endl, GetSystematics2017(), ana::kNoShift, runNovaSAM::ret, sigma(), and systs.

Referenced by make_predictions_systs(), and make_predictions_systs_fakedata().

213  {
214 
215  std::vector <ShiDef> ret;
216 
217  if(option.Contains("BeamTransport") ||
218  option.Contains("BeamAllTransport") ||
219  option.Contains("PPFXSyst") ||
220  option.Contains("XSecSyst") ||
221  option.Contains("NumuEnergySyst") ||
222  option.Contains("NueExtrapSyst") ||
223  option.Contains("AllSmall") ||
224  option.Contains("NuMuSmall")
225  ){
226  auto systs = GetSystematics2017(option);
227 
228  for (auto syst:systs){
229  for (auto sigma:{+2,+1,-1,-2}) {
230  TString sig_str = (sigma>0?"plus":"minus");
231  if(abs(sigma)==1) sig_str+="One";
232  if(abs(sigma)==2) sig_str+="Two";
233  ret.push_back({syst->ShortName(),sig_str,SystShifts(syst,sigma)});
234  std::cout << setw(40) << (TString) "Added " + syst->ShortName() + "_" + sig_str + " || ";
235  }//end sigmas
236  std::cout << std::endl;
237  }//end systs
238  }//end beam or xsec
239  else {
240  TString topstr, lowstr;
241  topstr = "Nominal"; lowstr= "noShift";
242 
243  if (option.Contains("CalibrationUp")) { topstr= "Calibration"; lowstr="plusOne";}
244  else if(option.Contains("CalibrationDown")) { topstr= "Calibration"; lowstr="minusOne";}
245  else if(option.Contains("RelativeCalibUp")) { topstr= "RelativeCalib";lowstr="plusTwo";}
246  else if(option.Contains("RelativeCalibDown")){ topstr= "RelativeCalib";lowstr="minusTwo";}
247  else if(option.Contains("CalibShape")) { topstr= "CalibShape"; lowstr="plusOne"; }
248  else if(option.Contains("Cherenkov")) { topstr= "Cherenkov"; lowstr="plusOne"; }
249  else if(option.Contains("LightLevelUp")) { topstr= "Lightlevel"; lowstr="plusOne";}
250  else if(option.Contains("LightLevelDown")) { topstr= "Lightlevel"; lowstr="minusOne";}
251  else if(option.Contains("LightLevelNom")) { topstr= "Lightlevel"; lowstr="noShift";}
252  else if(option.Contains("CalibrationUp_2sigmaNoTau" ) ){ topstr= "Calibration";lowstr="plusTwo"; }
253  else if(option.Contains("CalibrationDown_2sigmaNoTau") ){ topstr= "Calibration";lowstr="minusTwo"; }
254  else if(option.Contains("RPA2018")) {topstr = "RPA2018"; lowstr = "noShift"; }
255 
256  ret = {{topstr, lowstr,kNoShift}};
257  }
258  return ret;
259 }
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
void abs(TH1 *hist)
double sigma(TH1F *hist, double percentile)
const SystShifts kNoShift
Definition: SystShifts.cxx:22
OStream cout
Definition: OStream.cxx:6
std::vector< const ISyst * > GetSystematics2017(const TString option)
std::vector<const ISyst*> GetSystematics2017 ( const TString  option)

Definition at line 138 of file syst_variations.h.

References om::cout, allTimeWatchdog::endl, ana::getAllXsecSysts_2017(), ana::getAna2017SummedSmallXsecSysts(), ana::GetPPFXPrincipals(), MECModelEnuComparisons::i, ana::kBeamAllTransport, ana::kBeamGeomWater, ana::kBeamH1PosX, ana::kBeamH1PosY, ana::kBeamH2PosX, ana::kBeamH2PosY, ana::kBeamHornCurrent, ana::kBeamMagField, ana::kBeamPosX, ana::kBeamPosY, ana::kBeamSpotSize, ana::kBeamTarget, ana::kDirectHadEScaleSyst2017, ana::kDirectRelHadEScaleSyst2017, ana::kJointAna2017, ana::kMuEScaleSyst2017, ana::kNueExtrapSystBkg2017, ana::kNueExtrapSystSignalKin2017, ana::kNumuAna2017, ana::kRelMuEScaleSyst2017, and runNovaSAM::ret.

Referenced by GetShiftNames2017(), and GetShifts2017().

139 {
140  std::vector <const ISyst*> ret;
141 
142  if(option.Contains("BeamTransport")){
143  ret = { & kBeamHornCurrent,
144  & kBeamSpotSize,
145  & kBeamPosX,
146  & kBeamPosY,
147  & kBeamH1PosX,
148  & kBeamH1PosY,
149  & kBeamH2PosX,
150  & kBeamH2PosY,
151  & kBeamTarget,
152  & kBeamMagField,
154  };
155  }
156  else if(option.Contains("BeamAllTransport")){
157  ret = { & kBeamAllTransport };
158  }
159  else if(option.Contains("PPFXSyst")){
160  for (int i =0; i<15; i++){
161  ret.push_back(GetPPFXPrincipals(i));
162  }
163  }
164  else if(option.Contains("XSecSyst") ){
165  auto geniesysts = getAllXsecSysts_2017();
166  int minsyst=0, maxsyst=geniesysts.size();
167  if(option.Contains("XSecSyst_Frac")){ minsyst= 0; maxsyst=3;
168  std::cout << "\n\nOnly looking at a small range; " << minsyst << " -- " << maxsyst << "\n\n" << std::endl;}
169  if(option.Contains("XSecSyst_1of6")){ minsyst= 0; maxsyst=14;}
170  if(option.Contains("XSecSyst_2of6")){ minsyst=14; maxsyst=28;}
171  if(option.Contains("XSecSyst_3of6")){ minsyst=28; maxsyst=42;}
172  if(option.Contains("XSecSyst_4of6")){ minsyst=42; maxsyst=56;}
173  if(option.Contains("XSecSyst_5of6")){ minsyst=56; maxsyst=70;}
174  if(option.Contains("XSecSyst_6of6")){ minsyst=70; maxsyst=84;}
175 
176  for(int i = minsyst; i < maxsyst; ++i) {
177  if (i >= (int)geniesysts.size()) break;
178  ret.push_back(geniesysts[i]);
179  }
180  }
181  else if (option.Contains ("NumuEnergySyst")){
182  ret = {
183  &kMuEScaleSyst2017, // 1.0% abs (FD + ND) muon E scale applied to muon track length
184  &kRelMuEScaleSyst2017, // .76% rel (FD only) muon E scale applied to muon track length
185  &kDirectHadEScaleSyst2017, // 5% hadronic energy scale shift.
186  &kDirectRelHadEScaleSyst2017 // The relative hadronic energy scale shift
187  };
188  }
189  else if (option.Contains ("NueExtrapSyst")){
190  ret = {
193  };
194  }
195  else if(option.Contains("AllSmall")){
197  }
198  else if (option.Contains("NuMuSmall")){
200  }
201 
202  return ret;
203 }
BeamSyst * GetPPFXPrincipals(int PCIdx)
Definition: BeamSysts.cxx:72
const BeamSyst kBeamTarget((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"7mmTargetZ","+/- 7mm Target z Position")
Target z position shift +/-7mm.
Definition: BeamSysts.h:117
const BeamSyst kBeamHornCurrent((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"2kA","2kAHornCurrent","+/- 2kA Horn Current")
Horn Current +/-2kA.
Definition: BeamSysts.h:101
const BeamSyst kBeamGeomWater((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"1mmHornWater","+/- 1mm water on Horn 1")
Water layer on horn 1: +/- 1mm.
Definition: BeamSysts.h:132
const MuEScaleSyst2017 kMuEScaleSyst2017(0.0074, 0.0012)
const BeamSyst kBeamH1PosX((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"3mmHorn1X","+/- 3mm Horn 1 X Position")
Horn 1 and 2 position +-3mm in X and Y separately.
Definition: BeamSysts.h:111
const RelMuEScaleSyst2017 kRelMuEScaleSyst2017(0.0045, 10.5)
const BeamSyst kBeamAllTransport((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"totErr","beamTransportComb","Combined Beam Transport Systematics")
All Beam Transport systematics combined in quadratures.
Definition: BeamSysts.h:135
const DirectHadEScaleSyst2017 kDirectHadEScaleSyst2017(0.05)
const NueExtrapSystSignalKin2017 kNueExtrapSystSignalKin2017
const SummedSyst * getAna2017SummedSmallXsecSysts(const EAnaType2017 ana)
const NueExtrapSystBkg2017 kNueExtrapSystBkg2017
OStream cout
Definition: OStream.cxx:6
const BeamSyst kBeamPosY((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"1mmBeamShiftY","Beam Position Y")
Definition: BeamSysts.h:108
const DirectRelHadEScaleSyst2017 kDirectRelHadEScaleSyst2017(0.05)
const BeamSyst kBeamH1PosY((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"3mmHorn1Y","+/- 3mm Horn 1 Y Position")
Definition: BeamSysts.h:112
const BeamSyst kBeamSpotSize((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"0.2mmBeamSpotSize","0p2mmBeamSpotSize"," 1.3 +/- 0.2 mm Spot Size")
Beam Spot Size 1.3 +/- 0.2 mm both XY.
Definition: BeamSysts.h:104
const BeamSyst kBeamH2PosX((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"3mmHorn2X","+/- 3mm Horn 2 X Position")
Definition: BeamSysts.h:113
const BeamSyst kBeamPosX((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"1mmBeamShiftX","Beam Position X")
Beam position on target +-1 mm, X/Y separately.
Definition: BeamSysts.h:107
const BeamSyst kBeamH2PosY((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"3mmHorn2Y","+/- 3mm Horn 2 Y Position")
Definition: BeamSysts.h:114
const BeamSyst kBeamMagField((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"Magnetic Field in Decay Pipe","MagnFieldDecayPipe","Magnetic Field in Decay Pipe")
Constant magnetic field in decay pipe.
Definition: BeamSysts.h:120
std::vector< const ISyst * > getAllXsecSysts_2017()
Get master XSec syst list for 2017 analyses.
void SwapNDDataLoader ( Loaders loaders,
const TString  option,
const TString  period = "full" 
)

Definition at line 115 of file syst_variations.h.

References om::cout, allTimeWatchdog::endl, ana::Loaders::GetLoaderPath(), ana::kBeam, ana::Loaders::kData, ana::kDecaf, ana::Loaders::kFHC, ana::kFullCAF, ana::Loaders::kMC, caf::kNEARDET, ana::Loaders::kNonSwap, ana::kNueConcat, ana::kNumuConcat, ana::Loaders::kRHC, DCS_db_parser::period, and ana::Loaders::SetLoaderPath().

Referenced by make_predictions_systs().

116 {
117  auto caftype = ana::ECAFType::kDecaf;
118  auto flxtype = option.Contains("RHC") ? Loaders::kRHC : Loaders::kFHC;
119 
120  if (option.Contains("cafs")) caftype = ana::ECAFType::kFullCAF;
121  if (option.Contains("nueconcat")) caftype = ana::ECAFType::kNueConcat;
122  if (option.Contains("numuconcat")) caftype = ana::ECAFType::kNumuConcat;
123 
124  auto temploaders = new Prod3NomLoaders (caftype, period.Data(), "full", flxtype);
125  auto nominalNDMC = temploaders->GetLoaderPath(caf::kNEARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap);
126  delete temploaders;
127  std::cout << "\n\nSwapping ND Data for fake data \n\n";
128  std::cout << "Before "
129  << loaders->GetLoaderPath(caf::kNEARDET, Loaders::kData, ana::kBeam, Loaders::kNonSwap)
130  << "\n";
131  loaders->SetLoaderPath(nominalNDMC, caf::kNEARDET, Loaders::kData, ana::kBeam, Loaders::kNonSwap);
132  std::cout << "After "
133  << loaders->GetLoaderPath(caf::kNEARDET, Loaders::kData, ana::kBeam, Loaders::kNonSwap)
134  << std::endl << std::endl;
135 }
Near Detector underground.
Definition: SREnums.h:10
For nominal spectra and reweighting systs (xsec/flux)
Definition: Prod3Loaders.h:40
const Color_t kMC
std::string GetLoaderPath(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap) const
Definition: Loaders.cxx:89
OStream cout
Definition: OStream.cxx:6
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25

Variable Documentation

const HistAxis axis_nue_4bin = kNue2017Axis

Definition at line 365 of file syst_variations.h.

Referenced by GetExtrapolationDefs().

const HistAxis axis_numu = kNumuCCOptimisedAxis
const HistAxis axis_numu_for_nuesig = kNumuCCOptimisedAxis

Definition at line 353 of file syst_variations.h.

Referenced by make_predictions_systs(), and make_predictions_systs_fakedata().

const Cut cut_nuefd_all = kNue2017FDAllSamples

Definition at line 356 of file syst_variations.h.

Referenced by GetExtrapolationDefs().

const Cut cut_nuefd_core = kNue2017FD

Definition at line 357 of file syst_variations.h.

Referenced by GetExtrapolationDefs().

const Cut cut_nuend = kNue2017NDCVNSsb

Definition at line 352 of file syst_variations.h.

Referenced by GetExtrapolationDefs(), and NueExtrap().

const Cut cut_numufd = kNumuCutFD2017
const Cut cut_numund = kNumuCutND2017

Definition at line 344 of file syst_variations.h.

Referenced by NueExtrap(), and NumuExtrap().

const Var tempEnergyCVN2D = Var2D(kCVNe,kCVNNLBinning,kNueEnergy2017,kNueSAEnergyBinning)

Definition at line 363 of file syst_variations.h.