Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/treeplayer:$Id$
2// Author: Philippe Canal 09/06/2006
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT__TSelectorEntries
13#define ROOT__TSelectorEntries
16// //
17// TSelectorEntries //
18// //
19// A specialized TSelector for TTree::GetEntries(selection) //
20// The selection is passed either via the constructor or via //
21// SetSelection. The number of entries passing the selection (or //
22// at least one element of the arrays or collections used in the //
23// selection is passing the slection) is stored in fSeletedRwos //
24// which can be retrieved via GetSelectedRows. //
25// See a usage example in TTreePlayer::GetEntries. //
26// //
29#include <TSelector.h>
31class TTree;
32class TTreeFormula;
35 Bool_t fOwnInput; // true if we created the input list.
36public :
37 TTree *fChain; //! pointer to the analyzed TTree or TChain
38 TTreeFormula *fSelect; // Pointer to selection formula
39 Long64_t fSelectedRows; // Number of selected entries
40 Bool_t fSelectMultiple; // true if selection has a variable index
42 TSelectorEntries(TTree *tree = 0, const char *selection = 0);
43 TSelectorEntries(const char *selection);
44 virtual ~TSelectorEntries();
45 virtual Int_t Version() const { return 2; }
46 virtual void Begin(TTree *tree);
47 virtual void SlaveBegin(TTree *tree);
48 virtual void Init(TTree *tree);
49 virtual Bool_t Notify();
50 virtual Bool_t Process(Long64_t entry);
51 virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0);
52 virtual Long64_t GetSelectedRows() const { return fSelectedRows; }
53 virtual void SetOption(const char *option) { fOption = option; }
54 virtual void SetObject(TObject *obj) { fObject = obj; }
55 virtual void SetSelection(const char *selection);
56 virtual TList *GetOutputList() const { return fOutput; }
57 virtual void SlaveTerminate();
58 virtual void Terminate();
60 ClassDef(TSelectorEntries,1); //A specialized TSelector for TTree::GetEntries(selection)
int Int_t
Definition RtypesCore.h:45
bool Bool_t
Definition RtypesCore.h:63
long long Long64_t
Definition RtypesCore.h:73
#define ClassDef(name, id)
Definition Rtypes.h:325
A doubly linked list.
Definition TList.h:44
Mother of all ROOT objects.
Definition TObject.h:37
The class is derived from the ROOT class TSelector.
virtual Int_t Version() const
virtual TList * GetOutputList() const
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read entry.
virtual void SetOption(const char *option)
TTreeFormula * fSelect
pointer to the analyzed TTree or TChain
virtual void Init(TTree *tree)
The Init() function is called when the selector needs to initialize a new tree or chain.
virtual Bool_t Notify()
This function is called at the first entry of a new tree in a chain.
virtual void SetSelection(const char *selection)
Set the selection expression.
virtual Long64_t GetSelectedRows() const
virtual ~TSelectorEntries()
virtual void Begin(TTree *tree)
The Begin() function is called at the start of the query.
virtual void Terminate()
The Terminate() function is the last function to be called during a query.
virtual Bool_t Process(Long64_t entry)
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
virtual void SetObject(TObject *obj)
virtual void SlaveBegin(TTree *tree)
The SlaveBegin() function is called after the Begin() function.
virtual void SlaveTerminate()
The SlaveTerminate() function is called after all entries or objects have been processed.
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition TSelector.h:31
TString fOption
Option given to TTree::Process.
Definition TSelector.h:39
TSelectorList * fOutput
! List of objects created during processing
Definition TSelector.h:42
TObject * fObject
! Current object if processing object (vs. TTree)
Definition TSelector.h:40
Used to pass a selection expression to the Tree drawing routine.
A TTree represents a columnar dataset.
Definition TTree.h:79
Definition tree.py:1