Bdb packages | Design docs | Source docs | Guidelines | Recent releases

Search | Site Map .

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

/BdbBitMap/BdbBMBin.cc

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // File:
00003 //      BdbBMBits.cc
00004 //
00005 // Description:
00006 //       Persistent abstract class representing one bin.
00007 //
00008 // Environment:
00009 //      Software developed for the BaBar Detector at the SLAC B-Factory
00010 //
00011 // Author List:
00012 //      Igor Gaponenko           Original Author
00013 //
00014 // Copyright Information:
00015 //      Copyright (C) 1997-98      Stanford Linear Accelerator Center
00016 //
00017 //------------------------------------------------------------------------------
00018 
00019 // -------------------------
00020 // -- This Class's Header --
00021 // -------------------------
00022 
00023 #ifndef BDBBMBIN_HH
00024 #include "BdbBitMap/BdbBMBin.hh"
00025 #endif
00026 
00027 // ---------------------------------
00028 // -- Collaborating Class Headers --
00029 // ---------------------------------
00030 
00031 #ifndef BDBINDEXINGERRORS_HH
00032 #include "BdbIndexing/BdbIndexingErrors.hh"
00033 #endif
00034 #ifndef BDBEVENTSTORE_HH
00035 #include "BdbEventStore/BdbEventStore.hh"
00036 #endif
00037 #ifndef BDBEVSCLUSTERINGHINT_HH
00038 #include "BdbClustering/BdbEvsClusteringHint.hh"
00039 #endif
00040 
00041  ;
00042 
00043 // --------------------------------
00044 // -- Initialize clustering hint --
00045 // --------------------------------
00046 
00047 BdbHintInit(BdbBMBin) ;
00048 
00049 /**
00050  **  BdbBMBin() - default constructor
00051  **/
00052 
00053 BdbBMBin::BdbBMBin()
00054 {
00055     _minValue = 0.0 ;
00056     _maxValue = 1.0 ;
00057     _numUsed  = 0 ;
00058 }
00059 
00060 /**
00061  **  BdbBMBin() - constructor
00062  **/
00063 
00064 BdbBMBin::BdbBMBin(d_Float minValue,
00065                    d_Float maxValue)
00066 {
00067     _minValue = minValue ;
00068     _maxValue = maxValue ;
00069     _numUsed  = 0 ;
00070 }
00071 
00072 /**
00073  **  ~BdbBMBin() - destructor
00074  **/
00075 
00076 BdbBMBin::~BdbBMBin()
00077 {}
00078 
00079 /**
00080  **  setLimits() - set the limits of the bin. Be aware that the left
00081  **                value belongs to the interval whereas the right - does not.
00082  **/
00083 
00084 BdbStatus
00085 BdbBMBin::setLimits(d_Float minValue, d_Float maxValue)
00086 {
00087 
00088   // Check for the correct value of parameters.
00089 
00090     if ( minValue >= maxValue ) {
00091         return BdbSignal(BdbcUserError, BdbIndexingErrInvalidParameter, 0, 
00092                              "BdbBMBin::setLimits") ;
00093         }
00094         
00095         _minValue = minValue ;
00096         _maxValue = maxValue ;
00097 
00098     return BdbcSuccess ;
00099 }
00100 
00101 /**
00102  **  extendBy() - extend the size of the array by the value
00103  **               of specified element.
00104  **               In a case of compressed bits strings, the number
00105  **               of actually used bits in the element is ignored.
00106  **/
00107  
00108 BdbStatus
00109 BdbBMBin::extendBy(d_ULong element, d_ULong nUsed)
00110 {
00111     BdbStatus status ;
00112 
00113     status = _bits.extend(element) ;
00114     if ( status != BdbcSuccess ) {
00115         return status ;
00116     }
00117     _numUsed = nUsed ;
00118 
00119     return BdbcSuccess ;
00120 }
00121 
00122 /////////////////
00123 // End Of File //
00124 /////////////////

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 04, 2002