Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TSelectorEntries.h
Go to the documentation of this file.
1// @(#)root/treeplayer:$Id$
2// Author: Philippe Canal 09/06/2006
3
4/*************************************************************************
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 *************************************************************************/
11
12#ifndef ROOT__TSelectorEntries
13#define ROOT__TSelectorEntries
14
15//////////////////////////////////////////////////////////////////////////
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 selection) is stored in fSeletedRwos //
24// which can be retrieved via GetSelectedRows. //
25// See a usage example in TTreePlayer::GetEntries. //
26// //
27//////////////////////////////////////////////////////////////////////////
28
29#include <TSelector.h>
30
31class TTree;
32class TTreeFormula;
33
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
41
42 TSelectorEntries(TTree *tree = nullptr, const char *selection = nullptr);
43 TSelectorEntries(const char *selection);
44 ~TSelectorEntries() override;
45 Int_t Version() const override { return 2; }
46 void Begin(TTree *tree) override;
47 void SlaveBegin(TTree *tree) override;
48 void Init(TTree *tree) override;
49 Bool_t Notify() override;
50 Bool_t Process(Long64_t entry) override;
51 Int_t GetEntry(Long64_t entry, Int_t getall = 0) override;
52 virtual Long64_t GetSelectedRows() const { return fSelectedRows; }
53 void SetOption(const char *option) override { fOption = option; }
54 void SetObject(TObject *obj) override { fObject = obj; }
55 virtual void SetSelection(const char *selection);
56 TList *GetOutputList() const override { return fOutput; }
57 void SlaveTerminate() override;
58 void Terminate() override;
59
60 ClassDefOverride(TSelectorEntries,1); //A specialized TSelector for TTree::GetEntries(selection)
61};
62
63#endif
64
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long long Long64_t
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
A doubly linked list.
Definition TList.h:38
Mother of all ROOT objects.
Definition TObject.h:41
The class is derived from the ROOT class TSelector.
void SetOption(const char *option) override
Bool_t fSelectMultiple
True if selection has a variable index.
Int_t Version() const override
Bool_t Notify() override
This function is called at the first entry of a new tree in a chain.
TList * GetOutputList() const override
~TSelectorEntries() override
Destructor.
TTree * fChain
! Pointer to the analyzed TTree or TChain
void Begin(TTree *tree) override
The Begin() function is called at the start of the query.
Bool_t fOwnInput
True if we created the input list.
void SlaveTerminate() override
The SlaveTerminate() function is called after all entries or objects have been processed.
TTreeFormula * fSelect
Pointer to selection formula.
void SetObject(TObject *obj) override
virtual void SetSelection(const char *selection)
Set the selection expression.
virtual Long64_t GetSelectedRows() const
Bool_t Process(Long64_t entry) override
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
void Init(TTree *tree) override
The Init() function is called when the selector needs to initialize a new tree or chain.
Long64_t fSelectedRows
Number of selected entries.
void SlaveBegin(TTree *tree) override
The SlaveBegin() function is called after the Begin() function.
void Terminate() override
The Terminate() function is the last function to be called during a query.
Int_t GetEntry(Long64_t entry, Int_t getall=0) override
Read entry.
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