Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TSelectorDraw.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/treeplayer:$Id$
0002 // Author: Rene Brun   08/01/2003
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TSelectorDraw
0013 #define ROOT_TSelectorDraw
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TSelectorDraw                                                        //
0019 //                                                                      //
0020 // A specialized TSelector for TTree::Draw.                             //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TSelector.h"
0025 
0026 #include <vector>
0027 
0028 class TTreeFormula;
0029 class TTreeFormulaManager;
0030 class TH1;
0031 class TEntryListArray;
0032 
0033 class TSelectorDraw : public TSelector {
0034 
0035 protected:
0036    enum EStatusBits { kWarn = BIT(12) };
0037 
0038    TTree         *fTree;             ///<  Pointer to current Tree
0039    TTreeFormula **fVar;              ///<![fDimension] Array of pointers to variables formula
0040    TTreeFormula  *fSelect;           ///<  Pointer to selection formula
0041    TTreeFormulaManager *fManager;    ///<  Pointer to the formula manager
0042    TObject       *fTreeElist;        ///<  Pointer to Tree Event list
0043    TEntryListArray *fTreeElistArray; ///<! Pointer to Tree Event list array
0044    TH1           *fOldHistogram;     ///<! Pointer to previously used histogram
0045    Int_t          fAction;           ///<! Action type
0046    Long64_t       fDraw;             ///<! Last entry loop number when object was drawn
0047    Int_t          fNfill;            ///<! Total number of histogram fills
0048    Int_t          fMultiplicity;     ///<  Indicator of the variability of the size of entries
0049    Int_t          fDimension;        ///<  Dimension of the current expression
0050    Long64_t       fSelectedRows;     ///<  Number of selected entries
0051    Long64_t       fOldEstimate;      ///<  Value of Tree fEstimate when selector is called
0052    Int_t          fForceRead;        ///<  Force Read flag
0053    Int_t         *fNbins;            ///<![fDimension] Number of bins per dimension
0054    Double_t      *fVmin;             ///<![fDimension] Minima of varexp columns
0055    Double_t      *fVmax;             ///<![fDimension] Maxima of varexp columns
0056    Double_t       fWeight;           ///<  Tree weight (see TTree::SetWeight)
0057    Double_t     **fVal;              ///<![fSelectedRows][fDimension] Local buffer for the variables
0058    Int_t          fValSize;
0059    Double_t      *fW;                ///<![fSelectedRows]Local buffer for weights
0060    bool          *fVarMultiple;      ///<![fDimension] True if fVar[i] has a variable index
0061    bool           fSelectMultiple;   ///<  True if selection has a variable index
0062    bool           fCleanElist;       ///<  True if original Tree elist must be saved
0063    bool           fObjEval;          ///<  True if fVar1 returns an object (or pointer to).
0064    Long64_t       fCurrentSubEntry;  ///<  Current subentry when fSelectMultiple is true. Used to fill TEntryListArray
0065 
0066 protected:
0067    virtual void      ClearFormula();
0068    virtual bool      CompileVariables(const char *varexp="", const char *selection="");
0069    virtual void      InitArrays(Int_t newsize);
0070 
0071 private:
0072    TSelectorDraw(const TSelectorDraw&);             // not implemented
0073    TSelectorDraw& operator=(const TSelectorDraw&);  // not implemented
0074 
0075 public:
0076    TSelectorDraw();
0077    ~TSelectorDraw() override;
0078 
0079    void      Begin(TTree *tree) override;
0080    virtual Int_t     GetAction() const {return fAction;}
0081    virtual bool      GetCleanElist() const {return fCleanElist;}
0082    virtual Int_t     GetDimension() const {return fDimension;}
0083    virtual Long64_t  GetDrawFlag() const {return fDraw;}
0084    TObject          *GetObject() const {return fObject;}
0085    Int_t             GetMultiplicity() const   {return fMultiplicity;}
0086    virtual Int_t     GetNfill() const {return fNfill;}
0087    TH1              *GetOldHistogram() const {return fOldHistogram;}
0088    TTreeFormula     *GetSelect() const    {return fSelect;}
0089    virtual Long64_t  GetSelectedRows() const {return fSelectedRows;}
0090    TTree            *GetTree() const {return fTree;}
0091    TTreeFormula     *GetVar(Int_t i) const;
0092    /// See TSelectorDraw::GetVar
0093    TTreeFormula     *GetVar1() const {return GetVar(0);}
0094    /// See TSelectorDraw::GetVar
0095    TTreeFormula     *GetVar2() const {return GetVar(1);}
0096    /// See TSelectorDraw::GetVar
0097    TTreeFormula     *GetVar3() const {return GetVar(2);}
0098    /// See TSelectorDraw::GetVar
0099    TTreeFormula     *GetVar4() const {return GetVar(3);}
0100    virtual Double_t *GetVal(Int_t i) const;
0101    /// See TSelectorDraw::GetVal
0102    virtual Double_t *GetV1() const   {return GetVal(0);}
0103    /// See TSelectorDraw::GetVal
0104    virtual Double_t *GetV2() const   {return GetVal(1);}
0105    /// See TSelectorDraw::GetVal
0106    virtual Double_t *GetV3() const   {return GetVal(2);}
0107    /// See TSelectorDraw::GetVal
0108    virtual Double_t *GetV4() const   {return GetVal(3);}
0109    virtual Double_t *GetW() const    {return fW;}
0110    bool      Notify() override;
0111    bool      Process(Long64_t /*entry*/) override { return false; }
0112    void      ProcessFill(Long64_t entry) override;
0113    virtual void      ProcessFillMultiple(Long64_t entry);
0114    virtual void      ProcessFillObject(Long64_t entry);
0115    virtual void      SetEstimate(Long64_t n);
0116    virtual UInt_t    SplitNames(const TString &varexp, std::vector<TString> &names);
0117    virtual void      TakeAction();
0118    virtual void      TakeEstimate();
0119    void      Terminate() override;
0120 
0121    ClassDefOverride(TSelectorDraw,1);  //A specialized TSelector for TTree::Draw
0122 };
0123 
0124 #endif