| CholeskyDecomp.h | | CholeskyDecomp.h | |
| | | | |
| skipping to change at line 19 | | skipping to change at line 19 | |
| * routines for use with ROOT's SMatrix classes (symmetric positive | | * routines for use with ROOT's SMatrix classes (symmetric positive | |
| * definite case) | | * definite case) | |
| * | | * | |
| * @author Manuel Schiller | | * @author Manuel Schiller | |
| * @date Aug 29 2008 | | * @date Aug 29 2008 | |
| * initial release inside LHCb | | * initial release inside LHCb | |
| * @date May 7 2009 | | * @date May 7 2009 | |
| * factored code to provide a nice Cholesky decomposition class, along | | * factored code to provide a nice Cholesky decomposition class, along | |
| * with separate methods for solving a single linear system and to | | * with separate methods for solving a single linear system and to | |
| * obtain the inverse matrix from the decomposition | | * obtain the inverse matrix from the decomposition | |
|
| * @data July 15th 2013 | | * @date July 15th 2013 | |
| * provide a version of that class which works if the dimension of the | | * provide a version of that class which works if the dimension of the | |
| * problem is only known at run time | | * problem is only known at run time | |
|
| | | * @date September 30th 2013 | |
| | | * provide routines to access the result of the decomposition L and its | |
| | | * inverse | |
| */ | | */ | |
| | | | |
| #include <cmath> | | #include <cmath> | |
| #include <algorithm> | | #include <algorithm> | |
| | | | |
| namespace ROOT { | | namespace ROOT { | |
| | | | |
| namespace Math { | | namespace Math { | |
| | | | |
| /// helpers for CholeskyDecomp | | /// helpers for CholeskyDecomp | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 128 | |
| fL, PackedArrayAdapter<G>(m)); | | fL, PackedArrayAdapter<G>(m)); | |
| } | | } | |
| | | | |
| /// returns true if decomposition was successful | | /// returns true if decomposition was successful | |
| /** @returns true if decomposition was successful */ | | /** @returns true if decomposition was successful */ | |
| bool ok() const { return fOk; } | | bool ok() const { return fOk; } | |
| /// returns true if decomposition was successful | | /// returns true if decomposition was successful | |
| /** @returns true if decomposition was successful */ | | /** @returns true if decomposition was successful */ | |
| operator bool() const { return fOk; } | | operator bool() const { return fOk; } | |
| | | | |
|
| /// solves a linear system for the given right hand side | | /** @brief solves a linear system for the given right hand side | |
| /** solves a linear system for the given right hand side | | | |
| * | | * | |
| * Note that you can use both SVector classes and plain arrays for | | * Note that you can use both SVector classes and plain arrays for | |
| * rhs. (Make sure that the sizes match!). It will work with any vector | | * rhs. (Make sure that the sizes match!). It will work with any vector | |
| * implementing the operator [i] | | * implementing the operator [i] | |
| * | | * | |
| * @returns if the decomposition was successful | | * @returns if the decomposition was successful | |
| */ | | */ | |
| template<class V> bool Solve(V& rhs) const | | template<class V> bool Solve(V& rhs) const | |
| { | | { | |
| using CholeskyDecompHelpers::_solver; | | using CholeskyDecompHelpers::_solver; | |
| if (fOk) _solver<F,N,V>()(rhs, fL); return fOk; | | if (fOk) _solver<F,N,V>()(rhs, fL); return fOk; | |
| } | | } | |
| | | | |
|
| /// place the inverse into m | | /** @brief place the inverse into m | |
| /** place the inverse into m | | | |
| * | | * | |
| * This is the method to use with an SMatrix. | | * This is the method to use with an SMatrix. | |
| * | | * | |
| * @returns if the decomposition was successful | | * @returns if the decomposition was successful | |
| */ | | */ | |
| template<class M> bool Invert(M& m) const | | template<class M> bool Invert(M& m) const | |
| { | | { | |
| using CholeskyDecompHelpers::_inverter; | | using CholeskyDecompHelpers::_inverter; | |
| if (fOk) _inverter<F,N,M>()(m, fL); return fOk; | | if (fOk) _inverter<F,N,M>()(m, fL); return fOk; | |
| } | | } | |
| | | | |
|
| /// place the inverse into m | | /** @brief place the inverse into m | |
| /** place the inverse into m | | | |
| * | | * | |
| * This is the method to use with a plain array. | | * This is the method to use with a plain array. | |
| * | | * | |
| * @returns if the decomposition was successful | | * @returns if the decomposition was successful | |
| * | | * | |
| * NOTE: the matrix is given in packed representation, matrix | | * NOTE: the matrix is given in packed representation, matrix | |
| * element m(i,j) (j <= i) is supposed to be in array element | | * element m(i,j) (j <= i) is supposed to be in array element | |
| * (i * (i + 1)) / 2 + j | | * (i * (i + 1)) / 2 + j | |
| */ | | */ | |
| template<typename G> bool Invert(G* m) const | | template<typename G> bool Invert(G* m) const | |
| { | | { | |
| using CholeskyDecompHelpers::_inverter; | | using CholeskyDecompHelpers::_inverter; | |
| using CholeskyDecompHelpers::PackedArrayAdapter; | | using CholeskyDecompHelpers::PackedArrayAdapter; | |
| if (fOk) { | | if (fOk) { | |
| PackedArrayAdapter<G> adapted(m); | | PackedArrayAdapter<G> adapted(m); | |
| _inverter<F,N,PackedArrayAdapter<G> >()(adapted, fL); | | _inverter<F,N,PackedArrayAdapter<G> >()(adapted, fL); | |
| } | | } | |
| return fOk; | | return fOk; | |
| } | | } | |
|
| | | | |
| | | /** @brief obtain the decomposed matrix L | |
| | | * | |
| | | * This is the method to use with a plain array. | |
| | | * | |
| | | * @returns if the decomposition was successful | |
| | | */ | |
| | | template<class M> bool getL(M& m) const | |
| | | { | |
| | | if (!fOk) return false; | |
| | | for (unsigned i = 0; i < N; ++i) { | |
| | | // zero upper half of matrix | |
| | | for (unsigned j = i + 1; j < N; ++j) | |
| | | m(i, j) = F(0); | |
| | | // copy the rest | |
| | | for (unsigned j = 0; j <= i; ++j) | |
| | | m(i, j) = fL[i * (i + 1) / 2 + j]; | |
| | | // adjust the diagonal - we save 1/L(i, i) in that position, so | |
| | | // convert to what caller expects | |
| | | m(i, i) = F(1) / m(i, i); | |
| | | } | |
| | | return true; | |
| | | } | |
| | | | |
| | | /** @brief obtain the decomposed matrix L | |
| | | * | |
| | | * @returns if the decomposition was successful | |
| | | * | |
| | | * NOTE: the matrix is given in packed representation, matrix | |
| | | * element m(i,j) (j <= i) is supposed to be in array element | |
| | | * (i * (i + 1)) / 2 + j | |
| | | */ | |
| | | template<typename G> bool getL(G* m) const | |
| | | { | |
| | | if (!fOk) return false; | |
| | | // copy L | |
| | | for (unsigned i = 0; i < (N * (N + 1)) / 2; ++i) | |
| | | m[i] = fL[i]; | |
| | | // adjust diagonal - we save 1/L(i, i) in that position, so convert | |
| | | to | |
| | | // what caller expects | |
| | | for (unsigned i = 0; i < N; ++i) | |
| | | m[(i * (i + 1)) / 2 + i] = F(1) / fL[(i * (i + 1)) / 2 + i]; | |
| | | return true; | |
| | | } | |
| | | | |
| | | /** @brief obtain the inverse of the decomposed matrix L | |
| | | * | |
| | | * This is the method to use with a plain array. | |
| | | * | |
| | | * @returns if the decomposition was successful | |
| | | */ | |
| | | template<class M> bool getLi(M& m) const | |
| | | { | |
| | | if (!fOk) return false; | |
| | | for (unsigned i = 0; i < N; ++i) { | |
| | | // zero lower half of matrix | |
| | | for (unsigned j = i + 1; j < N; ++j) | |
| | | m(j, i) = F(0); | |
| | | // copy the rest | |
| | | for (unsigned j = 0; j <= i; ++j) | |
| | | m(j, i) = fL[i * (i + 1) / 2 + j]; | |
| | | } | |
| | | // invert the off-diagonal part of what we just copied | |
| | | for (unsigned i = 1; i < N; ++i) { | |
| | | for (unsigned j = 0; j < i; ++j) { | |
| | | typename M::value_type tmp = F(0); | |
| | | for (unsigned k = i; k-- > j;) | |
| | | tmp -= m(k, i) * m(j, k); | |
| | | m(j, i) = tmp * m(i, i); | |
| | | } | |
| | | } | |
| | | return true; | |
| | | } | |
| | | | |
| | | /** @brief obtain the inverse of the decomposed matrix L | |
| | | * | |
| | | * @returns if the decomposition was successful | |
| | | * | |
| | | * NOTE: the matrix is given in packed representation, matrix | |
| | | * element m(j,i) (j <= i) is supposed to be in array element | |
| | | * (i * (i + 1)) / 2 + j | |
| | | */ | |
| | | template<typename G> bool getLi(G* m) const | |
| | | { | |
| | | if (!fOk) return false; | |
| | | // copy L | |
| | | for (unsigned i = 0; i < (N * (N + 1)) / 2; ++i) | |
| | | m[i] = fL[i]; | |
| | | // invert the off-diagonal part of what we just copied | |
| | | G* base1 = &m[1]; | |
| | | for (unsigned i = 1; i < N; base1 += ++i) { | |
| | | for (unsigned j = 0; j < i; ++j) { | |
| | | G tmp = F(0); | |
| | | const G *base2 = &m[(i * (i - 1)) / 2]; | |
| | | for (unsigned k = i; k-- > j; base2 -= k) | |
| | | tmp -= base1[k] * base2[j]; | |
| | | base1[j] = tmp * base1[i]; | |
| | | } | |
| | | } | |
| | | return true; | |
| | | } | |
| }; | | }; | |
| | | | |
| /// class to compute the Cholesky decomposition of a matrix | | /// class to compute the Cholesky decomposition of a matrix | |
| /** class to compute the Cholesky decomposition of a symmetric | | /** class to compute the Cholesky decomposition of a symmetric | |
| * positive definite matrix when the dimensionality of the problem is not k
nown | | * positive definite matrix when the dimensionality of the problem is not k
nown | |
| * at compile time | | * at compile time | |
| * | | * | |
| * provides routines to check if the decomposition succeeded (i.e. if | | * provides routines to check if the decomposition succeeded (i.e. if | |
| * matrix is positive definite and non-singular), to solve a linear | | * matrix is positive definite and non-singular), to solve a linear | |
| * system for the given matrix and to obtain its inverse | | * system for the given matrix and to obtain its inverse | |
| * | | * | |
| * the actual functionality is implemented in templated helper | | * the actual functionality is implemented in templated helper | |
| * classes which have specializations for dimensions N = 1 to 6 | | * classes which have specializations for dimensions N = 1 to 6 | |
| * to achieve a gain in speed for common matrix sizes | | * to achieve a gain in speed for common matrix sizes | |
| * | | * | |
| * usage example: | | * usage example: | |
| * @code | | * @code | |
| * // let m be a symmetric positive definite SMatrix (use type float | | * // let m be a symmetric positive definite SMatrix (use type float | |
| * // for internal computations, matrix size is 4x4) | | * // for internal computations, matrix size is 4x4) | |
|
| * CholeskyDecomp<float, 4> decomp(m); | | * CholeskyDecompGenDim<float> decomp(4, m); | |
| * // check if the decomposition succeeded | | * // check if the decomposition succeeded | |
| * if (!decomp) { | | * if (!decomp) { | |
| * std::cerr << "decomposition failed!" << std::endl; | | * std::cerr << "decomposition failed!" << std::endl; | |
| * } else { | | * } else { | |
| * // let rhs be a vector; we seek a vector x such that m * x = rhs | | * // let rhs be a vector; we seek a vector x such that m * x = rhs | |
| * decomp.Solve(rhs); | | * decomp.Solve(rhs); | |
| * // rhs now contains the solution we are looking for | | * // rhs now contains the solution we are looking for | |
| * | | * | |
| * // obtain the inverse of m, put it into m itself | | * // obtain the inverse of m, put it into m itself | |
| * decomp.Invert(m); | | * decomp.Invert(m); | |
| | | | |
| skipping to change at line 265 | | skipping to change at line 366 | |
| /// destructor | | /// destructor | |
| ~CholeskyDecompGenDim() { delete[] fL; } | | ~CholeskyDecompGenDim() { delete[] fL; } | |
| | | | |
| /// returns true if decomposition was successful | | /// returns true if decomposition was successful | |
| /** @returns true if decomposition was successful */ | | /** @returns true if decomposition was successful */ | |
| bool ok() const { return fOk; } | | bool ok() const { return fOk; } | |
| /// returns true if decomposition was successful | | /// returns true if decomposition was successful | |
| /** @returns true if decomposition was successful */ | | /** @returns true if decomposition was successful */ | |
| operator bool() const { return fOk; } | | operator bool() const { return fOk; } | |
| | | | |
|
| /// solves a linear system for the given right hand side | | /** @brief solves a linear system for the given right hand side | |
| /** solves a linear system for the given right hand side | | | |
| * | | * | |
| * Note that you can use both SVector classes and plain arrays for | | * Note that you can use both SVector classes and plain arrays for | |
| * rhs. (Make sure that the sizes match!). It will work with any vector | | * rhs. (Make sure that the sizes match!). It will work with any vector | |
| * implementing the operator [i] | | * implementing the operator [i] | |
| * | | * | |
| * @returns if the decomposition was successful | | * @returns if the decomposition was successful | |
| */ | | */ | |
| template<class V> bool Solve(V& rhs) const | | template<class V> bool Solve(V& rhs) const | |
| { | | { | |
| using CholeskyDecompHelpers::_solverGenDim; | | using CholeskyDecompHelpers::_solverGenDim; | |
| if (fOk) _solverGenDim<F,V>()(rhs, fL, fN); return fOk; | | if (fOk) _solverGenDim<F,V>()(rhs, fL, fN); return fOk; | |
| } | | } | |
| | | | |
|
| /// place the inverse into m | | /** @brief place the inverse into m | |
| /** place the inverse into m | | | |
| * | | * | |
| * This is the method to use with an SMatrix. | | * This is the method to use with an SMatrix. | |
| * | | * | |
| * @returns if the decomposition was successful | | * @returns if the decomposition was successful | |
| */ | | */ | |
| template<class M> bool Invert(M& m) const | | template<class M> bool Invert(M& m) const | |
| { | | { | |
| using CholeskyDecompHelpers::_inverterGenDim; | | using CholeskyDecompHelpers::_inverterGenDim; | |
| if (fOk) _inverterGenDim<F,M>()(m, fL, fN); return fOk; | | if (fOk) _inverterGenDim<F,M>()(m, fL, fN); return fOk; | |
| } | | } | |
| | | | |
|
| /// place the inverse into m | | /** @brief place the inverse into m | |
| /** place the inverse into m | | | |
| * | | * | |
| * This is the method to use with a plain array. | | * This is the method to use with a plain array. | |
| * | | * | |
| * @returns if the decomposition was successful | | * @returns if the decomposition was successful | |
| * | | * | |
| * NOTE: the matrix is given in packed representation, matrix | | * NOTE: the matrix is given in packed representation, matrix | |
| * element m(i,j) (j <= i) is supposed to be in array element | | * element m(i,j) (j <= i) is supposed to be in array element | |
| * (i * (i + 1)) / 2 + j | | * (i * (i + 1)) / 2 + j | |
| */ | | */ | |
| template<typename G> bool Invert(G* m) const | | template<typename G> bool Invert(G* m) const | |
| { | | { | |
| using CholeskyDecompHelpers::_inverterGenDim; | | using CholeskyDecompHelpers::_inverterGenDim; | |
| using CholeskyDecompHelpers::PackedArrayAdapter; | | using CholeskyDecompHelpers::PackedArrayAdapter; | |
| if (fOk) { | | if (fOk) { | |
| PackedArrayAdapter<G> adapted(m); | | PackedArrayAdapter<G> adapted(m); | |
| _inverterGenDim<F,PackedArrayAdapter<G> >()(adapted, fL, fN); | | _inverterGenDim<F,PackedArrayAdapter<G> >()(adapted, fL, fN); | |
| } | | } | |
| return fOk; | | return fOk; | |
| } | | } | |
|
| | | | |
| | | /** @brief obtain the decomposed matrix L | |
| | | * | |
| | | * This is the method to use with a plain array. | |
| | | * | |
| | | * @returns if the decomposition was successful | |
| | | */ | |
| | | template<class M> bool getL(M& m) const | |
| | | { | |
| | | if (!fOk) return false; | |
| | | for (unsigned i = 0; i < fN; ++i) { | |
| | | // zero upper half of matrix | |
| | | for (unsigned j = i + 1; j < fN; ++j) | |
| | | m(i, j) = F(0); | |
| | | // copy the rest | |
| | | for (unsigned j = 0; j <= i; ++j) | |
| | | m(i, j) = fL[i * (i + 1) / 2 + j]; | |
| | | // adjust the diagonal - we save 1/L(i, i) in that position, so | |
| | | // convert to what caller expects | |
| | | m(i, i) = F(1) / m(i, i); | |
| | | } | |
| | | return true; | |
| | | } | |
| | | | |
| | | /** @brief obtain the decomposed matrix L | |
| | | * | |
| | | * @returns if the decomposition was successful | |
| | | * | |
| | | * NOTE: the matrix is given in packed representation, matrix | |
| | | * element m(i,j) (j <= i) is supposed to be in array element | |
| | | * (i * (i + 1)) / 2 + j | |
| | | */ | |
| | | template<typename G> bool getL(G* m) const | |
| | | { | |
| | | if (!fOk) return false; | |
| | | // copy L | |
| | | for (unsigned i = 0; i < (fN * (fN + 1)) / 2; ++i) | |
| | | m[i] = fL[i]; | |
| | | // adjust diagonal - we save 1/L(i, i) in that position, so convert | |
| | | to | |
| | | // what caller expects | |
| | | for (unsigned i = 0; i < fN; ++i) | |
| | | m[(i * (i + 1)) / 2 + i] = F(1) / fL[(i * (i + 1)) / 2 + i]; | |
| | | return true; | |
| | | } | |
| | | | |
| | | /** @brief obtain the inverse of the decomposed matrix L | |
| | | * | |
| | | * This is the method to use with a plain array. | |
| | | * | |
| | | * @returns if the decomposition was successful | |
| | | */ | |
| | | template<class M> bool getLi(M& m) const | |
| | | { | |
| | | if (!fOk) return false; | |
| | | for (unsigned i = 0; i < fN; ++i) { | |
| | | // zero lower half of matrix | |
| | | for (unsigned j = i + 1; j < fN; ++j) | |
| | | m(j, i) = F(0); | |
| | | // copy the rest | |
| | | for (unsigned j = 0; j <= i; ++j) | |
| | | m(j, i) = fL[i * (i + 1) / 2 + j]; | |
| | | } | |
| | | // invert the off-diagonal part of what we just copied | |
| | | for (unsigned i = 1; i < fN; ++i) { | |
| | | for (unsigned j = 0; j < i; ++j) { | |
| | | typename M::value_type tmp = F(0); | |
| | | for (unsigned k = i; k-- > j;) | |
| | | tmp -= m(k, i) * m(j, k); | |
| | | m(j, i) = tmp * m(i, i); | |
| | | } | |
| | | } | |
| | | return true; | |
| | | } | |
| | | | |
| | | /** @brief obtain the inverse of the decomposed matrix L | |
| | | * | |
| | | * @returns if the decomposition was successful | |
| | | * | |
| | | * NOTE: the matrix is given in packed representation, matrix | |
| | | * element m(j,i) (j <= i) is supposed to be in array element | |
| | | * (i * (i + 1)) / 2 + j | |
| | | */ | |
| | | template<typename G> bool getLi(G* m) const | |
| | | { | |
| | | if (!fOk) return false; | |
| | | // copy L | |
| | | for (unsigned i = 0; i < (fN * (fN + 1)) / 2; ++i) | |
| | | m[i] = fL[i]; | |
| | | // invert the off-diagonal part of what we just copied | |
| | | G* base1 = &m[1]; | |
| | | for (unsigned i = 1; i < fN; base1 += ++i) { | |
| | | for (unsigned j = 0; j < i; ++j) { | |
| | | G tmp = F(0); | |
| | | const G *base2 = &m[(i * (i - 1)) / 2]; | |
| | | for (unsigned k = i; k-- > j; base2 -= k) | |
| | | tmp -= base1[k] * base2[j]; | |
| | | base1[j] = tmp * base1[i]; | |
| | | } | |
| | | } | |
| | | return true; | |
| | | } | |
| }; | | }; | |
| | | | |
| namespace CholeskyDecompHelpers { | | namespace CholeskyDecompHelpers { | |
| /// adapter for packed arrays (to SMatrix indexing conventions) | | /// adapter for packed arrays (to SMatrix indexing conventions) | |
| template<typename G> class PackedArrayAdapter | | template<typename G> class PackedArrayAdapter | |
| { | | { | |
| private: | | private: | |
| G* fArr; ///< pointer to first array element | | G* fArr; ///< pointer to first array element | |
| public: | | public: | |
| /// constructor | | /// constructor | |
| | | | |
End of changes. 11 change blocks. |
| 14 lines changed or deleted | | 215 lines changed or added | |
|
| CollectionProxy.h | | CollectionProxy.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| // purpose is hereby granted without fee, provided that this copyright and | | // purpose is hereby granted without fee, provided that this copyright and | |
| // permissions notice appear in all copies and derivatives. | | // permissions notice appear in all copies and derivatives. | |
| // | | // | |
| // This software is provided "as is" without express or implied warranty. | | // This software is provided "as is" without express or implied warranty. | |
| | | | |
| #ifndef Reflex_CollectionProxy | | #ifndef Reflex_CollectionProxy | |
| #define Reflex_CollectionProxy 1 1 | | #define Reflex_CollectionProxy 1 1 | |
| | | | |
| #include <cstddef> | | #include <cstddef> | |
| #include <assert.h> | | #include <assert.h> | |
|
| | | #include <vector> | |
| | | #include <map> | |
| | | | |
| // Macro indicating the version of the Collection Proxy interface followed | | // Macro indicating the version of the Collection Proxy interface followed | |
| // by this Reflex build, this must match the version number of | | // by this Reflex build, this must match the version number of | |
| // ROOT_COLLECTIONPROXY_VERSION in ROOT's TVirtutalCollectionProxy.h | | // ROOT_COLLECTIONPROXY_VERSION in ROOT's TVirtutalCollectionProxy.h | |
| | | | |
| #define REFLEX_COLLECTIONPROXY_VERSION 3 | | #define REFLEX_COLLECTIONPROXY_VERSION 3 | |
| | | | |
| // Forward declarations | | // Forward declarations | |
|
| | | | |
| | | class TVirtualCollectionProxy; | |
| | | | |
| namespace std { | | namespace std { | |
| template <class T, class A> class deque; | | template <class T, class A> class deque; | |
|
| template <class T, class A> class vector; | | //template <class T, class A> class vector; | |
| template <class T, class A> class list; | | template <class T, class A> class list; | |
| template <class T, class A> class queue; | | template <class T, class A> class queue; | |
| template <class T, class A> class stack; | | template <class T, class A> class stack; | |
| template <class K, class T, class A> class set; | | template <class K, class T, class A> class set; | |
| template <class K, class T, class A> class multiset; | | template <class K, class T, class A> class multiset; | |
|
| template <class K, class T, class R, class A> class map; | | //template <class K, class T, class R, class A> class map; | |
| template <class K, class T, class R, class A> class multimap; | | template <class K, class T, class R, class A> class multimap; | |
|
| template <class T> class allocator; | | //template <class T> class allocator; | |
| } | | } | |
| // Hash map forward declarations | | // Hash map forward declarations | |
| #if defined(__GNUC__) | | #if defined(__GNUC__) | |
| namespace __gnu_cxx { // GNU GCC | | namespace __gnu_cxx { // GNU GCC | |
| template <class T, class F, class E, class A> class hash_set; | | template <class T, class F, class E, class A> class hash_set; | |
| template <class T, class F, class E, class A> class hash_multiset; | | template <class T, class F, class E, class A> class hash_multiset; | |
| template <class K, class T, class F, class E, class A> class hash_map; | | template <class K, class T, class F, class E, class A> class hash_map; | |
| template <class K, class T, class F, class E, class A> class hash_multim
ap; | | template <class K, class T, class F, class E, class A> class hash_multim
ap; | |
| } | | } | |
| #elif defined(_WIN32) | | #elif defined(_WIN32) | |
| | | | |
| skipping to change at line 143 | | skipping to change at line 148 | |
| * Small helper to implement the function to create,access and destroy | | * Small helper to implement the function to create,access and destroy | |
| * iterators. | | * iterators. | |
| * | | * | |
| **/ | | **/ | |
| | | | |
| template <typename Cont_t, bool large = false> | | template <typename Cont_t, bool large = false> | |
| struct Iterators { | | struct Iterators { | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| typedef typename Cont_t::iterator iterator; | | typedef typename Cont_t::iterator iterator; | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy *) { | |
| PCont_t c = PCont_t(coll); | | PCont_t c = PCont_t(coll); | |
| new (*begin_arena) iterator(c->begin()); | | new (*begin_arena) iterator(c->begin()); | |
| new (*end_arena) iterator(c->end()); | | new (*end_arena) iterator(c->end()); | |
| } | | } | |
| static void* copy(void *dest_arena, const void *source_ptr) { | | static void* copy(void *dest_arena, const void *source_ptr) { | |
| iterator *source = (iterator *)(source_ptr); | | iterator *source = (iterator *)(source_ptr); | |
| new (dest_arena) iterator(*source); | | new (dest_arena) iterator(*source); | |
| return dest_arena; | | return dest_arena; | |
| } | | } | |
| static void* next(void *iter_loc, const void *end_loc) { | | static void* next(void *iter_loc, const void *end_loc) { | |
| | | | |
| skipping to change at line 184 | | skipping to change at line 189 | |
| | | | |
| // For Vector we take an extra short cut to avoid derefencing | | // For Vector we take an extra short cut to avoid derefencing | |
| // the iterator all the time and redefine the 'address' of the | | // the iterator all the time and redefine the 'address' of the | |
| // iterator as the iterator itself. This requires special handling | | // iterator as the iterator itself. This requires special handling | |
| // in the looper (see TStreamerInfoAction) but is much faster. | | // in the looper (see TStreamerInfoAction) but is much faster. | |
| template <typename T> struct Iterators<std::vector<T>, false> { | | template <typename T> struct Iterators<std::vector<T>, false> { | |
| typedef std::vector<T> Cont_t; | | typedef std::vector<T> Cont_t; | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| typedef typename Cont_t::iterator iterator; | | typedef typename Cont_t::iterator iterator; | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy *) { | |
| PCont_t c = PCont_t(coll); | | PCont_t c = PCont_t(coll); | |
| if (c->empty()) { | | if (c->empty()) { | |
| *begin_arena = 0; | | *begin_arena = 0; | |
| *end_arena = 0; | | *end_arena = 0; | |
| return; | | return; | |
| } | | } | |
| *begin_arena = &(*c->begin()); | | *begin_arena = &(*c->begin()); | |
| #ifdef R__VISUAL_CPLUSPLUS | | #ifdef R__VISUAL_CPLUSPLUS | |
| *end_arena = &(*(c->end()-1)) + 1; // On windows we can not der
erence the end iterator at all. | | *end_arena = &(*(c->end()-1)) + 1; // On windows we can not der
erence the end iterator at all. | |
| #else | | #else | |
| | | | |
| skipping to change at line 221 | | skipping to change at line 226 | |
| static void destruct2(void * /* begin_ptr */, void * /* end_ptr */
) { | | static void destruct2(void * /* begin_ptr */, void * /* end_ptr */
) { | |
| // Nothing to do | | // Nothing to do | |
| } | | } | |
| }; | | }; | |
| | | | |
| template <> struct Iterators<std::vector<bool>, false> { | | template <> struct Iterators<std::vector<bool>, false> { | |
| typedef std::vector<bool> Cont_t; | | typedef std::vector<bool> Cont_t; | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| typedef Cont_t::iterator iterator; | | typedef Cont_t::iterator iterator; | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy *) { | |
| PCont_t c = PCont_t(coll); | | PCont_t c = PCont_t(coll); | |
| new (*begin_arena) iterator(c->begin()); | | new (*begin_arena) iterator(c->begin()); | |
| new (*end_arena) iterator(c->end()); | | new (*end_arena) iterator(c->end()); | |
| } | | } | |
| static void* copy(void *dest_arena, const void *source_ptr) { | | static void* copy(void *dest_arena, const void *source_ptr) { | |
| iterator *source = (iterator *)(source_ptr); | | iterator *source = (iterator *)(source_ptr); | |
| new (dest_arena) iterator(*source); | | new (dest_arena) iterator(*source); | |
| return dest_arena; | | return dest_arena; | |
| } | | } | |
| static void* next(void *iter_loc, const void *end_loc) { | | static void* next(void *iter_loc, const void *end_loc) { | |
| | | | |
| skipping to change at line 257 | | skipping to change at line 262 | |
| iterator *end = (iterator *)(end_ptr); | | iterator *end = (iterator *)(end_ptr); | |
| start->~iterator(); | | start->~iterator(); | |
| end->~iterator(); | | end->~iterator(); | |
| } | | } | |
| }; | | }; | |
| | | | |
| template <typename Cont_t> struct Iterators<Cont_t, /* large= */ true
> { | | template <typename Cont_t> struct Iterators<Cont_t, /* large= */ true
> { | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| typedef typename Cont_t::iterator iterator; | | typedef typename Cont_t::iterator iterator; | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy *) { | |
| PCont_t c = PCont_t(coll); | | PCont_t c = PCont_t(coll); | |
| *begin_arena = new iterator(c->begin()); | | *begin_arena = new iterator(c->begin()); | |
| *end_arena = new iterator(c->end()); | | *end_arena = new iterator(c->end()); | |
| } | | } | |
| static void* copy(void * /*dest_arena*/, const void *source_ptr) { | | static void* copy(void * /*dest_arena*/, const void *source_ptr) { | |
| iterator *source = (iterator *)(source_ptr); | | iterator *source = (iterator *)(source_ptr); | |
| void *iter = new iterator(*source); | | void *iter = new iterator(*source); | |
| return iter; | | return iter; | |
| } | | } | |
| static void* next(void *iter_loc, const void *end_loc) { | | static void* next(void *iter_loc, const void *end_loc) { | |
| | | | |
| skipping to change at line 549 | | skipping to change at line 554 | |
| void* (*clear_func)(void*); | | void* (*clear_func)(void*); | |
| void* (*first_func)(void*); | | void* (*first_func)(void*); | |
| void* (*next_func)(void*); | | void* (*next_func)(void*); | |
| void* (*construct_func)(void*,size_t); | | void* (*construct_func)(void*,size_t); | |
| void (*destruct_func)(void*,size_t); | | void (*destruct_func)(void*,size_t); | |
| void* (*feed_func)(void*,void*,size_t); | | void* (*feed_func)(void*,void*,size_t); | |
| void* (*collect_func)(void*,void*); | | void* (*collect_func)(void*,void*); | |
| void* (*create_env)(); | | void* (*create_env)(); | |
| | | | |
| // Set of function of direct iteration of the collections. | | // Set of function of direct iteration of the collections. | |
|
| void (*fCreateIterators)(void *collection, void **begin_arena, void *
*end_arena); | | void (*fCreateIterators)(void *collection, void **begin_arena, void *
*end_arena, TVirtualCollectionProxy *proxy); | |
| // begin_arena and end_arena should contain the location of memory ar
ena of size fgIteratorSize. | | // begin_arena and end_arena should contain the location of memory ar
ena of size fgIteratorSize. | |
| // If the collection iterator are of that size or less, the iterators
will be constructed in place in those location (new with placement) | | // If the collection iterator are of that size or less, the iterators
will be constructed in place in those location (new with placement) | |
| // Otherwise the iterators will be allocated via a regular new and th
eir address returned by modifying the value of begin_arena and end_arena. | | // Otherwise the iterators will be allocated via a regular new and th
eir address returned by modifying the value of begin_arena and end_arena. | |
| | | | |
| void* (*fCopyIterator)(void *dest, const void *source); | | void* (*fCopyIterator)(void *dest, const void *source); | |
| // Copy the iterator source, into dest. dest should contain should
contain the location of memory arena of size fgIteratorSize. | | // Copy the iterator source, into dest. dest should contain should
contain the location of memory arena of size fgIteratorSize. | |
| // If the collection iterator are of that size or less, the iterator
will be constructed in place in this location (new with placement) | | // If the collection iterator are of that size or less, the iterator
will be constructed in place in this location (new with placement) | |
| // Otherwise the iterator will be allocated via a regular new and its
address returned by modifying the value of dest. | | // Otherwise the iterator will be allocated via a regular new and its
address returned by modifying the value of dest. | |
| | | | |
| void* (*fNext)(void *iter, const void *end); | | void* (*fNext)(void *iter, const void *end); | |
| | | | |
| skipping to change at line 872 | | skipping to change at line 877 | |
| | | | |
| struct Iterators { | | struct Iterators { | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| union PtrSize_t { size_t fIndex; void *fAddress; }; | | union PtrSize_t { size_t fIndex; void *fAddress; }; | |
| typedef std::pair<PtrSize_t,bool> iterator; | | typedef std::pair<PtrSize_t,bool> iterator; | |
| // In the end iterator we store the bitset pointer | | // In the end iterator we store the bitset pointer | |
| // and do not use the 'second' part of the pair. | | // and do not use the 'second' part of the pair. | |
| // In the other iterator we store the index | | // In the other iterator we store the index | |
| // and the value. | | // and the value. | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy *) { | |
| iterator *begin = new (*begin_arena) iterator; | | iterator *begin = new (*begin_arena) iterator; | |
| begin->first.fIndex = 0; | | begin->first.fIndex = 0; | |
| begin->second = false; | | begin->second = false; | |
| iterator *end = new (*end_arena) iterator; | | iterator *end = new (*end_arena) iterator; | |
| end->first.fAddress = coll; | | end->first.fAddress = coll; | |
| end->second = false; | | end->second = false; | |
| } | | } | |
| static void* copy(void *dest_arena, const void *source_ptr) { | | static void* copy(void *dest_arena, const void *source_ptr) { | |
| const iterator *source = (const iterator *)(source_ptr); | | const iterator *source = (const iterator *)(source_ptr); | |
| new (dest_arena) iterator(*source); | | new (dest_arena) iterator(*source); | |
| | | | |
End of changes. 11 change blocks. |
| 9 lines changed or deleted | | 14 lines changed or added | |
|
| Configurable.h | | Configurable.h | |
| | | | |
| skipping to change at line 84 | | skipping to change at line 84 | |
| template<class T> | | template<class T> | |
| OptionBase* DeclareOptionRef( T& ref, const TString& name, const TStr
ing& desc = "" ); | | OptionBase* DeclareOptionRef( T& ref, const TString& name, const TStr
ing& desc = "" ); | |
| | | | |
| template<class T> | | template<class T> | |
| OptionBase* DeclareOptionRef( T*& ref, Int_t size, const TString& nam
e, const TString& desc = "" ); | | OptionBase* DeclareOptionRef( T*& ref, Int_t size, const TString& nam
e, const TString& desc = "" ); | |
| | | | |
| // Add a predefined value to the last declared option | | // Add a predefined value to the last declared option | |
| template<class T> | | template<class T> | |
| void AddPreDefVal(const T&); | | void AddPreDefVal(const T&); | |
| | | | |
|
| | | // Add a predefined value to the option named optname | |
| | | template<class T> | |
| | | void AddPreDefVal(const TString&optname ,const T&); | |
| | | | |
| void CheckForUnusedOptions() const; | | void CheckForUnusedOptions() const; | |
| | | | |
| const TString& GetOptions() const { return fOptions; } | | const TString& GetOptions() const { return fOptions; } | |
| void SetOptions(const TString& s) { fOptions = s; } | | void SetOptions(const TString& s) { fOptions = s; } | |
| | | | |
| void WriteOptionsToStream ( std::ostream& o, const TString& prefix )
const; | | void WriteOptionsToStream ( std::ostream& o, const TString& prefix )
const; | |
|
| void ReadOptionsFromStream( istream& istr ); | | void ReadOptionsFromStream( std::istream& istr ); | |
| | | | |
| void AddOptionsXMLTo( void* parent ) const; | | void AddOptionsXMLTo( void* parent ) const; | |
| void ReadOptionsFromXML( void* node ); | | void ReadOptionsFromXML( void* node ); | |
| | | | |
| protected: | | protected: | |
| | | | |
| Bool_t LooseOptionCheckingEnabled() const { return fLooseOptionChecki
ngEnabled; } | | Bool_t LooseOptionCheckingEnabled() const { return fLooseOptionChecki
ngEnabled; } | |
| void EnableLooseOptions( Bool_t b = kTRUE ) { fLooseOptionCheckingE
nabled = b; } | | void EnableLooseOptions( Bool_t b = kTRUE ) { fLooseOptionCheckingE
nabled = b; } | |
| | | | |
| void WriteOptionsReferenceToFile(); | | void WriteOptionsReferenceToFile(); | |
| | | | |
| skipping to change at line 173 | | skipping to change at line 177 | |
| OptionBase* o = new Option<T*>(ref, size, name, desc); | | OptionBase* o = new Option<T*>(ref, size, name, desc); | |
| fListOfOptions.Add(o); | | fListOfOptions.Add(o); | |
| fLastDeclaredOption = o; | | fLastDeclaredOption = o; | |
| return o; | | return o; | |
| } | | } | |
| | | | |
| //______________________________________________________________________ | | //______________________________________________________________________ | |
| template<class T> | | template<class T> | |
| void TMVA::Configurable::AddPreDefVal(const T& val) | | void TMVA::Configurable::AddPreDefVal(const T& val) | |
| { | | { | |
|
| // add predefined option value | | // add predefined option value to the last declared option | |
| Option<T>* oc = dynamic_cast<Option<T>*>(fLastDeclaredOption); | | Option<T>* oc = dynamic_cast<Option<T>*>(fLastDeclaredOption); | |
| if(oc!=0) oc->AddPreDefVal(val); | | if(oc!=0) oc->AddPreDefVal(val); | |
| } | | } | |
| | | | |
| //______________________________________________________________________ | | //______________________________________________________________________ | |
|
| | | template<class T> | |
| | | void TMVA::Configurable::AddPreDefVal(const TString &optname, const T& val) | |
| | | { | |
| | | // add predefined option value to the option named optname | |
| | | | |
| | | TListIter optIt( &fListOfOptions ); | |
| | | while (OptionBase * op = (OptionBase *) optIt()) { | |
| | | if (optname == TString(op->TheName())){ | |
| | | Option<T>* oc = dynamic_cast<Option<T>*>(op); | |
| | | if(oc!=0){ | |
| | | oc->AddPreDefVal(val); | |
| | | return; | |
| | | } | |
| | | else{ | |
| | | Log() << kFATAL << "Option \"" << optname | |
| | | << "\" was found, but somehow I could not convert the pointer | |
| | | propperly.. please check the syntax of your option declaration" << Endl; | |
| | | return; | |
| | | } | |
| | | | |
| | | } | |
| | | } | |
| | | Log() << kFATAL << "Option \"" << optname | |
| | | << "\" is not declared, hence cannot add predefined value, please c | |
| | | heck the syntax of your option declaration" << Endl; | |
| | | | |
| | | } | |
| | | | |
| | | //______________________________________________________________________ | |
| template <class T> | | template <class T> | |
| void TMVA::Configurable::AssignOpt(const TString& name, T& valAssign) const | | void TMVA::Configurable::AssignOpt(const TString& name, T& valAssign) const | |
| { | | { | |
| // assign an option | | // assign an option | |
| TObject* opt = fListOfOptions.FindObject(name); | | TObject* opt = fListOfOptions.FindObject(name); | |
| if (opt!=0) valAssign = ((Option<T>*)opt)->Value(); | | if (opt!=0) valAssign = ((Option<T>*)opt)->Value(); | |
| else | | else | |
| Log() << kFATAL << "Option \"" << name | | Log() << kFATAL << "Option \"" << name | |
| << "\" not declared, please check the syntax of your option str
ing" << Endl; | | << "\" not declared, please check the syntax of your option str
ing" << Endl; | |
| } | | } | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 35 lines changed or added | |
|
| DataSet.h | | DataSet.h | |
| | | | |
| skipping to change at line 53 | | skipping to change at line 53 | |
| | | | |
| #ifndef ROOT_TObject | | #ifndef ROOT_TObject | |
| #include "TObject.h" | | #include "TObject.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TString | | #ifndef ROOT_TString | |
| #include "TString.h" | | #include "TString.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TTree | | #ifndef ROOT_TTree | |
| #include "TTree.h" | | #include "TTree.h" | |
| #endif | | #endif | |
|
| #ifndef ROOT_TCut | | //#ifndef ROOT_TCut | |
| #include "TCut.h" | | //#include "TCut.h" | |
| #endif | | //#endif | |
| #ifndef ROOT_TMatrixDfwd | | //#ifndef ROOT_TMatrixDfwd | |
| #include "TMatrixDfwd.h" | | //#include "TMatrixDfwd.h" | |
| #endif | | //#endif | |
| #ifndef ROOT_TPrincipal | | //#ifndef ROOT_TPrincipal | |
| #include "TPrincipal.h" | | //#include "TPrincipal.h" | |
| #endif | | //#endif | |
| #ifndef ROOT_TRandom3 | | #ifndef ROOT_TRandom3 | |
| #include "TRandom3.h" | | #include "TRandom3.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOT_TMVA_Types | | #ifndef ROOT_TMVA_Types | |
| #include "TMVA/Types.h" | | #include "TMVA/Types.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TMVA_VariableInfo | | #ifndef ROOT_TMVA_VariableInfo | |
| #include "TMVA/VariableInfo.h" | | #include "TMVA/VariableInfo.h" | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 92 | | skipping to change at line 92 | |
| public: | | public: | |
| | | | |
| DataSet(const DataSetInfo&); | | DataSet(const DataSetInfo&); | |
| virtual ~DataSet(); | | virtual ~DataSet(); | |
| | | | |
| void AddEvent( Event *, Types::ETreeType ); | | void AddEvent( Event *, Types::ETreeType ); | |
| | | | |
| Long64_t GetNEvents( Types::ETreeType type = Types::kMaxTreeType ) c
onst; | | Long64_t GetNEvents( Types::ETreeType type = Types::kMaxTreeType ) c
onst; | |
| Long64_t GetNTrainingEvents() const { return GetNEvents
(Types::kTraining); } | | Long64_t GetNTrainingEvents() const { return GetNEvents
(Types::kTraining); } | |
| Long64_t GetNTestEvents() const { return GetNEvents
(Types::kTesting); } | | Long64_t GetNTestEvents() const { return GetNEvents
(Types::kTesting); } | |
|
| Event* GetEvent() const; // returns event w | | | |
| ithout transformations | | // const getters | |
| Event* GetEvent ( Long64_t ievt ) const { fCurrentEventIdx | | const Event* GetEvent() const; // returns e | |
| = ievt; return GetEvent(); } // returns event without transformations | | vent without transformations | |
| Event* GetTrainingEvent( Long64_t ievt ) const { return GetEvent(i | | const Event* GetEvent ( Long64_t ievt ) const { fCurrentEve | |
| evt, Types::kTraining); } | | ntIdx = ievt; return GetEvent(); } // returns event without transformations | |
| Event* GetTestEvent ( Long64_t ievt ) const { return GetEvent(i | | const Event* GetTrainingEvent( Long64_t ievt ) const { return GetE | |
| evt, Types::kTesting); } | | vent(ievt, Types::kTraining); } | |
| Event* GetEvent ( Long64_t ievt, Types::ETreeType type ) co | | const Event* GetTestEvent ( Long64_t ievt ) const { return GetE | |
| nst { | | vent(ievt, Types::kTesting); } | |
| | | const Event* GetEvent ( Long64_t ievt, Types::ETreeType typ | |
| | | e ) const | |
| | | { | |
| fCurrentTreeIdx = TreeIndex(type); fCurrentEventIdx = ievt; return
GetEvent(); | | fCurrentTreeIdx = TreeIndex(type); fCurrentEventIdx = ievt; return
GetEvent(); | |
| } | | } | |
| | | | |
|
| UInt_t GetNVariables() const; | | UInt_t GetNVariables() const; | |
| UInt_t GetNTargets() const; | | UInt_t GetNTargets() const; | |
| UInt_t GetNSpectators() const; | | UInt_t GetNSpectators() const; | |
| | | | |
| void SetCurrentEvent( Long64_t ievt ) const { fCurrentEv
entIdx = ievt; } | | void SetCurrentEvent( Long64_t ievt ) const { fCurrentEv
entIdx = ievt; } | |
| void SetCurrentType ( Types::ETreeType type ) const { fCurrentTr
eeIdx = TreeIndex(type); } | | void SetCurrentType ( Types::ETreeType type ) const { fCurrentTr
eeIdx = TreeIndex(type); } | |
| Types::ETreeType GetCurrentType() const; | | Types::ETreeType GetCurrentType() const; | |
| | | | |
| void SetEventCollection( std::vector<Event*>*,
Types::ETreeType ); | | void SetEventCollection( std::vector<Event*>*,
Types::ETreeType ); | |
| const std::vector<Event*>& GetEventCollection( Types::ETreeType type
= Types::kMaxTreeType ) const; | | const std::vector<Event*>& GetEventCollection( Types::ETreeType type
= Types::kMaxTreeType ) const; | |
| const TTree* GetEventCollectionAsTree(); | | const TTree* GetEventCollectionAsTree(); | |
| | | | |
| | | | |
| skipping to change at line 165 | | skipping to change at line 168 | |
| | | | |
| std::vector<Event*>::iterator fEvtCollIt; | | std::vector<Event*>::iterator fEvtCollIt; | |
| std::vector< std::vector<Event*>* > fEventCollection; //! list of ev
ents for training/testing/... | | std::vector< std::vector<Event*>* > fEventCollection; //! list of ev
ents for training/testing/... | |
| | | | |
| std::vector< std::map< TString, Results* > > fResults; //! [
train/test/...][method-identifier] | | std::vector< std::map< TString, Results* > > fResults; //! [
train/test/...][method-identifier] | |
| | | | |
| mutable UInt_t fCurrentTreeIdx; | | mutable UInt_t fCurrentTreeIdx; | |
| mutable Long64_t fCurrentEventIdx; | | mutable Long64_t fCurrentEventIdx; | |
| | | | |
| // event sampling | | // event sampling | |
|
| std::vector<Char_t> fSampling; // random or
importance sampling (not all events are taken) !! Bool_t are stored ( no v
ector<bool> taken for speed (performance) issues ) | | std::vector<Char_t> fSampling; // random or
importance sampling (not all events are taken) !! Bool_t are stored ( no s
td::vector<bool> taken for speed (performance) issues ) | |
| std::vector<Int_t> fSamplingNEvents; // number of
events which should be sampled | | std::vector<Int_t> fSamplingNEvents; // number of
events which should be sampled | |
| std::vector<Float_t> fSamplingWeight; // weight ch
ange factor [weight is indicating if sampling is random (1.0) or importance
(<1.0)] | | std::vector<Float_t> fSamplingWeight; // weight ch
ange factor [weight is indicating if sampling is random (1.0) or importance
(<1.0)] | |
| mutable std::vector< std::vector< std::pair< Float_t, Long64_t >* > >
fSamplingEventList; // weights and indices for sampling | | mutable std::vector< std::vector< std::pair< Float_t, Long64_t >* > >
fSamplingEventList; // weights and indices for sampling | |
| mutable std::vector< std::vector< std::pair< Float_t, Long64_t >* > >
fSamplingSelected; // selected events | | mutable std::vector< std::vector< std::pair< Float_t, Long64_t >* > >
fSamplingSelected; // selected events | |
| TRandom3 *fSamplingRandom; // random ge
nerator for sampling | | TRandom3 *fSamplingRandom; // random ge
nerator for sampling | |
| | | | |
| // further things | | // further things | |
| std::vector< std::vector<Long64_t> > fClassEvents; //! number o
f events of class 0,1,2,... in training[0] | | std::vector< std::vector<Long64_t> > fClassEvents; //! number o
f events of class 0,1,2,... in training[0] | |
| // and testi
ng[1] (+validation, trainingoriginal) | | // and testi
ng[1] (+validation, trainingoriginal) | |
| | | | |
| Bool_t fHasNegativeEventWeights; // true if a
t least one signal or bkg event has negative weight | | Bool_t fHasNegativeEventWeights; // true if a
t least one signal or bkg event has negative weight | |
| | | | |
| mutable MsgLogger* fLogger; // message logger | | mutable MsgLogger* fLogger; // message logger | |
| MsgLogger& Log() const { return *fLogger; } | | MsgLogger& Log() const { return *fLogger; } | |
| std::vector<Char_t> fBlockBelongToTraining; // when divi
ding the dataset to blocks, sets whether | | std::vector<Char_t> fBlockBelongToTraining; // when divi
ding the dataset to blocks, sets whether | |
| // the certa
in block is in the Training set or else | | // the certa
in block is in the Training set or else | |
| // in the va
lidation set | | // in the va
lidation set | |
|
| // boolean a
re stored, taken vector<Char_t> for performance reasons (instead of vector<
Bool_t>) | | // boolean a
re stored, taken std::vector<Char_t> for performance reasons (instead of st
d::vector<Bool_t>) | |
| Long64_t fTrainingBlockSize; // block siz
e into which the training dataset is divided | | Long64_t fTrainingBlockSize; // block siz
e into which the training dataset is divided | |
| | | | |
| void ApplyTrainingBlockDivision(); | | void ApplyTrainingBlockDivision(); | |
| void ApplyTrainingSetDivision(); | | void ApplyTrainingSetDivision(); | |
| }; | | }; | |
| } | | } | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
| inline UInt_t TMVA::DataSet::TreeIndex(Types::ETreeType type) const | | inline UInt_t TMVA::DataSet::TreeIndex(Types::ETreeType type) const | |
| { | | { | |
| | | | |
End of changes. 5 change blocks. |
| 23 lines changed or deleted | | 26 lines changed or added | |
|
| DataSetFactory.h | | DataSetFactory.h | |
| | | | |
| skipping to change at line 103 | | skipping to change at line 103 | |
| return fRandom.Integer(n); | | return fRandom.Integer(n); | |
| } | | } | |
| private: | | private: | |
| TRandom3 fRandom; // random generator | | TRandom3 fRandom; // random generator | |
| }; | | }; | |
| | | | |
| // delete-functor (to be used in e.g. for_each algorithm) | | // delete-functor (to be used in e.g. for_each algorithm) | |
| template<class T> | | template<class T> | |
| struct DeleteFunctor_t | | struct DeleteFunctor_t | |
| { | | { | |
|
| DeleteFunctor_t& operator()(T* p) { | | DeleteFunctor_t& operator()(const T* p) { | |
| delete p; | | delete p; | |
| return *this; | | return *this; | |
| } | | } | |
| }; | | }; | |
| | | | |
| template<class T> | | template<class T> | |
|
| DeleteFunctor_t<T> DeleteFunctor() | | DeleteFunctor_t<const T> DeleteFunctor() | |
| { | | { | |
|
| return DeleteFunctor_t<T>(); | | return DeleteFunctor_t<const T>(); | |
| } | | } | |
| | | | |
| template< typename T > | | template< typename T > | |
| class Increment { | | class Increment { | |
| T value; | | T value; | |
| public: | | public: | |
| Increment( T start ) : value( start ){ } | | Increment( T start ) : value( start ){ } | |
| T operator()() { | | T operator()() { | |
| return value++; | | return value++; | |
| } | | } | |
| | | | |
| skipping to change at line 198 | | skipping to change at line 198 | |
| inline compose_unary_t<F,G> compose_unary(const F& _f, const G& _g) { | | inline compose_unary_t<F,G> compose_unary(const F& _f, const G& _g) { | |
| return compose_unary_t<F,G>(_f,_g); | | return compose_unary_t<F,G>(_f,_g); | |
| } | | } | |
| | | | |
| // =============== functors ======================= | | // =============== functors ======================= | |
| | | | |
| // ========================================================= | | // ========================================================= | |
| | | | |
| class DataSetFactory { | | class DataSetFactory { | |
| | | | |
|
| typedef std::vector< Event* > EventVector
; | | typedef std::vector<Event* > EventVector; | |
| typedef std::vector< EventVector > EventVector
OfClasses; | | typedef std::vector< EventVector > EventVector
OfClasses; | |
| typedef std::map<Types::ETreeType, EventVectorOfClasses > EventVector
OfClassesOfTreeType; | | typedef std::map<Types::ETreeType, EventVectorOfClasses > EventVector
OfClassesOfTreeType; | |
| typedef std::map<Types::ETreeType, EventVector > EventVector
OfTreeType; | | typedef std::map<Types::ETreeType, EventVector > EventVector
OfTreeType; | |
| | | | |
| typedef std::vector< Double_t > ValuePerClass; | | typedef std::vector< Double_t > ValuePerClass; | |
| typedef std::map<Types::ETreeType, ValuePerClass > ValuePerClassOfTre
eType; | | typedef std::map<Types::ETreeType, ValuePerClass > ValuePerClassOfTre
eType; | |
| | | | |
| class EventStats { | | class EventStats { | |
| public: | | public: | |
| Int_t nTrainingEventsRequested; | | Int_t nTrainingEventsRequested; | |
| | | | |
| skipping to change at line 299 | | skipping to change at line 299 | |
| | | | |
| // verbosity | | // verbosity | |
| Bool_t Verbose() { return fVerbose; } | | Bool_t Verbose() { return fVerbose; } | |
| | | | |
| // data members | | // data members | |
| | | | |
| // verbosity | | // verbosity | |
| Bool_t fVerbose; //! Verbosity | | Bool_t fVerbose; //! Verbosity | |
| TString fVerboseLevel; //! VerboseLevel | | TString fVerboseLevel; //! VerboseLevel | |
| | | | |
|
| | | Bool_t fScaleWithPreselEff; //! how to deal with | |
| | | requested #events in connection with preselection cuts | |
| | | | |
| // the event | | // the event | |
| mutable TTree* fCurrentTree; //! the tree, events a
re currently read from | | mutable TTree* fCurrentTree; //! the tree, events a
re currently read from | |
| mutable UInt_t fCurrentEvtIdx; //! the current event
(to avoid reading of the same event) | | mutable UInt_t fCurrentEvtIdx; //! the current event
(to avoid reading of the same event) | |
| | | | |
| // the formulas for reading the original tree | | // the formulas for reading the original tree | |
| std::vector<TTreeFormula*> fInputFormulas; //! input variables | | std::vector<TTreeFormula*> fInputFormulas; //! input variables | |
| std::vector<TTreeFormula*> fTargetFormulas; //! targets | | std::vector<TTreeFormula*> fTargetFormulas; //! targets | |
| std::vector<TTreeFormula*> fCutFormulas; //! cuts | | std::vector<TTreeFormula*> fCutFormulas; //! cuts | |
| std::vector<TTreeFormula*> fWeightFormula; //! weights | | std::vector<TTreeFormula*> fWeightFormula; //! weights | |
| std::vector<TTreeFormula*> fSpectatorFormulas; //! spectators | | std::vector<TTreeFormula*> fSpectatorFormulas; //! spectators | |
| | | | |
End of changes. 5 change blocks. |
| 4 lines changed or deleted | | 7 lines changed or added | |
|
| DataSetInfo.h | | DataSetInfo.h | |
| | | | |
| skipping to change at line 134 | | skipping to change at line 134 | |
| VariableInfo& GetSpectatorInfo( Int_t i ) { return
fSpectators.at(i); } | | VariableInfo& GetSpectatorInfo( Int_t i ) { return
fSpectators.at(i); } | |
| const VariableInfo& GetSpectatorInfo( Int_t i ) const {
return fSpectators.at(i); } | | const VariableInfo& GetSpectatorInfo( Int_t i ) const {
return fSpectators.at(i); } | |
| | | | |
| UInt_t GetNVariables() const { return fV
ariables.size(); } | | UInt_t GetNVariables() const { return fV
ariables.size(); } | |
| UInt_t GetNTargets() const { return fT
argets.size(); } | | UInt_t GetNTargets() const { return fT
argets.size(); } | |
| UInt_t GetNSpectators(bool all=kTRUE) con
st; | | UInt_t GetNSpectators(bool all=kTRUE) con
st; | |
| | | | |
| const TString& GetNormalization() const { return fN
ormalization; } | | const TString& GetNormalization() const { return fN
ormalization; } | |
| void SetNormalization( const TString& nor
m ) { fNormalization = norm; } | | void SetNormalization( const TString& nor
m ) { fNormalization = norm; } | |
| | | | |
|
| | | void SetTrainingSumSignalWeights(Double_t trainingSumSignalWeights){f | |
| | | TrainingSumSignalWeights = trainingSumSignalWeights;} | |
| | | void SetTrainingSumBackgrWeights(Double_t trainingSumBackgrWeights){f | |
| | | TrainingSumBackgrWeights = trainingSumBackgrWeights;} | |
| | | void SetTestingSumSignalWeights (Double_t testingSumSignalWeights ){f | |
| | | TestingSumSignalWeights = testingSumSignalWeights ;} | |
| | | void SetTestingSumBackgrWeights (Double_t testingSumBackgrWeights ){f | |
| | | TestingSumBackgrWeights = testingSumBackgrWeights ;} | |
| | | | |
| | | Double_t GetTrainingSumSignalWeights(); | |
| | | Double_t GetTrainingSumBackgrWeights(); | |
| | | Double_t GetTestingSumSignalWeights (); | |
| | | Double_t GetTestingSumBackgrWeights (); | |
| | | | |
| // classification information | | // classification information | |
| Int_t GetClassNameMaxLength() const; | | Int_t GetClassNameMaxLength() const; | |
| ClassInfo* GetClassInfo( Int_t clNum ) const; | | ClassInfo* GetClassInfo( Int_t clNum ) const; | |
| ClassInfo* GetClassInfo( const TString& name ) const; | | ClassInfo* GetClassInfo( const TString& name ) const; | |
| void PrintClasses() const; | | void PrintClasses() const; | |
| UInt_t GetNClasses() const { return fClasses.size(); } | | UInt_t GetNClasses() const { return fClasses.size(); } | |
| Bool_t IsSignal( const Event* ev ) const; | | Bool_t IsSignal( const Event* ev ) const; | |
| std::vector<Float_t>* GetTargetsForMulticlass( const Event* ev ); | | std::vector<Float_t>* GetTargetsForMulticlass( const Event* ev ); | |
|
| | | UInt_t GetSignalClassIndex(){return fSignalClass;} | |
| | | | |
| // by variable | | // by variable | |
| Int_t FindVarIndex( const TString& ) const; | | Int_t FindVarIndex( const TString& ) const; | |
| | | | |
| // weights | | // weights | |
| const TString GetWeightExpression(Int_t i) const { return G
etClassInfo(i)->GetWeight(); } | | const TString GetWeightExpression(Int_t i) const { return G
etClassInfo(i)->GetWeight(); } | |
| void SetWeightExpression( const TString& exp, const TSt
ring& className = "" ); | | void SetWeightExpression( const TString& exp, const TSt
ring& className = "" ); | |
| | | | |
| // cuts | | // cuts | |
| const TCut& GetCut (Int_t i) const { r
eturn GetClassInfo(i)->GetCut(); } | | const TCut& GetCut (Int_t i) const { r
eturn GetClassInfo(i)->GetCut(); } | |
| | | | |
| skipping to change at line 203 | | skipping to change at line 214 | |
| std::vector<VariableInfo> fVariables; //! list of variable e
xpressions/internal names | | std::vector<VariableInfo> fVariables; //! list of variable e
xpressions/internal names | |
| std::vector<VariableInfo> fTargets; //! list of targets ex
pressions/internal names | | std::vector<VariableInfo> fTargets; //! list of targets ex
pressions/internal names | |
| std::vector<VariableInfo> fSpectators; //! list of spectato
rs expressions/internal names | | std::vector<VariableInfo> fSpectators; //! list of spectato
rs expressions/internal names | |
| | | | |
| // the classes | | // the classes | |
| mutable std::vector<ClassInfo*> fClasses; //! name and other inf
os of the classes | | mutable std::vector<ClassInfo*> fClasses; //! name and other inf
os of the classes | |
| | | | |
| TString fNormalization; //! | | TString fNormalization; //! | |
| TString fSplitOptions; //! | | TString fSplitOptions; //! | |
| | | | |
|
| | | Double_t fTrainingSumSignalWeights; | |
| | | Double_t fTrainingSumBackgrWeights; | |
| | | Double_t fTestingSumSignalWeights ; | |
| | | Double_t fTestingSumBackgrWeights ; | |
| | | | |
| TDirectory* fOwnRootDir; //! ROOT output dir | | TDirectory* fOwnRootDir; //! ROOT output dir | |
| Bool_t fVerbose; //! Verbosity | | Bool_t fVerbose; //! Verbosity | |
| | | | |
| UInt_t fSignalClass; //! index of the class
with the name signal | | UInt_t fSignalClass; //! index of the class
with the name signal | |
| | | | |
| std::vector<Float_t>* fTargetsForMulticlass; //! all targe
ts 0 except the one with index==classNumber | | std::vector<Float_t>* fTargetsForMulticlass; //! all targe
ts 0 except the one with index==classNumber | |
| | | | |
| mutable MsgLogger* fLogger; //! message logger | | mutable MsgLogger* fLogger; //! message logger | |
| MsgLogger& Log() const { return *fLogger; } | | MsgLogger& Log() const { return *fLogger; } | |
| | | | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 20 lines changed or added | |
|
| DecisionTree.h | | DecisionTree.h | |
| | | | |
| skipping to change at line 81 | | skipping to change at line 81 | |
| | | | |
| class DecisionTree : public BinaryTree { | | class DecisionTree : public BinaryTree { | |
| | | | |
| private: | | private: | |
| | | | |
| static const Int_t fgRandomSeed; // set nonzero for debugging and zer
o for random seeds | | static const Int_t fgRandomSeed; // set nonzero for debugging and zer
o for random seeds | |
| | | | |
| public: | | public: | |
| | | | |
| typedef std::vector<TMVA::Event*> EventList; | | typedef std::vector<TMVA::Event*> EventList; | |
|
| | | typedef std::vector<const TMVA::Event*> EventConstList; | |
| | | | |
| // the constructur needed for the "reading" of the decision tree from
weight files | | // the constructur needed for the "reading" of the decision tree from
weight files | |
| DecisionTree( void ); | | DecisionTree( void ); | |
| | | | |
| // the constructur needed for constructing the decision tree via trai
ning with events | | // the constructur needed for constructing the decision tree via trai
ning with events | |
|
| DecisionTree( SeparationBase *sepType, Int_t minSize, | | DecisionTree( SeparationBase *sepType, Float_t minSize, | |
| Int_t nCuts, | | Int_t nCuts, | |
| UInt_t cls =0, | | UInt_t cls =0, | |
| Bool_t randomisedTree=kFALSE, Int_t useNvars=0, Bool_t
usePoissonNvars=kFALSE, | | Bool_t randomisedTree=kFALSE, Int_t useNvars=0, Bool_t
usePoissonNvars=kFALSE, | |
|
| UInt_t nNodesMax=999999, UInt_t nMaxDepth=9999999, | | UInt_t nMaxDepth=9999999, | |
| Int_t iSeed=fgRandomSeed, Float_t purityLimit=0.5, | | Int_t iSeed=fgRandomSeed, Float_t purityLimit=0.5, | |
| Int_t treeID = 0); | | Int_t treeID = 0); | |
| | | | |
| // copy constructor | | // copy constructor | |
| DecisionTree (const DecisionTree &d); | | DecisionTree (const DecisionTree &d); | |
| | | | |
| virtual ~DecisionTree( void ); | | virtual ~DecisionTree( void ); | |
| | | | |
| // Retrieves the address of the root node | | // Retrieves the address of the root node | |
| virtual DecisionTreeNode* GetRoot() const { return dynamic_cast<TMVA:
:DecisionTreeNode*>(fRoot); } | | virtual DecisionTreeNode* GetRoot() const { return dynamic_cast<TMVA:
:DecisionTreeNode*>(fRoot); } | |
| virtual DecisionTreeNode * CreateNode(UInt_t) const { return new Deci
sionTreeNode(); } | | virtual DecisionTreeNode * CreateNode(UInt_t) const { return new Deci
sionTreeNode(); } | |
| virtual BinaryTree* CreateTree() const { return new DecisionTree(); } | | virtual BinaryTree* CreateTree() const { return new DecisionTree(); } | |
| static DecisionTree* CreateFromXML(void* node, UInt_t tmva_Version_C
ode = TMVA_VERSION_CODE); | | static DecisionTree* CreateFromXML(void* node, UInt_t tmva_Version_C
ode = TMVA_VERSION_CODE); | |
| virtual const char* ClassName() const { return "DecisionTree"; } | | virtual const char* ClassName() const { return "DecisionTree"; } | |
| | | | |
| // building of a tree by recursivly splitting the nodes | | // building of a tree by recursivly splitting the nodes | |
| | | | |
|
| UInt_t BuildTree( const EventList & eventSample, | | // UInt_t BuildTree( const EventList & eventSample, | |
| | | // DecisionTreeNode *node = NULL); | |
| | | UInt_t BuildTree( const EventConstList & eventSample, | |
| DecisionTreeNode *node = NULL); | | DecisionTreeNode *node = NULL); | |
| // determine the way how a node is split (which variable, which cut v
alue) | | // determine the way how a node is split (which variable, which cut v
alue) | |
| | | | |
|
| Double_t TrainNode( const EventList & eventSample, DecisionTreeNode | | Double_t TrainNode( const EventConstList & eventSample, DecisionTree | |
| *node ) { return TrainNodeFast( eventSample, node ); } | | Node *node ) { return TrainNodeFast( eventSample, node ); } | |
| Double_t TrainNodeFast( const EventList & eventSample, DecisionTreeN | | Double_t TrainNodeFast( const EventConstList & eventSample, Decision | |
| ode *node ); | | TreeNode *node ); | |
| Double_t TrainNodeFull( const EventList & eventSample, DecisionTreeN | | Double_t TrainNodeFull( const EventConstList & eventSample, Decision | |
| ode *node ); | | TreeNode *node ); | |
| void GetRandomisedVariables(Bool_t *useVariable, UInt_t *variableM
ap, UInt_t & nVars); | | void GetRandomisedVariables(Bool_t *useVariable, UInt_t *variableM
ap, UInt_t & nVars); | |
|
| std::vector<Double_t> GetFisherCoefficients(const EventList &eventSa
mple, UInt_t nFisherVars, UInt_t *mapVarInFisher); | | std::vector<Double_t> GetFisherCoefficients(const EventConstList &ev
entSample, UInt_t nFisherVars, UInt_t *mapVarInFisher); | |
| | | | |
| // fill at tree with a given structure already (just see how many sig
na/bkgr | | // fill at tree with a given structure already (just see how many sig
na/bkgr | |
| // events end up in each node | | // events end up in each node | |
| | | | |
|
| void FillTree( EventList & eventSample); | | void FillTree( const EventList & eventSample); | |
| | | | |
| // fill the existing the decision tree structure by filling event | | // fill the existing the decision tree structure by filling event | |
| // in from the top node and see where they happen to end up | | // in from the top node and see where they happen to end up | |
|
| void FillEvent( TMVA::Event & event, | | void FillEvent( const TMVA::Event & event, | |
| TMVA::DecisionTreeNode *node ); | | TMVA::DecisionTreeNode *node ); | |
| | | | |
| // returns: 1 = Signal (right), -1 = Bkg (left) | | // returns: 1 = Signal (right), -1 = Bkg (left) | |
| | | | |
|
| Double_t CheckEvent( const TMVA::Event & , Bool_t UseYesNoLeaf = kFAL
SE ) const; | | Double_t CheckEvent( const TMVA::Event * , Bool_t UseYesNoLeaf = kFAL
SE ) const; | |
| TMVA::DecisionTreeNode* GetEventNode(const TMVA::Event & e) const; | | TMVA::DecisionTreeNode* GetEventNode(const TMVA::Event & e) const; | |
| | | | |
| // return the individual relative variable importance | | // return the individual relative variable importance | |
| std::vector< Double_t > GetVariableImportance(); | | std::vector< Double_t > GetVariableImportance(); | |
| | | | |
| Double_t GetVariableImportance(UInt_t ivar); | | Double_t GetVariableImportance(UInt_t ivar); | |
| | | | |
| // clear the tree nodes (their S/N, Nevents etc), just keep the struc
ture of the tree | | // clear the tree nodes (their S/N, Nevents etc), just keep the struc
ture of the tree | |
| | | | |
| void ClearTree(); | | void ClearTree(); | |
| | | | |
| // set pruning method | | // set pruning method | |
| enum EPruneMethod { kExpectedErrorPruning=0, kCostComplexityPruning,
kNoPruning }; | | enum EPruneMethod { kExpectedErrorPruning=0, kCostComplexityPruning,
kNoPruning }; | |
| void SetPruneMethod( EPruneMethod m = kCostComplexityPruning ) { fPru
neMethod = m; } | | void SetPruneMethod( EPruneMethod m = kCostComplexityPruning ) { fPru
neMethod = m; } | |
| | | | |
| // recursive pruning of the tree, validation sample required for auto
matic pruning | | // recursive pruning of the tree, validation sample required for auto
matic pruning | |
|
| Double_t PruneTree( EventList* validationSample = NULL ); | | Double_t PruneTree( const EventConstList* validationSample = NULL ); | |
| | | | |
| // manage the pruning strength parameter (iff < 0 -> automate the pru
ning process) | | // manage the pruning strength parameter (iff < 0 -> automate the pru
ning process) | |
| void SetPruneStrength( Double_t p ) { fPruneStrength = p; } | | void SetPruneStrength( Double_t p ) { fPruneStrength = p; } | |
| Double_t GetPruneStrength( ) const { return fPruneStrength; } | | Double_t GetPruneStrength( ) const { return fPruneStrength; } | |
| | | | |
| // apply pruning validation sample to a decision tree | | // apply pruning validation sample to a decision tree | |
|
| void ApplyValidationSample( const EventList* validationSample ) const
; | | void ApplyValidationSample( const EventConstList* validationSample )
const; | |
| | | | |
| // return the misclassification rate of a pruned tree | | // return the misclassification rate of a pruned tree | |
| Double_t TestPrunedTreeQuality( const DecisionTreeNode* dt = NULL, In
t_t mode=0 ) const; | | Double_t TestPrunedTreeQuality( const DecisionTreeNode* dt = NULL, In
t_t mode=0 ) const; | |
| | | | |
| // pass a single validation event throught a pruned decision tree | | // pass a single validation event throught a pruned decision tree | |
|
| void CheckEventWithPrunedTree( const TMVA::Event& ) const; | | void CheckEventWithPrunedTree( const TMVA::Event* ) const; | |
| | | | |
| // calculate the normalization factor for a pruning validation sample | | // calculate the normalization factor for a pruning validation sample | |
|
| Double_t GetSumWeights( const EventList* validationSample ) const; | | Double_t GetSumWeights( const EventConstList* validationSample ) cons
t; | |
| | | | |
| void SetNodePurityLimit( Double_t p ) { fNodePurityLimit = p; } | | void SetNodePurityLimit( Double_t p ) { fNodePurityLimit = p; } | |
| Double_t GetNodePurityLimit( ) const { return fNodePurityLimit; } | | Double_t GetNodePurityLimit( ) const { return fNodePurityLimit; } | |
| | | | |
| void DescendTree( Node *n = NULL ); | | void DescendTree( Node *n = NULL ); | |
| void SetParentTreeInNodes( Node *n = NULL ); | | void SetParentTreeInNodes( Node *n = NULL ); | |
| | | | |
| // retrieve node from the tree. Its position (up to a maximal tree de
pth of 64) | | // retrieve node from the tree. Its position (up to a maximal tree de
pth of 64) | |
| // is coded as a sequence of left-right moves starting from the root,
coded as | | // is coded as a sequence of left-right moves starting from the root,
coded as | |
| // 0-1 bit patterns stored in the "long-integer" together with the de
pth | | // 0-1 bit patterns stored in the "long-integer" together with the de
pth | |
| Node* GetNode( ULong_t sequence, UInt_t depth ); | | Node* GetNode( ULong_t sequence, UInt_t depth ); | |
| | | | |
| UInt_t CleanTree(DecisionTreeNode *node=NULL); | | UInt_t CleanTree(DecisionTreeNode *node=NULL); | |
| | | | |
| void PruneNode(TMVA::DecisionTreeNode *node); | | void PruneNode(TMVA::DecisionTreeNode *node); | |
| | | | |
| // prune a node from the tree without deleting its descendants; allow
s one to | | // prune a node from the tree without deleting its descendants; allow
s one to | |
| // effectively prune a tree many times without making deep copies | | // effectively prune a tree many times without making deep copies | |
| void PruneNodeInPlace( TMVA::DecisionTreeNode* node ); | | void PruneNodeInPlace( TMVA::DecisionTreeNode* node ); | |
| | | | |
|
| | | Int_t GetNNodesBeforePruning(){return (fNNodesBeforePruning)?fNNodesB | |
| | | eforePruning:fNNodesBeforePruning=GetNNodes();} | |
| | | | |
| UInt_t CountLeafNodes(TMVA::Node *n = NULL); | | UInt_t CountLeafNodes(TMVA::Node *n = NULL); | |
| | | | |
| void SetTreeID(Int_t treeID){fTreeID = treeID;}; | | void SetTreeID(Int_t treeID){fTreeID = treeID;}; | |
| Int_t GetTreeID(){return fTreeID;}; | | Int_t GetTreeID(){return fTreeID;}; | |
| | | | |
| Bool_t DoRegression() const { return fAnalysisType == Types::kRegress
ion; } | | Bool_t DoRegression() const { return fAnalysisType == Types::kRegress
ion; } | |
| void SetAnalysisType (Types::EAnalysisType t) { fAnalysisType = t;} | | void SetAnalysisType (Types::EAnalysisType t) { fAnalysisType = t;} | |
| Types::EAnalysisType GetAnalysisType ( void ) { return fAnalysisType;
} | | Types::EAnalysisType GetAnalysisType ( void ) { return fAnalysisType;
} | |
| inline void SetUseFisherCuts(Bool_t t=kTRUE) { fUseFisherCuts = t;} | | inline void SetUseFisherCuts(Bool_t t=kTRUE) { fUseFisherCuts = t;} | |
| inline void SetMinLinCorrForFisher(Double_t min){fMinLinCorrForFisher
= min;} | | inline void SetMinLinCorrForFisher(Double_t min){fMinLinCorrForFisher
= min;} | |
| inline void SetUseExclusiveVars(Bool_t t=kTRUE){fUseExclusiveVars = t
;} | | inline void SetUseExclusiveVars(Bool_t t=kTRUE){fUseExclusiveVars = t
;} | |
|
| inline void SetPairNegWeightsInNode(){fPairNegWeightsInNode=kTRUE;} | | inline void SetNVars(Int_t n){fNvars = n;} | |
| | | | |
| private: | | private: | |
| // utility functions | | // utility functions | |
| | | | |
| // calculate the Purity out of the number of sig and bkg events colle
cted | | // calculate the Purity out of the number of sig and bkg events colle
cted | |
| // from individual samples. | | // from individual samples. | |
| | | | |
| // calculates the purity S/(S+B) of a given event sample | | // calculates the purity S/(S+B) of a given event sample | |
| Double_t SamplePurity(EventList eventSample); | | Double_t SamplePurity(EventList eventSample); | |
| | | | |
| UInt_t fNvars; // number of variables used to separate S
and B | | UInt_t fNvars; // number of variables used to separate S
and B | |
| Int_t fNCuts; // number of grid point in variable cut sc
ans | | Int_t fNCuts; // number of grid point in variable cut sc
ans | |
| Bool_t fUseFisherCuts; // use multivariate splits using the Fishe
r criterium | | Bool_t fUseFisherCuts; // use multivariate splits using the Fishe
r criterium | |
| Double_t fMinLinCorrForFisher; // the minimum linear correlation bet
ween two variables demanded for use in fisher criterium in node splitting | | Double_t fMinLinCorrForFisher; // the minimum linear correlation bet
ween two variables demanded for use in fisher criterium in node splitting | |
| Bool_t fUseExclusiveVars; // individual variables already used in
fisher criterium are not anymore analysed individually for node splitting | | Bool_t fUseExclusiveVars; // individual variables already used in
fisher criterium are not anymore analysed individually for node splitting | |
| | | | |
| SeparationBase *fSepType; // the separation crition | | SeparationBase *fSepType; // the separation crition | |
| RegressionVariance *fRegType; // the separation crition used in Regr
ession | | RegressionVariance *fRegType; // the separation crition used in Regr
ession | |
| | | | |
| Double_t fMinSize; // min number of events in node | | Double_t fMinSize; // min number of events in node | |
|
| | | Double_t fMinNodeSize; // min fraction of training events in node | |
| Double_t fMinSepGain; // min number of separation gain to perfor
m node splitting | | Double_t fMinSepGain; // min number of separation gain to perfor
m node splitting | |
| | | | |
| Bool_t fUseSearchTree; // cut scan done with binary trees or simp
le event loop. | | Bool_t fUseSearchTree; // cut scan done with binary trees or simp
le event loop. | |
| Double_t fPruneStrength; // a parameter to set the "amount" of prun
ing..needs to be adjusted | | Double_t fPruneStrength; // a parameter to set the "amount" of prun
ing..needs to be adjusted | |
| | | | |
| EPruneMethod fPruneMethod; // method used for prunig | | EPruneMethod fPruneMethod; // method used for prunig | |
|
| | | Int_t fNNodesBeforePruning; //remember this one (in case of prunin
g, it allows to monitor the before/after | |
| | | | |
| Double_t fNodePurityLimit;// purity limit to decide whether a node i
s signal | | Double_t fNodePurityLimit;// purity limit to decide whether a node i
s signal | |
| | | | |
| Bool_t fRandomisedTree; // choose at each node splitting a random
set of variables | | Bool_t fRandomisedTree; // choose at each node splitting a random
set of variables | |
| Int_t fUseNvars; // the number of variables used in randomi
sed trees; | | Int_t fUseNvars; // the number of variables used in randomi
sed trees; | |
| Bool_t fUsePoissonNvars; // use "fUseNvars" not as fixed number bu
t as mean of a possion distr. in each split | | Bool_t fUsePoissonNvars; // use "fUseNvars" not as fixed number bu
t as mean of a possion distr. in each split | |
| | | | |
| TRandom3 *fMyTrandom; // random number generator for randomised
trees | | TRandom3 *fMyTrandom; // random number generator for randomised
trees | |
| | | | |
| std::vector< Double_t > fVariableImportance; // the relative importan
ce of the different variables | | std::vector< Double_t > fVariableImportance; // the relative importan
ce of the different variables | |
| | | | |
|
| UInt_t fNNodesMax; // max # of nodes | | | |
| UInt_t fMaxDepth; // max depth | | UInt_t fMaxDepth; // max depth | |
| UInt_t fSigClass; // class which is treated as signal when b
uilding the tree | | UInt_t fSigClass; // class which is treated as signal when b
uilding the tree | |
|
| Bool_t fPairNegWeightsInNode; // randomly pair miscl. ev. with n
eg. and pos. weights in node and don't boost them | | | |
| static const Int_t fgDebugLevel = 0; // debug level determining
some printout/control plots etc. | | static const Int_t fgDebugLevel = 0; // debug level determining
some printout/control plots etc. | |
| Int_t fTreeID; // just an ID number given to the tree.. ma
kes debugging easier as tree knows who he is. | | Int_t fTreeID; // just an ID number given to the tree.. ma
kes debugging easier as tree knows who he is. | |
| | | | |
| Types::EAnalysisType fAnalysisType; // kClassification(=0=false) o
r kRegression(=1=true) | | Types::EAnalysisType fAnalysisType; // kClassification(=0=false) o
r kRegression(=1=true) | |
| | | | |
| ClassDef(DecisionTree,0) // implementation of a Decisio
n Tree | | ClassDef(DecisionTree,0) // implementation of a Decisio
n Tree | |
| }; | | }; | |
| | | | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| | | | |
End of changes. 19 change blocks. |
| 20 lines changed or deleted | | 26 lines changed or added | |
|
| DecisionTreeNode.h | | DecisionTreeNode.h | |
| | | | |
| skipping to change at line 66 | | skipping to change at line 66 | |
| public: | | public: | |
| DTNodeTrainingInfo():fSampleMin(), | | DTNodeTrainingInfo():fSampleMin(), | |
| fSampleMax(), | | fSampleMax(), | |
| fNodeR(0),fSubTreeR(0),fAlpha(0),fG(0),fNTermina
l(0), | | fNodeR(0),fSubTreeR(0),fAlpha(0),fG(0),fNTermina
l(0), | |
| fNB(0),fNS(0),fSumTarget(0),fSumTarget2(0),fCC(0
), | | fNB(0),fNS(0),fSumTarget(0),fSumTarget2(0),fCC(0
), | |
| fNSigEvents ( 0 ), fNBkgEvents ( 0 ), | | fNSigEvents ( 0 ), fNBkgEvents ( 0 ), | |
| fNEvents ( -1 ), | | fNEvents ( -1 ), | |
| fNSigEvents_unweighted ( 0 ), | | fNSigEvents_unweighted ( 0 ), | |
| fNBkgEvents_unweighted ( 0 ), | | fNBkgEvents_unweighted ( 0 ), | |
| fNEvents_unweighted ( 0 ), | | fNEvents_unweighted ( 0 ), | |
|
| | | fNSigEvents_unboosted ( 0 ), | |
| | | fNBkgEvents_unboosted ( 0 ), | |
| | | fNEvents_unboosted ( 0 ), | |
| fSeparationIndex (-1 ), | | fSeparationIndex (-1 ), | |
| fSeparationGain ( -1 ) | | fSeparationGain ( -1 ) | |
| { | | { | |
| } | | } | |
| std::vector< Float_t > fSampleMin; // the minima for each ivar of th
e sample on the node during training | | std::vector< Float_t > fSampleMin; // the minima for each ivar of th
e sample on the node during training | |
| std::vector< Float_t > fSampleMax; // the maxima for each ivar of th
e sample on the node during training | | std::vector< Float_t > fSampleMax; // the maxima for each ivar of th
e sample on the node during training | |
| Double_t fNodeR; // node resubstitution estimate, R(t) | | Double_t fNodeR; // node resubstitution estimate, R(t) | |
| Double_t fSubTreeR; // R(T) = Sum(R(t) : t in ~T) | | Double_t fSubTreeR; // R(T) = Sum(R(t) : t in ~T) | |
| Double_t fAlpha; // critical alpha for this node | | Double_t fAlpha; // critical alpha for this node | |
| Double_t fG; // minimum alpha in subtree rooted at this
node | | Double_t fG; // minimum alpha in subtree rooted at this
node | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 92 | |
| Float_t fSumTarget; // sum of weight*target used for the calc
ulatio of the variance (regression) | | Float_t fSumTarget; // sum of weight*target used for the calc
ulatio of the variance (regression) | |
| Float_t fSumTarget2; // sum of weight*target^2 used for the cal
culatio of the variance (regression) | | Float_t fSumTarget2; // sum of weight*target^2 used for the cal
culatio of the variance (regression) | |
| Double_t fCC; // debug variable for cost complexity pruning .. | | Double_t fCC; // debug variable for cost complexity pruning .. | |
| | | | |
| Float_t fNSigEvents; // sum of weights of signal event in the n
ode | | Float_t fNSigEvents; // sum of weights of signal event in the n
ode | |
| Float_t fNBkgEvents; // sum of weights of backgr event in the n
ode | | Float_t fNBkgEvents; // sum of weights of backgr event in the n
ode | |
| Float_t fNEvents; // number of events in that entered the no
de (during training) | | Float_t fNEvents; // number of events in that entered the no
de (during training) | |
| Float_t fNSigEvents_unweighted; // sum of signal event in the n
ode | | Float_t fNSigEvents_unweighted; // sum of signal event in the n
ode | |
| Float_t fNBkgEvents_unweighted; // sum of backgr event in the n
ode | | Float_t fNBkgEvents_unweighted; // sum of backgr event in the n
ode | |
| Float_t fNEvents_unweighted; // number of events in that ent
ered the node (during training) | | Float_t fNEvents_unweighted; // number of events in that ent
ered the node (during training) | |
|
| | | Float_t fNSigEvents_unboosted; // sum of signal event in the no | |
| | | de | |
| | | Float_t fNBkgEvents_unboosted; // sum of backgr event in the no | |
| | | de | |
| | | Float_t fNEvents_unboosted; // number of events in that ente | |
| | | red the node (during training) | |
| Float_t fSeparationIndex; // measure of "purity" (separation between
S and B) AT this node | | Float_t fSeparationIndex; // measure of "purity" (separation between
S and B) AT this node | |
| Float_t fSeparationGain; // measure of "purity", separation, or inf
ormation gained BY this nodes selection | | Float_t fSeparationGain; // measure of "purity", separation, or inf
ormation gained BY this nodes selection | |
| | | | |
| // copy constructor | | // copy constructor | |
| DTNodeTrainingInfo(const DTNodeTrainingInfo& n) : | | DTNodeTrainingInfo(const DTNodeTrainingInfo& n) : | |
| fSampleMin(),fSampleMax(), // Samplemin and max are reset in copy
constructor | | fSampleMin(),fSampleMax(), // Samplemin and max are reset in copy
constructor | |
| fNodeR(n.fNodeR), fSubTreeR(n.fSubTreeR), | | fNodeR(n.fNodeR), fSubTreeR(n.fSubTreeR), | |
| fAlpha(n.fAlpha), fG(n.fG), | | fAlpha(n.fAlpha), fG(n.fG), | |
| fNTerminal(n.fNTerminal), | | fNTerminal(n.fNTerminal), | |
| fNB(n.fNB), fNS(n.fNS), | | fNB(n.fNB), fNS(n.fNS), | |
| | | | |
| skipping to change at line 199 | | skipping to change at line 205 | |
| | | | |
| // set the sum of the unweighted signal events in the node | | // set the sum of the unweighted signal events in the node | |
| void SetNSigEvents_unweighted( Float_t s ) { fTrainInfo->fNSigEvents_
unweighted = s; } | | void SetNSigEvents_unweighted( Float_t s ) { fTrainInfo->fNSigEvents_
unweighted = s; } | |
| | | | |
| // set the sum of the unweighted backgr events in the node | | // set the sum of the unweighted backgr events in the node | |
| void SetNBkgEvents_unweighted( Float_t b ) { fTrainInfo->fNBkgEvents_
unweighted = b; } | | void SetNBkgEvents_unweighted( Float_t b ) { fTrainInfo->fNBkgEvents_
unweighted = b; } | |
| | | | |
| // set the number of unweighted events that entered the node (during
training) | | // set the number of unweighted events that entered the node (during
training) | |
| void SetNEvents_unweighted( Float_t nev ){ fTrainInfo->fNEvents_unwei
ghted =nev ; } | | void SetNEvents_unweighted( Float_t nev ){ fTrainInfo->fNEvents_unwei
ghted =nev ; } | |
| | | | |
|
| | | // set the sum of the unboosted signal events in the node | |
| | | void SetNSigEvents_unboosted( Float_t s ) { fTrainInfo->fNSigEvents_u | |
| | | nboosted = s; } | |
| | | | |
| | | // set the sum of the unboosted backgr events in the node | |
| | | void SetNBkgEvents_unboosted( Float_t b ) { fTrainInfo->fNBkgEvents_u | |
| | | nboosted = b; } | |
| | | | |
| | | // set the number of unboosted events that entered the node (during t | |
| | | raining) | |
| | | void SetNEvents_unboosted( Float_t nev ){ fTrainInfo->fNEvents_unboos | |
| | | ted =nev ; } | |
| | | | |
| // increment the sum of the signal weights in the node | | // increment the sum of the signal weights in the node | |
| void IncrementNSigEvents( Float_t s ) { fTrainInfo->fNSigEvents += s;
} | | void IncrementNSigEvents( Float_t s ) { fTrainInfo->fNSigEvents += s;
} | |
| | | | |
| // increment the sum of the backgr weights in the node | | // increment the sum of the backgr weights in the node | |
| void IncrementNBkgEvents( Float_t b ) { fTrainInfo->fNBkgEvents += b;
} | | void IncrementNBkgEvents( Float_t b ) { fTrainInfo->fNBkgEvents += b;
} | |
| | | | |
| // increment the number of events that entered the node (during train
ing) | | // increment the number of events that entered the node (during train
ing) | |
| void IncrementNEvents( Float_t nev ){ fTrainInfo->fNEvents +=nev ; } | | void IncrementNEvents( Float_t nev ){ fTrainInfo->fNEvents +=nev ; } | |
| | | | |
| // increment the sum of the signal weights in the node | | // increment the sum of the signal weights in the node | |
| | | | |
| skipping to change at line 235 | | skipping to change at line 250 | |
| | | | |
| // return the sum of unweighted signal weights in the node | | // return the sum of unweighted signal weights in the node | |
| Float_t GetNSigEvents_unweighted( void ) const { return fTrainInfo->
fNSigEvents_unweighted; } | | Float_t GetNSigEvents_unweighted( void ) const { return fTrainInfo->
fNSigEvents_unweighted; } | |
| | | | |
| // return the sum of unweighted backgr weights in the node | | // return the sum of unweighted backgr weights in the node | |
| Float_t GetNBkgEvents_unweighted( void ) const { return fTrainInfo->
fNBkgEvents_unweighted; } | | Float_t GetNBkgEvents_unweighted( void ) const { return fTrainInfo->
fNBkgEvents_unweighted; } | |
| | | | |
| // return the number of unweighted events that entered the node (dur
ing training) | | // return the number of unweighted events that entered the node (dur
ing training) | |
| Float_t GetNEvents_unweighted( void ) const { return fTrainInfo->fNE
vents_unweighted; } | | Float_t GetNEvents_unweighted( void ) const { return fTrainInfo->fNE
vents_unweighted; } | |
| | | | |
|
| // set the chosen index, measure of "purity" (separation between S an | | // return the sum of unboosted signal weights in the node | |
| d B) AT this node | | Float_t GetNSigEvents_unboosted( void ) const { return fTrainInfo->f | |
| | | NSigEvents_unboosted; } | |
| | | | |
| | | // return the sum of unboosted backgr weights in the node | |
| | | Float_t GetNBkgEvents_unboosted( void ) const { return fTrainInfo->f | |
| | | NBkgEvents_unboosted; } | |
| | | | |
| | | // return the number of unboosted events that entered the node (duri | |
| | | ng training) | |
| | | Float_t GetNEvents_unboosted( void ) const { return fTrainInfo->fNEv | |
| | | ents_unboosted; } | |
| | | | |
| | | // set the choosen index, measure of "purity" (separation between S a | |
| | | nd B) AT this node | |
| void SetSeparationIndex( Float_t sep ){ fTrainInfo->fSeparationIndex
=sep ; } | | void SetSeparationIndex( Float_t sep ){ fTrainInfo->fSeparationIndex
=sep ; } | |
| // return the separation index AT this node | | // return the separation index AT this node | |
| Float_t GetSeparationIndex( void ) const { return fTrainInfo->fSepar
ationIndex; } | | Float_t GetSeparationIndex( void ) const { return fTrainInfo->fSepar
ationIndex; } | |
| | | | |
| // set the separation, or information gained BY this nodes selection | | // set the separation, or information gained BY this nodes selection | |
| void SetSeparationGain( Float_t sep ){ fTrainInfo->fSeparationGain =s
ep ; } | | void SetSeparationGain( Float_t sep ){ fTrainInfo->fSeparationGain =s
ep ; } | |
| // return the gain in separation obtained by this nodes selection | | // return the gain in separation obtained by this nodes selection | |
| Float_t GetSeparationGain( void ) const { return fTrainInfo->fSepara
tionGain; } | | Float_t GetSeparationGain( void ) const { return fTrainInfo->fSepara
tionGain; } | |
| | | | |
| // printout of the node | | // printout of the node | |
|
| virtual void Print( ostream& os ) const; | | virtual void Print( std::ostream& os ) const; | |
| | | | |
| // recursively print the node and its daughters (--> print the 'tree'
) | | // recursively print the node and its daughters (--> print the 'tree'
) | |
|
| virtual void PrintRec( ostream& os ) const; | | virtual void PrintRec( std::ostream& os ) const; | |
| | | | |
| virtual void AddAttributesToNode(void* node) const; | | virtual void AddAttributesToNode(void* node) const; | |
| virtual void AddContentToNode(std::stringstream& s) const; | | virtual void AddContentToNode(std::stringstream& s) const; | |
| | | | |
| // recursively clear the nodes content (S/N etc, but not the cut crit
eria) | | // recursively clear the nodes content (S/N etc, but not the cut crit
eria) | |
| void ClearNodeAndAllDaughters(); | | void ClearNodeAndAllDaughters(); | |
| | | | |
| // get pointers to children, mother in the tree | | // get pointers to children, mother in the tree | |
| | | | |
| // return pointer to the left/right daughter or parent node | | // return pointer to the left/right daughter or parent node | |
| | | | |
| skipping to change at line 312 | | skipping to change at line 336 | |
| | | | |
| inline Float_t GetSumTarget() const {return fTrainInfo? fTrainInfo->
fSumTarget : -9999;} | | inline Float_t GetSumTarget() const {return fTrainInfo? fTrainInfo->
fSumTarget : -9999;} | |
| inline Float_t GetSumTarget2() const {return fTrainInfo? fTrainInfo->
fSumTarget2: -9999;} | | inline Float_t GetSumTarget2() const {return fTrainInfo? fTrainInfo->
fSumTarget2: -9999;} | |
| | | | |
| // reset the pruning validation data | | // reset the pruning validation data | |
| void ResetValidationData( ); | | void ResetValidationData( ); | |
| | | | |
| // flag indicates whether this node is terminal | | // flag indicates whether this node is terminal | |
| inline Bool_t IsTerminal() const { return fIsTerminalNode;
} | | inline Bool_t IsTerminal() const { return fIsTerminalNode;
} | |
| inline void SetTerminal( Bool_t s = kTRUE ) { fIsTerminalNode = s;
} | | inline void SetTerminal( Bool_t s = kTRUE ) { fIsTerminalNode = s;
} | |
|
| void PrintPrune( ostream& os ) const ; | | void PrintPrune( std::ostream& os ) const ; | |
| void PrintRecPrune( ostream& os ) const; | | void PrintRecPrune( std::ostream& os ) const; | |
| | | | |
| void SetCC(Double_t cc); | | void SetCC(Double_t cc); | |
| Double_t GetCC() const {return (fTrainInfo? fTrainInfo->fCC : -1.);} | | Double_t GetCC() const {return (fTrainInfo? fTrainInfo->fCC : -1.);} | |
| | | | |
| Float_t GetSampleMin(UInt_t ivar) const; | | Float_t GetSampleMin(UInt_t ivar) const; | |
| Float_t GetSampleMax(UInt_t ivar) const; | | Float_t GetSampleMax(UInt_t ivar) const; | |
| void SetSampleMin(UInt_t ivar, Float_t xmin); | | void SetSampleMin(UInt_t ivar, Float_t xmin); | |
| void SetSampleMax(UInt_t ivar, Float_t xmax); | | void SetSampleMax(UInt_t ivar, Float_t xmax); | |
| | | | |
| static bool fgIsTraining; // static variable to flag training phase i
n which we need fTrainInfo | | static bool fgIsTraining; // static variable to flag training phase i
n which we need fTrainInfo | |
| | | | |
| skipping to change at line 347 | | skipping to change at line 371 | |
| Int_t fNodeType; // Type of node: -1 == Bkg-leaf, 1 == Sign
al-leaf, 0 = internal | | Int_t fNodeType; // Type of node: -1 == Bkg-leaf, 1 == Sign
al-leaf, 0 = internal | |
| Float_t fPurity; // the node purity | | Float_t fPurity; // the node purity | |
| | | | |
| Bool_t fIsTerminalNode; //! flag to set node as terminal (i.e.,
without deleting its descendants) | | Bool_t fIsTerminalNode; //! flag to set node as terminal (i.e.,
without deleting its descendants) | |
| | | | |
| mutable DTNodeTrainingInfo* fTrainInfo; | | mutable DTNodeTrainingInfo* fTrainInfo; | |
| | | | |
| private: | | private: | |
| | | | |
| virtual void ReadAttributes(void* node, UInt_t tmva_Version_Code = TM
VA_VERSION_CODE ); | | virtual void ReadAttributes(void* node, UInt_t tmva_Version_Code = TM
VA_VERSION_CODE ); | |
|
| virtual Bool_t ReadDataRecord( istream& is, UInt_t tmva_Version_Code
= TMVA_VERSION_CODE ); | | virtual Bool_t ReadDataRecord( std::istream& is, UInt_t tmva_Version_
Code = TMVA_VERSION_CODE ); | |
| virtual void ReadContent(std::stringstream& s); | | virtual void ReadContent(std::stringstream& s); | |
| | | | |
| ClassDef(DecisionTreeNode,0) // Node for the Decision Tree | | ClassDef(DecisionTreeNode,0) // Node for the Decision Tree | |
| }; | | }; | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 8 change blocks. |
| 7 lines changed or deleted | | 42 lines changed or added | |
|
| Event.h | | Event.h | |
| | | | |
| skipping to change at line 77 | | skipping to change at line 77 | |
| UInt_t theClass = 0, Double_t weight = 1.0, Double_t
boostweight = 1.0 ); | | UInt_t theClass = 0, Double_t weight = 1.0, Double_t
boostweight = 1.0 ); | |
| explicit Event( const std::vector<Float_t>&, | | explicit Event( const std::vector<Float_t>&, | |
| UInt_t theClass, Double_t weight = 1.0, Double_t boos
tweight = 1.0 ); | | UInt_t theClass, Double_t weight = 1.0, Double_t boos
tweight = 1.0 ); | |
| explicit Event( const std::vector<Float_t*>*&, UInt_t nvar ); | | explicit Event( const std::vector<Float_t*>*&, UInt_t nvar ); | |
| | | | |
| ~Event(); | | ~Event(); | |
| | | | |
| // accessors | | // accessors | |
| Bool_t IsDynamic() const {return fDynamic; } | | Bool_t IsDynamic() const {return fDynamic; } | |
| | | | |
|
| Double_t GetWeight() const { return fWeight*fBoostWeight; } | | // Double_t GetWeight() const { return fWeight*fBoostWei | |
| | | ght; } | |
| | | Double_t GetWeight() const; | |
| Double_t GetOriginalWeight() const { return fWeight; } | | Double_t GetOriginalWeight() const { return fWeight; } | |
| Double_t GetBoostWeight() const { return TMath::Max(Double_t(0.000
1),fBoostWeight); } | | Double_t GetBoostWeight() const { return TMath::Max(Double_t(0.000
1),fBoostWeight); } | |
| UInt_t GetClass() const { return fClass; } | | UInt_t GetClass() const { return fClass; } | |
| | | | |
| UInt_t GetNVariables() const; | | UInt_t GetNVariables() const; | |
| UInt_t GetNTargets() const; | | UInt_t GetNTargets() const; | |
| UInt_t GetNSpectators() const; | | UInt_t GetNSpectators() const; | |
| | | | |
| Float_t GetValue( UInt_t ivar) const; | | Float_t GetValue( UInt_t ivar) const; | |
|
| | | std::vector<Float_t>& GetValues() | |
| | | { | |
| | | //For a detailed explanation, please see the heading "Avoid Duplic | |
| | | ation in const and Non-const Member Function," on p. 23, in Item 3 "Use con | |
| | | st whenever possible," in Effective C++, 3d ed by Scott Meyers, ISBN-13: 97 | |
| | | 80321334879. | |
| | | // http://stackoverflow.com/questions/123758/how-do-i-remove-code- | |
| | | duplication-between-similar-const-and-non-const-member-func | |
| | | return const_cast<std::vector<Float_t>&>( static_cast<const Event& | |
| | | >(*this).GetValues() ); | |
| | | } | |
| const std::vector<Float_t>& GetValues() const; | | const std::vector<Float_t>& GetValues() const; | |
| | | | |
| Float_t GetTarget( UInt_t itgt ) const { return fTargets.at(itgt); } | | Float_t GetTarget( UInt_t itgt ) const { return fTargets.at(itgt); } | |
|
| std::vector<Float_t>& GetTargets() const { return fTargets; } | | std::vector<Float_t>& GetTargets() { return fTargets; } | |
| | | const std::vector<Float_t>& GetTargets() const { return fTargets; } | |
| | | | |
| Float_t GetSpectator( UInt_t ivar) const; | | Float_t GetSpectator( UInt_t ivar) const; | |
|
| std::vector<Float_t>& GetSpectators() const { return fSpectators; } | | std::vector<Float_t>& GetSpectators() { return fSpectators; } | |
| | | const std::vector<Float_t>& GetSpectators() const { return fSpectator | |
| | | s; } | |
| | | | |
|
| void ScaleWeight ( Double_t s ) { fWeight*=s; } | | | |
| void SetWeight ( Double_t w ) { fWeight=w; } | | void SetWeight ( Double_t w ) { fWeight=w; } | |
|
| void SetBoostWeight ( Double_t w ) { fDoNotBoost ? fDoNotB | | void SetBoostWeight ( Double_t w ) const { fDoNotBoost ? f | |
| oost = kFALSE : fBoostWeight=w; } | | DoNotBoost = kFALSE : fBoostWeight=w; } | |
| void ScaleBoostWeight ( Double_t s ) { fDoNotBoost ? fDoNotB | | void ScaleBoostWeight ( Double_t s ) const { fDoNotBoost ? f | |
| oost = kFALSE : fBoostWeight *= s; } | | DoNotBoost = kFALSE : fBoostWeight *= s; } | |
| void SetClass ( UInt_t t ) { fClass=t; } | | void SetClass ( UInt_t t ) { fClass=t; } | |
| void SetVal ( UInt_t ivar, Float_t val ); | | void SetVal ( UInt_t ivar, Float_t val ); | |
| void SetTarget ( UInt_t itgt, Float_t value ); | | void SetTarget ( UInt_t itgt, Float_t value ); | |
| void SetSpectator ( UInt_t ivar, Float_t value ); | | void SetSpectator ( UInt_t ivar, Float_t value ); | |
| | | | |
|
| void SetDoNotBoost () { fDoNotBoost = kTRUE; } | | void SetDoNotBoost () const { fDoNotBoost = kTRUE; } | |
| static void ClearDynamicVariables() {} | | static void ClearDynamicVariables() {} | |
| | | | |
| void CopyVarValues( const Event& other ); | | void CopyVarValues( const Event& other ); | |
| void Print ( std::ostream & o ) const; | | void Print ( std::ostream & o ) const; | |
| | | | |
|
| | | static void SetIsTraining(Bool_t); | |
| | | static void SetIgnoreNegWeightsInTraining(Bool_t); | |
| private: | | private: | |
| | | | |
|
| mutable std::vector<Float_t> fValues; // the event values | | static Bool_t fgIsTraining; // mark if we are in an act | |
| | | ual training or "evaluation/testing" phase --> ignoreNegWeights only in act | |
| | | ual training ! | |
| | | static Bool_t fgIgnoreNegWeightsInTraining; | |
| | | | |
| | | mutable std::vector<Float_t> fValues; // the event values | |
| | | ; mutable, to be able to copy the dynamic values in there | |
| mutable std::vector<Float_t*>* fValuesDynamic; // the event values | | mutable std::vector<Float_t*>* fValuesDynamic; // the event values | |
|
| mutable std::vector<Float_t> fTargets; // target values for | | std::vector<Float_t> fTargets; // target values for regress | |
| regression | | ion | |
| mutable std::vector<Float_t> fSpectators; // "visisting" varia | | mutable std::vector<Float_t> fSpectators; // "visisting" varia | |
| bles not used in MVAs | | bles not used in MVAs ; mutable, to be able to copy the dynamic values in t | |
| | | here | |
| | | | |
| UInt_t fClass; // class number | | UInt_t fClass; // class number | |
| Double_t fWeight; // event weight (pro
duct of global and individual weights) | | Double_t fWeight; // event weight (pro
duct of global and individual weights) | |
|
| Double_t fBoostWeight; // internal weight t
o be set by boosting algorithm | | mutable Double_t fBoostWeight; // internal weight t
o be set by boosting algorithm | |
| Bool_t fDynamic; // is set when the d
ynamic values are taken | | Bool_t fDynamic; // is set when the d
ynamic values are taken | |
|
| Bool_t fDoNotBoost; // mark event as no
t to be boosted (used to compensate for events with negative event weights | | mutable Bool_t fDoNotBoost; // mark event as no
t to be boosted (used to compensate for events with negative event weights | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 16 lines changed or deleted | | 40 lines changed or added | |
|
| Interval.h | | Interval.h | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| | | | |
| #ifndef ROOT_TMVA_Interval | | #ifndef ROOT_TMVA_Interval | |
| #define ROOT_TMVA_Interval | | #define ROOT_TMVA_Interval | |
| | | | |
| ///////////////////////////////////////////////////////////////////////////
/// | | ///////////////////////////////////////////////////////////////////////////
/// | |
| //
// | | //
// | |
| // Interval
// | | // Interval
// | |
| //
// | | //
// | |
| // Interval definition, continuous and discrete
// | | // Interval definition, continuous and discrete
// | |
| //
// | | //
// | |
|
| // Interval(min,max) : a continuous interval [min,max]
// | | // Interval(min,max) : a continous interval [min,max]
// | |
| // Interval(min,max,n): a "discrete interval" [min,max], i.e the n numbers:
// | | // Interval(min,max,n): a "discrete interval" [min,max], i.e the n numbers:
// | |
| // min, min+step, min+2*step,...., min+(n-1)*step, min+n*step=max
// | | // min, min+step, min+2*step,...., min+(n-1)*step, min+n*step=max
// | |
| // e.g.: Interval(1,5,5)=1,2,3,4,5
// | | // e.g.: Interval(1,5,5)=1,2,3,4,5
// | |
| // Interval(.5,1.,6)= .5, .6., .7, .8, .9, 1.0
// | | // Interval(.5,1.,6)= .5, .6., .7, .8, .9, 1.0
// | |
| //
// | | //
// | |
| // Note: **bin** counting starts from ZERO unlike in ROOT histograms
// | | // Note: **bin** counting starts from ZERO unlike in ROOT histograms
// | |
| //
// | | //
// | |
| // Example: Interval(.5,1.,6)
// | | // Example: Interval(.5,1.,6)
// | |
| //
// | | //
// | |
| // [ min max ]
// | | // [ min max ]
// | |
| | | | |
| skipping to change at line 72 | | skipping to change at line 72 | |
| | | | |
| class Interval { | | class Interval { | |
| | | | |
| public: | | public: | |
| | | | |
| Interval( Double_t min, Double_t max, Int_t nbins = 0 ); | | Interval( Double_t min, Double_t max, Int_t nbins = 0 ); | |
| Interval( const Interval& other ); | | Interval( const Interval& other ); | |
| virtual ~Interval(); | | virtual ~Interval(); | |
| | | | |
| // accessors | | // accessors | |
|
| Double_t GetMin() const { return fMin; } | | // accessors | |
| Double_t GetMax() const { return fMax; } | | virtual Double_t GetMin() const { return fMin; } | |
| Double_t GetWidth() const { return fMax - fMin; } | | virtual Double_t GetMax() const { return fMax; } | |
| Int_t GetNbins() const { return fNbins; } | | virtual Double_t GetWidth() const; | |
| Double_t GetMean() const { return (fMax + fMin)/2; } | | virtual Int_t GetNbins() const { return fNbins; } | |
| Double_t GetRndm( TRandom3& ) const; | | virtual Double_t GetMean() const; | |
| Double_t GetElement( Int_t position ) const; | | virtual Double_t GetRndm( TRandom3& ) const; | |
| Double_t GetStepSize() const; | | virtual Double_t GetElement( Int_t position ) const; | |
| | | virtual Double_t GetStepSize(Int_t iBin=0) const; | |
| | | | |
| void SetMax( Double_t m ) { fMax = m; } | | void SetMax( Double_t m ) { fMax = m; } | |
| void SetMin( Double_t m ) { fMin = m; } | | void SetMin( Double_t m ) { fMin = m; } | |
| | | | |
|
| private: | | virtual void Print( std::ostream& os ) const; | |
| | | | |
| | | protected: | |
| | | | |
| Double_t fMin, fMax; // the constraints of the Interval | | Double_t fMin, fMax; // the constraints of the Interval | |
| Int_t fNbins; // when >0 : number of bins (discrete interva
l); when ==0 continuous interval | | Int_t fNbins; // when >0 : number of bins (discrete interva
l); when ==0 continuous interval | |
| | | | |
|
| | | private: | |
| static MsgLogger* fgLogger; // message logger | | static MsgLogger* fgLogger; // message logger | |
| MsgLogger& Log() const { return *fgLogger; } | | MsgLogger& Log() const { return *fgLogger; } | |
| | | | |
|
| ClassDef(Interval,0) // Interval definition, continuous and discre
te | | ClassDef(Interval,0) // Interval definition, continous and discret
e | |
| }; | | }; | |
| | | | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 11 lines changed or deleted | | 15 lines changed or added | |
|
| MethodANNBase.h | | MethodANNBase.h | |
| | | | |
| skipping to change at line 58 | | skipping to change at line 58 | |
| #include <vector> | | #include <vector> | |
| #ifndef ROOT_TTree | | #ifndef ROOT_TTree | |
| #include "TTree.h" | | #include "TTree.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TObjArray | | #ifndef ROOT_TObjArray | |
| #include "TObjArray.h" | | #include "TObjArray.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TRandom3 | | #ifndef ROOT_TRandom3 | |
| #include "TRandom3.h" | | #include "TRandom3.h" | |
| #endif | | #endif | |
|
| | | #ifndef ROOT_TMatrix | |
| | | #include "TMatrix.h" | |
| | | #endif | |
| | | | |
| #ifndef ROOT_TMVA_MethodBase | | #ifndef ROOT_TMVA_MethodBase | |
| #include "TMVA/MethodBase.h" | | #include "TMVA/MethodBase.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TMVA_TActivation | | #ifndef ROOT_TMVA_TActivation | |
| #include "TMVA/TActivation.h" | | #include "TMVA/TActivation.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TMVA_TNeuron | | #ifndef ROOT_TMVA_TNeuron | |
| #include "TMVA/TNeuron.h" | | #include "TMVA/TNeuron.h" | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 117 | |
| if (fInputCalculator != NULL) delete fInputCalculator; | | if (fInputCalculator != NULL) delete fInputCalculator; | |
| fInputCalculator = inputCalculator; | | fInputCalculator = inputCalculator; | |
| } | | } | |
| | | | |
| // this will have to be overridden by every subclass | | // this will have to be overridden by every subclass | |
| virtual void Train() = 0; | | virtual void Train() = 0; | |
| | | | |
| // print network, for debugging | | // print network, for debugging | |
| virtual void PrintNetwork() const; | | virtual void PrintNetwork() const; | |
| | | | |
|
| | | // call this function like that: | |
| | | // ... | |
| | | // MethodMLP* mlp = dynamic_cast<MethodMLP*>(method); | |
| | | // std::vector<float> layerValues; | |
| | | // mlp->GetLayerActivation (2, std::back_inserter(layerValues)); | |
| | | // ... do now something with the layerValues | |
| | | // | |
| | | template <typename WriteIterator> | |
| | | void GetLayerActivation (size_t layer, WriteIterator writeIterator); | |
| | | | |
| using MethodBase::ReadWeightsFromStream; | | using MethodBase::ReadWeightsFromStream; | |
| | | | |
| // write weights to file | | // write weights to file | |
| void AddWeightsXMLTo( void* parent ) const; | | void AddWeightsXMLTo( void* parent ) const; | |
| void ReadWeightsFromXML( void* wghtnode ); | | void ReadWeightsFromXML( void* wghtnode ); | |
| | | | |
| // read weights from file | | // read weights from file | |
|
| virtual void ReadWeightsFromStream( istream& istr ); | | virtual void ReadWeightsFromStream( std::istream& istr ); | |
| | | | |
| // calculate the MVA value | | // calculate the MVA value | |
| virtual Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper =
0 ); | | virtual Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper =
0 ); | |
| | | | |
| virtual const std::vector<Float_t> &GetRegressionValues(); | | virtual const std::vector<Float_t> &GetRegressionValues(); | |
| | | | |
| virtual const std::vector<Float_t> &GetMulticlassValues(); | | virtual const std::vector<Float_t> &GetMulticlassValues(); | |
| | | | |
| // write method specific histos to target file | | // write method specific histos to target file | |
| virtual void WriteMonitoringHistosToFile() const; | | virtual void WriteMonitoringHistosToFile() const; | |
| | | | |
| skipping to change at line 161 | | skipping to change at line 174 | |
| void ForceNetworkInputs( const Event* ev, Int_t ignoreIndex = -1
); | | void ForceNetworkInputs( const Event* ev, Int_t ignoreIndex = -1
); | |
| Double_t GetNetworkOutput() { return GetOutputNeuron()->GetActivation
Value(); } | | Double_t GetNetworkOutput() { return GetOutputNeuron()->GetActivation
Value(); } | |
| | | | |
| // debugging utilities | | // debugging utilities | |
| void PrintMessage( TString message, Bool_t force = kFALSE ) const
; | | void PrintMessage( TString message, Bool_t force = kFALSE ) const
; | |
| void ForceNetworkCalculations(); | | void ForceNetworkCalculations(); | |
| void WaitForKeyboard(); | | void WaitForKeyboard(); | |
| | | | |
| // accessors | | // accessors | |
| Int_t NumCycles() { return fNcycles; } | | Int_t NumCycles() { return fNcycles; } | |
|
| TNeuron* GetInputNeuron(Int_t index) { return (TNeuron*)fInputL | | TNeuron* GetInputNeuron (Int_t index) { return (TNeuron*)fInput | |
| ayer->At(index); } | | Layer->At(index); } | |
| TNeuron* GetOutputNeuron( Int_t index = 0) { return fOutputNeurons.at | | TNeuron* GetOutputNeuron(Int_t index = 0) { return fOutputNeurons.a | |
| (index); } | | t(index); } | |
| | | | |
| // protected variables | | // protected variables | |
| TObjArray* fNetwork; // TObjArray of TObjArrays representi
ng network | | TObjArray* fNetwork; // TObjArray of TObjArrays representi
ng network | |
| TObjArray* fSynapses; // array of pointers to synapses, no
structural data | | TObjArray* fSynapses; // array of pointers to synapses, no
structural data | |
| TActivation* fActivation; // activation function to be used for
hidden layers | | TActivation* fActivation; // activation function to be used for
hidden layers | |
| TActivation* fOutput; // activation function to be used for
output layers, depending on estimator | | TActivation* fOutput; // activation function to be used for
output layers, depending on estimator | |
| TActivation* fIdentity; // activation for input and output la
yers | | TActivation* fIdentity; // activation for input and output la
yers | |
| TRandom3* frgen; // random number generator for variou
s uses | | TRandom3* frgen; // random number generator for variou
s uses | |
| TNeuronInput* fInputCalculator; // input calculator for all neurons | | TNeuronInput* fInputCalculator; // input calculator for all neurons | |
| | | | |
| | | | |
| skipping to change at line 195 | | skipping to change at line 208 | |
| std::vector<TH1*> fEpochMonHistB; // epoch monitoring hitograms for b
ackground | | std::vector<TH1*> fEpochMonHistB; // epoch monitoring hitograms for b
ackground | |
| std::vector<TH1*> fEpochMonHistW; // epoch monitoring hitograms for w
eights | | std::vector<TH1*> fEpochMonHistW; // epoch monitoring hitograms for w
eights | |
| | | | |
| // general | | // general | |
| TMatrixD fInvHessian; // zjh | | TMatrixD fInvHessian; // zjh | |
| bool fUseRegulator; // zjh | | bool fUseRegulator; // zjh | |
| | | | |
| protected: | | protected: | |
| Int_t fRandomSeed; // random seed for initial
synapse weights | | Int_t fRandomSeed; // random seed for initial
synapse weights | |
| | | | |
|
| | | Int_t fNcycles; // number of epochs to trai | |
| | | n | |
| | | | |
| | | TString fNeuronType; // name of neuron activatio | |
| | | n function class | |
| | | TString fNeuronInputType; // name of neuron input cal | |
| | | culator class | |
| | | | |
| private: | | private: | |
| | | | |
| // helper functions for building network | | // helper functions for building network | |
| void BuildLayers(std::vector<Int_t>* layout, Bool_t from_file = false
); | | void BuildLayers(std::vector<Int_t>* layout, Bool_t from_file = false
); | |
| void BuildLayer(Int_t numNeurons, TObjArray* curLayer, TObjArray* pre
vLayer, | | void BuildLayer(Int_t numNeurons, TObjArray* curLayer, TObjArray* pre
vLayer, | |
| Int_t layerIndex, Int_t numLayers, Bool_t from_file =
false); | | Int_t layerIndex, Int_t numLayers, Bool_t from_file =
false); | |
| void AddPreLinks(TNeuron* neuron, TObjArray* prevLayer); | | void AddPreLinks(TNeuron* neuron, TObjArray* prevLayer); | |
| | | | |
| // helper functions for weight initialization | | // helper functions for weight initialization | |
| void InitWeights(); | | void InitWeights(); | |
| | | | |
| skipping to change at line 216 | | skipping to change at line 234 | |
| | | | |
| // helper functions for deleting network | | // helper functions for deleting network | |
| void DeleteNetwork(); | | void DeleteNetwork(); | |
| void DeleteNetworkLayer(TObjArray*& layer); | | void DeleteNetworkLayer(TObjArray*& layer); | |
| | | | |
| // debugging utilities | | // debugging utilities | |
| void PrintLayer(TObjArray* layer) const; | | void PrintLayer(TObjArray* layer) const; | |
| void PrintNeuron(TNeuron* neuron) const; | | void PrintNeuron(TNeuron* neuron) const; | |
| | | | |
| // private variables | | // private variables | |
|
| Int_t fNcycles; // number of epochs to trai | | | |
| n | | | |
| TString fNeuronType; // name of neuron activatio | | | |
| n function class | | | |
| TString fNeuronInputType; // name of neuron input cal | | | |
| culator class | | | |
| TObjArray* fInputLayer; // cache this for fast acce
ss | | TObjArray* fInputLayer; // cache this for fast acce
ss | |
| std::vector<TNeuron*> fOutputNeurons; // cache this for fast acce
ss | | std::vector<TNeuron*> fOutputNeurons; // cache this for fast acce
ss | |
| TString fLayerSpec; // layout specification opt
ion | | TString fLayerSpec; // layout specification opt
ion | |
| | | | |
| // some static flags | | // some static flags | |
| static const Bool_t fgDEBUG = kTRUE; // debug flag | | static const Bool_t fgDEBUG = kTRUE; // debug flag | |
| | | | |
| ClassDef(MethodANNBase,0) // Base class for TMVA ANNs | | ClassDef(MethodANNBase,0) // Base class for TMVA ANNs | |
| }; | | }; | |
| | | | |
|
| | | template <typename WriteIterator> | |
| | | inline void MethodANNBase::GetLayerActivation (size_t layerNumber, Writ | |
| | | eIterator writeIterator) | |
| | | { | |
| | | // get the activation values of the nodes in layer "layer" | |
| | | // write the node activation values into the writeIterator | |
| | | // assumes, that the network has been computed already (by calling | |
| | | // "GetRegressionValues") | |
| | | | |
| | | if (layerNumber >= (size_t)fNetwork->GetEntriesFast()) | |
| | | return; | |
| | | | |
| | | TObjArray* layer = (TObjArray*)fNetwork->At(layerNumber); | |
| | | UInt_t nNodes = layer->GetEntriesFast(); | |
| | | for (UInt_t iNode = 0; iNode < nNodes; iNode++) | |
| | | { | |
| | | (*writeIterator) = ((TNeuron*)layer->At(iNode))->GetActivationVa | |
| | | lue(); | |
| | | ++writeIterator; | |
| | | } | |
| | | } | |
| | | | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 11 lines changed or deleted | | 48 lines changed or added | |
|
| MethodBDT.h | | MethodBDT.h | |
| | | | |
| skipping to change at line 102 | | skipping to change at line 102 | |
| | | | |
| // revoke training | | // revoke training | |
| void Reset( void ); | | void Reset( void ); | |
| | | | |
| using MethodBase::ReadWeightsFromStream; | | using MethodBase::ReadWeightsFromStream; | |
| | | | |
| // write weights to file | | // write weights to file | |
| void AddWeightsXMLTo( void* parent ) const; | | void AddWeightsXMLTo( void* parent ) const; | |
| | | | |
| // read weights from file | | // read weights from file | |
|
| void ReadWeightsFromStream( istream& istr ); | | void ReadWeightsFromStream( std::istream& istr ); | |
| void ReadWeightsFromXML(void* parent); | | void ReadWeightsFromXML(void* parent); | |
| | | | |
| // write method specific histos to target file | | // write method specific histos to target file | |
| void WriteMonitoringHistosToFile( void ) const; | | void WriteMonitoringHistosToFile( void ) const; | |
| | | | |
| // calculate the MVA value | | // calculate the MVA value | |
| Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0); | | Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0); | |
| | | | |
|
| | | // get the actual forest size (might be less than fNTrees, the reques | |
| | | ted one, if boosting is stopped early | |
| | | UInt_t GetNTrees() const {return fForest.size();} | |
| private: | | private: | |
| Double_t GetMvaValue( Double_t* err, Double_t* errUpper, UInt_t useNT
rees ); | | Double_t GetMvaValue( Double_t* err, Double_t* errUpper, UInt_t useNT
rees ); | |
|
| Double_t PrivateGetMvaValue( TMVA::Event& ev, Double_t* err=0, Double
_t* errUpper=0, UInt_t useNTrees=0 ); | | Double_t PrivateGetMvaValue( const TMVA::Event *ev, Double_t* err=0,
Double_t* errUpper=0, UInt_t useNTrees=0 ); | |
| void BoostMonitor(Int_t iTree); | | void BoostMonitor(Int_t iTree); | |
| | | | |
| public: | | public: | |
| const std::vector<Float_t>& GetMulticlassValues(); | | const std::vector<Float_t>& GetMulticlassValues(); | |
| | | | |
| // regression response | | // regression response | |
| const std::vector<Float_t>& GetRegressionValues(); | | const std::vector<Float_t>& GetRegressionValues(); | |
| | | | |
| // apply the boost algorithm to a tree in the collection | | // apply the boost algorithm to a tree in the collection | |
|
| Double_t Boost( std::vector<TMVA::Event*>, DecisionTree *dt, Int_t iT
ree, UInt_t cls = 0); | | Double_t Boost( std::vector<const TMVA::Event*>&, DecisionTree *dt, U
Int_t cls = 0); | |
| | | | |
| // ranking of input variables | | // ranking of input variables | |
| const Ranking* CreateRanking(); | | const Ranking* CreateRanking(); | |
| | | | |
| // the option handling methods | | // the option handling methods | |
| void DeclareOptions(); | | void DeclareOptions(); | |
| void ProcessOptions(); | | void ProcessOptions(); | |
| void SetMaxDepth(Int_t d){fMaxDepth = d;} | | void SetMaxDepth(Int_t d){fMaxDepth = d;} | |
|
| void SetNodeMinEvents(Int_t d){fNodeMinEvents = d;} | | void SetMinNodeSize(Double_t sizeInPercent); | |
| | | void SetMinNodeSize(TString sizeInPercent); | |
| | | | |
| void SetNTrees(Int_t d){fNTrees = d;} | | void SetNTrees(Int_t d){fNTrees = d;} | |
| void SetAdaBoostBeta(Double_t b){fAdaBoostBeta = b;} | | void SetAdaBoostBeta(Double_t b){fAdaBoostBeta = b;} | |
| void SetNodePurityLimit(Double_t l){fNodePurityLimit = l;} | | void SetNodePurityLimit(Double_t l){fNodePurityLimit = l;} | |
|
| | | void SetShrinkage(Double_t s){fShrinkage = s;} | |
| | | void SetUseNvars(Int_t n){fUseNvars = n;} | |
| | | void SetBaggedSampleFraction(Double_t f){fBaggedSampleFraction = f;} | |
| | | | |
| // get the forest | | // get the forest | |
| inline const std::vector<TMVA::DecisionTree*> & GetForest() const; | | inline const std::vector<TMVA::DecisionTree*> & GetForest() const; | |
| | | | |
| // get the forest | | // get the forest | |
|
| inline const std::vector<TMVA::Event*> & GetTrainingEvents() const; | | inline const std::vector<const TMVA::Event*> & GetTrainingEvents() co
nst; | |
| | | | |
| inline const std::vector<double> & GetBoostWeights() const; | | inline const std::vector<double> & GetBoostWeights() const; | |
| | | | |
| //return the individual relative variable importance | | //return the individual relative variable importance | |
| std::vector<Double_t> GetVariableImportance(); | | std::vector<Double_t> GetVariableImportance(); | |
| Double_t GetVariableImportance(UInt_t ivar); | | Double_t GetVariableImportance(UInt_t ivar); | |
| | | | |
| Double_t TestTreeQuality( DecisionTree *dt ); | | Double_t TestTreeQuality( DecisionTree *dt ); | |
| | | | |
| // make ROOT-independent C++ class for classifier response (classifie
r-specific implementation) | | // make ROOT-independent C++ class for classifier response (classifie
r-specific implementation) | |
| | | | |
| skipping to change at line 172 | | skipping to change at line 179 | |
| protected: | | protected: | |
| void DeclareCompatibilityOptions(); | | void DeclareCompatibilityOptions(); | |
| | | | |
| private: | | private: | |
| // Init used in the various constructors | | // Init used in the various constructors | |
| void Init( void ); | | void Init( void ); | |
| | | | |
| void PreProcessNegativeEventWeights(); | | void PreProcessNegativeEventWeights(); | |
| | | | |
| // boosting algorithm (adaptive boosting) | | // boosting algorithm (adaptive boosting) | |
|
| Double_t AdaBoost( std::vector<TMVA::Event*>, DecisionTree *dt ); | | Double_t AdaBoost( std::vector<const TMVA::Event*>&, DecisionTree *dt | |
| | | ); | |
| | | | |
| | | // boosting algorithm (adaptive boosting with cost matrix) | |
| | | Double_t AdaCost( std::vector<const TMVA::Event*>&, DecisionTree *dt | |
| | | ); | |
| | | | |
| // boosting as a random re-weighting | | // boosting as a random re-weighting | |
|
| Double_t Bagging( std::vector<TMVA::Event*>, Int_t iTree ); | | Double_t Bagging( ); | |
| | | | |
| // boosting special for regression | | // boosting special for regression | |
|
| Double_t RegBoost( std::vector<TMVA::Event*>, DecisionTree *dt ); | | Double_t RegBoost( std::vector<const TMVA::Event*>&, DecisionTree *dt
); | |
| | | | |
| // adaboost adapted to regression | | // adaboost adapted to regression | |
|
| Double_t AdaBoostR2( std::vector<TMVA::Event*>, DecisionTree *dt ); | | Double_t AdaBoostR2( std::vector<const TMVA::Event*>&, DecisionTree *
dt ); | |
| | | | |
| // binomial likelihood gradient boost for classification | | // binomial likelihood gradient boost for classification | |
| // (see Friedman: "Greedy Function Approximation: a Gradient Boosting
Machine" | | // (see Friedman: "Greedy Function Approximation: a Gradient Boosting
Machine" | |
| // Technical report, Dept. of Statistics, Stanford University) | | // Technical report, Dept. of Statistics, Stanford University) | |
|
| Double_t GradBoost( std::vector<TMVA::Event*>, DecisionTree *dt, UInt | | Double_t GradBoost( std::vector<const TMVA::Event*>&, DecisionTree *d | |
| _t cls = 0); | | t, UInt_t cls = 0); | |
| Double_t GradBoostRegression(std::vector<TMVA::Event*>, DecisionTree | | Double_t GradBoostRegression(std::vector<const TMVA::Event*>&, Decisi | |
| *dt ); | | onTree *dt ); | |
| void InitGradBoost( std::vector<TMVA::Event*>); | | void InitGradBoost( std::vector<const TMVA::Event*>&); | |
| void UpdateTargets( std::vector<TMVA::Event*>, UInt_t cls = 0); | | void UpdateTargets( std::vector<const TMVA::Event*>&, UInt_t cls = 0) | |
| void UpdateTargetsRegression( std::vector<TMVA::Event*>,Bool_t first= | | ; | |
| kFALSE); | | void UpdateTargetsRegression( std::vector<const TMVA::Event*>&,Bool_t | |
| Double_t GetGradBoostMVA(TMVA::Event& e, UInt_t nTrees); | | first=kFALSE); | |
| void GetRandomSubSample(); | | Double_t GetGradBoostMVA(const TMVA::Event *e, UInt_t nTrees); | |
| | | void GetBaggedSubSample(std::vector<const TMVA::Event*>&); | |
| Double_t GetWeightedQuantile(std::vector<std::pair<Double_t, Double_t
> > vec, const Double_t quantile, const Double_t SumOfWeights = 0.0); | | Double_t GetWeightedQuantile(std::vector<std::pair<Double_t, Double_t
> > vec, const Double_t quantile, const Double_t SumOfWeights = 0.0); | |
| | | | |
|
| std::vector<TMVA::Event*> fEventSample; // the training eve | | std::vector<const TMVA::Event*> fEventSample; // the traini | |
| nts | | ng events | |
| std::vector<TMVA::Event*> fValidationSample;// the Validation e | | std::vector<const TMVA::Event*> fValidationSample;// the Valida | |
| vents | | tion events | |
| std::vector<TMVA::Event*> fSubSample; // subsample for ba | | std::vector<const TMVA::Event*> fSubSample; // subsample | |
| gged grad boost | | for bagged grad boost | |
| | | std::vector<const TMVA::Event*> *fTrainSample; // pointer to | |
| | | sample actually used in training (fEventSample or fSubSample) for example | |
| | | | |
| Int_t fNTrees; // number of decisi
on trees requested | | Int_t fNTrees; // number of decisi
on trees requested | |
| std::vector<DecisionTree*> fForest; // the collection o
f decision trees | | std::vector<DecisionTree*> fForest; // the collection o
f decision trees | |
| std::vector<double> fBoostWeights; // the weights appl
ied in the individual boosts | | std::vector<double> fBoostWeights; // the weights appl
ied in the individual boosts | |
|
| Bool_t fRenormByClass; // individually re-
normalize each event class to the original size after boosting | | Double_t fSigToBkgFraction;// Signal to Backgr
ound fraction assumed during training | |
| TString fBoostType; // string specifyin
g the boost type | | TString fBoostType; // string specifyin
g the boost type | |
| Double_t fAdaBoostBeta; // beta parameter f
or AdaBoost algorithm | | Double_t fAdaBoostBeta; // beta parameter f
or AdaBoost algorithm | |
| TString fAdaBoostR2Loss; // loss type used i
n AdaBoostR2 (Linear,Quadratic or Exponential) | | TString fAdaBoostR2Loss; // loss type used i
n AdaBoostR2 (Linear,Quadratic or Exponential) | |
| Double_t fTransitionPoint; // break-down point
for gradient regression | | Double_t fTransitionPoint; // break-down point
for gradient regression | |
| Double_t fShrinkage; // learning rate fo
r gradient boost; | | Double_t fShrinkage; // learning rate fo
r gradient boost; | |
|
| | | Bool_t fBaggedBoost; // turn bagging in
combination with boost on/off | |
| Bool_t fBaggedGradBoost; // turn bagging in
combination with grad boost on/off | | Bool_t fBaggedGradBoost; // turn bagging in
combination with grad boost on/off | |
|
| Double_t fSampleFraction; // fraction of even
ts used for bagged grad boost | | | |
| Double_t fSumOfWeights; // sum of all event
weights | | Double_t fSumOfWeights; // sum of all event
weights | |
|
| std::map< TMVA::Event*, std::pair<Double_t, Double_t> > fWeight | | std::map< const TMVA::Event*, std::pair<Double_t, Double_t> > f | |
| edResiduals; // weighted regression residuals | | WeightedResiduals; // weighted regression residuals | |
| std::map< TMVA::Event*,std::vector<double> > fResiduals; // individua | | std::map< const TMVA::Event*,std::vector<double> > fResiduals; // ind | |
| l event residuals for gradient boost | | ividual event residuals for gradient boost | |
| | | | |
| //options for the decision Tree | | //options for the decision Tree | |
| SeparationBase *fSepType; // the separation u
sed in node splitting | | SeparationBase *fSepType; // the separation u
sed in node splitting | |
| TString fSepTypeS; // the separation (
option string) used in node splitting | | TString fSepTypeS; // the separation (
option string) used in node splitting | |
|
| Int_t fNodeMinEvents; // min number of ev | | Int_t fMinNodeEvents; // min number of ev | |
| ents in node | | ents in node | |
| | | Float_t fMinNodeSize; // min percentage o | |
| | | f training events in node | |
| | | TString fMinNodeSizeS; // string containin | |
| | | g min percentage of training events in node | |
| | | | |
| Int_t fNCuts; // grid used in cut
applied in node splitting | | Int_t fNCuts; // grid used in cut
applied in node splitting | |
| Bool_t fUseFisherCuts; // use multivariate
splits using the Fisher criterium | | Bool_t fUseFisherCuts; // use multivariate
splits using the Fisher criterium | |
| Double_t fMinLinCorrForFisher; // the minimum
linear correlation between two variables demanded for use in fisher criteri
um in node splitting | | Double_t fMinLinCorrForFisher; // the minimum
linear correlation between two variables demanded for use in fisher criteri
um in node splitting | |
| Bool_t fUseExclusiveVars; // individual vari
ables already used in fisher criterium are not anymore analysed individuall
y for node splitting | | Bool_t fUseExclusiveVars; // individual vari
ables already used in fisher criterium are not anymore analysed individuall
y for node splitting | |
| Bool_t fUseYesNoLeaf; // use sig or bkg c
lassification in leave nodes or sig/bkg | | Bool_t fUseYesNoLeaf; // use sig or bkg c
lassification in leave nodes or sig/bkg | |
| Double_t fNodePurityLimit; // purity limit for
sig/bkg nodes | | Double_t fNodePurityLimit; // purity limit for
sig/bkg nodes | |
|
| Bool_t fUseWeightedTrees;// use average clas
sification from the trees, or have the individual trees trees in the forest
weighted (e.g. log(boostweight) from AdaBoost | | | |
| UInt_t fNNodesMax; // max # of nodes | | UInt_t fNNodesMax; // max # of nodes | |
| UInt_t fMaxDepth; // max depth | | UInt_t fMaxDepth; // max depth | |
| | | | |
| DecisionTree::EPruneMethod fPruneMethod; // method used for
prunig | | DecisionTree::EPruneMethod fPruneMethod; // method used for
prunig | |
| TString fPruneMethodS; // prune method op
tion String | | TString fPruneMethodS; // prune method op
tion String | |
| Double_t fPruneStrength; // a parameter to
set the "amount" of pruning..needs to be adjusted | | Double_t fPruneStrength; // a parameter to
set the "amount" of pruning..needs to be adjusted | |
|
| Bool_t fPruneBeforeBoost;// flag to prune b
efore boosting | | | |
| Double_t fFValidationEvents; // fraction o
f events to use for pruning | | Double_t fFValidationEvents; // fraction o
f events to use for pruning | |
| Bool_t fAutomatic; // use user given
prune strength or automatically determined one using a validation sample | | Bool_t fAutomatic; // use user given
prune strength or automatically determined one using a validation sample | |
| Bool_t fRandomisedTrees; // choose a random
subset of possible cut variables at each node during training | | Bool_t fRandomisedTrees; // choose a random
subset of possible cut variables at each node during training | |
| UInt_t fUseNvars; // the number of v
ariables used in the randomised tree splitting | | UInt_t fUseNvars; // the number of v
ariables used in the randomised tree splitting | |
| Bool_t fUsePoissonNvars; // use "fUseNvars"
not as fixed number but as mean of a possion distr. in each split | | Bool_t fUsePoissonNvars; // use "fUseNvars"
not as fixed number but as mean of a possion distr. in each split | |
| UInt_t fUseNTrainEvents; // number of rando
mly picked training events used in randomised (and bagged) trees | | UInt_t fUseNTrainEvents; // number of rando
mly picked training events used in randomised (and bagged) trees | |
| | | | |
|
| Double_t fSampleSizeFraction; // relative
size of bagged event sample to original sample size | | Double_t fBaggedSampleFraction; // relati
ve size of bagged event sample to original sample size | |
| TString fNegWeightTreatment; // variable
that holds the option of how to treat negative event weights in training | | TString fNegWeightTreatment; // variable
that holds the option of how to treat negative event weights in training | |
| Bool_t fNoNegWeightsInTraining; // ignore n
egative event weights in the training | | Bool_t fNoNegWeightsInTraining; // ignore n
egative event weights in the training | |
| Bool_t fInverseBoostNegWeights; // boost ev
. with neg. weights with 1/boostweight rathre than boostweight | | Bool_t fInverseBoostNegWeights; // boost ev
. with neg. weights with 1/boostweight rathre than boostweight | |
| Bool_t fPairNegWeightsGlobal; // pair ev.
with neg. and pos. weights in traning sample and "annihilate" them | | Bool_t fPairNegWeightsGlobal; // pair ev.
with neg. and pos. weights in traning sample and "annihilate" them | |
|
| Bool_t fPairNegWeightsInNode; // randomly
pair miscl. ev. with neg. and pos. weights in node and don't boost them | | | |
| Bool_t fTrainWithNegWeights; // yes there a
re negative event weights and we don't ignore them | | Bool_t fTrainWithNegWeights; // yes there a
re negative event weights and we don't ignore them | |
| Bool_t fDoBoostMonitor; //create control pl
ot with ROC integral vs tree number | | Bool_t fDoBoostMonitor; //create control pl
ot with ROC integral vs tree number | |
| | | | |
| //some histograms for monitoring | | //some histograms for monitoring | |
| TTree* fMonitorNtuple; // monitoring ntup
le | | TTree* fMonitorNtuple; // monitoring ntup
le | |
| Int_t fITree; // ntuple var: ith
tree | | Int_t fITree; // ntuple var: ith
tree | |
| Double_t fBoostWeight; // ntuple var: boo
st weight | | Double_t fBoostWeight; // ntuple var: boo
st weight | |
| Double_t fErrorFraction; // ntuple var: mis
classification error fraction | | Double_t fErrorFraction; // ntuple var: mis
classification error fraction | |
| | | | |
|
| | | Double_t fCss; // Cost factor | |
| | | Double_t fCts_sb; // Cost factor | |
| | | Double_t fCtb_ss; // Cost factor | |
| | | Double_t fCbb; // Cost factor | |
| | | | |
| | | Bool_t fDoPreselection; // do or do not pe | |
| | | rform automatic pre-selection of 100% eff. cuts | |
| | | | |
| std::vector<Double_t> fVariableImportance; // the relative
importance of the different variables | | std::vector<Double_t> fVariableImportance; // the relative
importance of the different variables | |
| | | | |
|
| | | void DeterminePreselectionCuts(const std: | |
| | | :vector<const TMVA::Event*>& eventSample); | |
| | | Double_t ApplyPreselectionCuts(const Event* e | |
| | | v); | |
| | | | |
| | | std::vector<Double_t> fLowSigCut; | |
| | | std::vector<Double_t> fLowBkgCut; | |
| | | std::vector<Double_t> fHighSigCut; | |
| | | std::vector<Double_t> fHighBkgCut; | |
| | | | |
| | | std::vector<Bool_t> fIsLowSigCut; | |
| | | std::vector<Bool_t> fIsLowBkgCut; | |
| | | std::vector<Bool_t> fIsHighSigCut; | |
| | | std::vector<Bool_t> fIsHighBkgCut; | |
| | | | |
| | | Bool_t fHistoricBool; //historic variable, only needed for "Compatibi | |
| | | lityOptions" | |
| | | | |
| // debugging flags | | // debugging flags | |
| static const Int_t fgDebugLevel; // debug level det
ermining some printout/control plots etc. | | static const Int_t fgDebugLevel; // debug level det
ermining some printout/control plots etc. | |
| | | | |
| // for backward compatibility | | // for backward compatibility | |
| | | | |
| ClassDef(MethodBDT,0) // Analysis of Boosted Decision Trees | | ClassDef(MethodBDT,0) // Analysis of Boosted Decision Trees | |
| }; | | }; | |
| | | | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| const std::vector<TMVA::DecisionTree*>& TMVA::MethodBDT::GetForest()
const { return fForest; } | | const std::vector<TMVA::DecisionTree*>& TMVA::MethodBDT::GetForest()
const { return fForest; } | |
|
| const std::vector<TMVA::Event*>& TMVA::MethodBDT::GetTrainingEvents(
) const { return fEventSample; } | | const std::vector<const TMVA::Event*> & TMVA::MethodBDT::GetTrainingEvents(
) const { return fEventSample; } | |
| const std::vector<double>& TMVA::MethodBDT::GetBoostWeights()
const { return fBoostWeights; } | | const std::vector<double>& TMVA::MethodBDT::GetBoostWeights()
const { return fBoostWeights; } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 25 change blocks. |
| 38 lines changed or deleted | | 82 lines changed or added | |
|
| MethodBase.h | | MethodBase.h | |
| | | | |
| skipping to change at line 204 | | skipping to change at line 204 | |
| return (*ptr); | | return (*ptr); | |
| } | | } | |
| | | | |
| // multiclass classification response | | // multiclass classification response | |
| virtual const std::vector<Float_t>& GetMulticlassValues() { | | virtual const std::vector<Float_t>& GetMulticlassValues() { | |
| std::vector<Float_t>* ptr = new std::vector<Float_t>(0); | | std::vector<Float_t>* ptr = new std::vector<Float_t>(0); | |
| return (*ptr); | | return (*ptr); | |
| } | | } | |
| | | | |
| // probability of classifier response (mvaval) to be signal (requires
"CreateMvaPdf" option set) | | // probability of classifier response (mvaval) to be signal (requires
"CreateMvaPdf" option set) | |
|
| | | virtual Double_t GetProba( const Event *ev); // the simple one, autom
atically calcualtes the mvaVal and uses the SAME sig/bkg ratio as given in
the training sample (typically 50/50 .. (NormMode=EqualNumEvents) but can b
e different) | |
| virtual Double_t GetProba( Double_t mvaVal, Double_t ap_sig ); | | virtual Double_t GetProba( Double_t mvaVal, Double_t ap_sig ); | |
| | | | |
| // Rarity of classifier response (signal or background (default) is u
niform in [0,1]) | | // Rarity of classifier response (signal or background (default) is u
niform in [0,1]) | |
| virtual Double_t GetRarity( Double_t mvaVal, Types::ESBType reftype =
Types::kBackground ) const; | | virtual Double_t GetRarity( Double_t mvaVal, Types::ESBType reftype =
Types::kBackground ) const; | |
| | | | |
| // create ranking | | // create ranking | |
| virtual const Ranking* CreateRanking() = 0; | | virtual const Ranking* CreateRanking() = 0; | |
| | | | |
|
| // perfrom extra actions during the boosting at different stages | | | |
| virtual Bool_t MonitorBoost(MethodBoost* /*booster*/) {return kFALS | | | |
| E;}; | | | |
| | | | |
| // make ROOT-independent C++ class | | // make ROOT-independent C++ class | |
| virtual void MakeClass( const TString& classFileName = TString(""
) ) const; | | virtual void MakeClass( const TString& classFileName = TString(""
) ) const; | |
| | | | |
| // print help message | | // print help message | |
| void PrintHelpMessage() const; | | void PrintHelpMessage() const; | |
| | | | |
| // | | // | |
| // streamer methods for training information (creates "weight" files)
-------- | | // streamer methods for training information (creates "weight" files)
-------- | |
| // | | // | |
| public: | | public: | |
| | | | |
| skipping to change at line 237 | | skipping to change at line 235 | |
| | | | |
| protected: | | protected: | |
| // the actual "weights" | | // the actual "weights" | |
| virtual void AddWeightsXMLTo ( void* parent ) const = 0; | | virtual void AddWeightsXMLTo ( void* parent ) const = 0; | |
| virtual void ReadWeightsFromXML ( void* wghtnode ) = 0; | | virtual void ReadWeightsFromXML ( void* wghtnode ) = 0; | |
| virtual void ReadWeightsFromStream( std::istream& ) = 0; // bac
kward compatibility | | virtual void ReadWeightsFromStream( std::istream& ) = 0; // bac
kward compatibility | |
| virtual void ReadWeightsFromStream( TFile& ) {} // bac
kward compatibility | | virtual void ReadWeightsFromStream( TFile& ) {} // bac
kward compatibility | |
| | | | |
| private: | | private: | |
| friend class MethodCategory; | | friend class MethodCategory; | |
|
| friend class MethodCommittee; | | | |
| friend class MethodCompositeBase; | | friend class MethodCompositeBase; | |
| void WriteStateToXML ( void* parent ) const; | | void WriteStateToXML ( void* parent ) const; | |
| void ReadStateFromXML ( void* parent ); | | void ReadStateFromXML ( void* parent ); | |
| void WriteStateToStream ( std::ostream& tf ) const; // needed for
MakeClass | | void WriteStateToStream ( std::ostream& tf ) const; // needed for
MakeClass | |
| void WriteVarsToStream ( std::ostream& tf, const TString& prefix =
"" ) const; // needed for MakeClass | | void WriteVarsToStream ( std::ostream& tf, const TString& prefix =
"" ) const; // needed for MakeClass | |
| | | | |
| public: // these two need to be public, they are used to read in-memory
weight-files | | public: // these two need to be public, they are used to read in-memory
weight-files | |
| void ReadStateFromStream ( std::istream& tf ); // backward c
ompatibility | | void ReadStateFromStream ( std::istream& tf ); // backward c
ompatibility | |
| void ReadStateFromStream ( TFile& rf ); // backward c
ompatibility | | void ReadStateFromStream ( TFile& rf ); // backward c
ompatibility | |
| void ReadStateFromXMLString( const char* xmlstr ); // for readin
g from memory | | void ReadStateFromXMLString( const char* xmlstr ); // for readin
g from memory | |
| | | | |
| skipping to change at line 363 | | skipping to change at line 360 | |
| const TransformationHandler& GetTransformationHandler(Bool_t takeRer
outedIfAvailable=true) const | | const TransformationHandler& GetTransformationHandler(Bool_t takeRer
outedIfAvailable=true) const | |
| { | | { | |
| if(fTransformationPointer && takeReroutedIfAvailable) return *fTra
nsformationPointer; else return fTransformation; | | if(fTransformationPointer && takeReroutedIfAvailable) return *fTra
nsformationPointer; else return fTransformation; | |
| } | | } | |
| | | | |
| void RerouteTransformationHandler (TransformationHandler*
fTargetTransformation) { fTransformationPointer=fTargetTransformation; } | | void RerouteTransformationHandler (TransformationHandler*
fTargetTransformation) { fTransformationPointer=fTargetTransformation; } | |
| | | | |
| // ---------- event accessors ---------------------------------------
--------- | | // ---------- event accessors ---------------------------------------
--------- | |
| | | | |
| // returns reference to data set | | // returns reference to data set | |
|
| | | // NOTE: this DataSet is the "original" dataset, i.e. the one seen by | |
| | | ALL Classifiers WITHOUT transformation | |
| | | DataSet* Data() const { return DataInfo().GetDataSet(); } | |
| DataSetInfo& DataInfo() const { return fDataSetInfo; } | | DataSetInfo& DataInfo() const { return fDataSetInfo; } | |
| | | | |
| mutable const Event* fTmpEvent; //! temporary event when testing on
a different DataSet than the own one | | mutable const Event* fTmpEvent; //! temporary event when testing on
a different DataSet than the own one | |
| | | | |
| // event reference and update | | // event reference and update | |
|
| | | // NOTE: these Event accessors make sure that you get the events tran | |
| | | sformed according to the | |
| | | // particular clasifiers transformation chosen | |
| UInt_t GetNEvents () const { return Data()->GetNEvents
(); } | | UInt_t GetNEvents () const { return Data()->GetNEvents
(); } | |
| const Event* GetEvent () const; | | const Event* GetEvent () const; | |
| const Event* GetEvent ( const TMVA::Event* ev ) const; | | const Event* GetEvent ( const TMVA::Event* ev ) const; | |
| const Event* GetEvent ( Long64_t ievt ) const; | | const Event* GetEvent ( Long64_t ievt ) const; | |
| const Event* GetEvent ( Long64_t ievt , Types::ETreeType t
ype ) const; | | const Event* GetEvent ( Long64_t ievt , Types::ETreeType t
ype ) const; | |
| const Event* GetTrainingEvent( Long64_t ievt ) const; | | const Event* GetTrainingEvent( Long64_t ievt ) const; | |
| const Event* GetTestingEvent ( Long64_t ievt ) const; | | const Event* GetTestingEvent ( Long64_t ievt ) const; | |
| const std::vector<TMVA::Event*>& GetEventCollection( Types::ETreeType
type ); | | const std::vector<TMVA::Event*>& GetEventCollection( Types::ETreeType
type ); | |
| | | | |
| // ---------- public auxiliary methods ------------------------------
--------- | | // ---------- public auxiliary methods ------------------------------
--------- | |
| | | | |
| // this method is used to decide whether an event is signal- or backg
round-like | | // this method is used to decide whether an event is signal- or backg
round-like | |
| // the reference cut "xC" is taken to be where | | // the reference cut "xC" is taken to be where | |
| // Int_[-oo,xC] { PDF_S(x) dx } = Int_[xC,+oo] { PDF_B(x) dx } | | // Int_[-oo,xC] { PDF_S(x) dx } = Int_[xC,+oo] { PDF_B(x) dx } | |
| virtual Bool_t IsSignalLike(); | | virtual Bool_t IsSignalLike(); | |
| virtual Bool_t IsSignalLike(Double_t mvaVal); | | virtual Bool_t IsSignalLike(Double_t mvaVal); | |
| | | | |
|
| DataSet* Data() const { return DataInfo().GetDataSet(); } | | | |
| | | | |
| Bool_t HasMVAPdfs() const { return fHasMVAPdfs; } | | Bool_t HasMVAPdfs() const { return fHasMVAPdfs; } | |
| virtual void SetAnalysisType( Types::EAnalysisType type ) {
fAnalysisType = type; } | | virtual void SetAnalysisType( Types::EAnalysisType type ) {
fAnalysisType = type; } | |
| Types::EAnalysisType GetAnalysisType() const { return fAnalysisType;
} | | Types::EAnalysisType GetAnalysisType() const { return fAnalysisType;
} | |
| Bool_t DoRegression() const { return fAnalysisType ==
Types::kRegression; } | | Bool_t DoRegression() const { return fAnalysisType ==
Types::kRegression; } | |
| Bool_t DoMulticlass() const { return fAnalysisType ==
Types::kMulticlass; } | | Bool_t DoMulticlass() const { return fAnalysisType ==
Types::kMulticlass; } | |
| | | | |
| // setter method for suppressing writing to XML and writing of standa
lone classes | | // setter method for suppressing writing to XML and writing of standa
lone classes | |
| void DisableWriting(Bool_t setter){ fDisableWriting
= setter; } | | void DisableWriting(Bool_t setter){ fDisableWriting
= setter; } | |
| | | | |
| protected: | | protected: | |
| | | | |
| skipping to change at line 453 | | skipping to change at line 452 | |
| Double_t&, Double_t&, Double_t&, | | Double_t&, Double_t&, Double_t&, | |
| Double_t&, Double_t&, Double_t& ); | | Double_t&, Double_t&, Double_t& ); | |
| | | | |
| // if TRUE, write weights only to text files | | // if TRUE, write weights only to text files | |
| Bool_t TxtWeightsOnly() const { return kTRUE; } | | Bool_t TxtWeightsOnly() const { return kTRUE; } | |
| | | | |
| protected: | | protected: | |
| | | | |
| // access to event information that needs method-specific information | | // access to event information that needs method-specific information | |
| | | | |
|
| Float_t GetTWeight( const Event* ev ) const { | | | |
| return (fIgnoreNegWeightsInTraining && (ev->GetWeight() < 0)) ? 0. | | | |
| : ev->GetWeight(); | | | |
| } | | | |
| | | | |
| Bool_t IsConstructedFromWeightFile() const { return fConstr
uctedFromWeightFile; } | | Bool_t IsConstructedFromWeightFile() const { return fConstr
uctedFromWeightFile; } | |
| | | | |
|
| public: | | | |
| virtual void SetCurrentEvent( Long64_t ievt ) const { | | | |
| Data()->SetCurrentEvent(ievt); | | | |
| } | | | |
| | | | |
| private: | | private: | |
| | | | |
| // ---------- private definitions -----------------------------------
--------- | | // ---------- private definitions -----------------------------------
--------- | |
| // Initialisation | | // Initialisation | |
| void InitBase(); | | void InitBase(); | |
| void DeclareBaseOptions(); | | void DeclareBaseOptions(); | |
| void ProcessBaseOptions(); | | void ProcessBaseOptions(); | |
| | | | |
| // used in efficiency computation | | // used in efficiency computation | |
| enum ECutOrientation { kNegative = -1, kPositive = +1 }; | | enum ECutOrientation { kNegative = -1, kPositive = +1 }; | |
| | | | |
End of changes. 8 change blocks. |
| 17 lines changed or deleted | | 7 lines changed or added | |
|
| MethodBoost.h | | MethodBoost.h | |
| | | | |
| skipping to change at line 91 | | skipping to change at line 91 | |
| | | | |
| // ranking of input variables | | // ranking of input variables | |
| const Ranking* CreateRanking(); | | const Ranking* CreateRanking(); | |
| | | | |
| // saves the name and options string of the boosted classifier | | // saves the name and options string of the boosted classifier | |
| Bool_t BookMethod( Types::EMVA theMethod, TString methodTitle, TStrin
g theOption ); | | Bool_t BookMethod( Types::EMVA theMethod, TString methodTitle, TStrin
g theOption ); | |
| void SetBoostedMethodName ( TString methodName ) { fBoostedMethod
Name = methodName; } | | void SetBoostedMethodName ( TString methodName ) { fBoostedMethod
Name = methodName; } | |
| | | | |
| Int_t GetBoostNum() { return fBoostNum; } | | Int_t GetBoostNum() { return fBoostNum; } | |
| | | | |
|
| // gives the monitoring historgram from the vector according to index | | | |
| of the | | | |
| // histrogram added in the MonitorBoost function | | | |
| TH1* GetMonitoringHist( Int_t histInd ) { return (*fMonitor | | | |
| Hist)[fDefaultHistNum+histInd]; } | | | |
| | | | |
| void AddMonitoringHist( TH1* hist ) { return fMonitorHi | | | |
| st->push_back(hist); } | | | |
| | | | |
| Types::EBoostStage GetBoostStage() { return fBoostStage; } | | | |
| | | | |
| void CleanBoostOptions(); | | void CleanBoostOptions(); | |
| | | | |
| Double_t GetMvaValue( Double_t* err=0, Double_t* errUpper = 0 ); | | Double_t GetMvaValue( Double_t* err=0, Double_t* errUpper = 0 ); | |
| | | | |
| private : | | private : | |
| // clean up | | // clean up | |
| void ClearAll(); | | void ClearAll(); | |
| | | | |
| // print fit results | | // print fit results | |
| void PrintResults( const TString&, std::vector<Double_t>&, const Doub
le_t ) const; | | void PrintResults( const TString&, std::vector<Double_t>&, const Doub
le_t ) const; | |
| | | | |
| // initializing mostly monitoring tools of the boost process | | // initializing mostly monitoring tools of the boost process | |
| void Init(); | | void Init(); | |
| void InitHistos(); | | void InitHistos(); | |
| void CheckSetup(); | | void CheckSetup(); | |
| | | | |
|
| | | void MonitorBoost( Types::EBoostStage stage, UInt_t methodIdx=0); | |
| | | | |
| // the option handling methods | | // the option handling methods | |
| void DeclareOptions(); | | void DeclareOptions(); | |
|
| | | void DeclareCompatibilityOptions(); | |
| void ProcessOptions(); | | void ProcessOptions(); | |
| | | | |
|
| MethodBoost* SetStage( Types::EBoostStage stage ) { fBoostStage = sta | | MethodBase* CurrentMethod(){return fCurrentMethod;} | |
| ge; return this; } | | UInt_t CurrentMethodIdx(){return fCurrentMethodIdx;} | |
| | | | |
| // training a single classifier | | // training a single classifier | |
| void SingleTrain(); | | void SingleTrain(); | |
| | | | |
| // calculating a boosting weight from the classifier, storing it in t
he next one | | // calculating a boosting weight from the classifier, storing it in t
he next one | |
|
| void SingleBoost(); | | Double_t SingleBoost(MethodBase* method); | |
| | | Double_t AdaBoost(MethodBase* method, Bool_t useYesNoLeaf ); | |
| | | Double_t Bagging(); | |
| | | | |
| // calculate weight of single method | | // calculate weight of single method | |
|
| void CalcMethodWeight(); | | Double_t CalcMethodWeight(); | |
| | | | |
| // return ROC integral on training/testing sample | | // return ROC integral on training/testing sample | |
| Double_t GetBoostROCIntegral(Bool_t, Types::ETreeType, Bool_t CalcOve
rlapIntergral=kFALSE); | | Double_t GetBoostROCIntegral(Bool_t, Types::ETreeType, Bool_t CalcOve
rlapIntergral=kFALSE); | |
| | | | |
| // writing the monitoring histograms and tree to a file | | // writing the monitoring histograms and tree to a file | |
| void WriteMonitoringHistosToFile( void ) const; | | void WriteMonitoringHistosToFile( void ) const; | |
| | | | |
| // write evaluation histograms into target file | | // write evaluation histograms into target file | |
| virtual void WriteEvaluationHistosToFile(Types::ETreeType treetype); | | virtual void WriteEvaluationHistosToFile(Types::ETreeType treetype); | |
| | | | |
| // performs the MethodBase testing + testing of each boosted classifi
er | | // performs the MethodBase testing + testing of each boosted classifi
er | |
| virtual void TestClassification(); | | virtual void TestClassification(); | |
| | | | |
| // finding the MVA to cut between sig and bgd according to fMVACutPer
c,fMVACutType | | // finding the MVA to cut between sig and bgd according to fMVACutPer
c,fMVACutType | |
|
| void FindMVACut(); | | void FindMVACut(MethodBase* method); | |
| | | | |
| // setting all the boost weights to 1 | | // setting all the boost weights to 1 | |
| void ResetBoostWeights(); | | void ResetBoostWeights(); | |
| | | | |
| // creating the vectors of histogram for monitoring MVA response of e
ach classifier | | // creating the vectors of histogram for monitoring MVA response of e
ach classifier | |
| void CreateMVAHistorgrams(); | | void CreateMVAHistorgrams(); | |
| | | | |
| // calculate MVA values of current trained method on training | | // calculate MVA values of current trained method on training | |
| // sample | | // sample | |
| void CalcMVAValues(); | | void CalcMVAValues(); | |
| | | | |
|
| Int_t fBoostNum; // Number of times the classi | | UInt_t fBoostNum; // Number of times the cl | |
| fier is boosted | | assifier is boosted | |
| TString fBoostType; // string specifying the boos | | TString fBoostType; // string specifying the | |
| t type | | boost type | |
| TString fMethodWeightType; // string specifying the boos | | | |
| t type | | | |
| Double_t fMethodError; // estimation of the level er | | | |
| ror of the classifier | | | |
| // analysing the train datase | | | |
| t | | | |
| Double_t fOrigMethodError; // estimation of the level er | | | |
| ror of the classifier | | | |
| // analysing the train datase | | | |
| t (with unboosted weights) | | | |
| Double_t fBoostWeight; // the weight used to boost t | | | |
| he next classifier | | | |
| TString fTransformString; // min and max values for the | | | |
| classifier response | | | |
| Bool_t fDetailedMonitoring; // produce detailed monitorin | | | |
| g histograms (boost-wise) | | | |
| | | | |
| Double_t fADABoostBeta; // ADA boost parameter, defau | | | |
| lt is 1 | | | |
| UInt_t fRandomSeed; // seed for random number gen | | | |
| erator used for bagging | | | |
| | | | |
| TString fBoostedMethodName; // details of the boosted c | | | |
| lassifier | | | |
| TString fBoostedMethodTitle; // title | | | |
| TString fBoostedMethodOptions; // options | | | |
| | | | |
|
| std::vector<TH1*>* fMonitorHist; // histograms to monitor va | | TString fTransformString; // min and max values for | |
| lues during the boosting | | the classifier response | |
| Bool_t fMonitorBoostedMethod; // monitor the MVA response | | Bool_t fDetailedMonitoring; // produce detailed monit | |
| of every classifier | | oring histograms (boost-wise) | |
| | | | |
| | | Double_t fAdaBoostBeta; // ADA boost parameter, d | |
| | | efault is 1 | |
| | | UInt_t fRandomSeed; // seed for random number | |
| | | generator used for bagging | |
| | | Double_t fBaggedSampleFraction;// rel.Size of bagged sa | |
| | | mple | |
| | | | |
| | | TString fBoostedMethodName; // details of the boost | |
| | | ed classifier | |
| | | TString fBoostedMethodTitle; // title | |
| | | TString fBoostedMethodOptions; // options | |
| | | | |
| | | Bool_t fMonitorBoostedMethod; // monitor the MVA resp | |
| | | onse of every classifier | |
| | | | |
| // MVA output from each classifier over the training hist, using orig
nal events weights | | // MVA output from each classifier over the training hist, using orig
nal events weights | |
| std::vector< TH1* > fTrainSigMVAHist; | | std::vector< TH1* > fTrainSigMVAHist; | |
| std::vector< TH1* > fTrainBgdMVAHist; | | std::vector< TH1* > fTrainBgdMVAHist; | |
| // MVA output from each classifier over the training hist, using boos
ted events weights | | // MVA output from each classifier over the training hist, using boos
ted events weights | |
| std::vector< TH1* > fBTrainSigMVAHist; | | std::vector< TH1* > fBTrainSigMVAHist; | |
| std::vector< TH1* > fBTrainBgdMVAHist; | | std::vector< TH1* > fBTrainBgdMVAHist; | |
| // MVA output from each classifier over the testing hist | | // MVA output from each classifier over the testing hist | |
| std::vector< TH1* > fTestSigMVAHist; | | std::vector< TH1* > fTestSigMVAHist; | |
|
| std::vector< TH1* > fTestBgdMVAHist; | | std::vector | |
| | | < TH1* > fTestBgdMVAHist; | |
| | | | |
|
| TTree* fMonitorTree; // tree to monitor values du | | //monitoring tree/ntuple and it's variables | |
| ring the boosting | | TTree* fMonitorTree; // tree to monitor values du | |
| Types::EBoostStage fBoostStage; // stage of the boosting | | ring the boosting | |
| Int_t fDefaultHistNum; // number of histogram filled | | Double_t fBoostWeight; // the weight used to boos | |
| for every type of boosted classifier | | t the next classifier | |
| Bool_t fRecalculateMVACut; // whether to recalculate the | | Double_t fMethodError; // estimation of the level er | |
| MVA cut at every boosting step | | ror of the classifier | |
| | | // analysing the train da | |
| | | taset | |
| Double_t fROC_training; // roc integral of last train
ed method (on training sample) | | Double_t fROC_training; // roc integral of last train
ed method (on training sample) | |
| | | | |
| // overlap integral of mva distributions for signal and | | // overlap integral of mva distributions for signal and | |
| // background (training sample) | | // background (training sample) | |
| Double_t fOverlap_integral; | | Double_t fOverlap_integral; | |
| | | | |
| std::vector<Float_t> *fMVAvalues; // mva values for the last tr
ained method | | std::vector<Float_t> *fMVAvalues; // mva values for the last tr
ained method | |
| | | | |
| DataSetManager* fDataSetManager; // DSMTEST | | DataSetManager* fDataSetManager; // DSMTEST | |
| friend class Factory; // DSMTEST | | friend class Factory; // DSMTEST | |
| friend class Reader; // DSMTEST | | friend class Reader; // DSMTEST | |
| | | | |
|
| | | TString fHistoricOption; //historic variable, only needed for "Com | |
| | | patibilityOptions" | |
| | | Bool_t fHistoricBoolOption; //historic variable, only needed for "Com | |
| | | patibilityOptions" | |
| | | | |
| protected: | | protected: | |
| | | | |
| // get help message text | | // get help message text | |
| void GetHelpMessage() const; | | void GetHelpMessage() const; | |
| | | | |
| ClassDef(MethodBoost,0) | | ClassDef(MethodBoost,0) | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 59 lines changed or deleted | | 49 lines changed or added | |
|
| MethodDT.h | | MethodDT.h | |
| | | | |
| skipping to change at line 85 | | skipping to change at line 85 | |
| virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t num
berClasses, UInt_t numberTargets ); | | virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t num
berClasses, UInt_t numberTargets ); | |
| | | | |
| void Train( void ); | | void Train( void ); | |
| | | | |
| using MethodBase::ReadWeightsFromStream; | | using MethodBase::ReadWeightsFromStream; | |
| | | | |
| // write weights to file | | // write weights to file | |
| void AddWeightsXMLTo( void* parent ) const; | | void AddWeightsXMLTo( void* parent ) const; | |
| | | | |
| // read weights from file | | // read weights from file | |
|
| void ReadWeightsFromStream( istream& istr ); | | void ReadWeightsFromStream( std::istream& istr ); | |
| void ReadWeightsFromXML ( void* wghtnode ); | | void ReadWeightsFromXML ( void* wghtnode ); | |
| | | | |
| // calculate the MVA value | | // calculate the MVA value | |
| Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 ); | | Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 ); | |
| | | | |
| // the option handling methods | | // the option handling methods | |
| void DeclareOptions(); | | void DeclareOptions(); | |
| void ProcessOptions(); | | void ProcessOptions(); | |
|
| | | void DeclareCompatibilityOptions(); | |
| | | | |
| void GetHelpMessage() const; | | void GetHelpMessage() const; | |
| | | | |
| // ranking of input variables | | // ranking of input variables | |
| const Ranking* CreateRanking(); | | const Ranking* CreateRanking(); | |
| | | | |
|
| Double_t PruneTree(const Int_t methodIndex); | | Double_t PruneTree( ); | |
| | | | |
| Double_t TestTreeQuality( DecisionTree *dt ); | | Double_t TestTreeQuality( DecisionTree *dt ); | |
| | | | |
| Double_t GetPruneStrength () { return fPruneStrength; } | | Double_t GetPruneStrength () { return fPruneStrength; } | |
| | | | |
|
| Bool_t MonitorBoost( MethodBoost* booster); | | void SetMinNodeSize(Double_t sizeInPercent); | |
| | | void SetMinNodeSize(TString sizeInPercent); | |
| | | | |
| | | Int_t GetNNodesBeforePruning(){return fTree->GetNNodesBeforePruning() | |
| | | ;} | |
| | | Int_t GetNNodes(){return fTree->GetNNodes();} | |
| | | | |
| private: | | private: | |
| // Init used in the various constructors | | // Init used in the various constructors | |
| void Init( void ); | | void Init( void ); | |
| | | | |
| private: | | private: | |
| | | | |
| std::vector<Event*> fEventSample; // the training eve
nts | | std::vector<Event*> fEventSample; // the training eve
nts | |
| | | | |
| DecisionTree* fTree; // the decision tre
e | | DecisionTree* fTree; // the decision tre
e | |
| //options for the decision Tree | | //options for the decision Tree | |
| SeparationBase *fSepType; // the separation u
sed in node splitting | | SeparationBase *fSepType; // the separation u
sed in node splitting | |
| TString fSepTypeS; // the separation (
option string) used in node splitting | | TString fSepTypeS; // the separation (
option string) used in node splitting | |
|
| Int_t fNodeMinEvents; // min number of ev | | Int_t fMinNodeEvents; // min number of ev | |
| ents in node | | ents in node | |
| | | Float_t fMinNodeSize; // min percentage o | |
| | | f training events in node | |
| | | TString fMinNodeSizeS; // string containin | |
| | | g min percentage of training events in node | |
| | | | |
| Int_t fNCuts; // grid used in cut
applied in node splitting | | Int_t fNCuts; // grid used in cut
applied in node splitting | |
| Bool_t fUseYesNoLeaf; // use sig or bkg c
lassification in leave nodes or sig/bkg | | Bool_t fUseYesNoLeaf; // use sig or bkg c
lassification in leave nodes or sig/bkg | |
| Double_t fNodePurityLimit; // purity limit for
sig/bkg nodes | | Double_t fNodePurityLimit; // purity limit for
sig/bkg nodes | |
|
| UInt_t fNNodesMax; // max # of nodes | | | |
| UInt_t fMaxDepth; // max depth | | UInt_t fMaxDepth; // max depth | |
| | | | |
| Double_t fErrorFraction; // ntuple var: mis
classification error fraction | | Double_t fErrorFraction; // ntuple var: mis
classification error fraction | |
| Double_t fPruneStrength; // a parameter to
set the "amount" of pruning..needs to be adjusted | | Double_t fPruneStrength; // a parameter to
set the "amount" of pruning..needs to be adjusted | |
| DecisionTree::EPruneMethod fPruneMethod; // method used for
prunig | | DecisionTree::EPruneMethod fPruneMethod; // method used for
prunig | |
| TString fPruneMethodS; // prune method op
tion String | | TString fPruneMethodS; // prune method op
tion String | |
| Bool_t fAutomatic; // use user given
prune strength or automatically determined one using a validation sample | | Bool_t fAutomatic; // use user given
prune strength or automatically determined one using a validation sample | |
| Bool_t fRandomisedTrees; // choose a random
subset of possible cut variables at each node during training | | Bool_t fRandomisedTrees; // choose a random
subset of possible cut variables at each node during training | |
| Int_t fUseNvars; // the number of v
ariables used in the randomised tree splitting | | Int_t fUseNvars; // the number of v
ariables used in the randomised tree splitting | |
|
| Bool_t fPruneBeforeBoost; //whether to prun | | Bool_t fUsePoissonNvars; // fUseNvars is us | |
| e right after the training (before the boosting) | | ed as a poisson mean, and the actual value of useNvars is at each step draw | |
| | | n form that distribution | |
| std::vector<Double_t> fVariableImportance; // the relative
importance of the different variables | | std::vector<Double_t> fVariableImportance; // the relative
importance of the different variables | |
| | | | |
| Double_t fDeltaPruneStrength; // step size in
pruning, is adjusted according to experience of previous trees | | Double_t fDeltaPruneStrength; // step size in
pruning, is adjusted according to experience of previous trees | |
| // debugging flags | | // debugging flags | |
| static const Int_t fgDebugLevel = 0; // debug level determining
some printout/control plots etc. | | static const Int_t fgDebugLevel = 0; // debug level determining
some printout/control plots etc. | |
| | | | |
|
| | | Bool_t fPruneBeforeBoost; //aincient variable, only needed for "Compa | |
| | | tibilityOptions" | |
| | | | |
| ClassDef(MethodDT,0) // Analysis of Decision Trees | | ClassDef(MethodDT,0) // Analysis of Decision Trees | |
| | | | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 8 change blocks. |
| 9 lines changed or deleted | | 21 lines changed or added | |
|
| OptimizeConfigParameters.h | | OptimizeConfigParameters.h | |
| | | | |
| skipping to change at line 66 | | skipping to change at line 66 | |
| | | | |
| namespace TMVA { | | namespace TMVA { | |
| | | | |
| class MethodBase; | | class MethodBase; | |
| class MsgLogger; | | class MsgLogger; | |
| class OptimizeConfigParameters : public IFitterTarget { | | class OptimizeConfigParameters : public IFitterTarget { | |
| | | | |
| public: | | public: | |
| | | | |
| //default constructor | | //default constructor | |
|
| OptimizeConfigParameters(MethodBase * const method, std::map<TString,
TMVA::Interval> tuneParameters, TString fomType="Separation", TString optim
izationType = "GA"); | | OptimizeConfigParameters(MethodBase * const method, std::map<TString,
TMVA::Interval*> tuneParameters, TString fomType="Separation", TString opti
mizationType = "GA"); | |
| | | | |
| // destructor | | // destructor | |
| virtual ~OptimizeConfigParameters(); | | virtual ~OptimizeConfigParameters(); | |
| // could later be changed to be set via option string... | | // could later be changed to be set via option string... | |
| // but for now it's impler like this | | // but for now it's impler like this | |
| std::map<TString,Double_t> optimize(); | | std::map<TString,Double_t> optimize(); | |
| | | | |
| private: | | private: | |
| std::vector< int > GetScanIndices( int val, std::vector<int> base); | | std::vector< int > GetScanIndices( int val, std::vector<int> base); | |
| void optimizeScan(); | | void optimizeScan(); | |
| | | | |
| skipping to change at line 94 | | skipping to change at line 94 | |
| | | | |
| void GetMVADists(); | | void GetMVADists(); | |
| Double_t GetSeparation(); | | Double_t GetSeparation(); | |
| Double_t GetROCIntegral(); | | Double_t GetROCIntegral(); | |
| Double_t GetSigEffAtBkgEff( Double_t bkgEff = 0.1); | | Double_t GetSigEffAtBkgEff( Double_t bkgEff = 0.1); | |
| Double_t GetBkgEffAtSigEff( Double_t sigEff = 0.5); | | Double_t GetBkgEffAtSigEff( Double_t sigEff = 0.5); | |
| Double_t GetBkgRejAtSigEff( Double_t sigEff = 0.5); | | Double_t GetBkgRejAtSigEff( Double_t sigEff = 0.5); | |
| | | | |
| MethodBase* const fMethod; // The MVA method to be evaluated | | MethodBase* const fMethod; // The MVA method to be evaluated | |
| std::vector<Float_t> fFOMvsIter; // graph showing the dev
elompment of the Figure Of Merit values during the fit | | std::vector<Float_t> fFOMvsIter; // graph showing the dev
elompment of the Figure Of Merit values during the fit | |
|
| std::map<TString,TMVA::Interval> fTuneParameters; // parameters inclu
ded in the tuning | | std::map<TString,TMVA::Interval*> fTuneParameters; // parameters incl
uded in the tuning | |
| std::map<TString,Double_t> fTunedParameters; // parameters incl
uded in the tuning | | std::map<TString,Double_t> fTunedParameters; // parameters incl
uded in the tuning | |
| std::map< std::vector<Double_t> , Double_t> fAlreadyTrainedParCombin
ation; // save parameters for which the FOM is already known (GA seems to e
valuate the same parameters several times) | | std::map< std::vector<Double_t> , Double_t> fAlreadyTrainedParCombin
ation; // save parameters for which the FOM is already known (GA seems to e
valuate the same parameters several times) | |
| TString fFOMType; // the FOM type (Separation, ROC integ
ra.. whaeter you implemented.. | | TString fFOMType; // the FOM type (Separation, ROC integ
ra.. whaeter you implemented.. | |
| TString fOptimizationFitType; // which type of optimisation
procedure to be used | | TString fOptimizationFitType; // which type of optimisation
procedure to be used | |
| TH1D *fMvaSig; // MVA distrituion for signal events, used
for spline fit | | TH1D *fMvaSig; // MVA distrituion for signal events, used
for spline fit | |
| TH1D *fMvaBkg; // MVA distrituion for bakgr. events, used
for spline fit | | TH1D *fMvaBkg; // MVA distrituion for bakgr. events, used
for spline fit | |
| | | | |
| TH1D *fMvaSigFineBin; // MVA distrituion for signal event
s | | TH1D *fMvaSigFineBin; // MVA distrituion for signal event
s | |
| TH1D *fMvaBkgFineBin; // MVA distrituion for bakgr. event
s | | TH1D *fMvaBkgFineBin; // MVA distrituion for bakgr. event
s | |
| | | | |
|
| | | Bool_t fNotDoneYet; // flat to indicate of Method Transform | |
| | | ations have been optained yet or not (normally done in MethodBase::TrainMet | |
| | | hod) | |
| | | | |
| mutable MsgLogger* fLogger; // message logger | | mutable MsgLogger* fLogger; // message logger | |
| MsgLogger& Log() const { return *fLogger; } | | MsgLogger& Log() const { return *fLogger; } | |
| | | | |
| ClassDef(OptimizeConfigParameters,0) // Interface to different separa
tion critiera used in training algorithms | | ClassDef(OptimizeConfigParameters,0) // Interface to different separa
tion critiera used in training algorithms | |
| }; | | }; | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 2 lines changed or deleted | | 6 lines changed or added | |
|
| Option.h | | Option.h | |
| | | | |
| skipping to change at line 36 | | skipping to change at line 36 | |
| * (http://mva.sourceforge.net/license.txt)
* | | * (http://mva.sourceforge.net/license.txt)
* | |
| **************************************************************************
********/ | | **************************************************************************
********/ | |
| | | | |
| #ifndef ROOT_TMVA_Option | | #ifndef ROOT_TMVA_Option | |
| #define ROOT_TMVA_Option | | #define ROOT_TMVA_Option | |
| | | | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| // // | | // // | |
| // Option // | | // Option // | |
| // // | | // // | |
|
| // Class for MVA-option handling // | | // Class for TMVA-option handling // | |
| // // | | // // | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| | | | |
| #include <iomanip> | | #include <iomanip> | |
| #include <sstream> | | #include <sstream> | |
| #include <vector> | | #include <vector> | |
| | | | |
| #ifndef ROOT_TObject | | #ifndef ROOT_TObject | |
| #include "TObject.h" | | #include "TObject.h" | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 83 | | skipping to change at line 83 | |
| | | | |
| Bool_t IsSet() const { return fIsSet; } | | Bool_t IsSet() const { return fIsSet; } | |
| virtual Bool_t IsArrayOpt() const = 0; | | virtual Bool_t IsArrayOpt() const = 0; | |
| const TString& Description() const { return fDescription; } | | const TString& Description() const { return fDescription; } | |
| virtual Bool_t IsPreDefinedVal(const TString&) const = 0; | | virtual Bool_t IsPreDefinedVal(const TString&) const = 0; | |
| virtual Bool_t HasPreDefinedVal() const = 0; | | virtual Bool_t HasPreDefinedVal() const = 0; | |
| virtual Int_t GetArraySize() const = 0; | | virtual Int_t GetArraySize() const = 0; | |
| virtual Bool_t SetValue( const TString& vs, Int_t i=-1 ); | | virtual Bool_t SetValue( const TString& vs, Int_t i=-1 ); | |
| | | | |
| using TObject::Print; | | using TObject::Print; | |
|
| virtual void Print( ostream&, Int_t levelofdetail=0 ) const = 0; | | virtual void Print( std::ostream&, Int_t levelofdetail=0 ) const = 0; | |
| | | | |
| private: | | private: | |
| | | | |
| virtual void SetValueLocal(const TString& vs, Int_t i=-1) = 0; | | virtual void SetValueLocal(const TString& vs, Int_t i=-1) = 0; | |
| | | | |
| const TString fName; // name of variable | | const TString fName; // name of variable | |
| TString fNameAllLower; // name of variable | | TString fNameAllLower; // name of variable | |
| const TString fDescription; // its description | | const TString fDescription; // its description | |
| Bool_t fIsSet; // set by user ? | | Bool_t fIsSet; // set by user ? | |
| | | | |
| | | | |
| skipping to change at line 123 | | skipping to change at line 123 | |
| virtual TString GetValue( Int_t i=-1 ) const; | | virtual TString GetValue( Int_t i=-1 ) const; | |
| virtual const T& Value ( Int_t i=-1 ) const; | | virtual const T& Value ( Int_t i=-1 ) const; | |
| virtual Bool_t HasPreDefinedVal() const { return (fPreDefs.size()!=0)
; } | | virtual Bool_t HasPreDefinedVal() const { return (fPreDefs.size()!=0)
; } | |
| virtual Bool_t IsPreDefinedVal( const TString& ) const; | | virtual Bool_t IsPreDefinedVal( const TString& ) const; | |
| virtual Bool_t IsArrayOpt() const { return kFALSE; } | | virtual Bool_t IsArrayOpt() const { return kFALSE; } | |
| virtual Int_t GetArraySize() const { return 0; } | | virtual Int_t GetArraySize() const { return 0; } | |
| | | | |
| // setters | | // setters | |
| virtual void AddPreDefVal(const T&); | | virtual void AddPreDefVal(const T&); | |
| using OptionBase::Print; | | using OptionBase::Print; | |
|
| virtual void Print ( ostream&, Int_t levelofdetail=0 ) const; | | virtual void Print ( std::ostream&, Int_t levelofdetail=0 ) con | |
| virtual void PrintPreDefs( ostream&, Int_t levelofdetail=0 ) const; | | st; | |
| | | virtual void PrintPreDefs( std::ostream&, Int_t levelofdetail=0 ) con | |
| | | st; | |
| | | | |
| protected: | | protected: | |
| | | | |
| T& Value(Int_t=-1); | | T& Value(Int_t=-1); | |
| | | | |
| virtual void SetValueLocal( const TString& val, Int_t i=-1 ); | | virtual void SetValueLocal( const TString& val, Int_t i=-1 ); | |
| virtual Bool_t IsPreDefinedValLocal( const T& ) const; | | virtual Bool_t IsPreDefinedValLocal( const T& ) const; | |
| | | | |
| T* fRefPtr; | | T* fRefPtr; | |
| std::vector<T> fPreDefs; // templated vector | | std::vector<T> fPreDefs; // templated vector | |
| | | | |
| skipping to change at line 156 | | skipping to change at line 156 | |
| TString GetValue( Int_t i ) const { | | TString GetValue( Int_t i ) const { | |
| std::stringstream str; | | std::stringstream str; | |
| str << std::scientific << Value(i); | | str << std::scientific << Value(i); | |
| return str.str(); | | return str.str(); | |
| } | | } | |
| const T& Value( Int_t i ) const { return (*fVRefPtr)[i]; } | | const T& Value( Int_t i ) const { return (*fVRefPtr)[i]; } | |
| virtual Bool_t IsArrayOpt() const { return kTRUE; } | | virtual Bool_t IsArrayOpt() const { return kTRUE; } | |
| virtual Int_t GetArraySize() const { return fSize; } | | virtual Int_t GetArraySize() const { return fSize; } | |
| | | | |
| using Option<T>::Print; | | using Option<T>::Print; | |
|
| virtual void Print( ostream&, Int_t levelofdetail=0 ) const; | | virtual void Print( std::ostream&, Int_t levelofdetail=0 ) const; | |
| | | | |
| virtual Bool_t SetValue( const TString& val, Int_t i=0 ); | | virtual Bool_t SetValue( const TString& val, Int_t i=0 ); | |
| | | | |
| T& Value(Int_t i) { return (*fVRefPtr)[i]; } | | T& Value(Int_t i) { return (*fVRefPtr)[i]; } | |
| T ** fVRefPtr; | | T ** fVRefPtr; | |
| Int_t fSize; | | Int_t fSize; | |
| | | | |
| }; | | }; | |
| | | | |
| } // namespace | | } // namespace | |
| | | | |
| skipping to change at line 265 | | skipping to change at line 265 | |
| | | | |
| template<> | | template<> | |
| inline void TMVA::Option<Float_t>::AddPreDefVal( const Float_t& ) | | inline void TMVA::Option<Float_t>::AddPreDefVal( const Float_t& ) | |
| { | | { | |
| // template specialization for Float_t | | // template specialization for Float_t | |
| *fgLogger << kFATAL << "<AddPreDefVal> predefined values for Option<F
loat_t> don't make sense" | | *fgLogger << kFATAL << "<AddPreDefVal> predefined values for Option<F
loat_t> don't make sense" | |
| << Endl; | | << Endl; | |
| } | | } | |
| | | | |
| template<class T> | | template<class T> | |
|
| inline void TMVA::Option<T>::Print( ostream& os, Int_t levelofdetail ) c
onst | | inline void TMVA::Option<T>::Print( std::ostream& os, Int_t levelofdetai
l ) const | |
| { | | { | |
| // template specialization for TString printing | | // template specialization for TString printing | |
| os << TheName() << ": " << "\"" << GetValue() << "\"" << " [" << Desc
ription() << "]"; | | os << TheName() << ": " << "\"" << GetValue() << "\"" << " [" << Desc
ription() << "]"; | |
| this->PrintPreDefs(os,levelofdetail); | | this->PrintPreDefs(os,levelofdetail); | |
| } | | } | |
| | | | |
| template<class T> | | template<class T> | |
|
| inline void TMVA::Option<T*>::Print( ostream& os, Int_t levelofdetail )
const | | inline void TMVA::Option<T*>::Print( std::ostream& os, Int_t levelofdeta
il ) const | |
| { | | { | |
| // template specialization for TString printing | | // template specialization for TString printing | |
| for (Int_t i=0; i<fSize; i++) { | | for (Int_t i=0; i<fSize; i++) { | |
| if (i==0) | | if (i==0) | |
| os << this->TheName() << "[" << i << "]: " << "\"" << this->Get
Value(i) << "\"" << " [" << this->Description() << "]"; | | os << this->TheName() << "[" << i << "]: " << "\"" << this->Get
Value(i) << "\"" << " [" << this->Description() << "]"; | |
| else | | else | |
| os << " " << this->TheName() << "[" << i << "]: " << "\"" <<
this->GetValue(i) << "\""; | | os << " " << this->TheName() << "[" << i << "]: " << "\"" <<
this->GetValue(i) << "\""; | |
| if (i!=fSize-1) os << std::endl; | | if (i!=fSize-1) os << std::endl; | |
| } | | } | |
| this->PrintPreDefs(os,levelofdetail); | | this->PrintPreDefs(os,levelofdetail); | |
| } | | } | |
| | | | |
| //______________________________________________________________________ | | //______________________________________________________________________ | |
| template<class T> | | template<class T> | |
|
| inline void TMVA::Option<T>::PrintPreDefs( ostream& os, Int_t levelofdet
ail ) const | | inline void TMVA::Option<T>::PrintPreDefs( std::ostream& os, Int_t level
ofdetail ) const | |
| { | | { | |
| // template specialization for TString printing | | // template specialization for TString printing | |
| if (HasPreDefinedVal() && levelofdetail>0) { | | if (HasPreDefinedVal() && levelofdetail>0) { | |
| os << std::endl << "PreDefined - possible values are:" << std::end
l; | | os << std::endl << "PreDefined - possible values are:" << std::end
l; | |
| typename std::vector<T>::const_iterator predefIt; | | typename std::vector<T>::const_iterator predefIt; | |
| predefIt = fPreDefs.begin(); | | predefIt = fPreDefs.begin(); | |
| for (;predefIt!=fPreDefs.end(); predefIt++) { | | for (;predefIt!=fPreDefs.end(); predefIt++) { | |
| os << " "; | | os << " "; | |
| os << " - " << (*predefIt) << std::endl; | | os << " - " << (*predefIt) << std::endl; | |
| } | | } | |
| | | | |
End of changes. 7 change blocks. |
| 8 lines changed or deleted | | 10 lines changed or added | |
|
| PDEFoam.h | | PDEFoam.h | |
| | | | |
| skipping to change at line 79 | | skipping to change at line 79 | |
| // separation types | | // separation types | |
| enum EDTSeparation { kFoam, kGiniIndex, kMisClassificationError, | | enum EDTSeparation { kFoam, kGiniIndex, kMisClassificationError, | |
| kCrossEntropy, kGiniIndexWithLaplace, kSdivSqrtSplus
B }; | | kCrossEntropy, kGiniIndexWithLaplace, kSdivSqrtSplus
B }; | |
| | | | |
| // foam types | | // foam types | |
| enum EFoamType { kSeparate, kDiscr, kMonoTarget, kMultiTarget, kMultiCla
ss }; | | enum EFoamType { kSeparate, kDiscr, kMonoTarget, kMultiTarget, kMultiCla
ss }; | |
| | | | |
| // enum type for possible foam cell values | | // enum type for possible foam cell values | |
| // kValue : cell value who's rms is minimized | | // kValue : cell value who's rms is minimized | |
| // kValueError : error on kValue | | // kValueError : error on kValue | |
|
| // kValueDensity : volume density of kValue | | // kValueDensity : kValue / cell volume | |
| // kMeanValue : mean sampling value (saved in fIntegral) | | // kMeanValue : mean sampling value (saved in fIntegral) | |
| // kRms : rms of sampling distribution (saved in fDriver) | | // kRms : rms of sampling distribution (saved in fDriver) | |
| // kRmsOvMean : rms/mean of sampling distribution (saved in | | // kRmsOvMean : rms/mean of sampling distribution (saved in | |
| // fDriver and fIntegral) | | // fDriver and fIntegral) | |
|
| | | // kCellVolume : volume of cell | |
| enum ECellValue { kValue, kValueError, kValueDensity, kMeanValue, | | enum ECellValue { kValue, kValueError, kValueDensity, kMeanValue, | |
| kRms, kRmsOvMean, kCellVolume }; | | kRms, kRmsOvMean, kCellVolume }; | |
| } | | } | |
| | | | |
| #ifndef ROOT_TMVA_PDEFoamDensityBase | | #ifndef ROOT_TMVA_PDEFoamDensityBase | |
| #include "TMVA/PDEFoamDensityBase.h" | | #include "TMVA/PDEFoamDensityBase.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TMVA_PDEFoamVect | | #ifndef ROOT_TMVA_PDEFoamVect | |
| #include "TMVA/PDEFoamVect.h" | | #include "TMVA/PDEFoamVect.h" | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 197 | | skipping to change at line 198 | |
| PDEFoam(const PDEFoam&); // Copy Constructor NOT USED | | PDEFoam(const PDEFoam&); // Copy Constructor NOT USED | |
| | | | |
| // ---------- Public functions ---------------------------------- | | // ---------- Public functions ---------------------------------- | |
| public: | | public: | |
| PDEFoam(); // Default constructor (used only by ROOT
streamer) | | PDEFoam(); // Default constructor (used only by ROOT
streamer) | |
| PDEFoam(const TString&); // Principal user-defined constructor | | PDEFoam(const TString&); // Principal user-defined constructor | |
| virtual ~PDEFoam(); // Default destructor | | virtual ~PDEFoam(); // Default destructor | |
| | | | |
| // ---------- Foam creation functions | | // ---------- Foam creation functions | |
| | | | |
|
| void Initialize(){}; // initialize the PDEFoam | | void Initialize() {} // initialize the PDEFoam | |
| void FillBinarySearchTree( const Event* ev ); // fill event into BST | | void FillBinarySearchTree( const Event* ev ); // fill event into BST | |
| void Create(); // build-up foam | | void Create(); // build-up foam | |
| | | | |
| // function to fill created cell with given value | | // function to fill created cell with given value | |
| virtual void FillFoamCells(const Event* ev, Float_t wt); | | virtual void FillFoamCells(const Event* ev, Float_t wt); | |
| | | | |
| // remove all cell elements | | // remove all cell elements | |
| void ResetCellElements(); | | void ResetCellElements(); | |
| | | | |
| // function to call after foam is grown | | // function to call after foam is grown | |
|
| virtual void Finalize(){}; | | virtual void Finalize() {} | |
| | | | |
| // ---------- Getters and Setters | | // ---------- Getters and Setters | |
| | | | |
| void SetDim(Int_t kDim); // Sets dimension of cubical space | | void SetDim(Int_t kDim); // Sets dimension of cubical space | |
| void SetnCells(Long_t nCells){fNCells =nCells;} // Sets maximum numb
er of cells | | void SetnCells(Long_t nCells){fNCells =nCells;} // Sets maximum numb
er of cells | |
| void SetnSampl(Long_t nSampl){fNSampl =nSampl;} // Sets no of MC eve
nts in cell exploration | | void SetnSampl(Long_t nSampl){fNSampl =nSampl;} // Sets no of MC eve
nts in cell exploration | |
| void SetnBin(Int_t nBin){fNBin = nBin;} // Sets no of bins i
n histogs in cell exploration | | void SetnBin(Int_t nBin){fNBin = nBin;} // Sets no of bins i
n histogs in cell exploration | |
| void SetEvPerBin(Int_t EvPerBin){fEvPerBin =EvPerBin;} // Sets max. n
o. of effective events per bin | | void SetEvPerBin(Int_t EvPerBin){fEvPerBin =EvPerBin;} // Sets max. n
o. of effective events per bin | |
| void SetInhiDiv(Int_t, Int_t ); // Set inhibition of cell division al
ong certain edge | | void SetInhiDiv(Int_t, Int_t ); // Set inhibition of cell division al
ong certain edge | |
| void SetDensity(PDEFoamDensityBase *dens) { fDistr = dens; } | | void SetDensity(PDEFoamDensityBase *dens) { fDistr = dens; } | |
| | | | |
| // coverity[ -tainted_data_return ] | | // coverity[ -tainted_data_return ] | |
| Int_t GetTotDim() const {return fDim; } // Get total dimension | | Int_t GetTotDim() const {return fDim; } // Get total dimension | |
| TString GetFoamName() const {return fName; } // Get name of foam | | TString GetFoamName() const {return fName; } // Get name of foam | |
|
| UInt_t GetNActiveCells() const {return fNoAct;}; // returns numbe | | UInt_t GetNActiveCells() const {return fNoAct;} // returns number | |
| r of active cells | | of active cells | |
| UInt_t GetNInActiveCells() const {return GetNCells()-GetNActiveCell | | UInt_t GetNInActiveCells() const {return GetNCells()-GetNActiveCell | |
| s();}; // returns number of not active cells | | s();} // returns number of not active cells | |
| UInt_t GetNCells() const {return fNCells;}; // returns nu | | UInt_t GetNCells() const {return fNCells;} // returns num | |
| mber of cells | | ber of cells | |
| PDEFoamCell* GetRootCell() const {return fCells[0];}; // get pointe | | PDEFoamCell* GetRootCell() const {return fCells[0];} // get pointer | |
| r to root cell | | to root cell | |
| | | | |
| // Getters and Setters for user cut options | | // Getters and Setters for user cut options | |
| void SetNmin(UInt_t val) { fNmin=val; } | | void SetNmin(UInt_t val) { fNmin=val; } | |
| UInt_t GetNmin() { return fNmin; } | | UInt_t GetNmin() { return fNmin; } | |
| void SetMaxDepth(UInt_t maxdepth) { fMaxDepth = maxdepth; } | | void SetMaxDepth(UInt_t maxdepth) { fMaxDepth = maxdepth; } | |
| UInt_t GetMaxDepth() const { return fMaxDepth; } | | UInt_t GetMaxDepth() const { return fMaxDepth; } | |
| | | | |
| // Getters and Setters for foam boundaries | | // Getters and Setters for foam boundaries | |
| void SetXmin(Int_t idim, Double_t wmin); | | void SetXmin(Int_t idim, Double_t wmin); | |
| void SetXmax(Int_t idim, Double_t wmax); | | void SetXmax(Int_t idim, Double_t wmax); | |
| | | | |
End of changes. 5 change blocks. |
| 11 lines changed or deleted | | 12 lines changed or added | |
|
| RooAbsArg.h | | RooAbsArg.h | |
| | | | |
| skipping to change at line 72 | | skipping to change at line 72 | |
| } ; | | } ; | |
| | | | |
| class RooAbsArg : public TNamed, public RooPrintable { | | class RooAbsArg : public TNamed, public RooPrintable { | |
| public: | | public: | |
| | | | |
| // Constructors, cloning and assignment | | // Constructors, cloning and assignment | |
| RooAbsArg() ; | | RooAbsArg() ; | |
| virtual ~RooAbsArg(); | | virtual ~RooAbsArg(); | |
| RooAbsArg(const char *name, const char *title); | | RooAbsArg(const char *name, const char *title); | |
| RooAbsArg(const RooAbsArg& other, const char* name=0) ; | | RooAbsArg(const RooAbsArg& other, const char* name=0) ; | |
|
| virtual TObject* clone(const char* newname) const = 0 ; | | virtual TObject* clone(const char* newname=0) const = 0 ; | |
| virtual TObject* Clone(const char* newname=0) const { | | virtual TObject* Clone(const char* newname=0) const { | |
|
| return clone(newname?newname:GetName()) ; | | return clone(newname) ; | |
| } | | } | |
| virtual RooAbsArg* cloneTree(const char* newname=0) const ; | | virtual RooAbsArg* cloneTree(const char* newname=0) const ; | |
| | | | |
| // Accessors to client-server relation information | | // Accessors to client-server relation information | |
| virtual Bool_t isDerived() const { | | virtual Bool_t isDerived() const { | |
| // Does value or shape of this arg depend on any other arg? | | // Does value or shape of this arg depend on any other arg? | |
| return kTRUE ; | | return kTRUE ; | |
| //std::cout << IsA()->GetName() << "::isDerived(" << GetName() << ") =
" << (_serverList.GetSize()>0 || _proxyList.GetSize()>0) << std::endl ; | | //std::cout << IsA()->GetName() << "::isDerived(" << GetName() << ") =
" << (_serverList.GetSize()>0 || _proxyList.GetSize()>0) << std::endl ; | |
| //return (_serverList.GetSize()>0 || _proxyList.GetSize()>0)?kTRUE:kFAL
SE; | | //return (_serverList.GetSize()>0 || _proxyList.GetSize()>0)?kTRUE:kFAL
SE; | |
| } | | } | |
| | | | |
| skipping to change at line 485 | | skipping to change at line 485 | |
| virtual void serverNameChangeHook(const RooAbsArg* /*oldServer*/, const R
ooAbsArg* /*newServer*/) { } ; | | virtual void serverNameChangeHook(const RooAbsArg* /*oldServer*/, const R
ooAbsArg* /*newServer*/) { } ; | |
| | | | |
| void addServer(RooAbsArg& server, Bool_t valueProp=kTRUE, Bool_t shapePro
p=kFALSE) ; | | void addServer(RooAbsArg& server, Bool_t valueProp=kTRUE, Bool_t shapePro
p=kFALSE) ; | |
| void addServerList(RooAbsCollection& serverList, Bool_t valueProp=kTRUE,
Bool_t shapeProp=kFALSE) ; | | void addServerList(RooAbsCollection& serverList, Bool_t valueProp=kTRUE,
Bool_t shapeProp=kFALSE) ; | |
| void replaceServer(RooAbsArg& oldServer, RooAbsArg& newServer, Bool_t val
ueProp, Bool_t shapeProp) ; | | void replaceServer(RooAbsArg& oldServer, RooAbsArg& newServer, Bool_t val
ueProp, Bool_t shapeProp) ; | |
| void changeServer(RooAbsArg& server, Bool_t valueProp, Bool_t shapeProp)
; | | void changeServer(RooAbsArg& server, Bool_t valueProp, Bool_t shapeProp)
; | |
| void removeServer(RooAbsArg& server, Bool_t force=kFALSE) ; | | void removeServer(RooAbsArg& server, Bool_t force=kFALSE) ; | |
| RooAbsArg *findNewServer(const RooAbsCollection &newSet, Bool_t nameChang
e) const; | | RooAbsArg *findNewServer(const RooAbsCollection &newSet, Bool_t nameChang
e) const; | |
| | | | |
| RooExpensiveObjectCache& expensiveObjectCache() const ; | | RooExpensiveObjectCache& expensiveObjectCache() const ; | |
|
| void setExpensiveObjectCache(RooExpensiveObjectCache& cache) { _eocache =
&cache ; } | | virtual void setExpensiveObjectCache(RooExpensiveObjectCache& cache) { _e
ocache = &cache ; } | |
| | | | |
| virtual Bool_t importWorkspaceHook(RooWorkspace&) { return kFALSE ; } ; | | virtual Bool_t importWorkspaceHook(RooWorkspace&) { return kFALSE ; } ; | |
| | | | |
| protected: | | protected: | |
| | | | |
| // Proxy management | | // Proxy management | |
| friend class RooAddModel ; | | friend class RooAddModel ; | |
| friend class RooArgProxy ; | | friend class RooArgProxy ; | |
| friend class RooSetProxy ; | | friend class RooSetProxy ; | |
| friend class RooListProxy ; | | friend class RooListProxy ; | |
| | | | |
End of changes. 3 change blocks. |
| 3 lines changed or deleted | | 3 lines changed or added | |
|
| RooDataHist.h | | RooDataHist.h | |
| | | | |
| skipping to change at line 19 | | skipping to change at line 19 | |
| * Copyright (c) 2000-2005, Regents of the University of California
* | | * Copyright (c) 2000-2005, Regents of the University of California
* | |
| * and Stanford University. All rights reserved.
* | | * and Stanford University. All rights reserved.
* | |
| *
* | | *
* | |
| * Redistribution and use in source and binary forms,
* | | * Redistribution and use in source and binary forms,
* | |
| * with or without modification, are permitted according to the terms
* | | * with or without modification, are permitted according to the terms
* | |
| * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
* | | * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
* | |
| **************************************************************************
***/ | | **************************************************************************
***/ | |
| #ifndef ROO_DATA_HIST | | #ifndef ROO_DATA_HIST | |
| #define ROO_DATA_HIST | | #define ROO_DATA_HIST | |
| | | | |
|
| | | #include <map> | |
| | | #include <vector> | |
| | | #include <string> | |
| | | #include <utility> | |
| | | | |
| #include "RooAbsData.h" | | #include "RooAbsData.h" | |
| #include "RooDirItem.h" | | #include "RooDirItem.h" | |
| #include "RooArgSet.h" | | #include "RooArgSet.h" | |
| #include "RooNameSet.h" | | #include "RooNameSet.h" | |
| #include "RooCacheManager.h" | | #include "RooCacheManager.h" | |
|
| #include <vector> | | | |
| #include <list> | | | |
| #include <map> | | | |
| #include <string> | | | |
| | | | |
| class TObject ; | | class TObject ; | |
| class RooAbsArg; | | class RooAbsArg; | |
| class RooAbsReal ; | | class RooAbsReal ; | |
| class RooAbsCategory ; | | class RooAbsCategory ; | |
| class Roo1DTable ; | | class Roo1DTable ; | |
| class RooPlot; | | class RooPlot; | |
| class RooArgSet ; | | class RooArgSet ; | |
| class RooLinkedList ; | | class RooLinkedList ; | |
| class RooAbsLValue ; | | class RooAbsLValue ; | |
| | | | |
| skipping to change at line 92 | | skipping to change at line 93 | |
| virtual Double_t sumEntries() const ; | | virtual Double_t sumEntries() const ; | |
| virtual Double_t sumEntries(const char* cutSpec, const char* cutRange=0)
const ; | | virtual Double_t sumEntries(const char* cutSpec, const char* cutRange=0)
const ; | |
| virtual Bool_t isWeighted() const { | | virtual Bool_t isWeighted() const { | |
| // Return true as all histograms have in principle events weight != 1 | | // Return true as all histograms have in principle events weight != 1 | |
| return kTRUE ; | | return kTRUE ; | |
| } | | } | |
| virtual Bool_t isNonPoissonWeighted() const ; | | virtual Bool_t isNonPoissonWeighted() const ; | |
| | | | |
| Double_t sum(Bool_t correctForBinSize, Bool_t inverseCorr=kFALSE) const ; | | Double_t sum(Bool_t correctForBinSize, Bool_t inverseCorr=kFALSE) const ; | |
| Double_t sum(const RooArgSet& sumSet, const RooArgSet& sliceSet, Bool_t c
orrectForBinSize, Bool_t inverseCorr=kFALSE) ; | | Double_t sum(const RooArgSet& sumSet, const RooArgSet& sliceSet, Bool_t c
orrectForBinSize, Bool_t inverseCorr=kFALSE) ; | |
|
| | | Double_t sum(const RooArgSet& sumSet, const RooArgSet& sliceSet, Bool_t c
orrectForBinSize, Bool_t inverseCorr, const std::map<const RooAbsArg*, std:
:pair<Double_t, Double_t> >& ranges); | |
| | | | |
| virtual Double_t weight() const { | | virtual Double_t weight() const { | |
| // Return weight of current bin | | // Return weight of current bin | |
| return _curWeight ; | | return _curWeight ; | |
| } | | } | |
| Double_t weightSquared() const ; | | Double_t weightSquared() const ; | |
| Double_t weight(const RooArgSet& bin, Int_t intOrder=1, Bool_t correctFor
BinSize=kFALSE, Bool_t cdfBoundaries=kFALSE, Bool_t oneSafe=kFALSE) ; | | Double_t weight(const RooArgSet& bin, Int_t intOrder=1, Bool_t correctFor
BinSize=kFALSE, Bool_t cdfBoundaries=kFALSE, Bool_t oneSafe=kFALSE) ; | |
| Double_t binVolume() const { return _curVolume ; } | | Double_t binVolume() const { return _curVolume ; } | |
| Double_t binVolume(const RooArgSet& bin) ; | | Double_t binVolume(const RooArgSet& bin) ; | |
| virtual Bool_t valid() const ; | | virtual Bool_t valid() const ; | |
| | | | |
| skipping to change at line 149 | | skipping to change at line 151 | |
| | | | |
| void setAllWeights(Double_t value) ; | | void setAllWeights(Double_t value) ; | |
| | | | |
| void initialize(const char* binningName=0,Bool_t fillTree=kTRUE) ; | | void initialize(const char* binningName=0,Bool_t fillTree=kTRUE) ; | |
| RooDataHist(const char* name, const char* title, RooDataHist* h, const Ro
oArgSet& varSubset, | | RooDataHist(const char* name, const char* title, RooDataHist* h, const Ro
oArgSet& varSubset, | |
| const RooFormulaVar* cutVar, const char* cutRange, Int_t nStar
t, Int_t nStop, Bool_t copyCache) ; | | const RooFormulaVar* cutVar, const char* cutRange, Int_t nStar
t, Int_t nStop, Bool_t copyCache) ; | |
| RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cu
tVar, const char* cutRange=0, | | RooAbsData* reduceEng(const RooArgSet& varSubset, const RooFormulaVar* cu
tVar, const char* cutRange=0, | |
| Int_t nStart=0, Int_t nStop=2000000000, Bool_t copyC
ache=kTRUE) ; | | Int_t nStart=0, Int_t nStop=2000000000, Bool_t copyC
ache=kTRUE) ; | |
| Double_t interpolateDim(RooRealVar& dim, const RooAbsBinning* binning, Do
uble_t xval, Int_t intOrder, Bool_t correctForBinSize, Bool_t cdfBoundaries
) ; | | Double_t interpolateDim(RooRealVar& dim, const RooAbsBinning* binning, Do
uble_t xval, Int_t intOrder, Bool_t correctForBinSize, Bool_t cdfBoundaries
) ; | |
| void calculatePartialBinVolume(const RooArgSet& dimSet) const ; | | void calculatePartialBinVolume(const RooArgSet& dimSet) const ; | |
|
| | | void checkBinBounds() const; | |
| | | | |
| void adjustBinning(const RooArgList& vars, TH1& href, Int_t* offset=0) ; | | void adjustBinning(const RooArgList& vars, TH1& href, Int_t* offset=0) ; | |
| void importTH1(const RooArgList& vars, TH1& histo, Double_t initWgt, Bool
_t doDensityCorrection) ; | | void importTH1(const RooArgList& vars, TH1& histo, Double_t initWgt, Bool
_t doDensityCorrection) ; | |
| void importTH1Set(const RooArgList& vars, RooCategory& indexCat, std::map
<std::string,TH1*> hmap, Double_t initWgt, Bool_t doDensityCorrection) ; | | void importTH1Set(const RooArgList& vars, RooCategory& indexCat, std::map
<std::string,TH1*> hmap, Double_t initWgt, Bool_t doDensityCorrection) ; | |
| void importDHistSet(const RooArgList& vars, RooCategory& indexCat, std::m
ap<std::string,RooDataHist*> dmap, Double_t initWgt) ; | | void importDHistSet(const RooArgList& vars, RooCategory& indexCat, std::m
ap<std::string,RooDataHist*> dmap, Double_t initWgt) ; | |
| | | | |
| virtual RooAbsData* cacheClone(const RooAbsArg* newCacheOwner, const RooA
rgSet* newCacheVars, const char* newName=0) ; | | virtual RooAbsData* cacheClone(const RooAbsArg* newCacheOwner, const RooA
rgSet* newCacheVars, const char* newName=0) ; | |
| | | | |
| Int_t _arrSize ; // Size of the weight array | | Int_t _arrSize ; // Size of the weight array | |
| std::vector<Int_t> _idxMult ; // Multiplier jump table for index calculat
ion | | std::vector<Int_t> _idxMult ; // Multiplier jump table for index calculat
ion | |
| | | | |
| skipping to change at line 179 | | skipping to change at line 182 | |
| | | | |
| mutable Double_t _curWeight ; // Weight associated with the current coord
inate | | mutable Double_t _curWeight ; // Weight associated with the current coord
inate | |
| mutable Double_t _curWgtErrLo ; // Error on weight associated with the cu
rrent coordinate | | mutable Double_t _curWgtErrLo ; // Error on weight associated with the cu
rrent coordinate | |
| mutable Double_t _curWgtErrHi ; // Error on weight associated with the cu
rrent coordinate | | mutable Double_t _curWgtErrHi ; // Error on weight associated with the cu
rrent coordinate | |
| mutable Double_t _curSumW2 ; // Current sum of weights^2 | | mutable Double_t _curSumW2 ; // Current sum of weights^2 | |
| mutable Double_t _curVolume ; // Volume of bin enclosing current coordina
te | | mutable Double_t _curVolume ; // Volume of bin enclosing current coordina
te | |
| mutable Int_t _curIndex ; // Current index | | mutable Int_t _curIndex ; // Current index | |
| | | | |
| mutable std::vector<Double_t>* _pbinv ; //! Partial bin volume array | | mutable std::vector<Double_t>* _pbinv ; //! Partial bin volume array | |
| mutable RooCacheManager<std::vector<Double_t> > _pbinvCacheMgr ; //! Cach
e manager for arrays of partial bin volumes | | mutable RooCacheManager<std::vector<Double_t> > _pbinvCacheMgr ; //! Cach
e manager for arrays of partial bin volumes | |
|
| std::list<RooAbsLValue*> _lvvars ; //! List of observables casted as RooA | | std::vector<RooAbsLValue*> _lvvars ; //! List of observables casted as Ro | |
| bsLValue | | oAbsLValue | |
| std::list<const RooAbsBinning*> _lvbins ; //! List of used binnings assoc | | std::vector<const RooAbsBinning*> _lvbins ; //! List of used binnings ass | |
| iated with lvalues | | ociated with lvalues | |
| | | mutable std::vector<std::vector<Double_t> > _binbounds; //! list of bin b | |
| | | ounds per dimension | |
| | | | |
| private: | | private: | |
| | | | |
| ClassDef(RooDataHist,4) // Binned data set | | ClassDef(RooDataHist,4) // Binned data set | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 8 lines changed or deleted | | 13 lines changed or added | |
|
| RooNLLVar.h | | RooNLLVar.h | |
| | | | |
| skipping to change at line 22 | | skipping to change at line 22 | |
| * Redistribution and use in source and binary forms,
* | | * Redistribution and use in source and binary forms,
* | |
| * with or without modification, are permitted according to the terms
* | | * with or without modification, are permitted according to the terms
* | |
| * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
* | | * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
* | |
| **************************************************************************
***/ | | **************************************************************************
***/ | |
| #ifndef ROO_NLL_VAR | | #ifndef ROO_NLL_VAR | |
| #define ROO_NLL_VAR | | #define ROO_NLL_VAR | |
| | | | |
| #include "RooAbsOptTestStatistic.h" | | #include "RooAbsOptTestStatistic.h" | |
| #include "RooCmdArg.h" | | #include "RooCmdArg.h" | |
| #include "RooAbsPdf.h" | | #include "RooAbsPdf.h" | |
|
| | | #include <vector> | |
| | | | |
| | | class RooRealSumPdf ; | |
| | | | |
| class RooNLLVar : public RooAbsOptTestStatistic { | | class RooNLLVar : public RooAbsOptTestStatistic { | |
| public: | | public: | |
| | | | |
| // Constructors, assignment etc | | // Constructors, assignment etc | |
| RooNLLVar() { _first = kTRUE ; } | | RooNLLVar() { _first = kTRUE ; } | |
| RooNLLVar(const char *name, const char* title, RooAbsPdf& pdf, RooAbsData
& data, | | RooNLLVar(const char *name, const char* title, RooAbsPdf& pdf, RooAbsData
& data, | |
|
| const RooCmdArg& arg1 , const RooCmdArg& arg2=Roo
CmdArg::none(),const RooCmdArg& arg3=RooCmdArg::none(), | | const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=R
ooCmdArg::none(),const RooCmdArg& arg3=RooCmdArg::none(), | |
| const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=R
ooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none(), | | const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=R
ooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none(), | |
| const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=R
ooCmdArg::none(),const RooCmdArg& arg9=RooCmdArg::none()) ; | | const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=R
ooCmdArg::none(),const RooCmdArg& arg9=RooCmdArg::none()) ; | |
| | | | |
| RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData
& data, | | RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData
& data, | |
|
| Bool_t extended=kFALSE, const char* rangeName=0, const char* add | | Bool_t extended, const char* rangeName=0, const char* addCoefRan | |
| CoefRangeName=0, | | geName=0, | |
| Int_t nCPU=1, RooFit::MPSplit interleave=RooFit::BulkPartition, | | Int_t nCPU=1, RooFit::MPSplit interleave=RooFit::BulkPartition, | |
| Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE, Bool_t cloneData=kTRUE) ; | | Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE, | |
| | | Bool_t cloneData=kTRUE, Bool_t binnedL=kFALSE) ; | |
| | | | |
| RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData
& data, | | RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData
& data, | |
| const RooArgSet& projDeps, Bool_t extended=kFALSE, const char* r
angeName=0, | | const RooArgSet& projDeps, Bool_t extended=kFALSE, const char* r
angeName=0, | |
|
| const char* addCoefRangeName=0, Int_t nCPU=1, RooFit::MPSplit in | | const char* addCoefRangeName=0, Int_t nCPU=1, RooFit::MPSplit in | |
| terleave=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFA | | terleave=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFA | |
| LSE, Bool_t cloneData=kTRUE) ; | | LSE, | |
| | | Bool_t cloneData=kTRUE, Bool_t binnedL=kFALSE) ; | |
| | | | |
| RooNLLVar(const RooNLLVar& other, const char* name=0); | | RooNLLVar(const RooNLLVar& other, const char* name=0); | |
| virtual TObject* clone(const char* newname) const { return new RooNLLVar(
*this,newname); } | | virtual TObject* clone(const char* newname) const { return new RooNLLVar(
*this,newname); } | |
| | | | |
| virtual RooAbsTestStatistic* create(const char *name, const char *title,
RooAbsReal& pdf, RooAbsData& adata, | | virtual RooAbsTestStatistic* create(const char *name, const char *title,
RooAbsReal& pdf, RooAbsData& adata, | |
| const RooArgSet& projDeps, const char*
rangeName, const char* addCoefRangeName=0, | | const RooArgSet& projDeps, const char*
rangeName, const char* addCoefRangeName=0, | |
|
| Int_t nCPU=1, RooFit::MPSplit interlea | | Int_t nCPU=1, RooFit::MPSplit interlea | |
| ve=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE) { | | ve=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE, B | |
| return new RooNLLVar(name,title,(RooAbsPdf&)pdf,adata,projDeps,_extende | | ool_t binnedL=kFALSE) { | |
| d,rangeName, addCoefRangeName, nCPU, interleave,verbose,splitRange,kFALSE) | | return new RooNLLVar(name,title,(RooAbsPdf&)pdf,adata,projDeps,_extende | |
| ; | | d,rangeName, addCoefRangeName, nCPU, interleave,verbose,splitRange,kFALSE,b | |
| | | innedL) ; | |
| } | | } | |
| | | | |
| virtual ~RooNLLVar(); | | virtual ~RooNLLVar(); | |
| | | | |
| void applyWeightSquared(Bool_t flag) ; | | void applyWeightSquared(Bool_t flag) ; | |
| | | | |
| virtual Double_t defaultErrorLevel() const { return 0.5 ; } | | virtual Double_t defaultErrorLevel() const { return 0.5 ; } | |
| | | | |
| protected: | | protected: | |
| | | | |
| | | | |
| skipping to change at line 69 | | skipping to change at line 74 | |
| | | | |
| static RooArgSet _emptySet ; // Supports named argument constructor | | static RooArgSet _emptySet ; // Supports named argument constructor | |
| | | | |
| Bool_t _extended ; | | Bool_t _extended ; | |
| virtual Double_t evaluatePartition(Int_t firstEvent, Int_t lastEvent, Int
_t stepSize) const ; | | virtual Double_t evaluatePartition(Int_t firstEvent, Int_t lastEvent, Int
_t stepSize) const ; | |
| Bool_t _weightSq ; // Apply weights squared? | | Bool_t _weightSq ; // Apply weights squared? | |
| mutable Bool_t _first ; //! | | mutable Bool_t _first ; //! | |
| Double_t _offsetSaveW2; //! | | Double_t _offsetSaveW2; //! | |
| Double_t _offsetCarrySaveW2; //! | | Double_t _offsetCarrySaveW2; //! | |
| | | | |
|
| | | mutable std::vector<Double_t> _binw ; //! | |
| | | mutable RooRealSumPdf* _binnedPdf ; //! | |
| | | | |
| ClassDef(RooNLLVar,2) // Function representing (extended) -log(L) of p.d.
f and dataset | | ClassDef(RooNLLVar,2) // Function representing (extended) -log(L) of p.d.
f and dataset | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 13 lines changed or deleted | | 22 lines changed or added | |
|
| RooSimWSTool.h | | RooSimWSTool.h | |
| | | | |
| skipping to change at line 76 | | skipping to change at line 76 | |
| | | | |
| ObjBuildConfig* validateConfig(BuildConfig& bc) ; | | ObjBuildConfig* validateConfig(BuildConfig& bc) ; | |
| RooSimultaneous* executeBuild(const char* simPdfName,ObjBuildConfig& obc,
Bool_t verbose=kTRUE) ; | | RooSimultaneous* executeBuild(const char* simPdfName,ObjBuildConfig& obc,
Bool_t verbose=kTRUE) ; | |
| std::string makeSplitName(const RooArgSet& splitCatSet) ; | | std::string makeSplitName(const RooArgSet& splitCatSet) ; | |
| | | | |
| RooWorkspace* _ws ; | | RooWorkspace* _ws ; | |
| | | | |
| ClassDef(RooSimWSTool,0) // Workspace oriented tool for customized clonin
g of p.d.f. into a simultaneous p.d.f | | ClassDef(RooSimWSTool,0) // Workspace oriented tool for customized clonin
g of p.d.f. into a simultaneous p.d.f | |
| } ; | | } ; | |
| | | | |
|
| | | class RooSimWSTool::SplitRule : public TNamed { | |
| | | public: | |
| | | SplitRule(const char* pdfName="") : TNamed(pdfName,pdfName) {} ; | |
| | | virtual ~SplitRule() {} ; | |
| | | void splitParameter(const char* paramList, const char* categoryList) ; | |
| | | void splitParameterConstrained(const char* paramNameList, const char* ca | |
| | | tegoryNameList, const char* remainderStateName) ; | |
| | | | |
| | | protected: | |
| | | | |
| | | friend class RooSimWSTool ; | |
| | | friend class BuildConfig ; | |
| | | friend class MultiBuildConfig ; | |
| | | void configure(const RooCmdArg& arg1=RooCmdArg::none(),const RooCmdArg& | |
| | | arg2=RooCmdArg::none(), | |
| | | const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& | |
| | | arg4=RooCmdArg::none(), | |
| | | const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& | |
| | | arg6=RooCmdArg::none()) ; | |
| | | | |
| | | std::list<std::string> _miSt | |
| | | ateNameList ; | |
| | | std::map<std::string, std::pair<std::list<std::string>,std::string> > _p | |
| | | aramSplitMap ; //<paramName,<std::list<splitCatSet>,remainderStateName>> | |
| | | ClassDef(SplitRule,0) // Split rule specification for prototype p.d.f | |
| | | } ; | |
| | | | |
| class RooSimWSTool::BuildConfig | | class RooSimWSTool::BuildConfig | |
| { | | { | |
| public: | | public: | |
| BuildConfig(const char* pdfName, SplitRule& sr) ; | | BuildConfig(const char* pdfName, SplitRule& sr) ; | |
| BuildConfig(const char* pdfName, const RooCmdArg& arg1=RooCmdArg::none(),
const RooCmdArg& arg2=RooCmdArg::none(), | | BuildConfig(const char* pdfName, const RooCmdArg& arg1=RooCmdArg::none(),
const RooCmdArg& arg2=RooCmdArg::none(), | |
| const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& arg4=
RooCmdArg::none(), | | const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& arg4=
RooCmdArg::none(), | |
| const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=
RooCmdArg::none()) ; | | const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=
RooCmdArg::none()) ; | |
| | | | |
| BuildConfig(const RooArgSet& legacyBuildConfig) ; | | BuildConfig(const RooArgSet& legacyBuildConfig) ; | |
| | | | |
| | | | |
| skipping to change at line 119 | | skipping to change at line 140 | |
| const RooCmdArg& arg1=RooCmdArg::none(),const RooCmdArg& arg2=
RooCmdArg::none(), | | const RooCmdArg& arg1=RooCmdArg::none(),const RooCmdArg& arg2=
RooCmdArg::none(), | |
| const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& arg4=
RooCmdArg::none(), | | const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& arg4=
RooCmdArg::none(), | |
| const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=
RooCmdArg::none()) ; | | const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=
RooCmdArg::none()) ; | |
| | | | |
| protected: | | protected: | |
| friend class RooSimWSTool ; | | friend class RooSimWSTool ; | |
| | | | |
| ClassDef(MultiBuildConfig,0) // Build configuration object for RooSimWSTo
ol with multiple prototype p.d.f. | | ClassDef(MultiBuildConfig,0) // Build configuration object for RooSimWSTo
ol with multiple prototype p.d.f. | |
| } ; | | } ; | |
| | | | |
|
| class RooSimWSTool::SplitRule : public TNamed { | | | |
| public: | | | |
| SplitRule(const char* pdfName="") : TNamed(pdfName,pdfName) {} ; | | | |
| virtual ~SplitRule() {} ; | | | |
| void splitParameter(const char* paramList, const char* categoryList) ; | | | |
| void splitParameterConstrained(const char* paramNameList, const char* cat | | | |
| egoryNameList, const char* remainderStateName) ; | | | |
| | | | |
| protected: | | | |
| | | | |
| friend class RooSimWSTool ; | | | |
| friend class BuildConfig ; | | | |
| friend class MultiBuildConfig ; | | | |
| void configure(const RooCmdArg& arg1=RooCmdArg::none(),const RooCmdArg& a | | | |
| rg2=RooCmdArg::none(), | | | |
| const RooCmdArg& arg3=RooCmdArg::none(),const RooCmdArg& ar | | | |
| g4=RooCmdArg::none(), | | | |
| const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& ar | | | |
| g6=RooCmdArg::none()) ; | | | |
| | | | |
| std::list<std::string> _miSta | | | |
| teNameList ; | | | |
| std::map<std::string, std::pair<std::list<std::string>,std::string> > _pa | | | |
| ramSplitMap ; //<paramName,<std::list<splitCatSet>,remainderStateName>> | | | |
| ClassDef(SplitRule,0) // Split rule specification for prototype p.d.f | | | |
| } ; | | | |
| | | | |
| class RooSimWSTool::ObjSplitRule { | | class RooSimWSTool::ObjSplitRule { | |
| public: | | public: | |
| ObjSplitRule() {} ; | | ObjSplitRule() {} ; | |
| virtual ~ObjSplitRule() ; | | virtual ~ObjSplitRule() ; | |
| | | | |
| protected: | | protected: | |
| friend class RooSimWSTool ; | | friend class RooSimWSTool ; | |
| friend class RooSimWSTool::ObjBuildConfig ; | | friend class RooSimWSTool::ObjBuildConfig ; | |
| std::list<const RooCatType*> _miStateList ; | | std::list<const RooCatType*> _miStateList ; | |
| std::map<RooAbsArg*, std::pair<RooArgSet,std::string> > _paramSplitMap ;
//<paramName,<std::list<splitCatSet>,remainderStateName>> | | std::map<RooAbsArg*, std::pair<RooArgSet,std::string> > _paramSplitMap ;
//<paramName,<std::list<splitCatSet>,remainderStateName>> | |
| | | | |
End of changes. 2 change blocks. |
| 27 lines changed or deleted | | 27 lines changed or added | |
|
| RooWorkspace.h | | RooWorkspace.h | |
| | | | |
| skipping to change at line 108 | | skipping to change at line 108 | |
| // RooAbsPdf* joinPdf(const char* jointPdfName, const char* indexName,
const char* inputMapping) ; | | // RooAbsPdf* joinPdf(const char* jointPdfName, const char* indexName,
const char* inputMapping) ; | |
| // RooAbsData* joinData(const char* jointDataName, const char* indexNam
e, const char* inputMapping) ; | | // RooAbsData* joinData(const char* jointDataName, const char* indexNam
e, const char* inputMapping) ; | |
| | | | |
| // Accessor functions | | // Accessor functions | |
| RooAbsPdf* pdf(const char* name) const ; | | RooAbsPdf* pdf(const char* name) const ; | |
| RooAbsReal* function(const char* name) const ; | | RooAbsReal* function(const char* name) const ; | |
| RooRealVar* var(const char* name) const ; | | RooRealVar* var(const char* name) const ; | |
| RooCategory* cat(const char* name) const ; | | RooCategory* cat(const char* name) const ; | |
| RooAbsCategory* catfunc(const char* name) const ; | | RooAbsCategory* catfunc(const char* name) const ; | |
| RooAbsData* data(const char* name) const ; | | RooAbsData* data(const char* name) const ; | |
|
| | | RooAbsData* embeddedData(const char* name) const ; | |
| RooAbsArg* arg(const char* name) const ; | | RooAbsArg* arg(const char* name) const ; | |
| RooAbsArg* fundArg(const char* name) const ; | | RooAbsArg* fundArg(const char* name) const ; | |
| RooArgSet argSet(const char* nameList) const ; | | RooArgSet argSet(const char* nameList) const ; | |
| TIterator* componentIterator() const { return _allOwnedNodes.createIterat
or() ; } | | TIterator* componentIterator() const { return _allOwnedNodes.createIterat
or() ; } | |
| const RooArgSet& components() const { return _allOwnedNodes ; } | | const RooArgSet& components() const { return _allOwnedNodes ; } | |
| TObject* genobj(const char* name) const ; | | TObject* genobj(const char* name) const ; | |
| TObject* obj(const char* name) const ; | | TObject* obj(const char* name) const ; | |
| | | | |
| // Group accessors | | // Group accessors | |
| RooArgSet allVars() const; | | RooArgSet allVars() const; | |
| RooArgSet allCats() const ; | | RooArgSet allCats() const ; | |
| RooArgSet allFunctions() const ; | | RooArgSet allFunctions() const ; | |
| RooArgSet allCatFunctions() const ; | | RooArgSet allCatFunctions() const ; | |
| RooArgSet allPdfs() const ; | | RooArgSet allPdfs() const ; | |
| RooArgSet allResolutionModels() const ; | | RooArgSet allResolutionModels() const ; | |
| std::list<RooAbsData*> allData() const ; | | std::list<RooAbsData*> allData() const ; | |
|
| | | std::list<RooAbsData*> allEmbeddedData() const ; | |
| std::list<TObject*> allGenericObjects() const ; | | std::list<TObject*> allGenericObjects() const ; | |
| | | | |
| Bool_t makeDir() ; | | Bool_t makeDir() ; | |
| Bool_t cd(const char* path = 0) ; | | Bool_t cd(const char* path = 0) ; | |
| | | | |
| Bool_t writeToFile(const char* fileName, Bool_t recreate=kTRUE) ; | | Bool_t writeToFile(const char* fileName, Bool_t recreate=kTRUE) ; | |
| | | | |
| // Tools management | | // Tools management | |
| RooFactoryWSTool& factory() ; | | RooFactoryWSTool& factory() ; | |
| RooAbsArg* factory(const char* expr) ; | | RooAbsArg* factory(const char* expr) ; | |
| | | | |
| skipping to change at line 249 | | skipping to change at line 251 | |
| static std::string _classFileExportDir ; | | static std::string _classFileExportDir ; | |
| | | | |
| TUUID _uuid ; // Unique workspace ID | | TUUID _uuid ; // Unique workspace ID | |
| | | | |
| static Bool_t _autoClass ; // Automatic import of non-distribution class
code | | static Bool_t _autoClass ; // Automatic import of non-distribution class
code | |
| | | | |
| CodeRepo _classes ; // Repository of embedded class code. This data membe
r _must_ be first | | CodeRepo _classes ; // Repository of embedded class code. This data membe
r _must_ be first | |
| | | | |
| RooArgSet _allOwnedNodes ; // List of owned pdfs and components | | RooArgSet _allOwnedNodes ; // List of owned pdfs and components | |
| RooLinkedList _dataList ; // List of owned datasets | | RooLinkedList _dataList ; // List of owned datasets | |
|
| | | RooLinkedList _embeddedDataList ; // List of owned datasets that are embe
dded in pdfs | |
| RooLinkedList _views ; // List of model views | | RooLinkedList _views ; // List of model views | |
| RooLinkedList _snapshots ; // List of parameter snapshots | | RooLinkedList _snapshots ; // List of parameter snapshots | |
| RooLinkedList _genObjects ; // List of generic objects | | RooLinkedList _genObjects ; // List of generic objects | |
| RooLinkedList _studyMods ; // List if StudyManager modules | | RooLinkedList _studyMods ; // List if StudyManager modules | |
| std::map<std::string,RooArgSet> _namedSets ; // Map of named RooArgSets | | std::map<std::string,RooArgSet> _namedSets ; // Map of named RooArgSets | |
| | | | |
| WSDir* _dir ; //! Transient ROOT directory representation of workspace | | WSDir* _dir ; //! Transient ROOT directory representation of workspace | |
| | | | |
| RooExpensiveObjectCache _eocache ; // Cache for expensive objects | | RooExpensiveObjectCache _eocache ; // Cache for expensive objects | |
| | | | |
| RooFactoryWSTool* _factory ; //! Factory tool associated with workspace | | RooFactoryWSTool* _factory ; //! Factory tool associated with workspace | |
| | | | |
| Bool_t _doExport ; //! Export contents of workspace to CINT? | | Bool_t _doExport ; //! Export contents of workspace to CINT? | |
| std::string _exportNSName ; //! Name of CINT namespace to which contents
are exported | | std::string _exportNSName ; //! Name of CINT namespace to which contents
are exported | |
| | | | |
| Bool_t _openTrans ; //! Is there a transaction open? | | Bool_t _openTrans ; //! Is there a transaction open? | |
| RooArgSet _sandboxNodes ; //! Sandbox for incoming objects in a transac
tion | | RooArgSet _sandboxNodes ; //! Sandbox for incoming objects in a transac
tion | |
| | | | |
|
| ClassDef(RooWorkspace,7) // Persistable project container for (composite
) pdfs, functions, variables and datasets | | ClassDef(RooWorkspace,8) // Persistable project container for (composite
) pdfs, functions, variables and datasets | |
| | | | |
| } ; | | } ; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 4 lines changed or added | |
|
| RuleEnsemble.h | | RuleEnsemble.h | |
| | | | |
| skipping to change at line 66 | | skipping to change at line 66 | |
| | | | |
| namespace TMVA { | | namespace TMVA { | |
| | | | |
| class TBits; | | class TBits; | |
| class MethodBase; | | class MethodBase; | |
| class RuleFit; | | class RuleFit; | |
| class MethodRuleFit; | | class MethodRuleFit; | |
| class RuleEnsemble; | | class RuleEnsemble; | |
| class MsgLogger; | | class MsgLogger; | |
| | | | |
|
| ostream& operator<<( ostream& os, const RuleEnsemble& event ); | | std::ostream& operator<<( std::ostream& os, const RuleEnsemble& event ); | |
| | | | |
| class RuleEnsemble { | | class RuleEnsemble { | |
| | | | |
| // output operator for a RuleEnsemble | | // output operator for a RuleEnsemble | |
|
| friend ostream& operator<< ( ostream& os, const RuleEnsemble& rules )
; | | friend std::ostream& operator<< ( std::ostream& os, const RuleEnsembl
e& rules ); | |
| | | | |
| public: | | public: | |
| | | | |
| enum ELearningModel { kFull=0, kRules=1, kLinear=2 }; | | enum ELearningModel { kFull=0, kRules=1, kLinear=2 }; | |
| | | | |
| // main constructor | | // main constructor | |
| RuleEnsemble( RuleFit* rf ); | | RuleEnsemble( RuleFit* rf ); | |
| | | | |
| // copy constructor | | // copy constructor | |
| RuleEnsemble( const RuleEnsemble& other ); | | RuleEnsemble( const RuleEnsemble& other ); | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 162 | |
| // Recursivly search for end-nodes; used by CalcNRules() | | // Recursivly search for end-nodes; used by CalcNRules() | |
| void FindNEndNodes( const TMVA::Node* node, Int_t& nendnodes ); | | void FindNEndNodes( const TMVA::Node* node, Int_t& nendnodes ); | |
| | | | |
| // set current event to be used | | // set current event to be used | |
| void SetEvent( const Event & e ) { fEvent = &e; fEventCacheOK = kFALS
E; } | | void SetEvent( const Event & e ) { fEvent = &e; fEventCacheOK = kFALS
E; } | |
| | | | |
| // fill cached values of rule/linear respons | | // fill cached values of rule/linear respons | |
| void UpdateEventVal(); | | void UpdateEventVal(); | |
| | | | |
| // fill binary rule respons for all events (or selected subset) | | // fill binary rule respons for all events (or selected subset) | |
|
| void MakeRuleMap(const std::vector<TMVA::Event *> *events=0, UInt_t i
first=0, UInt_t ilast=0); | | void MakeRuleMap(const std::vector<const TMVA::Event *> *events=0, UI
nt_t ifirst=0, UInt_t ilast=0); | |
| | | | |
| // clear rule map | | // clear rule map | |
| void ClearRuleMap() { fRuleMap.clear(); fRuleMapEvents=0; } | | void ClearRuleMap() { fRuleMap.clear(); fRuleMapEvents=0; } | |
| | | | |
| // evaluates the event using the ensemble of rules | | // evaluates the event using the ensemble of rules | |
| // the following uses fEventCache, that is per event saved in cache | | // the following uses fEventCache, that is per event saved in cache | |
| Double_t EvalEvent() const; | | Double_t EvalEvent() const; | |
| Double_t EvalEvent( const Event & e ); | | Double_t EvalEvent( const Event & e ); | |
| | | | |
| // same as previous but using other model coefficients | | // same as previous but using other model coefficients | |
| | | | |
| skipping to change at line 264 | | skipping to change at line 264 | |
| Double_t CoefficientRadius(); | | Double_t CoefficientRadius(); | |
| | | | |
| // fill the vector with the coefficients | | // fill the vector with the coefficients | |
| void GetCoefficients( std::vector< Double_t >& v ); | | void GetCoefficients( std::vector< Double_t >& v ); | |
| | | | |
| // accessors | | // accessors | |
| const MethodRuleFit* GetMethodRuleFit() const; | | const MethodRuleFit* GetMethodRuleFit() const; | |
| const MethodBase* GetMethodBase() const; | | const MethodBase* GetMethodBase() const; | |
| const RuleFit* GetRuleFit() const { r
eturn fRuleFit; } | | const RuleFit* GetRuleFit() const { r
eturn fRuleFit; } | |
| // | | // | |
|
| const std::vector<TMVA::Event *>* GetTrainingEvents() const; | | const std::vector<const TMVA::Event *>* GetTrainingEvents() cons
t; | |
| const Event* GetTrainingEvent(UInt_t i) const; | | const Event* GetTrainingEvent(UInt_t i) const; | |
| const Event* GetEvent() const { return fEvent; } | | const Event* GetEvent() const { return fEvent; } | |
| // | | // | |
| Bool_t DoLinear() const { return
(fLearningModel==kFull) || (fLearningModel==kLinear); } | | Bool_t DoLinear() const { return
(fLearningModel==kFull) || (fLearningModel==kLinear); } | |
| Bool_t DoRules() const { return
(fLearningModel==kFull) || (fLearningModel==kRules); } | | Bool_t DoRules() const { return
(fLearningModel==kFull) || (fLearningModel==kRules); } | |
| Bool_t DoOnlyRules() const { return
(fLearningModel==kRules); } | | Bool_t DoOnlyRules() const { return
(fLearningModel==kRules); } | |
| Bool_t DoOnlyLinear() const { return
(fLearningModel==kLinear); } | | Bool_t DoOnlyLinear() const { return
(fLearningModel==kLinear); } | |
| Bool_t DoFull() const { return
(fLearningModel==kFull); } | | Bool_t DoFull() const { return
(fLearningModel==kFull); } | |
| ELearningModel GetLearningModel() const { return
fLearningModel; } | | ELearningModel GetLearningModel() const { return
fLearningModel; } | |
| Double_t GetImportanceCut() const { return
fImportanceCut; } | | Double_t GetImportanceCut() const { return
fImportanceCut; } | |
| | | | |
| skipping to change at line 323 | | skipping to change at line 323 | |
| const TMVA::Event *GetRuleMapEvent(UInt_t evtidx) const { return (*fR
uleMapEvents)[evtidx]; } | | const TMVA::Event *GetRuleMapEvent(UInt_t evtidx) const { return (*fR
uleMapEvents)[evtidx]; } | |
| Bool_t IsRuleMapOK() const { return fRuleMapOK;
} | | Bool_t IsRuleMapOK() const { return fRuleMapOK;
} | |
| | | | |
| // print rule generation info | | // print rule generation info | |
| void PrintRuleGen() const; | | void PrintRuleGen() const; | |
| | | | |
| // print the ensemble | | // print the ensemble | |
| void Print() const; | | void Print() const; | |
| | | | |
| // print the model in a cryptic way | | // print the model in a cryptic way | |
|
| void PrintRaw ( ostream& os ) const; // obsolete | | void PrintRaw ( std::ostream& os ) const; // obsolete | |
| void* AddXMLTo ( void* parent ) const; | | void* AddXMLTo ( void* parent ) const; | |
| | | | |
| // read the model from input stream | | // read the model from input stream | |
|
| void ReadRaw ( istream& istr ); // obsolete | | void ReadRaw ( std::istream& istr ); // obsolete | |
| void ReadFromXML( void* wghtnode ); | | void ReadFromXML( void* wghtnode ); | |
| | | | |
| private: | | private: | |
| | | | |
| // delete all rules | | // delete all rules | |
| void DeleteRules() { for (UInt_t i=0; i<fRules.size(); i++) delete fR
ules[i]; fRules.clear(); } | | void DeleteRules() { for (UInt_t i=0; i<fRules.size(); i++) delete fR
ules[i]; fRules.clear(); } | |
| | | | |
| // copy method | | // copy method | |
| void Copy( RuleEnsemble const& other ); | | void Copy( RuleEnsemble const& other ); | |
| | | | |
| | | | |
| skipping to change at line 390 | | skipping to change at line 390 | |
| // | | // | |
| const Event* fEvent; // current event. | | const Event* fEvent; // current event. | |
| Bool_t fEventCacheOK; // true if rule/lin
ear respons are updated | | Bool_t fEventCacheOK; // true if rule/lin
ear respons are updated | |
| std::vector<Char_t> fEventRuleVal; // the rule respons
of current event <----- stores boolean | | std::vector<Char_t> fEventRuleVal; // the rule respons
of current event <----- stores boolean | |
| std::vector<Double_t> fEventLinearVal; // linear respons | | std::vector<Double_t> fEventLinearVal; // linear respons | |
| // | | // | |
| Bool_t fRuleMapOK; // true if MakeRule
Map() has been called | | Bool_t fRuleMapOK; // true if MakeRule
Map() has been called | |
| std::vector< std::vector<UInt_t> > fRuleMap; // map of rule
responses | | std::vector< std::vector<UInt_t> > fRuleMap; // map of rule
responses | |
| UInt_t fRuleMapInd0; // start index | | UInt_t fRuleMapInd0; // start index | |
| UInt_t fRuleMapInd1; // last index | | UInt_t fRuleMapInd1; // last index | |
|
| const std::vector<TMVA::Event *> *fRuleMapEvents; // pointer to vecto
r of events used | | const std::vector<const TMVA::Event *> *fRuleMapEvents; // pointer to
vector of events used | |
| // | | // | |
| const RuleFit* fRuleFit; // pointer to rule
fit object | | const RuleFit* fRuleFit; // pointer to rule
fit object | |
| | | | |
| mutable MsgLogger* fLogger; //! message logger | | mutable MsgLogger* fLogger; //! message logger | |
| MsgLogger& Log() const { return *fLogger; } | | MsgLogger& Log() const { return *fLogger; } | |
| }; | | }; | |
| } | | } | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
| inline void TMVA::RuleEnsemble::UpdateEventVal() | | inline void TMVA::RuleEnsemble::UpdateEventVal() | |
| | | | |
End of changes. 7 change blocks. |
| 7 lines changed or deleted | | 7 lines changed or added | |
|
| RuleFit.h | | RuleFit.h | |
| | | | |
| skipping to change at line 69 | | skipping to change at line 69 | |
| RuleFit( void ); | | RuleFit( void ); | |
| | | | |
| virtual ~RuleFit( void ); | | virtual ~RuleFit( void ); | |
| | | | |
| void InitNEveEff(); | | void InitNEveEff(); | |
| void InitPtrs( const TMVA::MethodBase *rfbase ); | | void InitPtrs( const TMVA::MethodBase *rfbase ); | |
| void Initialize( const TMVA::MethodBase *rfbase ); | | void Initialize( const TMVA::MethodBase *rfbase ); | |
| | | | |
| void SetMsgType( EMsgType t ); | | void SetMsgType( EMsgType t ); | |
| | | | |
|
| void SetTrainingEvents( const std::vector<TMVA::Event *> & el ); | | void SetTrainingEvents( const std::vector<const TMVA::Event *> & el )
; | |
| | | | |
| void ReshuffleEvents() { std::random_shuffle(fTrainingEventsRndm.begi
n(),fTrainingEventsRndm.end()); } | | void ReshuffleEvents() { std::random_shuffle(fTrainingEventsRndm.begi
n(),fTrainingEventsRndm.end()); } | |
| | | | |
| void SetMethodBase( const MethodBase *rfbase ); | | void SetMethodBase( const MethodBase *rfbase ); | |
| | | | |
| // make the forest of trees for rule generation | | // make the forest of trees for rule generation | |
| void MakeForest(); | | void MakeForest(); | |
| | | | |
| // build a tree | | // build a tree | |
| void BuildTree( TMVA::DecisionTree *dt ); | | void BuildTree( TMVA::DecisionTree *dt ); | |
| | | | |
| skipping to change at line 97 | | skipping to change at line 97 | |
| // boost events based on the given tree | | // boost events based on the given tree | |
| void Boost( TMVA::DecisionTree *dt ); | | void Boost( TMVA::DecisionTree *dt ); | |
| | | | |
| // calculate and print some statistics on the given forest | | // calculate and print some statistics on the given forest | |
| void ForestStatistics(); | | void ForestStatistics(); | |
| | | | |
| // calculate the discriminating variable for the given event | | // calculate the discriminating variable for the given event | |
| Double_t EvalEvent( const Event& e ); | | Double_t EvalEvent( const Event& e ); | |
| | | | |
| // calculate sum of | | // calculate sum of | |
|
| Double_t CalcWeightSum( const std::vector<TMVA::Event *> *events, UIn
t_t neve=0 ); | | Double_t CalcWeightSum( const std::vector<const TMVA::Event *> *event
s, UInt_t neve=0 ); | |
| | | | |
| // do the fitting of the coefficients | | // do the fitting of the coefficients | |
| void FitCoefficients(); | | void FitCoefficients(); | |
| | | | |
| // calculate variable and rule importance from a set of events | | // calculate variable and rule importance from a set of events | |
| void CalcImportance(); | | void CalcImportance(); | |
| | | | |
| // set usage of linear term | | // set usage of linear term | |
| void SetModelLinear() { fRuleEnsemble.SetMod
elLinear(); } | | void SetModelLinear() { fRuleEnsemble.SetMod
elLinear(); } | |
| // set usage of rules | | // set usage of rules | |
| | | | |
| skipping to change at line 140 | | skipping to change at line 140 | |
| void MakeDebugHists(); | | void MakeDebugHists(); | |
| Bool_t GetCorrVars(TString & title, TString & var1, TString & var2)
; | | Bool_t GetCorrVars(TString & title, TString & var1, TString & var2)
; | |
| // accessors | | // accessors | |
| UInt_t GetNTreeSample() const { return fNTreeSample
; } | | UInt_t GetNTreeSample() const { return fNTreeSample
; } | |
| Double_t GetNEveEff() const { return fNEveEffTrai
n; } // reweighted number of events = sum(wi) | | Double_t GetNEveEff() const { return fNEveEffTrai
n; } // reweighted number of events = sum(wi) | |
| const Event* GetTrainingEvent(UInt_t i) const { return static_cast<
const Event *>(fTrainingEvents[i]); } | | const Event* GetTrainingEvent(UInt_t i) const { return static_cast<
const Event *>(fTrainingEvents[i]); } | |
| Double_t GetTrainingEventWeight(UInt_t i) const { return fTrain
ingEvents[i]->GetWeight(); } | | Double_t GetTrainingEventWeight(UInt_t i) const { return fTrain
ingEvents[i]->GetWeight(); } | |
| | | | |
| // const Event* GetTrainingEvent(UInt_t i, UInt_t isub) const
{ return &(fTrainingEvents[fSubsampleEvents[isub]])[i]; } | | // const Event* GetTrainingEvent(UInt_t i, UInt_t isub) const
{ return &(fTrainingEvents[fSubsampleEvents[isub]])[i]; } | |
| | | | |
|
| const std::vector< TMVA::Event * > & GetTrainingEvents() const { ret
urn fTrainingEvents; } | | const std::vector< const TMVA::Event * > & GetTrainingEvents() const
{ return fTrainingEvents; } | |
| // const std::vector< Int_t > & GetSubsampleEvents
() const { return fSubsampleEvents; } | | // const std::vector< Int_t > & GetSubsampleEvents
() const { return fSubsampleEvents; } | |
| | | | |
| // void GetSubsampleEvents(Int_t sub, UInt_t & ibeg, UInt_t & i
end) const; | | // void GetSubsampleEvents(Int_t sub, UInt_t & ibeg, UInt_t & i
end) const; | |
| void GetRndmSampleEvents(std::vector< const TMVA::Event * > & evevec
, UInt_t nevents); | | void GetRndmSampleEvents(std::vector< const TMVA::Event * > & evevec
, UInt_t nevents); | |
| // | | // | |
| const std::vector< const TMVA::DecisionTree *> & GetForest() cons
t { return fForest; } | | const std::vector< const TMVA::DecisionTree *> & GetForest() cons
t { return fForest; } | |
| const RuleEnsemble & GetRuleEnsemble() cons
t { return fRuleEnsemble; } | | const RuleEnsemble & GetRuleEnsemble() cons
t { return fRuleEnsemble; } | |
| RuleEnsemble * GetRuleEnsemblePtr()
{ return &fRuleEnsemble; } | | RuleEnsemble * GetRuleEnsemblePtr()
{ return &fRuleEnsemble; } | |
| const RuleFitParams & GetRuleFitParams() cons
t { return fRuleFitParams; } | | const RuleFitParams & GetRuleFitParams() cons
t { return fRuleFitParams; } | |
| RuleFitParams * GetRuleFitParamsPtr()
{ return &fRuleFitParams; } | | RuleFitParams * GetRuleFitParamsPtr()
{ return &fRuleFitParams; } | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 162 | |
| const MethodBase * GetMethodBase() cons
t { return fMethodBase; } | | const MethodBase * GetMethodBase() cons
t { return fMethodBase; } | |
| | | | |
| private: | | private: | |
| | | | |
| // copy constructor | | // copy constructor | |
| RuleFit( const RuleFit & other ); | | RuleFit( const RuleFit & other ); | |
| | | | |
| // copy method | | // copy method | |
| void Copy( const RuleFit & other ); | | void Copy( const RuleFit & other ); | |
| | | | |
|
| std::vector<TMVA::Event *> fTrainingEvents; // all trai | | std::vector<const TMVA::Event *> fTrainingEvents; // all trai | |
| ning events | | ning events | |
| std::vector<TMVA::Event *> fTrainingEventsRndm; // idem, bu | | std::vector<const TMVA::Event *> fTrainingEventsRndm; // idem, bu | |
| t randomly shuffled | | t randomly shuffled | |
| std::vector<Double_t> fEventWeights; // original
weights of the events - follows fTrainingEvents | | std::vector<Double_t> fEventWeights; // original
weights of the events - follows fTrainingEvents | |
| UInt_t fNTreeSample; // number o
f events in sub sample = frac*neve | | UInt_t fNTreeSample; // number o
f events in sub sample = frac*neve | |
| | | | |
| Double_t fNEveEffTrain; // reweighted n
umber of events = sum(wi) | | Double_t fNEveEffTrain; // reweighted n
umber of events = sum(wi) | |
| std::vector< const TMVA::DecisionTree *> fForest; // the input fo
rest of decision trees | | std::vector< const TMVA::DecisionTree *> fForest; // the input fo
rest of decision trees | |
| RuleEnsemble fRuleEnsemble; // the ensemble
of rules | | RuleEnsemble fRuleEnsemble; // the ensemble
of rules | |
| RuleFitParams fRuleFitParams; // fit rule par
ameters | | RuleFitParams fRuleFitParams; // fit rule par
ameters | |
| const MethodRuleFit *fMethodRuleFit; // pointer the
method which initialized this RuleFit instance | | const MethodRuleFit *fMethodRuleFit; // pointer the
method which initialized this RuleFit instance | |
| const MethodBase *fMethodBase; // pointer the
method base which initialized this RuleFit instance | | const MethodBase *fMethodBase; // pointer the
method base which initialized this RuleFit instance | |
| Bool_t fVisHistsUseImp; // if true, use
importance as weight; else coef in vis hists | | Bool_t fVisHistsUseImp; // if true, use
importance as weight; else coef in vis hists | |
| | | | |
End of changes. 4 change blocks. |
| 7 lines changed or deleted | | 7 lines changed or added | |
|
| RuleFitAPI.h | | RuleFitAPI.h | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 48 | |
| // // | | // // | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| | | | |
| #include <fstream> | | #include <fstream> | |
| | | | |
| #include "TMVA/MsgLogger.h" | | #include "TMVA/MsgLogger.h" | |
| | | | |
| namespace TMVA { | | namespace TMVA { | |
| | | | |
| class MethodRuleFit; | | class MethodRuleFit; | |
|
| | | class RuleFit; | |
| | | | |
| class RuleFitAPI { | | class RuleFitAPI { | |
| | | | |
| public: | | public: | |
| | | | |
| RuleFitAPI( const TMVA::MethodRuleFit *rfbase, TMVA::RuleFit *rulefit
, EMsgType minType ); | | RuleFitAPI( const TMVA::MethodRuleFit *rfbase, TMVA::RuleFit *rulefit
, EMsgType minType ); | |
| | | | |
| virtual ~RuleFitAPI(); | | virtual ~RuleFitAPI(); | |
| | | | |
| // welcome message | | // welcome message | |
| | | | |
| skipping to change at line 136 | | skipping to change at line 137 | |
| void SetRFTrain() { fRFProgram = kRfTrain; } | | void SetRFTrain() { fRFProgram = kRfTrain; } | |
| void SetRFPredict() { fRFProgram = kRfPredict; } | | void SetRFPredict() { fRFProgram = kRfPredict; } | |
| void SetRFVarimp() { fRFProgram = kRfVarimp; } | | void SetRFVarimp() { fRFProgram = kRfVarimp; } | |
| | | | |
| // handle rulefit files | | // handle rulefit files | |
| inline TString GetRFName(TString name); | | inline TString GetRFName(TString name); | |
| inline Bool_t OpenRFile(TString name, std::ofstream & f); | | inline Bool_t OpenRFile(TString name, std::ofstream & f); | |
| inline Bool_t OpenRFile(TString name, std::ifstream & f); | | inline Bool_t OpenRFile(TString name, std::ifstream & f); | |
| | | | |
| // read/write binary files | | // read/write binary files | |
|
| inline Bool_t WriteInt(ofstream & f, const Int_t *v, Int_t n=1); | | inline Bool_t WriteInt(std::ofstream & f, const Int_t *v, Int_t n | |
| inline Bool_t WriteFloat(ofstream & f, const Float_t *v, Int_t n=1); | | =1); | |
| inline Int_t ReadInt(ifstream & f, Int_t *v, Int_t n=1) const; | | inline Bool_t WriteFloat(std::ofstream & f, const Float_t *v, Int_t n | |
| inline Int_t ReadFloat(ifstream & f, Float_t *v, Int_t n=1) const; | | =1); | |
| | | inline Int_t ReadInt(std::ifstream & f, Int_t *v, Int_t n=1) const | |
| | | ; | |
| | | inline Int_t ReadFloat(std::ifstream & f, Float_t *v, Int_t n=1) con | |
| | | st; | |
| | | | |
| // write rf_go.exe i/o files | | // write rf_go.exe i/o files | |
| Bool_t WriteAll(); | | Bool_t WriteAll(); | |
| Bool_t WriteIntParms(); | | Bool_t WriteIntParms(); | |
| Bool_t WriteRealParms(); | | Bool_t WriteRealParms(); | |
| Bool_t WriteLx(); | | Bool_t WriteLx(); | |
| Bool_t WriteProgram(); | | Bool_t WriteProgram(); | |
| Bool_t WriteRealVarImp(); | | Bool_t WriteRealVarImp(); | |
| Bool_t WriteRfOut(); | | Bool_t WriteRfOut(); | |
| Bool_t WriteRfStatus(); | | Bool_t WriteRfStatus(); | |
| | | | |
| skipping to change at line 264 | | skipping to change at line 265 | |
| f.open(fullName); | | f.open(fullName); | |
| if (!f.is_open()) { | | if (!f.is_open()) { | |
| fLogger << kERROR << "Error opening RuleFit file for input: " | | fLogger << kERROR << "Error opening RuleFit file for input: " | |
| << fullName << Endl; | | << fullName << Endl; | |
| return kFALSE; | | return kFALSE; | |
| } | | } | |
| return kTRUE; | | return kTRUE; | |
| } | | } | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
|
| Bool_t TMVA::RuleFitAPI::WriteInt(ofstream & f, const Int_t *v, Int_t n
) | | Bool_t TMVA::RuleFitAPI::WriteInt(std::ofstream & f, const Int_t *v, In
t_t n) | |
| { | | { | |
| // write an int | | // write an int | |
| if (!f.is_open()) return kFALSE; | | if (!f.is_open()) return kFALSE; | |
|
| return f.write(reinterpret_cast<char const *>(v), n*sizeof(Int_t)); | | return (Bool_t)f.write(reinterpret_cast<char const *>(v), n*sizeof(Int_t
)); | |
| } | | } | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
|
| Bool_t TMVA::RuleFitAPI::WriteFloat(ofstream & f, const Float_t *v, Int_t n
) | | Bool_t TMVA::RuleFitAPI::WriteFloat(std::ofstream & f, const Float_t *v, In
t_t n) | |
| { | | { | |
| // write a float | | // write a float | |
| if (!f.is_open()) return kFALSE; | | if (!f.is_open()) return kFALSE; | |
|
| return f.write(reinterpret_cast<char const *>(v), n*sizeof(Float_t)); | | return (Bool_t)f.write(reinterpret_cast<char const *>(v), n*sizeof(Float
_t)); | |
| } | | } | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
|
| Int_t TMVA::RuleFitAPI::ReadInt(ifstream & f, Int_t *v, Int_t n) const | | Int_t TMVA::RuleFitAPI::ReadInt(std::ifstream & f, Int_t *v, Int_t n) con
st | |
| { | | { | |
| // read an int | | // read an int | |
| if (!f.is_open()) return 0; | | if (!f.is_open()) return 0; | |
| if (f.read(reinterpret_cast<char *>(v), n*sizeof(Int_t))) return 1; | | if (f.read(reinterpret_cast<char *>(v), n*sizeof(Int_t))) return 1; | |
| return 0; | | return 0; | |
| } | | } | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
|
| Int_t TMVA::RuleFitAPI::ReadFloat(ifstream & f, Float_t *v, Int_t n) const | | Int_t TMVA::RuleFitAPI::ReadFloat(std::ifstream & f, Float_t *v, Int_t n) c
onst | |
| { | | { | |
| // read a float | | // read a float | |
| if (!f.is_open()) return 0; | | if (!f.is_open()) return 0; | |
| if (f.read(reinterpret_cast<char *>(v), n*sizeof(Float_t))) return 1; | | if (f.read(reinterpret_cast<char *>(v), n*sizeof(Float_t))) return 1; | |
| return 0; | | return 0; | |
| } | | } | |
| | | | |
| #endif // RuleFitAPI_H | | #endif // RuleFitAPI_H | |
| | | | |
End of changes. 8 change blocks. |
| 10 lines changed or deleted | | 15 lines changed or added | |
|
| TCollectionProxyInfo.h | | TCollectionProxyInfo.h | |
| | | | |
| skipping to change at line 81 | | skipping to change at line 81 | |
| * Small helper to implement the function to create,access and destroy | | * Small helper to implement the function to create,access and destroy | |
| * iterators. | | * iterators. | |
| * | | * | |
| **/ | | **/ | |
| | | | |
| template <typename Cont_t, bool large = false> | | template <typename Cont_t, bool large = false> | |
| struct Iterators { | | struct Iterators { | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| typedef typename Cont_t::iterator iterator; | | typedef typename Cont_t::iterator iterator; | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy*) { | |
| PCont_t c = PCont_t(coll); | | PCont_t c = PCont_t(coll); | |
| new (*begin_arena) iterator(c->begin()); | | new (*begin_arena) iterator(c->begin()); | |
| new (*end_arena) iterator(c->end()); | | new (*end_arena) iterator(c->end()); | |
| } | | } | |
| static void* copy(void *dest_arena, const void *source_ptr) { | | static void* copy(void *dest_arena, const void *source_ptr) { | |
| iterator *source = (iterator *)(source_ptr); | | iterator *source = (iterator *)(source_ptr); | |
| new (dest_arena) iterator(*source); | | new (dest_arena) iterator(*source); | |
| return dest_arena; | | return dest_arena; | |
| } | | } | |
| static void* next(void *iter_loc, const void *end_loc) { | | static void* next(void *iter_loc, const void *end_loc) { | |
| | | | |
| skipping to change at line 122 | | skipping to change at line 122 | |
| | | | |
| // For Vector we take an extra short cut to avoid derefencing | | // For Vector we take an extra short cut to avoid derefencing | |
| // the iterator all the time and redefine the 'address' of the | | // the iterator all the time and redefine the 'address' of the | |
| // iterator as the iterator itself. This requires special handling | | // iterator as the iterator itself. This requires special handling | |
| // in the looper (see TStreamerInfoAction) but is much faster. | | // in the looper (see TStreamerInfoAction) but is much faster. | |
| template <typename T> struct Iterators<std::vector<T>, false> { | | template <typename T> struct Iterators<std::vector<T>, false> { | |
| typedef std::vector<T> Cont_t; | | typedef std::vector<T> Cont_t; | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| typedef typename Cont_t::iterator iterator; | | typedef typename Cont_t::iterator iterator; | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy*) { | |
| PCont_t c = PCont_t(coll); | | PCont_t c = PCont_t(coll); | |
| if (c->empty()) { | | if (c->empty()) { | |
| *begin_arena = 0; | | *begin_arena = 0; | |
| *end_arena = 0; | | *end_arena = 0; | |
| return; | | return; | |
| } | | } | |
| *begin_arena = &(*c->begin()); | | *begin_arena = &(*c->begin()); | |
| #ifdef R__VISUAL_CPLUSPLUS | | #ifdef R__VISUAL_CPLUSPLUS | |
| *end_arena = &(*(c->end()-1)) + 1; // On windows we can not der
erence the end iterator at all. | | *end_arena = &(*(c->end()-1)) + 1; // On windows we can not der
erence the end iterator at all. | |
| #else | | #else | |
| | | | |
| skipping to change at line 158 | | skipping to change at line 158 | |
| } | | } | |
| static void destruct2(void * /* begin_ptr */, void * /* end_ptr */
) { | | static void destruct2(void * /* begin_ptr */, void * /* end_ptr */
) { | |
| // Nothing to do | | // Nothing to do | |
| } | | } | |
| }; | | }; | |
| | | | |
| template <typename Cont_t> struct Iterators<Cont_t, /* large= */ true
> { | | template <typename Cont_t> struct Iterators<Cont_t, /* large= */ true
> { | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| typedef typename Cont_t::iterator iterator; | | typedef typename Cont_t::iterator iterator; | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy*) { | |
| PCont_t c = PCont_t(coll); | | PCont_t c = PCont_t(coll); | |
| *begin_arena = new iterator(c->begin()); | | *begin_arena = new iterator(c->begin()); | |
| *end_arena = new iterator(c->end()); | | *end_arena = new iterator(c->end()); | |
| } | | } | |
| static void* copy(void * /*dest_arena*/, const void *source_ptr) { | | static void* copy(void * /*dest_arena*/, const void *source_ptr) { | |
| iterator *source = (iterator *)(source_ptr); | | iterator *source = (iterator *)(source_ptr); | |
| void *iter = new iterator(*source); | | void *iter = new iterator(*source); | |
| return iter; | | return iter; | |
| } | | } | |
| static void* next(void *iter_loc, const void *end_loc) { | | static void* next(void *iter_loc, const void *end_loc) { | |
| | | | |
| skipping to change at line 444 | | skipping to change at line 444 | |
| void* (*fClearFunc)(void*); | | void* (*fClearFunc)(void*); | |
| void* (*fFirstFunc)(void*); | | void* (*fFirstFunc)(void*); | |
| void* (*fNextFunc)(void*); | | void* (*fNextFunc)(void*); | |
| void* (*fConstructFunc)(void*,size_t); | | void* (*fConstructFunc)(void*,size_t); | |
| void (*fDestructFunc)(void*,size_t); | | void (*fDestructFunc)(void*,size_t); | |
| void* (*fFeedFunc)(void*,void*,size_t); | | void* (*fFeedFunc)(void*,void*,size_t); | |
| void* (*fCollectFunc)(void*,void*); | | void* (*fCollectFunc)(void*,void*); | |
| void* (*fCreateEnv)(); | | void* (*fCreateEnv)(); | |
| | | | |
| // Set of function of direct iteration of the collections. | | // Set of function of direct iteration of the collections. | |
|
| void (*fCreateIterators)(void *collection, void **begin_arena, void *
*end_arena); | | void (*fCreateIterators)(void *collection, void **begin_arena, void *
*end_arena, TVirtualCollectionProxy *proxy); | |
| // begin_arena and end_arena should contain the location of memory ar
ena of size fgIteratorSize. | | // begin_arena and end_arena should contain the location of memory ar
ena of size fgIteratorSize. | |
| // If the collection iterator are of that size or less, the iterators
will be constructed in place in those location (new with placement) | | // If the collection iterator are of that size or less, the iterators
will be constructed in place in those location (new with placement) | |
| // Otherwise the iterators will be allocated via a regular new and th
eir address returned by modifying the value of begin_arena and end_arena. | | // Otherwise the iterators will be allocated via a regular new and th
eir address returned by modifying the value of begin_arena and end_arena. | |
| | | | |
| void* (*fCopyIterator)(void *dest, const void *source); | | void* (*fCopyIterator)(void *dest, const void *source); | |
| // Copy the iterator source, into dest. dest should contain should
contain the location of memory arena of size fgIteratorSize. | | // Copy the iterator source, into dest. dest should contain should
contain the location of memory arena of size fgIteratorSize. | |
| // If the collection iterator are of that size or less, the iterator
will be constructed in place in this location (new with placement) | | // If the collection iterator are of that size or less, the iterator
will be constructed in place in this location (new with placement) | |
| // Otherwise the iterator will be allocated via a regular new and its
address returned by modifying the value of dest. | | // Otherwise the iterator will be allocated via a regular new and its
address returned by modifying the value of dest. | |
| | | | |
| void* (*fNext)(void *iter, const void *end); | | void* (*fNext)(void *iter, const void *end); | |
| | | | |
| skipping to change at line 480 | | skipping to change at line 480 | |
| void* (*size_func)(void*), | | void* (*size_func)(void*), | |
| void (*resize_func)(void*,size_t), | | void (*resize_func)(void*,size_t), | |
| void* (*clear_func)(void*), | | void* (*clear_func)(void*), | |
| void* (*first_func)(void*), | | void* (*first_func)(void*), | |
| void* (*next_func)(void*), | | void* (*next_func)(void*), | |
| void* (*construct_func)(void*,size_t), | | void* (*construct_func)(void*,size_t), | |
| void (*destruct_func)(void*,size_t), | | void (*destruct_func)(void*,size_t), | |
| void* (*feed_func)(void*,void*,size_t), | | void* (*feed_func)(void*,void*,size_t), | |
| void* (*collect_func)(void*,void*), | | void* (*collect_func)(void*,void*), | |
| void* (*create_env)(), | | void* (*create_env)(), | |
|
| void (*getIterators)(void *collection, void **
begin_arena, void **end_arena) = 0, | | void (*getIterators)(void *collection, void **
begin_arena, void **end_arena, TVirtualCollectionProxy *proxy) = 0, | |
| void* (*copyIterator)(void *dest, const void *s
ource) = 0, | | void* (*copyIterator)(void *dest, const void *s
ource) = 0, | |
| void* (*next)(void *iter, const void *end) = 0, | | void* (*next)(void *iter, const void *end) = 0, | |
| void (*deleteSingleIterator)(void *iter) = 0, | | void (*deleteSingleIterator)(void *iter) = 0, | |
| void (*deleteTwoIterators)(void *begin, void *
end) = 0 | | void (*deleteTwoIterators)(void *begin, void *
end) = 0 | |
| ) : | | ) : | |
| fInfo(info), fIterSize(iter_size), fValueDiff(value_diff), | | fInfo(info), fIterSize(iter_size), fValueDiff(value_diff), | |
| fValueOffset(value_offset), | | fValueOffset(value_offset), | |
| fSizeFunc(size_func),fResizeFunc(resize_func),fClearFunc(clear_fun
c), | | fSizeFunc(size_func),fResizeFunc(resize_func),fClearFunc(clear_fun
c), | |
| fFirstFunc(first_func),fNextFunc(next_func),fConstructFunc(constru
ct_func), | | fFirstFunc(first_func),fNextFunc(next_func),fConstructFunc(constru
ct_func), | |
| fDestructFunc(destruct_func),fFeedFunc(feed_func),fCollectFunc(col
lect_func), | | fDestructFunc(destruct_func),fFeedFunc(feed_func),fCollectFunc(col
lect_func), | |
| | | | |
| skipping to change at line 619 | | skipping to change at line 619 | |
| // Nothing to destruct. | | // Nothing to destruct. | |
| } | | } | |
| | | | |
| //static const bool fgLargeIterator = sizeof(Cont_t::iterator) > fgIt
eratorArenaSize; | | //static const bool fgLargeIterator = sizeof(Cont_t::iterator) > fgIt
eratorArenaSize; | |
| //typedef Iterators<Cont_t,fgLargeIterator> Iterators_t; | | //typedef Iterators<Cont_t,fgLargeIterator> Iterators_t; | |
| | | | |
| struct Iterators { | | struct Iterators { | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| typedef Cont_t::iterator iterator; | | typedef Cont_t::iterator iterator; | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy*) { | |
| PCont_t c = PCont_t(coll); | | PCont_t c = PCont_t(coll); | |
| new (*begin_arena) iterator(c->begin()); | | new (*begin_arena) iterator(c->begin()); | |
| new (*end_arena) iterator(c->end()); | | new (*end_arena) iterator(c->end()); | |
| } | | } | |
| static void* copy(void *dest_arena, const void *source_ptr) { | | static void* copy(void *dest_arena, const void *source_ptr) { | |
| const iterator *source = (const iterator *)(source_ptr); | | const iterator *source = (const iterator *)(source_ptr); | |
| new (dest_arena) iterator(*source); | | new (dest_arena) iterator(*source); | |
| return dest_arena; | | return dest_arena; | |
| } | | } | |
| static void* next(void *iter_loc, const void *end_loc) { | | static void* next(void *iter_loc, const void *end_loc) { | |
| | | | |
| skipping to change at line 761 | | skipping to change at line 761 | |
| | | | |
| struct Iterators { | | struct Iterators { | |
| typedef Cont_t *PCont_t; | | typedef Cont_t *PCont_t; | |
| union PtrSize_t { size_t fIndex; void *fAddress; }; | | union PtrSize_t { size_t fIndex; void *fAddress; }; | |
| typedef std::pair<PtrSize_t,Bool_t> iterator; | | typedef std::pair<PtrSize_t,Bool_t> iterator; | |
| // In the end iterator we store the bitset pointer | | // In the end iterator we store the bitset pointer | |
| // and do not use the 'second' part of the pair. | | // and do not use the 'second' part of the pair. | |
| // In the other iterator we store the index | | // In the other iterator we store the index | |
| // and the value. | | // and the value. | |
| | | | |
|
| static void create(void *coll, void **begin_arena, void **end_aren
a) { | | static void create(void *coll, void **begin_arena, void **end_aren
a, TVirtualCollectionProxy*) { | |
| iterator *begin = new (*begin_arena) iterator; | | iterator *begin = new (*begin_arena) iterator; | |
| begin->first.fIndex = 0; | | begin->first.fIndex = 0; | |
| begin->second = false; | | begin->second = false; | |
| iterator *end = new (*end_arena) iterator; | | iterator *end = new (*end_arena) iterator; | |
| end->first.fAddress = coll; | | end->first.fAddress = coll; | |
| end->second = false; | | end->second = false; | |
| } | | } | |
| static void* copy(void *dest_arena, const void *source_ptr) { | | static void* copy(void *dest_arena, const void *source_ptr) { | |
| const iterator *source = (const iterator *)(source_ptr); | | const iterator *source = (const iterator *)(source_ptr); | |
| new (dest_arena) iterator(*source); | | new (dest_arena) iterator(*source); | |
| | | | |
End of changes. 7 change blocks. |
| 7 lines changed or deleted | | 7 lines changed or added | |
|
| TFilePrefetch.h | | TFilePrefetch.h | |
|
| // @(#)root/io:$Id$ | | // @(#)root/io: | |
| // Author: Elvin Sindrilaru 19/05/2011 | | // Author: Elvin Sindrilaru 19/05/2011 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 79 | | skipping to change at line 79 | |
| | | | |
| private: | | private: | |
| TFile *fFile; // reference to the file | | TFile *fFile; // reference to the file | |
| TList *fPendingBlocks; // list of pending blocks to be read | | TList *fPendingBlocks; // list of pending blocks to be read | |
| TList *fReadBlocks; // list of blocks read | | TList *fReadBlocks; // list of blocks read | |
| TThread *fConsumer; // consumer thread | | TThread *fConsumer; // consumer thread | |
| TMutex *fMutexPendingList; // mutex for the pending list | | TMutex *fMutexPendingList; // mutex for the pending list | |
| TMutex *fMutexReadList; // mutex for the list of read blocks | | TMutex *fMutexReadList; // mutex for the list of read blocks | |
| TCondition *fNewBlockAdded; // signal the addition of a new pending
block | | TCondition *fNewBlockAdded; // signal the addition of a new pending
block | |
| TCondition *fReadBlockAdded; // signal the addition of a new red bloc
k | | TCondition *fReadBlockAdded; // signal the addition of a new red bloc
k | |
|
| TCondition *fCondNextFile; // signal TChain that we can move to the
next file | | | |
| TSemaphore *fSemMasterWorker; // semaphore used to kill the consumer t
hread | | TSemaphore *fSemMasterWorker; // semaphore used to kill the consumer t
hread | |
| TSemaphore *fSemWorkerMaster; // semaphore used to notify the master t
hat worker is killed | | TSemaphore *fSemWorkerMaster; // semaphore used to notify the master t
hat worker is killed | |
|
| | | TSemaphore *fSemChangeFile; // semaphore used when changin a file in
TChain | |
| TString fPathCache; // path to the cache directory | | TString fPathCache; // path to the cache directory | |
| TStopwatch fWaitTime; // time wating to prefetch a buffer (in
usec) | | TStopwatch fWaitTime; // time wating to prefetch a buffer (in
usec) | |
| Bool_t fThreadJoined; // mark if async thread was joined | | Bool_t fThreadJoined; // mark if async thread was joined | |
| | | | |
| static TThread::VoidRtnFunc_t ThreadProc(void*); //create a joinable wo
rker thread | | static TThread::VoidRtnFunc_t ThreadProc(void*); //create a joinable wo
rker thread | |
| | | | |
| public: | | public: | |
| TFilePrefetch(TFile*); | | TFilePrefetch(TFile*); | |
| virtual ~TFilePrefetch(); | | virtual ~TFilePrefetch(); | |
| | | | |
| | | | |
| skipping to change at line 117 | | skipping to change at line 117 | |
| Bool_t CheckCachePath(const char*); | | Bool_t CheckCachePath(const char*); | |
| Bool_t CheckBlockInCache(char*&, TFPBlock*); | | Bool_t CheckBlockInCache(char*&, TFPBlock*); | |
| char *GetBlockFromCache(const char*, Int_t); | | char *GetBlockFromCache(const char*, Int_t); | |
| void SaveBlockInCache(TFPBlock*); | | void SaveBlockInCache(TFPBlock*); | |
| | | | |
| Int_t SumHex(const char*); | | Int_t SumHex(const char*); | |
| Bool_t BinarySearchReadList(TFPBlock*, Long64_t, Int_t, Int_t*); | | Bool_t BinarySearchReadList(TFPBlock*, Long64_t, Int_t, Int_t*); | |
| Long64_t GetWaitTime(); | | Long64_t GetWaitTime(); | |
| | | | |
| void SetFile(TFile*); | | void SetFile(TFile*); | |
|
| TCondition* GetCondNextFile() const { return fCondNextFile; }; | | TCondition* GetCondNewBlock() const { return fNewBlockAdded; }; | |
| void WaitFinishPrefetch(); | | void WaitFinishPrefetch(); | |
| | | | |
| ClassDef(TFilePrefetch, 0); // File block prefetcher | | ClassDef(TFilePrefetch, 0); // File block prefetcher | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 4 change blocks. |
| 3 lines changed or deleted | | 3 lines changed or added | |
|
| TGeoBranchArray.h | | TGeoBranchArray.h | |
| | | | |
| skipping to change at line 41 | | skipping to change at line 41 | |
| class TGeoBranchArray : public TObject | | class TGeoBranchArray : public TObject | |
| { | | { | |
| protected: | | protected: | |
| Int_t fLevel; // Branch depth | | Int_t fLevel; // Branch depth | |
| Int_t fMaxLevel; // Array length | | Int_t fMaxLevel; // Array length | |
| TGeoNode **fArray; //![fMaxLevel] Array of nodes | | TGeoNode **fArray; //![fMaxLevel] Array of nodes | |
| TGeoHMatrix *fMatrix; // Global matrix (owned) | | TGeoHMatrix *fMatrix; // Global matrix (owned) | |
| TObject *fClient; // Client object to notify | | TObject *fClient; // Client object to notify | |
| | | | |
| public: | | public: | |
|
| TGeoBranchArray() : TObject(), fLevel(0), fMaxLevel(10), fArray(NULL), f
Matrix(NULL), fClient(NULL) {} | | TGeoBranchArray() : TObject(), fLevel(-1), fMaxLevel(10), fArray(NULL),
fMatrix(NULL), fClient(NULL) {} | |
| TGeoBranchArray(Int_t level); | | TGeoBranchArray(Int_t level); | |
| virtual ~TGeoBranchArray(); | | virtual ~TGeoBranchArray(); | |
| | | | |
| TGeoBranchArray(const TGeoBranchArray&); | | TGeoBranchArray(const TGeoBranchArray&); | |
| TGeoBranchArray& operator=(const TGeoBranchArray&); | | TGeoBranchArray& operator=(const TGeoBranchArray&); | |
| Bool_t operator ==(const TGeoBranchArray& other) const; | | Bool_t operator ==(const TGeoBranchArray& other) const; | |
| Bool_t operator !=(const TGeoBranchArray& other) const; | | Bool_t operator !=(const TGeoBranchArray& other) const; | |
| Bool_t operator >(const TGeoBranchArray& other) const; | | Bool_t operator >(const TGeoBranchArray& other) const; | |
| Bool_t operator <(const TGeoBranchArray& other) const; | | Bool_t operator <(const TGeoBranchArray& other) const; | |
| Bool_t operator >=(const TGeoBranchArray& other) const; | | Bool_t operator >=(const TGeoBranchArray& other) const; | |
| | | | |
| skipping to change at line 67 | | skipping to change at line 67 | |
| TGeoNode **GetArray() const {return fArray;} | | TGeoNode **GetArray() const {return fArray;} | |
| TObject *GetClient() const {return fClient;} | | TObject *GetClient() const {return fClient;} | |
| Int_t GetLevel() const {return fLevel;} | | Int_t GetLevel() const {return fLevel;} | |
| TGeoHMatrix *GetMatrix() const {return fMatrix;} | | TGeoHMatrix *GetMatrix() const {return fMatrix;} | |
| TGeoNode *GetNode(Int_t level) const {return fArray[level];} | | TGeoNode *GetNode(Int_t level) const {return fArray[level];} | |
| TGeoNode *GetCurrentNode() const {return fArray[fLevel];} | | TGeoNode *GetCurrentNode() const {return fArray[fLevel];} | |
| void GetPath(TString &path) const; | | void GetPath(TString &path) const; | |
| void Init(TGeoNode **branch, TGeoMatrix *global, Int_t leve
l); | | void Init(TGeoNode **branch, TGeoMatrix *global, Int_t leve
l); | |
| void InitFromNavigator(TGeoNavigator *nav); | | void InitFromNavigator(TGeoNavigator *nav); | |
| virtual Bool_t IsSortable() const {return kTRUE;} | | virtual Bool_t IsSortable() const {return kTRUE;} | |
|
| | | Bool_t IsOutside() const {return (fLevel<0)?kTRUE:kFALSE;} | |
| virtual Bool_t Notify() {return (fClient)?fClient->Notify():kFALSE;} | | virtual Bool_t Notify() {return (fClient)?fClient->Notify():kFALSE;} | |
| virtual void Print(Option_t *option="") const; | | virtual void Print(Option_t *option="") const; | |
| void SetClient(TObject *client) {fClient = client;} | | void SetClient(TObject *client) {fClient = client;} | |
| static void Sort(Int_t n, TGeoBranchArray **array, Int_t *index, B
ool_t down=kTRUE); | | static void Sort(Int_t n, TGeoBranchArray **array, Int_t *index, B
ool_t down=kTRUE); | |
| static Long64_t BinarySearch(Long64_t n, const TGeoBranchArray **array
, TGeoBranchArray *value); | | static Long64_t BinarySearch(Long64_t n, const TGeoBranchArray **array
, TGeoBranchArray *value); | |
| void UpdateNavigator(TGeoNavigator *nav) const; | | void UpdateNavigator(TGeoNavigator *nav) const; | |
| | | | |
| ClassDef(TGeoBranchArray, 3) | | ClassDef(TGeoBranchArray, 3) | |
| }; | | }; | |
| | | | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 2 lines changed or added | |
|
| TGeoCone.h | | TGeoCone.h | |
| | | | |
| skipping to change at line 124 | | skipping to change at line 124 | |
| // - second phi limit /
/ | | // - second phi limit /
/ | |
| // /
/ | | // /
/ | |
| ///////////////////////////////////////////////////////////////////////////
/ | | ///////////////////////////////////////////////////////////////////////////
/ | |
| | | | |
| class TGeoConeSeg : public TGeoCone | | class TGeoConeSeg : public TGeoCone | |
| { | | { | |
| protected: | | protected: | |
| // data members | | // data members | |
| Double_t fPhi1; // first phi limit | | Double_t fPhi1; // first phi limit | |
| Double_t fPhi2; // second phi limit | | Double_t fPhi2; // second phi limit | |
|
| | | // Transient trigonometric data | |
| | | Double_t fS1; //!sin(phi1) | |
| | | Double_t fC1; //!cos(phi1) | |
| | | Double_t fS2; //!sin(phi2) | |
| | | Double_t fC2; //!cos(phi2) | |
| | | Double_t fSm; //!sin(0.5*(phi1+phi2)) | |
| | | Double_t fCm; //!cos(0.5*(phi1+phi2)) | |
| | | Double_t fCdfi; //!cos(0.5*(phi1-phi2)) | |
| | | | |
| | | void InitTrigonometry(); | |
| | | | |
| public: | | public: | |
| // constructors | | // constructors | |
| TGeoConeSeg(); | | TGeoConeSeg(); | |
| TGeoConeSeg(Double_t dz, Double_t rmin1, Double_t rmax1, | | TGeoConeSeg(Double_t dz, Double_t rmin1, Double_t rmax1, | |
| Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2
); | | Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2
); | |
| TGeoConeSeg(const char *name, Double_t dz, Double_t rmin1, Double_t rmax
1, | | TGeoConeSeg(const char *name, Double_t dz, Double_t rmin1, Double_t rmax
1, | |
| Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2
); | | Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2
); | |
| TGeoConeSeg(Double_t *params); | | TGeoConeSeg(Double_t *params); | |
| // destructor | | // destructor | |
| virtual ~TGeoConeSeg(); | | virtual ~TGeoConeSeg(); | |
| // methods | | // methods | |
|
| | | virtual void AfterStreamer(); | |
| virtual Double_t Capacity() const; | | virtual Double_t Capacity() const; | |
| static Double_t Capacity(Double_t dz, Double_t rmin1, Double_t rma
x1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2); | | static Double_t Capacity(Double_t dz, Double_t rmin1, Double_t rma
x1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2); | |
| virtual void ComputeBBox(); | | virtual void ComputeBBox(); | |
| virtual void ComputeNormal(const Double_t *point, const Double_
t *dir, Double_t *norm); | | virtual void ComputeNormal(const Double_t *point, const Double_
t *dir, Double_t *norm); | |
| virtual void ComputeNormal_v(const Double_t *points, const Doub
le_t *dirs, Double_t *norms, Int_t vecsize); | | virtual void ComputeNormal_v(const Double_t *points, const Doub
le_t *dirs, Double_t *norms, Int_t vecsize); | |
| static void ComputeNormalS(const Double_t *point, const Double
_t *dir, Double_t *norm, | | static void ComputeNormalS(const Double_t *point, const Double
_t *dir, Double_t *norm, | |
| Double_t dz, Double_t rmin1, Double
_t rmax1, Double_t rmin2, Double_t rmax2, | | Double_t dz, Double_t rmin1, Double
_t rmax1, Double_t rmin2, Double_t rmax2, | |
| Double_t c1, Double_t s1, Double_t
c2, Double_t s2); | | Double_t c1, Double_t s1, Double_t
c2, Double_t s2); | |
| virtual Bool_t Contains(const Double_t *point) const; | | virtual Bool_t Contains(const Double_t *point) const; | |
| virtual void Contains_v(const Double_t *points, Bool_t *inside,
Int_t vecsize) const; | | virtual void Contains_v(const Double_t *points, Bool_t *inside,
Int_t vecsize) const; | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 11 lines changed or added | |
|
| TGeoNavigator.h | | TGeoNavigator.h | |
| | | | |
| skipping to change at line 185 | | skipping to change at line 185 | |
| void SetCurrentPoint(Double_t x, Double_t y, Double_t
z) { | | void SetCurrentPoint(Double_t x, Double_t y, Double_t
z) { | |
| fPoint[0]=x; fPoint[1]=y; fPoint[2]=z;} | | fPoint[0]=x; fPoint[1]=y; fPoint[2]=z;} | |
| void SetLastPoint(Double_t x, Double_t y, Double_t z)
{ | | void SetLastPoint(Double_t x, Double_t y, Double_t z)
{ | |
| fLastPoint[0]=x; fLastPoint[1]=y; fLast
Point[2]=z;} | | fLastPoint[0]=x; fLastPoint[1]=y; fLast
Point[2]=z;} | |
| void SetCurrentDirection(const Double_t *dir) {memcpy(
fDirection,dir,3*sizeof(Double_t));} | | void SetCurrentDirection(const Double_t *dir) {memcpy(
fDirection,dir,3*sizeof(Double_t));} | |
| void SetCurrentDirection(Double_t nx, Double_t ny, Dou
ble_t nz) { | | void SetCurrentDirection(Double_t nx, Double_t ny, Dou
ble_t nz) { | |
| fDirection[0]=nx; fDirection[1]=ny; fDi
rection[2]=nz;} | | fDirection[0]=nx; fDirection[1]=ny; fDi
rection[2]=nz;} | |
| // void SetNormalChecked(Double_t norm) {fNormalChecked
=norm;} | | // void SetNormalChecked(Double_t norm) {fNormalChecked
=norm;} | |
| void SetCldirChecked(Double_t *dir) {memcpy(fCldirChec
ked, dir, 3*sizeof(Double_t));} | | void SetCldirChecked(Double_t *dir) {memcpy(fCldirChec
ked, dir, 3*sizeof(Double_t));} | |
| void SetLastSafetyForPoint(Double_t safe, const Double
_t *point) {fLastSafety=safe; memcpy(fLastPoint,point,3*sizeof(Double_t));} | | void SetLastSafetyForPoint(Double_t safe, const Double
_t *point) {fLastSafety=safe; memcpy(fLastPoint,point,3*sizeof(Double_t));} | |
|
| | | void SetLastSafetyForPoint(Double_t safe, Double_t x,
Double_t y, Double_t z) {fLastSafety=safe; fLastPoint[0]=x; fLastPoint[1]=y
, fLastPoint[2]=z;} | |
| | | | |
| //--- point/vector reference frame conversion | | //--- point/vector reference frame conversion | |
| void LocalToMaster(const Double_t *local, Double_t *ma
ster) const {fCache->LocalToMaster(local, master);} | | void LocalToMaster(const Double_t *local, Double_t *ma
ster) const {fCache->LocalToMaster(local, master);} | |
| void LocalToMasterVect(const Double_t *local, Double_t
*master) const {fCache->LocalToMasterVect(local, master);} | | void LocalToMasterVect(const Double_t *local, Double_t
*master) const {fCache->LocalToMasterVect(local, master);} | |
| void LocalToMasterBomb(const Double_t *local, Double_t
*master) const {fCache->LocalToMasterBomb(local, master);} | | void LocalToMasterBomb(const Double_t *local, Double_t
*master) const {fCache->LocalToMasterBomb(local, master);} | |
| void MasterToLocal(const Double_t *master, Double_t *l
ocal) const {fCache->MasterToLocal(master, local);} | | void MasterToLocal(const Double_t *master, Double_t *l
ocal) const {fCache->MasterToLocal(master, local);} | |
| void MasterToLocalVect(const Double_t *master, Double_
t *local) const {fCache->MasterToLocalVect(master, local);} | | void MasterToLocalVect(const Double_t *master, Double_
t *local) const {fCache->MasterToLocalVect(master, local);} | |
| void MasterToLocalBomb(const Double_t *master, Double_
t *local) const {fCache->MasterToLocalBomb(master, local);} | | void MasterToLocalBomb(const Double_t *master, Double_
t *local) const {fCache->MasterToLocalBomb(master, local);} | |
| void MasterToTop(const Double_t *master, Double_t *top
) const; | | void MasterToTop(const Double_t *master, Double_t *top
) const; | |
| void TopToMaster(const Double_t *top, Double_t *master
) const; | | void TopToMaster(const Double_t *top, Double_t *master
) const; | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 1 lines changed or added | |
|
| TGeoTube.h | | TGeoTube.h | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 114 | |
| // - second phi limit /
/ | | // - second phi limit /
/ | |
| // /
/ | | // /
/ | |
| ///////////////////////////////////////////////////////////////////////////
/ | | ///////////////////////////////////////////////////////////////////////////
/ | |
| | | | |
| class TGeoTubeSeg : public TGeoTube | | class TGeoTubeSeg : public TGeoTube | |
| { | | { | |
| protected: | | protected: | |
| // data members | | // data members | |
| Double_t fPhi1; // first phi limit | | Double_t fPhi1; // first phi limit | |
| Double_t fPhi2; // second phi limit | | Double_t fPhi2; // second phi limit | |
|
| | | // Transient trigonometric data | |
| | | Double_t fS1; //!sin(phi1) | |
| | | Double_t fC1; //!cos(phi1) | |
| | | Double_t fS2; //!sin(phi2) | |
| | | Double_t fC2; //!cos(phi2) | |
| | | Double_t fSm; //!sin(0.5*(phi1+phi2)) | |
| | | Double_t fCm; //!cos(0.5*(phi1+phi2)) | |
| | | Double_t fCdfi; //!cos(0.5*(phi1-phi2)) | |
| | | | |
| | | void InitTrigonometry(); | |
| | | | |
| public: | | public: | |
| // constructors | | // constructors | |
| TGeoTubeSeg(); | | TGeoTubeSeg(); | |
| TGeoTubeSeg(Double_t rmin, Double_t rmax, Double_t dz, | | TGeoTubeSeg(Double_t rmin, Double_t rmax, Double_t dz, | |
| Double_t phi1, Double_t phi2); | | Double_t phi1, Double_t phi2); | |
| TGeoTubeSeg(const char * name, Double_t rmin, Double_t rmax, Double_t dz
, | | TGeoTubeSeg(const char * name, Double_t rmin, Double_t rmax, Double_t dz
, | |
| Double_t phi1, Double_t phi2); | | Double_t phi1, Double_t phi2); | |
| TGeoTubeSeg(Double_t *params); | | TGeoTubeSeg(Double_t *params); | |
| // destructor | | // destructor | |
| virtual ~TGeoTubeSeg(); | | virtual ~TGeoTubeSeg(); | |
| // methods | | // methods | |
|
| | | virtual void AfterStreamer(); | |
| virtual Double_t Capacity() const; | | virtual Double_t Capacity() const; | |
| static Double_t Capacity(Double_t rmin, Double_t rmax, Double_t dz
, Double_t phi1, Double_t phi2); | | static Double_t Capacity(Double_t rmin, Double_t rmax, Double_t dz
, Double_t phi1, Double_t phi2); | |
| virtual void ComputeBBox(); | | virtual void ComputeBBox(); | |
| virtual void ComputeNormal(const Double_t *point, const Double_
t *dir, Double_t *norm); | | virtual void ComputeNormal(const Double_t *point, const Double_
t *dir, Double_t *norm); | |
| virtual void ComputeNormal_v(const Double_t *points, const Doub
le_t *dirs, Double_t *norms, Int_t vecsize); | | virtual void ComputeNormal_v(const Double_t *points, const Doub
le_t *dirs, Double_t *norms, Int_t vecsize); | |
| static void ComputeNormalS(const Double_t *point, const Double
_t *dir, Double_t *norm, | | static void ComputeNormalS(const Double_t *point, const Double
_t *dir, Double_t *norm, | |
| Double_t rmin, Double_t rmax, Doubl
e_t dz, | | Double_t rmin, Double_t rmax, Doubl
e_t dz, | |
| Double_t c1, Double_t s1, Double_t
c2, Double_t s2); | | Double_t c1, Double_t s1, Double_t
c2, Double_t s2); | |
| virtual Bool_t Contains(const Double_t *point) const; | | virtual Bool_t Contains(const Double_t *point) const; | |
| virtual void Contains_v(const Double_t *points, Bool_t *inside,
Int_t vecsize) const; | | virtual void Contains_v(const Double_t *points, Bool_t *inside,
Int_t vecsize) const; | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 11 lines changed or added | |
|
| TMath.h | | TMath.h | |
| | | | |
| skipping to change at line 152 | | skipping to change at line 152 | |
| inline Double_t ATan(Double_t); | | inline Double_t ATan(Double_t); | |
| inline Double_t ATan2(Double_t, Double_t); | | inline Double_t ATan2(Double_t, Double_t); | |
| Double_t ASinH(Double_t); | | Double_t ASinH(Double_t); | |
| Double_t ACosH(Double_t); | | Double_t ACosH(Double_t); | |
| Double_t ATanH(Double_t); | | Double_t ATanH(Double_t); | |
| Double_t Hypot(Double_t x, Double_t y); | | Double_t Hypot(Double_t x, Double_t y); | |
| | | | |
| /* ************************ */ | | /* ************************ */ | |
| /* * Elementary Functions * */ | | /* * Elementary Functions * */ | |
| /* ************************ */ | | /* ************************ */ | |
|
| inline Double_t Sqrt(Double_t x); | | | |
| inline Double_t Ceil(Double_t x); | | inline Double_t Ceil(Double_t x); | |
| inline Int_t CeilNint(Double_t x); | | inline Int_t CeilNint(Double_t x); | |
| inline Double_t Floor(Double_t x); | | inline Double_t Floor(Double_t x); | |
| inline Int_t FloorNint(Double_t x); | | inline Int_t FloorNint(Double_t x); | |
|
| | | template<typename T> | |
| | | inline Int_t Nint(T x); | |
| | | | |
| | | inline Double_t Sqrt(Double_t x); | |
| inline Double_t Exp(Double_t x); | | inline Double_t Exp(Double_t x); | |
| inline Double_t Ldexp(Double_t x, Int_t exp); | | inline Double_t Ldexp(Double_t x, Int_t exp); | |
| Double_t Factorial(Int_t i); | | Double_t Factorial(Int_t i); | |
| inline Double_t Power(Double_t x, Double_t y); | | inline Double_t Power(Double_t x, Double_t y); | |
| inline Double_t Power(Double_t x, Int_t y); | | inline Double_t Power(Double_t x, Int_t y); | |
| inline Double_t Log(Double_t x); | | inline Double_t Log(Double_t x); | |
| Double_t Log2(Double_t x); | | Double_t Log2(Double_t x); | |
| inline Double_t Log10(Double_t x); | | inline Double_t Log10(Double_t x); | |
|
| Int_t Nint(Float_t x); | | | |
| Int_t Nint(Double_t x); | | | |
| inline Int_t Finite(Double_t x); | | inline Int_t Finite(Double_t x); | |
| inline Int_t IsNaN(Double_t x); | | inline Int_t IsNaN(Double_t x); | |
| | | | |
| inline Double_t QuietNaN(); | | inline Double_t QuietNaN(); | |
| inline Double_t SignalingNaN(); | | inline Double_t SignalingNaN(); | |
| inline Double_t Infinity(); | | inline Double_t Infinity(); | |
| | | | |
| template <typename T> | | template <typename T> | |
| struct Limits { | | struct Limits { | |
| inline static T Min(); | | inline static T Min(); | |
| | | | |
| skipping to change at line 466 | | skipping to change at line 467 | |
| | | | |
| inline Int_t TMath::CeilNint(Double_t x) | | inline Int_t TMath::CeilNint(Double_t x) | |
| { return TMath::Nint(ceil(x)); } | | { return TMath::Nint(ceil(x)); } | |
| | | | |
| inline Double_t TMath::Floor(Double_t x) | | inline Double_t TMath::Floor(Double_t x) | |
| { return floor(x); } | | { return floor(x); } | |
| | | | |
| inline Int_t TMath::FloorNint(Double_t x) | | inline Int_t TMath::FloorNint(Double_t x) | |
| { return TMath::Nint(floor(x)); } | | { return TMath::Nint(floor(x)); } | |
| | | | |
|
| | | template<typename T> | |
| | | inline Int_t TMath::Nint(T x) | |
| | | { | |
| | | // Round to nearest integer. Rounds half integers to the nearest | |
| | | // even integer. | |
| | | int i; | |
| | | if (x >= 0) { | |
| | | i = int(x + 0.5); | |
| | | if ( i & 1 && x + 0.5 == T(i) ) i--; | |
| | | } else { | |
| | | i = int(x - 0.5); | |
| | | if ( i & 1 && x - 0.5 == T(i) ) i++; | |
| | | } | |
| | | return i; | |
| | | } | |
| | | | |
| inline Double_t TMath::Exp(Double_t x) | | inline Double_t TMath::Exp(Double_t x) | |
| { return exp(x); } | | { return exp(x); } | |
| | | | |
| inline Double_t TMath::Ldexp(Double_t x, Int_t exp) | | inline Double_t TMath::Ldexp(Double_t x, Int_t exp) | |
| { return ldexp(x, exp); } | | { return ldexp(x, exp); } | |
| | | | |
| inline Double_t TMath::Power(Double_t x, Double_t y) | | inline Double_t TMath::Power(Double_t x, Double_t y) | |
| { return pow(x, y); } | | { return pow(x, y); } | |
| | | | |
| inline Double_t TMath::Power(Double_t x, Int_t y) { | | inline Double_t TMath::Power(Double_t x, Int_t y) { | |
| | | | |
| skipping to change at line 492 | | skipping to change at line 509 | |
| | | | |
| inline Double_t TMath::Log(Double_t x) | | inline Double_t TMath::Log(Double_t x) | |
| { return log(x); } | | { return log(x); } | |
| | | | |
| inline Double_t TMath::Log10(Double_t x) | | inline Double_t TMath::Log10(Double_t x) | |
| { return log10(x); } | | { return log10(x); } | |
| | | | |
| inline Int_t TMath::Finite(Double_t x) | | inline Int_t TMath::Finite(Double_t x) | |
| #if defined(R__HPUX11) | | #if defined(R__HPUX11) | |
| { return isfinite(x); } | | { return isfinite(x); } | |
|
| #elif defined(R__MACOSX) && defined(__arm__) | | #elif defined(R__MACOSX) | |
| #ifdef isfinite | | #ifdef isfinite | |
| // from math.h | | // from math.h | |
| { return isfinite(x); } | | { return isfinite(x); } | |
| #else | | #else | |
| // from cmath | | // from cmath | |
| { return std::isfinite(x); } | | { return std::isfinite(x); } | |
| #endif | | #endif | |
| #else | | #else | |
| { return finite(x); } | | { return finite(x); } | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 4 lines changed or deleted | | 21 lines changed or added | |
|
| TProofBench.h | | TProofBench.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| #endif | | #endif | |
| #ifndef ROOT_TProofBenchTypes | | #ifndef ROOT_TProofBenchTypes | |
| #include "TProofBenchTypes.h" | | #include "TProofBenchTypes.h" | |
| #endif | | #endif | |
| #ifndef ROOT_TString | | #ifndef ROOT_TString | |
| #include "TString.h" | | #include "TString.h" | |
| #endif | | #endif | |
| | | | |
| class TF1; | | class TF1; | |
| class TFile; | | class TFile; | |
|
| | | class TGraphErrors; | |
| | | class TProfile; | |
| class TProof; | | class TProof; | |
| class TProofBenchRunCPU; | | class TProofBenchRunCPU; | |
| class TProofBenchRunDataRead; | | class TProofBenchRunDataRead; | |
| class TProofBenchDataSet; | | class TProofBenchDataSet; | |
| | | | |
| class TProofBench : public TObject { | | class TProofBench : public TObject { | |
| | | | |
| private: | | private: | |
| Bool_t fUnlinkOutfile; // Whether to remove empty output files | | Bool_t fUnlinkOutfile; // Whether to remove empty output files | |
| | | | |
| | | | |
| skipping to change at line 56 | | skipping to change at line 58 | |
| TProof* fProofDS; // Proof to be used for dataset actions | | TProof* fProofDS; // Proof to be used for dataset actions | |
| TFile *fOutFile; // Output file | | TFile *fOutFile; // Output file | |
| TString fOutFileName; // Name of the output file | | TString fOutFileName; // Name of the output file | |
| Int_t fNtries; // Number of times a measurement is repeat
ed | | Int_t fNtries; // Number of times a measurement is repeat
ed | |
| TPBHistType *fHistType; // Type of histograms for CPU runs | | TPBHistType *fHistType; // Type of histograms for CPU runs | |
| Int_t fNHist; // Number of histograms to be created in d
efault CPU runs | | Int_t fNHist; // Number of histograms to be created in d
efault CPU runs | |
| TPBReadType *fReadType; // Type of read (partial, full) | | TPBReadType *fReadType; // Type of read (partial, full) | |
| TString fDataSet; // Name of the dataset | | TString fDataSet; // Name of the dataset | |
| Int_t fNFilesWrk; // Number of files generated files per wor
ker | | Int_t fNFilesWrk; // Number of files generated files per wor
ker | |
| Int_t fNumWrkMax; // Max number of workers (required for dyn
amic setups) | | Int_t fNumWrkMax; // Max number of workers (required for dyn
amic setups) | |
|
| | | Bool_t fReleaseCache; // Release cache for data reads between ru
ns | |
| | | | |
| TString fCPUSel; // Selector to be used for CPU benchmarks | | TString fCPUSel; // Selector to be used for CPU benchmarks | |
| TString fCPUPar; // List of par files to be loaded for CPU
benchmarks | | TString fCPUPar; // List of par files to be loaded for CPU
benchmarks | |
| TString fDataSel; // Selector to be used for data benchmarks | | TString fDataSel; // Selector to be used for data benchmarks | |
| TString fDataPar; // List of par files to be loaded for data
benchmarks | | TString fDataPar; // List of par files to be loaded for data
benchmarks | |
| TString fDataGenSel; // Selector to be used for generate data f
or benchmarks | | TString fDataGenSel; // Selector to be used for generate data f
or benchmarks | |
| TString fDataGenPar; // List of par files to be loaded to gener
ate data for benchmarks | | TString fDataGenPar; // List of par files to be loaded to gener
ate data for benchmarks | |
| | | | |
| TProofBenchRunCPU *fRunCPU; // Instance to run CPU scans | | TProofBenchRunCPU *fRunCPU; // Instance to run CPU scans | |
| TProofBenchRunDataRead *fRunDS; // Instance to run data-read scans | | TProofBenchRunDataRead *fRunDS; // Instance to run data-read scans | |
| TProofBenchDataSet *fDS; // Instance to handle datasets operatio
ns | | TProofBenchDataSet *fDS; // Instance to handle datasets operatio
ns | |
| | | | |
| Bool_t fDebug; // Debug switch | | Bool_t fDebug; // Debug switch | |
| | | | |
| TNamed *fDescription; // Strings describing the cluster for this
test (saved in the output file) | | TNamed *fDescription; // Strings describing the cluster for this
test (saved in the output file) | |
| | | | |
|
| | | static TGraphErrors *GetGraph(TDirectory *d, const char *pfn, | |
| | | Int_t &nb, Double_t &xmi, Double_t &xmx, | |
| | | Double_t &ymi, Double_t &ymx, Int_t &kmx, | |
| | | TProfile *&pf); | |
| | | | |
| static TF1 *fgFp1; // Simple 1st degree polynomial | | static TF1 *fgFp1; // Simple 1st degree polynomial | |
| static TF1 *fgFp1n; // Normalized 1st degree | | static TF1 *fgFp1n; // Normalized 1st degree | |
| static TF1 *fgFp2; // Simple 2nd degree polynomial | | static TF1 *fgFp2; // Simple 2nd degree polynomial | |
| static TF1 *fgFp2n; // Normalized 2nd degree | | static TF1 *fgFp2n; // Normalized 2nd degree | |
| | | | |
|
| | | static TList *fgGraphs; // List of TGraphErrors created by Draw a | |
| | | ctions | |
| | | | |
| static void AssertFittingFun(Double_t mi, Double_t mx); | | static void AssertFittingFun(Double_t mi, Double_t mx); | |
| | | | |
| public: | | public: | |
| | | | |
| TProofBench(const char *url, const char *outfile = "<default>", const ch
ar *proofopt = 0); | | TProofBench(const char *url, const char *outfile = "<default>", const ch
ar *proofopt = 0); | |
| | | | |
| virtual ~TProofBench(); | | virtual ~TProofBench(); | |
| | | | |
| Int_t RunCPU(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1, Int_t s
tep=-1); | | Int_t RunCPU(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1, Int_t s
tep=-1); | |
| Int_t RunCPUx(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1); | | Int_t RunCPUx(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1); | |
| | | | |
| skipping to change at line 106 | | skipping to change at line 115 | |
| | | | |
| void CloseOutFile(); | | void CloseOutFile(); | |
| Int_t OpenOutFile(Bool_t wrt = kFALSE, Bool_t verbose = kTRUE); | | Int_t OpenOutFile(Bool_t wrt = kFALSE, Bool_t verbose = kTRUE); | |
| Int_t SetOutFile(const char *outfile, Bool_t verbose = kTRUE); | | Int_t SetOutFile(const char *outfile, Bool_t verbose = kTRUE); | |
| const char *GetOutFileName() const { return fOutFileName; } | | const char *GetOutFileName() const { return fOutFileName; } | |
| void SetNFilesWrk(Int_t nf = 0) { fNFilesWrk = (nf > 0) ? nf : 4; } | | void SetNFilesWrk(Int_t nf = 0) { fNFilesWrk = (nf > 0) ? nf : 4; } | |
| void SetNTries(Int_t nt) { if (nt > 0) fNtries = nt; } | | void SetNTries(Int_t nt) { if (nt > 0) fNtries = nt; } | |
| void SetHistType(TPBHistType *histtype) { fHistType = histtype; } | | void SetHistType(TPBHistType *histtype) { fHistType = histtype; } | |
| void SetNHist(Int_t nh) { fNHist = nh; } | | void SetNHist(Int_t nh) { fNHist = nh; } | |
| void SetReadType(TPBReadType *readtype) { fReadType = readtype; } | | void SetReadType(TPBReadType *readtype) { fReadType = readtype; } | |
|
| | | void SetReleaseCache(Bool_t on = kTRUE) { fReleaseCache = on; } | |
| | | | |
| void SetCPUSel(const char *sel) { fCPUSel = sel; } | | void SetCPUSel(const char *sel) { fCPUSel = sel; } | |
| void SetCPUPar(const char *par) { fCPUPar = par; } | | void SetCPUPar(const char *par) { fCPUPar = par; } | |
| void SetDataSel(const char *sel) { fDataSel = sel; } | | void SetDataSel(const char *sel) { fDataSel = sel; } | |
| void SetDataPar(const char *par) { fDataPar = par; } | | void SetDataPar(const char *par) { fDataPar = par; } | |
| void SetDataGenSel(const char *sel) { fDataGenSel = sel; } | | void SetDataGenSel(const char *sel) { fDataGenSel = sel; } | |
| void SetDataGenPar(const char *par) { fDataGenPar = par; } | | void SetDataGenPar(const char *par) { fDataGenPar = par; } | |
| | | | |
| void SetProofDS(TProof *p); | | void SetProofDS(TProof *p); | |
| | | | |
| void SetDebug(Bool_t debug = kTRUE) { fDebug = debug; } | | void SetDebug(Bool_t debug = kTRUE) { fDebug = debug; } | |
| | | | |
| Bool_t GetDebug() { return fDebug; } | | Bool_t GetDebug() { return fDebug; } | |
| | | | |
| static void DrawCPU(const char *outfile, const char *opt = "std:", Bool_
t verbose = kFALSE, Int_t dofit = 0); | | static void DrawCPU(const char *outfile, const char *opt = "std:", Bool_
t verbose = kFALSE, Int_t dofit = 0); | |
| static void DrawDataSet(const char *outfile, const char *opt = "std:", c
onst char *type = "mbs", Bool_t verbose = kFALSE); | | static void DrawDataSet(const char *outfile, const char *opt = "std:", c
onst char *type = "mbs", Bool_t verbose = kFALSE); | |
| static void GetPerfSpecs(const char *path = ".", Int_t degfit = 1); | | static void GetPerfSpecs(const char *path = ".", Int_t degfit = 1); | |
|
| | | static void DrawEfficiency(const char *outfile, const char *opt = "", Bo | |
| | | ol_t verbose = kFALSE); | |
| | | | |
| | | static TList *GetGraphs() { return fgGraphs; } | |
| | | | |
| ClassDef(TProofBench, 0) // Steering class for PROOF benchmarks | | ClassDef(TProofBench, 0) // Steering class for PROOF benchmarks | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 0 lines changed or deleted | | 16 lines changed or added | |
|
| TProofBenchRunDataRead.h | | TProofBenchRunDataRead.h | |
| | | | |
| skipping to change at line 39 | | skipping to change at line 39 | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOT_TProofBenchRun | | #ifndef ROOT_TProofBenchRun | |
| #include "TProofBenchRun.h" | | #include "TProofBenchRun.h" | |
| #endif | | #endif | |
| | | | |
| class TProof; | | class TProof; | |
| class TCanvas; | | class TCanvas; | |
| class TH2; | | class TH2; | |
| class TProfile; | | class TProfile; | |
|
| | | class TLegend; | |
| class TTree; | | class TTree; | |
| class TFileCollection; | | class TFileCollection; | |
| | | | |
| class TProofBenchMode; | | class TProofBenchMode; | |
| class TProofBenchDataSet; | | class TProofBenchDataSet; | |
| class TProofNodes; | | class TProofNodes; | |
| class TPBReadType; | | class TPBReadType; | |
| | | | |
| class TProofBenchRunDataRead : public TProofBenchRun { | | class TProofBenchRunDataRead : public TProofBenchRun { | |
| | | | |
| | | | |
| skipping to change at line 62 | | skipping to change at line 63 | |
| TPBReadType *fReadType; //read type | | TPBReadType *fReadType; //read type | |
| TProofBenchDataSet *fDS; //dataset operations handler | | TProofBenchDataSet *fDS; //dataset operations handler | |
| | | | |
| Long64_t fNEvents; //number of events per file | | Long64_t fNEvents; //number of events per file | |
| Int_t fNTries; //number of tries | | Int_t fNTries; //number of tries | |
| Int_t fStart; //start number of workers | | Int_t fStart; //start number of workers | |
| Int_t fStop; //stop number of workers | | Int_t fStop; //stop number of workers | |
| Int_t fStep; //test to be performed every fStep workers | | Int_t fStep; //test to be performed every fStep workers | |
| Int_t fDebug; //debug switch | | Int_t fDebug; //debug switch | |
| Int_t fFilesPerWrk; //# of files to be processed per worker | | Int_t fFilesPerWrk; //# of files to be processed per worker | |
|
| | | Bool_t fReleaseCache; // Release cache for data reads between ru
ns | |
| | | | |
| TDirectory *fDirProofBench; //directory for proof outputs | | TDirectory *fDirProofBench; //directory for proof outputs | |
| | | | |
| TProofNodes *fNodes; //list of nodes information | | TProofNodes *fNodes; //list of nodes information | |
| | | | |
| TList *fListPerfPlots; //list of performance plots | | TList *fListPerfPlots; //list of performance plots | |
| TProfile *fProfile_perfstat_event; | | TProfile *fProfile_perfstat_event; | |
| TH2 *fHist_perfstat_event; | | TH2 *fHist_perfstat_event; | |
|
| | | TProfile *fProfile_perfstat_evtmax; | |
| | | TProfile *fNorm_perfstat_evtmax; | |
| TProfile *fProfile_queryresult_event; | | TProfile *fProfile_queryresult_event; | |
| TProfile *fNorm_queryresult_event; | | TProfile *fNorm_queryresult_event; | |
| TProfile *fProfile_perfstat_IO; | | TProfile *fProfile_perfstat_IO; | |
| TH2 *fHist_perfstat_IO; | | TH2 *fHist_perfstat_IO; | |
|
| | | TProfile *fProfile_perfstat_IOmax; | |
| | | TProfile *fNorm_perfstat_IOmax; | |
| TProfile *fProfile_queryresult_IO; | | TProfile *fProfile_queryresult_IO; | |
| TProfile *fNorm_queryresult_IO; | | TProfile *fNorm_queryresult_IO; | |
|
| | | TProfile *fProfile_cpu_eff; | |
| | | | |
| | | TLegend *fProfLegend_evt; // Legend for profiles evts | |
| | | TLegend *fNormLegend_evt; // Legend for norms evts | |
| | | TLegend *fProfLegend_mb; // Legend for profiles mbs | |
| | | TLegend *fNormLegend_mb; // Legend for norms mbs | |
| | | | |
| TCanvas *fCPerfProfiles; //canvas for performance profile histogram
s | | TCanvas *fCPerfProfiles; //canvas for performance profile histogram
s | |
| | | | |
| TString fName; //name of this run | | TString fName; //name of this run | |
| | | | |
| void BuildHistos(Int_t start, Int_t stop, Int_t step, Bool_t nx); | | void BuildHistos(Int_t start, Int_t stop, Int_t step, Bool_t nx); | |
| | | | |
| protected: | | protected: | |
| | | | |
| void FillPerfStatProfiles(TTree* t, Int_t nactive); | | void FillPerfStatProfiles(TTree* t, Int_t nactive); | |
| | | | |
| skipping to change at line 118 | | skipping to change at line 130 | |
| | | | |
| void SetReadType(TPBReadType *readtype) { fReadType = readtype; } | | void SetReadType(TPBReadType *readtype) { fReadType = readtype; } | |
| void SetNEvents(Long64_t nevents) { fNEvents = nevents; } | | void SetNEvents(Long64_t nevents) { fNEvents = nevents; } | |
| void SetNTries(Int_t ntries) { fNTries = ntries; } | | void SetNTries(Int_t ntries) { fNTries = ntries; } | |
| void SetStart(Int_t start) { fStart = start; } | | void SetStart(Int_t start) { fStart = start; } | |
| void SetStop(Int_t stop) { fStop = stop; } | | void SetStop(Int_t stop) { fStop = stop; } | |
| void SetStep(Int_t step) { fStep = step; } | | void SetStep(Int_t step) { fStep = step; } | |
| void SetDebug(Int_t debug) { fDebug = debug; } | | void SetDebug(Int_t debug) { fDebug = debug; } | |
| void SetDirProofBench(TDirectory* dir) { fDirProofBench = dir; } | | void SetDirProofBench(TDirectory* dir) { fDirProofBench = dir; } | |
| void SetFilesPerWrk(Int_t fpw) { fFilesPerWrk = fpw; } | | void SetFilesPerWrk(Int_t fpw) { fFilesPerWrk = fpw; } | |
|
| | | void SetReleaseCache(Bool_t on = kTRUE) { fReleaseCache = on; } | |
| | | | |
| TPBReadType *GetReadType() const { return fReadType; } | | TPBReadType *GetReadType() const { return fReadType; } | |
| Long64_t GetNEvents() const { return fNEvents; } | | Long64_t GetNEvents() const { return fNEvents; } | |
| Int_t GetNTries() const { return fNTries; } | | Int_t GetNTries() const { return fNTries; } | |
| Int_t GetStart() const { return fStart; } | | Int_t GetStart() const { return fStart; } | |
| Int_t GetStop() const { return fStop; } | | Int_t GetStop() const { return fStop; } | |
| Int_t GetStep() const { return fStep; } | | Int_t GetStep() const { return fStep; } | |
| Int_t GetDebug() const { return fDebug; } | | Int_t GetDebug() const { return fDebug; } | |
| TDirectory* GetDirProofBench() const { return fDirProofBench; } | | TDirectory* GetDirProofBench() const { return fDirProofBench; } | |
| TCanvas* GetCPerfProfiles() const { return fCPerfProfiles; } | | TCanvas* GetCPerfProfiles() const { return fCPerfProfiles; } | |
| | | | |
End of changes. 6 change blocks. |
| 0 lines changed or deleted | | 13 lines changed or added | |
|
| TProofPerfAnalysis.h | | TProofPerfAnalysis.h | |
| | | | |
| skipping to change at line 86 | | skipping to change at line 86 | |
| void FillWrkInfo(Bool_t force = kFALSE); | | void FillWrkInfo(Bool_t force = kFALSE); | |
| void FillFileInfo(Bool_t force = kFALSE); | | void FillFileInfo(Bool_t force = kFALSE); | |
| TString GetCanvasTitle(const char *t); | | TString GetCanvasTitle(const char *t); | |
| void GetWrkFileList(TList *wl, TList *sl); | | void GetWrkFileList(TList *wl, TList *sl); | |
| void LoadTree(TDirectory *dir); | | void LoadTree(TDirectory *dir); | |
| | | | |
| public: | | public: | |
| | | | |
| TProofPerfAnalysis(const char *perffile, const char *title = "", | | TProofPerfAnalysis(const char *perffile, const char *title = "", | |
| const char *treename = "PROOF_PerfStats"); | | const char *treename = "PROOF_PerfStats"); | |
|
| | | TProofPerfAnalysis(TTree *tree, const char *title = ""); | |
| virtual ~TProofPerfAnalysis(); | | virtual ~TProofPerfAnalysis(); | |
| | | | |
| Bool_t IsValid() const { return (fFile && fTree) ? kTRUE : kFALSE; } | | Bool_t IsValid() const { return (fFile && fTree) ? kTRUE : kFALSE; } | |
| Bool_t WrkInfoOK() const { return (fWrksInfo.GetSize() > 0) ? kTRUE : kF
ALSE; } | | Bool_t WrkInfoOK() const { return (fWrksInfo.GetSize() > 0) ? kTRUE : kF
ALSE; } | |
| | | | |
| void EventDist(); // Analyse event and packet
distribution | | void EventDist(); // Analyse event and packet
distribution | |
| void FileDist(Bool_t writedet = kFALSE); // Analyse the file distribu
tion | | void FileDist(Bool_t writedet = kFALSE); // Analyse the file distribu
tion | |
| void LatencyPlot(const char *wrks = 0); // Packet latency distributi
on vs time | | void LatencyPlot(const char *wrks = 0); // Packet latency distributi
on vs time | |
| void RatePlot(const char *wrks = 0); // Rate distribution vs time | | void RatePlot(const char *wrks = 0); // Rate distribution vs time | |
| void WorkerActivity(); // Analyse the worker activi
ty | | void WorkerActivity(); // Analyse the worker activi
ty | |
| void PrintWrkInfo(Int_t showlast = 10); // Print workers info | | void PrintWrkInfo(Int_t showlast = 10); // Print workers info | |
| void PrintWrkInfo(const char *wrk); // Print worker info by name | | void PrintWrkInfo(const char *wrk); // Print worker info by name | |
| | | | |
| void PrintFileInfo(Int_t showlast = 10, const char *opt = "", const cha
r *out = 0); // Print file info | | void PrintFileInfo(Int_t showlast = 10, const char *opt = "", const cha
r *out = 0); // Print file info | |
| void PrintFileInfo(const char *fn, const char *opt = "P", const char *o
ut = 0); // Print file info by name | | void PrintFileInfo(const char *fn, const char *opt = "P", const char *o
ut = 0); // Print file info by name | |
| void FileProcPlot(const char *fn, const char *out = 0); // Plot info ab
out file processing | | void FileProcPlot(const char *fn, const char *out = 0); // Plot info ab
out file processing | |
| void FileRatePlot(const char *fns = 0); // Plot info about file proc
essing rates | | void FileRatePlot(const char *fns = 0); // Plot info about file proc
essing rates | |
| | | | |
|
| | | Double_t GetEvtRateAvgMax() const { return fEvtRateAvgMax; } // Max | |
| | | running event processing rate | |
| | | Double_t GetMBRateAvgMax() const { return fMBRateAvgMax; } // Max | |
| | | running MB processing rate | |
| | | Double_t GetEvtRateAvg() const { return fEvtRateAvg; } // Averag | |
| | | e event processing rate | |
| | | Double_t GetMBRateAvg() const { return fMBRateAvg; } // Average | |
| | | MB processing rate | |
| | | void GetAverages(Double_t &evtmax, Double_t &mbmax, Double_t &evt, Doubl | |
| | | e_t &mb) const | |
| | | { evtmax = fEvtRateAvgMax; mbmax = fMBRateAvgMax; evt = fEvtRateAvg | |
| | | ; mb = fMBRateAvg; return; } | |
| | | | |
| void Summary(Option_t *opt = "", const char *out = ""); | | void Summary(Option_t *opt = "", const char *out = ""); | |
| | | | |
| void SetDebug(Int_t d = 0); // Setter for the verbosity level | | void SetDebug(Int_t d = 0); // Setter for the verbosity level | |
| static void SetgDebug(Bool_t on = kTRUE); // Overall verbosity level | | static void SetgDebug(Bool_t on = kTRUE); // Overall verbosity level | |
| | | | |
| ClassDef(TProofPerfAnalysis, 0) // Set of tools to analyse the perform
ance tree | | ClassDef(TProofPerfAnalysis, 0) // Set of tools to analyse the perform
ance tree | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 14 lines changed or added | |
|
| TVirtualCollectionIterators.h | | TVirtualCollectionIterators.h | |
|
| // @(#)root/cont:$Id$ | | // @(#)root/cont:$Id: e00edea30f17233d3f97a85eba14e20c201eb980 $ | |
| // Author: Philippe Canal 20/08/2010 | | // Author: Philippe Canal 20/08/2010 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2003, Rene Brun, Fons Rademakers and al. * | | * Copyright (C) 1995-2003, Rene Brun, Fons Rademakers and al. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 66 | | skipping to change at line 66 | |
| fCreateIterators = proxy->GetFunctionCreateIterators(read); | | fCreateIterators = proxy->GetFunctionCreateIterators(read); | |
| fDeleteTwoIterators = proxy->GetFunctionDeleteTwoIterators(read); | | fDeleteTwoIterators = proxy->GetFunctionDeleteTwoIterators(read); | |
| } else { | | } else { | |
| ::Fatal("TIterators::TIterators","Created with out a collection pr
oxy!\n"); | | ::Fatal("TIterators::TIterators","Created with out a collection pr
oxy!\n"); | |
| } | | } | |
| } | | } | |
| TVirtualCollectionIterators(CreateIterators_t creator, DeleteTwoIterator
s_t destruct) : fBegin( &(fBeginBuffer[0]) ), fEnd(&(fEndBuffer[0])), fCrea
teIterators(creator), fDeleteTwoIterators(destruct) | | TVirtualCollectionIterators(CreateIterators_t creator, DeleteTwoIterator
s_t destruct) : fBegin( &(fBeginBuffer[0]) ), fEnd(&(fEndBuffer[0])), fCrea
teIterators(creator), fDeleteTwoIterators(destruct) | |
| { | | { | |
| } | | } | |
| | | | |
|
| inline void CreateIterators(void *collection) | | inline void CreateIterators(void *collection, TVirtualCollectionProxy *p
roxy) | |
| { | | { | |
| // Initialize the fBegin and fEnd iterators. | | // Initialize the fBegin and fEnd iterators. | |
| | | | |
|
| fCreateIterators(collection, &fBegin, &fEnd); | | fCreateIterators(collection, &fBegin, &fEnd, proxy); | |
| } | | } | |
| | | | |
| inline ~TVirtualCollectionIterators() | | inline ~TVirtualCollectionIterators() | |
| { | | { | |
| if (fBegin != &(fBeginBuffer[0])) { | | if (fBegin != &(fBeginBuffer[0])) { | |
| // assert(end != endbuf); | | // assert(end != endbuf); | |
| fDeleteTwoIterators(fBegin,fEnd); | | fDeleteTwoIterators(fBegin,fEnd); | |
| } | | } | |
| } | | } | |
| }; | | }; | |
| | | | |
| skipping to change at line 146 | | skipping to change at line 146 | |
| fDeleteTwoIterators = proxy->GetFunctionDeleteTwoIterators(); | | fDeleteTwoIterators = proxy->GetFunctionDeleteTwoIterators(); | |
| | | | |
| fEndBuffer.fCopy = fBeginBuffer.fCopy = proxy->GetFunctionCopyIter
ator(); | | fEndBuffer.fCopy = fBeginBuffer.fCopy = proxy->GetFunctionCopyIter
ator(); | |
| fEndBuffer.fNext = fBeginBuffer.fNext = proxy->GetFunctionNext(); | | fEndBuffer.fNext = fBeginBuffer.fNext = proxy->GetFunctionNext(); | |
| fEndBuffer.fDelete = fBeginBuffer.fDelete = proxy->GetFunctionDele
teIterator(); | | fEndBuffer.fDelete = fBeginBuffer.fDelete = proxy->GetFunctionDele
teIterator(); | |
| } else { | | } else { | |
| ::Fatal("TIterators::TIterators","Created with out a collection pr
oxy!\n"); | | ::Fatal("TIterators::TIterators","Created with out a collection pr
oxy!\n"); | |
| } | | } | |
| } | | } | |
| | | | |
|
| inline void CreateIterators(void *collection) | | inline void CreateIterators(void *collection, TVirtualCollectionProxy *p
roxy) | |
| { | | { | |
| // Initialize the fBegin and fEnd iterators. | | // Initialize the fBegin and fEnd iterators. | |
| | | | |
| fBegin = &(fRawBeginBuffer[0]); | | fBegin = &(fRawBeginBuffer[0]); | |
| fEnd = &(fRawEndBuffer[0]); | | fEnd = &(fRawEndBuffer[0]); | |
|
| fCreateIterators(collection, &fBegin, &fEnd); | | fCreateIterators(collection, &fBegin, &fEnd, proxy); | |
| if (fBegin != &(fRawBeginBuffer[0])) { | | if (fBegin != &(fRawBeginBuffer[0])) { | |
| // The iterator where too large to buffer in the buffer | | // The iterator where too large to buffer in the buffer | |
| fAllocated = kTRUE; | | fAllocated = kTRUE; | |
| } | | } | |
| fBeginBuffer.fIter = fBegin; | | fBeginBuffer.fIter = fBegin; | |
| fEndBuffer.fIter = fEnd; | | fEndBuffer.fIter = fEnd; | |
| fBegin = &fBeginBuffer; | | fBegin = &fBeginBuffer; | |
| fEnd = &fEndBuffer; | | fEnd = &fEndBuffer; | |
| } | | } | |
| | | | |
| | | | |
End of changes. 5 change blocks. |
| 5 lines changed or deleted | | 5 lines changed or added | |
|
| Tools.h | | Tools.h | |
| | | | |
| skipping to change at line 139 | | skipping to change at line 139 | |
| | | | |
| // parse option string for ANN methods | | // parse option string for ANN methods | |
| std::vector<Int_t>* ParseANNOptionString( TString theOptions, Int_t n
var, | | std::vector<Int_t>* ParseANNOptionString( TString theOptions, Int_t n
var, | |
| std::vector<Int_t>* nodes )
; | | std::vector<Int_t>* nodes )
; | |
| | | | |
| // returns the square-root of a symmetric matrix: symMat = sqrtMat*sq
rtMat | | // returns the square-root of a symmetric matrix: symMat = sqrtMat*sq
rtMat | |
| TMatrixD* GetSQRootMatrix( TMatrixDSym* symMat ); | | TMatrixD* GetSQRootMatrix( TMatrixDSym* symMat ); | |
| | | | |
| // returns the covariance matrix of of the different classes (and the
sum) | | // returns the covariance matrix of of the different classes (and the
sum) | |
| // given the event sample | | // given the event sample | |
|
| std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector< | | std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector< | |
| TMVA::Event*>& events, Int_t maxCls, VariableTransformBase* transformBase=0 | | Event*>& events, Int_t maxCls, VariableTransformBase* transformBase=0 ); | |
| ); | | std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector< | |
| std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector< | | const Event*>& events, Int_t maxCls, VariableTransformBase* transformBase=0 | |
| const TMVA::Event*>& events, Int_t maxCls, VariableTransformBase* transform | | ); | |
| Base=0 ); | | | |
| | | | |
| // turns covariance into correlation matrix | | // turns covariance into correlation matrix | |
| const TMatrixD* GetCorrelationMatrix( const TMatrixD* covMat ); | | const TMatrixD* GetCorrelationMatrix( const TMatrixD* covMat ); | |
| | | | |
| // check spline quality by comparison with initial histogram | | // check spline quality by comparison with initial histogram | |
| Bool_t CheckSplines( const TH1*, const TSpline* ); | | Bool_t CheckSplines( const TH1*, const TSpline* ); | |
| | | | |
| // normalization of variable output | | // normalization of variable output | |
| Double_t NormVariable( Double_t x, Double_t xmin, Double_t xmax ); | | Double_t NormVariable( Double_t x, Double_t xmin, Double_t xmax ); | |
| | | | |
| | | | |
| skipping to change at line 268 | | skipping to change at line 268 | |
| Bool_t AddRawLine ( void* node, const char * raw ); | | Bool_t AddRawLine ( void* node, const char * raw ); | |
| Bool_t AddComment ( void* node, const char* comment ); | | Bool_t AddComment ( void* node, const char* comment ); | |
| | | | |
| void* GetParent( void* child); | | void* GetParent( void* child); | |
| void* GetChild ( void* parent, const char* childname=0 ); | | void* GetChild ( void* parent, const char* childname=0 ); | |
| void* GetNextChild( void* prevchild, const char* childname=0 ); | | void* GetNextChild( void* prevchild, const char* childname=0 ); | |
| const char* GetContent ( void* node ); | | const char* GetContent ( void* node ); | |
| const char* GetName ( void* node ); | | const char* GetName ( void* node ); | |
| | | | |
| TXMLEngine& xmlengine() { return *fXMLEngine; } | | TXMLEngine& xmlengine() { return *fXMLEngine; } | |
|
| int xmlenginebuffersize() { return 1000000; } | | int xmlenginebuffersize() { return 10000000; } | |
| TXMLEngine* fXMLEngine; | | TXMLEngine* fXMLEngine; | |
| | | | |
| private: | | private: | |
| | | | |
| // utilities for correlation ratio | | // utilities for correlation ratio | |
| Double_t GetYMean_binX( const TH2& , Int_t bin_x ); | | Double_t GetYMean_binX( const TH2& , Int_t bin_x ); | |
| | | | |
| }; // Common tools | | }; // Common tools | |
| | | | |
| Tools& gTools(); // global accessor | | Tools& gTools(); // global accessor | |
| | | | |
End of changes. 2 change blocks. |
| 7 lines changed or deleted | | 6 lines changed or added | |
|
| VariableTransformBase.h | | VariableTransformBase.h | |
| | | | |
| skipping to change at line 79 | | skipping to change at line 79 | |
| public: | | public: | |
| | | | |
| typedef std::vector<std::pair<Char_t,UInt_t> > VectorOfCharAndInt; | | typedef std::vector<std::pair<Char_t,UInt_t> > VectorOfCharAndInt; | |
| typedef VectorOfCharAndInt::iterator ItVarTypeIdx; | | typedef VectorOfCharAndInt::iterator ItVarTypeIdx; | |
| typedef VectorOfCharAndInt::const_iterator ItVarTypeIdxConst; | | typedef VectorOfCharAndInt::const_iterator ItVarTypeIdxConst; | |
| | | | |
| VariableTransformBase( DataSetInfo& dsi, Types::EVariableTransform tf
, const TString& trfName ); | | VariableTransformBase( DataSetInfo& dsi, Types::EVariableTransform tf
, const TString& trfName ); | |
| virtual ~VariableTransformBase( void ); | | virtual ~VariableTransformBase( void ); | |
| | | | |
| virtual void Initialize() = 0; | | virtual void Initialize() = 0; | |
|
| virtual Bool_t PrepareTransformation( const std::vector<Event*>
& ) = 0; | | virtual Bool_t PrepareTransformation (const std::vector<Event*>
& ) = 0; | |
| virtual const Event* Transform ( const Event* const, Int_t cls
) const = 0; | | virtual const Event* Transform ( const Event* const, Int_t cls
) const = 0; | |
| virtual const Event* InverseTransform( const Event* const, Int_t cls
) const = 0; | | virtual const Event* InverseTransform( const Event* const, Int_t cls
) const = 0; | |
| | | | |
| // accessors | | // accessors | |
| void SetEnabled ( Bool_t e ) { fEnabled = e; } | | void SetEnabled ( Bool_t e ) { fEnabled = e; } | |
| void SetNormalise( Bool_t n ) { fNormalise = n; } | | void SetNormalise( Bool_t n ) { fNormalise = n; } | |
| Bool_t IsEnabled() const { return fEnabled; } | | Bool_t IsEnabled() const { return fEnabled; } | |
| Bool_t IsCreated() const { return fCreated; } | | Bool_t IsCreated() const { return fCreated; } | |
| Bool_t IsNormalised() const { return fNormalise; } | | Bool_t IsNormalised() const { return fNormalise; } | |
| | | | |
| | | | |
| skipping to change at line 119 | | skipping to change at line 119 | |
| virtual void ReadFromXML( void* trfnode ) = 0; | | virtual void ReadFromXML( void* trfnode ) = 0; | |
| | | | |
| Types::EVariableTransform GetVariableTransform() const { return fVari
ableTransform; } | | Types::EVariableTransform GetVariableTransform() const { return fVari
ableTransform; } | |
| | | | |
| // writer of function code | | // writer of function code | |
| virtual void MakeFunction( std::ostream& fout, const TString& fncName
, Int_t part, | | virtual void MakeFunction( std::ostream& fout, const TString& fncName
, Int_t part, | |
| UInt_t trCounter, Int_t cls ) = 0; | | UInt_t trCounter, Int_t cls ) = 0; | |
| | | | |
| // provides string vector giving explicit transformation | | // provides string vector giving explicit transformation | |
| virtual std::vector<TString>* GetTransformationStrings( Int_t cls ) c
onst; | | virtual std::vector<TString>* GetTransformationStrings( Int_t cls ) c
onst; | |
|
| virtual void PrintTransformation( ostream & ) {} | | virtual void PrintTransformation( std::ostream & ) {} | |
| | | | |
| const std::vector<TMVA::VariableInfo>& Variables() const { return fVa
riables; } | | const std::vector<TMVA::VariableInfo>& Variables() const { return fVa
riables; } | |
| const std::vector<TMVA::VariableInfo>& Targets() const { return fTa
rgets; } | | const std::vector<TMVA::VariableInfo>& Targets() const { return fTa
rgets; } | |
| const std::vector<TMVA::VariableInfo>& Spectators() const { return
fSpectators; } | | const std::vector<TMVA::VariableInfo>& Spectators() const { return
fSpectators; } | |
| | | | |
| MsgLogger& Log() const { return *fLogger; } | | MsgLogger& Log() const { return *fLogger; } | |
| | | | |
| void SetTMVAVersion(TMVAVersion_t v) { fTMVAVersion = v; } | | void SetTMVAVersion(TMVAVersion_t v) { fTMVAVersion = v; } | |
| | | | |
| protected: | | protected: | |
| | | | |
|
| void CalcNorm( const std::vector<Event*>& ); | | void CalcNorm( const std::vector<const Event*>& ); | |
| | | | |
| void SetCreated( Bool_t c = kTRUE ) { fCreated = c; } | | void SetCreated( Bool_t c = kTRUE ) { fCreated = c; } | |
| void SetNVariables( UInt_t i ) { fNVars = i; } | | void SetNVariables( UInt_t i ) { fNVars = i; } | |
| void SetName( const TString& c ) { fTransformName = c; } | | void SetName( const TString& c ) { fTransformName = c; } | |
| | | | |
| UInt_t GetNVariables() const { return fDsi.GetNVariables(); } | | UInt_t GetNVariables() const { return fDsi.GetNVariables(); } | |
| UInt_t GetNTargets() const { return fDsi.GetNTargets(); } | | UInt_t GetNTargets() const { return fDsi.GetNTargets(); } | |
| UInt_t GetNSpectators() const { return fDsi.GetNSpectators(); } | | UInt_t GetNSpectators() const { return fDsi.GetNSpectators(); } | |
| | | | |
| DataSetInfo& fDsi; | | DataSetInfo& fDsi; | |
| | | | |
End of changes. 3 change blocks. |
| 3 lines changed or deleted | | 3 lines changed or added | |
|