ROOT
6.07/01
Reference Guide
|
Used to pass a selection expression to the Tree drawing routine.
See TTree::Draw
A TreeFormula can contain any arithmetic expression including standard operators and mathematical functions separated by operators. Examples of valid expression:
TTreeFormula now relies on a variety of TFormLeafInfo classes to handle the reading of the information. Here is the list of theses classes:
The following method are available from the TFormLeafInfo interface:
Definition at line 64 of file TTreeFormula.h.
Public Member Functions | |
TTreeFormula () | |
TTreeFormula (const char *name, const char *formula, TTree *tree) | |
Normal TTree Formula Constuctor. More... | |
virtual | ~TTreeFormula () |
Tree Formula default destructor. More... | |
virtual Int_t | DefinedVariable (TString &variable, Int_t &action) |
Check if name is in the list of Tree/Branch leaves. More... | |
virtual TClass * | EvalClass () const |
Evaluate the class of this treeformula. More... | |
template<typename T > | |
T | EvalInstance (Int_t i=0, const char *stringStack[]=0) |
Evaluate this treeformula. More... | |
virtual Double_t | EvalInstance (Int_t i=0, const char *stringStack[]=0) |
virtual Long64_t | EvalInstance64 (Int_t i=0, const char *stringStack[]=0) |
virtual LongDouble_t | EvalInstanceLD (Int_t i=0, const char *stringStack[]=0) |
virtual const char * | EvalStringInstance (Int_t i=0) |
Eval the instance as a string. More... | |
virtual void * | EvalObject (Int_t i=0) |
Evaluate this treeformula. More... | |
TFormLeafInfo * | GetLeafInfo (Int_t code) const |
Return DataMember corresponding to code. More... | |
TTreeFormulaManager * | GetManager () const |
TMethodCall * | GetMethodCall (Int_t code) const |
Return methodcall corresponding to code. More... | |
virtual Int_t | GetMultiplicity () const |
virtual TLeaf * | GetLeaf (Int_t n) const |
Return leaf corresponding to serial number n. More... | |
virtual Int_t | GetNcodes () const |
virtual Int_t | GetNdata () |
Return number of available instances in the formula. More... | |
virtual Bool_t | IsInteger (Bool_t fast=kTRUE) const |
Return TRUE if the formula corresponds to one single Tree leaf and this leaf is short, int or unsigned short, int When a leaf is of type integer or string, the generated histogram is forced to have an integer bin width. More... | |
Bool_t | IsQuickLoad () const |
virtual Bool_t | IsString () const |
Return TRUE if the formula is a string. More... | |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification. More... | |
virtual char * | PrintValue (Int_t mode=0) const |
Return value of variable as a string. More... | |
virtual char * | PrintValue (Int_t mode, Int_t instance, const char *decform="9.9") const |
Return value of variable as a string. More... | |
virtual void | SetAxis (TAxis *axis=0) |
Set the axis (in particular get the type). More... | |
void | SetQuickLoad (Bool_t quick) |
virtual void | SetTree (TTree *tree) |
virtual void | ResetLoading () |
Tell the formula that we are going to request a new entry. More... | |
virtual TTree * | GetTree () const |
virtual void | UpdateFormulaLeaves () |
This function is called TTreePlayer::UpdateFormulaLeaves, itself called by TChain::LoadTree when a new Tree is loaded. More... | |
template<> | |
LongDouble_t | GetConstant (Int_t k) |
template<> | |
Long64_t | GetConstant (Int_t k) |
Public Member Functions inherited from ROOT::v5::TFormula | |
TFormula () | |
TFormula (const char *name, const char *formula) | |
TFormula (const TFormula &formula) | |
TFormula & | operator= (const TFormula &rhs) |
virtual | ~TFormula () |
void | Optimize () |
virtual void | Analyze (const char *schain, Int_t &err, Int_t offset=0) |
virtual Bool_t | AnalyzeFunction (TString &chaine, Int_t &err, Int_t offset=0) |
virtual Int_t | Compile (const char *expression="") |
virtual void | Copy (TObject &formula) const |
Copy this to obj. More... | |
virtual void | Clear (Option_t *option="") |
Set name and title to empty strings (""). More... | |
virtual char * | DefinedString (Int_t code) |
virtual Double_t | DefinedValue (Int_t code) |
virtual Double_t | Eval (Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const |
virtual Double_t | EvalParOld (const Double_t *x, const Double_t *params=0) |
virtual Double_t | EvalPar (const Double_t *x, const Double_t *params=0) |
virtual const TObject * | GetLinearPart (Int_t i) |
virtual Int_t | GetNdim () const |
virtual Int_t | GetNpar () const |
virtual Int_t | GetNumber () const |
virtual TString | GetExpFormula (Option_t *option="") const |
Double_t | GetParameter (Int_t ipar) const |
Double_t | GetParameter (const char *name) const |
virtual Double_t * | GetParameters () const |
virtual void | GetParameters (Double_t *params) |
virtual const char * | GetParName (Int_t ipar) const |
virtual Int_t | GetParNumber (const char *name) const |
virtual Bool_t | IsLinear () const |
virtual Bool_t | IsNormalized () const |
virtual void | Print (Option_t *option="") const |
Print TNamed name and title. More... | |
virtual void | ProcessLinear (TString &replaceformula) |
virtual void | SetNumber (Int_t number) |
virtual void | SetParameter (const char *name, Double_t parvalue) |
virtual void | SetParameter (Int_t ipar, Double_t parvalue) |
virtual void | SetParameters (const Double_t *params) |
virtual void | SetParameters (Double_t p0, Double_t p1, Double_t p2=0, Double_t p3=0, Double_t p4=0, Double_t p5=0, Double_t p6=0, Double_t p7=0, Double_t p8=0, Double_t p9=0, Double_t p10=0) |
virtual void | SetParName (Int_t ipar, const char *name) |
virtual void | SetParNames (const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10") |
virtual void | Update () |
void | Streamer (TBuffer &b, const TClass *onfile_class) |
void | Streamer (TBuffer &b, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class=0) |
Public Member Functions inherited from TNamed | |
TNamed () | |
TNamed (const char *name, const char *title) | |
TNamed (const TString &name, const TString &title) | |
TNamed (const TNamed &named) | |
TNamed & | operator= (const TNamed &rhs) |
TNamed assignment operator. More... | |
virtual | ~TNamed () |
virtual TObject * | Clone (const char *newname="") const |
Make a clone of an object using the Streamer facility. More... | |
virtual Int_t | Compare (const TObject *obj) const |
Compare two TNamed objects. More... | |
virtual void | FillBuffer (char *&buffer) |
Encode TNamed into output buffer. More... | |
virtual const char * | GetName () const |
Returns name of object. More... | |
virtual const char * | GetTitle () const |
Returns title of object. More... | |
virtual ULong_t | Hash () const |
Return hash value for this object. More... | |
virtual Bool_t | IsSortable () const |
virtual void | SetName (const char *name) |
Change (i.e. More... | |
virtual void | SetNameTitle (const char *name, const char *title) |
Change (i.e. set) all the TNamed parameters (name and title). More... | |
virtual void | SetTitle (const char *title="") |
Change (i.e. set) the title of the TNamed. More... | |
virtual void | ls (Option_t *option="") const |
List TNamed name and title. More... | |
virtual Int_t | Sizeof () const |
Return size of the TNamed part of the TObject. More... | |
Public Member Functions inherited from TObject | |
TObject () | |
TObject (const TObject &object) | |
TObject copy ctor. More... | |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. More... | |
virtual | ~TObject () |
TObject destructor. More... | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. More... | |
virtual void | Browse (TBrowser *b) |
Browse object. May be overridden for another default action. More... | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. More... | |
virtual void | Delete (Option_t *option="") |
Delete this object. More... | |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
Computes distance from point (px,py) to the object. More... | |
virtual void | Draw (Option_t *option="") |
Default Draw method for all objects. More... | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. More... | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current pad. More... | |
virtual void | Dump () const |
Dump contents of object on stdout. More... | |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
Execute method on this object with the given parameter string, e.g. More... | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
Execute method on this object with parameters stored in the TObjArray. More... | |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
Execute action corresponding to an event at (px,py). More... | |
virtual TObject * | FindObject (const char *name) const |
Must be redefined in derived classes. More... | |
virtual TObject * | FindObject (const TObject *obj) const |
Must be redefined in derived classes. More... | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. More... | |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. More... | |
virtual const char * | GetIconName () const |
Returns mime type name of object. More... | |
virtual Option_t * | GetOption () const |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
Returns string containing info about the object at position (px,py). More... | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. More... | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". More... | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. More... | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. More... | |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More... | |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). More... | |
Bool_t | IsOnHeap () const |
Bool_t | IsZombie () const |
virtual void | Paint (Option_t *option="") |
This method must be overridden if a class wants to paint itself. More... | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. More... | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. More... | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove this object from a list. More... | |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. More... | |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save a primitive as a C++ statement(s) on output stream "out". More... | |
virtual void | SetDrawOption (Option_t *option="") |
Set drawing option for object. More... | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. More... | |
virtual void | UseCurrentStyle () |
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. More... | |
void * | operator new (size_t sz) |
void * | operator new[] (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz, void *vp) |
void | operator delete (void *ptr) |
Operator delete. More... | |
void | operator delete[] (void *ptr) |
Operator delete []. More... | |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. More... | |
void | SetBit (UInt_t f) |
void | ResetBit (UInt_t f) |
Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
void | InvertBit (UInt_t f) |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. More... | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. More... | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. More... | |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. More... | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. More... | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. More... | |
void | MayNotUse (const char *method) const |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More... | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. More... | |
Protected Types | |
enum | { kIsCharacter = BIT(12), kMissingLeaf = BIT(15), kIsInteger = BIT(17), kNeedEntries = BIT(18) } |
enum | { kDirect, kDataMember, kMethod, kIndexOfEntry, kEntries, kLength, kIteration, kLengthFunc, kSum, kEntryList, kTreeMember, kIndexOfLocalEntry, kMin, kMax } |
enum | { kAlias = 200, kAliasString = 201, kAlternate = 202, kAlternateString = 203, kMinIf = 204, kMaxIf = 205 } |
Protected Types inherited from ROOT::v5::TFormula | |
enum | { kEnd = 0, kAdd = 1, kSubstract = 2, kMultiply = 3, kDivide = 4, kModulo = 5, kcos = 10, ksin = 11, ktan = 12, kacos = 13, kasin = 14, katan = 15, katan2 = 16, kfmod = 17, kpow = 20, ksq = 21, ksqrt = 22, kstrstr = 23, kmin = 24, kmax = 25, klog = 30, kexp = 31, klog10 = 32, kpi = 40, kabs = 41, ksign = 42, kint = 43, kSignInv = 44, krndm = 50, kAnd = 60, kOr = 61, kEqual = 62, kNotEqual = 63, kLess = 64, kGreater = 65, kLessThan = 66, kGreaterThan = 67, kNot = 68, kcosh = 70, ksinh = 71, ktanh = 72, kacosh = 73, kasinh = 74, katanh = 75, kStringEqual = 76, kStringNotEqual = 77, kBitAnd = 78, kBitOr = 79, kLeftShift = 80, kRightShift = 81, kJumpIf = 82, kJump = 83, kexpo = 100, kxexpo = 100, kyexpo = 101, kzexpo = 102, kxyexpo = 105, kgaus = 110, kxgaus = 110, kygaus = 111, kzgaus = 112, kxygaus = 115, klandau = 120, kxlandau = 120, kylandau = 121, kzlandau = 122, kxylandau = 125, kpol = 130, kxpol = 130, kypol = 131, kzpol = 132, kParameter = 140, kConstant = 141, kBoolOptimize = 142, kStringConst = 143, kVariable = 144, kFunctionCall = 145, kData = 146, kUnary = 147, kBinary = 148, kThree = 149, kDefinedVariable = 150, kDefinedString = 151, kPlusD = 152, kPlusDD = 153, kMultD = 154, kMultDD = 155, kBoolOptimizeOr = 156, kBoolOptimizeAnd = 157, kBoolSet = 158, kFDM = 159, kFD0 = 160, kFD1 = 161, kFD2 = 162, kFD3 = 163 } |
typedef Double_t(TObject::* | TFuncG )(const Double_t *, const Double_t *) const |
Protected Member Functions | |
TTreeFormula (const char *name, const char *formula, TTree *tree, const std::vector< std::string > &aliases) | |
Constructor used during the expansion of an alias. More... | |
void | Init (const char *name, const char *formula) |
Initialiation called from the constructors. More... | |
Bool_t | BranchHasMethod (TLeaf *leaf, TBranch *branch, const char *method, const char *params, Long64_t readentry) const |
Return the leaf (if any) of the tree with contains an object of a class having a method which has the name provided in the argument. More... | |
Int_t | DefineAlternate (const char *expression) |
This method check for treat the case where expression contains $Atl and load up both fAliases and fExpr. More... | |
void | DefineDimensions (Int_t code, Int_t size, TFormLeafInfoMultiVarDim *info, Int_t &virt_dim) |
This method is used internally to decode the dimensions of the variables. More... | |
Int_t | FindLeafForExpression (const char *expression, TLeaf *&leaf, TString &leftover, Bool_t &final, UInt_t ¶n_level, TObjArray &castqueue, std::vector< std::string > &aliasUsed, Bool_t &useLeafCollectionObject, const char *fullExpression) |
Look for the leaf corresponding to the start of expression. More... | |
TLeaf * | GetLeafWithDatamember (const char *topchoice, const char *nextchice, Long64_t readentry) const |
Return the leaf (if any) which contains an object containing a data member which has the name provided in the arguments. More... | |
Int_t | ParseWithLeaf (TLeaf *leaf, const char *expression, Bool_t final, UInt_t paran_level, TObjArray &castqueue, Bool_t useLeafCollectionObject, const char *fullExpression) |
Decompose 'expression' as pointing to something inside the leaf Returns: More... | |
Int_t | RegisterDimensions (Int_t code, Int_t size, TFormLeafInfoMultiVarDim *multidim=0) |
This method stores the dimension information for later usage. More... | |
Int_t | RegisterDimensions (Int_t code, TBranchElement *branch) |
This method is used internally to decode the dimensions of the variables. More... | |
Int_t | RegisterDimensions (Int_t code, TFormLeafInfo *info, TFormLeafInfo *maininfo, Bool_t useCollectionObject) |
This method is used internally to decode the dimensions of the variables. More... | |
Int_t | RegisterDimensions (Int_t code, TLeaf *leaf) |
This method is used internally to decode the dimensions of the variables. More... | |
Int_t | RegisterDimensions (const char *size, Int_t code) |
This method is used internally to decode the dimensions of the variables. More... | |
virtual Double_t | GetValueFromMethod (Int_t i, TLeaf *leaf) const |
Return result of a leafobject method. More... | |
virtual void * | GetValuePointerFromMethod (Int_t i, TLeaf *leaf) const |
Return result of a leafobject method. More... | |
Int_t | GetRealInstance (Int_t instance, Int_t codeindex) |
Now let calculate what physical instance we really need. More... | |
void | LoadBranches () |
Make sure that all the branches have been loaded properly. More... | |
Bool_t | LoadCurrentDim () |
Calculate the actual dimension for the current entry. More... | |
void | ResetDimensions () |
Populate the TTreeFormulaManager with the dimension information. More... | |
virtual TClass * | EvalClass (Int_t oper) const |
Evaluate the class of the operation oper. More... | |
virtual Bool_t | IsLeafInteger (Int_t code) const |
Return TRUE if the leaf corresponding to code is short, int or unsigned short, int When a leaf is of type integer, the generated histogram is forced to have an integer bin width. More... | |
virtual Bool_t | IsString (Int_t oper) const |
Return true if the expression at the index 'oper' is to be treated as as string. More... | |
virtual Bool_t | IsLeafString (Int_t code) const |
Return TRUE if the leaf or data member corresponding to code is a string. More... | |
virtual Bool_t | SwitchToFormLeafInfo (Int_t code) |
Convert the underlying lookup method from the direct technique (dereferencing the address held by the branch) to the method using TFormLeafInfo. More... | |
virtual Bool_t | StringToNumber (Int_t code) |
Try to 'demote' a string into an array bytes. More... | |
void | Convert (UInt_t fromVersion) |
Protected Member Functions inherited from ROOT::v5::TFormula | |
Int_t | PreCompile () |
pointer to optimal function More... | |
virtual Bool_t | CheckOperands (Int_t operation, Int_t &err) |
virtual Bool_t | CheckOperands (Int_t leftoperand, Int_t rightoperartion, Int_t &err) |
void | MakePrimitive (const char *expr, Int_t pos) |
Int_t * | GetOper () const |
Short_t | GetAction (Int_t code) const |
Int_t | GetActionParam (Int_t code) const |
void | SetAction (Int_t code, Int_t value, Int_t param=0) |
Int_t * | GetOperOptimized () const |
Short_t | GetActionOptimized (Int_t code) const |
Int_t | GetActionParamOptimized (Int_t code) const |
void | SetActionOptimized (Int_t code, Int_t value, Int_t param=0) |
void | ClearFormula (Option_t *option="") |
Double_t | EvalParFast (const Double_t *x, const Double_t *params) |
Double_t | EvalPrimitive (const Double_t *x, const Double_t *params) |
Double_t | EvalPrimitive0 (const Double_t *x, const Double_t *params) |
Double_t | EvalPrimitive1 (const Double_t *x, const Double_t *params) |
Double_t | EvalPrimitive2 (const Double_t *x, const Double_t *params) |
Double_t | EvalPrimitive3 (const Double_t *x, const Double_t *params) |
Double_t | EvalPrimitive4 (const Double_t *x, const Double_t *params) |
Protected Member Functions inherited from TObject | |
void | MakeZombie () |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). More... | |
Protected Attributes | |
TTree * | fTree |
Int_t | fCodes [kMAXCODES] |
pointer to Tree More... | |
Int_t | fNdata [kMAXCODES] |
Int_t | fNcodes |
This caches the physical number of element in the leaf or datamember. More... | |
Bool_t | fHasCast |
Int_t | fMultiplicity |
Int_t | fNindex |
Int_t * | fLookupType |
TObjArray | fLeaves |
TObjArray | fDataMembers |
List of leaf used in this formula. More... | |
TObjArray | fMethods |
List of leaf data members. More... | |
TObjArray | fExternalCuts |
List of leaf method calls. More... | |
TObjArray | fAliases |
List of TCutG and TEntryList used in the formula. More... | |
TObjArray | fLeafNames |
List of TTreeFormula for each alias used. More... | |
TObjArray | fBranches |
Bool_t | fQuickLoad |
List of branches to read. Similar to fLeaces but duplicates are zeroed out. More... | |
Bool_t | fNeedLoading |
If true, branch GetEntry is only called when the entry number changes. More... | |
Int_t | fNdimensions [kMAXCODES] |
If true, the current entry has not been loaded yet. More... | |
Int_t | fFixedSizes [kMAXCODES][kMAXFORMDIM] |
UChar_t | fHasMultipleVarDim [kMAXCODES] |
Int_t | fCumulSizes [kMAXCODES][kMAXFORMDIM] |
Int_t | fIndexes [kMAXCODES][kMAXFORMDIM] |
TTreeFormula * | fVarIndexes [kMAXCODES][kMAXFORMDIM] |
TAxis * | fAxis |
Bool_t | fDidBooleanOptimization |
pointer to histogram axis if this is a string More... | |
TTreeFormulaManager * | fManager |
True if we executed one boolean optimization since the last time instance number 0 was evaluated. More... | |
TList * | fDimensionSetup |
The dimension coordinator. More... | |
std::vector< std::string > | fAliasesUsed |
list of dimension setups, for delayed creation of the dimension information. More... | |
LongDouble_t * | fConstLD |
List of aliases used during the parsing of the expression. More... | |
Protected Attributes inherited from ROOT::v5::TFormula | |
Int_t | fNdim |
Int_t | fNpar |
Int_t | fNoper |
Int_t | fNconst |
Int_t | fNumber |
Int_t | fNval |
Int_t | fNstring |
TString * | fExpr |
Double_t * | fConst |
Double_t * | fParams |
TString * | fNames |
TObjArray | fFunctions |
TObjArray | fLinearParts |
TBits | fAlreadyFound |
Int_t | fNOperOptimized |
cache for information More... | |
TString * | fExprOptimized |
Number of operators after optimization. More... | |
Int_t * | fOperOptimized |
[fNOperOptimized] List of expressions More... | |
TOperOffset * | fOperOffset |
[fNOperOptimized] List of operators. (See documentation for changes made at version 7) More... | |
TFormulaPrimitive ** | fPredefined |
[fNOperOptimized] Offsets of operrands More... | |
TFuncG | fOptimal |
[fNPar] predefined function More... | |
Protected Attributes inherited from TNamed | |
TString | fName |
TString | fTitle |
Private Member Functions | |
TTreeFormula (const TTreeFormula &) | |
TTreeFormula & | operator= (const TTreeFormula &) |
template<typename T > | |
T | GetConstant (Int_t k) |
Friends | |
class | TTreeFormulaManager |
Additional Inherited Members | |
Public Types inherited from ROOT::v5::TFormula | |
enum | { kNotGlobal = BIT(10), kNormalized = BIT(14), kLinear = BIT(16) } |
Public Types inherited from TObject | |
enum | EStatusBits { kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4), kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13) } |
enum | { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff } |
enum | { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) } |
Static Public Member Functions inherited from ROOT::v5::TFormula | |
static void | SetMaxima (Int_t maxop=1000, Int_t maxpar=1000, Int_t maxconst=1000) |
static void | GetMaxima (Int_t &maxop, Int_t &maxpar, Int_t &maxconst) |
Static Public Member Functions inherited from TObject | |
static Long_t | GetDtorOnly () |
Return destructor only flag. More... | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. More... | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. More... | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. More... | |
#include <TTreeFormula.h>
|
protected |
Enumerator | |
---|---|
kIsCharacter | |
kMissingLeaf | |
kIsInteger | |
kNeedEntries |
Definition at line 69 of file TTreeFormula.h.
|
protected |
Enumerator | |
---|---|
kDirect | |
kDataMember | |
kMethod | |
kIndexOfEntry | |
kEntries | |
kLength | |
kIteration | |
kLengthFunc | |
kSum | |
kEntryList | |
kTreeMember | |
kIndexOfLocalEntry | |
kMin | |
kMax |
Definition at line 75 of file TTreeFormula.h.
|
protected |
Enumerator | |
---|---|
kAlias | |
kAliasString | |
kAlternate | |
kAlternateString | |
kMinIf | |
kMaxIf |
Definition at line 83 of file TTreeFormula.h.
|
protected |
Constructor used during the expansion of an alias.
Definition at line 168 of file TTreeFormula.cxx.
|
private |
TTreeFormula::TTreeFormula | ( | ) |
Definition at line 125 of file TTreeFormula.cxx.
Referenced by DefineAlternate(), and DefinedVariable().
TTreeFormula::TTreeFormula | ( | const char * | name, |
const char * | formula, | ||
TTree * | tree | ||
) |
Normal TTree Formula Constuctor.
Definition at line 158 of file TTreeFormula.cxx.
|
virtual |
Tree Formula default destructor.
Definition at line 325 of file TTreeFormula.cxx.
|
protected |
Return the leaf (if any) of the tree with contains an object of a class having a method which has the name provided in the argument.
Definition at line 3206 of file TTreeFormula.cxx.
Referenced by FindLeafForExpression().
Reimplemented from ROOT::v5::TFormula.
Definition at line 5562 of file TTreeFormula.cxx.
|
protected |
This method check for treat the case where expression contains $Atl and load up both fAliases and fExpr.
We return:
Definition at line 654 of file TTreeFormula.cxx.
Referenced by DefinedVariable().
|
protected |
This method is used internally to decode the dimensions of the variables.
Definition at line 357 of file TTreeFormula.cxx.
Referenced by ResetDimensions().
Check if name is in the list of Tree/Branch leaves.
This member function redefines the function in ROOT::v5::TFormula If a leaf has a name corresponding to the argument name, then returns a new code.
A TTreeFormula may contain more than one variable. For each variable referenced, the pointers to the corresponding branch and leaf is stored in the object arrays fBranches and fLeaves.
name can be :
New additions:
'.' can be replaced by '->'
and
The expected returns values are
Reimplemented from ROOT::v5::TFormula.
Definition at line 2674 of file TTreeFormula.cxx.
Evaluate the class of the operation oper.
If the 'value' in the requested operation is a simple pointer to an object, this function returns the TClass corresponding to its type.
Definition at line 3565 of file TTreeFormula.cxx.
Referenced by TSelectorDraw::CompileVariables(), and TSelectorDraw::ProcessFillObject().
|
virtual |
Evaluate the class of this treeformula.
If the 'value' of this formula is a simple pointer to an object, this function returns the TClass corresponding to its type.
Definition at line 3552 of file TTreeFormula.cxx.
Referenced by IsInteger(), and ParseWithLeaf().
Evaluate this treeformula.
Definition at line 3913 of file TTreeFormula.cxx.
Referenced by TSpider::AddVariable(), TMVA::DataSetFactory::BuildEventVector(), TMultiLayerPerceptron::ComputeDEDw(), TTreePlayer::CopyTree(), EvalInstance(), EvalStringInstance(), FindMax(), FindMin(), TMLPAnalyzer::GatherInformations(), TNeuron::GetBranch(), TTreeIndex::GetEntryNumberFriend(), TChainIndex::GetEntryNumberFriend(), TMultiLayerPerceptron::GetError(), GetRealInstance(), TTreeTableInterface::GetValue(), TTreeTableInterface::GetValueAsString(), TSpider::InitVariables(), TMVA::MethodCategory::PassesCut(), TTreePlayer::Principal(), PrintValue(), TSelectorEntries::Process(), TSelectorDraw::ProcessFill(), TSelectorDraw::ProcessFillMultiple(), TSelectorDraw::ProcessFillObject(), TTreePlayer::Query(), TTreePlayer::Scan(), TSpider::SetCurrentEntries(), TSPlot::SetTreeSelection(), Summing(), and TTreeIndex::TTreeIndex().
|
inlinevirtual |
Definition at line 176 of file TTreeFormula.h.
|
inlinevirtual |
Definition at line 177 of file TTreeFormula.h.
|
inlinevirtual |
Definition at line 178 of file TTreeFormula.h.
Evaluate this treeformula.
Return the address of the object pointed to by the formula. Return 0 if the formula is not a single object The object type can be retrieved using by call EvalClass();
Definition at line 3614 of file TTreeFormula.cxx.
Referenced by TSelectorDraw::ProcessFillObject().
|
virtual |
Eval the instance as a string.
Definition at line 3664 of file TTreeFormula.cxx.
Referenced by EvalInstance(), and TTreeTableInterface::GetValueAsString().
|
protected |
Look for the leaf corresponding to the start of expression.
It returns the corresponding leaf if any. It also modify the following arguments:
Definition at line 2164 of file TTreeFormula.cxx.
Referenced by DefinedVariable().
Definition at line 3886 of file TTreeFormula.cxx.
|
inline |
Definition at line 3887 of file TTreeFormula.cxx.
Definition at line 3907 of file TTreeFormula.cxx.
Return leaf corresponding to serial number n.
Definition at line 4378 of file TTreeFormula.cxx.
Referenced by ROOT::Internal::TTreeProxyGenerator::AnalyzeElement(), TMVA::DataSetFactory::ChangeToNewTree(), TMVA::DataSetFactory::CheckTTreeFormula(), and THbookFile::InitLeaves().
TFormLeafInfo * TTreeFormula::GetLeafInfo | ( | Int_t | code | ) | const |
Return DataMember corresponding to code.
function called by TLeafObject::GetValue with the value of fLookupType computed in TTreeFormula::DefinedVariable
Definition at line 4369 of file TTreeFormula.cxx.
Referenced by ROOT::Internal::TTreeProxyGenerator::AnalyzeElement(), EvalInstance(), EvalStringInstance(), IsLeafInteger(), IsLeafString(), PrintValue(), ResetDimensions(), and UpdateFormulaLeaves().
|
protected |
Return the leaf (if any) which contains an object containing a data member which has the name provided in the arguments.
Definition at line 3040 of file TTreeFormula.cxx.
Referenced by FindLeafForExpression().
|
inline |
Definition at line 184 of file TTreeFormula.h.
Referenced by DefineAlternate(), LoadCurrentDim(), TTreePlayer::Scan(), TTreeTableInterface::SyncFormulas(), and TSpider::SyncFormulas().
TMethodCall * TTreeFormula::GetMethodCall | ( | Int_t | code | ) | const |
Return methodcall corresponding to code.
function called by TLeafObject::GetValue with the value of fLookupType computed in TTreeFormula::DefinedVariable
Definition at line 4389 of file TTreeFormula.cxx.
Referenced by GetValueFromMethod(), and GetValuePointerFromMethod().
|
inlinevirtual |
Definition at line 186 of file TTreeFormula.h.
Referenced by TSelectorDraw::Begin(), DefineDimensions(), TMultiLayerPerceptron::ExpandStructure(), LoadCurrentDim(), ResetDimensions(), TSelectorEntries::SlaveBegin(), and TTreeFormulaManager::Sync().
|
inlinevirtual |
Definition at line 188 of file TTreeFormula.h.
Referenced by TMVA::DataSetFactory::ChangeToNewTree(), TMVA::DataSetFactory::CheckTTreeFormula(), and THbookFile::InitLeaves().
|
virtual |
Return number of available instances in the formula.
Definition at line 4398 of file TTreeFormula.cxx.
Referenced by TSpider::AddVariable(), TMVA::DataSetFactory::BuildEventVector(), TMVA::DataSetFactory::CheckTTreeFormula(), TTreePlayer::CopyTree(), DefineDimensions(), EvalInstance(), TMultiLayerPerceptron::ExpandStructure(), FindMax(), FindMin(), TSpider::InitVariables(), LoadCurrentDim(), TSelectorEntries::Process(), TTreePlayer::Query(), TTreePlayer::Scan(), TSpider::SetCurrentEntries(), Summing(), and TNeuron::UseBranch().
Now let calculate what physical instance we really need.
Some redundant code is used to speed up the cases where they are no dimensions.
We know that instance is less that fCumulUsedSize[0] so we can skip the modulo when virt_dim is 0.
Definition at line 3326 of file TTreeFormula.cxx.
Referenced by EvalInstance(), EvalObject(), EvalStringInstance(), and GetRealInstance().
|
inlinevirtual |
Definition at line 205 of file TTreeFormula.h.
Referenced by TTreeIndex::GetMajorFormulaParent(), TChainIndex::GetMajorFormulaParent(), TTreeIndex::GetMinorFormulaParent(), and TChainIndex::GetMinorFormulaParent().
Return result of a leafobject method.
Definition at line 4406 of file TTreeFormula.cxx.
Referenced by EvalInstance().
Return result of a leafobject method.
Definition at line 4467 of file TTreeFormula.cxx.
Referenced by EvalObject().
|
protected |
Initialiation called from the constructors.
Definition at line 179 of file TTreeFormula.cxx.
Referenced by TTreeFormula().
Return TRUE if the formula corresponds to one single Tree leaf and this leaf is short, int or unsigned short, int When a leaf is of type integer or string, the generated histogram is forced to have an integer bin width.
Definition at line 4536 of file TTreeFormula.cxx.
Referenced by TTreePlayer::DrawSelect(), Init(), IsInteger(), and SetAxis().
Return TRUE if the leaf corresponding to code is short, int or unsigned short, int When a leaf is of type integer, the generated histogram is forced to have an integer bin width.
Definition at line 4590 of file TTreeFormula.cxx.
Referenced by IsInteger().
Return TRUE if the leaf or data member corresponding to code is a string.
Definition at line 4659 of file TTreeFormula.cxx.
Referenced by IsInteger(), and ParseWithLeaf().
|
inline |
Definition at line 196 of file TTreeFormula.h.
Return true if the expression at the index 'oper' is to be treated as as string.
Reimplemented from ROOT::v5::TFormula.
Definition at line 4647 of file TTreeFormula.cxx.
Referenced by DefineAlternate(), DefinedVariable(), TTreeTableInterface::GetValue(), TTreeTableInterface::GetValueAsString(), Init(), and TGL5DDataSet::TGL5DDataSet().
|
virtual |
Return TRUE if the formula is a string.
Definition at line 4637 of file TTreeFormula.cxx.
Referenced by EvalStringInstance(), Init(), PrintValue(), and SetAxis().
|
protected |
Make sure that all the branches have been loaded properly.
Definition at line 5270 of file TTreeFormula.cxx.
Referenced by GetRealInstance(), and LoadBranches().
|
protected |
Calculate the actual dimension for the current entry.
Definition at line 5294 of file TTreeFormula.cxx.
Referenced by TTreeFormulaManager::GetNdata().
|
inlinevirtual |
This method must be overridden to handle object notification.
Reimplemented from TObject.
Definition at line 198 of file TTreeFormula.h.
|
private |
|
protected |
Decompose 'expression' as pointing to something inside the leaf Returns:
Definition at line 761 of file TTreeFormula.cxx.
Referenced by DefinedVariable().
|
virtual |
Return value of variable as a string.
Definition at line 4737 of file TTreeFormula.cxx.
Referenced by TTreePlayer::Query(), and TTreePlayer::Scan().
|
virtual |
Return value of variable as a string.
mode = 0 : Print column values
decform contains the requested format (with the same convention as printf).
Definition at line 4751 of file TTreeFormula.cxx.
|
protected |
This method stores the dimension information for later usage.
Definition at line 436 of file TTreeFormula.cxx.
Referenced by ParseWithLeaf(), and RegisterDimensions().
|
protected |
This method is used internally to decode the dimensions of the variables.
Definition at line 552 of file TTreeFormula.cxx.
|
protected |
This method is used internally to decode the dimensions of the variables.
Definition at line 447 of file TTreeFormula.cxx.
This method is used internally to decode the dimensions of the variables.
Definition at line 580 of file TTreeFormula.cxx.
This method is used internally to decode the dimensions of the variables.
Definition at line 399 of file TTreeFormula.cxx.
|
protected |
Populate the TTreeFormulaManager with the dimension information.
Definition at line 5088 of file TTreeFormula.cxx.
Referenced by TTreeFormulaManager::Sync().
|
virtual |
Tell the formula that we are going to request a new entry.
Definition at line 4892 of file TTreeFormula.cxx.
Referenced by TSelectorDraw::ProcessFillMultiple(), and ResetLoading().
Set the axis (in particular get the type).
Definition at line 4920 of file TTreeFormula.cxx.
Referenced by TSelectorDraw::Begin(), and SetAxis().
Definition at line 202 of file TTreeFormula.h.
Referenced by TSelectorDraw::CompileVariables(), TProofDraw::CompileVariables(), TTreeIndex::GetMajorFormula(), TTreeIndex::GetMajorFormulaParent(), TChainIndex::GetMajorFormulaParent(), TTreeIndex::GetMinorFormula(), TTreeIndex::GetMinorFormulaParent(), TChainIndex::GetMinorFormulaParent(), and TSelectorEntries::SlaveBegin().
Definition at line 203 of file TTreeFormula.h.
Referenced by TTreeIndex::GetMajorFormulaParent(), TChainIndex::GetMajorFormulaParent(), TTreeIndex::GetMinorFormulaParent(), TChainIndex::GetMinorFormulaParent(), TTreeIndex::UpdateFormulaLeaves(), and TChainIndex::UpdateFormulaLeaves().
Try to 'demote' a string into an array bytes.
If this is not possible, return false.
Reimplemented from ROOT::v5::TFormula.
Definition at line 4979 of file TTreeFormula.cxx.
Convert the underlying lookup method from the direct technique (dereferencing the address held by the branch) to the method using TFormLeafInfo.
This is in particular usefull in the case where we need to append an additional TFormLeafInfo (for example to call a method). Return false if the switch was unsuccessfull (basically in the case of an old style split tree).
Definition at line 5610 of file TTreeFormula.cxx.
Referenced by ParseWithLeaf().
|
virtual |
This function is called TTreePlayer::UpdateFormulaLeaves, itself called by TChain::LoadTree when a new Tree is loaded.
Because Trees in a TChain may have a different list of leaves, one must update the leaves numbers in the TTreeFormula used by the TreePlayer.
A safer alternative would be to recompile the whole thing .... However currently compile HAS TO be called from the constructor!
Definition at line 5008 of file TTreeFormula.cxx.
Referenced by TTreePlayer::CopyTree(), TTreeIndex::GetMajorFormulaParent(), TChainIndex::GetMajorFormulaParent(), TTreeIndex::GetMinorFormulaParent(), TChainIndex::GetMinorFormulaParent(), Init(), TSelectorEntries::Notify(), TSelectorDraw::Notify(), Notify(), TTreeIndex::TTreeIndex(), TTreeIndex::UpdateFormulaLeaves(), TTreeFormulaManager::UpdateFormulaLeaves(), TChainIndex::UpdateFormulaLeaves(), and UpdateFormulaLeaves().
|
friend |
Definition at line 66 of file TTreeFormula.h.
Referenced by Init().
|
protected |
List of TCutG and TEntryList used in the formula.
Definition at line 104 of file TTreeFormula.h.
Referenced by DefineAlternate(), DefinedVariable(), EvalInstance(), Init(), IsInteger(), LoadBranches(), ResetDimensions(), ResetLoading(), SetAxis(), UpdateFormulaLeaves(), and ~TTreeFormula().
|
protected |
list of dimension setups, for delayed creation of the dimension information.
Definition at line 125 of file TTreeFormula.h.
Referenced by DefinedVariable().
|
protected |
Definition at line 119 of file TTreeFormula.h.
Referenced by EvalInstance(), EvalObject(), Init(), IsLeafInteger(), SetAxis(), and TTreeFormula().
|
protected |
Definition at line 106 of file TTreeFormula.h.
Referenced by Init(), and UpdateFormulaLeaves().
pointer to Tree
Definition at line 93 of file TTreeFormula.h.
Referenced by DefinedVariable(), EvalInstance(), Init(), LoadCurrentDim(), ParseWithLeaf(), ResetDimensions(), TTreeFormula(), and UpdateFormulaLeaves().
|
protected |
List of aliases used during the parsing of the expression.
Definition at line 127 of file TTreeFormula.h.
Referenced by GetConstant(), Init(), TTreeFormula(), and ~TTreeFormula().
|
protected |
Definition at line 115 of file TTreeFormula.h.
Referenced by DefineDimensions(), GetRealInstance(), Init(), LoadCurrentDim(), RegisterDimensions(), ResetDimensions(), and TTreeFormula().
|
protected |
List of leaf used in this formula.
Definition at line 101 of file TTreeFormula.h.
Referenced by EvalClass(), EvalInstance(), EvalObject(), GetLeafInfo(), GetRealInstance(), LoadCurrentDim(), ParseWithLeaf(), RegisterDimensions(), SwitchToFormLeafInfo(), and ~TTreeFormula().
|
protected |
pointer to histogram axis if this is a string
Definition at line 120 of file TTreeFormula.h.
Referenced by EvalInstance(), GetRealInstance(), and ResetLoading().
|
protected |
The dimension coordinator.
Definition at line 124 of file TTreeFormula.h.
Referenced by Init(), RegisterDimensions(), ResetDimensions(), and ~TTreeFormula().
|
protected |
List of leaf method calls.
Definition at line 103 of file TTreeFormula.h.
Referenced by DefinedVariable(), EvalInstance(), ResetDimensions(), and UpdateFormulaLeaves().
|
protected |
Definition at line 111 of file TTreeFormula.h.
Referenced by GetRealInstance(), Init(), LoadCurrentDim(), and ResetDimensions().
|
protected |
Definition at line 96 of file TTreeFormula.h.
Referenced by TTreeFormulaManager::GetNdata(), Init(), ParseWithLeaf(), TTreeFormulaManager::Sync(), and TTreeFormula().
Definition at line 112 of file TTreeFormula.h.
Referenced by GetRealInstance(), Init(), LoadCurrentDim(), ParseWithLeaf(), RegisterDimensions(), and TTreeFormula().
|
protected |
Definition at line 116 of file TTreeFormula.h.
Referenced by DefineDimensions(), DefinedVariable(), GetRealInstance(), Init(), IsLeafString(), LoadCurrentDim(), ResetDimensions(), and TTreeFormula().
|
protected |
List of TTreeFormula for each alias used.
Definition at line 105 of file TTreeFormula.h.
Referenced by FindLeafForExpression(), ParseWithLeaf(), UpdateFormulaLeaves(), and ~TTreeFormula().
|
protected |
Definition at line 100 of file TTreeFormula.h.
Referenced by EvalClass(), EvalInstance(), EvalObject(), EvalStringInstance(), FindLeafForExpression(), GetLeaf(), Init(), IsInteger(), IsLeafInteger(), IsLeafString(), LoadBranches(), LoadCurrentDim(), ParseWithLeaf(), PrintValue(), ResetDimensions(), StringToNumber(), SwitchToFormLeafInfo(), and UpdateFormulaLeaves().
|
protected |
Definition at line 99 of file TTreeFormula.h.
Referenced by DefinedVariable(), EvalClass(), EvalInstance(), EvalObject(), EvalStringInstance(), Init(), IsInteger(), IsLeafInteger(), IsLeafString(), LoadCurrentDim(), ParseWithLeaf(), PrintValue(), RegisterDimensions(), ResetDimensions(), StringToNumber(), SwitchToFormLeafInfo(), TTreeFormula(), UpdateFormulaLeaves(), and ~TTreeFormula().
|
protected |
True if we executed one boolean optimization since the last time instance number 0 was evaluated.
Definition at line 121 of file TTreeFormula.h.
Referenced by TTreeFormulaManager::Add(), DefineDimensions(), DefinedVariable(), EvalInstance(), GetManager(), GetNdata(), GetRealInstance(), Init(), LoadCurrentDim(), RegisterDimensions(), ResetDimensions(), TTreeFormula(), and ~TTreeFormula().
|
protected |
List of leaf data members.
Definition at line 102 of file TTreeFormula.h.
Referenced by GetMethodCall(), and ~TTreeFormula().
|
protected |
Definition at line 97 of file TTreeFormula.h.
Referenced by GetMultiplicity(), TTreeFormulaManager::GetNdata(), Init(), ParseWithLeaf(), and TTreeFormula().
|
protected |
This caches the physical number of element in the leaf or datamember.
Definition at line 95 of file TTreeFormula.h.
Referenced by DefinedVariable(), EvalClass(), EvalInstance(), EvalObject(), EvalStringInstance(), FindLeafForExpression(), GetNcodes(), Init(), LoadCurrentDim(), ParseWithLeaf(), ResetDimensions(), ResetLoading(), TTreeFormula(), and ~TTreeFormula().
Definition at line 94 of file TTreeFormula.h.
Referenced by EvalInstance(), EvalObject(), EvalStringInstance(), GetRealInstance(), Init(), LoadCurrentDim(), PrintValue(), ResetDimensions(), and TTreeFormula().
If true, the current entry has not been loaded yet.
Definition at line 110 of file TTreeFormula.h.
Referenced by DefineDimensions(), GetRealInstance(), Init(), IsLeafString(), LoadBranches(), LoadCurrentDim(), RegisterDimensions(), ResetDimensions(), ResetLoading(), TTreeFormula(), and ~TTreeFormula().
|
protected |
If true, branch GetEntry is only called when the entry number changes.
Definition at line 108 of file TTreeFormula.h.
Referenced by EvalInstance(), EvalObject(), EvalStringInstance(), and ResetLoading().
|
protected |
Definition at line 98 of file TTreeFormula.h.
Referenced by Init(), and TTreeFormula().
|
protected |
List of branches to read. Similar to fLeaces but duplicates are zeroed out.
Definition at line 107 of file TTreeFormula.h.
Referenced by BranchHasMethod(), EvalInstance(), EvalObject(), EvalStringInstance(), GetLeafWithDatamember(), IsQuickLoad(), LoadCurrentDim(), ParseWithLeaf(), PrintValue(), and SetQuickLoad().
|
protected |
Definition at line 92 of file TTreeFormula.h.
Referenced by DefineAlternate(), DefinedVariable(), EvalInstance(), FindLeafForExpression(), GetLeafWithDatamember(), GetTree(), Init(), ParseWithLeaf(), SetTree(), and TTreeFormula().
|
protected |
Definition at line 117 of file TTreeFormula.h.
Referenced by DefineDimensions(), DefinedVariable(), GetRealInstance(), Init(), LoadBranches(), LoadCurrentDim(), ResetLoading(), TTreeFormula(), UpdateFormulaLeaves(), and ~TTreeFormula().