Log of /trunk/tree/treeplayer/src/TTreePlayer.cxx
Parent Directory
Revision
48046 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Dec 14 15:35:16 2012 UTC (2 years, 1 month ago) by
rdm
File length: 123449 byte(s)
Diff to
previous 47612
From Ioan:
Replace the trunk code that uses the deprecated TH1::kCanRebin bit with
the new methods TH1::CanExtendAllAxes() and TH1::SetCanExtend() - see r47909,
r48012 and r48031. The old TH1::kCanRebin bit did not really have much to
do with histogram rebinning, but rather with extending the limits of the
histogram's axes (which can cause a rebin, but only in some cases). As such,
the word "Rebin" has been replaced with "Extend" for the new methods.
Rename TH1::RebinAxis() to TH1::ExtendAxis() for the reasons stated above.
The TH1::RebinAxis() method will be kept in v6-00 for backward compatibility
with an obsolete warning and will be removed in v6-02. The current
implementation simply forwards the call to TH1::ExtendAxis().
Revision
46190 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 25 20:24:14 2012 UTC (2 years, 3 months ago) by
pcanal
File length: 122981 byte(s)
Diff to
previous 45195
Add support for the filenames (platform dependent :() given by cling for STL collection and common structs [To be replaced by new interface/API in core/meta when available]
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: 122423 byte(s)
Diff to
previous 43596
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
42754 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 20 20:13:07 2012 UTC (3 years ago) by
pcanal
File length: 122335 byte(s)
Diff to
previous 41643
From Peter van Gemmeren:
Allow multiple read caches per file by adding a fCacheReadMap member and owner arguments to GetCacheRead() and SetCacheRead()
to TFile.
Index: io/io/inc/TFileCacheRead.h
Index: io/io/src/TFileCacheRead.cxx
* Adding new argument for constructor to specify TTree owner
* whitespace indents
Index: tree/tree/inc/TBasket.h
Index: tree/tree/src/TBasket.cxx
* Add optional tree owner argument to LoadBasketBuffers() to retrieve cache.
* In LoadBasketBuffers() and ReadBuffers() check the cache first than call TFile::ReadBuffer only if needed.
Index: tree/tree/inc/TChain.h
Index: tree/tree/src/TChain.cxx
* Override SetCacheSize() function to update TTree owner on the current cache.
* whitespace indents
Index: tree/tree/src/TTree.cxx
* Get TTreeCache for current TTree, by specifying owner in GetCacheRead() calls
* Always delete owned cache
Index: tree/tree/src/TTreeCache.cxx
* Adding new argument for constructor for TFileCacheRead to specify TTree owner
Index: tree/treeplayer/src/TTreePlayer.cxx
* Get TTreeCache for current TTree, by specifying owner in GetCacheRead() calls
Index: tree/tree/src/TTreeCloner.cxx
* Call TBasket::LoadBasketBuffers() with current TTree as owner of cache
Index: proof/proofplayer/src/TEventIter.cxx
* Get TTreeCache for current TTree, by specifying owner in GetCacheRead() and SetCacheRead() calls
Revision
41318 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 11 08:48:03 2011 UTC (3 years, 3 months ago) by
pcanal
File length: 121582 byte(s)
Diff to
previous 41244
Fix Coverity issues:
TTreePlayer.cxx: another instance of 34037 Dereference null return value
TBranchElement.cxx: 2nd attempt for 34040,34042 Dereference null return (stat)
TTabCom.cxx: another instance of 34168 Explicit null dereferenced
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: 121573 byte(s)
Diff to
previous 40915
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
39073 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon May 2 19:07:42 2011 UTC (3 years, 8 months ago) by
pcanal
File length: 120585 byte(s)
Diff to
previous 38936
Issue an error message when MakeClass/MakeSelector detects that a branch address can not be properly set:
Error in <TTreePlayer::MakeClass>: The branch named E (full path name: E.E) is hidden by another branch of the same name and its data will not be loaded.
Revision
38936 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Apr 19 21:06:30 2011 UTC (3 years, 9 months ago) by
pcanal
File length: 120113 byte(s)
Diff to
previous 38869
Merge the documentation that was duplicated in TTree and TTreePlayer and remove the duplicate from TTreePlayer. Fix grammar in TLeaf/TBranch
Revision
38869 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 15 11:29:04 2011 UTC (3 years, 9 months ago) by
pcanal
File length: 151834 byte(s)
Diff to
previous 38784
Patch to correctly honour selector abort status settings in TTreePlayer::Process. Currently only
the TSelector::kAbortProcess was handled by stopping processing. In particular
TSelector::kAbortFile was ignored; this recently created some problems in ALICE
with corrupted files, with repeated attempts to read events eventually leading to
bad_alloc exceptions.
Revision
38784 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 8 20:26:27 2011 UTC (3 years, 9 months ago) by
pcanal
File length: 151582 byte(s)
Diff to
previous 38774
Avoid relying on gDirectory to be 'correct' when generating a MakeClass nor when executing it (in the case where the file is already open
Revision
38774 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 7 22:24:23 2011 UTC (3 years, 9 months ago) by
pcanal
File length: 151405 byte(s)
Diff to
previous 38741
In the genereated TSelector::LoadTree do not unnecessarily check for the actual type of fChain (virtuality is just fine here)
Revision
38741 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Apr 5 18:12:39 2011 UTC (3 years, 9 months ago) by
pcanal
File length: 151548 byte(s)
Diff to
previous 37839
Copy documentation explained the length of the array returned by TSelectorDraw::GetVal. Add reference to this documentation in the other related function GetV1, etc. in TSelectorDraw, TTreePlayer and TTree.
Revision
37839 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 21 17:22:08 2011 UTC (4 years ago) by
pcanal
File length: 151281 byte(s)
Diff to
previous 37409
Allow the output name passed to MakeProxy to be either a classname (to which will be added .h to make the filename) or a filename (which already has an extension)
Revision
35450 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 20 12:36:11 2010 UTC (4 years, 4 months ago) by
pcanal
File length: 150830 byte(s)
Diff to
previous 35427
Fix Coverity reports
TDatabasePDG.cxx: #11418 getc returns an int
TTree.cxx: #10577 unused variable
TTreeFormula.cxx: #10795,#10796,#13272,#13273,#13274,#14173 strcat -> strncat, strcpy -> strncpy
TTreePlayer.cxx: #10891,#10892,#14169,#14170,#14172 strcpy -> strncpy
TStreamerElement.cxx: #12537,#13200,#13318,#13586,#13587,#13588,#13589,#13590,#13591,#13596,#13597,#13598 strcpy,sprintf -> strncpy,snprintf (or TString)
TStreamerInfo.cxx: #13470,#13787,#13788 strcpy,sprintf -> strncpy,snprintf (or TString)
TBranchProxy.cxx: null pointer dereference.
TBranch.cxx: #10689 null pointer dereference.
loadfile.cxx: #10767,#12387.#12388,#12389,#12521,#12522,#13514,etc.. strcpy,sprintf -> strncpy,snprintf (or TString)
TFileDrawMap.cxx: #10893,#10894,#10895,#13460,#14176,#14177,#14718,#14179 strcpy,sprintf -> strncpy,snprintf (or TString)
TFile.cxx: #13789,#13193,#13450 strcpy,sprintf -> strncpy,snprintf (or TString)
TMethod.cxx: #10802,#13310 strcpy,sprintf -> strncpy,snprintf (or TString)
TClass.cxx: #10814,#13122,#13467,#13468,#13490 strcpy,sprintf -> strncpy,snprintf (or TString)
TDataMember.cxx: #10825,#13241,#13329,#13330,#13584 strcpy,sprintf -> strncpy,snprintf (or TString)
TFormula.cxx: #13263,#13783 sprintf -> snprintf or TString
stlLoader.cxx: #13599 static array -> G__FastAllocString
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: 150520 byte(s)
Diff to
previous 35189
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
33330 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 30 21:19:53 2010 UTC (4 years, 8 months ago) by
pcanal
File length: 150410 byte(s)
Diff to
previous 32930
Avoid attempting to print the content of empty TClonesArray even if this 'content' are strings (see roottest/root/treeformula/scan/execmissingString.C)
Revision
32930 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 9 16:18:32 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 150386 byte(s)
Diff to
previous 32881
Prefer the use of InheritsFrom(TClass*) over InheritsFrom(const char*) as long as
it does not increase the library dependencies.
Revision
32028 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 15 10:24:33 2010 UTC (5 years ago) by
pcanal
File length: 149133 byte(s)
Diff to
previous 31752
In TTree::Draw: Avoid confusing '2000<var' with in a file name '2000' (due to IsFileInIncludePath stripping what it thinks to be an I/O indirection)
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: 148785 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
30157 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 14 20:12:53 2009 UTC (5 years, 4 months ago) by
pcanal
File length: 148770 byte(s)
Diff to
previous 29656
In TFormula and TTreeFormula add support for the ternary condition operator ( c ? i : e )
In TSplot, TSpider, TSelectorDraw, TTreePlayer, TTreeTableInterface update the parsing
of colon separated line to properly handle the ternary condition operator, reduce
code duplication and fix existing parsing bugs (due to the 'almost' duplicated code
syndrome):
- Removed TSelectorDraw::MakeIndex and TSelectorDraw::GetNameByIndex
- Added TSelectorDraw::SplitNames to replace those 2 function plus pre-processing code
that was always used in conjunction with their calls.
- Updated the calling points to use TSelectorDraw::SplitNames.
- Removed the unused (and incorrect) TTree::MakeIndex and TTree::GetNameByIndex.
Revision
29656 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 31 16:14:49 2009 UTC (5 years, 5 months ago) by
pcanal
File length: 149925 byte(s)
Diff to
previous 29317
Add new special function in TTreeFormula (and hence TTree::Draw and TTree::Scan) to calculate the minimun and maximum with an entry:
Min$(formula),Max$(formula):
return the minimun/maximum (within one TTree entry) of the value of the elements of the formula given as a parameter.
MinIf$(formula,condition),MaxIf$(formula,condition):
return the minimum (maximum) (within one TTree entry) of the value of the elements of the formula given as a parameter if they match the condition. If not element match the condition, the result is zero. To avoid the the result is zero. To avoid the consequent peak a zero, use the pattern:
tree->Draw("MinIf$(formula,condition)","condition");
which will avoid calculation MinIf$ for the entries that have no match for the condition.
Revision
28526 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon May 11 15:10:59 2009 UTC (5 years, 8 months ago) by
brun
File length: 148100 byte(s)
Diff to
previous 27127
The logic to invoke TGl5D is moved to TTreePlayer.
TTree::SetEstimate is automatically cally when option "gl5d" is specified.
A GL canvas is automatically created when option "gl5d" is specified.
Revision
27127 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jan 13 05:54:09 2009 UTC (6 years ago) by
pcanal
File length: 147544 byte(s)
Diff to
previous 26241
Significantly improve performance of TTree Proxy by using an 'interface' base class instead of CINT to allow support optional within the user's script. (This brings TTree Proxy from being 50% slower than the optimal case (for h1analysis) to being within the measurement incertainty of this optimal).
Revision
25572 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Sep 27 07:03:25 2008 UTC (6 years, 3 months ago) by
pcanal
File length: 149463 byte(s)
Diff to
previous 25365
Fix tree->Draw("s1.value"); when the top level branch does not have a trailing dot
(and hence the real branch name is only 'value').
TTreeFormula was properly parsing the string and finding the correct branch, however
it was recorded only the end branch name as the result of the parse (i.e. in the
above case, just 'value') and hence UpdateFormulaLeaves was not restoring the leaf
correctly (and hence EvalInstance returned 0s).
To solve the issue we now record the 'full pathname' of the branch (i.e. including
the omitted top level branch names) and we upgrade TTree::FindBranch and
TBranchElement::FindBranch to be able to handle those path.
Fix TTree::Scan("*") to properly requested the distinct leaf even if the branch
name are ambiguous (previously it would repetively print the first match).
Revision
19589 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 10 10:09:52 2007 UTC (7 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 148084 byte(s)
Diff to
previous 19580
From Bastien:
Fixed: TParallelCoordVar.cxx: The extreme bins of the axes histograms are now properly diplayed.
Fixed: TParallelCoordVar.cxx, TParallelCoordVar.h: The histograms, minimums, maximums, averages and quantiles are now updated when changing the entries to display.
Fixed: TParallelCoord.cxx, TParallelCoordVar.cxx, TParallelCoordRange.cxx, TParallelCoordEditor.cxx: Several not portable C++ expressions has been changed.
Added: TParallelCoordEditor.cxx, TParallelCoordEditor.h: Better interface to display or not bar histograms.
Added: TTreePlayer.cxx: Added documentation to TTreePlayer::DrawSelect.
Added: TTree.cxx: Added documentation to TTree::Draw.
Added: TSelectorDraw.cxx: Protection in TSelectorDraw::Begin if there is more than 4 dimensions and neither the option "para", "candle" or "goff" are activated.
Added: TParallelCoord.cxx: The "Apply to tree" button now also update the selected entries drawn on the TParallelCoord.
Added: TParallelCoord.cxx, TParallelCoord.h: An initial entry list is defined. Calling TParallelCoord::ResetTree will produce the same output as when first initialized.
Fixed: TParallelCoordEditor.cxx, TParallelCoordEditor.h: Fixed seg faults from bad management of the TGComboBox.
Fixed: TParallelCoordVar.cxx: Fixed seg fault when computing the quantiles.
Revision
19569 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Aug 8 12:58:13 2007 UTC (7 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 147297 byte(s)
Diff to
previous 19112
From Bastien DallaPiazza:
treeplayer/src/TTreePlayer.cxx:
Add the options "para" and "candle" to TTreePlayer::DrawSelect.
The option "para" brings a parallel coordinates plot.
The option "candle" brings a candle stick chart.
treeplayer/src/TSelectorDraw.cxx:
Add some code in TSelectorDraw::Begin, TSelectorDraw::TakeAction and
TSelectorDraw::TakeEstimate to draw parallel coordinates plots and candle
stick charts.
Revision
19112 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 21 15:42:50 2007 UTC (7 years, 7 months ago) by
pcanal
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 146760 byte(s)
Diff to
previous 18934
Modify TChain::GetReadEntry to now returns the current entry of the chain
instead of the underlying tree. (To get the previous value do
mychain->GetTree()->GetReadEntry()). Thus Entry$ nows returns/draws/scans
the value of the entry number in the chain.
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/src/TTreePlayer.cxx
File length: 146537 byte(s)
Diff to
previous 18637
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
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/treeplayer/src/TTreePlayer.cxx
File length: 144904 byte(s)
Diff to
previous 18438
-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
17846 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Feb 10 07:36:56 2007 UTC (7 years, 11 months ago) by
pcanal
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 143432 byte(s)
Diff to
previous 17773
Change fSelectorUpdate from Bool_t to TSelector* to hold the value
of the selector being processed so that UpdateFormulaLeaves can update it
instead of blindly update the possibly
idle fSelector __and__ the possibly invalid (because of file reload)
fSelectorFromFile. (This resolves the crash in roottest/root/tree/selector)
Revision
17422 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 22 07:57:14 2007 UTC (8 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 143443 byte(s)
Diff to
previous 16877
From Anna:
Extend the functionality of TEntryList and add the following info in TTree::Draw
// Saving the result of Draw to a TEventList or a TEntryList
// =========================================================
// TTree::Draw can be used to fill a TEventList object (list of entry numbers)
// instead of histogramming one variable.
// If varexp0 has the form >>elist , a TEventList object named "elist"
// is created in the current directory. elist will contain the list
// of entry numbers satisfying the current selection.
// If option "entrylist" is used, a TEntryList object is created
// Example:
// tree.Draw(">>yplus","y>0")
// will create a TEventList object named "yplus" in the current directory.
// In an interactive session, one can type (after TTree::Draw)
// yplus.Print("all")
// to print the list of entry numbers in the list.
// tree.Draw(">>yplus", "y>0", "entrylist")
// will create a TEntryList object names "yplus" in the current directory
//
// By default, the specified entry list is reset.
// To continue to append data to an existing list, use "+" in front
// of the list name;
// tree.Draw(">>+yplus","y>0")
// will not reset yplus, but will enter the selected entries at the end
// of the existing list.
//
// Using a TEventList or a TEntryList as Input
// ===========================
// Once a TEventList or a TEntryList object has been generated, it can be used as input
// for TTree::Draw. Use TTree::SetEventList or TTree::SetEntryList to set the
// current event list
// Example1:
// TEventList *elist = (TEventList*)gDirectory->Get("yplus");
// tree->SetEventList(elist);
// tree->Draw("py");
// Example2:
// TEntryList *elist = (TEntryList*)gDirectory->Get("yplus");
// tree->SetEntryList(elist);
// tree->Draw("py");
// If a TEventList object is used as input, a new TEntryList object is created
// inside the SetEventList function. In case of a TChain, all tree headers are loaded
// for this transformation. This new object is owned by the chain and is deleted
// with it, unless the user extracts it by calling GetEntryList() function.
// See also comments to SetEventList() function of TTree and TChain.
//
// If arrays are used in the selection critera, the entry entered in the
// list are all the entries that have at least one element of the array that
// satisfy the selection.
// Example:
// tree.Draw(">>pyplus","fTracks.fPy>0");
// tree->SetEventList(pyplus);
// tree->Draw("fTracks.fPy");
// will draw the fPy of ALL tracks in event with at least one track with
// a positive fPy.
//
// To select only the elements that did match the original selection
// use TEventList::SetReapplyCut or TEntryList::SetReapplyCut.
// Example:
// tree.Draw(">>pyplus","fTracks.fPy>0");
// pyplus->SetReapplyCut(kTRUE);
// tree->SetEventList(pyplus);
// tree->Draw("fTracks.fPy");
// will draw the fPy of only the tracks that have a positive fPy.
//
// Note: Use tree->SetEventList(0) if you do not want use the list as input.
Revision
16532 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Oct 15 20:08:33 2006 UTC (8 years, 3 months ago) by
pcanal
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 141244 byte(s)
Diff to
previous 16287
From Jason Detwiler:
Allow more formatting options for TTree::Scan.
In the option paramater (after col=), the format strings should
follow the printf format specification. The value given will
be prefixed by % and, if no conversion specifier is given, will
be suffixed by the letter g.
For example:
tree->Scan("val:flag:flag:c:cstr", "", "col=::#x:c:");
where val is float, flag an int, c a char and cstr a char*
now prints:
************************************************************************
* Row * val * flag * flag * c * cstr *
************************************************************************
* 0 * 0 * 1 * 0x1 * a * i00 *
* 1 * 1.1 * 2 * 0x2 * b * i01 *
Revision
16245 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Sep 13 05:08:35 2006 UTC (8 years, 4 months ago) by
pcanal
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 138868 byte(s)
Diff to
previous 16177
TTreeFormula (and hence TTree::Draw) is now able to plot objects of
any class which has either AsDouble or AsString (AsDouble has
priority). So for such a class (for example TTimeStamp):
tree->Draw("myTimeStamp");
will plot the same as:
tree->Draw("myTimeStamp.AsDouble");
AsString can be returning either a char*, or a TString or an std::string
Revision
15935 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Aug 6 07:15:01 2006 UTC (8 years, 5 months ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 138087 byte(s)
Diff to
previous 15890
Handle several issues related to the TTree::Process() and TTree::Draw()
return values:
- TSelector: fStatus increased from Int_t to Long64_t. It is used to
return the number of selected events by TTree::Draw() which returns
a Long64_t.
- TVirtualProof, TProof, TDSet, TProofPlayer: Process() and Draw() were
returning an Int_t, now a Long64_t to be consistent with TTree/TChain.
Actually returning of TSelector::GetStatus() from the workers to be
done tomorrow.
Also added proper comments describing the return values for Draw()
(number of selected events), and Process() (value returned by
TSelector::GetStatus()).
- TTree, TChain, TSelectorDraw: added proper comments describing the
return values of Draw() and Process().
Revision
15690 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 4 23:35:37 2006 UTC (8 years, 6 months ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 137845 byte(s)
Diff to
previous 15591
Some new features in TSelector and derivatives:
- new method Abort() which allows Process() to be aborted by the user
from within the selector. After Abort(), either the Process() is aborted
or the current file is aborted and the next file in a chain will be
processed. Abort() can also be called from Begin(), SlaveBegin(),
Init() and Notify() to interrupt processing. In all cases SlaveTerminate()
and Terminate() are still called.
- new method GetEntry() which is a wrapper around:
fChain->GetTree()->GetEntry()
- GetStatus() now also implemented in TSelectorCint so the selector
fStatus is correctly reported back by TTree::Process() also for
interpreted selectors (also documented in the generated selector).
- documented in the generated selector code that the boolean return
values of Notify() and Process() are not used.
- fixed a bug in TProofPlayer() that caused Init() and Notify() to be
called for every packet and not once per file.
Revision
15572 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 27 14:36:28 2006 UTC (8 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 137313 byte(s)
Diff to
previous 15536
-Rename class TFilePrefetch -> TFileCacheRead
-Rename class TTreeFilePrefetch -> TTreeCache
-Add new class TFileCacheWrite that implements automatic caching
when writing network files. This class replaces the previous class TCache.
-old TCache class deleted.
-TFileCacheRead can read buffers from the wite cache in TFileCacheWrite.
-As a result TFile::UseCache is obsolete. The function is kept for
backward compatibility.
-Remove references to TCache from TXMLFile, TSQLFile, TwebFile, TNetFile
-remove pointer TFile::fCache
-Add pointers TFile::fCacheRead and TFile::fCacheWrite
-Remove members fMaxCacheSize and fPageSize from TChain
NOTE that it is recommended to
rm -f base/src/*.d base/src/*.o
rm -f net/src/*.d net/src/*.o
rm -f tree/src/*.d tree/src/*.o
Revision
15536 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Jun 25 14:14:11 2006 UTC (8 years, 7 months ago) by
pcanal
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 137345 byte(s)
Diff to
previous 15455
Enhance SetBranchAddress so that the curent recommended code:
chain->SetBranchAddres(branchname,&userdata); // once per chain
....
branchptr = chain->GetBranch(branchname); // once per tree in the chain
can be replaced by:
chain->SetBranchAddres(branchname,&userdata,&branchptr); // once per chain
As a result, branchptr will be either set to 0 when the branch does
not exist or the tree is not loaded yet and will be 'refreshed'
automatically everytime the chain loads a new tree.
MakeClass and MakeSelector have been updated to take advantage of
this new feature. This removed most the code from the Notify
method.
Revision
15455 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 16 11:01:17 2006 UTC (8 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 139139 byte(s)
Diff to
previous 15421
Introduce two new major optimizations for the Tree cache.
-in case of a TChain, the list of branches computed during the
training phase of the first file is reused for all the other files.
-add support for TEventlist. Only the baskets referenced by the list
are added to the cache. This has requested a new function in TEventlist
Bool_t TEventList::ContainsRange(Long64_t entrymin, Long64_t entrymax)
// Return TRUE if list contains entries from entrymin to entrymax included.
Revision
15396 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 12 09:02:03 2006 UTC (8 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 138886 byte(s)
Diff to
previous 15370
Introduce an optimisation in the algorithm of TTreeFilePrefetch
void TTreeFilePrefetch::SetThreshold(Double_t t)
// Static function to set fgThreshold
// A new basket will not be registered in the cache if
// the current (Tree entry < fEntryMin) > 100*fgThreshold
// so t is more or less the percentage of baskets read to be considered in the cache
// This algorithm eliminates branches where only a few baskets are processed
Revision
15332 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 5 20:30:28 2006 UTC (8 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 138837 byte(s)
Diff to
previous 15186
New class TTreeFilePrefetch:
//////////////////////////////////////////////////////////////////////////
// //
// TTreeFilePrefetch //
// //
// A specialized TFilePrefetch object for a TTree //
// This class acts as a file cache, registering automatically the //
// baskets from the branches being processed (TTree::Draw or //
// TTree::Process and TSelectors. //
// This cache speeds-up considerably the performance, in particular //
// when the Tree is accessed remotely via a high latency network. //
// //
// The default cache size (10 Mbytes) may be changed via the function //
// TTreeFilePrefetch::SetCacheSize //
// //
// Only the baskets for the requested entry range are put in the cache //
// //
// For each Tree being processed a TTreeFilePrefetch object is created.//
// This object is automatically deleted when the Tree is deleted or //
// when the file is deleted.
// //
//////////////////////////////////////////////////////////////////////////
For the time being activate this cache with
mytree.SetCacheSize();
New transient member fCacheSize added to TTree and the corresponding
Get/Set function.
Revision
14464 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 29 10:36:27 2006 UTC (8 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 137968 byte(s)
Diff to
previous 14331
Add the following note in TTree::MakeClass and TTreePlayer::MakeXClass
//
// NOTE: Do not use the code generated for one Tree in case of a TChain.
// Maximum dimensions calculated on the basis of one TTree only
// might be too small when processing all the TTrees in one TChain.
// Instead of myTree.MakeClass(.., use myChain.MakeClass(..
Revision
12187 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 24 20:25:11 2005 UTC (9 years, 7 months ago) by
pcanal
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 134883 byte(s)
Diff to
previous 11901
From Marek:
hen a user creates a TChainIndex (by invoking e.g. TChain::BuildIndex())
1. The TChainIndex constructor reads all the trees one by one
and for each:
a. checks if there is an index if not or if that one is built on
different formaulae it builds an index and keeps it (can't leave an
index in a tree because when the next tree is loaded the index
will be deleted).
b. takes the min and max values of the index (perhaps only min is
needed - I'll see later on).
2. checks if the min and max values of all the tree indices are sorted.
If not it turns itself into z Zombie.
When the index is accessed:
1. using the min and max values finds a tree which should be accessed
2. loads the tree using Load(the first entry number in that tree)
3. If there is no index in that tree (it means it was created inside
TChainIndex constructor) the index is set to that tree.
4. the entry is loaded using the tree index.
5. if the tree didn't have an index before its index is set back to 0
(needed because otherwise the index would have been deleted in the
tree destructor called when loading another tree in the chain).
Revision
11436 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 28 21:17:39 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 134274 byte(s)
Diff to
previous 11333
From Philippe
The following problems were found while running roottest on MacOS.
rootcint: Insure that the dimensions of
Int_t (*fArray)[3];
are properly recorded by the ShowMembers function
TStreamerInfo: Insure that the wrapper template function see
all modifications to the TStreamerInfo
TTreePlayer: In Scan insures that the entry number is printed
as a long long (aka with %lld).
Revision
11309 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 11 21:25:11 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 128374 byte(s)
Diff to
previous 11256
From Philippe:
This patch implements support for the accessing the collection object in
TTreeFormula:
// Accessing collection objects
// ============================
//
// TTree::Draw default's handling of collections is to assume that any
// request on a collection pertain to it content. For example, if fTracks
// is a collection of Track objects, the following:
// tree->Draw("event.fTracks.fPx");
// will plot the value of fPx for each Track objects inside the collection.
// Also
// tree->Draw("event.fTracks.size()");
// would plot the result of the member function Track::size() for each
// Track object inside the collection.
// To access information about the collection itself, TTree::Draw support
// the '@' notation. If a variable which points to a collection is
prefixed
// or postfixed with '@', the next part of the expression will pertain to
// the collection object. For example:
// tree->Draw("event.@fTracks.size()");
// will plot the size of the collection refered to by fTracks (i.e the
number
// of Track objects).
Revision
11256 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 7 18:48:27 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 127397 byte(s)
Diff to
previous 11234
From Philippe:
In MakeClass/MakeSelector, update the code so that the
index of a split collection has its "BranchCount"'s
address properly set.
Also avoid generating a data member that we are not
going to use (Case of the top of a split object).
This object are not useable (since the TTree is in
MakeClass mode) and can actually be damageable
(the class name is possibly not known at the time
the MakeClass/MakeSelector is run).
This is needed to properly generate MakeClass/MakeSelector
on the new CMS data files.
Revision
10917 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jan 13 20:07:46 2005 UTC (10 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 126568 byte(s)
Diff to
previous 10893
From Philippe:
TBranchElement: Insure that fSTLtype is always positive (was preventing the
reading of sets and maps in some case of split mode).
TTree, TTreePlayer: fix to TTree::Draw documentation
TTreeFormula: insures that TTree::Draw properly reads strings within a
collection
Revision
9975 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 10 16:44:04 2004 UTC (10 years, 4 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 124690 byte(s)
Diff to
previous 9803
Thanks to Hajime Nanjyo <nanjyo@icepp.s.u-tokyo.ac.jp> for fixing a problem
in TTree::UnbinnedFit.
In the function TreeUnbinnedFitLikelihood, event weights were treated as
follows.
prob = fitfunc->EvalPar(x,par) * weight[i]/sum;
it should be
prob = TMath::Power(fitfunc->EvalPar(x,par),weight[i]/sum).
So the original code,
prob = fitfunc->EvalPar(x,par) * weight[i]/sum;
if(prob > 0) logL += TMath::Log(prob);
else logL += logEpsilon;
is changed to
prob = fitfunc->EvalPar(x,par);
if(prob > 0) logL += TMath::Log(prob) * weight[i]/sum;
else logL += logEpsilon * weight[i]/sum;
Revision
9803 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 20 21:02:10 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 124674 byte(s)
Diff to
previous 9753
From Philippe:
This patch is an important step toward the implementation of the member-wise
saving of stl containers.
Mainly, the code does not require anymore the collection proxy to be able
to provide a C-style array of pointer to its content. This avoid the
problems of having to iterate twice through some collection and/or to have to
keep in memory a version of this array. Concretely this also mean that the
I/O routine will now be able to recurse through stl containers.
Technically, this is done by templating TStreamerInfo::ReadBuffer and
TStreamerInfo::WriteBufferAux (as well as the ReadBufferSkip And
ReadBufferConv) so that you can use it directly with a char** or
with a TVirtualCollection (to which we added an operator [] and
removed the method GetPtrArray).
In addition, we added 2 new method to TVirtualCollectionProxy:
PushProxy and PopProxy that will allow to keep some state on
where we are in the iteration for a collection when we recurse.
(This is required for a reasonable implementation of the
TVirtualCollection for std::list).
Also (in an unrelated fix) we update TTreePlayer::Scan to
properly display the columns when they are more expressions
in the request than leaves in the tree.
Revision
9753 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 13 09:44:28 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 124674 byte(s)
Diff to
previous 9729
Add a new function;
Long64_t TTreePlayer::GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const
// return the number of entries to be processed
// this function checks that nentries is not bigger than the number
// of entries in the Tree or in the associated TEventlist
This new function is called in:
TTreePlayer::CopyTree
TTreePlayer::Principal
TTreePlayer::Process
TTreePlayer::Scan
TTreePlayer::Query
Revision
9729 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 12 04:33:45 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 124772 byte(s)
Diff to
previous 9661
From Philippe:
This enhance the support in TTreeFormula for (conceptual) array
with 2 varying dimensions in the case the 2nd dimensions has
some zero length and a fixed index is used.
This patch also add the ability to format the output of
TTree::Scan. The option parameter can now contains the following
customization:
// colsize=ss
// Where 'ss' will be used as the default size for all the column
// If this options is not specified, the default column size is 9
// precision=pp
// Where 'pp' will be used as the default 'precision' for the
// printing format.
// col=xxx
// Where 'xxx' is colon (:) delimited list of printing format for
// each column if no format is specified for a column, the default is
// used.
// For example:
// tree->Scan("a:b:c","","colsize=30 precision=3 col=::20.10");
// Will print 3 columns, the first 2 columns will be 30 characters long,
// the third columns will be 20 characters long. The printing format used
// for the columns (assuming they are numbers) will be respectively:
// %30.3g %30.3g %20.10g
Revision
9661 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Aug 3 05:25:03 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 121112 byte(s)
Diff to
previous 9625
From Philippe:
This patch add to TTreeFormula (and to TStreamerInfo::GetValue)
the ability to read the content of a data member defined as
Int_t *arr[3]; //[n]
The data was properly wrote and read back from disk. However
TTreeFormula (and StreamerInfo::GetValue) where ignoring the
size of the array of pointers.
+ a fix to the printout of TTree::Scan (for Long64_t)
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/treeplayer/src/TTreePlayer.cxx
File length: 120942 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/treeplayer/src/TTreePlayer.cxx
File length: 120690 byte(s)
Diff to
previous 9515
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
9460 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 9 04:40:49 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 120283 byte(s)
Diff to
previous 9432
From Philippe:
The choice of allowing TTree::Draw to take a filename is having
an unplanned consequence. We can call:
tree->Draw("myfilename.C");
We can also call
tree->Draw("$HOME/myfilename.C");
However this means that
T->Draw("Entry$")
now issues
Error in <TUnixSystem::ExpandFileName>: input: Entry$, output: Entry$
Error in <TUnixSystem::ExpandFileName>: input: ...
Error in <TUnixSystem::ExpandFileName>: ...
The attached patch fix this problem.
However if the user tree has a variable name var$var (well not nice but
legal), we still get:
T->Draw("var$var");
Error in <TUnixSystem::ExpandFileName>: input: var$var, output: var$var
Error in <TUnixSystem::ExpandFileName>: input: ....
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/treeplayer/src/TTreePlayer.cxx
File length: 119662 byte(s)
Diff to
previous 8337
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
7880 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 10 10:52:31 2004 UTC (11 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 114142 byte(s)
Diff to
previous 7784
From Philippe:
This mega patch introduces a new implementation of the STL I/O
which is backward and forward compatible. In addition this is more
exactly a new implementation or an extension of the container I/O.
We are introducing a new abstract interface:
"TVirtualContainerProxy", which can be implemented to present a
proxy to any collection which the I/O (and TTreeFormula) can use
then transparently.
The TVirtualContainerProxy interface allows to the I/O system to
request some information and to execute some essential function of
the container:
what kind of object/data does it contain
does it contain pointers
how to insert data into the container
how to retrieve an array of pointer to the elements inside
how to create a collection object
how to clear the collection
how to resize the collection
how to streamer the collection (if needed)
how to calculate the sizeof the collection
how to calculate the number of elements of the collection.
Using those primitives, the I/O and TTreeFormula should be able to
access any collection. The I/O should also be able to handle the
splitting of collections that can be split (i.e. contains a single
type of object/data).
The current compromise selected between code duplication,
performance of the I/O of TClonesArray and vector of pointers and
the performance of the I/O of other containers, was to have on
function handle all collection as if they were a C-style array of
pointers to data. This implies for example that the I/O of vector
of object current passes via the construction of temporary array
of pointer. The cost of this construction is usually ~Qjust~R the
cost of calculating the addresses of the elements and assigning it
to an array element.
Registering a collection proxy will be similar to
static int dummy = GenerateInitInstance((CollectType*)0x0)-
>AdoptCollectionProxy(new CollectTypeProxy));
Follows a few details on the modifications made to some of the
files and classes.
Bytes.h:
Work around a problem in the MSVC++ 6.0 optimizer. This should
not affect other compilers.
String:
Included the std::string dictionary into G__Base2.cxx, this
insures its presence at all time.
Added a new file string.cxx holding the streamer for
std::string.
RConfig.h
Added proper ansi stream configuration for AIX, KCC
Added template specialization defect for MSVC
TBrowser
Start adding the ability to browser non TObject classes
TBuffer
To handle the reading and writing array of objects, added:
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const
TClass *clss, const char* classname);
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const
char *classname);
void ReadFastArray(void *start , TClass *cl, Int_t n=1,
TMemberStreamer *s=0);
void ReadFastArray(void **startp, TClass *cl, Int_t n=1,
Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
void WriteFastArray(void *start, TClass *cl, Int_t n=1,
TMemberStreamer *s=0);
Int_t WriteFastArray(void **startp, TClass *cl, Int_t n=1,
Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
TROOT
Enhancement to make the access to gROOT not dependent for the
library loading order. In particular we added:
ROOT::GetROOT()
which should be used instead of gROOT.
Improve support for STL. In particular, now STL containers do
have a corresponding TClass object
TRealData
Replace SetStreamer by AdoptStreamer that allow to use not only
a streamer function but also streamer object (allowing streamer
with a state for Foreign classes)
TString:
Improve streamer performance
TSystem:
More consistency of the return value of TSystem::CompileMacro
build/unix/makecintdlls.sh
Stop making the string.dll
config:
enhance sgicc makefiles
cont:
fix TBits::operator=
TClassTable now warns for duplicate only for non stl classes
TClonesArray fix a typo
gpad:
Add a new class TInspectObject to enable inspect non TObject
classes
TRootBrowser : enable inspect non TObject classes
TFormula/TTreeFormula
To enhance performance switch from using one array fOper which
contained the operation code and its arguments to using 2 arrays
fActions and fActionParams to store respectively the operation and
its parameters.
A new function Convert is used to convert old version from the
fOper to fActions. This allows cleaner coding and offer
optimization opportunities.
TTreePlayer
Start adding support in MakeClass for STL containers.
TRint/TProofServ
Insure the loading of the string support
Event.cxx
make sure to avoid memory over-write
stress.cxx
Add new parameters
stress <nevent> <style> <subbench> <portion>
if <subbench> is 1 or higher, print the benchmark results after
each test. This allows understand
which test is affect by a performance change.
portion is a binary field to indicate which test to run. This
allows to focus on a particular test.
TVirtualCollectionProxy
Abstract interface used to access any type of containers from
the I/O system and TTreeFormula. See TVectorProxy and
TEmulatedVectorProxy for examples.
TEmulatedVectorProxy
Implementation of a std::vector proxy to be able to read a
std::vector without any libraries.
TVectorProxy
Implementation of TVirtualCollectionProxy for a std::vector for
which we have the library.
TStreamerInfo.cxx
Split in 3 files: TStreamerInfo.cxx
TStreamerInfoReadBuffer.cxx TStreamerInfoWriteBuffer.cxx
All the ReadBuffer, ReadBufferClones and the new ReadBufferSTL
(similarly for WriteBuffer) have been factorized into one
function and 2 short wrappers. The new main function expect an
array of pointer to the objects (this array is most often of size
one).
TClonesArray objects pass GetObjectRef(0) to the common
ReadBuffer
vector<bla*> v pass &(v[0])
vector<bla> needs to create an intermediary array to hold the
address
This mechanism is sometimes not optimal (vector<blah>) but
allows extremely flexibly and extension. Basically, to add
support for a new container type using the StreamerInfo mechanism
(in particular allows splitting), one 'just' need to implement a
TVirtualCollectionProxy, which, in particular, will return an
array of address to the object it contains. Even std::map can be
handled with this mechanism, since, for I/O purposes, it can be
consider as a container of pairs.
Add a few optimization, including more caching via a new array
of a new struct (fComp).
Fixed a problem (re)introduced while implementing the Foreign
class CheckSum. Doing:
class Event;
f = new TFile("Event.root");
resulted in errors.
TCint
Add proper support for TClass of STL containers. Fix a memory
leak.
Add support for load TClass via a typedef.
Fix a problem with multiple inheritance
TClass
Fixed a problem (re)introduced while implementing the Foreign
class CheckSum. Doing:
class Event;
f = new TFile("Event.root");
resulted in errors.
Add a
TClass/TGenericClassInfo/TDataMember
Add support for a new interface (TVirtualCollectionProxy)
useable for STL containers or any user defined containers.
Add support for streamer with are objects (as opposed to free
standing function or methods). This allows the user a greater
flexibility in writing a streamer.
Add a few optimizations
Add CanSplit to answer the question for a whole Class (for
example some collection can not be splitted).
TClassStreamer
New class to wrap a class wide streamer
ClassStreamerFunc_t
typedef for a class wide streamer function
TMemberStreamer
New class to wrap a specific class member streamer
MemberStreamerFunc_t
typedef for a specific class member streamer function
RootStreamer
Macro to specify a free standing streamer object or function
for a class
For example:
RootStreamer(string,std_string_streamer);
TStreamerElement:
A couple of optimization/simplification.
Add support for the new STL I/O
Extend the useful
TBranchElement:
add a connection to the proper TVirtualCollectionProxy
add support for STL containers (non-split and split mode)
TTree
Make the function TTree::GetMakeClass NON-virtual for better
efficiency
Add support for STL containers
TBasket
Left (in comment) a yet unproved improvement proposed by
Victor. The preliminary tests were inconclusive performance wise
and it had (seemingly) problem with backward and forward
compatibility.
TBranch
Performance improvements
metautils
This is a new package for C++ files shared between rootcint and
meta.
It contains TClassEdit a class to help determine some property
of a class given its class name (stl, template, etc).
utils
Introduced a new file RStl.cxx to start separating rootcint in
modules.
Modified rootcint to support the new STL I/O methods.
In particular a new class RStl is in charge of doing the
generating of code for STL containers.
Revision
7784 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Dec 19 09:31:52 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 113993 byte(s)
Diff to
previous 7780
Add the following warning in TSelector::GetSelector:
// WARNING when a selector is used with a TChain:
// in the Process, ProcessCut, ProcessFill function, you must use
// the pointer to the current Tree to call GetEntry(entry).
// entry is always the local entry number in the current tree.
// Assuming that fChain is the pointer to the TChain being processed,
// use fChain->GetTree()->GetEntry(entry);
Modify TTreePlayer::MakeSelector to generate the code with this warning
in the selector Process function.
Revision
7780 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Dec 18 13:21:33 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 113553 byte(s)
Diff to
previous 7778
From Philippe:
Add support for the boolean optimization in TFormula::GetExpFormula
Prevent TTree::Scan from printing random value for invalid formulas
Add a new TTreeFormula special function:
Alt$(primary,alternate) : return the value of "primary" if it is available
for the current iteration otherwise return the value of "alternate".
For example, with arr1[3] and arr2[2]
tree->Draw("arr1-Alt$(arr2,0)");
will draw arr[0]+arr2[0] ; arr[1]+arr2[1] and arr[1]+0
Or with a variable size array arr3
tree->Draw("Alt$(arr3[0],0)+Alt$(arr3[1],0)+Alt$(arr3[2],0)");
will draw the sum arr3 for the index 0 to min(2,actual_size_of_arr3-1)
As a comparison
tree->Draw("arr3[0]+arr3[1]+arr3[2]");
will draw the sum arr3 for the index 0 to 2 only if the
actual_size_of_arr3 is greater or equal to 3.
Note that the array in 'primary' is flatened/linearilized thus using
Alt$ with multi-dimensional arrays of different dimensions in unlikely
to yield the expected results. To visualize a bit more what elements
would be matched by TTree::Draw, TTree::Scan can be used:
tree->Scan("arr1:Alt$(arr2,0)");
will print on one line the value of arr1 and (arr2,0) that will be
matched by
tree->Draw("arr1-Alt$(arr2,0)");
Revision
7777 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 16 22:42:29 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 112098 byte(s)
Diff to
previous 7775
From Philippe
This patch makes sure the formula are properly refreshed when using a chain.
It removes the printing of some (spurious) empty lines when using a selection criterion.
I.e. Without a selection criterion, there is always a least one line per entry (if is empty) while with a selection
criterion, an entry is printed if and only if a least one of the sub-element exist and match the criterion.
Revision
7773 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 16 18:55:49 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 111901 byte(s)
Diff to
previous 7763
From Philippe
This patch restores and enhances TTree::Scan previous behavior regarding arrays.
It nows always (unless user request otherwise) print all the requested elements
of all the arrays. The printing of multi-dimensional array is now done in a
linear, non-synchronized fashion. In particular this means that selection on
2D arrays (including array within a TClonesArray) might not print the correct
instance of the arrays (in case of using arrays of un-even dimension)
You can now limit the number of element in the array by using the string option 'lenmax=dd':
Revision
7749 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Dec 13 09:25:56 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 108189 byte(s)
Diff to
previous 7664
From Philippe
I enhanced TTree::Scan so that instead of having
t3333->Scan("PtGen","Type==13");
being always equivalent to
t3333->Scan("PtGen[0]","Type[0]==13");
TTree::Scan will now print all the requested elements of any array (as TTree::Draw does).
TTree::Principal has been similarly updated (but not tested).
TTreeFormula has also been updated to remove a bad side-effect of the boolean operation optimization. In case like
analysis->Scan("Lept_1","Lept_1>=0&&Lept_2!=0");
if Letp_1[0] was negatif then the Lept_2 branch was not read from file.
Revision
7664 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 26 21:48:27 2003 UTC (11 years, 2 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 106022 byte(s)
Diff to
previous 7630
From Philippe:
This update makes any selector created by the TTreePlayer directly from a source file local to the current TTreePlayer
object (instead of being a static).
It also insures that TProofPlayer and TTreePlayer do not call delete for an object of
a class which library was unloaded (since the code is gone, this would lead to a core
dump).
Revision
7630 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Nov 22 22:02:02 2003 UTC (11 years, 2 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 105492 byte(s)
Diff to
previous 7620
Replace the generation of a TPolyMarker by a TGraph when
generating 2-d plots in tree.Draw("y:x").
With this change, one can use all the features of a TGraph, like
additional drawing options "l" or TGraph::Fit.
For example the following command
tree.Draw("y:x");
produces a scatter plot with the points corresponding to the
original coordinates x and y. After the command, one can access
the TGraph object in the pad with
TGraph *g = (TGraph*)gPad->GetPrimitive("Graph");
The following command
tree.Draw("y:x:,"","l");
will produce a TGraph connecting all the points with a line.
A similar change is planned to replace the generation of the TPolyMarker3D
by a TGraph2D in commands like tree.Draw("z:y:x");
The above changes are also necessary to support multiple TGraph (or TGraph2D)
generated in a PROOF session when updating only the last generated points.
Revision
7619 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 20 15:03:44 2003 UTC (11 years, 2 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 105216 byte(s)
Diff to
previous 7438
From Axel Naumann:
I had a class with an impl file name
/home/.../src/TMyClass.cxx
which was misinterpreted as being a ROOT class (as it had the format
"*/src/T*"). I changed the ROOT class detection to check whether it's an
absolute path name, assuming that ROOT's classes' impl file names are
_always_ relative paths.
Revision
7407 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 7 15:45:00 2003 UTC (11 years, 3 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 105281 byte(s)
Diff to
previous 7403
Add documentation for the new 4-D option in TTree::Draw and TTreePlayer::DrawSelect
// varexp is an expression of the general form
// - "e1" produces a 1-d histogram of expression "e1"
// - "e1:e2" produces a 2-d histogram (or profile) of "e1" versus "e2"
// - "e1:e2:e3" produces a 3-d scatter-plot of "e1" versus "e2" versus "e3"
// - "e1:e2:e3:e4" produces a 3-d scatter-plot of "e1" versus "e2" versus "e3"
// and "e4" mapped on the color number.
//
// Example:
// varexp = x simplest case: draw a 1-Dim distribution of column named x
// = sqrt(x) : draw distribution of sqrt(x)
// = x*y/z
// = y:sqrt(x) 2-Dim distribution of y versus sqrt(x)
// = px:py:pz:2.5*E produces a 3-d scatter-plot of px vs py ps pz
// and the color number of each marker will be 2.5*E.
// If the color number is negative it is set to 0.
// If the color number is greater than the current number of colors
// it is set to the highest color number.
// The default number of colors is 50.
// see TStyle::SetPalette for setting a new color palette.
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/treeplayer/src/TTreePlayer.cxx
File length: 104514 byte(s)
Diff to
previous 7338
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
7223 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Sep 6 17:15:04 2003 UTC (11 years, 4 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 103680 byte(s)
Diff to
previous 7153
From Glenn Horton-Smith:
"The error bars obtained from TTree::UnbinnedFit() are incorrect, unless the user
takes special actions to work around the problem. The reason has to do with the
definition of TreeUnbinnedFitLikelihood() in TTreePlayer.cxx. In a nutshell,
the issue is that TreeUnbinnedFitLikelihood() returns -logL, when it should
return -2*logL in order for the default error definition to work correctly.
The workaround if you are using MINUIT is to call
gMinuit->SetErrorDef(0.5) before calling TTree::UnbinnedFit() -- and don't
forget to gMinuit->SetErrorDef(1.0) before using the other Fit() functions!
Note there is apparently no corresponding workaround if you prefer the Fumili
fitter.
The obvious fix is to make TreeUnbinnedFitLikelihood() return -2*logL"
~
~
~
Revision
7153 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 25 17:31:42 2003 UTC (11 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 103513 byte(s)
Diff to
previous 7029
From Philippe:
This patch solves 2 problems.
If a simple tree was made the friend of a chain, the simple tree was loaded using the 'entry in the tree (inside the
chain)' instead of the 'entry in the chain'. This resulted in ONLY the first part of the simple tree to be used (over
and over again)!
TTree::Scan (Query and CopyTree) could not handle the case where a TChain was made a friend of a TTree (and problably
more cases of uneven length chain friends). This was
because, it never detected that a new file was open since it only looked a the main Tree (and none of its friend). In
consequence the formula were not updated when they should.
Revision
6838 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Jul 6 19:41:49 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 102945 byte(s)
Diff to
previous 6824
From Philippe:
This patch comments the fact after TTree::CloneTree and until the original is deleted, the addresses of the original
are passed on to all the clones. Also the addresses of the clones are reset when the original is deleted.
This patch also simplify the implementation of TChain::Merge to take advantage of the new TTree::CloneTree feature.
Revision
6824 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 4 13:27:35 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 102510 byte(s)
Diff to
previous 6792
From Philippe:
This update remove the need to set the addresses before calling CloneTree or CopyTree. This is accomplished by
- making sure that default addresses are created before passing it to the clone.
- keep a list of cloned trees and inform them when an address change.
Also hard to trace memory errors due to the 'link' between the original and the cloned tree are removed by
making the original reset all the addresses of the cloned tree whenever the original tree/chain is deleted.
Revision
6410 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 9 16:30:19 2003 UTC (11 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 102880 byte(s)
Diff to
previous 6408
From Philippe:
In the case where the tree contains 2 top level objects which happen to have a data member
that has the same name, the variable name for the branch pointer in the class created by
MakeClass (i.e. b_branchname) was identical. This corrects the situation.
Revision
5869 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 11 09:07:20 2003 UTC (12 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 100835 byte(s)
Diff to
previous 5865
From Philippe:
Looking at Maarten's problem I noticed that the G__var_array are not properly initialized.
In the attached patch I corrected the problem by calling memset on each of the structs.
I also noticed (running Maarten's example) that a few times, the start of an error message is printed but the ending
(which should come from G__genericerror) is not printed because G__const_noerror is set to 1. So in a couple of place I
preceded the printing of the start of the error message by if (0==G__const_noerror).
Revision
5865 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 10 14:51:51 2003 UTC (12 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 98749 byte(s)
Diff to
previous 5720
Important restructuring of the TTreePlayer class in view of PROOF.
In particular TTree::DrawSelect is reduced to a few lines to use
the new TSelectorDraw class via TTreePlayer::Process.
More changes are foreseen to use the same mechanism for TTree::Scan
and TTree::Query.
Revision
5717 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Dec 2 18:50:12 2002 UTC (12 years, 1 month ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 138661 byte(s)
Diff to
previous 5686
mega patch to remove almost all compiler warnings on MacOS X where the
compiler is by default in pedantic mode (LHCb also like to use this option).
The following issues have been fixed:
- removal of unused arguments
- comparison between signed and unsigned integers
- not calling of base class copy ctor in copy ctor's
To be done, the TGeo classes where we get still many hundred warnings of
the above nature. List forwarded to Andrei.
Revision
5686 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 27 21:54:56 2002 UTC (12 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 138572 byte(s)
Diff to
previous 5444
From Philippe:
This patch:
a) add ClassDef to the generate TSelector with version 0.
b) keep the Error message for all cases but those inheriting from TSelector
(Warnings are not seems in the default rootcint mode).
c) rootcint succeed in all cases (hence allowing user to compile
classes that do not strictly implement the TObject interface).
Revision
5037 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 1 21:33:48 2002 UTC (12 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 139126 byte(s)
Diff to
previous 5013
This patch from Philippe implements the reading of variable size
array inside a TClonesArray when the TClonesArray is not split.
It also adds a test for reading variable size array inside a TClonesArray.
It also fixes a problem recently mentioned on roottalk where the formula
for not properly reading variable size array when the
variable size was indexed more there was more than one variable in the formula.
Revision
4366 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Apr 14 14:35:26 2002 UTC (12 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 136857 byte(s)
Diff to
previous 4362
Add several missing protections in MakeClass.
Replace the use of leaf-GetTitle() by leaf->GetName() in the 3 places
where GetTitle was still used.
This change is required for the introduction of the branch hierachy
supported by the new version of TBranchElement.
Revision
4356 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 12 19:19:53 2002 UTC (12 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 136971 byte(s)
Diff to
previous 4242
From Philippe:
The files produced by MakeClass/MakeSelector were incorrect if the tree
is containing a TClonesArray which contains a variable length array. This
fix correct the situation.
Also is included is a short documentation of the TTreeFormula special functions.
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/treeplayer/src/TTreePlayer.cxx
File length: 136052 byte(s)
Diff to
previous 4199
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
4199 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 19 17:05:50 2002 UTC (12 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 136840 byte(s)
Diff to
previous 4119
Patch from Philippe:
// Special functions and variables
// ===============================
//
// 'ENTRY': A TTree::Draw formula can use the special variable ENTRY
// to access the entry number being read. For example to draw every
// other entry use:
// tree.Draw("myvar","ENTRY%2==0");
Revision
3707 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 19 11:04:41 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 136459 byte(s)
Diff to
previous 3701
Add a new function TTree::GetEntriesFast. In case of a Tree,
both GetEntries and GetEntriesFast return directly fEntries.
In case of a TChain, GetEntries will force the read of the Tree headers
in all the files to get the number of entries and set the table of offsets.
The new function GetEntriesFast is used internally by TChain
or TTreePlayer to make sure that the TChain files are processed
only once in a given query.
TTreePlayer::MakeStats has been modified to call GetEntriesFast
instead of GetEntries.
These changes make the new functionality of TChain::Add backward compatible.
Revision
3696 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 18 11:35:41 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 139316 byte(s)
Diff to
previous 3669
All functions looping in Tree/Chain entries modified to take into account
the new default when creating a TChain.
When starting the loop on a TChain, the number of entries is not known.
TChain.GetEntries() return a large number.
A protection is added inside the loop when the entry number does not exist.
Also, add an additional statement in the code generated by TTreePlayer::MakeClass
to protect rdading beyond the last entry in a TChain.
Revision
3669 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jan 15 10:29:06 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 138915 byte(s)
Diff to
previous 3649
Delete function FindGoodLimits.
Use services of THLimitsFinder in TTreePlayer::SetEstimate.
Modify DrawSelect to use the modified function TTreeFormula::SetAxis.
This new function takes care of setting the bit kIsInteger in the axis.
This also fixes a problem when histograming integer variables. The number of bins
was not correctly recomputed.
Add a fix from Philippe in MakeClass to initialize members holding object pointers.
Revision
3622 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 9 16:18:47 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 141507 byte(s)
Diff to
previous 3611
Add new functionaly in TTreePlayer::DrawSelect (Heiko.Scheit@mpi-hd.mpg.de).
// Saving the result of Draw to an histogram
// =========================================
// By default the temporary histogram created is called htemp.
// If varexp0 contains >>hnew (following the variable(s) name(s),
// the new histogram created is called hnew and it is kept in the current
// directory.
// Example:
// tree.Draw("sqrt(x)>>hsqrt","y>0")
// will draw sqrt(x) and save the histogram as "hsqrt" in the current
// directory.
//
// The binning information is taken from the environment variables
//
// Hist.Binning.?D.?
//
// In addition, the name of the histogram can be followed by up to 9
// numbers between '(' and ')', where the numbers describe the
// following:
//
// 1 - bins in x-direction
// 2 - lower limit in x-direction
// 3 - upper limit in x-direction
// 4-6 same for y-direction
// 7-9 same for z-direction
//
// When a new binning is used the new value will become the default.
// Values can be skipped.
// Example:
// tree.Draw("sqrt(x)>>hsqrt(500,10,20)"
// // plot sqrt(x) between 10 and 20 using 500 bins
// tree.Draw("sqrt(x):sin(y)>>hsqrt(100,10,,50,.1,.5)"
// // plot sqrt(x) against sin(y)
// // 100 bins in x-direction; lower limit on x-axis is 10; no upper limit
// // 50 bins in y-direction; lower limit on y-axis is .1; upper limit is .5
//
// By default, the specified histogram is reset.
// To continue to append data to an existing histogram, use "+" in front
// of the histogram name.
// A '+' in front of the histogram name is ignored, when the name is followed by
// binning information as described in the previous paragraph.
// tree.Draw("sqrt(x)>>+hsqrt","y>0")
// will not reset hsqrt, but will continue filling.
// This works for 1-D, 2-D and 3-D histograms.
Revision
3611 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jan 8 14:44:04 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 135448 byte(s)
Diff to
previous 3563
Introduce some of the changes implemented by Heiko.Scheit@mpi-hd.mpg.de
The number of the bins for the default 1-d,2-d,3-d histograms can be
specified in the .rootrc file via the environment variables, eg:
# default binnings
Hist.Binning.1D.x: 100
Hist.Binning.2D.x: 40
Hist.Binning.2D.y: 40
Hist.Binning.2D.Prof: 100
Hist.Binning.3D.x: 20
Hist.Binning.3D.y: 20
Hist.Binning.3D.z: 20
Hist.Binning.3D.Profx: 100
Hist.Binning.3D.Profy: 100
Revision
3563 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 2 21:48:08 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 133424 byte(s)
Diff to
previous 3517
Delete unused function EstimateLimites.
Add support for histograms with string variables.
All combinations are supported for
1-D histograms
2-D histograms
3-D histograms
Profile histograms
2-D profile histograms.
Introduce a better version of TTreePlayer::FindGoodLimits in case
of integer or string variables.
Fix a problem in case of 1-D profile histograms. The kCanRebin bit
was not set.
Revision
3083 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 22 14:26:49 2001 UTC (13 years, 3 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 132759 byte(s)
Diff to
previous 3068
Update by Philippe of TEventList and TTreePlayer such that one can
reproduce the results obtained at the creation of the list.
The Title of the EventList object is now fully used to store the
actual selection criteria used to produce the EventList. When
SetReapplyCut is set to true, the criteria is fed back into the
new selection criteria.
This allows for example to really make a selection of some of
the tracks of the events and continue analysis on just them.
For example:
T->Draw(">>pxlist","fPx>2.7");
creates a TEventList 'pxlist' that list all events that have one or
more tracks with fPx greater than 2.7
T->SetEventList(pxlist);
T->Draw("fPx");
will draw the fPx of ALL the tracks of the events that have at least
one track with a fPx greater than 2.7
pxlist->SetReapplyCut(kTRUE);
T->SetEventList(pxlist);
T->Draw("fPx");
will draw the fPx of ONLY the tracks that ha a fPx greater than 2.7.
Also
T->Draw(">>+pxlist","fPy>2.7");
Will have pxlist.fTitle == (fPx>2.7)||(fPx>2.5)
Whenever, a TEventList is filled, its title is properly maintained
to reflect exactly the selection(s) used to create it.
Note that as a side-effect , the TEventList will now contain each entry
only once. (it was possible to add an entry multiple times in the list).
CCVS: ----------------------------------------------------------------------
Revision
3068 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Oct 19 16:10:43 2001 UTC (13 years, 3 months ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 131009 byte(s)
Diff to
previous 3038
This update insures that EventList is true to its word and includes ALL
the entry/event that has any subparts that match the criteria.
I.e. With fTracks a TClonesArray, the following call
T->Draw(">>elist","fTracks.fPx>0");
will create an EventList elist that contains ALL the entries that have one
or more tracks which have fPx greater than zero. Prior to this updates
elist would contain ONLY the entries where fTracks.A(0).fPx is greater
than zero.
Revision
2896 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Sep 29 16:03:24 2001 UTC (13 years, 3 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 130661 byte(s)
Diff to
previous 2819
Fix a memory leak in case the option "goff" is used in TTreePlayer::DrawSelect.
The generated histogram "htemp" is now kept in the current directory. It is accessible
after the Draw command and it is automatically deleted at the next Draw operation.
Revision
2819 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Sep 19 20:05:23 2001 UTC (13 years, 4 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 130499 byte(s)
Diff to
previous 2809
Use Double_t instead of Float_t in TPolyMarker.
Add new constructors to support Float_t and Double_t cases.
Same for SetPolyMarker.
Modify TTreePlayer to use Double_t in the interface with TPolyMarker.
This change solves a precision problem reported by some users when
producind scatter plots of variables with a large value and small range.
Revision
2382 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 6 07:21:15 2001 UTC (13 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 124560 byte(s)
Diff to
previous 2375
several enhancements from Philippe.
TFormula: added support for the shift operator '>>' and '<<'.
However the associativeness is currently wrong. It should have been left
associative (i.e. b << 4 >> 8 == (b<<4)>>8 ).
TTreePlayer: add support for letting '>>' be interpreted as a shift operator.
Now only the last '>>' which is NOT is parenthesis or brackets is interpreted
as meaning 'feed an histogram'. This might(?) be improved if there is a way
to guess is the right hand parameter of '>>' is and histogram or a variable.
TTreePlayer: enable string comparaison when the new style of branches and
with data member reading. (Are left to do: method result).
Revision
1569 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Feb 9 16:47:52 2001 UTC (13 years, 11 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 120790 byte(s)
Diff to
previous 1274
New version of TTreeFormula/TFormula by Philippe Canal:
In a TFormula . and -> are now synonymous.
In a TTreeFormula, you can now specify the index of an array (TClonesArray
or regular array) via another expression of the variable of the tree.
For example the following are now correctly handled:
myTree->Draw("clone1.a1:clone2.a2[2]");
myTree->Draw("clone1.a1:clone2.a2[clone1.b1]");
myTree->Draw("clone1.a1","clone2.a2[clone1.b1]>0");
This patch also enable (rudimentarily for now) the access to data members.
So now both the following are possible:
T->Draw("event->GetNtrack()");
T->Draw("event.fNtrack");
The lookup of leafname has been improved so that whether of not the dot
has been forced into the branchname the following will work:
T->Draw("event.fTemperature")
T->Draw("fTemperature")
Revision
698 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Oct 1 20:25:56 2000 UTC (14 years, 3 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 109869 byte(s)
Diff to
previous 635
Add additional comments in TTreePlayer::Process to indicate
that the argument entry in ProcessCut and ProcessFill is the
entry number in the current Tree.
Also modify the code generator of TTreePlayer::MakeSelector
to indicate this remark
Revision
635 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 12 15:45:11 2000 UTC (14 years, 4 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 109439 byte(s)
Diff to
previous 608
Change by Philippe Canal in TTreePlayer.
TTree::Draw uses up to 3 variables and a selection criterium. Until this
fix, if more than one of those 4 identities were pointing to an 'array'
(like a part of a TClonesArray), only one of them was properly setup.
(The first one in the order : selection criterium, var1, var2, var3 that
was an array was setup properly, as a side effect if another variable was
using one of the array properly setup, this variable would look okay).
Revision
579 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Sep 6 06:07:45 2000 UTC (14 years, 4 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 109095 byte(s)
Diff to
previous 542
A problem fixed by Philippe Canal in TTreePlayer::EntryLoop
When drawing 2D or 3D histograms, only the first of the variables
that happen to be 'variable length arrays' had their index properly
loaded from file.
So for example, if clone1.X and clone2.Y where both variable of two
separate TClonesArray clone1 and clone2:
Draw("clone1.X:clone2.Y")
would only load the size of clone1.X (thus the 'perceived size
clone2.Y would be random).
Revision
542 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 31 07:13:57 2000 UTC (14 years, 4 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 108915 byte(s)
Diff to
previous 489
A fix by Philippe Canal in TTreePlayer::Process.
When CINT reloads a script defining some classes, it unwinds
everything since the script was first loaded.
This has the side-effect of destroying the temporary variables holding
the filename and option string.
A local copy of these variables is necessary before invoking the
main Process function.
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/treeplayer/src/TTreePlayer.cxx
File length: 108773 byte(s)
Diff to
previous 448
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/treeplayer/src/TTreePlayer.cxx
File length: 104644 byte(s)
Diff to
previous 384
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/treeplayer/src/TTreePlayer.cxx
File length: 99267 byte(s)
Diff to
previous 381
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
375 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jul 13 19:19:27 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 99570 byte(s)
Diff to
previous 346
The previous class TSelector has been split into two classes:
-TSelector used by the compiled code
-TSelectorCint used by the interpreted code
TSelectorCint inherits from TSelector.
The names of the member functions in TSelector have been renamed to:
Begin: called everytime a loop on the tree starts.
a convenient place to create your histograms.
ProcessCut: called at the beginning of each entry to return a flag
true if the entry must be analyzed.
a convenient place to draw/fit your histograms.
ProcessFill: called in the entry loop for all entries accepted
by Select.
Terminate: called at the end of a loop on a TTree.
a convenient place to draw/fit your histograms.
These names have been chosen to have functions in alphabetic and logical order
in the user's class.
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/treeplayer/src/TTreePlayer.cxx
File length: 99184 byte(s)
Diff to
previous 337
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/treeplayer/src/TTreePlayer.cxx
File length: 97509 byte(s)
Diff to
previous 228
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
228 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 16 10:48:49 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 95441 byte(s)
Diff to
previous 201
The functionality of TTree::Draw has been upgraded to handle a wider
variety of operations involving arrays; TClonesArrays are here considered
as a variable size arrays.
Let assumes, a leaf fMatrix, on the branch fEvent, which is a 3 by 3 array.
In a TTree::Draw expression you can now access fMatrix using the following
syntaxes:
String passed What is used for each entry of the tree
"fMatrix" the 9 elements of fMatrix
"fMatrix[][]" the 9 elements of fMatrix
"fMatrix[2][2]" only the elements fMatrix[2][2]
"fMatrix[1]" the 3 elements fMatrix[1][0], fMatrix[1][1] and fMatrix[1][2]
"fMatrix[1][]" the 3 elements fMatrix[1][0], fMatrix[1][1] and fMatrix[1][2]
"fMatrix[][0]" the 3 elements fMatrix[0][0], fMatrix[1][0] and fMatrix[2][0]
"fEvent.fMatrix...." same as "fMatrix..." (unless there is more than one leaf
named fMatrix!).
In summary, if a specific index is not specified for a dimension, TTree::Draw
will loop through all the indices along this dimension. Leaving off the
last (right most) dimension of specifying then with the two characters '[]'
is equivalent. For variable size arrays (and TClonesArray) the range
of the first dimension is recalculated for each entry of the tree.
TTree::Draw also now properly handling operations involving 2 or more arrays.
Let assume a second matrix fResults[5][2], here are a sample of some
of the possible combinations, the number of elements they produce and
the loop used:
expression element(s) Loop
"fMatrix[2][1] - fResults[5][2]" one no loop
"fMatrix[2][] - fResults[5][2]" three on 2nd dim fMatrix
"fMatrix[2][] - fResults[5][]" two on both 2nd dimensions
"fMatrix[][2] - fResults[][1]" three on both 1st dimensions
"fMatrix[][2] - fResults[][]" six on both 1st and 2nd dimensions of
fResults
"fMatrix[][2] - fResults[3][]" two on 1st dim of fMatrix and 2nd of
fResults (at the same time)
"fMatrix[][] - fResults[][]" six on 1st dim then on 2nd dim
In summary, TTree::Draw loops through all un-specified dimensions. To
figure out the range of each loop, we match each unspecified dimension
from left to right (ignoring ALL dimensions for which an index has been
specified), in the equivalent loop matched dimensions use the same index
and are restricted to the smallest range (of only the matched dimensions).
When involving variable arrays, the range can of course be different
for each entry of the tree.
So the loop equivalent to "fMatrix[][2] - fResults[3][]" is:
for (Int_t i0; i < min(3,2); i++) {
use the value of (fMatrix[i0][2] - fMatrix[3][i0])
}
So the loop equivalent to "fMatrix[][2] - fResults[][]" is:
for (Int_t i0; i < min(3,5); i++) {
for (Int_t i1; i1 < 2; i1++) {
use the value of (fMatrix[i0][2] - fMatrix[i0][i1])
}
}
So the loop equivalent to "fMatrix[][] - fResults[][]" is:
for (Int_t i0; i < min(3,5); i++) {
for (Int_t i1; i1 < min(3,2); i1++) {
use the value of (fMatrix[i0][i1] - fMatrix[i0][i1])
}
}
Revision
120 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 13 09:18:47 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreePlayer.cxx
File length: 91871 byte(s)
Diff to
previous 100
- Mods in TTreePlayer to reflect the numerous changes in TGraph,
TVirtualPad, TView, TLego. Most internal variables changed from
Float_t to Double_t. In particular the members, fVmin, fVmax, fV1, fV2, fV3
are now double precision arrays. The corresponding getter functions have
their return type changed accordingly. This is a backward incompatibility.
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.