Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:24

0001 // @(#)root/treeplayer:$Id$
0002 // Author: Philippe Canal 09/06/2006
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT__TSelectorEntries
0013 #define ROOT__TSelectorEntries
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TSelectorEntries                                                     //
0018 //                                                                      //
0019 // A specialized TSelector for TTree::GetEntries(selection)             //
0020 // The selection is passed either via the constructor or via            //
0021 // SetSelection.  The number of entries passing the selection (or       //
0022 // at least one element of the arrays or collections used in the        //
0023 // selection is passing the selection) is stored in fSeletedRwos        //
0024 // which can be retrieved via GetSelectedRows.                          //
0025 // See a usage example in TTreePlayer::GetEntries.                      //
0026 //                                                                      //
0027 //////////////////////////////////////////////////////////////////////////
0028 
0029 #include <TSelector.h>
0030 
0031 class TTree;
0032 class TTreeFormula;
0033 
0034 class TSelectorEntries : public TSelector {
0035    bool            fOwnInput;       ///<  True if we created the input list.
0036 public :
0037    TTree          *fChain;          ///<! Pointer to the analyzed TTree or TChain
0038    TTreeFormula   *fSelect;         ///<  Pointer to selection formula
0039    Long64_t        fSelectedRows;   ///<  Number of selected entries
0040    bool            fSelectMultiple; ///<  True if selection has a variable index
0041 
0042    TSelectorEntries(TTree *tree = nullptr, const char *selection = nullptr);
0043    TSelectorEntries(const char *selection);
0044    ~TSelectorEntries() override;
0045    Int_t    Version() const override { return 2; }
0046    void     Begin(TTree *tree) override;
0047    void     SlaveBegin(TTree *tree) override;
0048    void     Init(TTree *tree) override;
0049    bool     Notify() override;
0050    bool     Process(Long64_t entry) override;
0051    Int_t    GetEntry(Long64_t entry, Int_t getall = 0) override;
0052    virtual Long64_t GetSelectedRows() const { return fSelectedRows; }
0053    void     SetOption(const char *option) override { fOption = option; }
0054    void     SetObject(TObject *obj) override { fObject = obj; }
0055    virtual void     SetSelection(const char *selection);
0056    TList   *GetOutputList() const override { return fOutput; }
0057    void     SlaveTerminate() override;
0058    void     Terminate() override;
0059 
0060    ClassDefOverride(TSelectorEntries,1); //A specialized TSelector for TTree::GetEntries(selection)
0061 };
0062 
0063 #endif
0064