MECSystsNux.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "CAFAna/Core/Loaders.h"
5 #include "TObjString.h"
6 #include "TH2.h"
11 
12 #include <iostream>
13 
14 
15 namespace ana
16 {
17 //-------------------------------------------------------------------------------------//
18 // cut used for official tune, not the same as official kNumu2020ND
19 // the fit was made earlier.
20 
21 
22 
23 struct MECWeight{
24  MECWeight(int universe){
25  DontAddDirectory guard;
26  TFile* f = new TFile("/nova/app/users/jhewes15/dev/nux_mec/NuXAna/Systs/MEC_Systs_Weights.root");
27  h = (TH2D*)f->Get(Form("weighted_%d",universe));
28 // std::cout<<"I'm pulling from the "<<universe<<std::endl;
29 // std::cout<<h->GetBinContent(5,5)<<std::endl;
30  delete f;
31  }
32  double operator()(const caf::SRProxy* sr) const {
33 
34  if ( sr->mc.nnu < 1) return 1.0;
35  if ( !kIsNumuCC( sr ) || sr->mc.nu[0].mode != caf::kMEC ) return 1.0;
36 
37  else{
38 
39  TAxis *xaxis = h->GetXaxis();
40  TAxis *yaxis = h->GetYaxis();
41  Int_t biny = yaxis->FindBin(kTrueQ0( sr ));
42  Int_t binx = xaxis->FindBin(kTrueQ3( sr ));
43 
44 // std::cout<<h->GetTitle()<<" "<<kTrueQ0( sr )<<" "<<kTrueQ3( sr )<<" "<<h->FindBin(kTrueQ0( sr ),kTrueQ3( sr ))
45 // <<" "<<h->GetBinContent(binx,biny)<<std::endl;
46  return h->GetBinContent(binx,biny);
47  }
48  }
49  TH2D* h;
50 
51 };
52 
53 }
54 
55 
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
int FindBin(double x) const
Definition: Binning.cxx:155
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
std::string yaxis
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
const Var kTrueQ0
Definition: TruthVars.h:32
std::string xaxis
const Binning binx
Definition: SINCpi0_Bins.h:7
const Var kTrueQ3
Definition: TruthVars.h:38
caf::StandardRecord * sr
const Binning biny
Definition: SINCpi0_Bins.h:8
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
double operator()(const caf::SRProxy *sr) const
Definition: MECSystsNux.h:32
Prevent histograms being added to the current directory.
Definition: UtilsExt.h:46
MECWeight(int universe)
Definition: MECSystsNux.h:24