library: libTreePlayer #include "TSelectorDraw.h"

# TSelectorDraw

class description - source file - inheritance tree (.pdf)

## class TSelectorDraw : public TSelector

| Inheritance Chart:

`TObject`

<-

`TSelector`

<-

`TSelectorDraw`

        protected:

            virtual void ClearFormula()
          virtual Bool_t CompileVariables(const char* varexp = "", const char* selection = "")

        public:

                            TSelectorDraw()
                            TSelectorDraw(const TSelectorDraw&)
                    virtual ~TSelectorDraw()
               virtual void Begin(TTree* tree)
             static TClass* Class()
              virtual Int_t GetAction() const
             virtual Bool_t GetCleanElist() const
              virtual Int_t GetDimension() const
              virtual Int_t GetDrawFlag() const
                      Int_t GetMultiplicity() const
                const char* GetNameByIndex(TString& varexp, Int_t* index, Int_t colindex) const
              virtual Int_t GetNfill() const
                   TObject* GetObject() const
                       TH1* GetOldHistogram() const
              TTreeFormula* GetSelect() const
           virtual Long64_t GetSelectedRows() const
          virtual Double_t* GetV1() const
          virtual Double_t* GetV2() const
          virtual Double_t* GetV3() const
          virtual Double_t* GetV4() const
              TTreeFormula* GetVar1() const
              TTreeFormula* GetVar2() const
              TTreeFormula* GetVar3() const
              TTreeFormula* GetVar4() const
          virtual Double_t* GetW() const
            virtual TClass* IsA() const
               virtual void MakeIndex(TString& varexp, Int_t* index)
             virtual Bool_t Notify()
             TSelectorDraw& operator=(const TSelectorDraw&)
             virtual Bool_t Process(Long64_t)
               virtual void ProcessFill(Long64_t entry)
               virtual void ProcessFillMultiple(Long64_t entry)
               virtual void ProcessFillObject(Long64_t entry)
               virtual void SetEstimate(Long64_t n)
               virtual void ShowMembers(TMemberInspector& insp, char* parent)
               virtual void Streamer(TBuffer& b)
                       void StreamerNVirtual(TBuffer& b)
               virtual void TakeAction()
               virtual void TakeEstimate()
               virtual void Terminate()

### Data Members

        protected:

                        TTree* fTree            Pointer to current Tree
                 TTreeFormula* fVar1            Pointer to first variable formula
                 TTreeFormula* fVar2            Pointer to second variable formula
                 TTreeFormula* fVar3            Pointer to third variable formula
                 TTreeFormula* fVar4            Pointer to fourth variable formula
                 TTreeFormula* fSelect          Pointer to selection formula
          TTreeFormulaManager* fManager         Pointer to the formula manager
                      TObject* fObject          ! Pointer to object being filled (histogram, event list)
                      TObject* fTreeElist       pointer to Tree Event list
                          TH1* fOldHistogram    ! Pointer to previously used histogram
                         Int_t fAction          ! Action type
                      Long64_t fDraw            ! Last entry loop number when object was drawn
                         Int_t fNfill           ! Total number of histogram fills
                         Int_t fMultiplicity    Indicator of the variability of the size of entries
                         Int_t fDimension       Dimension of the current expression
                      Long64_t fSelectedRows    Number of selected entries
                      Long64_t fOldEstimate     value of Tree fEstimate when selector is called
                         Int_t fForceRead       Forec Read flag
                         Int_t fNbins[4]        Number of bins per dimension
                      Double_t fVmin[4]         Minima of varexp columns
                      Double_t fVmax[4]         Maxima of varexp columns
                      Double_t fWeight          Tree weight (see TTree::SetWeight)
                     Double_t* fV1              ![fSelectedRows]Local buffer for variable 1
                     Double_t* fV2              ![fSelectedRows]Local buffer for variable 2
                     Double_t* fV3              ![fSelectedRows]Local buffer for variable 3
                     Double_t* fV4              ![fSelectedRows]Local buffer for variable 4
                     Double_t* fW               ![fSelectedRows]Local buffer for weights
                        Bool_t fVar1Multiple    true if var1 has a variable index
                        Bool_t fVar2Multiple    true if var2 has a variable index
                        Bool_t fVar3Multiple    true if var3 has a variable index
                        Bool_t fVar4Multiple    true if var4 has a variable index
                        Bool_t fSelectMultiple  true if selection has a variable index
                        Bool_t fCleanElist      true if original Tree elist must be saved
                        Bool_t fObjEval         true if fVar1 returns an object (or pointer to).

        public:

          static const enum TSelectorDraw:: kWarn

## Class Description

     TSelectorDraw

TSelectorDraw()

     Default selector constructor.

~TSelectorDraw()

     Selector destructor.

void Begin(TTree *tree)

     Called everytime a loop on the tree(s) starts.

void ClearFormula()

     Delete internal buffers.

Bool_t CompileVariables(const char *varexp, const char *selection)

     Compile input variables and selection expression.

      varexp is an expression of the general form e1:e2:e3
        where e1,etc is a formula referencing a combination of the columns
      Example:
         varexp = x  simplest case: draw a 1-Dim distribution of column named x
                = sqrt(x)         : draw distribution of sqrt(x)
                = x*y/z
                = y:sqrt(x) 2-Dim dsitribution of y versus sqrt(x)

      selection is an expression with a combination of the columns
      Example:
          selection = "x<y && sqrt(z)>3.2"
           in a selection all the C++ operators are authorized

      Return kFALSE if any of the variable is not compilable.

const char* GetNameByIndex(TString &varexp, Int_t *index,Int_t colindex)

     Return name corresponding to colindex in varexp.

     varexp is a string of names separated by :
     index is an array with pointers to the start of name[i] in varexp

void MakeIndex(TString &varexp, Int_t *index)

     Build Index array for names in varexp.

Bool_t Notify()

     This function is called at the first entry of a new tree in a chain.

void ProcessFill(Long64_t entry)

     Called in the entry loop for all entries accepted by Select.

void ProcessFillMultiple(Long64_t /*entry*/)

     Called in the entry loop for all entries accepted by Select.
     Complex case with multiplicity.

void ProcessFillObject(Long64_t /*entry*/)

     Called in the entry loop for all entries accepted by Select.
     Case where the only variable returns an object (or pointer to).

void SetEstimate(Long64_t)

     Set number of entries to estimate variable limits.

void TakeAction()

     Execute action for object obj fNfill times.

void TakeEstimate()

     Estimate limits for 1-D, 2-D or 3-D objects.

void Terminate()

     Called at the end of a loop on a TTree.

### Inline Functions

                     Int_t GetAction() const
                    Bool_t GetCleanElist() const
                     Int_t GetDimension() const
                     Int_t GetDrawFlag() const
                  TObject* GetObject() const
                     Int_t GetMultiplicity() const
                     Int_t GetNfill() const
                      TH1* GetOldHistogram() const
             TTreeFormula* GetSelect() const
                  Long64_t GetSelectedRows() const
             TTreeFormula* GetVar1() const
             TTreeFormula* GetVar2() const
             TTreeFormula* GetVar3() const
             TTreeFormula* GetVar4() const
                 Double_t* GetV1() const
                 Double_t* GetV2() const
                 Double_t* GetV3() const
                 Double_t* GetV4() const
                 Double_t* GetW() const
                    Bool_t Process(Long64_t)
                   TClass* Class()
                   TClass* IsA() const
                      void ShowMembers(TMemberInspector& insp, char* parent)
                      void Streamer(TBuffer& b)
                      void StreamerNVirtual(TBuffer& b)
             TSelectorDraw TSelectorDraw(const TSelectorDraw&)
            TSelectorDraw& operator=(const TSelectorDraw&)

Author: Rene Brun 08/01/2003
Last update: root/treeplayer:$Name: $:$Id: TSelectorDraw.cxx,v 1.51 2005/05/12 07:56:08 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *