Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 slection) 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 
31 class TTree;
32 class TTreeFormula;
33 
34 class TSelectorEntries : public TSelector {
35  Bool_t fOwnInput; // true if we created the input list.
36 public :
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 = 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();
59 
60  ClassDef(TSelectorEntries,1); //A specialized TSelector for TTree::GetEntries(selection)
61 };
62 
63 #endif
64