muonid_opt.C
Go to the documentation of this file.
2 #include "CAFAna/Core/HistAxis.h"
3 #include "CAFAna/Core/Binning.h"
4 #include "CAFAna/Core/SystematicDef.h"
5 
8 
9 #include "TFile.h"
10 
12 
13 void muonid_opt(string outFilename)
14 {
15  // Shared variables
17  ana::HistAxis * muonid_axis = new ana::HistAxis("MuonID", ana::Binning::Simple(100, -1.0, 1.0), ana::MubarClassifier::kMubarID);
18 
19  // MuonID Optimization object
21 
22  // Nominal
23  ana::SystematicDef * nominal_syst = new ana::SystematicDef("nominal", nominal_loader, muonid_axis, &ana::kUnweighted);
24  muonid_optimization.DefineNominal(nominal_syst);
25 
26  // Shifted samples
27  for (const std::pair<const std::string, const std::string>& syst : ana::xsec::numubar::syst_datasets)
28  muonid_optimization.DefineSystematic(new SystematicDef(syst.first, new SpectrumLoader(syst.second.c_str()), muonid_axis, &ana::kUnweighted));
29 
30  // GENIE multiverse
31  ana::SystematicDef * genie_syst = new ana::SystematicDef("genie", nominal_loader, muonid_axis, &ana::kUnweighted);
33  muonid_optimization.DefineMultiverseSystematic(genie_syst, genie_univs.GetSystShifts());
34 
35  // PPFX Multiverse
36 
37 
38  muonid_optimization.Go();
39 
40  TFile * fout = TFile::Open(outFilename.c_str(), "RECREATE");
41  muonid_optimization.SaveTo(fout, "muonid_cut_optimize");
42  fout->Close();
43 }
void muonid_optimization()
std::map< const std::string, const std::string > syst_datasets
void muonid_opt(string outFilename)
Definition: muonid_opt.C:13
void genie_syst(int ndatafiles=INT_MAX, int nmcfiles=INT_MAX, string dataflistpn="/nova/ana/users/slin/sam_definition_file_lists/prod_caf_R16-12-20-prod3recopreview.b_nd_numi_fhc_period3_v1_goodruns.txt", string mcflistpn="/nova/ana/users/slin/sam_definition_file_lists/prod_caf_R16-12-20-prod3recopreview.d_nd_genie_nonswap_fhc_nova_v08_full_v3.txt")
Definition: genie_syst.C:38
GenericSystematicDef< caf::SRProxy > SystematicDef
void DefineNominal(SystematicDef *nominal)
std::vector< const ISyst * > getAllXsecSysts_2020()
void SaveTo(TDirectory *dir, const std::string &name) const
void DefineMultiverseSystematic(SystematicDef *syst, std::vector< Var > mv_weights)
const std::string nominal_dataset
Dataset definitions.
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
void DefineSystematic(SystematicDef *syst)
std::vector< SystShifts > GetSystShifts()
GenericHistAxis< Var > HistAxis
Definition: HistAxis.h:111
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:114
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
Definition: Var.h:100