All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IExperiment.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<IExperiment> LoadFrom<IExperiment>(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 IExperiment::SaveTo(TDirectory* dir) const
41  {
42  assert(0 && "Not implemented");
43  }
44 }
BEGIN_PROLOG could also be cerr
process_name opflashCryoW ana
static std::unique_ptr< MultiExperiment > LoadFrom(TDirectory *dir)
static std::unique_ptr< ReactorExperiment > LoadFrom(TDirectory *dir)
tuple dir
Definition: dropbox.py:28
virtual void SaveTo(TDirectory *dir) const
Definition: IExperiment.cxx:40
static std::unique_ptr< SolarConstraints > LoadFrom(TDirectory *dir)
static std::unique_ptr< CountingExperiment > LoadFrom(TDirectory *dir)
std::unique_ptr< IExperiment > LoadFrom< IExperiment >(TDirectory *dir)
Definition: IExperiment.cxx:22
static std::unique_ptr< SingleSampleExperiment > LoadFrom(TDirectory *dir)