source: releases/Mars.2014.05.26/mhvstime/MHVsTime.h@ 18621

Last change on this file since 18621 was 12880, checked in by tbretz, 13 years ago
Removed some old workarounds hopefully not necessary anymor with newer root version -- tested with 5.32.00 so far.
File size: 2.3 KB
Line 
1#ifndef MARS_MHVsTime
2#define MARS_MHVsTime
3
4#ifndef MARS_MH
5#include "MH.h"
6#endif
7
8#ifndef MARS_MTime
9#include "MTime.h"
10#endif
11
12class TGraph;
13class MData;
14
15class MHVsTime : public MH
16{
17private:
18 static const TString gsDefName;
19 static const TString gsDefTitle;
20
21protected:
22 // Could be const but root < 3.02/06 doesn't like this...
23 TGraph *fGraph; // Histogram to fill
24 MData *fData; // Object from which the data is filled
25 MData *fError; // Object from which the error is filled
26 Double_t fScale; // Scale for axis (eg unit)
27 Int_t fMaxPts; // Maximum number of data points
28
29 Int_t fNumEvents; // Number of events to average
30
31 Double_t fMean; //! Mean value
32 Double_t fMeanErr; //! Mean error
33 Int_t fN; //! Number of entries in fMean
34 MTime fLast; //! For checks
35
36 Double_t fMinimum; // User defined minimum
37 Double_t fMaximum; // User defined maximum
38
39 Double_t fMin; //! Calculation of minimum
40 Double_t fMax; //! Calculation of maximum
41
42 enum {
43 kIsLogy = BIT(18)
44 };
45
46 Bool_t fUseEventNumber;
47
48 Bool_t Finalize();
49
50public:
51 MHVsTime(const char *rule=NULL, const char *ruleerr=NULL);
52 ~MHVsTime();
53
54 void SetScale(Double_t scale) { fScale = scale; }
55
56 void SetMinimum(Double_t min=-1111) { fMinimum = min; }
57 void SetMaximum(Double_t max=-1111) { fMaximum = max; }
58
59 Int_t GetNbins() const;
60
61 void SetName(const char *name);
62 void SetTitle(const char *title);
63
64 void SetLogy(Bool_t b=kTRUE) { b ? SetBit(kIsLogy) : ResetBit(kIsLogy); }
65
66 Bool_t SetupFill(const MParList *pList);
67 Int_t Fill(const MParContainer *par, const Stat_t w=1);
68
69 TString GetDataMember() const;
70 TString GetRule() const;
71
72 /*
73 const TH1 *GetHist() const;
74 TH1 *GetHist();
75 TH1 *GetHistByName(const TString name="");
76 */
77 const TGraph *GetGraph() const { return fGraph; }
78 TGraph *GetGraph() { return fGraph; }
79
80 void SetUseEventNumber(Bool_t use = kTRUE) { fUseEventNumber = use; }
81 void SetNumEvents(Int_t n) { fNumEvents=n; }
82
83 void Draw(Option_t *opt=NULL);
84
85 MParContainer *New() const;
86
87 void SetMaxPts(Int_t n) { fMaxPts=n; }
88
89 ClassDef(MHVsTime, 3) // Generalized 1/2/3D-histogram for Mars variables
90};
91
92#endif
Note: See TracBrowser for help on using the repository browser.