Log of /trunk/tree/treeplayer/inc/TBranchProxy.h
Parent Directory
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
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
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
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
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
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.