File indexing completed on 2023-03-17 10:46:56
0001
0002 #ifndef EGAMMAOBJECTS_GBRForest2D
0003 #define EGAMMAOBJECTS_GBRForest2D
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "CondFormats/Serialization/interface/Serializable.h"
0020
0021 #include "GBRTree2D.h"
0022
0023 #include <vector>
0024
0025 class GBRForest2D {
0026 public:
0027 GBRForest2D() {}
0028
0029 void GetResponse(const float *vector, double &x, double &y) const;
0030
0031 void SetInitialResponse(double x, double y) {
0032 fInitialResponseX = x;
0033 fInitialResponseY = y;
0034 }
0035
0036 std::vector<GBRTree2D> &Trees() { return fTrees; }
0037 const std::vector<GBRTree2D> &Trees() const { return fTrees; }
0038
0039 protected:
0040 double fInitialResponseX = 0.0;
0041 double fInitialResponseY = 0.0;
0042 std::vector<GBRTree2D> fTrees;
0043
0044 COND_SERIALIZABLE;
0045 };
0046
0047
0048 inline void GBRForest2D::GetResponse(const float *vector, double &x, double &y) const {
0049 x = fInitialResponseX;
0050 y = fInitialResponseY;
0051 double tx, ty;
0052 for (std::vector<GBRTree2D>::const_iterator it = fTrees.begin(); it != fTrees.end(); ++it) {
0053 it->GetResponse(vector, tx, ty);
0054 x += tx;
0055 y += ty;
0056 }
0057 return;
0058 }
0059
0060 #endif