![]() |
ATLAS Offline Software
|
Histogram class, similar to Root's TH2D. More...
#include <MuonHoughHisto2D.h>
Public Member Functions | |
~MuonHoughHisto2D ()=default | |
destructor More... | |
MuonHoughHisto2D (int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int number_of_maxima=1) | |
constructor More... | |
int | fill (double x, double y, double weight=1.) |
fill 2d histogram with point (x,y) with weight w, return binnumber filled More... | |
void | fill (int binnumber, double weight=1.) |
fill bin with weight w More... | |
int | getNbinsX () const |
returns number of bins x coordinate More... | |
int | getNbinsY () const |
returns number of bins y coordinate More... | |
double | getXmin () const |
returns min x axis More... | |
double | getXmax () const |
returns max x axis More... | |
double | getBinWidthX () const |
return binwidth x axis More... | |
double | getBinWidthY () const |
return binwidth y axis More... | |
double | getBinContent (int binnumber) const |
returns x axis More... | |
void | reset () |
clears histogram and bins_above_threshold More... | |
void | findMaxima () |
find maxima in histogram More... | |
std::pair< int, double > | getMax () const |
returns binnumber and maximum of histogram (doesn't use m_bins_above_threshold) More... | |
std::pair< int, double > | getMaximumBin (unsigned int maximum_number=0) |
returns binnumber and maximum of maximum number maximum_number More... | |
std::pair< double, double > | getCoordsMaximum (unsigned int maximum_number=0) |
returns coords of maximum number maximum_number More... | |
bool | checkIfMaximumAlreadyUsed (int binnumber) const |
check when searching for several maxima if binnumber is close to an earlier found maximum More... | |
bool | checkIfMaximum (int binnumber, double &maximum, int &maxbin) const |
check if binnumber is a maximum More... | |
int | distanceBins (int binnumber1, int binnumber2) const |
calculates the distance in binwidths between two binnumbers ("Manhattan metric") More... | |
double | getMaximum (unsigned int maximum_number=0) |
return value of maximum bin More... | |
int | getMaxBin (unsigned int maximum_number=0) |
return maximum binnumber More... | |
double | content_Bin_Area (int binnumber) const |
return the total content of binarea (default: content of bin) More... | |
std::pair< double, double > | binnumberToCoords (int binnumber, int printlevel=0) const |
gives coordinates for certain binnumber More... | |
double | binnumberToXCoord (int binnumber) const |
gives x-coordinate for certain binnumber More... | |
double | binnumberToYCoord (int binnumber) const |
gives y-coordinate for certain binnumber More... | |
int | coordToBinnumber (double x, double y) const |
converts coordinates to a binnumber More... | |
int | coordToBinx (double x) const |
converts x-coordinates to binx More... | |
int | coordToBiny (double y) const |
converts y-coordinates to biny More... | |
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 2 x overflow 3 y underflow 4 y overflow More... | |
void | setThreshold (double threshold) |
set threshold for maxima in histogram More... | |
double | getThreshold () const |
returns threshold for maxima in histogram More... | |
std::unique_ptr< TH2F > | bookAndFillRootHistogram (const std::string &hname) const |
intialises a root histogram of MuonHoughHisto2D and fill it, used for debugging purposes More... | |
void | setMaximumIsValid (bool flag) |
bool | msgLvl (const MSG::Level lvl) const |
Test the output level. More... | |
MsgStream & | msg () const |
The standard message stream. More... | |
MsgStream & | msg (const MSG::Level lvl) const |
The standard message stream. More... | |
void | setLevel (MSG::Level lvl) |
Change the current logging level. More... | |
Private Member Functions | |
void | init () |
initialises private members, called in constructor More... | |
void | resetHisto () |
resets histogram More... | |
void | setBinContent (int binnumber, double value) |
set bin content of binnumber More... | |
void | setBinContent (int binx, int biny, double value) |
set bin content of binnumber corresponding to coordinates More... | |
MuonHoughHisto2D & | operator= (const MuonHoughHisto2D &right) |
MuonHoughHisto2D (const MuonHoughHisto2D &) | |
void | initMessaging () const |
Initialize our message level and MessageSvc. More... | |
Private Attributes | |
std::unique_ptr< unsigned int[]> | m_histBuffer {} |
actual storage of bin values More... | |
unsigned int | m_size {0} |
size of array More... | |
unsigned int | m_nbinsx {0} |
number of x bins More... | |
unsigned int | m_nbinsx_plus2 {0} |
number of x bins + 2 , used for cpu speedup More... | |
double | m_xmin {0} |
minimum x coordinate More... | |
double | m_xmax {0} |
maximum x coordinate More... | |
unsigned int | m_nbinsy {0} |
number of y bins More... | |
unsigned int | m_nbinsy_plus2 {0} |
number of y bins + 2 , used for cpu speedup More... | |
double | m_ymin {0.} |
minimum y coordinate More... | |
double | m_ymax {0.} |
maximum y coordinate More... | |
double | m_binwidthx {0.} |
binwidth x axis More... | |
double | m_binwidthy {0.} |
binwidth y axis More... | |
double | m_invbinwidthx {0.} |
inv binwidth x axis used for cpu speedup More... | |
double | m_invbinwidthy {0.} |
inv binwidth y axis used for cpu speedup More... | |
std::set< int > | m_bins_above_threshold {} |
set of bins that are above threshold used for speeding up searching for maxima More... | |
std::vector< int > | m_maximumbins {} |
binnumbers found as maxima More... | |
const int | m_number_of_maxima {0} |
number of maxima to be searched for More... | |
unsigned int | m_scale {0} |
threshold for minimum content for a maximum More... | |
unsigned int | m_threshold {0} |
const int | m_distance_to_next_maximum {0} |
minimum distance for a maximum to be away from another maximum More... | |
bool | m_maxima_found {false} |
check if search for maxima already performed More... | |
int | m_maximumBin {-1} |
maximum More... | |
unsigned int | m_maximum {0} |
bool | m_maximumIsValid {true} |
std::string | m_nm |
Message source name. More... | |
boost::thread_specific_ptr< MsgStream > | m_msg_tls |
MsgStream instance (a std::cout like with print-out levels) More... | |
std::atomic< IMessageSvc * > | m_imsg { nullptr } |
MessageSvc pointer. More... | |
std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
Current logging level. More... | |
std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
Messaging initialized (initMessaging) More... | |
Histogram class, similar to Root's TH2D.
Binnumbering is similar to Root's numbering. Starting in left corner to right upper corner Remind the over/under flow bins
Definition at line 22 of file MuonHoughHisto2D.h.
|
default |
destructor
MuonHoughHisto2D::MuonHoughHisto2D | ( | int | nbinsx, |
double | xmin, | ||
double | xmax, | ||
int | nbinsy, | ||
double | ymin, | ||
double | ymax, | ||
int | number_of_maxima = 1 |
||
) |
|
private |
int MuonHoughHisto2D::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 2 x overflow 3 y underflow 4 y overflow
Definition at line 210 of file MuonHoughHisto2D.cxx.
std::pair< double, double > MuonHoughHisto2D::binnumberToCoords | ( | int | binnumber, |
int | printlevel = 0 |
||
) | const |
gives coordinates for certain binnumber
Definition at line 189 of file MuonHoughHisto2D.cxx.
|
inline |
gives x-coordinate for certain binnumber
Definition at line 228 of file MuonHoughHisto2D.h.
|
inline |
gives y-coordinate for certain binnumber
Definition at line 231 of file MuonHoughHisto2D.h.
std::unique_ptr< TH2F > MuonHoughHisto2D::bookAndFillRootHistogram | ( | const std::string & | hname | ) | const |
bool MuonHoughHisto2D::checkIfMaximum | ( | int | binnumber, |
double & | maximum, | ||
int & | maxbin | ||
) | const |
check if binnumber is a maximum
Definition at line 157 of file MuonHoughHisto2D.cxx.
bool MuonHoughHisto2D::checkIfMaximumAlreadyUsed | ( | int | binnumber | ) | const |
check when searching for several maxima if binnumber is close to an earlier found maximum
Definition at line 144 of file MuonHoughHisto2D.cxx.
|
inline |
return the total content of binarea (default: content of bin)
Definition at line 206 of file MuonHoughHisto2D.h.
|
inline |
|
inline |
|
inline |
int MuonHoughHisto2D::distanceBins | ( | int | binnumber1, |
int | binnumber2 | ||
) | const |
calculates the distance in binwidths between two binnumbers ("Manhattan metric")
Definition at line 180 of file MuonHoughHisto2D.cxx.
|
inline |
fill 2d histogram with point (x,y) with weight w, return binnumber filled
Definition at line 190 of file MuonHoughHisto2D.h.
|
inline |
void MuonHoughHisto2D::findMaxima | ( | ) |
find maxima in histogram
Definition at line 47 of file MuonHoughHisto2D.cxx.
|
inline |
|
inline |
|
inline |
std::pair< double, double > MuonHoughHisto2D::getCoordsMaximum | ( | unsigned int | maximum_number = 0 | ) |
returns coords of maximum number maximum_number
Definition at line 130 of file MuonHoughHisto2D.cxx.
std::pair< int, double > MuonHoughHisto2D::getMax | ( | ) | const |
returns binnumber and maximum of histogram (doesn't use m_bins_above_threshold)
Definition at line 87 of file MuonHoughHisto2D.cxx.
|
inline |
return maximum binnumber
Definition at line 218 of file MuonHoughHisto2D.h.
|
inline |
return value of maximum bin
Definition at line 215 of file MuonHoughHisto2D.h.
std::pair< int, double > MuonHoughHisto2D::getMaximumBin | ( | unsigned int | maximum_number = 0 | ) |
returns binnumber and maximum of maximum number maximum_number
Definition at line 111 of file MuonHoughHisto2D.cxx.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
initialises private members, called in constructor
Definition at line 34 of file MuonHoughHisto2D.cxx.
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
|
inlineinherited |
Test the output level.
lvl | The message level to test against |
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
|
private |
void MuonHoughHisto2D::reset | ( | ) |
|
inlineprivate |
|
inlineprivate |
|
private |
set bin content of binnumber corresponding to coordinates
|
inherited |
Change the current logging level.
Use this rather than msg().setLevel() for proper operation with MT.
Definition at line 28 of file AthMessaging.cxx.
|
inline |
Definition at line 115 of file MuonHoughHisto2D.h.
|
inline |
|
mutableprivateinherited |
Messaging initialized (initMessaging)
Definition at line 141 of file AthMessaging.h.
|
private |
set of bins that are above threshold used for speeding up searching for maxima
Definition at line 158 of file MuonHoughHisto2D.h.
|
private |
binwidth x axis
Definition at line 147 of file MuonHoughHisto2D.h.
|
private |
binwidth y axis
Definition at line 149 of file MuonHoughHisto2D.h.
|
private |
minimum distance for a maximum to be away from another maximum
Definition at line 172 of file MuonHoughHisto2D.h.
|
private |
actual storage of bin values
Definition at line 125 of file MuonHoughHisto2D.h.
|
mutableprivateinherited |
MessageSvc pointer.
Definition at line 135 of file AthMessaging.h.
|
private |
inv binwidth x axis used for cpu speedup
Definition at line 152 of file MuonHoughHisto2D.h.
|
private |
inv binwidth y axis used for cpu speedup
Definition at line 154 of file MuonHoughHisto2D.h.
|
mutableprivateinherited |
Current logging level.
Definition at line 138 of file AthMessaging.h.
|
private |
check if search for maxima already performed
Definition at line 175 of file MuonHoughHisto2D.h.
|
private |
Definition at line 179 of file MuonHoughHisto2D.h.
|
private |
maximum
Definition at line 178 of file MuonHoughHisto2D.h.
|
private |
binnumbers found as maxima
Definition at line 161 of file MuonHoughHisto2D.h.
|
private |
Definition at line 180 of file MuonHoughHisto2D.h.
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
|
private |
number of x bins
Definition at line 130 of file MuonHoughHisto2D.h.
|
private |
number of x bins + 2 , used for cpu speedup
Definition at line 132 of file MuonHoughHisto2D.h.
|
private |
number of y bins
Definition at line 138 of file MuonHoughHisto2D.h.
|
private |
number of y bins + 2 , used for cpu speedup
Definition at line 140 of file MuonHoughHisto2D.h.
|
privateinherited |
Message source name.
Definition at line 129 of file AthMessaging.h.
|
private |
number of maxima to be searched for
Definition at line 165 of file MuonHoughHisto2D.h.
|
private |
threshold for minimum content for a maximum
Definition at line 168 of file MuonHoughHisto2D.h.
|
private |
size of array
Definition at line 127 of file MuonHoughHisto2D.h.
|
private |
Definition at line 169 of file MuonHoughHisto2D.h.
|
private |
maximum x coordinate
Definition at line 136 of file MuonHoughHisto2D.h.
|
private |
minimum x coordinate
Definition at line 134 of file MuonHoughHisto2D.h.
|
private |
maximum y coordinate
Definition at line 144 of file MuonHoughHisto2D.h.
|
private |
minimum y coordinate
Definition at line 142 of file MuonHoughHisto2D.h.