make_quantiles_histogram_2020.C
Go to the documentation of this file.
5 
6 #include "CAFAna/Core/Binning.h"
7 #include "CAFAna/Core/Spectrum.h"
9 
12 #include "CAFAna/Vars/XsecTunes.h"
13 
14 #include "TCanvas.h"
15 #include "TH2.h"
16 #include "TFile.h"
17 #include <iostream>
18 
19 using namespace ana;
20 
21 
23 
24  std::string polarity = "";
25  if ( isFHC) polarity = "fhc";
26  if (!isFHC) polarity = "rhc";
27 
28  std::cout << "\n================================= \n"
29  << " make distribution for quantiles"
30  << "\n================================= \n"
31  << " polarity: " << polarity << ", period: " << period
32  << "\n================================= \n"
33  << std::endl;
34 
35  // Which cut am I using?
36  const Cut kThisCut = kNumu2020FD && kIsNumuCC;
37 
38  // What XSec Weight am I using?
39  const Var kXSecWeight = kXSecCVWgt2020;
40 
41  // Figure out my definition, and then declare my spectrum loader.
42  std::string MyDef = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_nonswap_"+polarity+"_nova_v08_"+period+"_v1";
43  SpectrumLoader loader( MyDef );
45 
46  // Declare my spectra
47  Spectrum sQuantiles (loader, kNumuCCOptimisedAxis2020, kHadEFracAxis2020, kThisCut , kNoShift, kPPFXFluxCVWgt*kXSecWeight );
48 
49  // Set my loader going.
50  loader.Go();
51 
52  // Call the MakeQuantileHistogram function.
53  TH2* hQuantiles = sQuantiles .ToTH2( sQuantiles .POT() );
54 
55  // Make my OldPresel Output file
56  std::string Out_OldPresel = "quantiles_" + polarity + "_" + period + "_numu2020.root";
57  TFile *OutFile = TFile::Open(Out_OldPresel.c_str(), "RECREATE");
58 
59  hQuantiles -> Write("FDSpec2D" );
60 
61  OutFile -> Close();
62 
63  new TCanvas;
64  hQuantiles->Draw("colz");
65 
66 }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
TH2 * ToTH2(double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Spectrum must be 2D to obtain TH2.
Definition: Spectrum.cxx:165
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
void SetSpillCut(const SpillCut &cut)
const HistAxis kNumuCCOptimisedAxis2020("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kNumuE2020)
Definition: HistAxes.h:25
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const HistAxis kHadEFracAxis2020("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kNumuHadEFrac2020)
Definition: HistAxes.h:31
void make_quantiles_histogram_2020(bool isFHC, std::string period="full")
virtual void Go() override
Load all the registered spectra.
loader
Definition: demo0.py:10
const Cut kNumu2020FD
Definition: NumuCuts2020.h:59
c1 Close()
static bool isFHC
const SystShifts kNoShift
Definition: SystShifts.cxx:21
OStream cout
Definition: OStream.cxx:6
std::vector< double > POT
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
TFile * OutFile
const Var kXSecCVWgt2020
Definition: XsecTunes.h:106
gm Write()
enum BeamMode string