ROOT logo
Podd » SRC » THaVhist

class THaVhist


 THaVhist

 Vector of histograms; of course can be just 1 histogram.
 This object uses TH1 class of ROOT to form a histogram
 used by THaOutput.
 The X and Y axis, as well as cut conditions, can be
 formulas of global variables.
 They can also be arrays of variables, or vector formula,
 though certain rules apply about the dimensions; see
 THaOutput documentation for those rules.


 author:  R. Michaels    May 2003


Function Members (Methods)

public:
THaVhist(const string& type, const string& name, const string& title)
virtual~THaVhist()
Int_tCheckCut(Int_t index = 0)
voidCheckValidity()
static TClass*Class()
Int_tEnd()
voidErrPrint() const
const string&GetCutStr() const
Int_tGetSize()
const string&GetVarX() const
const string&GetVarY() const
Bool_tHasCut() const
Int_tInit()
virtual TClass*IsA() const
Bool_tIsScaler()
Bool_tIsValid() const
voidPrint() const
Int_tProcess()
voidReAttach()
voidSetCut(const string& cut)
voidSetCut(THaVform* cut)
voidSetX(THaVform* varx)
voidSetX(Int_t nbinx, Double_t xlo, Double_t xhi, const string& varx)
voidSetY(THaVform* vary)
voidSetY(Int_t nbiny, Double_t ylo, Double_t yhi, const string& vary)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
protected:
Int_tBookHisto(Int_t hfirst, Int_t hlast)
Bool_tFindEye(const string& var)
Int_tFindVarSize()
Int_tGetCut(Int_t index = 0)
Int_tParseVar()
private:
THaVhist(const THaVhist& vhist)
THaVhist&operator=(const THaVhist& vhist)

Data Members

public:
enum FEr { kOK
kNoBinX
kIllFox
kIllFoy
kIllCut
kNoX
kAxiSiz
kCutSix
kCutSiy
kUnk
};
protected:
THaVform*fCut
Int_tfEye
Bool_tfFirst
THaVform*fFormX
THaVform*fFormY
vector<TH1*>fH1
Int_tfInitStat
Bool_tfMyCut
Bool_tfMyFormX
Bool_tfMyFormY
stringfName
Int_tfNbinX
Int_tfNbinY
Bool_tfProc
Int_tfScaler
stringfScut
Int_tfSize
stringfTitle
stringfType
stringfVarX
stringfVarY
Double_tfXhi
Double_tfXlo
Double_tfYhi
Double_tfYlo
static const intfgVERBOSE
static const intfgVHIST_HUGE

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

THaVhist(const string& type, const string& name, const string& title)
~THaVhist()
void CheckValidity()
Int_t Init()
 Must be called once at beginning of execution.
 Initializes this vector of histograms.
 Sets up the X, Y, and cuts as THaVforms.
 Checks the dimensionality of this object and
 calls BookHisto() to instantiate the histograms.
 fInitStat is returned.
 fInitStat ==  0  --> all ok
 fInitStat !=0 --> various errors, interpreted
                   with ErrPrint();
void ReAttach()
Bool_t FindEye(const string& var)
 If the variable is "[I]" it is an "Eye" variable.
 This means we will simply use I = 0,1,2, to fill that axis.
Int_t FindVarSize()
 Find the size of this object, according to this logic:
 1) If one of the variables is an "eye" ("[I]") then
    the other variable to determines the eye's size.
 2) If the cut is a scaler, and if one of X or Y is
    a scaler, this histo will be a scaler (i.e. one element).
 3) If neither 1) nor 2), then the size is the size of the
    X component.
 The sizes of X,Y,cuts must obey the rules encoded below.
 Return code:
      1 = size is 1, i.e. a scaler.
    > 1 = size of this vector.
    < 0 = Rules were violated, as follows:
     -1 = No X defined.  Must have at least an X.
     -2 = Inconsistent size of X and Y.
     -3 = Cut size inconsistent with X.
     -4 = Cut size inconsistent with Y.
Int_t BookHisto(Int_t hfirst, Int_t hlast)
 Using ROOT Histogram classes, set up the vector
 of histograms of type fType (th1f, th1d, th2f, th2d)
 for vector indices that run from hfirst to hlast.
Int_t Process()
 Every event must Process() to fill histograms.
 Two cases: This object is either a scaler or a vector.
 If it's a scaler, then we fill one histogram, and if one
 of the variables is an array then all its elements are put
 into that histogram.
 If it's a vector, then (as previously verified) 2 or more
 from among [x, y, cuts] are vectors of same size.  Hence
 fill a vector of histograms with indices running in parallel.
 Also, a vector of histograms can grow in size (up to a
 sensible limit) if the inputs grow in size.
Int_t End()
void ErrPrint() const
void Print() const
void SetX(Int_t nbinx, Double_t xlo, Double_t xhi, const string& varx)
void SetX(THaVform* varx)
void SetY(Int_t nbiny, Double_t ylo, Double_t yhi, const string& vary)
void SetY(THaVform* vary)
void SetCut(const string& cut)
void SetCut(THaVform* cut)
Int_t CheckCut(Int_t index = 0)
 Check the cut.  Returns !=0 if cut condition passed.
THaVhist(const string& type, const string& name, const string& title)
const string& GetVarX() const
{ return fVarX; }
const string& GetVarY() const
{ return fVarY; }
const string& GetCutStr() const
{ return fScut; }
Bool_t HasCut() const
{ return !fScut.empty(); }
Bool_t IsValid() const
 Must Init() once at beginning after various Set()'s
{ return fProc; }
Bool_t IsScaler()
 IsScaler() is kTRUE if histogram is a scaler (which it will then always be)
{ return (fScaler==1); }
Int_t GetSize()
{ return fSize; }
Int_t ParseVar()
Int_t GetCut(Int_t index = 0)
THaVhist& operator=(const THaVhist& vhist)