00001
00004 #ifndef __NAMEDBINNING_H
00005 #define __NAMEDBINNING_H
00006
00007 #include "jbltools/sfh/Binning.h"
00008 #include "jbltools/sfh/NamedO.h"
00009
00010
00012
00026 class NamedBinning: public Binning, public NamedO {
00027 public:
00029 NamedBinning () {}
00031
00034 NamedBinning (int nbins,
00035 float xlow,
00036 float xup,
00037 const char *name = 0
00038 )
00039 : Binning (nbins, xlow, xup),
00040 NamedO (name ? std::string(name) : std::string("Binning(")+str(nbins)+','+str(xlow)+','+str(xup)+')')
00041 {}
00043
00046 NamedBinning (int nbins,
00047 float xlow,
00048 float xup,
00049 const std::string& name
00050 )
00051 : Binning (nbins, xlow, xup),
00052 NamedO (name)
00053 {}
00055
00063 NamedBinning (int nbins,
00064 const float binedges_[],
00065 const char *name = 0
00066 )
00067 : Binning (nbins, binedges_),
00068 NamedO (name ? std::string(name) :
00069 std::string("Binning(")+str(nbins)+','+str(binedges_[0])+"..."+str(binedges_[nbins])+')')
00070 {}
00072
00080 NamedBinning (int nbins,
00081 const float binedges_[],
00082 const std::string& name
00083 )
00084 : Binning (nbins, binedges_),
00085 NamedO (name)
00086 {}
00087
00089
00097 NamedBinning (int nbins,
00098 const double binedges_[],
00099 const char *name = 0
00100 )
00101 : Binning (nbins, binedges_),
00102 NamedO (name ? std::string(name) :
00103 std::string("Binning(")+str(nbins)+','+str(binedges_[0])+"..."+str(binedges_[nbins])+')')
00104 {}
00105
00107
00115 NamedBinning (int nbins,
00116 const double binedges_[],
00117 const std::string& name
00118 )
00119 : Binning (nbins, binedges_),
00120 NamedO (name)
00121 {}
00122
00124 NamedBinning (const Binning& binning_,
00125 const char *name = 0
00126 )
00127 : Binning (binning_),
00128 NamedO (name ? std::string(name) :
00129 std::string("Binning(")
00130 +str(binning_.getNBins())+','
00131 +str(binning_.getLowerEdge())+"..."
00132 +str(binning_.getUpperEdge())+')')
00133 {}
00134
00136 NamedBinning (const Binning& binning_,
00137 const std::string& name
00138 )
00139 : Binning (binning_),
00140 NamedO (name)
00141 {}
00142
00144
00145
00146
00147
00148
00149
00150 virtual int getMaxBins() const { return getNBins(); }
00152
00156 static NamedBinning *getObject (const std::string& name
00157 ) {
00158 return NamedO::getObject<NamedBinning>(name);
00159 }
00160
00162
00166 static NamedBinning *getObject (const char * name
00167 ) {
00168 return NamedO::getObject<NamedBinning>(name);
00169 }
00170 protected:
00172 virtual ~NamedBinning() {};
00173 };
00174
00175
00176 #endif