[root] / trunk / tree / tree / inc / TVirtualTreePlayer.h Repository:
ViewVC logotype

Log of /trunk/tree/tree/inc/TVirtualTreePlayer.h

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 31561 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 4 16:31:47 2009 UTC (5 years, 1 month ago) by brun
File length: 5240 byte(s)
Diff to previous 31496
From Lorenzo:
patch to revert back the changes in the fitting method in the TTree in order to not have the libHist dependency.

Revision 31496 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 1 19:20:05 2009 UTC (5 years, 1 month ago) by brun
File length: 5267 byte(s)
Diff to previous 28514
From Lorenzo:
return a  TFitResultPtr  for the TTree::Fit and TTree::UnbinnedFit methods

Revision 28514 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 11 10:44:08 2009 UTC (5 years, 8 months ago) by brun
File length: 5240 byte(s)
Diff to previous 22902
Implement direct interfaces from TTree to the result of TSelector::Draw
  TTree:GetVal(int) and TTree::GetVar(int)

Revision 22902 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 31 09:48:42 2008 UTC (6 years, 9 months ago) by rdm
File length: 5138 byte(s)
Diff to previous 21642
move tree, treeplayer and treeviewer under tree meta directory.

Revision 21642 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 11 14:55:52 2008 UTC (7 years ago) by rdm
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5138 byte(s)
Diff to previous 21510
correct class description comment.

Revision 21510 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 19 20:55:57 2007 UTC (7 years, 1 month ago) by pcanal
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5149 byte(s)
Diff to previous 20882
add missing class and typedef descriptions

Revision 20882 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:31:26 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5148 byte(s)
Diff to previous 19826
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5148 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5207 byte(s)
Diff to previous 18606
remove :$ from tag line

Revision 18606 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 27 08:34:25 2007 UTC (7 years, 8 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5217 byte(s)
Diff to previous 17331
-Change the return type of TTree::Fit and TTree::UnbinnedFit from Long64_t to Int_t
to be consistent with the return type of TH1::Fit and TGraqph::Fit.
-TTree::Fit and TTree::UnbinnedFit have now the following return status:
   The function return the status of the fit in the following form
     fitResult = migradResult + 10*minosResult + 100*hesseResult + 1000*improveResult
   The fitResult is 0 is the fit is OK.
   The fitResult is negative in case of an error not connected with the fit.
   The number of entries used in the fit can be obtained via
     mytree.GetSelectedRows();
   If the number of selected entries is null the function returns -1

Revision 17331 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 15 14:27:37 2007 UTC (8 years ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5219 byte(s)
Diff to previous 16287
Use forward declaration of TClass instead of include "TClass.h"

Revision 16287 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Sep 17 19:08:13 2006 UTC (8 years, 4 months ago) by pcanal
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5203 byte(s)
Diff to previous 15826
Implement TTree::GetEntries(const char *selection) which return the number of entries passing the selection

Revision 15826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jul 19 18:01:38 2006 UTC (8 years, 6 months ago) by pcanal
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5147 byte(s)
Diff to previous 14342
From Sergei Linev:
Reset correctly fgCurrent in TVirtualTreePlayer destructor.

Revision 14342 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 21 05:20:34 2006 UTC (8 years, 10 months ago) by pcanal
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5150 byte(s)
Diff to previous 14336
Add include statements that are no longer strictly required but
are needed to preserve backward compatibility.

Revision 14336 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 20 21:43:44 2006 UTC (8 years, 10 months ago) by pcanal
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5117 byte(s)
Diff to previous 13207
Reduce direct dependencies on TClass.h, TROOT.h and TStreamerInfo.h.
Warning:  This means that some file that relied on the indirect
inclusion of these header file might now fail to compile with
an error message mention that gROOT is no known or that TClass,
TROOT or TStreamerInfo is incompletely defined.  Simply add the
proper include directive.

Revision 13207 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 11 22:16:04 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5149 byte(s)
Diff to previous 9840
Update the spacing and documentation to match the coding rule

Revision 9840 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 24 15:46:02 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 5137 byte(s)
Diff to previous 9615
Implement a new function
TVirtualTreePlayer *TVirtualTreePlayer::GetCurrentPlayer()
that returns a pointer to the current TTreePlayer.
This function is required for the THXEditor classes (rebinning TAB)

Revision 9615 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 29 10:54:55 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4990 byte(s)
Diff to previous 9556

*****************WARNING*****************
With this mega patch, we introduce support for TTree/TChain  with more than
2 billion entries. Several class data members have been changed from
Int_t (or Stat_t) to Long64_t.
==>Trees written with this new version cannot be read with older versions
******************************************

TBranch:
========
 - replace the members with type Int_t or Stat_t by Long64_t
    Long64_t    fEntryNumber;     //  Current entry number (last one filled in this branch)
    Long64_t    fReadEntry;       //! Current entry number when reading
    Long64_t    fEntries;         //  Number of entries
    Long64_t    fTotBytes;        //  Total number of bytes in all leaves before compression
    Long64_t    fZipBytes;        //  Total number of bytes in all leaves after compression
    Long64_t   *fBasketEntry;     //[fMaxBaskets] Table of first entry in eack basket

 - corresponding changes in the member functions
    virtual Int_t     GetEntry(Long64_t entry=0, Int_t getall = 0);
    virtual Int_t     GetEntryExport(Long64_t entry, Int_t getall, TClonesArray *list, Int_t n);
            Int_t     GetEvent(Long64_t entry=0) {return GetEntry(entry);}
            Long64_t *GetBasketEntry() const {return fBasketEntry;}
            Long64_t  GetReadEntry()   const {return fReadEntry;}
            Long64_t  GetTotalSize()   const;
            Long64_t  GetTotBytes()    const {return fTotBytes;}
            Long64_t  GetZipBytes()    const {return fZipBytes;}
            Long64_t  GetEntryNumber() const {return fEntryNumber;}
            Long64_t  GetEntries()     const {return fEntries;}

TBranch::Streamer has been modified to read old files and automatically translate
the old types to the new types.
The new version of Streamer uses the TClass::ReadBuffer/WriteBuffer.

TBranch::Print has been modified to take into account the new data types.

ClassDef version increased to 10.

TBranchClones:
==============
    virtual Int_t    GetEntry(Long64_t entry=0, Int_t getall = 0);

TBranchElement:
===============
            Int_t    GetEntry(Long64_t entry=0, Int_t getall = 0);

TBranchObject:
==============
    virtual Int_t    GetEntry(Long64_t entry=0, Int_t getall = 0);

TChain:
=======
    Long64_t    *fTreeOffset;       //[fTreeOffsetLen]Array of variables

    virtual Int_t     Add(const char *name, Long64_t nentries=kBigNumber);
    virtual Int_t     AddFile(const char *name, Long64_t nentries=kBigNumber);
    virtual Long64_t  Draw(const char *varexp, const TCut &selection, Option_t *option=""
                       ,Long64_t nentries=kBigNumber, Long64_t firstentry=0);
    virtual Long64_t  Draw(const char *varexp, const char *selection, Option_t *option=""
                     ,Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
    virtual Long64_t  GetChainEntryNumber(Long64_t entry) const;
    virtual Long64_t  GetEntries() const;
    virtual Int_t     GetEntry(Long64_t entry=0, Int_t getall=0);
            Long64_t  LoadTree(Long64_t entry);
    virtual void      Loop(Option_t *option="",Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
    virtual Long64_t  Merge(const char *name);
    virtual Long64_t  Merge(TCollection *list);
    virtual Long64_t  Merge(TFile *file, Int_t basketsize, Option_t *option="");
    virtual Long64_t  Process(const char *filename,Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
    virtual Long64_t  Process(TSelector *selector,Option_t *option="",  Long64_t nentries=kBigNumber, Long64_t firstentry=0);

ClassDef version changed from 4 to 5

TSelector
=========
   virtual Bool_t      ProcessCut(Long64_t /*entry*/) { return kTRUE; }
   virtual void        ProcessFill(Long64_t /*entry*/) { }
   virtual Bool_t      Process(Long64_t /*entry*/) { return kFALSE; }

TSelectorCint
=============
   virtual Bool_t      ProcessCut(Long64_t entry);
   virtual void        ProcessFill(Long64_t entry);
   virtual Bool_t      Process(Long64_t entry);

TSelectorDraw
=============
    Long64_t       fDraw;           //! Last entry loop number when object was drawn
    Long64_t       fSelectedRows;   //  Number of selected entries
    Long64_t       fOldEstimate;    //  value of Tree fEstimate when selector is called
    Double_t      *fV1;             //![fSelectedRows]Local buffer for variable 1
    Double_t      *fV2;             //![fSelectedRows]Local buffer for variable 2
    Double_t      *fV3;             //![fSelectedRows]Local buffer for variable 3
    Double_t      *fV4;             //![fSelectedRows]Local buffer for variable 4
    Double_t      *fW;              //![fSelectedRows]Local buffer for weights

    virtual Long64_t  GetSelectedRows() const {return fSelectedRows;}
    virtual Bool_t    Process(Long64_t /*entry*/) { return kFALSE; }
    virtual void      ProcessFill(Long64_t entry);
    virtual void      ProcessFillMultiple(Long64_t entry);
    virtual void      ProcessFillObject(Long64_t entry);
    virtual void      SetEstimate(Long64_t n);

TTree
=====
Modified data types
    Long64_t       fEntries;           //  Number of entries
    Long64_t       fTotBytes;          //  Total number of bytes in all branches before compression
    Long64_t       fZipBytes;          //  Total number of bytes in all branches after compression
    Long64_t       fSavedBytes;        //  Number of autosaved bytes
    Long64_t       fMaxEntryLoop;      //  Maximum number of entries to process
    Long64_t       fMaxVirtualSize;    //  Maximum total size of buffers kept in memory
    Long64_t       fAutoSave;          //  Autosave tree when fAutoSave bytes produced
    Long64_t       fEstimate;          //  Number of entries to estimate histogram limits
    Long64_t       fChainOffset;       //! Offset of 1st entry of this Tree in a TChain
    Long64_t       fReadEntry;         //! Number of the entry being processed
    Long64_t       fTotalBuffers;      //! Total number of bytes in branch buffers
    Long64_t       fDebugMin;          //! First entry number to debug
    Long64_t       fDebugMax;          //! Last entry number to debug

New function signatures
    virtual Long64_t     AutoSave(Option_t *option="");
    virtual TTree       *CloneTree(Long64_t nentries=-1, Option_t *option="");
    virtual Long64_t     CopyEntries(TTree *tree, Long64_t nentries=-1);
    virtual TTree       *CopyTree(const char *selection, Option_t *option=""
                          ,Long64_t nentries=1000000000, Long64_t firstentry=0);
    virtual Long64_t     Draw(const char *varexp, const TCut &selection, Option_t *option=""
                          ,Long64_t nentries=1000000000, Long64_t firstentry=0);
    virtual Long64_t     Draw(const char *varexp, const char *selection, Option_t *option=""
                          ,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
    virtual Long64_t     Fit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option="" ,Option_t *goption=""
                          ,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
    virtual Long64_t     GetChainEntryNumber(Long64_t entry) const {return entry;}
    virtual Long64_t     GetChainOffset() const { return fChainOffset; }
            Long64_t     GetDebugMax()  const {return fDebugMax;}
            Long64_t     GetDebugMin()  const {return fDebugMin;}
    virtual Long64_t     GetEntries() const   {return fEntries;}
    virtual Long64_t     GetEntriesFast() const   {return fEntries;}
    virtual Long64_t     GetEntriesFriend() const;
    virtual Long64_t     GetEstimate() const { return fEstimate; }
    virtual Int_t        GetEntry(Long64_t entry=0, Int_t getall=0);
            Int_t        GetEvent(Long64_t entry=0, Int_t getall=0) {return GetEntry(entry,getall);}
    virtual Long64_t     GetEntryNumberWithBestIndex(Int_t major, Int_t minor=0) const;
    virtual Long64_t     GetEntryNumberWithIndex(Int_t major, Int_t minor=0) const;
    virtual Long64_t     GetEntryNumber(Long64_t entry) const;
    virtual Long64_t     GetMaxEntryLoop() const {return fMaxEntryLoop;}
    static  Long64_t     GetMaxTreeSize();
    virtual Long64_t     GetMaxVirtualSize() const {return fMaxVirtualSize;}
    virtual Long64_t     GetReadEntry()  const {return fReadEntry;}
    virtual Long64_t     GetReadEvent()  const {return fReadEntry;}
    virtual Long64_t     GetSelectedRows() {return GetPlayer()->GetSelectedRows();}
    virtual Long64_t     GetTotBytes() const {return fTotBytes;}
    virtual Long64_t     GetZipBytes() const {return fZipBytes;}
    virtual Long64_t     LoadTree(Long64_t entry);
    virtual Long64_t     LoadTreeFriend(Long64_t entry, TTree *T);
    virtual Long64_t     Merge(TCollection *list);
    TPrincipal          *Principal(const char *varexp="", const char *selection="", Option_t *option="np"
                                   ,Long64_t nentries=1000000000, Long64_t firstentry=0);
    virtual Long64_t     Process(const char *filename,Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
    virtual Long64_t     Process(TSelector *selector, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0);
    virtual Long64_t     Project(const char *hname, const char *varexp, const char *selection="", Option_t *option=""
                          ,Long64_t nentries=1000000000, Long64_t firstentry=0);
    virtual TSQLResult  *Query(const char *varexp="", const char *selection="", Option_t *option=""
                          ,Long64_t nentries=1000000000, Long64_t firstentry=0);
    virtual Long64_t     Scan(const char *varexp="", const char *selection="", Option_t *option=""
                          ,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
    virtual void         SetDebug(Int_t level=1, Long64_t min=0, Long64_t max=9999999); // *MENU*
    virtual void         SetEntries(Long64_t n);
    virtual void         SetEstimate(Long64_t nentries=10000);
    virtual void         SetMaxEntryLoop(Long64_t maxev=1000000000) {fMaxEntryLoop = maxev;} // *MENU*
    static  void         SetMaxTreeSize(Long64_t maxsize=1900000000);
    virtual void         SetMaxVirtualSize(Long64_t size=0) {fMaxVirtualSize = size;} // *MENU*
    virtual void         Show(Long64_t entry=-1, Int_t lenmax=20);
    virtual Long64_t     UnbinnedFit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option=""
                          ,Long64_t nentries=1000000000, Long64_t firstentry=0);

TTree::Streamer has been modified to real old files.
TTree::Print has been modified to take into account the new data types.

ClassDef version number incremented to 13.

TVirtualTreePlayer
==================
    virtual TTree         *CopyTree(const char *selection, Option_t *option=""
                            ,Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
    virtual Long64_t       DrawScript(const char* wrapperPrefix,
                                      const char *macrofilename, const char *cutfilename,
                                      Option_t *option, Long64_t nentries, Long64_t firstentry) = 0;
    virtual Long64_t       DrawSelect(const char *varexp, const char *selection, Option_t *option
                            ,Long64_t nentries, Long64_t firstentry) = 0;
    virtual Long64_t       Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,Option_t *goption
                            ,Long64_t nentries, Long64_t firstentry) = 0;
    virtual Long64_t       GetSelectedRows() const = 0;
    virtual TPrincipal    *Principal(const char *varexp="", const char *selection="", Option_t *option="np"
                           ,Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
    virtual Long64_t       Process(const char *filename,Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
    virtual Long64_t       Process(TSelector *selector,Option_t *option="",  Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
    virtual Long64_t       Scan(const char *varexp, const char *selection, Option_t *option
                            ,Long64_t nentries, Long64_t firstentry) = 0;
    virtual TSQLResult    *Query(const char *varexp, const char *selection, Option_t *option
                            ,Long64_t nentries, Long64_t firstentry) = 0;
    virtual void           SetEstimate(Long64_t n) = 0;
    virtual Long64_t       UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
                            ,Long64_t nentries, Long64_t firstentry) = 0;

TTreeFormula
============
   TLeaf*      GetLeafWithDatamember(const char* topchoice, const char* nextchice, Long64_t readentry) const;
   Bool_t      BranchHasMethod(TLeaf* leaf, TBranch* branch,
                               const char* method,const char* params,
                               Long64_t readentry) const;

TTreePlayer
===========
    Long64_t       fSelectedRows;    //  Number of selected entries

    virtual TTree    *CopyTree(const char *selection, Option_t *option
                       ,Long64_t nentries, Long64_t firstentry);
    virtual Long64_t  DrawScript(const char* wrapperPrefix,
                                 const char *macrofilename, const char *cutfilename,
                                 Option_t *option, Long64_t nentries, Long64_t firstentry);
    virtual Long64_t  DrawSelect(const char *varexp, const char *selection, Option_t *option
                                 ,Long64_t nentries, Long64_t firstentry);
    virtual Long64_t  Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,
                          Option_t *goption ,Long64_t nentries, Long64_t firstentry);
    virtual Long64_t  GetSelectedRows() const {return fSelectedRows;}
    TPrincipal       *Principal(const char *varexp, const char *selection, Option_t *option
                       ,Long64_t nentries, Long64_t firstentry);
    virtual Long64_t  Process(const char *filename,Option_t *option, Long64_t nentries, Long64_t firstentry);
    virtual Long64_t  Process(TSelector *selector,Option_t *option,  Long64_t nentries, Long64_t firstentry);
    virtual Long64_t  Scan(const char *varexp, const char *selection, Option_t *option
                       ,Long64_t nentries, Long64_t firstentry);
    virtual TSQLResult *Query(const char *varexp, const char *selection, Option_t *option
                         ,Long64_t nentries, Long64_t firstentry);
    virtual void      SetEstimate(Long64_t n);
    virtual Long64_t  UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
                       ,Long64_t nentries, Long64_t firstentry);

The generated code by TTreePlayer::MakeCode, MakeClass, MakeProxy
uses Long64_t instead of Int_t

TTreeViewer
===========
    Long64_t      Process(const char* filename, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
    void          SetCurrentRecord(Long64_t entry);

THbookBranch
============
    virtual Int_t    GetEntry(Long64_t entry=0, Int_t getall=0);
    virtual void     SetEntries(Long64_t n) {fEntries=n;}

THbookTree
==========
    virtual Int_t    GetEntry(Long64_t entry=0, Int_t getall=0);
    virtual void     InitBranches(Long64_t entry);
    virtual void     SetEntries(Long64_t n);

TProofDraw
==========
    virtual Bool_t   Process(Long64_t /*entry*/);

TProofPlayer
============
    virtual Long64_t  Process(TDSet *set,
    virtual Long64_t  DrawSelect(TDSet *set, const char *varexp,
    Long64_t          Process(TDSet *set, const char *selector,
    Long64_t          DrawSelect(TDSet *set, const char *varexp,

Revision 9556 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 20 09:40:19 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4927 byte(s)
Diff to previous 9429
From Philippe:

This patch implements support for TTree Friend in the new TTree Proxy
mechanism (See releases notes of ROOT 4.00/08).

For example with the result of tutorials/treefriend.C and the macro print.C:

  void print() {
    cout << "Entry #" << fChain->GetReadEntry()
         << " and #" << TF.GetReadEntry() << "  \t"
         << x << " ";  // from the main tree
    if (TF.GetReadEntry()>=0) cout << TF.x; // from the friend tree
    else cout << "N/A";
    cout << endl;
  }

You can simply create a Proxy based TSelector with
  T->MakeProxy("withfriend","print.C","","nohist");
Then use the resulting file (withfriend.h) as anyother
TSelector script.  For example:
  T->Process("withfriend.h+","",20);

Or you can generate a simple histogram 2 files fill.C and fillCut.C
  root [5] .! cat fill.C
  double fill() {
    return x - TF.x;
  }
  root [6] .! cat fillCut.C
  Bool_t fillCut() {
    return TF.GetReadEntry()>=0;
  }
and you can just do:
  T->Draw("fill.C+","fillCut.C");

Revision 9429 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 8 08:08:08 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4827 byte(s)
Diff to previous 9323
Add a new function BuildIndex

Revision 9323 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 25 18:42:19 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4701 byte(s)
Diff to previous 7403
From Philippe:
This introduces the implementation of MakeProxy and Draw of a C++ function which
is run in a context where the name of the branches can be used as a C++ variable.

In TTree, we added a method MakeProxy and modified the behavior of TTree::Draw
(by modifying TTreePlayer::DrawSelect).
In TTreePlayer we added TTreePlayer::MakeProxy and TTreePlayer::DrawScript

TTreeProxyGenerator is a new class implementing the generation of the skeleton.
(TBranchProxyDescriptor and TBranchProxyClassDescriptor are helper class).

A priori the tree parsing done by TTreeProxyGenerator could be used to
re-implement improved an improve MakeClass/MakeSelector.

TBranchProxy is the base class of a new hierarchy of classes implementing the
indirect access to the branch of a TTree.  The main features are
        - protection against array out-of-bound
        - on-demand loading of branches
        - ability to use the 'branchname' as if it was a data member.
For example with Event.root:
                Double_t somepx = fTracks.fPx[2];
somepx is updated with the current fPx of the 3rd track.

TTree::Draw as been updated so that upon seeing
        tree->Draw("h1analysis.C+","")
        tree->Draw("h1analysis.C+","h1analysisCut.C")

If h1analysis.C (and h1analysisCut.C in the 2nd case) are readable files,
the new MakeProxy will be used __instead of__ TTreeFormula.  Currently
TTreeFormula and 'TBranchProxy' can not be used together.

In which case the means of parameters to TTree::Draw are more like:
   Int_t TTree::Draw(const char *filename, const char *cutfilename,
                     Option_t *option="",
                     Int_t nentries=1000000000, Int_t firstentry=0);

Both files are expected to be source file which contains at least a free
standing function with the signature:
        x_t filename();
and
        y_t cutfilename();

x_t and y_t needs to be type that can convert respectively to a double
and a bool (because the code does; if(cutfilename()) htemp->Fill(filename());

The 2 free standing function are run in a context such that the branch names
are available as locally avaiable variable of the correct (read-only) type.

If 'filename' is suffixes with an ACLiC mode, the ACLiC mode is inforced
(Note that at this time, interpreted mode is not supported and if no ACLiC
mode is specified, a '+' is used by default).

The generated script file (currently generatedSel.h but subject to change in
a future release) is intentionally __not__ deleted at the end of the processing.
Also if the file already exist, it is updated if and only if the new version
is different.  In particular this means issues twice in a row:
        tree->Draw("Script.C+");
does __not__ result in a second (useless) compilation.

For example to draw px in hsimple.root just have a hsimple.C file:
        double hsimple() {
           return px;
        }
and do:
        new TFile("hsimple.root")
        tree = ntuple
        draw(tree,"hsimple.C");
or
        draw(tree,"hsimple.C+");

I attached a few examples, including a full port of the h1analysis tutorials.

To use the h1analysis do:
        TChain chain("h42");
      chain.Add("$H1/dstarmb.root");  //  21330730 bytes  21920 events
        chain.Add("$H1/dstarp1a.root"); //  71464503 bytes  73243 events
      chain.Add("$H1/dstarp1b.root"); //  83827959 bytes  85597 events
      chain.Add("$H1/dstarp2.root");  // 100675234 bytes 103053 events

      chain.Draw("h1analysis.C+","h1analysisCut.C");
      h1analysis_Terminate();

I also have an example working of all the new Event files:

        new TFile("Event.new.split9.root");
        TTree * tree = (TTree*)file->Get("T");
        tree->Draw("script.C");

script0.C needs to be used for Event.new.split0.root.

Also you can just generate the skeleton by doing:
  tree->MakeProxy("mysel",scriptfilename,cutfilename,splitLevel);

Where the non-split branches, will be made to look as if there were
split up to 'splitLevel'. (i.e mean that their data members will
be syntactically available as if they were split).

Revision 7403 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 7 11:10:36 2003 UTC (11 years, 3 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4300 byte(s)
Diff to previous 5936
Implement support for 4 dimensions in TTree::Draw.
When doing tree.Draw("x:y:z:u"), the variable "u" is mapped to a color number.
A 3-d scatter plot is generated with ncolors TPolymarker3D objects attached
to the produced histogram list of functions.

Revision 5936 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 17 17:48:57 2003 UTC (12 years ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4253 byte(s)
Diff to previous 5918
Merge the functionality of the two previous classes TFileMap and TTreeFileMap
into a single new class TFileDrawMap.
See comments in TFileDrawMap for usage info.
make distclean is recommended

Revision 5918 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 15 18:48:16 2003 UTC (12 years ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4331 byte(s)
Diff to previous 5864
*** empty log message ***

Revision 5864 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 10 14:46:01 2003 UTC (12 years ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4253 byte(s)
Diff to previous 5339
Remove unused funcions GetMultiplicity and Loop

Revision 5339 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Sep 21 21:58:07 2002 UTC (12 years, 4 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4397 byte(s)
Diff to previous 4242
Remove references to TPacketGenerator from TVirtualTreePlayer and TTreePlayer.
These unused references required linking with libProof.

Revision 4242 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 26 07:05:57 2002 UTC (12 years, 10 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4577 byte(s)
Diff to previous 4038
This pacth from Philippe adds:

  - Support for 2D graphical Cuts for TClonesArray members
  - Support for 1D graphical Cuts by using their X minimum and
        maximum as ( Xmin <= Formula <= Xmax ).

  - Support for the following TTreeFormula special functions.

        Entry$   : return the current entry number (== TTree::GetReadEntry())
        Entries$ : return the total number of entries (== TTree::GetEntries())
        Length$  : return the total number of element of this formula for this
                        entry (==TTreeFormula::GetNdata())
        Iteration$: return the current iteration over this formula for this
                        entry (i.e. varies from 0 to LENGTH$).

  - Synchronization of the dimensions of all the formulas involved in
        a Draw call.

    For example for (with fMatrix[4][4] and fTracks[fNtrack].fVertex[3]
      T->Draw("fMatrix","fVertex>=2");

    The corrected result is histogram use something like:

        if (fTracks[0].fVertex[0]>=2) fMatrix[0][0];
        if (fTracks[0].fVertex[1]>=2) fMatrix[0][1];
        if (fTracks[0].fVertex[2]>=2) fMatrix[0][2];
        if (fTracks[1].fVertex[0]>=2) fMatrix[1][0];
        if (fTracks[1].fVertex[1]>=2) fMatrix[1][1];
        if (fTracks[1].fVertex[2]>=2) fMatrix[1][2];
        ....

    The old behavior was:

        if (fTracks[0].fVertex[0]>=2) fMatrix[0][0];
        if (fTracks[0].fVertex[1]>=2) fMatrix[0][1];
        if (fTracks[0].fVertex[2]>=2) fMatrix[0][2];
        if (fTracks[1].fVertex[0]>=2) fMatrix[0][3]; // note the extra step here.
        if (fTracks[1].fVertex[1]>=2) fMatrix[1][0];
        if (fTracks[1].fVertex[2]>=2) fMatrix[1][1];
        ....

Revision 4038 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 20 16:48:42 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4577 byte(s)
Diff to previous 1924
Add new functions GetNfill and GetMultiplicity.
These functions are necessary for the new THbookFile classes.

Revision 1924 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Apr 9 08:25:11 2001 UTC (13 years, 9 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4472 byte(s)
Diff to previous 1274
New function UpdateFormulaLeaves.
This function is called when loading a new Tree in a TChain.
This function calls TTReeFormula::UpdateFormulaLeaves for each TTreeFormula
object of a TTreePlayer.

Revision 1274 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 21 14:03:39 2000 UTC (14 years, 1 month ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4417 byte(s)
Diff to previous 1205
Remove dependency of libTree from libHist by moving TTree::UnbinnedFit
to TTreePlayer::UnbinnedFit. Same solution as for TTree::Fit.
In addition TTree::UnbinnedFit returns an Int_t instead of being void.

Revision 1205 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 13 15:13:57 2000 UTC (14 years, 1 month ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4230 byte(s)
Diff to previous 489
      W A R N I N G   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     ==================================================================
A very long list of changes in this pre-release of version 3.00.
We have modified the signature of many functions (in particular TObject)
to introduce more constness in the system.
You must change your code if your class derives from TObject and uses
one of the modified functions such as ls, Print, Compare, Hash, etc.
The modified functions in TObject have the following signature:
   virtual TObject    *Clone() const;
   virtual Int_t       Compare(const TObject *obj) const;
   virtual void        Delete(Option_t *option=""); // *MENU*
   virtual void        DrawClass() const; // *MENU*
   virtual void        DrawClone(Option_t *option="") const; // *MENU*
   virtual void        Dump() const; // *MENU*
   virtual TObject    *FindObject(const TObject *obj) const;
   virtual char       *GetObjectInfo(Int_t px, Int_t py) const;
   virtual ULong_t     Hash() const;
   virtual void        Inspect() const; // *MENU*
   virtual Bool_t      IsEqual(const TObject *obj) const;
   virtual void        ls(Option_t *option="") const;
   virtual void        Print(Option_t *option="") const;

A similar operation has been done with classes such as TH1, TVirtualPad,
TTree, etc.

Revision 489 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 17 09:47:00 2000 UTC (14 years, 5 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 4158 byte(s)
Diff to previous 385
Implement interface between trees and the principal components analysis class
TPrincipal.
The user interface is in TTree::Principal that calls the TTreePlayer::Principal
function. The specs of this interface are:
TPrincipal *TTree::Principal(const char *varexp, const char *selection, Option_t *option, Int_t nentries, Int_t firstentry)
{
//*-*-*-*-*-*-*-*-*Interface to the Principal Components Analysis class*-*-*
//*-*              ====================================================
//
//   Create an instance of TPrincipal
//   Fill it with the selected variables
//   if option "n" is specified, the TPrincipal object is filled with
//                 normalized variables.
//   If option "p" is specified, compute the principal components
//   If option "p" and "d" print results of analysis
//   If option "p" and "h" generate standard histograms
//   If option "p" and "c" generate code of conversion functions
//   return a pointer to the TPrincipal object. It is the user responsability
//   to delete this object.
//   The option default value is "np"
//
//   see TTree::Draw for explanation of the other parameters.
//
//   The created object is  named "principal" and a reference to it
//   is added to the list of specials Root objects.
//   you can retrieve a pointer to the created object via:
//      TPrincipal *principal =
//        (TPrincipal*)gROOT->GetListOfSpecials()->FindObject("principal");
//

Revision 385 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 18 16:35:01 2000 UTC (14 years, 6 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 3952 byte(s)
Diff to previous 382
Add new function TTree::MakeAnal
Modify signature of TTree::MakeClass, TVirtualTreePlayer::MakeClass
and TTreePlayer::MakeClass adding a second optional argument Option_t *option.
TTree::MakeAnal calls TTree::MakeClass with the 2nd arg = "anal"

TTree::MakeAnal generates the skeleton code to be used by TTree::Process.

Revision 382 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 17 10:26:41 2000 UTC (14 years, 6 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 3932 byte(s)
Diff to previous 346
TTree.h, TChain
=======
New data member  TString fProcessOption in the class TTree
This string contains the option passed to TTree::Process.
The option can be queried by TTree::GetProcessOption.

New function Int_t TTree::GetChainEntryNumber(Int_t entry)
    This function returns directly entry
New function Int_t TChain::GetChainEntryNumber(Int_t entry)
    This function returns the absolute entry number in the chain
    corresponding to the local TTree entry number entry.

The TTree::Process functions have a new optional argument Option_t (option.
same for TChain::Process, TVirtualTreePlayer and TTreePlayer

TSelector, TSelectorCint
=========
Add new functions
   virtual Bool_t      ExecuteNotify();
   virtual Bool_t      Notify() {return kTRUE;}

ExecuteNotify calls the user class function Notify when
TTree::Process starts the first entry in a file of a chain.

TTreePlayer
===========
Implememt the logic to call the new functions TSelector::ExecuteNotify

Revision 346 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 10 06:17:57 2000 UTC (14 years, 6 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 3892 byte(s)
Diff to previous 318
Implement the new function TTree::Process and the corresponding function(s)
in TTreePlayer.
The main function in TTreePlayer is
 TTreePlayer::Process(TSelector *selector, Int_t nentries, Int_t firstentry)
This new function exploits the new class TSelector to initialize, select,
analyze and terminate the user code referenced by the selector.
This function is now called by
 TTreePlayer::Process(const char *filename, Int_t nentries, Int_t firstentry)

The code in the class derived from TSelector may be interpreted or compiled.

Revision 318 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 3 10:11:04 2000 UTC (14 years, 6 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 3817 byte(s)
Diff to previous 121
The following functions have their signature changed from void to Int_t
The TTree::Draw, Fit, Process, Project and Scan functions returns the number
of selected events.

    virtual Int_t     Draw(TCut varexp, TCut selection, Option_t *option=""
                       ,Int_t nentries=1000000000, Int_t firstentry=0);
    virtual Int_t     Draw(const char *varexp, const char *selection, Option_t *option=""
                       ,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
    virtual Int_t     Fit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option="" ,Option_t *goption=""
                       ,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*

    virtual Int_t     Process(const char *filename, Option_t *option=""
                       ,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
    virtual Int_t     Project(const char *hname, const char *varexp, const char *selection="", Option_t *option=""
                       ,Int_t nentries=1000000000, Int_t firstentry=0);
    virtual Int_t     Scan(const char *varexp="", const char *selection="", Option_t *option=""
                       ,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*


The function TTree::Process is a new function:

//   The code in filename is loaded (interpreted or compiled , see below)
//   filename must contain a valid class implementation derived from TTreeProcess.
//   where TTreeProcess has the following member functions:
//     void TTreeProcess::Begin(). This function is called before looping on the
//          events in the Tree. The user can create his histograms in this function.
//
//     Bool_t TTreeProcess::Select(Int_t entry). This function is called
//          before processing entry. It is the user's responsability to read
//          the corresponding entry in memory (may be just a partial read).
//          The function returns kTRUE if the entry must be processed,
//          kFALSE otherwise.
//     void TTreeProcess::Analyze(Int_t entry). This function is called for
//          all selected events. User fills histograms in this function.
//     void TTreeProcess::Finish(). This function is called at the end of
//          the loop on all events.
//
//   if filename is of the form file.C, the file will be interpreted.
//   if filename is of the form file.C++, the file file.C will be compiled
//      and dynamically loaded. The corresponding binary file and shared library
//      will be deleted at the end of the function.
//   if filename is of the form file.C+, the file file.C will be compiled
//      and dynamically loaded. The corresponding binary file and shared library
//      will be kept at the end of the function. At next call, if file.C
//      is older than file.o and file.so, the file.C is not compiled, only
//      file.so is loaded.
//
//   The function returns the number of processed entries. It returns -1
//   in case of an error.

The correesponding modifications have been made in TChain, TVirtualTreePlayer
and TTreePlayer

Revision 121 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 13 09:21:09 2000 UTC (14 years, 7 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 3657 byte(s)
Diff to previous 47
- Mods in TVirtualtreePlayer.h. The return type for GetV1, GetV2, GetV3
  changed from Float_t* to Double_t*. This is a backward incompatibility.

Revision 47 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 29 06:19:21 2000 UTC (14 years, 7 months ago) by brun
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 3660 byte(s)
Diff to previous 3
//  29 May
- Add the following note in the TPave, TPaveLabel and TPaveText constructors:
    IMPORTANT NOTE:
    Because TPave objects (and objects deriving from TPave) have their
    master coordinate system in NDC, one cannot use the TBox functions
    SetX1,SetY1,SetX2,SetY2 to change the corner coordinates. One should use
    instead SetX1NDC, SetY1NDC, SetX2NDC, SetY2NDC.

   28 May
- Modify THistPainter::PaintStat and PaintStat2 to use the TLatex character #pm
  instead of +-

//     27 May
- Add new member functions:
    Int_t TVirtualTreePlayer::GetDimension()
    Int_t TTreePlayer::GetDimension()
  GetDimension returns the number of dimensions in the TTree::Draw expression.

- Add new function in TTree;
   void TTree::UnbinnedFit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option=""
                       ,Int_t nentries=1000000000, Int_t firstentry=0);
   This function (origin Stephen Bailey) performs an unbinned fit to the
   variable(s) given in varexp.

- Remove unused data member fDimension from class TTree.

- Introduce support for "Virtuality" in TLeafObject.
  New data member fVirtual added and corresponding IsVirtual/SetVirtual functions.
  By default, fVirtual is kTRUE.
  This change allows new interesting possibilities in split mode. For example
  if a member is TShape *fShape, a real object may be now of any type
  derived from TShape (eg, TTUBE, TBRIK, etc).
  With the previous version, the fShape object had to be of the declared
  type TShape only.
  When writing a TLeafObject, the class name of the object is now written in
  the branch buffer by TLeafObject::FillBasket. When TLeafObject::ReadBasket
  is called, an instance of the real class is built and its Streamer function
  called.
  This change is backward compatible. Old files can still be processed.
  It is possible to set the virtuality for the branch to kFALSE via
  TLeafObject::SetVirtual. Setting the virtuality to kFALSE makes
  writing and reading faster and the file slightly smaller. In this case,
  a TLeafObject must be of the type declared only.

- New minor changes in TGaxis (Damir Buskulic) for date/time format
  in case the start time is not an integer value.

- Modify tutorial psexam.C to set the TPaveText TextFont to 61 instead of 62.
  Font precision 1 bypass the TLatex logic.

- Mods in TLatex to remove the special treatment for characters ' and ".
  Strings like l'#acute{e}toile  are now correctly processed.

- Fix a bug in TGraph::GetFunction. (thanks Damon Spayde). The test
    if (fFunctions)  return 0;  replaced by
    if (!fFunctions) return 0;

Revision 3 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 16 17:00:58 2000 UTC (14 years, 8 months ago) by rdm
Original Path: trunk/tree/inc/TVirtualTreePlayer.h
File length: 3549 byte(s)
Copied from: branches/rdm/tree/inc/TVirtualTreePlayer.h revision 2
Diff to previous 2
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.

Revision 2 - (view) (download) (as text) (annotate) - [select for diffs]
Added Tue May 16 17:00:58 2000 UTC (14 years, 8 months ago) by rdm
Original Path: branches/rdm/tree/inc/TVirtualTreePlayer.h
File length: 3549 byte(s)
Initial import of ROOT into CVS

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9