source: tags/Mars-V0.10.2/mhvstime/MHVsTime.h

Last change on this file was 7033, 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 void SetMinimum(Double_t min=-1111);
48
49 Int_t GetNbins() const;
50
51 void SetName(const char *name);
52 void SetTitle(const char *title);
53
54 void SetLogy(Bool_t b=kTRUE) { b ? SetBit(kIsLogy) : ResetBit(kIsLogy); }
55
56 Bool_t SetupFill(const MParList *pList);
57 Bool_t Fill(const MParContainer *par, const Stat_t w=1);
58
59 TString GetDataMember() const;
60 TString GetRule() const;
61
62 /*
63 const TH1 *GetHist() const;
64 TH1 *GetHist();
65 TH1 *GetHistByName(const TString name="");
66 */
67 const TGraph *GetGraph() const { return fGraph; }
68 TGraph *GetGraph() { return fGraph; }
69
70 void SetUseEventNumber(Bool_t use = kTRUE) { fUseEventNumber = use; }
71 void SetNumEvents(Int_t n) { fNumEvents=n; }
72
73 void Draw(Option_t *opt=NULL);
74 void Paint(Option_t *opt=NULL);
75
76 MParContainer *New() const;
77
78 void SetMaxPts(Int_t n) { fMaxPts=n; }
79
80 ClassDef(MHVsTime, 1) // Generalized 1/2/3D-histogram for Mars variables
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.