2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
7 TB2DProfiler<T>::TB2DProfiler()
12 TB2DProfiler<T>::TB2DProfiler(size_t xBins, const T& xLow, const T& xHigh,
13 size_t yBins, const T& yLow, const T& yHigh)
16 // prepare internal stores
17 m_xBinning = new TBProfiler<T>(xBins,xLow,xHigh);
18 m_yBinning = new TBProfiler<T>(yBins,yLow,yHigh);
21 m_store = new TBProfiler<T>(xBins*yBins);
25 TB2DProfiler<T>::~TB2DProfiler()
33 void TB2DProfiler<T>::addData(const T& xPos, const T& yPos, const T& theData )
35 // get the combined index
36 size_t theIndex = this->getIndex(xPos,yPos);
37 if ( theIndex == size_t(-1) ) return;
40 m_store->addData(theIndex,theData);
44 bool TB2DProfiler<T>::getAverages(size_t i, size_t j, T& theData) const
46 size_t theIndex = this->getIndex(i,j);
47 return theIndex != size_t(-1)
48 ? m_store->getAverages(theIndex,theData)
53 bool TB2DProfiler<T>::getStandardDevs(size_t i, size_t j, T& theData) const
55 size_t theIndex = this->getIndex(i,j);
56 return theIndex != size_t(-1)
57 ? m_store->getStandardDevs(theIndex,theData)
62 bool TB2DProfiler<T>::getErrors(size_t i, size_t j, T& theData) const
64 size_t theIndex = this->getIndex(i,j);
65 return theIndex != size_t(-1)
66 ? m_store->getErrors(theIndex,theData)
71 bool TB2DProfiler<T>::getBinEntries(size_t i, size_t j,
72 size_t& theEntries ) const
74 size_t theIndex = this->getIndex(i,j);
75 return ( theIndex != size_t(-1) )
76 ? m_store->getBinEntries(theIndex,theEntries)
81 bool TB2DProfiler<T>::getBinEntries(const T& x, const T& y,
82 size_t& theEntries) const
84 size_t theIndex = this->getIndex(x,y);
85 return ( theIndex != size_t(-1) )
86 ? m_store->getBinEntries(theIndex,theEntries)
91 const TBProfiler<T>& TB2DProfiler<T>::getXBinning() const
97 const TBProfiler<T>& TB2DProfiler<T>::getYBinning() const
103 size_t TB2DProfiler<T>::getXIndex(const T& x) const
105 return m_xBinning->getIndex(x);
109 size_t TB2DProfiler<T>::getYIndex(const T& y) const
111 return m_yBinning->getIndex(y);
115 size_t TB2DProfiler<T>::getIndex(const T& xPos, const T& yPos) const
117 return this->getIndex(m_xBinning->getIndex(xPos),m_yBinning->getIndex(yPos));
121 size_t TB2DProfiler<T>::getIndex(size_t i,size_t j) const
123 return ( i < m_xBinning->getNumberOfChannels() &&
124 j < m_yBinning->getNumberOfChannels() )
125 ? i + j * m_xBinning->getNumberOfChannels()
130 size_t TB2DProfiler<T>::getNumberOfChannels() const
133 m_xBinning->getNumberOfChannels() *
134 m_yBinning->getNumberOfChannels();