thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
AnalysisFactory.h
1 // -*- C++ -*-
2 //
3 // AnalysisFactory.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2019 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef LWH_AnalysisFactory_H
10 #define LWH_AnalysisFactory_H
11 //
12 // This is the declaration of the AnalysisFactory class.
13 //
14 
15 #include "AIAnalysisFactory.h"
16 #include "TreeFactory.h"
17 #include "HistogramFactory.h"
18 #include "DataPointSetFactory.h"
19 #include <set>
20 
35 namespace LWH {
36 
37 using namespace AIDA;
38 
44 class AnalysisFactory: public IAnalysisFactory {
45 
46 public:
48  virtual ~AnalysisFactory() {
49  clear();
50  }
51 
56  ITreeFactory * createTreeFactory() {
57  return new TreeFactory;
58  }
59 
66  IHistogramFactory * createHistogramFactory(ITree & tree) {
67  Tree & tr = dynamic_cast<Tree &>(tree);
68  HistogramFactory * hf = new HistogramFactory(tr);
69  histfacs.insert(hf);
70  return hf;
71  }
72 
78  IDataPointSetFactory * createDataPointSetFactory(ITree & tree) {
79  Tree & tr = dynamic_cast<Tree &>(tree);
81  datafacs.insert(df);
82  return df;
83  }
84 
89  ITupleFactory * createTupleFactory(ITree &) {
90  return 0;
91  }
92 
97  IFunctionFactory * createFunctionFactory(ITree &) {
98  return 0;
99  }
100 
105  IPlotterFactory * createPlotterFactory(int = 0, char * * = 0,
106  const std::string & = "",
107  const std::string & = "") {
108  return 0;
109  }
110 
115  IFitFactory * createFitFactory() {
116  return 0;
117  }
118 
119 private:
120 
122  void clear() {
123  for ( std::set<HistogramFactory *>::iterator it = histfacs.begin();
124  it != histfacs.end(); ++it ) delete *it;
125  for ( std::set<DataPointSetFactory *>::iterator it = datafacs.begin();
126  it != datafacs.end(); ++it ) delete *it;
127  for ( std::set<TreeFactory *>::iterator it = treefacs.begin();
128  it != treefacs.end(); ++it ) delete *it;
129  histfacs.clear();
130  datafacs.clear();
131  treefacs.clear();
132  }
133 
135  std::set<HistogramFactory *> histfacs;
136 
138  std::set<DataPointSetFactory *> datafacs;
139 
141  std::set<TreeFactory *> treefacs;
142 
143 };
144 
145 }
146 
147 #endif /* LWH_AnalysisFactory_H */
IPlotterFactory * createPlotterFactory(int=0, char **=0, const std::string &="", const std::string &="")
Not implemented in LWH.
The creator of trees.
Definition: TreeFactory.h:27
IDataPointSetFactory * createDataPointSetFactory(ITree &tree)
Not implemented in LWH.
IFunctionFactory * createFunctionFactory(ITree &)
Not implemented in LWH.
void clear()
Delete all produced factories.
Basic user-level interface for creating a factory of IDataPointSet.
ITreeFactory * createTreeFactory()
Create an ITreeFactory.
std::set< HistogramFactory * > histfacs
The histogram factories.
The "master" factory from which other factories are obtained.
std::set< DataPointSetFactory * > datafacs
The dataset factories.
IFitFactory * createFitFactory()
Not implemented in LWH.
virtual ~AnalysisFactory()
Destructor.
std::set< TreeFactory * > treefacs
The tree factories.
User level interface for factory classes of Histograms (binned, unbinned, and profile).
The LWH namespace contains a Light-Weight Histogram package which implements the most rudimentary his...
IHistogramFactory * createHistogramFactory(ITree &tree)
Create an HistogramFactory.
ITupleFactory * createTupleFactory(ITree &)
Not implemented in LWH.
The Tree class is a simple implementation of the AIDA::ITree interface.
Definition: Tree.h:32