Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ana::PredictionNueRebinSA Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-02-16/CAFAna/Prediction/PredictionNueRebinSA.h"

Inheritance diagram for ana::PredictionNueRebinSA:
ana::IPrediction

Public Member Functions

 PredictionNueRebinSA (IPrediction *pred)
 pred must already be fully filled More...
 
virtual ~PredictionNueRebinSA ()
 
virtual Spectrum Predict (osc::IOscCalculator *calc) const override
 
virtual Spectrum PredictComponent (osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
 
virtual void SaveTo (TDirectory *dir) const override
 
virtual Spectrum PredictUnoscillated () const
 
virtual SpectrumStan Predict (osc::IOscCalculatorStan *calc) const
 
virtual Spectrum PredictSyst (osc::IOscCalculator *calc, const SystShifts &syst) const
 
virtual SpectrumStan PredictSyst (osc::IOscCalculatorStan *calc, const SystShifts &syst) const
 
virtual SpectrumStan PredictComponent (osc::IOscCalculatorStan *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual Spectrum PredictComponentSyst (osc::IOscCalculator *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual SpectrumStan PredictComponentSyst (osc::IOscCalculatorStan *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual void Derivative (osc::IOscCalculator *calc, const SystShifts &shift, double pot, std::unordered_map< const ISyst *, std::vector< double >> &dchi) const
 
virtual OscillatableSpectrum ComponentCC (int from, int to) const
 
virtual Spectrum ComponentNCTotal () const
 
virtual Spectrum ComponentNC () const
 
virtual Spectrum ComponentNCAnti () const
 

Static Public Member Functions

static std::unique_ptr< PredictionNueRebinSALoadFrom (TDirectory *dir)
 Can load any Prediction or an actual PredictionNueRebinSA. More...
 

Protected Member Functions

 PredictionNueRebinSA ()
 For LoadFrom. More...
 
OscillatableSpectrum Reduce (const OscillatableSpectrum &s) const
 
Spectrum Reduce (const Spectrum &s) const
 
Spectrum Inflate (const Spectrum &s) const
 

Protected Attributes

OscillatableSpectrum fComponentCC [2][3][2]
 
Spectrum fComponentNCTot
 

Detailed Description

Make use of the fact that some bins in the nue SA 2D binning are known to be empty to make predictions faster.

Definition at line 11 of file PredictionNueRebinSA.h.

Constructor & Destructor Documentation

ana::PredictionNueRebinSA::PredictionNueRebinSA ( IPrediction pred)

pred must already be fully filled

Definition at line 13 of file PredictionNueRebinSA.cxx.

References ana::IPrediction::ComponentCC(), fComponentCC, fComponentNCTot, plot_validation_datamc::pred, and Reduce().

14  :
16  {
17  {pred->ComponentCC(+12, +12), pred->ComponentCC(-12, -12)},
18  {pred->ComponentCC(+12, +14), pred->ComponentCC(-12, -14)},
19  {pred->ComponentCC(+12, +16), pred->ComponentCC(-12, -16)}
20  },
21  {
22  {pred->ComponentCC(+14, +12), pred->ComponentCC(-14, -12)},
23  {pred->ComponentCC(+14, +14), pred->ComponentCC(-14, -14)},
24  {pred->ComponentCC(+14, +16), pred->ComponentCC(-14, -16)}
25  }
26  },
27  fComponentNCTot(pred->ComponentNCTotal())
28  {
29  for(int from = 0; from < 2; ++from)
30  for(int to = 0; to < 3; ++to)
31  for(int anti = 0; anti < 2; ++anti)
32  fComponentCC[from][to][anti] = Reduce(fComponentCC[from][to][anti]);
33 
35  }
OscillatableSpectrum Reduce(const OscillatableSpectrum &s) const
OscillatableSpectrum fComponentCC[2][3][2]
ana::PredictionNueRebinSA::~PredictionNueRebinSA ( )
virtual

Definition at line 38 of file PredictionNueRebinSA.cxx.

39  {
40  }
ana::PredictionNueRebinSA::PredictionNueRebinSA ( )
inlineprotected

For LoadFrom.

Definition at line 36 of file PredictionNueRebinSA.h.

References fComponentNCTot, Inflate(), and Reduce().

Referenced by LoadFrom().

37  :
39  {
40  {OscillatableSpectrum(0, {}, {}, 0, 0), OscillatableSpectrum(0, {}, {}, 0, 0)},
41  {OscillatableSpectrum(0, {}, {}, 0, 0), OscillatableSpectrum(0, {}, {}, 0, 0)},
42  {OscillatableSpectrum(0, {}, {}, 0, 0), OscillatableSpectrum(0, {}, {}, 0, 0)}
43  },
44  {
45  {OscillatableSpectrum(0, {}, {}, 0, 0), OscillatableSpectrum(0, {}, {}, 0, 0)},
46  {OscillatableSpectrum(0, {}, {}, 0, 0), OscillatableSpectrum(0, {}, {}, 0, 0)},
47  {OscillatableSpectrum(0, {}, {}, 0, 0), OscillatableSpectrum(0, {}, {}, 0, 0)}
48  }
49  },
50  fComponentNCTot(Spectrum(0, {}, {}, 0, 0))
51  {
52  }
OscillatableSpectrum fComponentCC[2][3][2]

Member Function Documentation

virtual OscillatableSpectrum ana::IPrediction::ComponentCC ( int  from,
int  to 
) const
inlinevirtualinherited
virtual Spectrum ana::IPrediction::ComponentNC ( ) const
inlinevirtualinherited

Reimplemented in ana::PredictionExtendToPeripheral, ana::PredictionAddRock, ana::PredictionCombinePeriods, and ana::PredictionExtrap.

Definition at line 111 of file IPrediction.h.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::PredictionAddRock::ComponentNC(), and ana::PredictionExtendToPeripheral::PredictionExtendToPeripheral().

112  {std::cout << "WARNING! ComponentNC is unimplemented in IPrediction" << std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IPrediction::ComponentNCAnti ( ) const
inlinevirtualinherited

Reimplemented in ana::PredictionExtendToPeripheral, ana::PredictionAddRock, ana::PredictionCombinePeriods, and ana::PredictionExtrap.

Definition at line 113 of file IPrediction.h.

References om::cout, dir, allTimeWatchdog::endl, and ana::SaveTo().

Referenced by ana::PredictionAddRock::ComponentNCAnti(), and ana::PredictionExtendToPeripheral::PredictionExtendToPeripheral().

114  {std::cout << "WARNING! ComponentNCAnti is unimplemented in IPrediction" << std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IPrediction::ComponentNCTotal ( ) const
inlinevirtualinherited

Reimplemented in ana::PredictionExtendToPeripheral, ana::PredictionAddRock, ana::PredictionCombinePeriods, and ana::PredictionExtrap.

Definition at line 109 of file IPrediction.h.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::PredictionAddRock::ComponentNCTotal(), and ana::PredictionExtendToPeripheral::PredictionExtendToPeripheral().

110  {std::cout << "WARNING! ComponentNCTotal is unimplemented in IPrediction" << std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual void ana::IPrediction::Derivative ( osc::IOscCalculator calc,
const SystShifts shift,
double  pot,
std::unordered_map< const ISyst *, std::vector< double >> &  dchi 
) const
inlinevirtualinherited

Reimplemented in ana::PredictionInterp, and ana::PredictionAddRock.

Definition at line 92 of file IPrediction.h.

Referenced by ana::PredictionAddRock::Derivative(), and ana::SingleSampleExperiment::Derivative().

96  {
97  // Implementing this function is optional. If you don't implement it,
98  // this default implementation will be used, which signals to callers
99  // that your Prediction doesn't implement this feature.
100  dchi.clear();
101  }
Spectrum ana::PredictionNueRebinSA::Inflate ( const Spectrum s) const
protected

Definition at line 211 of file PredictionNueRebinSA.cxx.

References ana::HistCache::Delete(), ana::Spectrum::GetBinnings(), ana::Spectrum::GetLabels(), m, ana::HistCache::New(), ana::Spectrum::POT(), ana::Binning::Simple(), and ana::Spectrum::ToTH1().

Referenced by PredictComponent(), and PredictionNueRebinSA().

212  {
213  DontAddDirectory guard;
214 
215  TH1D* hin = s.ToTH1(s.POT());
216  assert(hin->GetNbinsX() == 12); // reduced binning
217 
218  // What external observers are expecting to see
219  TH1D* hout = HistCache::New(hin->GetTitle(),
220  Binning::Simple(30, 0, 30));
221 
222  for(const std::pair<int, int>& m: kBinMapping){
223  // hout->SetBinContent(m.first, hin->GetBinContent(m.second));
224  // This is on the critical path for fits, let's do it the fast way
225  hout->fArray[m.first] = hin->fArray[m.second];
226  }
227 
228  HistCache::Delete(hin);
229 
230  return Spectrum(std::unique_ptr<TH1D>(hout), s.GetLabels(), s.GetBinnings(), s.POT(), 0);
231  }
const XML_Char * s
Definition: expat.h:262
static void Delete(TH1D *&h)
Definition: HistCache.cxx:215
const std::vector< std::pair< int, int > > kBinMapping
static TH1D * New(const std::string &title, const Binning &bins)
Definition: HistCache.cxx:24
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:38
std::unique_ptr< PredictionNueRebinSA > ana::PredictionNueRebinSA::LoadFrom ( TDirectory *  dir)
static

Can load any Prediction or an actual PredictionNueRebinSA.

Definition at line 90 of file PredictionNueRebinSA.cxx.

References genie::utils::style::Format(), MECModelEnuComparisons::i, calib::j, ana::LoadFrom< IPrediction >(), PredictionNueRebinSA(), runNovaSAM::release, runNovaSAM::ret, and getGoodRuns4SAM::tag.

Referenced by ana::LoadFrom< IPrediction >().

91  {
92  TObjString* tag = (TObjString*)dir->Get("type");
93  assert(tag);
94 
95  if(tag->GetString() == "PredictionNueRebinSA"){
96  std::unique_ptr<PredictionNueRebinSA> ret(new PredictionNueRebinSA);
97 
98  for(int i = 0; i < 2; ++i){
99  for(int j = 0; j < 3; ++j){
100  for(int k = 0; k < 2; ++k){
101  ret->fComponentCC[i][j][k] = *ana::LoadFrom<OscillatableSpectrum>(dir->GetDirectory(TString::Format("cc_%d%d%d", i, j, k))).release();
102  }
103  }
104  }
105 
106  ret->fComponentNCTot = *ana::LoadFrom<Spectrum>(dir->GetDirectory("nc")).release();
107 
108  return ret;
109  }
110  else{
111  return std::unique_ptr<PredictionNueRebinSA>(new PredictionNueRebinSA(ana::LoadFrom<IPrediction>(dir).get()));
112  }
113  }
PredictionNueRebinSA()
For LoadFrom.
const double j
Definition: BetheBloch.cxx:29
std::unique_ptr< IPrediction > LoadFrom< IPrediction >(TDirectory *dir)
Definition: IPrediction.cxx:38
TDirectory * dir
Definition: macro.C:5
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
Spectrum ana::PredictionNueRebinSA::Predict ( osc::IOscCalculator calc) const
overridevirtual

Implements ana::IPrediction.

Definition at line 43 of file PredictionNueRebinSA.cxx.

References ana::Flavors::kAll, ana::Current::kBoth, ana::Sign::kBoth, and PredictComponent().

44  {
45  return PredictComponent(calc,
48  Sign::kBoth);
49  }
Interactions of both types.
Definition: IPrediction.h:42
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
virtual Spectrum PredictComponent(osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
SpectrumStan ana::IPrediction::Predict ( osc::IOscCalculatorStan calc) const
virtualinherited

Reimplemented in ana::PredictionInterp, and ana::PredictionExtrap.

Definition at line 92 of file IPrediction.cxx.

93  {
94  assert(0 && "This Prediction hasn't implemented a Stan-aware Predict()!");
95  }
Spectrum ana::PredictionNueRebinSA::PredictComponent ( osc::IOscCalculator calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtual

Implements ana::IPrediction.

Definition at line 52 of file PredictionNueRebinSA.cxx.

References ana::Spectrum::Clear(), fComponentCC, fComponentNCTot, Inflate(), ana::Flavors::kAll, ana::Sign::kAntiNu, ana::Sign::kBoth, ana::Current::kCC, ana::Current::kNC, ana::Sign::kNu, ana::Flavors::kNuEToNuE, ana::Flavors::kNuEToNuMu, ana::Flavors::kNuEToNuTau, ana::Flavors::kNuMuToNuE, ana::Flavors::kNuMuToNuMu, ana::Flavors::kNuMuToNuTau, ana::OscillatableSpectrum::Oscillated(), and runNovaSAM::ret.

Referenced by Predict().

56  {
57  Spectrum ret = fComponentNCTot; // Get binning
58  ret.Clear();
59 
60  if(curr & Current::kCC){
61  if(flav & Flavors::kNuEToNuE && sign & Sign::kNu) ret += fComponentCC[0][0][0].Oscillated(calc, +12, +12);
62  if(flav & Flavors::kNuEToNuE && sign & Sign::kAntiNu) ret += fComponentCC[0][0][1].Oscillated(calc, -12, -12);
63 
64  if(flav & Flavors::kNuEToNuMu && sign & Sign::kNu) ret += fComponentCC[0][1][0].Oscillated(calc, +12, +14);
65  if(flav & Flavors::kNuEToNuMu && sign & Sign::kAntiNu) ret += fComponentCC[0][1][1].Oscillated(calc, -12, -14);
66 
67  if(flav & Flavors::kNuEToNuTau && sign & Sign::kNu) ret += fComponentCC[0][2][0].Oscillated(calc, +12, +16);
68  if(flav & Flavors::kNuEToNuTau && sign & Sign::kAntiNu) ret += fComponentCC[0][2][1].Oscillated(calc, -12, -16);
69 
70  if(flav & Flavors::kNuMuToNuE && sign & Sign::kNu) ret += fComponentCC[1][0][0].Oscillated(calc, +14, +12);
71  if(flav & Flavors::kNuMuToNuE && sign & Sign::kAntiNu) ret += fComponentCC[1][0][1].Oscillated(calc, -14, -12);
72 
73  if(flav & Flavors::kNuMuToNuMu && sign & Sign::kNu) ret += fComponentCC[1][1][0].Oscillated(calc, +14, +14);
74  if(flav & Flavors::kNuMuToNuMu && sign & Sign::kAntiNu) ret += fComponentCC[1][1][1].Oscillated(calc, -14, -14);
75 
76  if(flav & Flavors::kNuMuToNuTau && sign & Sign::kNu) ret += fComponentCC[1][2][0].Oscillated(calc, +14, +16);
77  if(flav & Flavors::kNuMuToNuTau && sign & Sign::kAntiNu) ret += fComponentCC[1][2][1].Oscillated(calc, -14, -16);
78  }
79  if(curr & Current::kNC){
80  assert(flav == Flavors::kAll); // Don't know how to calculate anything else
81  assert(sign == Sign::kBoth); // Why would you want to split NCs out by sign?
82 
83  ret += fComponentNCTot;
84  }
85 
86  return Inflate(ret);
87  }
Spectrum Oscillated(osc::IOscCalculator *calc, int from, int to) const
Antineutrinos-only.
Definition: IPrediction.h:50
(&#39; appearance&#39;)
Definition: IPrediction.h:18
(&#39;beam &#39;)
Definition: IPrediction.h:15
Spectrum Inflate(const Spectrum &s) const
void Clear()
Definition: Spectrum.cxx:878
OscillatableSpectrum fComponentCC[2][3][2]
Charged-current interactions.
Definition: IPrediction.h:39
Neutrinos-only.
Definition: IPrediction.h:49
def sign(x)
Definition: canMan.py:204
(&#39; survival&#39;)
Definition: IPrediction.h:19
Neutral-current interactions.
Definition: IPrediction.h:40
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
(&#39; appearance&#39;)
Definition: IPrediction.h:16
SpectrumStan ana::IPrediction::PredictComponent ( osc::IOscCalculatorStan calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

Reimplemented in ana::PredictionInterp, and ana::PredictionExtrap.

Definition at line 119 of file IPrediction.cxx.

123  {
124  assert(0 && "This Prediction hasn't implemented a Stan-aware PredictComponent()!");
125  }
Spectrum ana::IPrediction::PredictComponentSyst ( osc::IOscCalculator calc,
const SystShifts syst,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

Reimplemented in ana::PredictionInterp, ana::PredictionNumuFAHadE, ana::PredictionCombinePeriods, and ana::PredictionAddRock.

Definition at line 128 of file IPrediction.cxx.

References ana::SystShifts::IsNominal(), and ana::IPrediction::PredictComponent().

Referenced by PlotSysts(), ana::PredictionAddRock::PredictComponentSyst(), ana::PredictionCombinePeriods::PredictComponentSyst(), ana::PredictionNumuFAHadE::PredictComponentSyst(), systematics_extrap_comp_from_pred_interp(), systematics_summary_from_pred_interp(), and systematics_table_from_pred_interp().

133  {
134  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
135 
136  // Default implementation: no treatment of systematics
137  return PredictComponent(calc, flav, curr, sign);
138  }
virtual Spectrum PredictComponent(osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
def sign(x)
Definition: canMan.py:204
string syst
Definition: plotSysts.py:176
SpectrumStan ana::IPrediction::PredictComponentSyst ( osc::IOscCalculatorStan calc,
const SystShifts syst,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

Reimplemented in ana::PredictionInterp.

Definition at line 142 of file IPrediction.cxx.

References ana::SystShifts::IsNominal(), and ana::IPrediction::PredictComponent().

147  {
148  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
149 
150  // Default implementation: no treatment of systematics
151  return PredictComponent(calc, flav, curr, sign);
152  }
virtual Spectrum PredictComponent(osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
def sign(x)
Definition: canMan.py:204
string syst
Definition: plotSysts.py:176
Spectrum ana::IPrediction::PredictSyst ( osc::IOscCalculator calc,
const SystShifts syst 
) const
virtualinherited
SpectrumStan ana::IPrediction::PredictSyst ( osc::IOscCalculatorStan calc,
const SystShifts syst 
) const
virtualinherited

Reimplemented in ana::PredictionInterp.

Definition at line 108 of file IPrediction.cxx.

References ana::SystShifts::IsNominal(), and ana::IPrediction::Predict().

110  {
111  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
112 
113  // Default implementation: no treatment of systematics
114  return Predict(calc);
115  }
virtual Spectrum Predict(osc::IOscCalculator *calc) const =0
string syst
Definition: plotSysts.py:176
Spectrum ana::IPrediction::PredictUnoscillated ( ) const
virtualinherited

Reimplemented in ana::PredictionSterile.

Definition at line 82 of file IPrediction.cxx.

References noosc, and ana::IPrediction::Predict().

Referenced by cc(), demo5(), demo::DrawUpDownRatioCanvas(), Efficiency(), efficiency(), efficiencySA(), fa_fd_data_mc_systs(), GetSpectra(), numu_demo_split_plot(), plot_nd_data_mc(), template_basic(), and test_ana().

83  {
84  // Default implementation
86  return Predict(&noosc);
87  }
Pass neutrinos through unchanged.
virtual Spectrum Predict(osc::IOscCalculator *calc) const =0
osc::NoOscillations noosc
Definition: NueSystFuncs.h:44
OscillatableSpectrum ana::PredictionNueRebinSA::Reduce ( const OscillatableSpectrum s) const
protected

Definition at line 157 of file PredictionNueRebinSA.cxx.

References ana::HistCache::Delete(), ana::ReweightableSpectrum::GetBinnings(), ana::ReweightableSpectrum::GetLabels(), MECModelEnuComparisons::i, calib::j, m, ana::HistCache::NewTH2D(), ana::Binning::Simple(), and ana::ReweightableSpectrum::ToTH2().

Referenced by PredictionNueRebinSA().

158  {
159  TH2D* hin = s.ToTH2(1e20);
160  assert(hin->GetNbinsX() == 30); // nue 2D binning
161 
162  // Only 12 bins are really filled
163  TH2D* hout = HistCache::NewTH2D(hin->GetTitle(),
164  Binning::Simple(12, 0, 12));
165 
166  for(const std::pair<int, int>& m: kBinMapping){
167  for(int i = 0; i < hin->GetNbinsY()+2; ++i){
168  hout->SetBinContent(m.second, i, hin->GetBinContent(m.first, i));
169  }
170  }
171 
172  // Check empty bins are really empty
173  for(int i: kEmptyBins){
174  for(int j = 0; j < hin->GetNbinsX()+2; ++j){
175  assert(hin->GetBinContent(i, j) == 0);
176  }
177  }
178 
179  HistCache::Delete(hin);
180 
181  return OscillatableSpectrum(hout, s.GetLabels(), s.GetBinnings(), 1e20, 0);
182  }
static TH2D * NewTH2D(const std::string &title, const Binning &bins)
Definition: HistCache.cxx:80
const XML_Char * s
Definition: expat.h:262
static void Delete(TH1D *&h)
Definition: HistCache.cxx:215
const double j
Definition: BetheBloch.cxx:29
const std::vector< std::pair< int, int > > kBinMapping
const std::vector< int > kEmptyBins
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:38
Spectrum ana::PredictionNueRebinSA::Reduce ( const Spectrum s) const
protected

Definition at line 185 of file PredictionNueRebinSA.cxx.

References ana::HistCache::Delete(), ana::Spectrum::GetBinnings(), ana::Spectrum::GetLabels(), MECModelEnuComparisons::i, m, ana::HistCache::New(), ana::Spectrum::POT(), ana::Binning::Simple(), and ana::Spectrum::ToTH1().

186  {
187  DontAddDirectory guard;
188 
189  TH1D* hin = s.ToTH1(s.POT());
190  assert(hin->GetNbinsX() == 30); // nue 2D binning
191 
192  // Only 12 bins are really filled
193  TH1D* hout = HistCache::New(hin->GetTitle(),
194  Binning::Simple(12, 0, 12));
195 
196  for(const std::pair<int, int>& m: kBinMapping){
197  hout->SetBinContent(m.second, hin->GetBinContent(m.first));
198  }
199 
200  // Check empty bins are really empty
201  for(int i: kEmptyBins){
202  assert(hin->GetBinContent(i) == 0);
203  }
204 
205  HistCache::Delete(hin);
206 
207  return Spectrum(std::unique_ptr<TH1D>(hout), s.GetLabels(), s.GetBinnings(), s.POT(), 0);
208  }
const XML_Char * s
Definition: expat.h:262
static void Delete(TH1D *&h)
Definition: HistCache.cxx:215
const std::vector< std::pair< int, int > > kBinMapping
static TH1D * New(const std::string &title, const Binning &bins)
Definition: HistCache.cxx:24
const std::vector< int > kEmptyBins
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:38
void ana::PredictionNueRebinSA::SaveTo ( TDirectory *  dir) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 116 of file PredictionNueRebinSA.cxx.

References fComponentCC, fComponentNCTot, genie::utils::style::Format(), MECModelEnuComparisons::i, calib::j, ana::OscillatableSpectrum::SaveTo(), ana::Spectrum::SaveTo(), and tmp.

117  {
118  TDirectory* tmp = gDirectory;
119 
120  dir->cd();
121  TObjString("PredictionNueRebinSA").Write("type");
122 
123  for(int i = 0; i < 2; ++i){
124  for(int j = 0; j < 3; ++j){
125  for(int k = 0; k < 2; ++k){
126  fComponentCC[i][j][k].SaveTo(dir->mkdir(TString::Format("cc_%d%d%d", i, j, k)));
127  }
128  }
129  }
130 
131  fComponentNCTot.SaveTo(dir->mkdir("nc"));
132 
133  tmp->cd();
134  }
Float_t tmp
Definition: plot.C:36
OscillatableSpectrum fComponentCC[2][3][2]
const double j
Definition: BetheBloch.cxx:29
TDirectory * dir
Definition: macro.C:5
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
void SaveTo(TDirectory *dir) const
void SaveTo(TDirectory *dir) const
Definition: Spectrum.cxx:1029

Member Data Documentation

OscillatableSpectrum ana::PredictionNueRebinSA::fComponentCC[2][3][2]
protected

Definition at line 58 of file PredictionNueRebinSA.h.

Referenced by PredictComponent(), PredictionNueRebinSA(), and SaveTo().

Spectrum ana::PredictionNueRebinSA::fComponentNCTot
protected

Definition at line 59 of file PredictionNueRebinSA.h.

Referenced by PredictComponent(), PredictionNueRebinSA(), and SaveTo().


The documentation for this class was generated from the following files: