| 1 | #ifndef MARS_MHEffectiveOnTime | 
|---|
| 2 | #define MARS_MHEffectiveOnTime | 
|---|
| 3 |  | 
|---|
| 4 | #ifndef MARS_MH | 
|---|
| 5 | #include "MH.h" | 
|---|
| 6 | #endif | 
|---|
| 7 | #ifndef MARS_MTime | 
|---|
| 8 | #include "MTime.h" | 
|---|
| 9 | #endif | 
|---|
| 10 | #ifndef ROOT_TH1 | 
|---|
| 11 | #include <TH1.h> | 
|---|
| 12 | #endif | 
|---|
| 13 | #ifndef ROOT_TH2 | 
|---|
| 14 | #include <TH2.h> | 
|---|
| 15 | #endif | 
|---|
| 16 | #ifndef ROOT_TF1 | 
|---|
| 17 | #include <TF1.h> | 
|---|
| 18 | #endif | 
|---|
| 19 |  | 
|---|
| 20 | class MTime; | 
|---|
| 21 | class MPointingPos; | 
|---|
| 22 | class MParameterDerr; | 
|---|
| 23 |  | 
|---|
| 24 | class MParList; | 
|---|
| 25 |  | 
|---|
| 26 | class MHEffectiveOnTime : public MH | 
|---|
| 27 | { | 
|---|
| 28 | private: | 
|---|
| 29 | MPointingPos   *fPointPos; //! Container to get the zenith angle from | 
|---|
| 30 | MTime           fLastTime; //! Time-Stamp of last event | 
|---|
| 31 |  | 
|---|
| 32 | MTime          *fTime;     //! Time-Stamp of "effective on-time" event | 
|---|
| 33 | MParameterDerr *fParam;    //! Output container for effective on-time | 
|---|
| 34 |  | 
|---|
| 35 | TH2D fH2DeltaT;      // Counts vs Delta T and Theta | 
|---|
| 36 | TH1D fH1DeltaT;      //! Counts vs Delta T (for a time interval) | 
|---|
| 37 |  | 
|---|
| 38 | TH1D fHThetaEffOn;   // Effective On time versus Theta | 
|---|
| 39 | TH1D fHThetaProb;    // Chisq prob fit of Effective On time versus Theta | 
|---|
| 40 | TH1D fHThetaNDF;     // NDF vs Theta | 
|---|
| 41 | TH1D fHThetaLambda;  // Slope (rate) vs Theta | 
|---|
| 42 |  | 
|---|
| 43 | TH1D fHTimeEffOn;    // Effective On time versus Time | 
|---|
| 44 | TH1D fHTimeProb;     // Chisq prob fit of Effective On time versus Time | 
|---|
| 45 | TH1D fHTimeLambda;   // Slope (rate) vs Time | 
|---|
| 46 |  | 
|---|
| 47 | Bool_t fIsFinalized; // Flag telling you whether fHThetaEffOn is the final result | 
|---|
| 48 |  | 
|---|
| 49 | UInt_t fNumEvents;   // Number of events to be used for a bin in time | 
|---|
| 50 | UInt_t fFirstBin;    // For bin for fit | 
|---|
| 51 |  | 
|---|
| 52 | Bool_t FitH(TH1D *h, Double_t *res, Bool_t paint=kFALSE) const; | 
|---|
| 53 | void FitThetaBins(); | 
|---|
| 54 | void FitTimeBin(); | 
|---|
| 55 | void PaintProb(TH1 &h) const; | 
|---|
| 56 | void PaintText(Double_t val, Double_t error, Double_t range=-1) const; | 
|---|
| 57 | void PaintText(Double_t *res) const; | 
|---|
| 58 | void DrawRightAxis(const char *title); | 
|---|
| 59 | void UpdateRightAxis(TH1 &h); | 
|---|
| 60 | void PrintStatistics(); | 
|---|
| 61 |  | 
|---|
| 62 | Bool_t SetupFill(const MParList *pList); | 
|---|
| 63 | Bool_t Fill(const MParContainer *par, const Stat_t w=1); | 
|---|
| 64 | Bool_t Finalize(); | 
|---|
| 65 |  | 
|---|
| 66 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); | 
|---|
| 67 |  | 
|---|
| 68 | public: | 
|---|
| 69 | MHEffectiveOnTime(const char *name=NULL, const char *title=NULL); | 
|---|
| 70 |  | 
|---|
| 71 | void SetNumEvents(Int_t i) { fNumEvents=i; } | 
|---|
| 72 | void SetFirstBin(Int_t i)  { fFirstBin=i;  } | 
|---|
| 73 |  | 
|---|
| 74 | const TH1D &GetHEffOnTheta() const { return fHThetaEffOn; } | 
|---|
| 75 | const TH1D &GetHEffOnTime() const { return fHTimeEffOn; } | 
|---|
| 76 |  | 
|---|
| 77 | const TH2D &GetH2DeltaT() const { return fH2DeltaT; } | 
|---|
| 78 |  | 
|---|
| 79 | void Draw(Option_t *option=""); | 
|---|
| 80 | void Paint(Option_t *opt=""); | 
|---|
| 81 |  | 
|---|
| 82 | ClassDef(MHEffectiveOnTime, 2) // Histogram to determin effective On-Time vs Time and Zenith Angle | 
|---|
| 83 | }; | 
|---|
| 84 |  | 
|---|
| 85 | #endif | 
|---|
| 86 |  | 
|---|