00001 #include "AIDA_BoundedProfile2D.h" 00002 #include <typeinfo> 00003 00004 Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D::AIDA_BoundedProfile2D( const std::string& title, 00005 int numberOfBinsX, 00006 double lowEdgeX, 00007 double highEdgeX, 00008 int numberOfBinsY, 00009 double lowEdgeY, 00010 double highEdgeY, 00011 double lowBound, 00012 double highBound ): 00013 Anaphe::AIDA_Histogram_native::AIDA_Profile2D( title, numberOfBinsX, lowEdgeX, highEdgeX, numberOfBinsY, lowEdgeY, highEdgeY ), 00014 m_extraEntries( 0 ), 00015 m_lowBound( lowBound ), 00016 m_highBound( highBound ) 00017 {} 00018 00019 00020 Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D::AIDA_BoundedProfile2D( const std::string& title, 00021 const std::vector< double >& edgesX, 00022 const std::vector< double >& edgesY, 00023 double lowBound, 00024 double highBound ): 00025 Anaphe::AIDA_Histogram_native::AIDA_Profile2D( title, edgesX, edgesY ), 00026 m_extraEntries( 0 ), 00027 m_lowBound( lowBound ), 00028 m_highBound( highBound ) 00029 {} 00030 00031 00032 Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D::AIDA_BoundedProfile2D( const AIDA_BoundedProfile2D& h ): 00033 Anaphe::AIDA_Histogram_native::AIDA_Profile2D( static_cast< const AIDA_Profile2D& >( h ) ), 00034 m_extraEntries( h.m_extraEntries ), 00035 m_lowBound( h.m_lowBound ), 00036 m_highBound( h.m_highBound ) 00037 {} 00038 00039 00040 bool 00041 Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D::reset() 00042 { 00043 m_extraEntries = 0; 00044 return this->Anaphe::AIDA_Histogram_native::AIDA_Profile2D::reset(); 00045 } 00046 00047 00048 int 00049 Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D::extraEntries() const 00050 { 00051 return m_extraEntries + this->Anaphe::AIDA_Histogram_native::AIDA_Profile2D::extraEntries(); 00052 } 00053 00054 00055 bool 00056 Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D::fill( double x, double y, double z, double weight ) 00057 { 00058 if ( z < m_lowBound || z > m_highBound ) { 00059 ++m_extraEntries; 00060 return true; 00061 } 00062 else return this->Anaphe::AIDA_Histogram_native::AIDA_Profile2D::fill( x, y, z, weight ); 00063 } 00064 00065 00066 bool 00067 Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D::add( const AIDA::IProfile2D & h ) 00068 { 00069 if ( ! ( this->Anaphe::AIDA_Histogram_native::AIDA_Profile2D::add( h ) ) ) return false; 00070 try { 00071 const Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D& hb = dynamic_cast< const Anaphe::AIDA_Histogram_native::AIDA_BoundedProfile2D& >( h ); 00072 m_extraEntries += hb.m_extraEntries; 00073 } 00074 catch( std::bad_cast ) { 00075 } 00076 return true; 00077 }