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

Log of /trunk/tree/treeplayer/inc/TBranchProxy.h

Parent Directory Parent Directory


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

Revision 48516 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 8 18:38:17 2013 UTC (23 months, 2 weeks ago) by rdm
File length: 39599 byte(s)
Diff to previous 44507
put Error in global scope so the pch generation works.

Revision 44507 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 4 12:30:41 2012 UTC (2 years, 7 months ago) by axel
File length: 39560 byte(s)
Diff to previous 43509
Remove
  using namespace std;
from Riostream.h, which has huge consequences for all of ROOT.
Riostream.h is now a simple wrapper for fstream, iostream, iomanip for backward compatibility; Riosfwd.h simply wraps iosfwd.

Because of templates and their inline functions, Riostream.h needed to be included in headers, too (e.g. TParameter.h), which violated the assumption that Riostream.h is not exposing its using namespace std to headers.
ROOT now requires R__ANSISTREAM, R__SSTREAM, which does not change the set of supported compilers.

Without "using namespace std", several identifiers are now prefixed by std::; e.g. roofit/* source files now have a using namespace std to keep their coding style.
TFile::MakeProject() now generates "using namespace std" to convert the CINT-style class names into C++ ones.

Revision 43509 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 27 16:23:11 2012 UTC (2 years, 9 months ago) by pcanal
File length: 39360 byte(s)
Diff to previous 41244
In MakeProxy properly recognized the TLeafC as a string and enhance
the proxy for string to support the Data member function and to add
a direct operator const char*().

Revision 41244 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Oct 6 19:42:35 2011 UTC (3 years, 3 months ago) by pcanal
File length: 39118 byte(s)
Diff to previous 36449
Fix Coverity issues:

TBranchSTL: cov 34339 Resource leak (false positive)
TTableDescriptor.cxx: cov 34219,34220 explicit null dereference
TSQLStructure.cxx: cov 34204,34205,34206 Explicit null dereferenced 
TTabCom.cxx: cov 34168 Explicit null dereferenced 
TClassRef.cxx: cove 34165 Explicit null dereferenced (false positive but still confusing coding).
TBufferXML.cxx: 34070 Explicit null dereferenced
TFriendProxyDescriptor.cxx: cov 34066 Uninitialized scalar field
TTreeCloner.cxx: cov 34034057 Dereference null return (stat) 63 Uninitialized scalar field 
TParallelCoordEditor.cxx: 34051,34059,34060,34061 Dereference null return value
TParallelCoord.cxx: 34050,34056, 34057 Dereference null return (stat) 
TBranchProxy.h: 34048 Dereference null return value 
TBranchProxy.cxx: 34043,34044,34045 Dereference null return value
TTree.cxx: 34039 Dereference null return value
TTreePlayer.cxx: 34037 Dereference null return value 
TLeafC.cxx: 34036 Dereference null return value

Revision 36449 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Oct 28 20:52:17 2010 UTC (4 years, 2 months ago) by pcanal
File length: 39110 byte(s)
Diff to previous 35344
Fix several issues with then handling of vector of object related to the bug report:
<http://savannah.cern.ch/bugs/?74451>

Revision 35344 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 16 21:34:21 2010 UTC (4 years, 4 months ago) by pcanal
File length: 39058 byte(s)
Diff to previous 34239
Fix Coverity reports

G__ci.h: #11161 missing initialization
common.h: #11161 missing initialization
error.cxx: #20793 Array compared against 0
init.cxx: #11712 explicit null derefence
macro.cxx: #10192 missing initialization
shl.cxx: #10626,10627 constant expression result

TBranchProxy.h: #10047 unchecked return value
TTreeProxyGenerator.cxx: #10059,#10060 enum as boolean
TClassEdit.cxx: #11546,#11734 forward null pointer
TStreamerInfoWriteBuffer.cxx: #11572, #11573 forward null pointer
TTreeFormula.cxx: #11587,#11588,#11592 forward null pointer
   #11618,#11619 unckecked dynamic cast
TTreePlayer.cxx:  #11984,#11985,#11986 dereference after null check
TTreeIndex.cxx: #11596  unckecked dynamic cast
TChainIndex.cxx: #11597,#11988 unckecked dynamic cast
TOracleServer.cxx: #11898 dereference after null check
TH1.cxx: #11983 dereference after null check
TFileDrawMap.cxx: $10896 copy into fixed size buffer

Revision 34239 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 30 12:59:51 2010 UTC (4 years, 6 months ago) by brun
File length: 38957 byte(s)
Diff to previous 27129
Fix missing armuments in format statements

Revision 27129 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 13 08:22:29 2009 UTC (6 years ago) by pcanal
File length: 38947 byte(s)
Diff to previous 22902
a few more slight improvements in TTree Proxy

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: 38902 byte(s)
Diff to previous 21709
move tree, treeplayer and treeviewer under tree meta directory.

Revision 21709 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 15 08:07:55 2008 UTC (7 years ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 38902 byte(s)
Diff to previous 21708
remove warning

Revision 21708 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 15 08:04:15 2008 UTC (7 years ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 38888 byte(s)
Diff to previous 21547
Prevent ambiguity regarding operator[]

Revision 21547 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 20 18:19:50 2007 UTC (7 years, 1 month ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 38471 byte(s)
Diff to previous 21510
Add ClassImp and doc markers

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/treeplayer/inc/TBranchProxy.h
File length: 37512 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/treeplayer/inc/TBranchProxy.h
File length: 27540 byte(s)
Diff to previous 20173
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 20173 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 2 11:52:49 2007 UTC (7 years, 3 months ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 27540 byte(s)
Diff to previous 19826
Second batch of changes to support the new type Float16_t.

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/treeplayer/inc/TBranchProxy.h
File length: 27166 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/treeplayer/inc/TBranchProxy.h
File length: 27219 byte(s)
Diff to previous 19631
remove :$ from tag line

Revision 19631 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 16 21:27:42 2007 UTC (7 years, 5 months ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 27229 byte(s)
Diff to previous 19542
From Axel:
when you ask a TBranchProxy of a split TClonesArray how many entries the
TCA has, it will only ready the entries member - and still think that it
has read the complete TCA. So all following accesses to the elements
contained in the TCA will return invalid objects. Attached patch fixes
that by not setting fRead when only the number of entries has been read.
It introduces a slight performance penalty for multiple
ClonesProxy/GetEntries() calls.

Revision 19542 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 3 16:53:25 2007 UTC (7 years, 5 months ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 27155 byte(s)
Diff to previous 19541
Fix a compiler warning about a variable possibly not initialized.

Revision 19541 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 3 15:41:02 2007 UTC (7 years, 5 months ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 27153 byte(s)
Diff to previous 19540
Fix compilation on mac

Revision 19540 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 3 13:33:49 2007 UTC (7 years, 5 months ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 27150 byte(s)
Diff to previous 19438
Add support for STL containers in MakeProxy

Revision 19438 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 23 17:07:48 2007 UTC (7 years, 6 months ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 19760 byte(s)
Diff to previous 18934
Rewrite the parsing of the TBranchElement by looping over the TStreamerElement
instead of the TBranchElement (hence emulating somewhat unroll instead of
guessing the connection between branch and element)
Fix support for base class (in particular when inside a TClonesArray)
Fix support for sub-objects without their own branch ('missing node').

Revision 18934 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 4 17:07:17 2007 UTC (7 years, 7 months ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 19309 byte(s)
Diff to previous 17615
Extend the support for multi dimensional arrays by replacing the T*Array2*Proxy
and T*Array3*Proxy by a completely generic T*Array*Proxy.
Add a few to retrive quickly the size of a (split) TClonesArray (by calling
GetEntries directly on the proxy object).

Revision 17615 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Feb 1 15:26:19 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21358 byte(s)
Diff to previous 12602
Use forward declarations instead of includes.

Revision 12602 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Sep 3 02:26:31 2005 UTC (9 years, 4 months ago) by pcanal
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21399 byte(s)
Diff to previous 10992
Fix to follow coding conventions

Revision 10992 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 27 06:16:43 2005 UTC (9 years, 11 months ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21384 byte(s)
Diff to previous 10958
From Philippe:
This add support for a few additional cases in MakeProxy (namely
TClonesArray in a TBranchObject, non-split top level objects when library is
loaded).

Revision 10958 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 19 18:30:58 2005 UTC (10 years ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21325 byte(s)
Diff to previous 10345
From Philippe:
This patch implement support for bool of various in memory size.  They are
always written using only 1 bytes.  This solves problem on MacOS where
sizeof(bool)==4 instead of 1.

Note that there should still be a problem with the old-style splitted branch
(tested in Event.old.split.root.
A fix for this will come later on.

Revision 10345 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 18 21:07:05 2004 UTC (10 years, 3 months ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21118 byte(s)
Diff to previous 9617
From Philippe:
This patch fix a problem with the compilation of the generated proxy on
Windows.

Revision 9617 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 29 18:09:40 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21040 byte(s)
Diff to previous 9335
From Philippe
Changes (Int_t to Long64_t) to be consistent with the other changes in TBranch, TTree

Revision 9335 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 28 16:38:00 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21024 byte(s)
Diff to previous 9326
From Philippe:
Fix a problem with CR/LF characters at the end of the lines
giving a problem with gcc2.95

Revision 9326 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 25 22:45:41 2004 UTC (10 years, 7 months ago) by rdm
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21648 byte(s)
Diff to previous 9323
correct multiple inclusion ifdefs, must be of the form ROOT_<filename - .h>.

Revision 9323 - (view) (download) (as text) (annotate) - [select for diffs]
Added Fri Jun 25 18:42:19 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/treeplayer/inc/TBranchProxy.h
File length: 21383 byte(s)
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).

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