source: trunk/MagicSoft/Mars/mhvstime/MHVsTime.h@ 6976

Last change on this file since 6976 was 4891, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.0 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 MDataChain;
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 MDataChain *fData; // Object from which the data is filled
25 MDataChain *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 enum {
37 kIsLogy = BIT(18)
38 };
39
40 Bool_t fUseEventNumber;
41
42public:
43 MHVsTime(const char *rule=NULL, const char *ruleerr=NULL);
44 ~MHVsTime();
45
46 void SetScale(Double_t scale) { fScale = scale; }
47
48 Int_t GetNbins() const;
49
50 void SetName(const char *name);
51 void SetTitle(const char *title);
52
53 void SetLogy(Bool_t b=kTRUE) { b ? SetBit(kIsLogy) : ResetBit(kIsLogy); }
54
55 Bool_t SetupFill(const MParList *pList);
56 Bool_t Fill(const MParContainer *par, const Stat_t w=1);
57
58 TString GetDataMember() const;
59 TString GetRule() const;
60
61 /*
62 const TH1 *GetHist() const;
63 TH1 *GetHist();
64 TH1 *GetHistByName(const TString name="");
65 */
66 const TGraph *GetGraph() const { return fGraph; }
67 TGraph *GetGraph() { return fGraph; }
68
69 void SetUseEventNumber(Bool_t use = kTRUE) { fUseEventNumber = use; }
70 void SetNumEvents(Int_t n) { fNumEvents=n; }
71
72 void Draw(Option_t *opt=NULL);
73 void Paint(Option_t *opt=NULL);
74
75 MParContainer *New() const;
76
77 void SetMaxPts(Int_t n) { fMaxPts=n; }
78
79 ClassDef(MHVsTime, 1) // Generalized 1/2/3D-histogram for Mars variables
80};
81
82#endif
Note: See TracBrowser for help on using the repository browser.