Functions
demo3.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 demo3 ()
 

Function Documentation

void demo3 ( )

Definition at line 20 of file demo3.C.

References std::asin(), ana::bins, calc, e, plot_validation_datamc::fname, ana::SpectrumLoader::Go(), make_syst_table_plots::h, ana::kIsNumuCC(), ana::kNHit, kRed, demo0::loader, demo1::nhit, caf::Proxy< caf::SRSlice >::nhit, ana::OscillatableSpectrum::Oscillated(), pot, osc::_OscCalcPMNSOpt< T >::SetdCP(), osc::_OscCalcPMNSOpt< T >::SetDmsq21(), osc::_OscCalcPMNSOpt< T >::SetDmsq32(), osc::_OscCalcPMNSOpt< T >::SetL(), osc::_OscCalcPMNSOpt< T >::SetRho(), osc::_OscCalcPMNSOpt< T >::SetTh12(), osc::_OscCalcPMNSOpt< T >::SetTh13(), osc::_OscCalcPMNSOpt< T >::SetTh23(), ana::Binning::Simple(), caf::Proxy< caf::StandardRecord >::slc, demo2::sosc, demo3::soscd, std::sqrt(), sr, string, ana::Spectrum::ToTH1(), 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  // 2D histograms
45  new TCanvas;
46  sosc.ToTH2(pot)->Draw("colz");
47 
48  // Make a calculator. This is the fastest variant
50 
51  calc.SetL(810);
52  calc.SetRho(2.75);
53  calc.SetDmsq21(7.6e-5);
54  calc.SetDmsq32(2.35e-3);
55  calc.SetTh12(asin(sqrt(.87))/2);
56  calc.SetTh13(asin(sqrt(.10))/2);
57  calc.SetTh23(TMath::Pi()/4);
58  calc.SetdCP(0);
59 
60  // Can oscillate a spectrum (numu->numu)
61  Spectrum soscd = sosc.Oscillated(&calc, 14, 14);
62  TH1* h = soscd.ToTH1(pot);
63  h->SetLineColor(kRed);
64  new TCanvas;
65  nhit.ToTH1(pot)->Draw("hist");
66  h->Draw("hist same");
67 }
enum BeamMode kRed
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
void SetTh13(const T &th13) override
void SetL(double L) override
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
Definition: Spectrum.cxx:148
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
T sqrt(T number)
Definition: d0nt_math.hpp:156
nhit
Definition: demo1.py:25
sosc
Definition: demo2.py:18
osc::OscCalcDumb calc
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
caf::Proxy< unsigned int > nhit
Definition: SRProxy.h:1315
soscd
Definition: demo3.py:40
Optimized version of OscCalcPMNS.
Definition: StanTypedefs.h:31
#define pot
caf::StandardRecord * sr
const Binning bins
void SetTh23(const T &th23) override
loader
Definition: demo0.py:10
void SetDmsq21(const T &dmsq21) override
void SetDmsq32(const T &dmsq32) override
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2142
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
void SetdCP(const T &dCP) override
void SetTh12(const T &th12) override
Float_t e
Definition: plot.C:35
Spectrum with true energy information, allowing it to be oscillated
kNHit
Definition: demo1.py:19
void SetRho(double rho) override
T asin(T number)
Definition: d0nt_math.hpp:60
enum BeamMode string