Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AIDA_BoundedProfile1D.cpp

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

Generated on Tue Nov 19 12:32:15 2002 for AIDA_Histogram_native by doxygen1.2.16