ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
IdentifiedProfileHistogram< SomeIDTag > Class Template Reference

#include <IdentifiedProfileHistogram.h>

Collaboration diagram for IdentifiedProfileHistogram< SomeIDTag >:

Public Member Functions

 IdentifiedProfileHistogram (const std::string &a_title, const unsigned int &a_numberofbins, const float &a_loweredge, const float &a_upperedge, const float &a_lowerlimit=0.0, const float &a_upperlimit=0.0)
 
 IdentifiedProfileHistogram (const std::string &a_title, const unsigned int &a_numberofbins, const float &a_loweredge, const float &a_upperedge, const std::vector< float > &a_lowerlimit, const std::vector< float > &a_upperlimit)
 
virtual ~IdentifiedProfileHistogram ()
 
const std::string & title () const
 
unsigned int numberOfBins () const
 
float lowerEdge () const
 
float upperEdge () const
 
float binWidth () const
 
const std::vector< int > & numberOfEntries (const SomeIDTag &ident) const
 
const std::vector< float > & content (const SomeIDTag &ident) const
 
const std::vector< float > & contentSquared (const SomeIDTag &ident) const
 
int numberOfIDs () const
 
const std::vector< float > abcissa () const
 
const std::vector< float > abcissaError () const
 
const std::vector< float > average (const SomeIDTag &ident) const
 
const std::vector< float > rms (const SomeIDTag &ident) const
 
const std::vector< float > averageError (const SomeIDTag &ident) const
 
float globalAverage (const SomeIDTag &ident) const
 
float globalRMS (const SomeIDTag &ident) const
 
float globalAverageError (const SomeIDTag &ident) const
 
int globalNumberOfEntries (const SomeIDTag &ident) const
 
int totalNumberOfEntries () const
 
bool fillEntry (const SomeIDTag &ident, const float &abcissa, const float &ordinate, const float &weight=1.0)
 

Private Attributes

unsigned int m_NumberOfBins
 
float m_LowerEdge
 
float m_BinWidth
 
std::vector< float > m_LowerLimit
 
std::vector< float > m_UpperLimit
 
ArrayStore< SomeIDTag, std::vector< int > > m_NumberOfEntries
 
ArrayStore< SomeIDTag, std::vector< float > > m_Content
 
ArrayStore< SomeIDTag, std::vector< float > > m_ContentSquared
 

Detailed Description

template<typename SomeIDTag>
class IdentifiedProfileHistogram< SomeIDTag >

Definition at line 34 of file IdentifiedProfileHistogram.h.

Constructor & Destructor Documentation

◆ IdentifiedProfileHistogram() [1/2]

template<typename SomeIDTag >
IdentifiedProfileHistogram< SomeIDTag >::IdentifiedProfileHistogram ( const std::string &  a_title,
const unsigned int &  a_numberofbins,
const float &  a_loweredge,
const float &  a_upperedge,
const float &  a_lowerlimit = 0.0,
const float &  a_upperlimit = 0.0 
)

Definition at line 161 of file IdentifiedProfileHistogram.h.

164  :
165  m_NumberOfBins(a_numberofbins),m_LowerEdge(a_loweredge),
166  m_BinWidth((a_upperedge-a_loweredge)/(float)a_numberofbins),
167  m_LowerLimit(a_numberofbins,a_lowerlimit),m_UpperLimit(a_numberofbins,a_upperlimit),
168  m_NumberOfEntries(a_title) {}

◆ IdentifiedProfileHistogram() [2/2]

template<typename SomeIDTag >
IdentifiedProfileHistogram< SomeIDTag >::IdentifiedProfileHistogram ( const std::string &  a_title,
const unsigned int &  a_numberofbins,
const float &  a_loweredge,
const float &  a_upperedge,
const std::vector< float > &  a_lowerlimit,
const std::vector< float > &  a_upperlimit 
)

Definition at line 171 of file IdentifiedProfileHistogram.h.

175  :
176  m_NumberOfBins(a_numberofbins),m_LowerEdge(a_loweredge),
177  m_BinWidth((a_upperedge-a_loweredge)/(float)a_numberofbins),
178  m_LowerLimit(a_lowerlimit), m_UpperLimit(a_upperlimit),m_NumberOfEntries(a_title){
179  if (a_lowerlimit.size()!=a_upperlimit.size()&& a_lowerlimit.size()!=a_numberofbins) {
180  std::cout<<"Inconsistent vector(s) of limits passed to IdentifiedProfileHistogram: "
181  << a_title << " -- limits ignored..." <<std::endl;
182  m_LowerLimit.clear();
183  m_UpperLimit.clear();
184  std::fill_n(std::back_inserter(m_LowerLimit), m_NumberOfBins, 0.0);
185  std::fill_n(std::back_inserter(m_UpperLimit), m_NumberOfBins, 0.0);
186  }
187 }

◆ ~IdentifiedProfileHistogram()

template<typename SomeIDTag >
virtual IdentifiedProfileHistogram< SomeIDTag >::~IdentifiedProfileHistogram ( )
inlinevirtual

Definition at line 57 of file IdentifiedProfileHistogram.h.

Member Function Documentation

◆ abcissa()

template<typename SomeIDTag >
const std::vector< float > IdentifiedProfileHistogram< SomeIDTag >::abcissa

Definition at line 190 of file IdentifiedProfileHistogram.h.

190  {
191  std::vector<float> result(m_NumberOfBins, m_BinWidth);
193  for (int i=1;i<m_NumberOfBins;i++)
194  result[i]=result[i-1]+m_BinWidth;
195  return result;
196 }

◆ abcissaError()

template<typename SomeIDTag >
const std::vector< float > IdentifiedProfileHistogram< SomeIDTag >::abcissaError
inline

Definition at line 133 of file IdentifiedProfileHistogram.h.

133  {
134  const std::vector<float> result(m_NumberOfBins, m_BinWidth/sqrt(12.0)); // strictly only valid for weight=CONST
135  return result;
136 }

◆ average()

template<typename SomeIDTag >
const std::vector< float > IdentifiedProfileHistogram< SomeIDTag >::average ( const SomeIDTag &  ident) const

Definition at line 199 of file IdentifiedProfileHistogram.h.

199  {
200  std::vector<float> result(m_NumberOfBins, 0.0);
202 // return result();
203  return result;
204  for (int i=0;i<m_NumberOfBins;i++)
206  return result;
207 }

◆ averageError()

template<typename SomeIDTag >
const std::vector< float > IdentifiedProfileHistogram< SomeIDTag >::averageError ( const SomeIDTag &  ident) const

Definition at line 221 of file IdentifiedProfileHistogram.h.

221  {
222  std::vector<float> result(m_NumberOfBins, 0.0);
224 // return result();
225  return result;
226  for (int i=0;i<m_NumberOfBins;i++)
228  return result;
229 }

◆ binWidth()

template<typename SomeIDTag >
float IdentifiedProfileHistogram< SomeIDTag >::binWidth
inline

Definition at line 102 of file IdentifiedProfileHistogram.h.

102 {return m_BinWidth;}

◆ content()

template<typename SomeIDTag >
const std::vector< float > & IdentifiedProfileHistogram< SomeIDTag >::content ( const SomeIDTag &  ident) const
inline

Definition at line 108 of file IdentifiedProfileHistogram.h.

108 {return m_Content[ident];}

◆ contentSquared()

template<typename SomeIDTag >
const std::vector< float > & IdentifiedProfileHistogram< SomeIDTag >::contentSquared ( const SomeIDTag &  ident) const
inline

Definition at line 111 of file IdentifiedProfileHistogram.h.

111 {return m_ContentSquared[ident];}

◆ fillEntry()

template<typename SomeIDTag >
bool IdentifiedProfileHistogram< SomeIDTag >::fillEntry ( const SomeIDTag &  ident,
const float &  abcissa,
const float &  ordinate,
const float &  weight = 1.0 
)

Definition at line 232 of file IdentifiedProfileHistogram.h.

232  {
233  if (abcissa<m_LowerEdge||abcissa>m_LowerEdge+m_BinWidth*(float)m_NumberOfBins||m_NumberOfBins==0)
234  return false;
236  if (m_LowerLimit[bin]<m_UpperLimit[bin]&&(ordinate<m_LowerLimit[bin]||ordinate>m_UpperLimit[bin]))
237  return false;
239  m_NumberOfEntries.push_back(ident,std::vector<int>(m_NumberOfBins,0));
240  m_Content.push_back(ident, std::vector<float>(m_NumberOfBins, 0.0));
241  m_ContentSquared.push_back(ident, std::vector<float>(m_NumberOfBins, 0.0));
242  }
244  m_Content[ident][bin]+=weight*ordinate;
245  m_ContentSquared[ident][bin]+=weight*ordinate*ordinate;
246  return true;
247 }

◆ globalAverage()

template<typename SomeIDTag >
float IdentifiedProfileHistogram< SomeIDTag >::globalAverage ( const SomeIDTag &  ident) const
inline

Definition at line 139 of file IdentifiedProfileHistogram.h.

139  {
140  return globalNumberOfEntries(ident)>0 ?
142 }

◆ globalAverageError()

template<typename SomeIDTag >
float IdentifiedProfileHistogram< SomeIDTag >::globalAverageError ( const SomeIDTag &  ident) const
inline

Definition at line 152 of file IdentifiedProfileHistogram.h.

152  {
153  return globalNumberOfEntries(ident)>0 ?
154  globalRMS(ident)/sqrt((float)globalNumberOfEntries(ident)) : 0.0;
155 }

◆ globalNumberOfEntries()

template<typename SomeIDTag >
int IdentifiedProfileHistogram< SomeIDTag >::globalNumberOfEntries ( const SomeIDTag &  ident) const
inline

Definition at line 126 of file IdentifiedProfileHistogram.h.

◆ globalRMS()

template<typename SomeIDTag >
float IdentifiedProfileHistogram< SomeIDTag >::globalRMS ( const SomeIDTag &  ident) const
inline

Definition at line 145 of file IdentifiedProfileHistogram.h.

◆ lowerEdge()

template<typename SomeIDTag >
float IdentifiedProfileHistogram< SomeIDTag >::lowerEdge
inline

Definition at line 96 of file IdentifiedProfileHistogram.h.

96 {return m_LowerEdge;}

◆ numberOfBins()

template<typename SomeIDTag >
unsigned int IdentifiedProfileHistogram< SomeIDTag >::numberOfBins
inline

Definition at line 93 of file IdentifiedProfileHistogram.h.

93 {return m_NumberOfBins;}

◆ numberOfEntries()

template<typename SomeIDTag >
const std::vector< int > & IdentifiedProfileHistogram< SomeIDTag >::numberOfEntries ( const SomeIDTag &  ident) const
inline

Definition at line 105 of file IdentifiedProfileHistogram.h.

105 {return m_NumberOfEntries[ident];}

◆ numberOfIDs()

template<typename SomeIDTag >
int IdentifiedProfileHistogram< SomeIDTag >::numberOfIDs
inline

Definition at line 114 of file IdentifiedProfileHistogram.h.

114 {return m_NumberOfEntries.numberOfIDs();}

◆ rms()

template<typename SomeIDTag >
const std::vector< float > IdentifiedProfileHistogram< SomeIDTag >::rms ( const SomeIDTag &  ident) const

Definition at line 210 of file IdentifiedProfileHistogram.h.

210  {
211  std::vector<float> result(m_NumberOfBins, 0.0);
213 // return result();
214  return result;
215  for (int i=0;i<m_NumberOfBins;i++)
217  return result;
218 }

◆ title()

template<typename SomeIDTag >
const std::string & IdentifiedProfileHistogram< SomeIDTag >::title
inline

Definition at line 90 of file IdentifiedProfileHistogram.h.

90 {return m_NumberOfEntries.tag();}

◆ totalNumberOfEntries()

template<typename SomeIDTag >
int IdentifiedProfileHistogram< SomeIDTag >::totalNumberOfEntries
inline

Definition at line 117 of file IdentifiedProfileHistogram.h.

118 {
119  int i=0;
120  for (typename ArrayStore<SomeIDTag, std::vector<int> >::map_citr itr=m_NumberOfEntries.cbegin();itr!=m_NumberOfEntries.cend();++itr)
121  i=std::accumulate(m_NumberOfEntries[itr->first].begin(),m_NumberOfEntries[itr->first].end(),i);
122  return i;
123 }

◆ upperEdge()

template<typename SomeIDTag >
float IdentifiedProfileHistogram< SomeIDTag >::upperEdge
inline

Definition at line 99 of file IdentifiedProfileHistogram.h.

Member Data Documentation

◆ m_BinWidth

template<typename SomeIDTag >
float IdentifiedProfileHistogram< SomeIDTag >::m_BinWidth
private

Definition at line 89 of file IdentifiedProfileHistogram.h.

◆ m_Content

template<typename SomeIDTag >
ArrayStore<SomeIDTag, std::vector<float> > IdentifiedProfileHistogram< SomeIDTag >::m_Content
private

Definition at line 93 of file IdentifiedProfileHistogram.h.

◆ m_ContentSquared

template<typename SomeIDTag >
ArrayStore<SomeIDTag, std::vector<float> > IdentifiedProfileHistogram< SomeIDTag >::m_ContentSquared
private

Definition at line 94 of file IdentifiedProfileHistogram.h.

◆ m_LowerEdge

template<typename SomeIDTag >
float IdentifiedProfileHistogram< SomeIDTag >::m_LowerEdge
private

Definition at line 88 of file IdentifiedProfileHistogram.h.

◆ m_LowerLimit

template<typename SomeIDTag >
std::vector<float> IdentifiedProfileHistogram< SomeIDTag >::m_LowerLimit
private

Definition at line 90 of file IdentifiedProfileHistogram.h.

◆ m_NumberOfBins

template<typename SomeIDTag >
unsigned int IdentifiedProfileHistogram< SomeIDTag >::m_NumberOfBins
private

Definition at line 87 of file IdentifiedProfileHistogram.h.

◆ m_NumberOfEntries

template<typename SomeIDTag >
ArrayStore<SomeIDTag, std::vector<int> > IdentifiedProfileHistogram< SomeIDTag >::m_NumberOfEntries
private

Definition at line 92 of file IdentifiedProfileHistogram.h.

◆ m_UpperLimit

template<typename SomeIDTag >
std::vector<float> IdentifiedProfileHistogram< SomeIDTag >::m_UpperLimit
private

Definition at line 91 of file IdentifiedProfileHistogram.h.


The documentation for this class was generated from the following file:
IdentifiedProfileHistogram::m_ContentSquared
ArrayStore< SomeIDTag, std::vector< float > > m_ContentSquared
Definition: IdentifiedProfileHistogram.h:94
get_generator_info.result
result
Definition: get_generator_info.py:21
IdentifiedProfileHistogram::globalAverage
float globalAverage(const SomeIDTag &ident) const
Definition: IdentifiedProfileHistogram.h:139
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ArrayStore::end
map_itr end()
Definition: ArrayStore.h:141
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
ArrayStore::tag
const std::string & tag() const
Tag accessor.
Definition: ArrayStore.h:135
bin
Definition: BinsDiffFromStripMedian.h:43
ArrayStore
Definition: ArrayStore.h:32
ArrayStore::numberOfIDs
int numberOfIDs()
Size accessor.
Definition: ArrayStore.h:106
ArrayStore::push_back
void push_back(const IdType &ident, const StorageType &value)
makes new index
Definition: ArrayStore.h:100
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
ArrayStore::existID
bool existID(const IdType &ident)
returns flag for index existing in the std::map
Definition: ArrayStore.h:112
ArrayStore::cbegin
map_citr cbegin() const
begin/end const iterators
Definition: ArrayStore.h:144
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
IdentifiedProfileHistogram::m_UpperLimit
std::vector< float > m_UpperLimit
Definition: IdentifiedProfileHistogram.h:91
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdentifiedProfileHistogram::m_LowerLimit
std::vector< float > m_LowerLimit
Definition: IdentifiedProfileHistogram.h:90
IdentifiedProfileHistogram::m_Content
ArrayStore< SomeIDTag, std::vector< float > > m_Content
Definition: IdentifiedProfileHistogram.h:93
IdentifiedProfileHistogram::globalRMS
float globalRMS(const SomeIDTag &ident) const
Definition: IdentifiedProfileHistogram.h:145
ArrayStore::cend
map_citr cend() const
Definition: ArrayStore.h:147
IdentifiedProfileHistogram::m_BinWidth
float m_BinWidth
Definition: IdentifiedProfileHistogram.h:89
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
TRT::Hit::ident
@ ident
Definition: HitInfo.h:77
IdentifiedProfileHistogram::abcissa
const std::vector< float > abcissa() const
Definition: IdentifiedProfileHistogram.h:190
IdentifiedProfileHistogram::m_LowerEdge
float m_LowerEdge
Definition: IdentifiedProfileHistogram.h:88
IdentifiedProfileHistogram::m_NumberOfBins
unsigned int m_NumberOfBins
Definition: IdentifiedProfileHistogram.h:87
IdentifiedProfileHistogram::globalNumberOfEntries
int globalNumberOfEntries(const SomeIDTag &ident) const
Definition: IdentifiedProfileHistogram.h:126
IdentifiedProfileHistogram::m_NumberOfEntries
ArrayStore< SomeIDTag, std::vector< int > > m_NumberOfEntries
Definition: IdentifiedProfileHistogram.h:92
readCCLHist.float
float
Definition: readCCLHist.py:83
ArrayStore::begin
map_itr begin()
begin/end iterators
Definition: ArrayStore.h:138