00001
00002
00003
00004
00005
00006
00007 #ifndef AIDAHISTOFACTORY_H
00008 #define AIDAHISTOFACTORY_H
00009
00010 #include <string>
00011 #include <vector>
00012 #include "Interfaces/IHistoFactory.h"
00013 #include "AIDAHistogramFactory.h"
00014
00015
00016 namespace Anaphe {
00017
00018 class CHBookFile;
00019 class CHBookFileManager;
00020
00021 class IAnnotationFactory;
00022 class IHistoManager;
00023 class IHistogram1D;
00024 class IHistogram2D;
00025 class IHistogram3D;
00026 class IProfileHistogram;
00027
00028 class HistoParameters1D;
00029 class HistoParameters2D;
00030
00031
00032
00033 namespace AIDA_HBook {
00034
00035 class AIDAHistogram1D;
00036 class AIDAHistogram2D;
00037 class AIDAProfileHist;
00038 class AIDAHist1DVar;
00039
00040 class AIDAHistoFactory : virtual public IHistoFactory, public AIDAHistogramFactory
00041 {
00042 public:
00043 AIDAHistoFactory(void);
00044 virtual ~AIDAHistoFactory(void);
00045
00046 public:
00047
00048 IHistogram1D* create1D(std::string title = "",
00049 int nBinsx = 10, double xmin = 0.0, double xmax = 10.0,
00050 const int ID = 0);
00051 IHistogram2D* create2D(std::string title = "",
00052 int nBinsx = 10, double xmin = 0.0, double xmax = 10.0,
00053 int nBinsy = 10, double ymin = 0.0, double ymax = 10.0,
00054 const int ID = 0);
00055
00056 public:
00057 IHistogram1D* create1D(const HistoParameters1D & hp);
00058 IHistogram2D* create2D(const HistoParameters2D & hp);
00059
00060 public:
00061
00062 IHistogram1D* create1D(const char* label, const char* title,
00063 int nBinsx = 10, double xmin = 0.0, double xmax = 10.0,
00064 const char* options = 0);
00065 IHistogram2D* create2D(const char* label, const char* title,
00066 int nBinsx = 10, double xmin = 0.0, double xmax = 10.0,
00067 int nBinsy = 10, double ymin = 0.0, double ymax = 10.0,
00068 const char* options = 0);
00069 IHistogram3D* create3D(const char* label, const char* title,
00070 int nBinsx = 10, double xmin = 0.0, double xmax = 10.0,
00071 int nBinsy = 10, double ymin = 0.0, double ymax = 10.0,
00072 int nBinsz = 10, double zmin = 0.0, double zmax = 10.0,
00073 const char* options = 0);
00074
00075 IProfileHistogram*
00076 createProfile(const char* label, const char* title,
00077 int nBinsx = 10, double xmin = 0.0, double xmax = 10.0,
00078 const char* options = 0);
00079
00080 IProfileHistogram*
00081 createProfile(const char* label, const char* title,
00082 int nBinsx = 10, double xmin = 0.0, double xmax = 10.0,
00083 double ymin = 0.0, double ymax = 10.0,
00084 const char* options = 0);
00085 IHistogram1D* dynamic1D(const char* label, const char* title="",
00086 const int nBinsx = 100);
00087 IHistogram1D* create1DVar(const char* label, const char *title,
00088 std::vector<float> binEdge,
00089 const char* options = 0);
00090 IHistogram2D* create2DVar(const char* label, const char* title,
00091 std::vector<float> binEdgeX,
00092 std::vector<float> binEdgeY,
00093 const char* options = 0);
00094 IHistogram1D* load1D(const char* label);
00095 IHistogram2D* load2D(const char* label);
00096 IHistogram3D* load3D(const char* label);
00097 IProfileHistogram* loadProf(const char* label);
00098 void scratchHisto(const char* label);
00099 bool store1D(IHistogram1D*);
00100 bool store2D(IHistogram2D*);
00101 bool store3D(IHistogram3D*);
00102 bool storeProf(IProfileHistogram*);
00103 void selectStore(const char*, const char* topDir = 0);
00104 void mkdir(const char*);
00105 void rmdir(const char*);
00106 void cd(const char*);
00107 void ls(void) const;
00108 void pwd(void) const;
00109 void setManager(IHistoManager*);
00110 void unregister(IHistogram* h);
00111 void destroy(IHistogram* h);
00112
00113 private:
00114 void notDoneMessage(const char*) const;
00115 void notInHBOOKMessage(const char*) const;
00116 void notOpenMessage(void) const;
00117 void badFileMessage(const char* filename) const;
00118 bool getIntFromLabel(const char* label, int& result) const;
00119
00120 private:
00121 IHistoManager* manager;
00122 IAnnotationFactory* annFactory;
00123 CHBookFileManager* fileManager;
00124 CHBookFile* file;
00125
00126 };
00127 }
00128 }
00129
00130 #endif
00131
00132
00133
00134