5#ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHHISTO2D_H
6#define MUONHOUGHPATTERNEVENT_MUONHOUGHHISTO2D_H
30 int fill(
double x,
double y,
double weight = 1.);
33 void fill(
int binnumber,
double weight = 1.);
61 std::pair<int, double>
getMax()
const;
63 std::pair<int, double>
getMaximumBin(
unsigned int maximum_number = 0);
70 bool checkIfMaximum(
int binnumber,
double& maximum,
int& maxbin)
const;
76 double getMaximum(
unsigned int maximum_number = 0);
78 int getMaxBin(
unsigned int maximum_number = 0);
86 std::pair<double, double>
binnumberToCoords(
int binnumber,
int printlevel = 0)
const;
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
bool checkIfMaximumAlreadyUsed(int binnumber) const
check when searching for several maxima if binnumber is close to an earlier found maximum
std::pair< int, double > getMaximumBin(unsigned int maximum_number=0)
returns binnumber and maximum of maximum number maximum_number
void init()
initialises private members, called in constructor
unsigned int m_size
size of array
unsigned int m_nbinsx
number of x bins
double m_invbinwidthx
inv binwidth x axis used for cpu speedup
std::vector< int > m_maximumbins
binnumbers found as maxima
~MuonHoughHisto2D()=default
destructor
void setThreshold(double threshold)
set threshold for maxima in histogram
double m_ymax
maximum y coordinate
int getMaxBin(unsigned int maximum_number=0)
return maximum binnumber
double m_binwidthx
binwidth x axis
unsigned int m_nbinsx_plus2
number of x bins + 2 , used for cpu speedup
unsigned int m_nbinsy_plus2
number of y bins + 2 , used for cpu speedup
const int m_number_of_maxima
number of maxima to be searched for
std::pair< double, double > getCoordsMaximum(unsigned int maximum_number=0)
returns coords of maximum number maximum_number
double getThreshold() const
returns threshold for maxima in histogram
bool checkIfMaximum(int binnumber, double &maximum, int &maxbin) const
check if binnumber is a maximum
int getNbinsY() const
returns number of bins y coordinate
unsigned int m_nbinsy
number of y bins
MuonHoughHisto2D & operator=(const MuonHoughHisto2D &right)
double m_xmax
maximum x coordinate
void resetHisto()
resets histogram
int getNbinsX() const
returns number of bins x coordinate
std::unique_ptr< TH2F > bookAndFillRootHistogram(const std::string &hname) const
intialises a root histogram of MuonHoughHisto2D and fill it, used for debugging purposes
MuonHoughHisto2D(const MuonHoughHisto2D &)
double getBinWidthY() const
return binwidth y axis
unsigned int m_scale
threshold for minimum content for a maximum
bool m_maxima_found
check if search for maxima already performed
double getXmax() const
returns max x axis
double m_xmin
minimum x coordinate
const int m_distance_to_next_maximum
minimum distance for a maximum to be away from another maximum
void reset()
clears histogram and bins_above_threshold
double getBinWidthX() const
return binwidth x axis
double getXmin() const
returns min x axis
void findMaxima()
find maxima in histogram
std::set< int > m_bins_above_threshold
set of bins that are above threshold used for speeding up searching for maxima
MuonHoughHisto2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int number_of_maxima=1)
constructor
int coordToBinx(double x) const
converts x-coordinates to binx
int distanceBins(int binnumber1, int binnumber2) const
calculates the distance in binwidths between two binnumbers ("Manhattan metric")
int coordToBiny(double y) const
converts y-coordinates to biny
double getMaximum(unsigned int maximum_number=0)
return value of maximum bin
double m_invbinwidthy
inv binwidth y axis used for cpu speedup
void setBinContent(int binx, int biny, double value)
set bin content of binnumber corresponding to coordinates
std::pair< int, double > getMax() const
returns binnumber and maximum of histogram (doesn't use m_bins_above_threshold)
int coordToBinnumber(double x, double y) const
converts coordinates to a binnumber
int binInHistogram(unsigned int bin) const
checks if bin is in histogram or if it is an under/overflow bin (unused) 0 is in histo 1 x underflow ...
double m_ymin
minimum y coordinate
double getBinContent(int binnumber) const
returns x axis
std::unique_ptr< unsigned int[]> m_histBuffer
actual storage of bin values
double binnumberToXCoord(int binnumber) const
gives x-coordinate for certain binnumber
double binnumberToYCoord(int binnumber) const
gives y-coordinate for certain binnumber
double content_Bin_Area(int binnumber) const
return the total content of binarea (default: content of bin)
std::pair< double, double > binnumberToCoords(int binnumber, int printlevel=0) const
gives coordinates for certain binnumber
int fill(double x, double y, double weight=1.)
fill 2d histogram with point (x,y) with weight w, return binnumber filled
void setBinContent(int binnumber, double value)
set bin content of binnumber
void setMaximumIsValid(bool flag)
double m_binwidthy
binwidth y axis