rock.C
Go to the documentation of this file.
1 #include "OscLib/OscCalcDumb.h"
2 
3 #include "CAFAna/Core/Spectrum.h"
5 
6 #include "CAFAna/Cuts/Cuts.h"
10 
11 #include "CAFAna/Vars/Vars.h"
14 
16 
18 //#include "./vars.h"
19 
20 #include "TFile.h"
21 
22 #include <iostream>
23 #include <cmath>
24 
25 using namespace ana;
26 
27 
28 void rock(std::string suffix = "full")
29 {
30 
31 // SpectrumLoader lNonS("prod_caf_R17-03-01-prod3reco.m_fd_rock+cosmic-overlay_genie_nonswap_fhc_nova_v08_full_v2");
32 // SpectrumLoader lSwap("prod_caf_R17-03-01-prod3reco.m_fd_rock+cosmic-overlay_genie_fluxswap_fhc_nova_v08_full_v2");
33 
34  SpectrumLoader lNonS("/pnfs/nova/scratch/users/bnayak/nue2017_fd_mc/prod_sumdecaf_R17-03-01-prod3reco.m_fd_rock+cosmic-overlay_genie_nonswap_fhc_nova_v08_full_v2_nue2017/*.root");
35  SpectrumLoader lSwap("/pnfs/nova/scratch/users/bnayak/nue2017_fd_mc/prod_sumdecaf_R17-03-01-prod3reco.m_fd_rock+cosmic-overlay_genie_fluxswap_fhc_nova_v08_full_v2_nue2017/*.root");
36 
39 
41 
42  cout << "ATTENTION! THERE IS A DECAF CUT BELOW, BE CAREFUL!" << endl;
43 
44  for(int selIdx = 0; selIdx < kNumSels; ++selIdx){
45  for (int varIdx=0; varIdx<kNumVars;varIdx++){
46  const HistAxis& axis = defs[varIdx].axis;
47  pred[selIdx][varIdx] = new PredictionNoExtrap(lNonS, lSwap,
48  axis.GetLabels()[0], axis.GetBinnings()[0], axis.GetVars()[0],
49  sels[selIdx] && kInBeamSpill && kNueFD2017DecafCut, //don't forget about decaf cut here
50  kNoShift,
52 
53  }
54  }
55 
56  lNonS.Go();
57  lSwap.Go();
58 
59  TFile* file = new TFile(("rock_bkg_"+suffix+".root").c_str(),"RECREATE");
60  for(int selIdx = 0; selIdx < kNumSels; ++selIdx){
61  TDirectory* d = file->mkdir(selNames[selIdx].c_str());
62  for (int varIdx=0; varIdx<kNumVars;varIdx++){
63  const char* name = defs[varIdx].name.c_str();
64  pred[selIdx][varIdx]->SaveTo(d, TString::Format("rock_%s", name));
65  }
66  }
67 
68 }
const XML_Char * name
Definition: expat.h:151
const int kNumVars
Definition: vars.h:14
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const std::vector< T > & GetVars() const
Definition: HistAxis.h:92
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
std::string name
Definition: NuePlotLists.h:12
void SetSpillCut(const SpillCut &cut)
const Cut sels[kNumSels]
Definition: vars.h:44
Float_t d
Definition: plot.C:236
virtual void Go() override
Load all the registered spectra.
const HistDef defs[kNumVars]
Definition: vars.h:15
const int kNumSels
Definition: vars.h:43
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
HistAxis axis
Definition: NuePlotLists.h:13
const SystShifts kNoShift
Definition: SystShifts.cxx:21
OStream cout
Definition: OStream.cxx:6
const std::vector< Binning > & GetBinnings() const
Definition: LabelsAndBins.h:69
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
TFile * file
Definition: cellShifts.C:17
const Cut kInBeamSpill([](const caf::SRProxy *sr){if(sr->spill.run > util::kLastBadTimingRun) return kInBeamSpill_main(sr);else return kInBeamSpill_main(sr)||kInBeamSpill_shifted(sr);}, [](const caf::SRSpillProxy *spill){if(spill->run > util::kLastBadTimingRun) return kInBeamSpill_main.Livetime(spill);else return kInBeamSpill_main.Livetime(spill)+kInBeamSpill_shifted.Livetime(spill);}, [](const caf::SRSpillProxy *spill) -> double{return spill->spillpot;})
Does the event fall inside the window we call the beam spill?
Definition: TimingCuts.h:8
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
Prediction that just uses FD MC, with no extrapolation.
const Cut kNueFD2017DecafCut
Definition: NueCuts2017.h:157
const std::string selNames[kNumSels]
Definition: vars.h:46
const Var kXSecCVWgt2017
Definition: XsecTunes.h:37
void rock(std::string suffix="full")
Definition: rock.C:28
const std::vector< std::string > & GetLabels() const
Definition: LabelsAndBins.h:68