9 #include "cetlib_except/exception.h" 64 if( !sp.
find_file(
"CAFAna/data/xs/genie_small_pc_shifts_fn_2020.root", filePath) )
66 <<
"Cannot find pca file ";
114 :
ISyst(shortname,latexname),
115 fFileName(fname), fHistName(shortname), fHistos()
137 if(
fHistos[0][0][0][0][0])
return;
145 TIter iterHist(gDirectory->GetListOfKeys());
149 while((keyHist = (TKey*)iterHist())) {
150 TString
histName = keyHist->GetName();
155 if(histName.Contains(
"FHC")) flux =
kFHC;
156 if(histName.Contains(
"RHC")) flux =
kRHC;
159 if(histName.Contains(
"ND")) det =
kND;
160 if(histName.Contains(
"FD")) det =
kFD;
163 if(histName.Contains(
"Numu")) sel =
kNumuSel;
164 if(histName.Contains(
"Nue" )) sel =
kNueSel;
167 if(histName.Contains(
"SigQE" )) flav =
kSigQE;
168 if(histName.Contains(
"SigNonQE")) flav =
kSigNonQE;
169 if(histName.Contains(
"Other" )) flav =
kBkgFlav;
170 if(histName.Contains(
"NC" )) flav =
kNC;
173 if(histName.Contains(
"minus")) sign =
kMinus;
174 if(histName.Contains(
"plus" )) sign =
kPlus;
197 if(sr->
mc.
nnu == 0)
return 1;
203 case 1 : det =
kND;
break;
204 case 2 : det =
kFD;
break;
223 if(NueNDSel(sr)) sel =
kNueSel;
227 if(NueFDSel(sr)) sel =
kNueSel;
229 if(sel == -1)
return 1;
243 if(flav == -1)
return 1;
254 if (energy > h->GetXaxis()->GetXmin() &&
255 energy < h->GetXaxis()->GetXmax() ){
256 return h->Interpolate(energy);
259 if (energy > h->GetXaxis()->GetXmax())
260 return h->GetBinContent(h->GetNbinsX());
268 if(sigma == 0)
return;
272 if(sigma<0) sign =
kMinus;
274 weight *=1+(
GetWeight(sr, sign)-1.)*TMath::Abs(sigma);
caf::Proxy< caf::SRSpill > spill
void InitializeHistograms() const
T max(const caf::Proxy< T > &a, T b)
Cuts and Vars for the 2020 FD DiF Study.
GeniePCASyst * GetGeniePrincipals2018(int PCIdx)
caf::Proxy< caf::SRHeader > hdr
const Cut kIsNumu([](const caf::SRProxy *sr){return(sr->mc.nnu==1 &&abs(sr->mc.nu[0].pdg)==14);})
Proxy for caf::StandardRecord.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
::xsd::cxx::tree::exception< char > exception
caf::Proxy< short int > nnu
std::string find_file(std::string const &filename) const
std::string FindCAFAnaDir()
Encapsulate code to systematically shift a caf::SRProxy.
TH1D * fHistos[kNumFluxType][kNumDets][kNumSels][kNumFlavors][kNumSigns]
const Cut kIsNC([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return!sr->mc.nu[0].iscc;})
Is this a Neutral Current event?
const Cut kIsNue([](const caf::SRProxy *sr){return(sr->mc.nnu==1 &&abs(sr->mc.nu[0].pdg)==12);})
double GetWeight(const caf::SRProxy *sr, ESign sign) const
GeniePCASyst * GetGeniePrincipals2018Small(int PCIdx)
caf::Proxy< caf::SRTruthBranch > mc
GeniePCASyst(const std::string &fname, const std::string &shortname, const std::string &latexname)
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
std::string to_string(ModuleType mt)
TH1D * getHist(int f, int d, int s, int fl, int p)
GeniePCASyst * GetGeniePrincipals2020Small(int PCIdx)