validationscript.C
Go to the documentation of this file.
1 #include <string>
2 #ifdef __CINT__
4 {
5  std::cout << "Sorry, you must run in compiled mode" << std::endl;
6 }
7 #else
8 
10 #include "CAFAna/Core/Spectrum.h"
11 #include "CAFAna/Core/SystShifts.h"
12 #include "CAFAna/Cuts/SpillCuts.h"
13 #include "3FlavorAna/Cuts/NueCutsSecondAna.h"
16 
19 
23 
24 #include "TH1.h"
25 #include "TH2.h"
26 #include "THStack.h"
27 #include "TCanvas.h"
28 #include "TLegend.h"
29 
30 #include <vector>
31 
32 using namespace ana;
34 {
35  TFile * outf = new TFile(outname.c_str(), "recreate");
36 
37  SpectrumLoader lND(fname);
38  lND.SetSpillCut(kStandardSpillCuts);
39 
40  Spectrum* spec[kcNumSels][kcNumChns][kvNumVars];
41  for (int i=0; i<kcNumSels; i++){
42  for (int j=0; j<kcNumChns; j++){
43  for (int k=0; k<kvNumVars; k++){
44  spec[i][j][k] = new Spectrum(hists[k].label, hists[k].bins, lND, hists[k].var,
46  }
47  }
48  }
49 
50  lND.Go();
51  outf->cd();
52 
53  for (int i=0; i<kcNumSels; i++){
54  for (int j=0; j<kcNumChns; j++){
55  for (int k=0; k<kvNumVars; k++){
56  char name[50];
57  sprintf(name, "%s_%s_%s", sels[i].name.c_str(), chns[j].name.c_str(),
58  hists[k].name.c_str());
59  spec[i][j][k]->SaveTo(outf->mkdir(name));
60  }
61  }
62  }
63 
64 
65  outf->Close();
66 }
67 
68 #endif
const XML_Char * name
Definition: expat.h:151
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
const SelDef chns[knumchns]
void validationscript(std::string fname, std::string outname)
std::vector< double > Spectrum
Definition: Constants.h:746
var_value< double > var
Definition: StanTypedefs.h:14
const int kcNumSels
Definition: NueCCIncCuts.h:292
TString hists[nhists]
Definition: bdt_com.C:3
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:39
const char * label
const Cut sels[kNumSels]
Definition: vars.h:44
TFile * outf
Definition: testXsec.C:51
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:534
const double j
Definition: BetheBloch.cxx:29
const SystShifts kNoShift
Definition: SystShifts.cxx:22
OStream cout
Definition: OStream.cxx:6
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const int kcNumChns
Definition: NueCCIncCuts.h:293
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
std::string name
const Var kXSecCVWgt2017
Definition: XsecTunes.h:36
enum BeamMode string