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

Last change on this file since 1863 was 1834, 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 Bool_t AddHistogram();
42
43 MH &operator[](Int_t i);
44 MH *At(Int_t i);
45
46 MH *GetH();
47
48 void SetIndexByKey(Double_t key);
49
50 void SetIndex(Int_t i) { fIdx=i; }
51 void IncIndex() { fIdx++; }
52 void DecIndex() { fIdx--; }
53
54 Int_t GetIndex() const { return fIdx; }
55
56 void Print(Option_t *option="") const;
57
58 void Draw(Option_t *opt="");
59 TObject *DrawClone(Option_t *opt="") const;
60
61 ClassDef(MHArray, 0) //A histogram class for an array of Mars histograms
62};
63
64#endif
65
Note: See TracBrowser for help on using the repository browser.