21 #include <Riostream.h>
48 fFactor((1<<Nbits())/(xmax-xmin))
95 AliError(
"Cannot add sparse histograms with different limits !");
99 for ( Int_t i = 0; i < h.
GetNbins(); ++i )
122 TObject::Copy(
object);
134 for ( Int_t i = 0; i <
GetNbins(); ++i )
163 return ( x & 0xFFF00000 ) >> 20;
172 return (x & 0xFFFFF);
181 return ( ( binCenter & 0xFFF ) ) << 20 | ( ( binContent & 0xFFFFF ) );
197 UInt_t* tmp =
new UInt_t[
fNbins+1];
198 for ( Int_t i = 0; i <
fNbins; ++i )
214 if ( value <
Xmin() )
220 if ( value >
Xmax() )
228 Int_t i =
Find(ivalue);
255 for ( Int_t i = 0; i <
GetNbins(); ++i )
276 if ( bin < 0 )
return -FLT_MAX;
277 if ( bin >=
GetNbins() )
return FLT_MAX;
290 if ( bin < 0 || bin >=
GetNbins() )
return 0xFFFFFFFF;
302 Int_t id1 = ( GetUniqueID() & 0xFFFF0000 ) >> 16;
303 Int_t id2 = GetUniqueID() & 0xFFFF;
305 cout <<
"ID=(" << id1 <<
"," << id2 <<
") n bins = " <<
GetNbins();
313 if ( sopt.Contains(
"FULL") )
315 for ( Int_t i = 0; i <
GetNbins(); ++i )
AliMUONSparseHisto & operator=(const AliMUONSparseHisto &rhs)
virtual void Print(Option_t *opt="") const
Bool_t HasOverflow() const
Int_t EncodeValue(Double_t value) const
Int_t GetNbins() const
Return number of bins we hold.
AliMUONSparseHisto(Double_t xmin=0.0, Double_t xmax=4096.0)
Double_t DecodeValue(Int_t value) const
UInt_t * fArray
compacted content = (bin,value)
Double_t Xmax() const
Return max value of bincenter.
Double_t GetBinCenter(Int_t bin) const
Int_t fNbins
number of bins we hold
Double_t fFactor
to go from double to int
Bool_t HasUnderflow() const
virtual void Copy(TObject &object) const
Double_t Factor() const
Conversion factor to go from float to int value (for bin content)
Int_t GetBinContent(Int_t bin) const
Int_t Find(Int_t binCenter) const
Int_t BinContent(UInt_t x) const
virtual ~AliMUONSparseHisto()
Int_t BinCenter(UInt_t x) const
A very memory compact histogram to hold some tracker distributions.
Double_t fXmin
min value of bincenter
Int_t Fill(Double_t value)
UInt_t GetBin(Int_t i) const
UInt_t Encode(Int_t binCenter, Int_t binContent) const
Double_t fXmax
max value of bincenter
Double_t Xmin() const
Return min value of bincenter.
Bool_t Add(const AliMUONSparseHisto &h)
virtual void Clear(Option_t *opt="")