|
ATLAS Offline Software
|
Go to the documentation of this file.
18 m_number_of_maxima(number_of_maxima),
20 m_threshold(2.1 * m_scale),
21 m_distance_to_next_maximum(100) {
50 int maximum_number = 0;
78 ATH_MSG_VERBOSE(
"MuonHoughHisto2D::Maximum Number: " << maximum_number <<
" Maximum: " << maximum
79 <<
" binnumber: " << maxbin <<
" x: " << coords.first <<
" y: " << coords.second);
88 std::pair<int, double> maxpair;
98 for (
unsigned int i = 0;
i <
m_size;
i++) {
105 maxpair.first = maxbin;
106 maxpair.second = maximum;
117 double maximum = -1.;
126 return std::make_pair(maxbin, maximum);
131 std::pair<double, double> coordsmaximum;
132 int binnumber =
getMaxBin(maximum_number);
134 if (binnumber != -1) {
138 coordsmaximum.first = 99999.;
139 coordsmaximum.second = 99999.;
141 return coordsmaximum;
165 if (content_bin_area == maximum) {
169 maximum = content_bin_area;
172 }
else if (content_bin_area > maximum) {
174 maximum = content_bin_area;
181 int binnumberdistance = std::abs(binnumber1 - binnumber2);
190 std::pair<double, double> coordsbin;
192 ATH_MSG_WARNING(
"MuonHoughHisto2D::ERROR: negativebinnumber: " << binnumber);
193 coordsbin.first = 99999.;
194 coordsbin.second = 99999.;
202 <<
" y: " << ycoord);
205 coordsbin.first = xcoord;
206 coordsbin.second = ycoord;
228 for (
unsigned int i = 0;
i <
m_size;
i++) {
double getBinContent(int binnumber) const
returns x axis
double m_invbinwidthx
inv binwidth x axis used for cpu speedup
double m_ymax
maximum y coordinate
double m_binwidthy
binwidth y axis
std::pair< int, double > getMax() const
returns binnumber and maximum of histogram (doesn't use m_bins_above_threshold)
void findMaxima()
find maxima in histogram
double binnumberToXCoord(int binnumber) const
gives x-coordinate for certain binnumber
int distanceBins(int binnumber1, int binnumber2) const
calculates the distance in binwidths between two binnumbers ("Manhattan metric")
std::unique_ptr< unsigned int[]> m_histBuffer
actual storage of bin values
unsigned int m_size
size of array
void init()
initialises private members, called in constructor
bool m_maxima_found
check if search for maxima already performed
std::vector< int > m_maximumbins
binnumbers found as maxima
#define ATH_MSG_VERBOSE(x)
const int m_distance_to_next_maximum
minimum distance for a maximum to be away from another maximum
bool checkIfMaximum(int binnumber, double &maximum, int &maxbin) const
check if binnumber is a maximum
unsigned int m_nbinsy
number of y bins
double m_ymin
minimum y coordinate
double content_Bin_Area(int binnumber) const
return the total content of binarea (default: content of bin)
bool checkIfMaximumAlreadyUsed(int binnumber) const
check when searching for several maxima if binnumber is close to an earlier found maximum
void reset()
clears histogram and bins_above_threshold
Class to provide easy MsgStream access and capabilities.
unsigned int m_nbinsx
number of x bins
std::pair< double, double > binnumberToCoords(int binnumber, int printlevel=0) const
gives coordinates for certain binnumber
void resetHisto()
resets histogram
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 binnumberToYCoord(int binnumber) const
gives y-coordinate for certain binnumber
double m_xmin
minimum x coordinate
int getMaxBin(unsigned int maximum_number=0)
return maximum binnumber
double m_xmax
maximum x coordinate
int getNbinsY() const
returns number of bins y coordinate
std::pair< int, double > getMaximumBin(unsigned int maximum_number=0)
returns binnumber and maximum of maximum number maximum_number
#define ATH_MSG_WARNING(x)
unsigned int m_nbinsy_plus2
number of y bins + 2 , used for cpu speedup
std::set< int > m_bins_above_threshold
set of bins that are above threshold used for speeding up searching for maxima
double m_invbinwidthy
inv binwidth y axis 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
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
unsigned int m_scale
threshold for minimum content for a maximum
unsigned int m_nbinsx_plus2
number of x bins + 2 , used for cpu speedup
std::unique_ptr< TH2F > bookAndFillRootHistogram(const std::string &hname) const
intialises a root histogram of MuonHoughHisto2D and fill it, used for debugging purposes
double m_binwidthx
binwidth x axis
MuonHoughHisto2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int number_of_maxima=1)
constructor