ATLAS Offline Software
TBProfiler.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TBUTILS_TBPROFILER_H
6 #define TBUTILS_TBPROFILER_H
7 
8 #include <vector>
9 #include <cmath>
10 
11 template<typename T>
13 {
14  public:
15 
17  TBProfiler(size_t storeSize);
18  TBProfiler(size_t storeSize, const T& lowerLimit, const T& upperLimit);
19 
20  virtual ~TBProfiler();
21 
22 
23  void addData(const T& theChannel, const T& theData);
24  void addData(const std::vector<T>& theData);
25  void addData(size_t index, const T& theData);
26 
27  bool getAverages(std::vector<T>& theAverages) const;
28  bool getAverages(size_t theIndex,T& theAverage) const;
29  bool getStandardDevs(std::vector<T>& theVariances) const;
30  bool getStandardDevs(size_t theIndex, T& theDev) const;
31  bool getErrors(std::vector<T>& theErrors) const;
32  bool getErrors(size_t theIndex, T& theError) const;
33  bool getBinEntries(std::vector<size_t>& theEntries) const;
34  bool getBinEntries(size_t theIndex, size_t& theEntries ) const;
35 
36  const std::vector<T>& getSums() const;
37  const std::vector<T>& getSumOfSquares() const;
38  const std::vector<size_t>& getEntries() const;
39 
40  size_t getNumberOfChannels() const;
41  T getChannelWidth() const;
42  T getMinChannel() const;
43  T getMaxChannel() const;
44  size_t getIndex(const T& theChannel) const;
45 
46  protected:
47 
48  std::vector<T> m_sum;
49  std::vector<T> m_sumOfSquares;
50  std::vector<size_t> m_entries;
51 
52  bool setupAction(size_t theSize);
53 
54  private:
55 
57  bool m_skipFlag;
58  std::vector<T> m_binLimits;
60 };
61 
62 #include "TBUtils/TBProfiler.icc"
63 
64 #endif
TBProfiler::getBinEntries
bool getBinEntries(std::vector< size_t > &theEntries) const
TBProfiler::getMinChannel
T getMinChannel() const
TBProfiler::addData
void addData(size_t index, const T &theData)
index
Definition: index.py:1
TBProfiler::m_entries
std::vector< size_t > m_entries
Definition: TBProfiler.h:50
TBProfiler::m_binLimits
std::vector< T > m_binLimits
Definition: TBProfiler.h:58
TBProfiler::m_channelFill
bool m_channelFill
Definition: TBProfiler.h:56
TBProfiler::~TBProfiler
virtual ~TBProfiler()
TBProfiler::getErrors
bool getErrors(size_t theIndex, T &theError) const
TBProfiler.icc
TBProfiler::getAverages
bool getAverages(std::vector< T > &theAverages) const
TBProfiler::getAverages
bool getAverages(size_t theIndex, T &theAverage) const
TBProfiler::m_deltaBin
T m_deltaBin
Definition: TBProfiler.h:59
TBProfiler::getStandardDevs
bool getStandardDevs(size_t theIndex, T &theDev) const
TBProfiler::getSumOfSquares
const std::vector< T > & getSumOfSquares() const
TBProfiler::m_skipFlag
bool m_skipFlag
Definition: TBProfiler.h:57
TBProfiler::getStandardDevs
bool getStandardDevs(std::vector< T > &theVariances) const
TBProfiler::TBProfiler
TBProfiler(size_t storeSize)
TBProfiler::TBProfiler
TBProfiler(size_t storeSize, const T &lowerLimit, const T &upperLimit)
TBProfiler::setupAction
bool setupAction(size_t theSize)
TBProfiler::getChannelWidth
T getChannelWidth() const
TBProfiler
Definition: TBProfiler.h:13
TBProfiler::getMaxChannel
T getMaxChannel() const
TBProfiler::addData
void addData(const std::vector< T > &theData)
TBProfiler::getBinEntries
bool getBinEntries(size_t theIndex, size_t &theEntries) const
TBProfiler::addData
void addData(const T &theChannel, const T &theData)
TBProfiler::getNumberOfChannels
size_t getNumberOfChannels() const
TBProfiler::getEntries
const std::vector< size_t > & getEntries() const
TBProfiler::getSums
const std::vector< T > & getSums() const
TBProfiler::TBProfiler
TBProfiler()
TBProfiler::getIndex
size_t getIndex(const T &theChannel) const
TBProfiler::getErrors
bool getErrors(std::vector< T > &theErrors) const
TBProfiler::m_sum
std::vector< T > m_sum
Definition: TBProfiler.h:48
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TBProfiler::m_sumOfSquares
std::vector< T > m_sumOfSquares
Definition: TBProfiler.h:49