ROOT  6.06/09
Reference Guide
TTreeFormulaManager.h
Go to the documentation of this file.
1 // @(#)root/treeplayer:$Id$
2 // Author: Philippe Canal 20/03/02
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers and al. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TTreeFormulaManager
13 #define ROOT_TTreeFormulaManager
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TTreeFormulaManager //
19 // //
20 // A class coordinating several TTreeFormula objects. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #ifndef ROOT_TObjArray
26 #include "TObjArray.h"
27 #endif
28 
29 #include "TTreeFormula.h"
30 
31 class TArrayI;
32 
33 
34 class TTreeFormulaManager : public TObject {
35 private:
37  Int_t fMultiplicity; // Indicator of the variability of the formula
38  Bool_t fMultiVarDim; // True if one of the variable has 2 variable size dimensions.
39  Int_t fNdata; //! Last value calculated by GetNdata
40 
41  //the next line should be: mutable Int_t fCumulUsedSizes[kMAXFORMDIM+1]; See GetNdata()
42  Int_t fCumulUsedSizes[kMAXFORMDIM+1]; //Accumulated size of lower dimensions as seen for this entry
43  TArrayI *fCumulUsedVarDims; //fCumulUsedSizes(1) for multi variable dimensions case
44  //the next line should be: mutable Int_t fUsedSizes[kMAXFORMDIM+1]; See GetNdata()
45  Int_t fUsedSizes[kMAXFORMDIM+1]; //Actual size of the dimensions as seen for this entry.
46  TArrayI *fVarDims[kMAXFORMDIM+1]; //List of variable sizes dimensions.
47  Int_t fVirtUsedSizes[kMAXFORMDIM+1]; //Virtual size of lower dimensions as seen for this formula
48 
49  Bool_t fNeedSync; // Indicate whether a new formula has been added since the last synchronization
50 
51  friend class TTreeFormula;
52 
53 private:
54  // Not implemented yet
57 
58 #if !defined(_MSC_VER) || (_MSC_VER < 1300) || defined(__CINT__)
59  // Deletion is the sole responsability of the TTreeFormulas
61 #endif
62 
63 protected:
64 
65  virtual void AddVarDims(Int_t virt_dim);
66  virtual void CancelDimension(Int_t virt_dim);
67  virtual void EnableMultiVarDims();
68  virtual void UpdateUsedSize(Int_t &virt_dim, Int_t vsize);
69 
70 public:
72 #if _MSC_VER >= 1300
73  // cannot be private due to a bug in VC++7
75 #endif
76 
77  virtual void Add(TTreeFormula*);
78  virtual Int_t GetMultiplicity() const {return fMultiplicity;}
79  virtual Int_t GetNdata(Bool_t forceLoadDim = kFALSE);
80  virtual Bool_t Notify() { UpdateFormulaLeaves(); return kTRUE; }
81  virtual void Remove(TTreeFormula*);
82  virtual Bool_t Sync();
83  virtual void UpdateFormulaLeaves();
84 
85  ClassDef(TTreeFormulaManager,0) // A class coordinating several TTreeFormula objects.
86 };
87 
88 
89 #endif // ROOT_TTreeFormulaManager
90 
Int_t fCumulUsedSizes[kMAXFORMDIM+1]
Last value calculated by GetNdata.
const Int_t kMAXFORMDIM
Definition: TTreeFormula.h:49
An array of TObjects.
Definition: TObjArray.h:39
virtual void Remove(TTreeFormula *)
Remove a formula from this manager.
virtual Bool_t Sync()
Synchronize all the formulae.
virtual void EnableMultiVarDims()
Set the manager as handling a formula with multiple variable dimensions.
TArrayI * fVarDims[kMAXFORMDIM+1]
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void UpdateFormulaLeaves()
This function could be called TTreePlayer::UpdateFormulaLeaves, itself called by TChain::LoadTree whe...
virtual void Add(TTreeFormula *)
Add a new formula to the list of formulas managed The manager of the formula will be changed and the ...
Array of integers (32 bits per element).
Definition: TArrayI.h:29
Int_t fVirtUsedSizes[kMAXFORMDIM+1]
virtual Int_t GetMultiplicity() const
virtual void CancelDimension(Int_t virt_dim)
Cancel a dimension.
Used to coordinate one or more TTreeFormula objects.
#define ClassDef(name, id)
Definition: Rtypes.h:254
~TTreeFormulaManager()
Tree FormulaManager default destructor.
Used to pass a selection expression to the Tree drawing routine.
Definition: TTreeFormula.h:64
virtual Bool_t Notify()
This method must be overridden to handle object notification.
TTreeFormulaManager & operator=(const TTreeFormulaManager &)
virtual void AddVarDims(Int_t virt_dim)
Add a variable dimension.
Int_t fUsedSizes[kMAXFORMDIM+1]
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Int_t GetNdata(Bool_t forceLoadDim=kFALSE)
Return number of available instances in the formulas.
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void UpdateUsedSize(Int_t &virt_dim, Int_t vsize)
Reload the array sizes.