8 #include "CAFAna/Core/Binning.h" 9 #include "CAFAna/Core/Cut.h" 10 #include "CAFAna/Core/HistAxis.h" 71 std::string wfile_name = (
"/nova/ana/users/zvallari/AcceptSyst2020/"+wfile).c_str();
72 TFile *weight_file = TFile::Open(wfile_name.c_str());
76 gDirectory->GetObject((
"trueQ2_weight_"+sample).c_str(),h);
79 int nbins = h->GetNbinsX();
82 bins[
i-1] = h->GetBinContent(
i);
83 binslow[
i-1] = h->GetBinLowEdge(
i);
84 binshigh[
i-1] = h->GetBinLowEdge(
i) + h->GetBinWidth(
i);
87 const Var kTrueQ2Weight([nbins, &binslow, &binshigh, &bins](
const caf::SRProxy *
sr){
90 std::cout <<
"THERE IS AN EVENT WHICH DOES NOT PASS NUMU ND CUT IN NUE SIGNAL EXTRAP!!!!" <<
std::endl;
105 gDirectory->GetObject((
"PtP_weight_"+sample).c_str(),hptp);
108 int nbins_ptp = hptp->GetNbinsX();
109 double bins_ptp[nbins_ptp], binslow_ptp[nbins_ptp], binshigh_ptp[nbins_ptp];
110 for(
int i = 1;
i <= nbins_ptp; ++
i){
111 bins_ptp[
i-1] = hptp->GetBinContent(
i);
112 binslow_ptp[
i-1] = hptp->GetBinLowEdge(
i);
113 binshigh_ptp[
i-1] = hptp->GetBinLowEdge(
i) + hptp->GetBinWidth(
i);
116 const Var kPtPWeight([nbins_ptp, &binslow_ptp, &binshigh_ptp, &bins_ptp](
const caf::SRProxy *sr){
118 for(
int i = 0;
i < nbins_ptp; ++
i){
119 if((kPtP(sr) > binslow_ptp[i]) && (kPtP(sr) < binshigh_ptp[i])){return bins_ptp[i];}
127 gDirectory->GetObject((
"CosNumi_weight_"+sample).c_str(),hcos);
130 int nbins_cos = hptp->GetNbinsX();
131 double bins_cos[nbins_cos], binslow_cos[nbins_cos], binshigh_cos[nbins_cos];
132 for(
int i = 1;
i <= nbins_cos; ++
i){
133 bins_cos[
i-1] = hcos->GetBinContent(
i);
134 binslow_cos[
i-1] = hcos->GetBinLowEdge(
i);
135 binshigh_cos[
i-1] = hcos->GetBinLowEdge(
i) + hcos->GetBinWidth(
i);
138 const Var kCosWeight([nbins_cos, &binslow_cos, &binshigh_cos, &bins_cos](
const caf::SRProxy *
sr){
140 for(
int i = 0;
i < nbins_cos; ++
i){
141 if((kCosNumi(sr) > binslow_cos[i]) && (kCosNumi(sr) < binshigh_cos[i])){return bins_cos[i];}
148 weight_file->Close();
155 const TString cutname;
156 const TString varname;
159 std::vector <GenDef>
gens;
163 sample.c_str(),
"nueAxis_NoExtrap"});
172 sample.c_str(),
"nueAxis_NueSignalExtrap_Q2Weight"});
180 sample.c_str(),
"nueAxis_NueSignalExtrap_CosWeight"});
188 sample.c_str(),
"nueAxis_NueSignalExtrap_PtPWeight"});
191 for(
auto & gen:
gens){
192 predictions.push_back(gen.gen->Generate(loaders).release());
const ana::Var kRecoQ2([](const caf::SRProxy *sr){const double M_mu_sqrd=util::sqr(0.1056);double E_mu=kMuE(sr);double p_mu=sqrt(util::sqr(E_mu)-M_mu_sqrd);return 2 *kCCE(sr)*(E_mu-p_mu *kCosNumi(sr))-M_mu_sqrd;})
Reconstructed four-momentum transfer invariant (Q^2)
Far Detector at Ash River.
Cuts and Vars for the 2020 FD DiF Study.
caf::Proxy< caf::SRHeader > hdr
Proxy for caf::StandardRecord.
const HistAxis kNumuCCOptimisedAxis2020("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kNumuE2020)
void Go()
Call Go() on all the loaders.
void SetSpillCut(const SpillCut &cut)
string outfilename
knobs that need extra care
For nominal spectra and reweighting systs (xsec/flux)
const HistAxis kNue2020Axis("NuE Energy / Analysis Bin", kNue2020Binning, kNue2020AnaBin)
Use this Axis for Ana2020, official Axis.
Simple oscillation probability calculator that has no solar term or mass hierarchy or delta so it's s...
const SystShifts kNoShift
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
Given loaders and an MC shift, Generate() generates an IPrediction.
const Cut kNue2020FDAllSamples
void make_nueFDprediction_kinematics_RHC_REW(const std::string sample, const std::string wfile, const std::string &outfilename="FDprediction_kinematics_REW.root")