IExtrap.cxx
Go to the documentation of this file.
2 
5 
6 #include "TDirectory.h"
7 #include "TObjString.h"
8 
9 #include <iostream>
10 
11 namespace ana
12 {
13  //----------------------------------------------------------------------
14  // Definition to satisfy declaration in Core/LoadFromFile.h
15  template<> std::unique_ptr<IExtrap> LoadFrom<IExtrap>(TDirectory* dir, const std::string& name)
16  {
17  TObjString* ptag = (TObjString*)dir->Get((name+"/type").c_str());
18  assert(ptag);
19 
20  const TString tag = ptag->GetString();
21 
22  const auto func = LoadFromRegistry<IExtrap>::Get(tag.Data());
23  if(func) return func(dir, name);
24 
25  std::cerr << "Unknown Extrap type '" << tag << "'" << std::endl;
26  abort();
27  }
28 
29  //----------------------------------------------------------------------
30  void IExtrap::SaveTo(TDirectory* dir, const std::string& name) const
31  {
32  assert(0 && "Not implemented");
33  }
34 }
const XML_Char * name
Definition: expat.h:151
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
virtual void SaveTo(TDirectory *dir, const std::string &name) const
Definition: IExtrap.cxx:30
OStream cerr
Definition: OStream.cxx:7
static Func_t Get(const std::string &tag)
std::unique_ptr< IExtrap > LoadFrom< IExtrap >(TDirectory *dir, const std::string &label)
Definition: IExtrap.cxx:15
double func(double x, double y)
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
enum BeamMode string