Functions
nus17_fd_cut_tables2D.C File Reference
#include "CAFAna/Cuts/Cuts.h"
#include "CAFAna/Cuts/SpillCuts.h"
#include "CAFAna/Analysis/Exposures.h"
#include "CAFAna/Core/Loaders.h"
#include "CAFAna/Core/Utilities.h"
#include "CAFAna/Core/SpectrumLoader.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Vars/Vars.h"
#include "NuXAna/Vars/NusVars.h"
#include "CAFAna/Vars/GenieWeights.h"
#include "CAFAna/Cuts/TimingCuts.h"
#include "OscLib/OscCalcDumb.h"
#include "CAFAna/Prediction/PredictionNoExtrap.h"
#include "CAFAna/Vars/PPFXWeights.h"
#include "NuXAna/macros/Nus17/nus17_fd_arrays.h"
#include "NuXAna/macros/Nus17/NusLoadProd3.h"
#include <string>

Go to the source code of this file.

Functions

void nus17_fd_cut_tables2D (std::string outfile)
 

Function Documentation

void nus17_fd_cut_tables2D ( std::string  outfile)

Definition at line 26 of file nus17_fd_cut_tables2D.C.

References om::cout, cutnames_nminus1, cutsarray_nminus1, submit_syst::fout, ana::SpectrumLoader::Go(), ana::Loaders::Go(), ana::kBeam, ana::kCosmic, caf::kFARDET, ana::kInCosmicTimingWindow, ana::Loaders::kMC, ana::Loaders::kNonSwap, ana::kNoShift, ana::kPPFXFluxCVWgt, ana::kStandardSpillCuts, ana::kXSecCVWgt2017, maxyptpaxis(), ncuts_nminus1, ana::IPrediction::SaveTo(), ana::Spectrum::SaveTo(), ana::Loaders::SetLoaderPath(), ana::Loaders::SetSpillCut(), ana::SpectrumLoaderBase::SetSpillCut(), and timedistaxis().

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 
38  loadercos.SetSpillCut(kStandardSpillCuts);
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
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
const Color_t kMC
virtual void SaveTo(TDirectory *dir, const std::string &name) const
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)
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:573
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]