CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/JetMETCorrections/InterpolationTables/interface/ArrayRange.h

Go to the documentation of this file.
00001 #ifndef NPSTAT_ARRAYRANGE_HH_
00002 #define NPSTAT_ARRAYRANGE_HH_
00003 
00014 #include "JetMETCorrections/InterpolationTables/interface/ArrayShape.h"
00015 #include "JetMETCorrections/InterpolationTables/interface/BoxND.h"
00016 
00017 namespace npstat {
00021     struct ArrayRange : public BoxND<unsigned>
00022     {
00023         inline ArrayRange() {}
00024 
00026         inline ArrayRange(unsigned dim) : BoxND<unsigned>(dim) {}
00027 
00029         inline ArrayRange(unsigned dim, const Interval<unsigned>& r1)
00030             : BoxND<unsigned>(dim, r1) {}
00031 
00033 
00038         inline ArrayRange(const ArrayShape& shape) : BoxND<unsigned>(shape) {}
00039         ArrayRange(const unsigned* shape, unsigned shapeLen);
00041 
00046         ArrayShape shape() const;
00047 
00049 
00050         bool isCompatible(const ArrayShape& shape) const;
00051         bool isCompatible(const unsigned* shape, unsigned shapeLen) const;
00053 
00055         unsigned long rangeSize() const;
00056 
00058         bool operator<(const ArrayRange&) const;
00059 
00065         ArrayRange& stripOuterLayer();
00066 
00071         void lowerLimits(unsigned* limits, unsigned limitsLen) const;
00072 
00074         void upperLimits(unsigned* limits, unsigned limitsLen) const;
00075 
00077         void rangeLength(unsigned* range, unsigned rangeLen) const;
00078     };
00079 }
00080 
00081 #endif // NPSTAT_ARRAYRANGE_HH_
00082