AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONSparseHisto Class Reference

A very memory compact histogram to hold some tracker distributions. More...

#include <AliMUONSparseHisto.h>

Inheritance diagram for AliMUONSparseHisto:

Public Types

enum  { kUnderflow = BIT(20), kOverflow = BIT(21) }
 

Public Member Functions

 AliMUONSparseHisto (Double_t xmin=0.0, Double_t xmax=4096.0)
 
 AliMUONSparseHisto (const AliMUONSparseHisto &rhs)
 
AliMUONSparseHistooperator= (const AliMUONSparseHisto &rhs)
 
virtual ~AliMUONSparseHisto ()
 
Bool_t Add (const AliMUONSparseHisto &h)
 
Bool_t HasUnderflow () const
 
Bool_t HasOverflow () const
 
Int_t Fill (Double_t value)
 
Int_t GetNbins () const
 Return number of bins we hold. More...
 
Double_t GetBinCenter (Int_t bin) const
 
Int_t GetBinContent (Int_t bin) const
 
virtual void Print (Option_t *opt="") const
 
virtual void Clear (Option_t *opt="")
 
Int_t Find (Int_t binCenter) const
 
virtual void Copy (TObject &object) const
 
Double_t Xmax () const
 Return max value of bincenter. More...
 
Double_t Xmin () const
 Return min value of bincenter. More...
 
Int_t Nbits () const
 Number of bits used to code the x-value of the histogram. More...
 

Private Member Functions

UInt_t Encode (Int_t binCenter, Int_t binContent) const
 
Double_t DecodeValue (Int_t value) const
 
Int_t EncodeValue (Double_t value) const
 
UInt_t GetBin (Int_t i) const
 
Int_t BinCenter (UInt_t x) const
 
Int_t BinContent (UInt_t x) const
 
void Expand ()
 
Double_t Factor () const
 Conversion factor to go from float to int value (for bin content) More...
 

Private Attributes

Int_t fNbins
 number of bins we hold More...
 
UInt_t * fArray
 compacted content = (bin,value) More...
 
Double_t fXmin
 min value of bincenter More...
 
Double_t fXmax
 max value of bincenter More...
 
Double_t fFactor
 to go from double to int More...
 

Detailed Description

A very memory compact histogram to hold some tracker distributions.

Tiny histogram-like class to hold some distributions of tracker data. Only intent of this class is to minimize memory consumption, in order to fit a maximum number of channel histograms into memory. The rest is not supported ;-)

Author
Laurent Aphecetche, Subatech

Definition at line 19 of file AliMUONSparseHisto.h.

Member Enumeration Documentation

anonymous enum
Enumerator
kUnderflow 
kOverflow 

Definition at line 23 of file AliMUONSparseHisto.h.

Constructor & Destructor Documentation

AliMUONSparseHisto::AliMUONSparseHisto ( Double_t  xmin = 0.0,
Double_t  xmax = 4096.0 
)

ctor

Definition at line 42 of file AliMUONSparseHisto.cxx.

AliMUONSparseHisto::AliMUONSparseHisto ( const AliMUONSparseHisto rhs)

copy ctor

Definition at line 56 of file AliMUONSparseHisto.cxx.

AliMUONSparseHisto::~AliMUONSparseHisto ( )
virtual

dtor

Definition at line 81 of file AliMUONSparseHisto.cxx.

Member Function Documentation

Bool_t AliMUONSparseHisto::Add ( const AliMUONSparseHisto h)

Add h to this

Definition at line 89 of file AliMUONSparseHisto.cxx.

Referenced by AliMUONTrackerData::Add().

Int_t AliMUONSparseHisto::BinCenter ( UInt_t  x) const
private

Extract binCenter part from x

Definition at line 159 of file AliMUONSparseHisto.cxx.

Referenced by GetBinCenter().

Int_t AliMUONSparseHisto::BinContent ( UInt_t  x) const
private

Extract binContent part from x

Definition at line 168 of file AliMUONSparseHisto.cxx.

Referenced by GetBinContent().

void AliMUONSparseHisto::Clear ( Option_t *  opt = "")
virtual

Reset the content

Definition at line 109 of file AliMUONSparseHisto.cxx.

void AliMUONSparseHisto::Copy ( TObject &  object) const
virtual

Copy this to *object

Definition at line 119 of file AliMUONSparseHisto.cxx.

Referenced by AliMUONSparseHisto(), and operator=().

Double_t AliMUONSparseHisto::DecodeValue ( Int_t  value) const
private

From internal integer to "original" double

Definition at line 143 of file AliMUONSparseHisto.cxx.

Referenced by GetBinCenter().

UInt_t AliMUONSparseHisto::Encode ( Int_t  binCenter,
Int_t  binContent 
) const
private

Convert (binCenter,binContent) into a single value

Definition at line 177 of file AliMUONSparseHisto.cxx.

Referenced by Fill().

Int_t AliMUONSparseHisto::EncodeValue ( Double_t  value) const
private

From original double value to internal integer

Definition at line 151 of file AliMUONSparseHisto.cxx.

Referenced by Fill().

void AliMUONSparseHisto::Expand ( )
private

Make fArray of size n

Definition at line 186 of file AliMUONSparseHisto.cxx.

Referenced by Fill().

Double_t AliMUONSparseHisto::Factor ( ) const
inlineprivate

Conversion factor to go from float to int value (for bin content)

Definition at line 88 of file AliMUONSparseHisto.h.

Referenced by Copy(), DecodeValue(), and EncodeValue().

Int_t AliMUONSparseHisto::Fill ( Double_t  value)

Fill

Definition at line 210 of file AliMUONSparseHisto.cxx.

Referenced by Add(), and AliMUONTrackerData::FillHisto().

Int_t AliMUONSparseHisto::Find ( Int_t  binCenter) const

Return the index in fArray of value, or -1 if not found

Definition at line 251 of file AliMUONSparseHisto.cxx.

Referenced by Fill().

UInt_t AliMUONSparseHisto::GetBin ( Int_t  i) const
private

Get bin, which is a compacted form of two integers : (binCenter,binContent) where binCenter itself might be an integer-fied double value.

Definition at line 264 of file AliMUONSparseHisto.cxx.

Referenced by Copy(), GetBinCenter(), GetBinContent(), and Print().

Double_t AliMUONSparseHisto::GetBinCenter ( Int_t  bin) const

Get bin center

Definition at line 273 of file AliMUONSparseHisto.cxx.

Referenced by AliMUONTrackerDataHistogrammer::Add(), Find(), and Print().

Int_t AliMUONSparseHisto::GetBinContent ( Int_t  bin) const

Get bin content

Definition at line 286 of file AliMUONSparseHisto.cxx.

Referenced by Add(), AliMUONTrackerDataHistogrammer::Add(), Fill(), and Print().

Int_t AliMUONSparseHisto::GetNbins ( ) const
inline

Return number of bins we hold.

Definition at line 48 of file AliMUONSparseHisto.h.

Referenced by Add(), AliMUONTrackerDataHistogrammer::Add(), Copy(), Find(), GetBinCenter(), GetBinContent(), and Print().

Bool_t AliMUONSparseHisto::HasOverflow ( ) const
inline

Whether this histogram has overflow values (no way to know the number of underflow, though)

Definition at line 43 of file AliMUONSparseHisto.h.

Referenced by AliMUONTrackerDataHistogrammer::Add(), and Print().

Bool_t AliMUONSparseHisto::HasUnderflow ( ) const
inline

Whether this histogram has underflow values (no way to know the number of underflow, though)

Definition at line 39 of file AliMUONSparseHisto.h.

Referenced by AliMUONTrackerDataHistogrammer::Add(), and Print().

Int_t AliMUONSparseHisto::Nbits ( ) const
inline

Number of bits used to code the x-value of the histogram.

Definition at line 69 of file AliMUONSparseHisto.h.

Referenced by AliMUONTrackerDataHistogrammer::CreateChannelHisto().

AliMUONSparseHisto & AliMUONSparseHisto::operator= ( const AliMUONSparseHisto rhs)

assignment operator

Definition at line 70 of file AliMUONSparseHisto.cxx.

void AliMUONSparseHisto::Print ( Option_t *  opt = "") const
virtual

Printout

Definition at line 299 of file AliMUONSparseHisto.cxx.

Double_t AliMUONSparseHisto::Xmax ( ) const
inline

Return max value of bincenter.

Definition at line 63 of file AliMUONSparseHisto.h.

Referenced by Add(), Copy(), and Fill().

Double_t AliMUONSparseHisto::Xmin ( ) const
inline

Return min value of bincenter.

Definition at line 66 of file AliMUONSparseHisto.h.

Referenced by Add(), Copy(), DecodeValue(), EncodeValue(), and Fill().

Member Data Documentation

UInt_t* AliMUONSparseHisto::fArray
private

compacted content = (bin,value)

Definition at line 95 of file AliMUONSparseHisto.h.

Referenced by Clear(), Copy(), Expand(), Fill(), GetBin(), and ~AliMUONSparseHisto().

Double_t AliMUONSparseHisto::fFactor
private

to go from double to int

Definition at line 100 of file AliMUONSparseHisto.h.

Referenced by Copy(), and Factor().

Int_t AliMUONSparseHisto::fNbins
private

number of bins we hold

Definition at line 92 of file AliMUONSparseHisto.h.

Referenced by Clear(), Copy(), Expand(), Fill(), and GetNbins().

Double_t AliMUONSparseHisto::fXmax
private

max value of bincenter

Definition at line 98 of file AliMUONSparseHisto.h.

Referenced by Add(), Copy(), and Xmax().

Double_t AliMUONSparseHisto::fXmin
private

min value of bincenter

Definition at line 97 of file AliMUONSparseHisto.h.

Referenced by Add(), Copy(), and Xmin().


The documentation for this class was generated from the following files: