ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
MuonHoughHisto2DContainer Class Reference

#include <MuonHoughHisto2DContainer.h>

Collaboration diagram for MuonHoughHisto2DContainer:

Public Member Functions

 MuonHoughHisto2DContainer ()
 constructor More...
 
virtual ~MuonHoughHisto2DContainer ()=default
 destructor More...
 
MuonHoughHisto2DgetHisto (int id) const
 return histogram at place id More...
 
std::pair< int, int > getMaximumBinnumber () const
 return maximum of container gives first id histogram (sector) and then maximumbin More...
 
void reset () const
 resets histograms More...
 
int size () const
 returns size of container More...
 
void reserve (int)
 reserve a certain size (memory) for m_histos More...
 
void push_back (std::unique_ptr< MuonHoughHisto2D >)
 push_back a histogram More...
 

Private Attributes

std::vector< std::unique_ptr< MuonHoughHisto2D > > m_histos {}
 vector of MuonHoughHisto2D* More...
 

Detailed Description

Definition at line 10 of file MuonHoughHisto2DContainer.h.

Constructor & Destructor Documentation

◆ MuonHoughHisto2DContainer()

MuonHoughHisto2DContainer::MuonHoughHisto2DContainer ( )
default

constructor

◆ ~MuonHoughHisto2DContainer()

virtual MuonHoughHisto2DContainer::~MuonHoughHisto2DContainer ( )
virtualdefault

destructor

Member Function Documentation

◆ getHisto()

MuonHoughHisto2D * MuonHoughHisto2DContainer::getHisto ( int  id) const
inline

return histogram at place id

Definition at line 39 of file MuonHoughHisto2DContainer.h.

39 { return m_histos.at(id).get(); }

◆ getMaximumBinnumber()

std::pair< int, int > MuonHoughHisto2DContainer::getMaximumBinnumber ( ) const

return maximum of container gives first id histogram (sector) and then maximumbin

Definition at line 9 of file MuonHoughHisto2DContainer.cxx.

9  {
10 
11  double maximum{0.};
12  int maxid{-1}, maxbin{-1};
13  for (int histoid = 0; histoid < size(); histoid++) {
14  std::pair<int, double> histomax =
15  getHisto(histoid)->getMaximumBin(0); // binnumber and value of the area of the bin
16 
17  if (histomax.second > maximum) {
18  maximum = histomax.second;
19  maxid = histoid;
20  maxbin = histomax.first;
21  }
22  }
23  return std::make_pair(maxid, maxbin);
24 }

◆ push_back()

void MuonHoughHisto2DContainer::push_back ( std::unique_ptr< MuonHoughHisto2D histo)
inline

push_back a histogram

Definition at line 41 of file MuonHoughHisto2DContainer.h.

41 { m_histos.push_back(std::move(histo)); }

◆ reserve()

void MuonHoughHisto2DContainer::reserve ( int  size)
inline

reserve a certain size (memory) for m_histos

Definition at line 40 of file MuonHoughHisto2DContainer.h.

40 { m_histos.reserve(size); }

◆ reset()

void MuonHoughHisto2DContainer::reset ( ) const

resets histograms

Definition at line 26 of file MuonHoughHisto2DContainer.cxx.

26  {
27  for (int histoid = 0; histoid < size(); histoid++) { getHisto(histoid)->reset(); }
28 }

◆ size()

int MuonHoughHisto2DContainer::size ( ) const
inline

returns size of container

Definition at line 38 of file MuonHoughHisto2DContainer.h.

38 { return m_histos.size(); }

Member Data Documentation

◆ m_histos

std::vector<std::unique_ptr<MuonHoughHisto2D> > MuonHoughHisto2DContainer::m_histos {}
private

vector of MuonHoughHisto2D*

Definition at line 35 of file MuonHoughHisto2DContainer.h.


The documentation for this class was generated from the following files:
MuonHoughHisto2DContainer::getHisto
MuonHoughHisto2D * getHisto(int id) const
return histogram at place id
Definition: MuonHoughHisto2DContainer.h:39
MuonHoughHisto2DContainer::size
int size() const
returns size of container
Definition: MuonHoughHisto2DContainer.h:38
MuonHoughHisto2DContainer::m_histos
std::vector< std::unique_ptr< MuonHoughHisto2D > > m_histos
vector of MuonHoughHisto2D*
Definition: MuonHoughHisto2DContainer.h:35
MuonHoughHisto2D::reset
void reset()
clears histogram and bins_above_threshold
Definition: MuonHoughHisto2D.cxx:36
MuonHoughHisto2D::getMaximumBin
std::pair< int, double > getMaximumBin(unsigned int maximum_number=0)
returns binnumber and maximum of maximum number maximum_number
Definition: MuonHoughHisto2D.cxx:111
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415