IDecomp.cxx
Go to the documentation of this file.
2 
5 
6 #include <cassert>
7 
8 #include "TDirectory.h"
9 #include "TObjString.h"
10 
11 #include <iostream>
12 
13 namespace ana
14 {
15  //----------------------------------------------------------------------
17  {
18  std::cout<<"IDecomp::Data_Componet() is not implemented for this class, check your Decomp"<<std::endl;
19  abort();
20  }
21 
23  {
24  std::cout << "IDecomp: not implemented" << std::endl; abort();
25  }
27  {
28  std::cout << "IDecomp: not implemented" << std::endl; abort();
29  }
31  {
32  std::cout << "IDecomp: not implemented" << std::endl; abort();
33  }
35  {
36  std::cout << "IDecomp: not implemented" << std::endl; abort();
37  }
39  {
40  std::cout << "IDecomp: not implemented" << std::endl; abort();
41  }
43  {
44  std::cout << "IDecomp: not implemented" << std::endl; abort();
45  }
47  {
48  std::cout << "IDecomp: not implemented" << std::endl; abort();
49  }
50 
51  //----------------------------------------------------------------------
52  // Definition to satisfy the declaration in Core/LoadFromFile.h
53  template<> std::unique_ptr<IDecomp> LoadFrom<IDecomp>(TDirectory* dir, const std::string& name)
54  {
55  TObjString* ptag = (TObjString*)dir->Get((name+"/type").c_str());
56  assert(ptag);
57 
58  const TString tag = ptag->GetString();
59 
60  const auto func = LoadFromRegistry<IDecomp>::Get(tag.Data());
61  if(func) return func(dir, name);
62 
63  std::cerr << "Unknown Decomp type '" << tag << "'" << std::endl;
64  abort();
65  }
66 }
const XML_Char * name
Definition: expat.h:151
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
virtual Spectrum MC_NCAntiComponent() const
Definition: IDecomp.cxx:30
virtual Spectrum Data_Component() const
Definition: IDecomp.cxx:16
OStream cerr
Definition: OStream.cxx:7
virtual Spectrum MC_NumuComponent() const
Definition: IDecomp.cxx:34
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
static Func_t Get(const std::string &tag)
virtual Spectrum MC_AntiNumuComponent() const
Definition: IDecomp.cxx:38
double func(double x, double y)
OStream cout
Definition: OStream.cxx:6
virtual Spectrum MC_AntiNueComponent() const
Definition: IDecomp.cxx:46
TDirectory * dir
Definition: macro.C:5
virtual Spectrum MC_NueComponent() const
Definition: IDecomp.cxx:42
assert(nhit_max >=nhit_nbins)
virtual Spectrum MC_NCTotalComponent() const
Definition: IDecomp.cxx:22
std::unique_ptr< IDecomp > LoadFrom< IDecomp >(TDirectory *dir, const std::string &label)
Definition: IDecomp.cxx:53
virtual Spectrum MC_NCComponent() const
Definition: IDecomp.cxx:26
enum BeamMode string