IChiSqExperiment.cxx
Go to the documentation of this file.
2 
4 
5 #include "TFile.h"
6 #include "TObjString.h"
7 
8 #include <cassert>
9 #include <iostream>
10 
11 // To implement LoadFrom()
17 
18 namespace ana
19 {
20  //----------------------------------------------------------------------
21  // Definition to satisfy declaration in Core/LoadFromFile.h
22  template<> std::unique_ptr<IChiSqExperiment> LoadFrom<IChiSqExperiment>(TDirectory* dir)
23  {
24  TObjString* ptag = (TObjString*)dir->Get("type");
25  assert(ptag);
26 
27  const TString tag = ptag->GetString();
28 
29  if(tag == "CountingExperiment") return CountingExperiment::LoadFrom(dir);
30  if(tag == "ReactorExperiment") return ReactorExperiment::LoadFrom(dir);
31  if(tag == "SingleSampleExperiment") return SingleSampleExperiment::LoadFrom(dir);
32  if(tag == "SolarConstraints") return SolarConstraints::LoadFrom(dir);
33  if(tag == "MultiExperiment") return MultiExperiment::LoadFrom(dir);
34 
35  std::cerr << "Unknown Experiment type '" << tag << "'" << std::endl;
36  abort();
37  }
38 
39  //----------------------------------------------------------------------
40  void IChiSqExperiment::SaveTo(TDirectory* dir) const
41  {
42  assert(0 && "Not implemented");
43  }
44 }
Oscillation analysis framework, runs over CAF files outside of ART.
std::unique_ptr< IChiSqExperiment > LoadFrom< IChiSqExperiment >(TDirectory *dir)
OStream cerr
Definition: OStream.cxx:7
static std::unique_ptr< MultiExperiment > LoadFrom(TDirectory *dir)
static std::unique_ptr< ReactorExperiment > LoadFrom(TDirectory *dir)
TDirectory * dir
Definition: macro.C:5
static std::unique_ptr< SolarConstraints > LoadFrom(TDirectory *dir)
virtual void SaveTo(TDirectory *dir) const
static std::unique_ptr< CountingExperiment > LoadFrom(TDirectory *dir)
static std::unique_ptr< SingleSampleExperiment > LoadFrom(TDirectory *dir)