#include <BinID.h>
Public Member Functions | |
BinID () | |
BinID (int intID, double low1, double high1) | |
BinID (int intID, double low1, double high1, double low2, double high2) | |
BinID (int intID, std::vector< double > low, std::vector< double > high) | |
double | low (int n=0) const |
double | high (int n=0) const |
bool | isInBin (const double &var) const |
bool | isInBin (const std::vector< double > &var) const |
bool | operator< (const BinID &other) const |
Private Attributes | |
int | m_int |
std::vector< double > | m_lowEdge |
std::vector< double > | m_highEdge |
Works with any number of dimensions.
Definition at line 16 of file BinID.h.
Atlfast::BinID::BinID | ( | ) | [inline] |
Default constructor
Definition at line 21 of file BinID.h.
00021 : m_int(0),m_lowEdge(1, 0.),m_highEdge(1, 0.){}
Atlfast::BinID::BinID | ( | int | intID, | |
double | low1, | |||
double | high1 | |||
) |
Constructor for 1D bin
Definition at line 6 of file BinID.cxx.
00006 : m_int(intID) { 00007 m_lowEdge.push_back(low1); 00008 m_highEdge.push_back(high1); 00009 }
Atlfast::BinID::BinID | ( | int | intID, | |
double | low1, | |||
double | high1, | |||
double | low2, | |||
double | high2 | |||
) |
Constructor for 2D bin
Definition at line 11 of file BinID.cxx.
00011 : 00012 m_int(intID) { 00013 m_lowEdge.push_back(low1); 00014 m_lowEdge.push_back(low2); 00015 m_highEdge.push_back(high1); 00016 m_highEdge.push_back(high2); 00017 }
Atlfast::BinID::BinID | ( | int | intID, | |
std::vector< double > | low, | |||
std::vector< double > | high | |||
) |
double Atlfast::BinID::low | ( | int | n = 0 |
) | const |
double Atlfast::BinID::high | ( | int | n = 0 |
) | const |
Returns high edge of bin in nth dimension
Definition at line 25 of file BinID.cxx.
00025 {return m_highEdge[n];}
bool Atlfast::BinID::isInBin | ( | const double & | var | ) | const |
bool Atlfast::BinID::isInBin | ( | const std::vector< double > & | var | ) | const |
Checks whether value is in between bin limits: any-dimensional
Definition at line 32 of file BinID.cxx.
00032 { 00033 std::vector<double>::const_iterator vIter = var.begin(); 00034 std::vector<double>::const_iterator vEnd = var.end(); 00035 std::vector<double>::const_iterator lowIter = m_lowEdge.begin(); 00036 std::vector<double>::const_iterator highIter = m_highEdge.begin(); 00037 00038 assert(var.size() <=m_lowEdge.size() ); 00039 00040 for (;vIter != vEnd; ++vIter) { 00041 if ( (*vIter) < (*lowIter) || (*vIter) > (*highIter) ) { 00042 return false; 00043 } 00044 ++lowIter; 00045 ++highIter; 00046 } 00047 return true; 00048 }
bool Atlfast::BinID::operator< | ( | const BinID & | other | ) | const |
int Atlfast::BinID::m_int [private] |
std::vector<double> Atlfast::BinID::m_lowEdge [private] |
std::vector<double> Atlfast::BinID::m_highEdge [private] |