Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:30

0001 // @(#)root/treeplayer:$Id$
0002 // Author: Philippe Canal   20/03/02
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers and al.        *
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_TTreeFormulaManager
0013 #define ROOT_TTreeFormulaManager
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TTreeFormulaManager                                                  //
0019 //                                                                      //
0020 // A class coordinating several TTreeFormula objects.                   //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TObjArray.h"
0025 #include "TTreeFormula.h"
0026 
0027 class TArrayI;
0028 
0029 
0030 class TTreeFormulaManager : public TObject {
0031 private:
0032    TObjArray   fFormulas;
0033    Int_t       fMultiplicity;     ///< Indicator of the variability of the formula
0034    bool        fMultiVarDim;      ///< True if one of the variable has 2 variable size dimensions.
0035    Int_t       fNdata;            ///<! Last value calculated by GetNdata
0036 
0037    //the next line should be: mutable Int_t fCumulUsedSizes[kMAXFORMDIM+1]; See GetNdata()
0038    Int_t       fCumulUsedSizes[kMAXFORMDIM+1];      ///< Accumulated size of lower dimensions as seen for this entry
0039    TArrayI    *fCumulUsedVarDims;                   ///< fCumulUsedSizes(1) for multi variable dimensions case
0040    //the next line should be: mutable Int_t fUsedSizes[kMAXFORMDIM+1]; See GetNdata()
0041    Int_t       fUsedSizes[kMAXFORMDIM+1];           ///< Actual size of the dimensions as seen for this entry.
0042    TArrayI    *fVarDims[kMAXFORMDIM+1];             ///< List of variable sizes dimensions.
0043    Int_t       fVirtUsedSizes[kMAXFORMDIM+1];       ///< Virtual size of lower dimensions as seen for this formula
0044 
0045    bool        fNeedSync;         // Indicate whether a new formula has been added since the last synchronization
0046 
0047    friend class TTreeFormula;
0048 
0049 private:
0050    // Not implemented yet
0051    TTreeFormulaManager(const TTreeFormulaManager&) = delete;
0052    TTreeFormulaManager& operator=(const TTreeFormulaManager&) = delete;
0053 
0054 protected:
0055 
0056    virtual void       AddVarDims(Int_t virt_dim);
0057    virtual void       CancelDimension(Int_t virt_dim);
0058    virtual void       EnableMultiVarDims();
0059    virtual void       UpdateUsedSize(Int_t &virt_dim, Int_t vsize);
0060 
0061 public:
0062    TTreeFormulaManager();
0063    ~TTreeFormulaManager() override;
0064 
0065    virtual void       Add(TTreeFormula*);
0066    virtual Int_t      GetMultiplicity() const {return fMultiplicity;}
0067    virtual Int_t      GetNdata(bool forceLoadDim = false);
0068    bool               Notify() override { UpdateFormulaLeaves(); return true; }
0069    virtual void       Remove(TTreeFormula*);
0070    virtual bool       Sync();
0071    virtual void       UpdateFormulaLeaves();
0072 
0073    ClassDefOverride(TTreeFormulaManager,0) // A class coordinating several TTreeFormula objects.
0074 };
0075 
0076 
0077 #endif // ROOT_TTreeFormulaManager
0078