source: trunk/MagicSoft/Mars/mhist/MHArray.h@ 1770

Last change on this file since 1770 was 1629, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 1.6 KB
Line 
1#ifndef MARS_MHArray
2#define MARS_MHArray
3
4#ifndef MARS_MH
5#include "MH.h"
6#endif
7
8class TList;
9class TLegend;
10
11class MMap;
12
13class MHArray : public MH
14{
15private:
16 Int_t fIdx; // current index for the fill function
17 TList *fArray; //-> Array storing the histograms
18
19 const MParList *fParList; //! pointer to parameter list used for SetupFill when a new Hist is created
20 TClass *fClass; // pointer to class entry in root dictionary
21
22 const MH *fTemplate; //-> pointer to a template histogram
23 TString fTemplateName; // name of the template class
24
25 MMap *fMapIdx; //! Table to map keys to array indices
26
27 Bool_t CreateH();
28 void AddLegendEntry(TLegend *leg, TObject *obj, Int_t idx) const;
29
30 enum { kUseTemplate=BIT(14) };
31
32public:
33 MHArray(const TString hname, Bool_t istempl=kFALSE, const char *name=NULL, const char *title=NULL);
34 MHArray(const MH *hist, const char *name=NULL, const char *title=NULL);
35 ~MHArray();
36
37 virtual Bool_t SetupFill(const MParList *pList);
38 virtual Bool_t Fill(const MParContainer *par);
39 virtual Bool_t Finalize();
40
41 MH &operator[](Int_t i);
42 MH *At(Int_t i);
43
44 MH *GetH();
45
46 void SetIndexByKey(Double_t key);
47
48 void SetIndex(Int_t i) { fIdx=i; }
49 void IncIndex() { fIdx++; }
50 void DecIndex() { fIdx--; }
51
52 Int_t GetIndex() const { return fIdx; }
53
54 void Print(Option_t *option="") const;
55
56 void Draw(Option_t *opt="");
57 TObject *DrawClone(Option_t *opt="") const;
58
59 ClassDef(MHArray, 0) //A histogram class for an array of Mars histograms
60};
61
62#endif
63
Note: See TracBrowser for help on using the repository browser.