ROOT logo
#ifndef __TMrbStatistics_h__
#define __TMrbStatistics_h__

namespace std {} using namespace std;

#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "Rtypes.h"
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "TKey.h"
#include "TList.h"
#include "TNamed.h"
#include "TDirectory.h"

class TMrbStatEntry: public TNamed {
public:
   TMrbStatEntry();

   TMrbStatEntry(TH1*, const char *, const char *);

   ~TMrbStatEntry(){};

   void Set(const Stat_t ent, const Stat_t sofw, const Stat_t mx,
            const Stat_t sx);                  // set statistics values for 1-dim
   void Set(const Stat_t ent, const Stat_t sofw); // set statistics values for 2-dim
   Int_t Get(Stat_t *ent, Stat_t *sofw, Stat_t *mx, Stat_t *sx) const;
   Int_t Get(Stat_t *ent, Stat_t *sofw) const;
   inline Stat_t GetEntries() const {return fEntries;}
   inline Stat_t GetSumofw() const {return fSumofw;}
   inline Stat_t GetMean() const {return fMean;}
   inline Stat_t GetSigma() const {return fSigma;}   
   TH1* GetHist() const {return fHist;}
   Int_t GetDimension() const {return fDim;};        // Get histogram dimension  
   void  SetCycle(Int_t cycle) {fCycle = cycle;}; 
   Int_t GetCycle() const {return fCycle;}; 
   void Print(Option_t * Option) const { TObject::Print(Option); }
   Int_t Print(ostream & ostr) const;                      // print out one line

protected:
   TH1 * fHist;            //! pointer to histogram, dont stream out hists
   Int_t fDim;             // Dimension of histogram
   Int_t fNofUpdates;      // Number of updates
   Int_t fCycle;           // cycle number of Key on file
   Int_t fNbinsX;
   Int_t fNbinsY;
   Int_t fNbinsZ;
   Int_t fBytesPerCell;
   Axis_t fLowX;
   Axis_t fHighX;
   Axis_t fLowY;
   Axis_t fHighY;
   Axis_t fLowZ;
   Axis_t fHighZ;
   Stat_t fEntries;        // Entries
   Stat_t fSumofw;         // Sum of Weights, contents without under/overflows
   Stat_t fMean;           // Mean (along X for 2 dim)
   Stat_t fSigma;          // RMS (root mean squared)
	ClassDef(TMrbStatEntry, 1)
};


class TMrbStatCheck: public TNamed {
public:
   TMrbStatCheck();
   TMrbStatCheck(const char *, const char *);
   ~TMrbStatCheck(){};
   Bool_t InsideMean(Stat_t val);
   Bool_t InsideSigma(Stat_t val);
public:
   Bool_t fAnyCheck;
   Stat_t fEntriesLow;        // Entries
   Stat_t fSumofwLow;         // Sum of Weights, contents without under/overflows
   Stat_t fMeanLow;           // Mean (along X for 2 dim)
   Stat_t fSigmaLow;          // RMS (root mean squared)
   Stat_t fEntriesUp;         // Entries
   Stat_t fSumofwUp;          // Sum of Weights, contents without under/overfUps
   Stat_t fMeanUp;            // Mean (along X for 2 dim)
   Stat_t fSigmaUp;           // RMS (root mean squared)
	ClassDef(TMrbStatCheck, 1)	// [Utils] Check histogram statistics
};

class TMrbStatistics: public TNamed {
public:
   TMrbStatistics(){fStatEntries=new TList(this);};

   TMrbStatistics(const char *);

   ~TMrbStatistics();

   Int_t Init();              // find hists and initialize table    
   Int_t Update();            // go through list of hists and update values
   Int_t Fill();              // fill stats for hists in memory
   Int_t Fill(TDirectory *);       // fill stats for hists in root file
//   Int_t Fill(TMapFile *);    // fill stats for hists in map file
   TList * GetListOfEntries(){return fStatEntries;};
   void Print(Option_t * Option) const { TObject::Print(Option); }
   void Print(ostream & ostr = cout) const;

protected:
   TList  *fStatEntries;

	ClassDef(TMrbStatistics, 1)	// [Utils] Histogram statistics
};
#endif
 TMrbStatistics.h:1
 TMrbStatistics.h:2
 TMrbStatistics.h:3
 TMrbStatistics.h:4
 TMrbStatistics.h:5
 TMrbStatistics.h:6
 TMrbStatistics.h:7
 TMrbStatistics.h:8
 TMrbStatistics.h:9
 TMrbStatistics.h:10
 TMrbStatistics.h:11
 TMrbStatistics.h:12
 TMrbStatistics.h:13
 TMrbStatistics.h:14
 TMrbStatistics.h:15
 TMrbStatistics.h:16
 TMrbStatistics.h:17
 TMrbStatistics.h:18
 TMrbStatistics.h:19
 TMrbStatistics.h:20
 TMrbStatistics.h:21
 TMrbStatistics.h:22
 TMrbStatistics.h:23
 TMrbStatistics.h:24
 TMrbStatistics.h:25
 TMrbStatistics.h:26
 TMrbStatistics.h:27
 TMrbStatistics.h:28
 TMrbStatistics.h:29
 TMrbStatistics.h:30
 TMrbStatistics.h:31
 TMrbStatistics.h:32
 TMrbStatistics.h:33
 TMrbStatistics.h:34
 TMrbStatistics.h:35
 TMrbStatistics.h:36
 TMrbStatistics.h:37
 TMrbStatistics.h:38
 TMrbStatistics.h:39
 TMrbStatistics.h:40
 TMrbStatistics.h:41
 TMrbStatistics.h:42
 TMrbStatistics.h:43
 TMrbStatistics.h:44
 TMrbStatistics.h:45
 TMrbStatistics.h:46
 TMrbStatistics.h:47
 TMrbStatistics.h:48
 TMrbStatistics.h:49
 TMrbStatistics.h:50
 TMrbStatistics.h:51
 TMrbStatistics.h:52
 TMrbStatistics.h:53
 TMrbStatistics.h:54
 TMrbStatistics.h:55
 TMrbStatistics.h:56
 TMrbStatistics.h:57
 TMrbStatistics.h:58
 TMrbStatistics.h:59
 TMrbStatistics.h:60
 TMrbStatistics.h:61
 TMrbStatistics.h:62
 TMrbStatistics.h:63
 TMrbStatistics.h:64
 TMrbStatistics.h:65
 TMrbStatistics.h:66
 TMrbStatistics.h:67
 TMrbStatistics.h:68
 TMrbStatistics.h:69
 TMrbStatistics.h:70
 TMrbStatistics.h:71
 TMrbStatistics.h:72
 TMrbStatistics.h:73
 TMrbStatistics.h:74
 TMrbStatistics.h:75
 TMrbStatistics.h:76
 TMrbStatistics.h:77
 TMrbStatistics.h:78
 TMrbStatistics.h:79
 TMrbStatistics.h:80
 TMrbStatistics.h:81
 TMrbStatistics.h:82
 TMrbStatistics.h:83
 TMrbStatistics.h:84
 TMrbStatistics.h:85
 TMrbStatistics.h:86
 TMrbStatistics.h:87
 TMrbStatistics.h:88
 TMrbStatistics.h:89
 TMrbStatistics.h:90
 TMrbStatistics.h:91
 TMrbStatistics.h:92
 TMrbStatistics.h:93
 TMrbStatistics.h:94
 TMrbStatistics.h:95
 TMrbStatistics.h:96
 TMrbStatistics.h:97
 TMrbStatistics.h:98
 TMrbStatistics.h:99
 TMrbStatistics.h:100
 TMrbStatistics.h:101
 TMrbStatistics.h:102
 TMrbStatistics.h:103
 TMrbStatistics.h:104
 TMrbStatistics.h:105
 TMrbStatistics.h:106
 TMrbStatistics.h:107