00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "AIDA_Cloud1DIterator.h"
00031 #include "AIDA_Function_FML/AIDA_RangeSet.h"
00032
00033 # include "AIDA/ICloud1D.h"
00034
00035 # include "FML/debug.h"
00036
00037
00038 namespace Anaphe {
00039 namespace AIDA_Fitter_FML {
00040
00041
00042 AIDA_Cloud1DIterator::AIDA_Cloud1DIterator(const AIDA::ICloud1D& h) : m_hist(&h), m_dim(h.dimension())
00043 {
00044 }
00045
00046 AIDA_Cloud1DIterator::~AIDA_Cloud1DIterator()
00047 {
00048 }
00049
00050 AIDA_Cloud1DIterator::AIDA_Cloud1DIterator(const AIDA_Cloud1DIterator &)
00051 {
00052 }
00053
00054 AIDA_Cloud1DIterator & AIDA_Cloud1DIterator::operator = (const AIDA_Cloud1DIterator &rhs)
00055 {
00056 if (this == &rhs) return *this;
00057
00058 return *this;
00059 }
00060
00061
00062
00063 void AIDA_Cloud1DIterator::fillData(const std::vector<Anaphe::AIDA_Function_FML::AIDA_RangeSet * > & ranges)
00064 {
00065 int n = ranges.size();
00066 if (n != m_dim) {
00067 INFO_MSG(" AIDA_Cloud1DIterator::fillData invalid dimension for rangeset - cannot feed data in FNL");
00068 return;
00069 }
00070 if (!ranges[0]) {
00071 INFO_MSG(" AIDA_Cloud1DIterator::fillData invalid rangeset - cannot feed data in FNL");
00072 return;
00073 }
00074
00075 std::auto_ptr<FML::DataVector> vptr (new FML::DataVector());
00076
00077 std::vector<double> x(m_dim);
00078
00079 int nPoints = 0;
00080 for(int i = 0; i<m_hist->entries(); ++i)
00081 {
00082 x[0] = m_hist->value(i);
00083 if (ranges[0]->isInRange(x[0]) ) {
00084 vptr->push_back(x, m_hist->weight(i), 0, 0);
00085
00086 nPoints++;
00087 }
00088
00089 }
00090
00091 vptr->setRange(FML::DataRange(nPoints) );
00092
00093 setVector(vptr);
00094
00095 }
00096 }
00097 }
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110