inlib  1.2.0
Public Types | Public Member Functions | Protected Member Functions
inlib::histo::h2< TC, TN, TW, TH > Class Template Reference
Inheritance diagram for inlib::histo::h2< TC, TN, TW, TH >:
Inheritance graph
[legend]
Collaboration diagram for inlib::histo::h2< TC, TN, TW, TH >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef b2< TC, TN, TW, TH >::bn_t bn_t

Public Member Functions

virtual TH bin_error (int aI, int aJ) const
bool multiply (TW aFactor)
bool scale (TW aFactor)
void copy_from_data (const histo_data< TC, TN, TW > &a_from)
histo_data< TC, TN, TW > get_histo_data () const
bool reset ()
bool fill (TC aX, TC aY, TW aWeight=1)
bool add (const h2 &a_histo)
bool subtract (const h2 &a_histo)
bool multiply (const h2 &a_histo)
bool divide (const h2 &a_histo)
 h2 (const std::string &a_title, bn_t aXnumber, TC aXmin, TC aXmax, bn_t aYnumber, TC aYmin, TC aYmax)
 h2 (const std::string &a_title, const std::vector< TC > &aEdgesX, const std::vector< TC > &aEdgesY)
virtual ~h2 ()
 h2 (const h2 &a_from)
h2operator= (const h2 &a_from)

Protected Member Functions

virtual TH get_bin_height (int a_offset) const

Detailed Description

template<class TC, class TN, class TW, class TH>
class inlib::histo::h2< TC, TN, TW, TH >

Definition at line 13 of file h2.


Member Typedef Documentation

template<class TC, class TN, class TW, class TH>
typedef b2<TC,TN,TW,TH>::bn_t inlib::histo::h2< TC, TN, TW, TH >::bn_t

Reimplemented from inlib::histo::b2< TC, TN, TW, TH >.

Definition at line 16 of file h2.


Constructor & Destructor Documentation

template<class TC, class TN, class TW, class TH>
inlib::histo::h2< TC, TN, TW, TH >::h2 ( const std::string &  a_title,
bn_t  aXnumber,
TC  aXmin,
TC  aXmax,
bn_t  aYnumber,
TC  aYmin,
TC  aYmax 
) [inline]

Definition at line 126 of file h2.

  : parent(a_title,aXnumber,aXmin,aXmax,aYnumber,aYmin,aYmax)
  {}
template<class TC, class TN, class TW, class TH>
inlib::histo::h2< TC, TN, TW, TH >::h2 ( const std::string &  a_title,
const std::vector< TC > &  aEdgesX,
const std::vector< TC > &  aEdgesY 
) [inline]

Definition at line 131 of file h2.

  : parent(a_title,aEdgesX,aEdgesY)
  {}
template<class TC, class TN, class TW, class TH>
virtual inlib::histo::h2< TC, TN, TW, TH >::~h2 ( ) [inline, virtual]

Definition at line 137 of file h2.

{}
template<class TC, class TN, class TW, class TH>
inlib::histo::h2< TC, TN, TW, TH >::h2 ( const h2< TC, TN, TW, TH > &  a_from) [inline]

Definition at line 139 of file h2.

: parent(a_from){}

Member Function Documentation

template<class TC, class TN, class TW, class TH>
bool inlib::histo::h2< TC, TN, TW, TH >::add ( const h2< TC, TN, TW, TH > &  a_histo) [inline]

Definition at line 102 of file h2.

                             {
    parent::base_add(a_histo);
    this->update_fast_getters();
    return true;
  }
template<class TC, class TN, class TW, class TH>
virtual TH inlib::histo::h2< TC, TN, TW, TH >::bin_error ( int  aI,
int  aJ 
) const [inline, virtual]

Implements inlib::histo::b2< TC, TN, TW, TH >.

Definition at line 23 of file h2.

                                            {
    if(parent::m_bin_number==0) return 0;
    bn_t ibin;
    if(!parent::m_axes[0].in_range_to_absolute_index(aI,ibin)) return 0;
    bn_t jbin;
    if(!parent::m_axes[1].in_range_to_absolute_index(aJ,jbin)) return 0;
    bn_t offset = ibin + jbin * parent::m_axes[1].m_offset;
    return ::sqrt(parent::m_bin_Sw2[offset]);
  }
template<class TC, class TN, class TW, class TH>
void inlib::histo::h2< TC, TN, TW, TH >::copy_from_data ( const histo_data< TC, TN, TW > &  a_from) [inline]

Definition at line 41 of file h2.

                                                          {
    parent::base_from_data(a_from);
  }
template<class TC, class TN, class TW, class TH>
bool inlib::histo::h2< TC, TN, TW, TH >::divide ( const h2< TC, TN, TW, TH > &  a_histo) [inline]

Definition at line 119 of file h2.

                                 {
    if(!parent::base_divide(a_histo)) return false;
    this->update_fast_getters();
    return true;
  }
template<class TC, class TN, class TW, class TH>
bool inlib::histo::h2< TC, TN, TW, TH >::fill ( TC  aX,
TC  aY,
TW  aWeight = 1 
) [inline]

Definition at line 54 of file h2.

                                        {
    //m_coords[0] = aX;
    //m_coords[1] = aY;
    //return fill_bin(m_coords,aWeight);
  
    if(parent::m_dimension<=0) return false;
  
    bn_t ibin,jbin;
    if(!parent::m_axes[0].coord_to_absolute_index(aX,ibin)) return false;
    if(!parent::m_axes[1].coord_to_absolute_index(aY,jbin)) return false;
  
    bn_t offset = ibin + jbin * parent::m_axes[1].m_offset;
  
    parent::m_bin_entries[offset]++;
    parent::m_bin_Sw[offset] += aWeight;
    parent::m_bin_Sw2[offset] += aWeight * aWeight;
  
    TC xw = aX * aWeight;
    TC x2w = aX * xw;
    parent::m_bin_Sxw[offset][0] += xw;
    parent::m_bin_Sx2w[offset][0] += x2w;
  
    TC yw = aY * aWeight;
    TC y2w = aY * yw;
    parent::m_bin_Sxw[offset][1] += yw;
    parent::m_bin_Sx2w[offset][1] += y2w;
  
    bool inRange = true;
    if(ibin==0) inRange = false;
    else if(ibin==(parent::m_axes[0].m_number_of_bins+1)) inRange = false;
  
    if(jbin==0) inRange = false;
    else if(jbin==(parent::m_axes[1].m_number_of_bins+1)) inRange = false;
  
    if(inRange) {
      parent::m_in_range_entries++;
      parent::m_in_range_Sw += aWeight;
  
      parent::m_in_range_Sxw += xw;
      parent::m_in_range_Sx2w += x2w;
  
      parent::m_in_range_Syw += yw;
      parent::m_in_range_Sy2w += y2w;
    }
   
    return true;
  }
template<class TC, class TN, class TW, class TH>
virtual TH inlib::histo::h2< TC, TN, TW, TH >::get_bin_height ( int  a_offset) const [inline, protected, virtual]

Implements inlib::histo::base_histo< TC, TN, TW, TH >.

Definition at line 18 of file h2.

                                                { //TH should be the same as TW
    return parent::m_bin_Sw[a_offset];
  }
template<class TC, class TN, class TW, class TH>
histo_data<TC,TN,TW> inlib::histo::h2< TC, TN, TW, TH >::get_histo_data ( ) const [inline]

Definition at line 44 of file h2.

                                              {
    return parent::base_get_data();
  }
template<class TC, class TN, class TW, class TH>
bool inlib::histo::h2< TC, TN, TW, TH >::multiply ( TW  aFactor) [inline]

Definition at line 34 of file h2.

                           {
    if(!parent::base_multiply(aFactor)) return false;
    this->update_fast_getters();
    return true;
  }
template<class TC, class TN, class TW, class TH>
bool inlib::histo::h2< TC, TN, TW, TH >::multiply ( const h2< TC, TN, TW, TH > &  a_histo) [inline]

Definition at line 113 of file h2.

                                   {  
    if(!parent::base_multiply(a_histo)) return false;
    this->update_fast_getters();
    return true;
  }
template<class TC, class TN, class TW, class TH>
h2& inlib::histo::h2< TC, TN, TW, TH >::operator= ( const h2< TC, TN, TW, TH > &  a_from) [inline]

Definition at line 140 of file h2.

                                 {
    parent::operator=(a_from);
    return *this;
  }
template<class TC, class TN, class TW, class TH>
bool inlib::histo::h2< TC, TN, TW, TH >::reset ( ) [inline]

Definition at line 48 of file h2.

               {
    parent::base_reset();
    this->update_fast_getters();
    return true;
  }
template<class TC, class TN, class TW, class TH>
bool inlib::histo::h2< TC, TN, TW, TH >::scale ( TW  aFactor) [inline]

Definition at line 39 of file h2.

{return multiply(aFactor);}
template<class TC, class TN, class TW, class TH>
bool inlib::histo::h2< TC, TN, TW, TH >::subtract ( const h2< TC, TN, TW, TH > &  a_histo) [inline]

Definition at line 107 of file h2.

                                  {
    parent::base_subtract(a_histo);
    this->update_fast_getters();
    return true;
  }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines