File indexing completed on 2026-08-06 09:38:18
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LWH_AnalysisFactory_H
0010 #define LWH_AnalysisFactory_H
0011
0012
0013
0014
0015 #include "AIAnalysisFactory.h"
0016 #include "TreeFactory.h"
0017 #include "HistogramFactory.h"
0018 #include "DataPointSetFactory.h"
0019 #include <set>
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 namespace LWH {
0036
0037 using namespace AIDA;
0038
0039
0040
0041
0042
0043
0044 class AnalysisFactory: public IAnalysisFactory {
0045
0046 public:
0047
0048 virtual ~AnalysisFactory() {
0049 clear();
0050 }
0051
0052
0053
0054
0055
0056 ITreeFactory * createTreeFactory() {
0057 return new TreeFactory;
0058 }
0059
0060
0061
0062
0063
0064
0065
0066 IHistogramFactory * createHistogramFactory(ITree & tree) {
0067 Tree & tr = dynamic_cast<Tree &>(tree);
0068 HistogramFactory * hf = new HistogramFactory(tr);
0069 histfacs.insert(hf);
0070 return hf;
0071 }
0072
0073
0074
0075
0076
0077
0078 IDataPointSetFactory * createDataPointSetFactory(ITree & tree) {
0079 Tree & tr = dynamic_cast<Tree &>(tree);
0080 DataPointSetFactory * df = new DataPointSetFactory(tr);
0081 datafacs.insert(df);
0082 return df;
0083 }
0084
0085
0086
0087
0088
0089 ITupleFactory * createTupleFactory(ITree &) {
0090 return 0;
0091 }
0092
0093
0094
0095
0096
0097 IFunctionFactory * createFunctionFactory(ITree &) {
0098 return 0;
0099 }
0100
0101
0102
0103
0104
0105 IPlotterFactory * createPlotterFactory(int = 0, char * * = 0,
0106 const std::string & = "",
0107 const std::string & = "") {
0108 return 0;
0109 }
0110
0111
0112
0113
0114
0115 IFitFactory * createFitFactory() {
0116 return 0;
0117 }
0118
0119 private:
0120
0121
0122 void clear() {
0123 for ( std::set<HistogramFactory *>::iterator it = histfacs.begin();
0124 it != histfacs.end(); ++it ) delete *it;
0125 for ( std::set<DataPointSetFactory *>::iterator it = datafacs.begin();
0126 it != datafacs.end(); ++it ) delete *it;
0127 for ( std::set<TreeFactory *>::iterator it = treefacs.begin();
0128 it != treefacs.end(); ++it ) delete *it;
0129 histfacs.clear();
0130 datafacs.clear();
0131 treefacs.clear();
0132 }
0133
0134
0135 std::set<HistogramFactory *> histfacs;
0136
0137
0138 std::set<DataPointSetFactory *> datafacs;
0139
0140
0141 std::set<TreeFactory *> treefacs;
0142
0143 };
0144
0145 }
0146
0147 #endif