1 | #ifndef MARS_MFillH
|
---|
2 | #define MARS_MFillH
|
---|
3 |
|
---|
4 | #ifndef MARS_MTask
|
---|
5 | #include "MTask.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class MH;
|
---|
9 | class MMap;
|
---|
10 | class MData;
|
---|
11 | class MParameterD;
|
---|
12 | class MParList;
|
---|
13 |
|
---|
14 | class TCanvas;
|
---|
15 |
|
---|
16 | class MFillH : public MTask
|
---|
17 | {
|
---|
18 | public:
|
---|
19 | enum {
|
---|
20 | kDoNotDisplay = BIT(17),
|
---|
21 | kCanSkip = BIT(18)
|
---|
22 | };
|
---|
23 |
|
---|
24 | private:
|
---|
25 | MParContainer *fParContainer; // Pointer to the data container storing
|
---|
26 | TString fParContainerName; // Name to a data container
|
---|
27 |
|
---|
28 | MH* fH; // Pointer to the MH container to get filled
|
---|
29 | TString fHName; // Name to a MH container to get filled
|
---|
30 | TString fNameTab;
|
---|
31 | TString fTitleTab;
|
---|
32 |
|
---|
33 | MParameterD *fWeight; // Pointer to the container storing a weight
|
---|
34 | TString fWeightName; // Name of a container storing a weight
|
---|
35 |
|
---|
36 | MData *fIndex; // MData object describing the 'key' to an automatic index for an MHArray
|
---|
37 | MMap *fMapIdx; //! Map to map key-index-pair for an MHArray (MMap see MFillH.cc)
|
---|
38 |
|
---|
39 | TCanvas *fCanvas; //! Canvas used to update a MStatusDisplay at the end of a loop
|
---|
40 |
|
---|
41 | TString fDrawOption; // Draw option for status display
|
---|
42 |
|
---|
43 | TString ExtractName(const char *name) const;
|
---|
44 | TString ExtractClass(const char *name) const;
|
---|
45 |
|
---|
46 | void Init(const char *name, const char *title);
|
---|
47 |
|
---|
48 | void StreamPrimitive(ostream &out) const;
|
---|
49 |
|
---|
50 | Bool_t DrawToDisplay();
|
---|
51 |
|
---|
52 | public:
|
---|
53 | MFillH();
|
---|
54 | MFillH(const char *hist, const char *par=NULL, const char *name=NULL, const char *title=NULL);
|
---|
55 | MFillH(const char *hist, MParContainer *par, const char *name=NULL, const char *title=NULL);
|
---|
56 | MFillH(MH *hist, const char *par=NULL, const char *name=NULL, const char *title=NULL);
|
---|
57 | MFillH(MH *hist, MParContainer *par, const char *name=NULL, const char *title=NULL);
|
---|
58 | ~MFillH();
|
---|
59 |
|
---|
60 | void SetNameTab(const char *n="", const char *t="") { fNameTab = n; fTitleTab = t; }
|
---|
61 | void SetTitleTab(const char *t="") { fTitleTab = t; }
|
---|
62 |
|
---|
63 | void SetRuleForIdx(const TString rule);
|
---|
64 | void SetRuleForIdx(MData *rule);
|
---|
65 |
|
---|
66 | void ResetWeight() { fWeight=0; fWeightName=""; }
|
---|
67 | void SetWeight(MParameterD *w) { fWeight = w; }
|
---|
68 | void SetWeight(const char *name="MWeight") { fWeightName = name; }
|
---|
69 |
|
---|
70 | void SetDrawOption(Option_t *option="");
|
---|
71 | Option_t *GetDrawOption() const { return fDrawOption; }
|
---|
72 |
|
---|
73 | Int_t PreProcess(MParList *pList);
|
---|
74 | Bool_t ReInit(MParList *pList);
|
---|
75 | Int_t Process();
|
---|
76 | Int_t PostProcess();
|
---|
77 |
|
---|
78 | TCanvas *GetCanvas() { return fCanvas; }
|
---|
79 |
|
---|
80 | ClassDef(MFillH, 3) // Task to fill a histogram with data from a parameter container
|
---|
81 | };
|
---|
82 |
|
---|
83 | #endif
|
---|
84 |
|
---|