Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ]   [ 15.*.* ] 

001 #include "AtlfastAlgs/BinID.h"
002 #include <assert.h>
003 
004 namespace Atlfast {
005 
006   /** @brief Stores bin limits for a given bin index.
007    *
008    * Works with any number of dimensions.
009    */
010 
011 /** Constructor for 1D bin*/ 
012 BinID::BinID(int intID, double low1, double high1): m_int(intID) { 
013   m_lowEdge.push_back(low1);
014   m_highEdge.push_back(high1);
015 }
016 /** Constructor for 2D bin */
017 BinID::BinID(int intID, double low1, double high1, double low2,double high2):
018   m_int(intID) {
019   m_lowEdge.push_back(low1);
020   m_lowEdge.push_back(low2);
021   m_highEdge.push_back(high1);
022   m_highEdge.push_back(high2);
023 }
024 /** Constructor for any-dimensional bin */
025 BinID::BinID(int intID, std::vector<double> low, std::vector<double> high):
026   m_int(intID), m_lowEdge(low), m_highEdge(high) {}
027 
028 /** Returns low edge of bin in nth dimension */    
029 double BinID::low(int n) const {return m_lowEdge[n];}
030 /** Returns high edge of bin in nth dimension */
031 double BinID::high(int n) const {return m_highEdge[n];}
032 /** Checks whether value is in between bin limits: 1D */
033 bool BinID::isInBin(const double& var) const{
034   std::vector<double> vec(1, var);
035   return this->isInBin(vec);
036 }
037 /** Checks whether value is in between bin limits: any-dimensional */
038 bool BinID::isInBin(const std::vector<double>& var) const{
039   std::vector<double>::const_iterator vIter = var.begin();
040   std::vector<double>::const_iterator vEnd = var.end();
041   std::vector<double>::const_iterator lowIter = m_lowEdge.begin();
042   std::vector<double>::const_iterator highIter = m_highEdge.begin();
043   
044   assert(var.size() <=m_lowEdge.size() );
045 
046   for (;vIter != vEnd; ++vIter) {
047     if ( (*vIter) < (*lowIter) || (*vIter) > (*highIter) ) {
048       return false;
049     }   
050     ++lowIter;
051     ++highIter;
052   }
053   return true;
054 }
055 
056  /** Is this bin index lower than the input bin's index? */
057 bool BinID::operator<(const BinID& other) const {
058   return (m_int < other.m_int);
059 }
060 
061 }

source navigation ] diff markup ] identifier search ] general search ]

Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems
This page was automatically generated by the LXR engine. Valid HTML 4.01!