]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSparseHisto.h
- Implementing the possibility to histogram the raw adc values when reading
[u/mrichter/AliRoot.git] / MUON / AliMUONSparseHisto.h
1 #ifndef ALIMUONSPARSEHISTO_H
2 #define ALIMUONSPARSEHISTO_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice                               */
6
7 // $Id$
8
9 /// \ingroup graphics
10 /// \class AliMUONSparseHisto
11 /// \brief A very memory compact histogram to hold tracker ADC distributions
12 /// 
13 // Author Laurent Aphecetche, Subatech
14
15 #ifndef ROOT_TObject
16 #  include "TObject.h"
17 #endif
18
19 class AliMUONSparseHisto : public TObject
20 {
21 public:
22   AliMUONSparseHisto();
23   AliMUONSparseHisto(const AliMUONSparseHisto& rhs);
24   AliMUONSparseHisto& operator=(const AliMUONSparseHisto& rhs);
25   
26   virtual ~AliMUONSparseHisto();
27   
28   Int_t Fill(Int_t adc);
29   
30   /// Return number of bins we hold
31   Int_t GetNbins() const { return fNbins; }
32   
33   Int_t GetBinContent(Int_t bin) const;
34   
35   virtual void Print(Option_t* opt="") const;
36   
37   virtual void Clear(Option_t* opt="");
38   
39   void Decode(Int_t value, Int_t& adc, Int_t& count) const;
40   
41   Int_t Encode(Int_t adc, Int_t count) const;
42   
43   Int_t Find(Int_t adc) const;
44   
45   virtual void Copy(TObject& object) const;
46
47 private:
48       
49     void Expand();
50   
51 private:
52
53   Int_t fNbins;  ///< number of bins we hold
54
55   /// compacted content = (bin,value)
56   Int_t* fArray; //[fNbins] compacted content = (bin,value)
57   
58   ClassDef(AliMUONSparseHisto,1) // Sparse histogram-like class for ADC distributions
59 };
60
61 #endif