nus17_fd_cut_tables2D.C
Go to the documentation of this file.
1 // This macro is used to make the nue energy blessed plots. (see doc 11789)
2 // Oscillation parameters are same as those in nue_ana_basic macro
3 
4 #include "CAFAna/Cuts/Cuts.h"
7 #include "CAFAna/Core/Loaders.h"
10 #include "CAFAna/Core/Spectrum.h"
11 #include "CAFAna/Vars/Vars.h"
12 #include "NuXAna/Vars/NusVars.h"
14 #include "CAFAna/Cuts/TimingCuts.h"
15 #include "OscLib/OscCalcDumb.h"
20 
21 #include <string>
22 
23 using namespace ana;
24 
25 
27 {
28 
29  std::string fFDmcDECAF_mcv1 = "/nova/ana/users/gsdavies/nus/prod3/gsdavies_ncid_decaf_nus17_20-06-17_1k_fd_genie_nonswap.root";
30 
31  std::string fFDcosmicdataDECAF_mcv1 = "/nova/ana/users/gsdavies/nus/prod3/gsdavies_ncid_decaf_nus17_20-06-17_11k_concat.root";
32  Loaders loadermc;
33  loadermc.SetLoaderPath(fFDmcDECAF_mcv1, caf::kFARDET, Loaders::kMC, kBeam, Loaders::kNonSwap);
34  //SpectrumLoader loadermc(fFDmcCAF_test);
35  SpectrumLoader loadercos(fFDcosmicdataDECAF_mcv1, kCosmic);
36 
39 
40  //------------------------------------------------------------
41 
42  Spectrum* spec2D_nminus1[ncuts_nminus1][2];
43  IPrediction* preds2D_nminus1[ncuts_nminus1][2];
44 
45 
46  const Var kReweight = kPPFXFluxCVWgt*kXSecCVWgt2017;
47  //------------------------------------------------------------
48 
49 
50  for(int ic = 0; ic < ncuts_nminus1; ++ic){
51  preds2D_nminus1[ic][0] = new PredictionNoExtrap(loadermc,
54  kNoShift, kReweight);
55  spec2D_nminus1[ic][0] = new Spectrum(loadercos, maxyptpaxis,
57  preds2D_nminus1[ic][1] = new PredictionNoExtrap(loadermc,
60  kNoShift, kReweight);
61  spec2D_nminus1[ic][1] = new Spectrum(loadercos, timedistaxis,
63  }
64 
65  loadercos.Go();
66  loadermc.Go();
67 
68  std::cout<<"making output file \n";
69  TFile fout(outfile.c_str(), "RECREATE");
70 
71 
72  for(int ic = 7; ic < ncuts_nminus1; ++ic){
73  char name[50];
74  sprintf(name, "spec_nminus1_%s_%s", cutnames_nminus1[ic].c_str(),
75  "2Dptp");
76  spec2D_nminus1[ic][0]->SaveTo(&fout, name);
77 
78  sprintf(name, "pred_nminus1_%s_%s", cutnames_nminus1[ic].c_str(),
79  "2Dptp");
80  preds2D_nminus1[ic][0]->SaveTo(&fout, name);
81 
82 
83  sprintf(name, "spec_nminus1_%s_%s", cutnames_nminus1[ic].c_str(),
84  "2Dtime");
85  spec2D_nminus1[ic][1]->SaveTo(&fout, name);
86 
87  sprintf(name, "pred_nminus1_%s_%s", cutnames_nminus1[ic].c_str(),
88  "2Dtime");
89  preds2D_nminus1[ic][1]->SaveTo(&fout, name);
90  }
91 }
const HistAxis timedistaxis("Distance from Closest Slice (cm)", Binning::Simple(100, 0., 2000.), kClosestSlcMinDist,"Closest Slice Dist. from Top", Binning::Simple(140, 0, 700), kClosestSlcMinTop)
const XML_Char * name
Definition: expat.h:151
Far Detector at Ash River.
Definition: SREnums.h:11
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
virtual void SaveTo(TDirectory *dir, const std::string &name) const
void SetSpillCut(const SpillCut &cut)
void nus17_fd_cut_tables2D(std::string outfile)
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:162
const Cut kInCosmicTimingWindow
Is the event far from the start and ends of the spill ? For FD cosmic selection.
Definition: TimingCuts.cxx:165
void SetSpillCut(const SpillCut &cut)
Definition: Loaders.cxx:121
const HistAxis maxyptpaxis("Shower Max Y", Binning::Simple(320,-800., 800.), kMaxY,"ptp", Binning::Simple(100, 0., 1.), kPartPtp)
virtual void Go() override
Load all the registered spectra.
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:517
const std::string cutnames_nminus1[ncuts_nminus1]
std::vector< float > Spectrum
Definition: Constants.h:570
const SystShifts kNoShift
Definition: SystShifts.cxx:21
OStream cout
Definition: OStream.cxx:6
const int ncuts_nminus1
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
Prediction that just uses FD MC, with no extrapolation.
const Var kXSecCVWgt2017
Definition: XsecTunes.h:37
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
FILE * outfile
Definition: dump_event.C:13
const Cut cutsarray_nminus1[ncuts_nminus1]