Functions
demo2.C File Reference
#include "OscLib/OscCalcPMNSOpt.h"
#include "CAFAna/Core/Binning.h"
#include "CAFAna/Cuts/Cuts.h"
#include "CAFAna/Experiment/SingleSampleExperiment.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Core/SpectrumLoader.h"
#include "CAFAna/Vars/Vars.h"
#include "StandardRecord/Proxy/SRProxy.h"
#include "TCanvas.h"
#include "TH2.h"

Go to the source code of this file.

Functions

void demo2 ()
 

Function Documentation

void demo2 ( )

Definition at line 20 of file demo2.C.

References ana::bins, plot_validation_datamc::fname, ana::SpectrumLoader::Go(), ana::kIsNumuCC(), ana::kNHit, demo0::loader, demo1::nhit, caf::Proxy< caf::SRSlice >::nhit, pot, ana::Binning::Simple(), caf::Proxy< caf::StandardRecord >::slc, demo2::sosc, sr, string, and ana::ReweightableSpectrum::ToTH2().

21 {
22  const std::string fname = "prod_sumdecaf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1_numu2020";
23 
24  SpectrumLoader loader(fname);
25 
26  const Binning bins = Binning::Simple(100, 0, 1000);
27 
28  const Var kNHit([](const caf::SRProxy* sr)
29  {
30  return sr->slc.nhit;
31  });
32 
33  Spectrum nhit("Number of hits in slice", bins, loader, kNHit, kIsNumuCC);
34 
35  // With true energy axis too
36  OscillatableSpectrum sosc("Number of hits in slice", bins, loader, kNHit, kIsNumuCC);
37 
38  // Do it!
39  loader.Go();
40 
41  // How to scale histograms
42  const double pot = 18e20;
43 
44  // We have histograms
45  nhit.ToTH1(pot)->Draw("hist");
46 
47  // And 2D histograms
48  new TCanvas;
49  sosc.ToTH2(pot)->Draw("colz");
50 }
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
nhit
Definition: demo1.py:25
sosc
Definition: demo2.py:18
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
caf::Proxy< unsigned int > nhit
Definition: SRProxy.h:1315
#define pot
caf::StandardRecord * sr
const Binning bins
loader
Definition: demo0.py:10
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2142
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
Spectrum with true energy information, allowing it to be oscillated
kNHit
Definition: demo1.py:19
enum BeamMode string