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

Compare a data spectrum to MC using a covariance matrix in the chi^2. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-01-22/CAFAna/Experiment/CovMxExperiment.h"

Inheritance diagram for ana::CovMxExperiment:
ana::SingleSampleExperiment ana::IChiSqExperiment

Classes

struct  Component
 Helper class used to specify components that are separately treated with their own covariance matrices. More...
 

Public Member Functions

 CovMxExperiment (const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, const std::map< Component, TMatrixD * > &covmx, double cosmicScaleError=0)
 
 CovMxExperiment (const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, TMatrixD *const covmx, double cosmicScaleError=0)
 Simplified version for use with a single covariance matrix. More...
 
 CovMxExperiment (const IPrediction *pred, const Spectrum &data, const TH1D *cosmic, const std::map< Component, TMatrixD * > &covmx, double cosmicScaleError=0)
 Fallback to manual cosmic scaling, like the comparable constructor in SingleSampleExperiment (see first constructor for explanation of parameters) More...
 
 CovMxExperiment (const IPrediction *pred, const Spectrum &data, const TH1D *cosmic, TMatrixD *const covmx, double cosmicScaleError=0)
 Single-matrix variant of manual cosmic scaling constructor. More...
 
 CovMxExperiment (const IPrediction *pred, const Spectrum &data, const std::map< Component, TMatrixD * > &covmx)
 No-cosmics version (see first constructor for explanation of parameters) More...
 
 CovMxExperiment (const IPrediction *pred, const Spectrum &data, TMatrixD *const covmx)
 Single-matrix variant of no-cosmics constructor. More...
 
virtual double ChiSq (osc::IOscCalculatorAdjustable *osc, const SystShifts &syst=SystShifts::Nominal()) const override
 
 CovMxExperiment (const SingleSampleExperiment &)=delete
 
CovMxExperimentoperator= (const SingleSampleExperiment &)=delete
 
virtual void Derivative (osc::IOscCalculator *calc, const SystShifts &shift, std::unordered_map< const ISyst *, double > &dch) const override
 
virtual void SaveTo (TDirectory *dir) const override
 

Static Public Member Functions

static std::unique_ptr< SingleSampleExperimentLoadFrom (TDirectory *dir)
 

Protected Member Functions

void MakeInvCovMxs (const std::map< Component, TMatrixD * > &covmx)
 
TH1D * PredHistIncCosmics (osc::IOscCalculator *calc, const SystShifts &syst) const
 

Protected Attributes

std::map< Component, std::unique_ptr< TMatrixD > > fCovMxInv
 
const IPredictionfMC
 
Spectrum fData
 
TH1D * fCosmic
 
double fCosmicScaleError
 

Detailed Description

Compare a data spectrum to MC using a covariance matrix in the chi^2.

Definition at line 22 of file CovMxExperiment.h.

Constructor & Destructor Documentation

ana::CovMxExperiment::CovMxExperiment ( const IPrediction pred,
const Spectrum data,
const Spectrum cosmic,
const std::map< Component, TMatrixD * > &  covmx,
double  cosmicScaleError = 0 
)
inline
Parameters
predSource of oscillated MC beam predictions
dataData spectrum to compare to
cosmicCosmic ray background component
covmxBin-to-bin covariance matrix for each component you want to separately treat. See below for alternate constructor if you have just a single covariance matrix (or pass a map with the single key Component(Flavors::kAll,Current::kBoth,Sign::kBoth)).
cosmicScaleErrorfractional uncertainty on cosmic normalization

Definition at line 49 of file CovMxExperiment.h.

References MakeInvCovMxs().

Referenced by CovMxExperiment().

54  : SingleSampleExperiment(pred, data, cosmic, cosmicScaleError)
55  {
56  this->MakeInvCovMxs(covmx);
57  };
SingleSampleExperiment(const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, double cosmicScaleError=0)
const XML_Char const XML_Char * data
Definition: expat.h:268
Sum up livetimes from individual cosmic triggers.
void MakeInvCovMxs(const std::map< Component, TMatrixD * > &covmx)
ana::CovMxExperiment::CovMxExperiment ( const IPrediction pred,
const Spectrum data,
const Spectrum cosmic,
TMatrixD *const  covmx,
double  cosmicScaleError = 0 
)
inline

Simplified version for use with a single covariance matrix.

Definition at line 60 of file CovMxExperiment.h.

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

65  : SingleSampleExperiment(pred, data, cosmic, cosmicScaleError)
66  {
68  };
SingleSampleExperiment(const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, double cosmicScaleError=0)
const XML_Char const XML_Char * data
Definition: expat.h:268
Interactions of both types.
Definition: IPrediction.h:42
Sum up livetimes from individual cosmic triggers.
void MakeInvCovMxs(const std::map< Component, TMatrixD * > &covmx)
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
ana::CovMxExperiment::CovMxExperiment ( const IPrediction pred,
const Spectrum data,
const TH1D *  cosmic,
const std::map< Component, TMatrixD * > &  covmx,
double  cosmicScaleError = 0 
)
inline

Fallback to manual cosmic scaling, like the comparable constructor in SingleSampleExperiment (see first constructor for explanation of parameters)

Definition at line 72 of file CovMxExperiment.h.

References MakeInvCovMxs().

77  : SingleSampleExperiment(pred, data, cosmic, cosmicScaleError)
78  {
79  this->MakeInvCovMxs(covmx);
80  };
SingleSampleExperiment(const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, double cosmicScaleError=0)
const XML_Char const XML_Char * data
Definition: expat.h:268
Sum up livetimes from individual cosmic triggers.
void MakeInvCovMxs(const std::map< Component, TMatrixD * > &covmx)
ana::CovMxExperiment::CovMxExperiment ( const IPrediction pred,
const Spectrum data,
const TH1D *  cosmic,
TMatrixD *const  covmx,
double  cosmicScaleError = 0 
)
inline

Single-matrix variant of manual cosmic scaling constructor.

Definition at line 83 of file CovMxExperiment.h.

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

88  : SingleSampleExperiment(pred, data, cosmic, cosmicScaleError)
89  {
91  };
SingleSampleExperiment(const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, double cosmicScaleError=0)
const XML_Char const XML_Char * data
Definition: expat.h:268
Interactions of both types.
Definition: IPrediction.h:42
Sum up livetimes from individual cosmic triggers.
void MakeInvCovMxs(const std::map< Component, TMatrixD * > &covmx)
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
ana::CovMxExperiment::CovMxExperiment ( const IPrediction pred,
const Spectrum data,
const std::map< Component, TMatrixD * > &  covmx 
)
inline

No-cosmics version (see first constructor for explanation of parameters)

Definition at line 94 of file CovMxExperiment.h.

References MakeInvCovMxs().

98  {
99  this->MakeInvCovMxs(covmx);
100  };
SingleSampleExperiment(const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, double cosmicScaleError=0)
const XML_Char const XML_Char * data
Definition: expat.h:268
void MakeInvCovMxs(const std::map< Component, TMatrixD * > &covmx)
ana::CovMxExperiment::CovMxExperiment ( const IPrediction pred,
const Spectrum data,
TMatrixD *const  covmx 
)
inline

Single-matrix variant of no-cosmics constructor.

Definition at line 103 of file CovMxExperiment.h.

References ChiSq(), CovMxExperiment(), ana::Flavors::kAll, ana::Current::kBoth, ana::Sign::kBoth, MakeInvCovMxs(), ana::SystShifts::Nominal(), operator=(), and plotSysts::syst.

107  {
109  };
SingleSampleExperiment(const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, double cosmicScaleError=0)
const XML_Char const XML_Char * data
Definition: expat.h:268
Interactions of both types.
Definition: IPrediction.h:42
void MakeInvCovMxs(const std::map< Component, TMatrixD * > &covmx)
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
ana::CovMxExperiment::CovMxExperiment ( const SingleSampleExperiment )
delete

Member Function Documentation

double ana::CovMxExperiment::ChiSq ( osc::IOscCalculatorAdjustable osc,
const SystShifts syst = SystShifts::Nominal() 
) const
overridevirtual

Reimplemented from ana::SingleSampleExperiment.

Definition at line 23 of file CovMxExperiment.cxx.

References bin, chi2(), ana::Chi2CovMx(), ana::HistCache::Delete(), release_diff::diff, e, ana::SingleSampleExperiment::fCosmic, ana::SingleSampleExperiment::fCosmicScaleError, fCovMxInv, ana::SingleSampleExperiment::fData, ana::SingleSampleExperiment::fMC, ana::SystShifts::GetShift(), ana::SystShifts::IsNominal(), ana::Flavors::kAll, ana::Current::kBoth, ana::Sign::kBoth, ana::kCosmicBkgScaleSyst, pot, ana::Spectrum::POT(), ana::IPrediction::Predict(), ana::IPrediction::PredictComponent(), scale, and ana::Spectrum::ToTH1().

Referenced by CovMxExperiment().

24  {
25  // the covariance matrix replaces the systematic shift approach.
26  if (!syst.IsNominal())
27  throw std::runtime_error("ExperimentWithCovMx::ChiSq(): Systematic shifts cannot be specified when fitting against covariance matrices");
28 
29  const double pot = fData.POT();
30  TH1D* hdata = fData.ToTH1(pot);
31 
32  std::map<Component, TH1D*> predictions;
33  for (const auto & mxPair : this->fCovMxInv)
34  {
35  const auto & comp = mxPair.first;
36  if (comp.flavor == Flavors::kAll && comp.current == Current::kBoth && comp.sign == Sign::kBoth)
37  {
38  // if you specified one matrix as applying to the whole prediction,
39  // why did you give me more of them??
40  if (this->fCovMxInv.size() > 1)
41  throw std::runtime_error("CovMxExperiment::ChiSq(): one component corresponds to the whole prediction but you also provided others?!");
42 
43  predictions.emplace(comp, fMC->Predict(calc).ToTH1(pot));
44  }
45  else
46  predictions.emplace(mxPair.first, fMC->PredictComponent(calc, comp.flavor, comp.current, comp.sign).ToTH1(pot));
47  }
48 
49  // will want the total prediction in a moment,
50  // but since we assume the components add to the total
51  // in the following calculations, might as well ensure it here.
52  TH1D * totalPred = fMC->Predict(calc).ToTH1(pot);
53  TH1D diff(*totalPred);
54  for (const auto & predPair : predictions)
55  diff.Add(predPair.second, -1);
56  for (int bin = 0; bin <= totalPred->GetNbinsX() + 1; bin++)
57  {
58  if ( std::fabs(diff.GetBinContent(bin)) > 1e-4 )
59  throw std::runtime_error("CovMxExperiment::ChiSq(): components don't sum to total prediction!");
60  }
61 
62  // add the cosmics into the prediction.
63  if(fCosmic)
64  {
65  if(fCosmicScaleError != 0)
66  {
67  const double scale = 1 + syst.GetShift(&kCosmicBkgScaleSyst) * fCosmicScaleError;
68  totalPred->Add(fCosmic, scale);
69  }
70  else
71  totalPred->Add(fCosmic);
72 
73  }
74 
75  // first, compute the statistical uncertainty covariance matrix
76  // (which is diagonal). we'll need this repeatedly below.
77  // use the *total* prediction to get the sigma^2 here because
78  // that's the expected fluctuation size
79  TMatrixD stat_mx(totalPred->GetNbinsX(), totalPred->GetNbinsX());
80  for (int binNum = 1; binNum <= totalPred->GetNbinsX(); binNum++)
81  stat_mx[binNum-1][binNum-1] = totalPred->GetBinContent(binNum);
82 
83 
84  // We need to include the statistical covariance matrix
85  // to do the chi^2 calculation or it'll be way off.
86  // we need to recalculate the sum for *every* new configuration of
87  // the IPrediction, unfortunately--
88  // and since we have to then invert it, this could be very costly.
89  // StackExchange to the rescue: somebody there wanted to solve a similar problem
90  // (where we already have the inverse of a matrix A
91  // and want to compute (A+B)^{-1] with some other invertible B):
92  // http://math.stackexchange.com/a/17780
93  // method has apparently been discovered in various forms by multiple people,
94  // but this version is due to K. Miller, Math.Mag. 54, 67 (1981)
95  //
96 
97 
98  // Strictly speaking, it's not possible to divide the prediction up
99  // into pieces and then use the covariance matrices for those pieces
100  // to compute a chi^2 because it's not possible to know which was which
101  // in the data. However, we'll cheat a little and do the following:
102  // for each component, we'll subtract the rest of the prediction
103  // and compare background-subtracted data to that component.
104  // Because we have to include the statistical covariance matrix every time,
105  // this over-counts the statistical uncertainty by a factor of
106  // roughly (N-1), where N is the number of components.
107  // Probably this isn't exactly the right statistical thing to do,
108  // but for a first approximation, we'll take an average of the chi^2s
109  // weighted by how many events they contribute to the prediction.
110 
111  double chi2 = 0;
112  for (auto it_comp = this->fCovMxInv.begin(); it_comp != this->fCovMxInv.end(); ++it_comp)
113  {
114  const auto & comp = it_comp->first;
115  const auto & compCovMxInv = it_comp->second;
116  const auto & predComp = *(predictions.at(comp));
117  TH1D hdata_compSub = *hdata - ( *totalPred - predComp );
118 
119 
120  // now recursively update the matrix
121  // by calculating the inverse of (A+B_k),
122  // where B_k is one of the N rank-1 matrices
123  // (when N is the rank of B) that B can be decomposed into.
124  // our case is even easier because we know B is diagonal
125  // (it's the statistical uncertainty covariance matrix).
126  TMatrixD Bk(stat_mx.GetNrows(), stat_mx.GetNcols());
127  TMatrixD CkInv(*compCovMxInv); // here we're setting what Miller calls C_1 = A
128 
129  // the rank of the stat mx is just the number of rows:
130  // it's diagonal and the bins are orthogonal.
131  // note that we're counting from zero instead of 1
132  // for convenience in the TMatrixDs
133  for (int k = 0; k < stat_mx.GetNrows(); k++)
134  {
135  // reset the last iteration so we can re-use
136  if (k > 0)
137  Bk[k-1][k-1] = 0;
138 
139  // set current iteration B_k
140  Bk[k][k] = stat_mx[k][k];
141 
142  // can short-circuit the trace in Miller's algorithm
143  // since our Bk come from a diagonal matrix:
144  // they're single entries on the diagonal
145  double gk = 1. / (1 + CkInv[k][k]*Bk[k][k]);
146 
147  CkInv -= gk * CkInv * Bk * CkInv;
148  }
149 
150  // event-weighted chi^2
151  chi2 += predComp.Integral() * Chi2CovMx(predictions.at(comp), &hdata_compSub, &CkInv);
152 
153  }
154 
155  // divide out the total number of events to the get the weighted chi^2
156  chi2 /= totalPred->Integral();
157 
158 
159  // finally, clean up all the temp hists we got from Spectrum::ToTH1()
160  HistCache::Delete(hdata);
161  HistCache::Delete(totalPred);
162  for (auto & predPair : predictions)
163  HistCache::Delete(predPair.second);
164 
165 
166  return chi2;
167  }
osc::OscCalculatorDumb calc
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:553
virtual Spectrum PredictComponent(osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
const CosmicBkgScaleSyst kCosmicBkgScaleSyst
double chi2()
virtual Spectrum Predict(osc::IOscCalculator *calc) const =0
Double_t scale
Definition: plot.C:25
Interactions of both types.
Definition: IPrediction.h:42
static void Delete(TH1D *&h)
Definition: HistCache.cxx:215
#define pot
float bin[41]
Definition: plottest35.C:14
double POT() const
Definition: Spectrum.h:263
predictions
std::map< Component, std::unique_ptr< TMatrixD > > fCovMxInv
string syst
Definition: plotSysts.py:176
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
Float_t e
Definition: plot.C:35
double Chi2CovMx(const TVectorD *e, const TVectorD *o, const TMatrixD *covmxinv)
Definition: Utilities.cxx:176
void ana::SingleSampleExperiment::Derivative ( osc::IOscCalculator calc,
const SystShifts shift,
std::unordered_map< const ISyst *, double > &  dch 
) const
overridevirtualinherited

Reimplemented from ana::IChiSqExperiment.

Definition at line 108 of file SingleSampleExperiment.cxx.

References ana::HistCache::Delete(), ana::IPrediction::Derivative(), ana::SingleSampleExperiment::fCosmic, ana::SingleSampleExperiment::fCosmicScaleError, ana::SingleSampleExperiment::fData, ana::SingleSampleExperiment::fMC, chisquared::hpred, MECModelEnuComparisons::i, it, ana::LogLikelihoodDerivative(), pot, ana::Spectrum::POT(), ana::SingleSampleExperiment::PredHistIncCosmics(), and ana::Spectrum::ToTH1().

Referenced by ana::SingleSampleExperiment::ChiSq().

111  {
112  const double pot = fData.POT();
113 
114  std::unordered_map<const ISyst*, std::vector<double>> dp;
115  for(auto it: dchi) dp[it.first] = {};
116  fMC->Derivative(calc, shift, pot, dp);
117 
118  if(dp.empty()){ // prediction doesn't implement derivatives
119  dchi.clear(); // pass on that info to our caller
120  return;
121  }
122 
123  TH1D* hpred = PredHistIncCosmics(calc, shift);
124  TH1D* hdata = fData.ToTH1(pot);
125 
126  for(auto& it: dchi){
127  if(it.first != &kCosmicBkgScaleSyst){
128  it.second += LogLikelihoodDerivative(hpred, hdata, dp[it.first]);
129  }
130  else{
131  const unsigned int N = fCosmic->GetNbinsX()+2;
132  const double* ca = fCosmic->GetArray();
133  std::vector<double> cosErr(N);
134  for(unsigned int i = 0; i < N; ++i) cosErr[i] = ca[i]*fCosmicScaleError;
135  it.second += LogLikelihoodDerivative(hpred, hdata, cosErr);
136  }
137  }
138 
139  HistCache::Delete(hpred);
140  HistCache::Delete(hdata);
141  }
set< int >::iterator it
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:553
virtual void Derivative(osc::IOscCalculator *calc, const SystShifts &shift, double pot, std::unordered_map< const ISyst *, std::vector< double >> &dchi) const
Definition: IPrediction.h:92
const CosmicBkgScaleSyst kCosmicBkgScaleSyst
double LogLikelihoodDerivative(double e, double o, double dedx)
Definition: Utilities.cxx:154
static void Delete(TH1D *&h)
Definition: HistCache.cxx:215
#define pot
double POT() const
Definition: Spectrum.h:263
TH1D * PredHistIncCosmics(osc::IOscCalculator *calc, const SystShifts &syst) const
std::unique_ptr< SingleSampleExperiment > ana::SingleSampleExperiment::LoadFrom ( TDirectory *  dir)
staticinherited

Definition at line 160 of file SingleSampleExperiment.cxx.

References ana::Spectrum::LoadFrom(), ana::LoadFrom< IPrediction >(), mc, runNovaSAM::release, and runNovaSAM::ret.

Referenced by getHists_FNEX(), and ana::LoadFrom< IChiSqExperiment >().

161  {
162  TObjString* ptag = (TObjString*)dir->Get("type");
163  assert(ptag);
164  assert(ptag->GetString() == "SingleSampleExperiment");
165 
166  assert(dir->GetDirectory("mc"));
167  assert(dir->GetDirectory("data"));
168 
169 
170  const IPrediction* mc = ana::LoadFrom<IPrediction>(dir->GetDirectory("mc")).release();
171  const std::unique_ptr<Spectrum> data = Spectrum::LoadFrom(dir->GetDirectory("data"));
172 
173  TH1D* cosmic = 0;
174  if(dir->Get("cosmic")) cosmic = (TH1D*)dir->Get("cosmic");
175 
176  auto ret = std::make_unique<SingleSampleExperiment>(mc, *data);
177  if(cosmic) ret->fCosmic = cosmic;
178  return ret;
179  }
const XML_Char const XML_Char * data
Definition: expat.h:268
Sum up livetimes from individual cosmic triggers.
std::unique_ptr< IPrediction > LoadFrom< IPrediction >(TDirectory *dir)
Definition: IPrediction.cxx:38
TDirectory * dir
Definition: macro.C:5
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir)
Definition: Spectrum.cxx:1055
void ana::CovMxExperiment::MakeInvCovMxs ( const std::map< Component, TMatrixD * > &  covmx)
inlineprotected

Definition at line 119 of file CovMxExperiment.h.

References fCovMxInv, and ana::SymmMxInverse().

Referenced by CovMxExperiment().

120  {
121  for (const auto & mxPair : covmx)
122  this->fCovMxInv.emplace( mxPair.first, SymmMxInverse(*(mxPair.second)) );
123 
124  }
std::unique_ptr< TMatrixD > SymmMxInverse(const TMatrixD &mx)
Definition: Utilities.cxx:219
std::map< Component, std::unique_ptr< TMatrixD > > fCovMxInv
CovMxExperiment& ana::CovMxExperiment::operator= ( const SingleSampleExperiment )
delete

Referenced by CovMxExperiment().

TH1D * ana::SingleSampleExperiment::PredHistIncCosmics ( osc::IOscCalculator calc,
const SystShifts syst 
) const
protectedinherited

Definition at line 68 of file SingleSampleExperiment.cxx.

References ana::SingleSampleExperiment::fCosmic, ana::SingleSampleExperiment::fCosmicScaleError, ana::SingleSampleExperiment::fData, ana::SingleSampleExperiment::fMC, ana::SystShifts::GetShift(), chisquared::hpred, ana::Spectrum::POT(), plot_validation_datamc::pred, ana::IPrediction::PredictSyst(), scale, ana::SystShifts::SetShift(), plotSysts::syst, and ana::Spectrum::ToTH1().

Referenced by ana::SingleSampleExperiment::ChiSq(), ana::SingleSampleExperiment::Derivative(), and ana::SingleSampleExperiment::~SingleSampleExperiment().

70  {
71  SystShifts systNoCosmic = syst;
72  systNoCosmic.SetShift(&kCosmicBkgScaleSyst, 0);
73 
74  const Spectrum pred = fMC->PredictSyst(calc, systNoCosmic);
75 
76  TH1D* hpred = pred.ToTH1(fData.POT());
77 
78  if(fCosmic){
79  if(fCosmicScaleError != 0){
80  const double scale = 1 + syst.GetShift(&kCosmicBkgScaleSyst) * fCosmicScaleError;
81  hpred->Add(fCosmic, scale);
82  }
83  else{
84  hpred->Add(fCosmic);
85  }
86  }
87 
88  return hpred;
89  }
const CosmicBkgScaleSyst kCosmicBkgScaleSyst
virtual Spectrum PredictSyst(osc::IOscCalculator *calc, const SystShifts &syst) const
Definition: IPrediction.cxx:98
Double_t scale
Definition: plot.C:25
double POT() const
Definition: Spectrum.h:263
string syst
Definition: plotSysts.py:176
void ana::SingleSampleExperiment::SaveTo ( TDirectory *  dir) const
overridevirtualinherited

Reimplemented from ana::IChiSqExperiment.

Definition at line 144 of file SingleSampleExperiment.cxx.

References dir, ana::SingleSampleExperiment::fCosmic, ana::SingleSampleExperiment::fData, ana::SingleSampleExperiment::fMC, ana::IPrediction::SaveTo(), ana::Spectrum::SaveTo(), and tmp.

Referenced by joint_fit_make_experiments().

145  {
146  TDirectory* tmp = dir;
147 
148  dir->cd();
149  TObjString("SingleSampleExperiment").Write("type");
150 
151  fMC->SaveTo(dir->mkdir("mc"));
152  fData.SaveTo(dir->mkdir("data"));
153 
154  if(fCosmic) fCosmic->Write("cosmic");
155 
156  tmp->cd();
157  }
virtual void SaveTo(TDirectory *dir) const
Float_t tmp
Definition: plot.C:36
TDirectory * dir
Definition: macro.C:5
void SaveTo(TDirectory *dir) const
Definition: Spectrum.cxx:1029

Member Data Documentation

TH1D* ana::SingleSampleExperiment::fCosmic
protectedinherited
double ana::SingleSampleExperiment::fCosmicScaleError
protectedinherited
std::map<Component, std::unique_ptr<TMatrixD> > ana::CovMxExperiment::fCovMxInv
protected

Definition at line 126 of file CovMxExperiment.h.

Referenced by ChiSq(), and MakeInvCovMxs().

Spectrum ana::SingleSampleExperiment::fData
protectedinherited
const IPrediction* ana::SingleSampleExperiment::fMC
protectedinherited

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