Log of /trunk/tree/treeplayer/src/TTreeFormula.cxx
Parent Directory
Revision
49050 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:57:43 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49049
Import revision 49009 from the v5-34-00 patch branch:
Implement the implicit rule for matching pair (based on being able to convert their content
Revision
49049 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:57:22 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49048
Import revision 49008 from the v5-34-00 patch branch:
std::pair also have implicit rules, so always craete a SchemaRuleSet
Revision
49046 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:56:15 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49045
Import revision 49005 from the v5-34-00 patch branch:
When switching STL collection proxy we also need to update fSTLtype
Revision
49045 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:55:53 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49044
Import revision 49004 from the v5-34-00 patch branch:
Fix conversion to from any type of numerical collection to associative type of numerical collection
Revision
49044 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:55:32 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49043
Import revision 49003 from the v5-34-00 patch branch:
Allow the implicit conversion from any type of numerical STL collection to any other type of numerical STL collection (e.g. vector<int> to list<float>)
Revision
49043 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:55:11 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49042
Import revision 49002 from the v5-34-00 patch branch:
Fix conversion to from any type of numerical collection to any type of numerical collection
Revision
49042 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:54:49 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49041
Import revision 49001 from the v5-34-00 patch branch:
Implement convertion to any type of numeric STL in the collection streamer
Revision
49041 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:54:29 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49040
Import revision 49000 from the v5-34-00 patch branch:
Remove use of data member fOnFileClass as much as possible (improve thread safety). Improve const-correctness
Revision
49040 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:53:59 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49039
Import revision 48999 from the v5-34-00 patch branch:
In SetBranchAddress, use the result of CheckBranchAddressType to decide whether to actually use the address or not. This avoid mis-using the user's pointer (but also might make invalid/awkward code fails). To prevent the check (and hence for the use a pointer no matter what), the user needs to cast the pointer to a void*.
Revision
49039 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:53:37 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49038
Import revision 48998 from the v5-34-00 patch branch:
Properly handle the evolution of an STL container containing a class with contains sub-object (don't claim the subobject also changed type)
Revision
49037 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:52:52 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49036
Import revision 48996 from the v5-34-00 patch branch:
In the MakeClass reading code when failing over to using the StreamerInfo, switch to using the action sequence
Revision
49036 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:52:30 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49035
Import revision 48995 from the v5-34-00 patch branch:
Compile the code for the conversion actions for generic collection
Revision
49032 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:50:54 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49031
Import revision 48986 from the v5-34-00 patch branch:
Extend the output of TTree::Print(debugInfo) to include the action sequence information (and add support for the sub option 'func' that also prints the function's (mangled) name
Revision
49031 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:50:32 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49030
Import revision 48984 from the v5-34-00 patch branch:
When printing a TActionSequence also print (on linux/macos) the symbol of the function that will be executed (when the option 'func') is passed.
Revision
49030 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:50:08 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49029
Import revision 48983 from the v5-34-00 patch branch:
In TTree::CheckBranchAddressType properly recognize and record that the user has requested a (valid) translation from one STL container to the other
Revision
49029 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:49:46 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49028
Import revision 48982 from the v5-34-00 patch branch:
Add support for implicit conversion of stl collection (when they require schema evolution)
Revision
49028 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:49:24 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49027
Import revision 48981 from the v5-34-00 patch branch:
In GetConversionStreamerInfo, make sure that we find always find at least one StreamerInfo for an stl collection
Revision
49027 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:49:02 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49025
Import revision 48980 from the v5-34-00 patch branch:
A TClassRef must be changed by operator= even if its ClassPtr has not yet been initialized!
Revision
49025 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:48:19 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49024
Import revision 48959 from the v5-34-00 patch branch:
Fix the spacing error introduce by last minutes code reformating ...
Revision
49024 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:47:57 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49023
Import revision 48954 from the v5-34-00 patch branch:
Be more specific in the error message when not knowing what the type passed to SetBranchAddress
Revision
49021 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:46:42 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49020
Import revision 48944 from the v5-34-00 patch branch:
In TTree::SetBranchAddress, properly reset the TargetClass when the address is changed (back) to the original type.
Issue an error message if the class type of the argument to TTree::SetBranchAddress can not be determined (missing dictionary but having only a typeid).
Revision
49020 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:46:19 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49019
Import revision 48943 from the v5-34-00 patch branch:
Improve performance of reading a branch with an std::list<int> by 25%
by migrating to using the StreamerInfoAction and by implementing
the access to iterator (creation, copy, increment, delete) via
template function (rather than reallying on the slow mechanism
using 'At' (and its use of the fEnv) ...)
Revision
49019 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:18:33 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49018
Import revision 48931 from the v5-34-00 patch branch:
Add the concept of implicit rules to (centrally) support automatic translation of
STL collection from numeric type to other numeric type or for when the contained
class has some rules. Currently enabled only when the target is an std::vector.
Implement the transformation from STL container of numeric to any other numeric
type (both in TGenCollectionStreamer and TStreamerInfo[Actions]).
Migrate more of the conversions to TStreamerInfoActions.
Fix the Conversion of a Double32 or Float16 inside a collection of object to another
type (the previous implemetation was not supporting the customization of the factor
nor the number of bits).
Add TBuffer::ReadFastArrayWithNbits and WithFactor for use in the StreamerInfo Actions.
TStreamerInfoActions:
Introduce WithFactorMarker and NoFactorMarker to allow for less code duplicaton when
supporting Float16_t and Double32_t.
Replace the collection-memberwise action from loop over simple operation to using
ReadFastArray (to be compatible with TBufferXML).
Revision
49018 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:17:38 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49017
Import revision 48922 from the v5-34-00 patch branch:
Remove inadvertent match between 2 unrelated STL collection containing objects
Revision
49017 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:17:11 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49016
Import revision 48921 from the v5-34-00 patch branch:
Improve performace of reading a vector of non-class type by 25% (i.e. std::vector<int>).
The code to apply the same improvement to other container type is in place but is not
enabled yet as the 'better' solution avoid creating a temporary array to read in the
value via Read[Fast]Array, however the avoid the call to Read[Fast]Array breaks
the XML streaming (which uses Read[Fast]Array to insert the <Array> tag around the
element). See for example VectorLooper::ReadCollectionBool ...
Revision
49015 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:16:15 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 228160 byte(s)
Diff to
previous 49014
Import revision 48911 from the v5-34-00 patch branch:
Add the Action function for trivial conversion.
Refactor the creation of the ConfiguredAction for collection (using 3 classes with function templates) that are used in the unique generator functions. This reduces code duplication.
Revision
48992 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 28 15:26:26 2013 UTC (21 months, 3 weeks ago) by
rdm
File length: 228160 byte(s)
Diff to
previous 48964
From Lifeng Sun:
The attached patchset fixes a bunch of typo in the source:
0001-succes-success.patch
0002-preceed-preced.patch
0003-informations-information.patch
0004-childs-children.patch
0005-avaliable-available.patch
0006-writeable-writable.patch
0007-comand-command.patch
0008-unkown-unknown.patch
0009-wierd-weird.patch
0010-wheter-whether.patch
0011-unecessary-unnecessary.patch
0012-splitted-split.patch
0013-registerd-registered.patch
0014-recieve-receive.patch
0015-processsing-processing.patch
0016-ouput-output.patch
0017-mutiple-multiple.patch
0018-lenght-length.patch
0019-interupted-interrupted.patch
0020-independant-independent.patch
0021-inconsistant-inconsistent.patch
0022-expresion-expression.patch
0023-explicitely-explicitly.patch
0024-enviroment-environment.patch
0025-deafult-default.patch
0026-continous-continuous.patch
0027-completly-completely.patch
0028-commited-committed.patch
0029-choosen-chosen.patch
0030-backgroud-background.patch
0031-auxilliary-auxiliary.patch
0032-authentification-authentication.patch
0033-appropiate-appropriate.patch
0034-an-other-another.patch
0035-environement-environment.patch
0036-targetting-targeting.patch
0037-suppported-supported.patch
0038-paramater-parameter.patch
Revision
48964 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 27 20:34:45 2013 UTC (21 months, 4 weeks ago) by
pcanal
File length: 228166 byte(s)
Diff to
previous 44311
Import revision 48963 from the v5-34-00 patch branch:
Record the consumption of a function arguments and closing paranthesis to avoid adding them a second time later on
Revision
44311 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat May 26 03:12:24 2012 UTC (2 years, 7 months ago) by
pcanal
File length: 228074 byte(s)
Diff to
previous 43993
Make sure that the axis managed by TTreeFormula aligns the bins on integer boundary for string histograms. (This was broken by revision 42783)
Revision
43993 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 27 16:23:16 2012 UTC (2 years, 8 months ago) by
pcanal
File length: 227887 byte(s)
Diff to
previous 43518
Fix coverity issues
Dereference null return:
32943,32945,36325,36329: TFormLeafInfo::GetLocalValuePointer
33253: TTreeFormula::EvalObject
33763: CloneTree
33258: GetBasket
34034: In DropBuffers (in addition avoid reading the basket when the intend is to drop the content from memory!)
36307: TTree::BuildIndex
36328: DrawCopy
36332: GetStreamerInfoCache
33025: BuildStreamerInfo
42469: Clone
33436: MakeIterator
Dereference after null check.
42470: in ImportStreamerInfo
33138: in TEntryListArray::Enter
Unchecked return value:
32049, 32050: TBranchProxy::Read and Setup
Mixed enums:
32705,32706: TClass::fStreamerType (and also name the enum type).
Revision
43515 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 27 21:15:53 2012 UTC (2 years, 9 months ago) by
pcanal
File length: 227845 byte(s)
Diff to
previous 43508
Fix coding convention R.RN7 (Avoid the raw C types 'long', 'unsigned long', 'long double', 'bool', 'long long' and 'unsigned long long'.)
Revision
43508 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 27 15:48:54 2012 UTC (2 years, 9 months ago) by
pcanal
File length: 227843 byte(s)
Diff to
previous 42783
Fix the use of string in TTree's alias and TTreeFormula by
fixing the detection that a TTreeFormula is a string or not.
Move to using kIsCharacter only as an accelerator to TTreeFormula::IsString
and always use this function to detect whether the formula is a string or not.
Fix (in TTreeFormula::Init) several cases of string detection and remove from
TFormula any settings (they were wrong anyway, they should have been ResetBit
rather than SetBit) of kIsCharacter.
Revision
41326 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 11 10:26:39 2011 UTC (3 years, 3 months ago) by
pcanal
File length: 226813 byte(s)
Diff to
previous 40993
Fix Coverity issues:
TFormLeafInfo.cxx: 32301,32302,32303,32304,32305,32416 make sure the return value are initialized even if the function accessed through TMethodCall is invalid or if GetStreamerElements 'fails'
TTreeFormuala.cxx: 32314,32315,32316,32395,32417,32418,32419 make sure the return value are initialized even if the function accessed through TMethodCall is invalid or if GetStreamerElements 'fails'
Revision
40993 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 23 18:54:14 2011 UTC (3 years, 4 months ago) by
pcanal
File length: 226773 byte(s)
Diff to
previous 40479
Introduce GetLeaf(branchname,leafname) used in TTreeFormula to avoid ambiguity in the syntax introduced by too many slashes
Revision
38892 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Apr 17 20:07:50 2011 UTC (3 years, 9 months ago) by
pcanal
File length: 226016 byte(s)
Diff to
previous 38500
Hide the soon-to-be-removed TString::fData and update TObject::Dump and TTree::Draw to properly display the content of TString (in the case of TTree::Draw even if the caller uses explicitly fData)
Revision
36672 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 15 17:27:36 2010 UTC (4 years, 2 months ago) by
pcanal
File length: 225494 byte(s)
Diff to
previous 36450
Fix a problem in TTree::Draw reported at http://root.cern.ch/phpBB3/viewtopic.php?t=11612
where if (and only if) exactly one entry of the tree was selected and the data being
plotted (but not selected on) was in a collection, some of the data in the collection
might not be properly updated (because the data branch 'thought' it was still holding
the correct data for the request entry but some of it had been 'zero-ed' out by the
fact that the collection at been resize for each entries).
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: 224625 byte(s)
Diff to
previous 35344
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: 224301 byte(s)
Diff to
previous 35215
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
33333 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat May 1 22:21:55 2010 UTC (4 years, 8 months ago) by
pcanal
File length: 223596 byte(s)
Diff to
previous 33331
Redo r33330 without unwanted side effect (i.e. we do want to print an empty line for entry with zero length array in TTree::Scan
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: 223596 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: 223511 byte(s)
Diff to
previous 32894
Prefer the use of InheritsFrom(TClass*) over InheritsFrom(const char*) as long as
it does not increase the library dependencies.
Revision
32894 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 7 15:00:21 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 223393 byte(s)
Diff to
previous 31936
Merge near indentical code in TChain::Merge, TTree::Clone and TTree::CopyEntries
into TTree::CopyEntries (and call it from the other 2 places). Some small behavior
changes:
TChain::Merge: no longer disable TTreeCache in fast copy mode.
TTree::CopyEntries: also copy the TTreeIndices if any; add proper support for TChain objects; add support for fast cloning.
TTree::CloneTree: also copy the TTreeIndices if any.
Improve the output of TTree::Scan but insert blank space whenever a value is not available because there is no proper row in a friend.
(Previously it was re-printing the previous value). This required changeis in TTree and TChain LoadTree where fReadEntry is now
set to -1 in case of failure to find the proper row.
Revision
31936 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Dec 18 08:10:34 2009 UTC (5 years, 1 month ago) by
brun
File length: 223150 byte(s)
Diff to
previous 31606
Modify TTreeFormula::IsInteger such that the generated histogram is forced
to have an integer binwidth when the leaf is of type integer or string
Revision
31346 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 20 17:29:51 2009 UTC (5 years, 2 months ago) by
pcanal
File length: 222967 byte(s)
Diff to
previous 31239
Properly detect the case where a fix length array is coming from a friend tree
connected with an Index (and hence the presence of the 'entry' is not guaranteed).
This fixes Savannah #58953
Revision
30878 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 27 05:31:56 2009 UTC (5 years, 2 months ago) by
pcanal
File length: 222942 byte(s)
Diff to
previous 30877
Remove a memory leak in some cases of syntax error in the use of aliases.
Re-add error messages skipped by the change in revision 30877.
Revision
30471 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 25 17:39:05 2009 UTC (5 years, 3 months ago) by
pcanal
File length: 221092 byte(s)
Diff to
previous 30176
Fix off by one loop in the reseting of the need to 'read' the branch. (This fixes savannah #56109). Prevent a null pointer dereferencing (in case of errorneous user input)
Revision
30176 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 15 15:42:11 2009 UTC (5 years, 4 months ago) by
pcanal
File length: 221037 byte(s)
Diff to
previous 30158
In TFormula and TTreeFormula when execting the ternary condition operator ( c ? i : e ),
only evaluate one of the two operands (remove kCondition and kStringCondition and add
kJump and kJumpIf). Add support for nested use of ?: in particular when using string
operands.
Improve the check for the type of the operands, in particular reject all cases of
trying to use a number and one string as operands expect for the special case
where the 'string' is actually are array of bytes.
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: 219978 byte(s)
Diff to
previous 29665
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: 219632 byte(s)
Diff to
previous 29623
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
28845 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 8 13:53:44 2009 UTC (5 years, 7 months ago) by
rdm
File length: 214098 byte(s)
Diff to
previous 28379
changes needed to be able to compile with Solaris CC5 and stlport4 STL
library. Backward compatible with old CC5 STL and other platforms.
Revision
26117 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 10 08:46:48 2008 UTC (6 years, 2 months ago) by
pcanal
File length: 213042 byte(s)
Diff to
previous 25572
Add proper support for vector<bool> (which was confused for a string ...)
Add proper support for vector<string> (was not looking through the container for the string type)
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: 211151 byte(s)
Diff to
previous 25402
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
25370 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 5 15:25:20 2008 UTC (6 years, 4 months ago) by
pcanal
File length: 210569 byte(s)
Diff to
previous 23856
Put the TCutG and TEntryList is their own list (fExternalCuts) in order to avoid having to query those object for their type during the destruction of the TTreeFormula (This was leading to using already deleted object in some cases)
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/TTreeFormula.cxx
File length: 206679 byte(s)
Diff to
previous 18807
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
18474 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 4 12:43:31 2007 UTC (7 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 199258 byte(s)
Diff to
previous 18451
Add an optional argument to TTreeFormula::IsInteger, ie
virtual Bool_t IsInteger(Bool_t fast=kTRUE) const;
TTreeFormula::Init calls this function with fast=kFALSE. In this case
the current IsInteger function is executed and the result stored in the kIsInteger bit
of the TTreeFormula. Later when the IsInteger function is called with kTRUE or
no arguments, the function returns immediatly the value of the kIsInteger bit.
This also solves another problem encountered when processing TChains.
It can happen that when TTreePlayer::DrawSelect calls TTreeFormula::IsInteger,
the TBranch objects of the processed Tree are no more available because the last Tree
in the chain has been deleted.
Revision
17730 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 6 15:20:31 2007 UTC (7 years, 11 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 199082 byte(s)
Diff to
previous 17711
In the Streamer functions replace the lines like
TPad::Class()->ReadBuffer(b, this, v, R__s, R__c);
TPad::Class()->WriteBuffer(b,this);
by
b.ReadClassBuffer(TPad::Class(), this, v, R__s, R__c);
b.WriteClassBuffer(TPad::Class(),this);
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/TTreeFormula.cxx
File length: 198649 byte(s)
Diff to
previous 17338
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/TTreeFormula.cxx
File length: 197277 byte(s)
Diff to
previous 16245
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/TTreeFormula.cxx
File length: 195735 byte(s)
Diff to
previous 16216
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
16196 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Sep 2 07:47:29 2006 UTC (8 years, 4 months ago) by
pcanal
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 192558 byte(s)
Diff to
previous 16176
This patch implement support for direct drawing of TString and std::string.
The following
tree->Draw("mybr.mystring");
nows draw the same thing as
tree->Draw("mybr.mystring.c_str()");
or
tree->Draw("mybr.mytstring.Data()");
i.e. an histogram whose labels are the string value of 'mystring'
Revision
14745 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 19 08:22:26 2006 UTC (8 years, 9 months ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 185072 byte(s)
Diff to
previous 14078
Change the TError.h macros:
Assert -> R__ASSERT
Check -> R__CHECK
Change the TCollection.h macro:
ForEach -> R__FOR_EACH
This to avoid potential problems due too trivial macro names.
The old macros will be removed in the next release. Currently
they will print out warning messages with the advice to move
to the new macro names.
Revision
12453 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Aug 9 20:11:53 2005 UTC (9 years, 5 months ago) by
pcanal
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 181687 byte(s)
Diff to
previous 11818
Add a new member function TTreeFormula::ResetLoading.
This can be used instead of calling TTreeFormula::EvalInstance(0) to
insure the proper loading of the branches.
In particular this solves issues when the formula is invalid (invalid
indices for example) for the first instance.
Revision
11818 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 18 21:04:54 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 180782 byte(s)
Diff to
previous 11658
From Philippe:
TBrancBrowsable:
This patch corrects the string passed by the TBrowser to
TTree::Draw with drawing the size of a ROOT collection.
TTreeFormula/TFormLeafInfo:
This patch corrects the handling of a nested TClonesArray
within a split TClonesArray.
Revision
11658 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Apr 23 06:13:09 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 180320 byte(s)
Diff to
previous 11656
From Philippe:
This patch solves a problem with friends of friends when the friends where
chains and contained some branches with the same name.
This issues is now test in roottest/root/tree/friend in test
the FriendOfFriend. (Which includes Marek's test).
Revision
11656 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 22 19:04:43 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 180180 byte(s)
Diff to
previous 11629
From Philippe:
This updates solves issues when trying to browse (via the TBrowser) branches
which had their top level branchname embedded in their own name (i.e. when
the top level branch has been created with a trailing dot in their name).
Also fix a few problem preventing the drawing of branches containing pointer
to STL collection or some case of STL collection containing pointer to
objects.
Revision
11457 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 30 21:09:19 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 178746 byte(s)
Diff to
previous 11435
From Philippe:
TBranch::fOffset stores permanently the offset of the data member in the
object.
When the branch is reloaded without the library, this offset might be
incorrect.
We introduce SetupAddresses (called by GetEntry and TTreeFormula) which
insures
the offset are correctly set.
In case of a fixed size char array nested inside a collection, the indexing
was inconsistent (It is drawn as a string but one of the inner mechanism was
still using the fixed size to calculate the index)
In case of string (like char* or char array) was within a collection,
the TFormLeafInfo 'chain' was incorrectly set (it was not using the
fact the branch has the address of the collection instead of the
addresses of the container of the collection).
Revision
11426 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 24 18:37:53 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 177796 byte(s)
Diff to
previous 11410
From Philippe:
This update fixes a case where when drawing a collection within
a TClonesArray, the size of the TClonesArray was not properly read.
It also fixes a case where TTreeFormula was trying to drill trhough
a collection when it already has seen 2 variable dimensions.
Revision
11410 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 22 19:53:59 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 177684 byte(s)
Diff to
previous 11400
From Philippe:
The attached patch protect TTreeFormula against missing leaves.
In case of missing leaf, it evaluate the whole formula at zero value.
This is not ideal, but adding the ability to skip entries with missing
leaves would require significant change in TSelectorDraw (which itself
is likely to be rewritten).
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/TTreeFormula.cxx
File length: 177549 byte(s)
Diff to
previous 11259
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
11259 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 8 05:33:30 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 173248 byte(s)
Diff to
previous 11254
From Philippe:
This patch solves a problem where the sizes of a collection
within a split-collection where not properly loaded (i.e.
TTreeFormula::LoadCurrentDim was not calling GetEntry on
the branch containing the collection within a collection).
Also (and independently):
To support for the cases where the user do
tree->GetEntry(entry);
// modify the event
tree->GetEntry(entry);
// User expect the event to have reverted to
// the same state as after the first GetEntry
we insured that TBranch::GetEntry always re-stream the
data from the basket. Similarly, TTreeFormula::EvalInstance
needs to also insure that it always re-stream the data
from the basket (Some developer uses TTreeFormula directly).
However in case, when we are guaranteed that the data pointed
to by the tree will not modified and we need to call GetEntry
several times on the same branch for the same entry,
this is a waste of time.
We are in this case for the TTreeFormula handled by
TProofDraw, TSelectorDraw and TTreeIndex.
The case where we currently have the inefficiencies are
the cases for the same branch is listed in several
distinct formulas (for example in the 1 dimension and
the selection or as an index) and the cases of
variable dimensions formulas (GetEntry called at least
once in LoadCurrentDim and once more in EvalInstance).
The attached patch solve the issue for TProofDraw,
TSelectorDraw and TTreeIndex by adding a new data member
to TTreeFormula (fQuickLoad), this can be set to tell
TTreeFormula to assume that the data is really read-only
(and hence it does not need to read the branch again is
br->GetReadEntry()==tree->GetReadEntry().
We can not solve the issue in the general case since we
can not guarantee that that data pointed will not be
modified between the call to GetNdata (hence LoadCurrentDim)
and EvalInstance. The cost of not properly insuring is
high since it involves silently displaying incorrect data.
However LoadCurrentDim could still be improved since it does
not use the optimization used by EvalInstance which insures
that itself reads each branch only once (Fixing this for
LoadCurrentDim would no be trivial)
Note that without the fQuickLoad flag set to true, branches
that are used several time in the same formula are loaded
several times. (With fQuickLoad set to true, they are loaded
only once). Solving this inefficiency is a difficult tasks,
since we would need to insure that the branch is read exactly
once not matter what the value of branch->GetReadEntry is.
In addition, this could only take in consideration the formulas
within the same TTreeFormulaManager. And this would have to
be done without any significant loss for the simple case and
for the case where we can do Boolean optimization (i.e. case
where the content of the branch is not needed to know the
final result of the formula).
Revision
11254 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 7 17:00:17 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 171796 byte(s)
Diff to
previous 11238
From Philippe
This patch adds a missing protection in TTreeFormula::LoadBranch (called
when a formula includes a boolean expression and an index which contains
reference to a branch, for
example tt->Draw("iCell","iCell>900&&iClus[iCellClus-1]==10").
This fixes the bug report #2766 and is tested by indexLoad in
roottest/root/treeformula/array
Revision
11238 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 4 19:37:52 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 171764 byte(s)
Diff to
previous 11190
From Philippe:
TFormula and TTreFormula's calculation of the modulo requires to cast double
precision values into integral value before executing the modulo. The
previous implementation was casting the value down to a Int_t this leads to
the value being incorrect if the original data was an unsigned int greater
than 2^31. We now cast to a Long64_t. Short of having to test for the sign
of both opererands and handling all 4 cases separately, we have to cast to a
sign intergral.
Hence, in order to not penalize in run-time the most used case, we accept
the fact that the modulo operation will still give an incorrect value if the
originial data is an unsigned
64 bits value and is greater than 2^63.
Revision
11188 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Feb 25 19:13:24 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 171763 byte(s)
Diff to
previous 11141
From Philippe:
This correct the support for nested collections. Previously, those nested
collection were silently wrongly handled.
We now properly draw collections nested inside one collection (i.e. 2 levels
of variable size). We explicitly do not support collection nested inside a
collection nested inside a collection (i.e. we can not support 3 levels of
variable size). For those case, the user needs to use the script drawing
mechanism (or MakeProxy directly).
The nesting can be direct (vector<vector<classX> > or vector<vector<int> >)
or indirect vector<classX> which classX containing a vector<classY> or
vector<int>.
Revision
11141 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Feb 18 09:15:08 2005 UTC (9 years, 11 months ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 167318 byte(s)
Diff to
previous 11074
From Philippe:
This patch extends the notion of TTree variable aliases to allow
them to be used as part of single data name.
For example, you can now do:
tree->SetAlias("theGoodTrack","event.fTracks[3]");
tree->Draw("theGoodTrack.fPx"); // same as "event.fTracks[3].fPx"
This patch includes a little clean-up in TTreeFormula::DefinedVariable
to better separate the different phases of the parsing (dimension requests,
leaf finding and exploration into the user class).
This patch also includes an update to DrawTest to test for the new alias
feature and in case of failure to print the corresponding Draw command.
Revision
11046 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Feb 7 17:23:31 2005 UTC (9 years, 11 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 162809 byte(s)
Diff to
previous 10950
From Philippe:
This patch insures that TTreeFormula only call GetEntry once per branch
per entry (This speeds up evaluating formula where the same branch is use
several times).
Update TTreeIndex (and hence TTree::BuildIndex) to be able to
work correctly independently of the state of the TTree object (It previously
__required__ TTree::fReadEntry to be equal to -1).
Make TTreeIndex::Print platform independent (it was not
printing correctly on windows).
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/TTreeFormula.cxx
File length: 161624 byte(s)
Diff to
previous 10902
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
10902 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 12 18:02:28 2005 UTC (10 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 161624 byte(s)
Diff to
previous 10898
From Philippe:
TDirectory:
update TDirectory::GetObject to be able to retrieve TObject from
the in-memory list (to match the behavior of TObject::Get).
stress:
update to use TDirectory new object retrieval interface. This will
allow testing of their availability in interpreted code.
TChainElement:
Insure the proper default initialization of new data members
TTree:
slight warning message fix
TTreeFormula:
Update to a problem in case of splitted top level STL container
Fix for TTree::Scan of strings when they are inside a collection
(the first element __was__ repeated instead of the sub-sequent elements).
Revision
10898 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 12 07:50:03 2005 UTC (10 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 161292 byte(s)
Diff to
previous 10549
From Philippe:
A) Support for top level STL Containers. You can now do
list<int> *ptr = new list<int>;
tree->Branch("mystl","list<int>",&ptr);
B) Autodetection of the pointer type passed to the branch constructor.
So you can now do:
list<int> *ptr = new list<int>;
tree->Branch("mystl",&ptr);
C) Check of the type of the pointer type passed to the branch constructor.
So that you now get an error:
list<int> *ptr = new list<int>;
tree->Branch("mystl","list<float>",&ptr);
Error in <TTree::Branch>: The class requested (list<float>) for the branch
"mystl" is different from the type of the pointer passed (list<int>)
D) TTree's SetBranchAddress now also check its input address (unless the
user explicitly specify (char*) or (void*).
Test/Event and the tree tutorials have been updated to take advantage of the
new syntax.
Revision
10549 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 17 17:56:53 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 160578 byte(s)
Diff to
previous 10545
From Philippe,
This patch implements the schema evolution to and from selected containers.
The following cases are currently implemented:
TClonesArray object -> STL object containing the same type
TClonesArray pointer -> STL pointer containing the same type
STL object -> STL object containing the same type
STL pointer -> STL pointer containing the same type
STL split branches -> TClonesArray
In addition this patch implement the ability to have schema evolution
between various version of a foreign class when the library is not present.
This patch also support in in TTree::Draw for the schema evolution of simple
type stored in a non-split branch.
Revision
10541 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 17 06:02:52 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 160390 byte(s)
Diff to
previous 10249
From Philippe:
This patch implements the schema evolution to and from selected containers.
The following cases are currently implemented:
TClonesArray object -> STL object containing the same type
TClonesArray pointer -> STL pointer containing the same type
STL object -> STL object containing the same type
STL pointer -> STL pointer containing the same type
STL split branches -> TClonesArray
In addition this patch implement the ability to have schema evolution
between various version of a foreign class when the library is not present.
This patch also support in in TTree::Draw for the schema evolution of simple
type stored in a non-split branch.
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/TTreeFormula.cxx
File length: 157278 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/TTreeFormula.cxx
File length: 155326 byte(s)
Diff to
previous 9615
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/TTreeFormula.cxx
File length: 154795 byte(s)
Diff to
previous 9551
*****************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
8987 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 19 19:41:38 2004 UTC (10 years, 8 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 216482 byte(s)
Diff to
previous 8913
From Philippe:
This patch corrects the parsing of nested operator[] in TTreeFormula, eg:
h1->Draw("Vnt_fmcvtx_r[Vnt_vtx_i[0]-1][]","Vnt_fmckin_id<50");
In this case the nested [] were (incorrectly) used twice :(
Also we now properly handle the case where 2 (or more) variable
size arrays are being used and the index for one of them is given
by an expression which is also a variable size array. There was
an error when the size of 'index' expression was reaching the value 1.
I.e If fNpoint is a variable size array whose size happens to be 1 for
the entry 0, the expression:
T->Draw("fPx[abs(fNpoint[]-65)]+fMeasures","","",1,0)
now works properly (it was previouls drawing sizeof(fMeasures) values
instead of just one value).
Also issue an error in TSelectorDraw::Begin and stop the processing if
the name of the histogram requested already exist and point to something
that is NOT an histogram (the worst case scenario is when you use the
same name as the TTree ! )
Revision
8908 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 12 22:43:06 2004 UTC (10 years, 8 months ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 215812 byte(s)
Diff to
previous 8502
From Philippe and Maarten:
This patch includes the implementation by Maarten of the support for
Long64_t in non-split objects in TTreeFormula.
It also include a correction in the error case detection of TFormula's
strstr (was leading to a core dump (instead of a parsing error) if the
first argument was not a char*).
Revision
8222 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Feb 18 07:28:02 2004 UTC (10 years, 11 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 213914 byte(s)
Diff to
previous 8187
From Philippe:
This patch implements TTree::Draw for vector. The current convention is the same
as for TClonesArray, namely after dereferencing a collection, the right hand of
the expression is request for the content and not for the container.
TBranchElement.cxx
Make sure that a non-split branch containing an stl container contain
one leaf.
TVirtualCollectionProxy, TEmulatedVectorProxy, TVectorProxy
Add the ability to retrieve the data type when it is a numerical type
TVectorProxy
Fix some problem in the addressing caching mechanism
TClass.h
Correct the ROOT::GetClass templates to properly return the TClass
object in case when the parameter is a pointer to pointer (or more).
TClassEdit.cxx:
Avoid thinking that vector<xxx>::iterator is an stl container!
TTreeFormula.cxx
Add support for stl container (actually ANY container which a
know TVirtualCollectionProxy). Added TFormLeafInfoCollection and
TFormLeafInfoNumerical (non struct, non class container content).
Revision
8187 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Feb 11 22:06:44 2004 UTC (10 years, 11 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 189715 byte(s)
Diff to
previous 8180
From Philippe:
This patches properly handles error cases where the streamer info is missing in the file. Instead of fixing the
symptoms (as in previous
patch), this patch prevent the formula parsing of incorrect cases.
In particular it introduces the following error messages:
root [3] Error in <TTreeFormula::DefinedVariable>: Missing StreamerInfo for evt.CosmicOOTLow. We will be unable to
read!
*ERROR 31 :
The Variable : "evt.CosmicOOTLow" exists but is not accessible
Error in <TTreeFormula::DefinedVariable>: Address not set when the type of the branch is negatif for for evt. We will
be unable to read!
*ERROR 31 :
The Variable : "evt.fBits" exists but is not accessible
Revision
8098 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 31 08:59:09 2004 UTC (10 years, 11 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 186846 byte(s)
Diff to
previous 7900
Reintroduce Philippe's patch, now corrected for several machines.
stress, bench and DrawTest.sh runs correctly.
Still problem in running DrawTest.sh on SGI (cc,gcc,kcc). Likely due
to an alignement problem with the handling of the new type Double32_t
Revision
7900 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jan 13 18:46:39 2004 UTC (11 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 186804 byte(s)
Diff to
previous 7880
From Philippe:
//*-* In version 7 of TFomrula, the usage of fOper has been changed
//*-* to improve the performance of TFormula::EvalPar.
//*-* Conceptually, fOper was changed from a simple array of Int_t
//*-* to an array of composite values.
//*-* For example a 'ylandau(5)' operation used to be encoded as 4105;
//*-* it is now encoded as (klandau >> kTFOperShit) + 5
//*-* Any class inheriting from TFormula and using directly fOper (which
//*-* is now a private data member), needs to be updated to take this
//*-* in consideration. The member functions recommended to set and
//*-* access fOper are: SetAction, GetAction, GetActionParam
//*-* For more performant access to the information, see the implementation
//*-* TFormula::EvalPar
Also note that version 6 of TFormula is not supported.
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/TTreeFormula.cxx
File length: 186781 byte(s)
Diff to
previous 7832
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
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/TTreeFormula.cxx
File length: 181616 byte(s)
Diff to
previous 7773
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
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/TTreeFormula.cxx
File length: 176685 byte(s)
Diff to
previous 7749
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/TTreeFormula.cxx
File length: 176247 byte(s)
Diff to
previous 7736
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
7736 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Dec 11 23:30:35 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 174285 byte(s)
Diff to
previous 7453
From Philippe:
The evaluation of operator && (and ||) is now optimized so that if the left hand of the expression is false (true) then
the right part is not evaluated.
Also this patch continues the replacement of some hard coded constants with enums value.
Revision
7453 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 20 18:19:58 2003 UTC (11 years, 3 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 173152 byte(s)
Diff to
previous 7222
From Philippe:
TFormula::Analyze now check whether an expression is numerical __before__ checking whether it is a defined variable.
Without this patch doing something as simple as:
mytree->Draw(".5");
mytree->Draw("goodvar*.5");
could fails depending on the structure of the tree. In particular, if a new 'weird'
branch is added to a tree, those statement might now lead to core dumps event if
the new branch is not being used. (The core dumps should not be happening in the
first place ... but this is more stable :) ).
In TTreeFormula, we now properly skip the case of a TClonesArray inside a split TClonesArray when looking for data
members and methods (when the branch name is not fully explicit).
Revision
7154 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 25 22:37:39 2003 UTC (11 years, 5 months ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 171320 byte(s)
Diff to
previous 7109
From Philippe:
Update TStreamerInfo::New to properly initialize pointers and array of objects.
Update BuildIndex to elegantly fail if the given index do not produces exactly
one value per entry.
Update TTreeFormula to properly handle the case of a TClonesArray inside a
TClonesArray when the former is a top branch and not split.
Revision
6805 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 30 15:45:52 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 167472 byte(s)
Diff to
previous 6775
From Philippe:
The following patch implements TTree variable alias.
To use them:
mytree->SetAlias("mult","fPx*fPy");
mytree->Draw("mult");
Note that the aliases have been added to the TTree object so that they can be persistent (with the tree) if you choose.
Also note that the alias are not checked for validity until they are used in a Draw or Scan command.
Existing alias are silently replaced.
The new functions are:
TTree::SetAlias
TTree::GetAlias
TChain::GetAlias
TTree::GetListOfAliases
This patch also adds operator= for TFormula, TF1, TF2, TF3 (it calls the respective Copy member functions). It makes TTreeFormula::operator= private (Copy has not been implemented yet).
Also some of the TFormula and TTreeFormula codes (those stored in fOper) has been aliased to enums (this renders the code is little bit more readable and searchable).
TFormula and TTreeFormula have been updated to handle strings in a more flexible (and for TTreeFormula to be able to return them).
Revision
6775 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 25 07:16:22 2003 UTC (11 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 161608 byte(s)
Diff to
previous 6751
Fix by Victor:
TStreamerInfo::GetElems() returns array of pointers to TStreamerElements
TBranchElement::GetID() returns index in this array.
It is OK.
But in files TTreeFormula.cxx and TBranchElement.cxx this index is used for the list
provided by TStreamerInfo::GetElements()
Generally these lists are different, but often the same.
In our case these lists are different because of TClass::IgnoreTObjectStreamer() method used
In GetElements() TObject element exists but
in GetElems() NOT.
Revision
6712 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 13 06:19:09 2003 UTC (11 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 161668 byte(s)
Diff to
previous 6699
From Philippe:
This implements the ability for TFormula, TFx and TTreeFormula to call global function and static member functions that
take numericals arguments and returns numerical arguments.
For example:
T->Draw("TMath::BreitWigner(fPx)");
or
T->Draw("MyInterpretedFunction(fPx)");
or
TF1 *f = new TF1("f1","TMath::BreitWigner(fPx.[0],[1])");
myhist->Fit(f);
Revision
6699 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 10 19:07:04 2003 UTC (11 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 160636 byte(s)
Diff to
previous 6551
From Philippe:
This patch prevents a core dump if the user double click in the TBrowser on a non-split leaf. It also reduces to 1 the
number of message warning that TSelectorDraw does not know how to histogram this type of objects (it only know how to
histogram TBits and numerical types).
Revision
6551 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 6 05:27:41 2003 UTC (11 years, 8 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 160536 byte(s)
Diff to
previous 6469
Patch from Philippe fixing a problem reported by Walter Mueller.
The problem was related to the fact that pct.amp was a static array of size 4 inside
a TClonesArray and pct.xo is just a data member inside the same TClonesArray.
Hence pct.amp[0][] is a array of size either 4 or 0 (if no element in the clones) and
pct.xo is a variable size array of the size of the current clonesArray. When the
clonesArray was of size exactly one, the system was confused and
thought that pct.xo was of the same size as pct.amt[0][].
'tree->Draw("pct.amp[0]:pct.xo");' and 'tree->Draw("pct.amp[0]:pct.t.xo");' presented
the same error but due to different path in the code were failing in different ways.
Revision
6263 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 6 23:07:06 2003 UTC (11 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 158824 byte(s)
Diff to
previous 6208
From Philippe;
This patch corrects 2 problems.
The first one is one where the list of friends of a tree of a chain was not properly updated if the friend was added after the tree was
loaded (i.e c->LoadTree(); c->AddFriend(); ).
The second one was a failure of TTreeFormula to request (sometime) the proper entry of a branch if this branch was part of a friends of a
chain where the tree where uneven in lenght(but the 2 chains were of the same length).
Revision
5977 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 24 07:04:29 2003 UTC (12 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 157448 byte(s)
Diff to
previous 5935
From Philippe
Inclosed is a patch that allow the TTree::Drawing a TBits object. I.e
mytree->Draw("myevent.myTbits");
will create a 1D histogram from 0 to nbits which is filled for
each bitnumber which is non-null.
This features is enable if and only if the 'to be drawn' formula contains
only one variable and no operations but can contains method calls:
mytree->Draw("event.fH");
mytree->Draw("event.GetHistogram()");
mytree->Draw("event.fH.GetXaxis()");
mytree->Draw("event.GetHistogram().GetXaxis()");
mytree->Draw("event.fH.GetXaxis().IsA()");
mytree->Draw("check("event.GetHeader()");
mytree->Draw("event.GetTrackCopy()");
mytree->Draw("event.GetTrackCopy(2)");
mytree->Draw("event.GetTrackCopy().fTrigBits");
The system will be extended to allow the 'drawing' of classes other than TBits.
This version is working but is not aggresively optimized (no code
duplication) but has a negligeable impact on the existing cases (one extra
'if (bool)' for each TSelectorDraw::ProcessFill.
TTreeFormula has a new eval function EvalObject which returns a pointer to
the (eventual) object pointed to by the formula. EvalClass return the TClass
corresponding to this object.
Revision
5935 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 17 17:48:09 2003 UTC (12 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 151696 byte(s)
Diff to
previous 5719
From Philippe:
The following patch repairs the fact that the new TSelectorDraw
does not properly recover from error in the parsing of the formulas.
It also fixes a problem in the parsing of erroneous input when part
of the name matches a split TClonesArray branch name.
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/TTreeFormula.cxx
File length: 151046 byte(s)
Diff to
previous 5710
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
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/TTreeFormula.cxx
File length: 149777 byte(s)
Diff to
previous 4997
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
4997 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 19 22:52:49 2002 UTC (12 years, 6 months ago) by
rdm
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 139809 byte(s)
Diff to
previous 4827
TBranchElement: when in MakeClass mode correctly read empty variable
length array stored inside a TClonesArray.
TTreeFormula: properly deal with empty variable length arrays stored
inside a TClonesArray when in split mode (it still does not work when
NOT split).
-- Philippe
Revision
4827 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jul 6 06:54:35 2002 UTC (12 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 139823 byte(s)
Diff to
previous 4724
From Philippe
This patch solves an ownership problem (friend chains on the stack were
delete), it also fix a problem with refreshing the pointer to the leaf
when the leaf was accessed using a tree-alias name. It also enables the
befriending of chains contains series of trees of unequal size (in
parallel).
It also re-enable using string (char*) store into a TClonesArray using a
TTree::Draw command (in the current version it was reading repetitively
the string of the 1st element).
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/TTreeFormula.cxx
File length: 139028 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/TTreeFormula.cxx
File length: 136692 byte(s)
Diff to
previous 4171
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
4155 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 8 08:09:11 2002 UTC (12 years, 10 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 134841 byte(s)
Diff to
previous 4145
iPatch from Philippe that (re)enables saving and reading C-style arrays of object.
The 4 cases added are
array of pointers to object inheriting from TObject
array objects inheriting from TObject
array of pointers to object not inheriting from TObject but with ClassDef
array objects not inheriting from TObject but with ClassDef
Note that the 1st 2 cases are also implemented for inside a TClonesArray while
the last 2 cases are NOT ... this will be done when we upgrade the ClassDef/ClassImp
facility....
A small update to TTreeFormula for those cases (more is needed).
Revision
3636 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jan 10 07:19:31 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 132925 byte(s)
Diff to
previous 3631
This patch from Philippe llows TTreeFormula to recover and properly return the
value of a method return a char* (or any variation). So with
Event.root: T->Draw("GetType()"), T->Draw("fTracks.GetTrackName()");
work properly.
Also fix a bug that prevented T->Draw("fTracks[0].GetPx()");
Revision
3631 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 9 18:51:08 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 130937 byte(s)
Diff to
previous 3562
This patch from Philippe supports more cases of string TLeaf.
It also fixes a problem when a TLeaf used as a string was the last
leaf mentioned in the formula.
I.e T->Draw("strstr(fEventName,\"Event\") + fType[2] "); was actually doing
T->Draw("strstr(fEventName,\"Event\") + 0 "); !
Revision
3390 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 4 21:52:31 2001 UTC (13 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 129229 byte(s)
Diff to
previous 3327
This update from Philippe rationalizes the treatment of array of chars and bytes.
They are now considered by default as an array of numbers. However if
they are used with an operator== or an operator!= and if the second argument
is also a string, the strcmp function will be used. In addition, a direct call
of the function strstr is allowed. The checks and error messages have been
improved for both the operator and strstr.
This update also corrects the problem where an expression was drawn multiple
times when using a fixed length array in string comparaison.
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/TTreeFormula.cxx
File length: 121311 byte(s)
Diff to
previous 2999
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
2992 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Oct 6 07:30:15 2001 UTC (13 years, 3 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 121173 byte(s)
Diff to
previous 2970
From Philippe,
Functions that return an int are now histogramed in integer format.
You can now call methods of classes stored in a split clones array.
You can now call those methods by omitting the branch name.
You can not (yet) call a method on an object data member that has
been split.
Revision
2964 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Oct 3 18:56:44 2001 UTC (13 years, 3 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 115778 byte(s)
Diff to
previous 2817
This updates from Philippe make sure that TTree::Draw eliminates all the temporary
objects that might be created by a method call on an entry per entry
basis. (Currently they would be accumulated until the end of the
Draw command and deleted when the next cint command is entered).
Revision
2817 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Sep 19 05:51:41 2001 UTC (13 years, 4 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 115645 byte(s)
Diff to
previous 2694
As discovered by Thomas Hebbeker, When a branch contained a leaf
of the same name, TTree::Draw was always using that leaf. For example
both Draw("Met.Met") and Draw("Met.Psi") were resulting in an histogram
of the values of Met.Met. This patch from Philippe fixes the problem.
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/TTreeFormula.cxx
File length: 101740 byte(s)
Diff to
previous 2360
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
2283 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 25 06:23:27 2001 UTC (13 years, 8 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 82990 byte(s)
Diff to
previous 2251
The following mods from Philippe:
Update TTreeFormula to be able to properly handle TClonesArray when the
split level is only 1. Also enhance the fix used when treating cases like
"function(var)".
One side-effect that could be removed is that you can now use:
Draw("GetXaxis") to do the same thing as Draw("fH.GetXaxis()")
WHEN and only when the split level is 1 or more.
Revision
2113 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 2 20:44:34 2001 UTC (13 years, 8 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 76129 byte(s)
Diff to
previous 2102
Add new code from Philippe to support, eg
T.Draw("event.GetHistogram()->GetMean()")
T.Draw("event.fH.fNcells").
The modification in TClass in needed to allow for TClass::GetMethod to properly
return method that allocated more than 1 parent class removed (i.e a function
in TObject for TTree).
Also, eventhough the result is correct, the modifications is not optimal
for speed
of execution of the GetMethod method.
Revision
2081 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 27 06:59:32 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 69493 byte(s)
Diff to
previous 2030
This updates by Philippe allows for all of the stress9 draw command
to be run on streamed (with shared library for now, see below) or
split leaves.
Things not implemented yet.
- following pointers other that TClonesArrays pointer (this should
be done soon).
- chains of methods (i.e fH.GetXaxis()->GetSomethingElse()
- callings methods on data members of a streamed class.
Revision
2030 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 20 21:21:38 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 45728 byte(s)
Diff to
previous 1994
From Philippe:
In tree, now allows to draw complete arrays with a double click in the browser
(before it was attempting draw one out-of-bounds element: array[max_size])
In meta, use SetReadingObject in ReadBuffer before processing the
following cases: kObjectp, kObjectP, kObject, kAny, kStreamer, kStreamLoop.
Also update the function TStreamerInfo::GetStreamerElement, to allow
TTreeFormula to properly cache the offset and type information.
In treeplayer, now correctly handle all datamember and method calls
(plus a little bit of clean-up in some calls) when in split mode.
Non-split(or streamed) mode needs more works.
Revision
1994 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 18 06:11:06 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 43947 byte(s)
Diff to
previous 1993
th this patch from Philippe one can access a datamember within a branch.
For example with a split tree of Event, one can now do:
TFile *Event = TFile::Open("Event.new.root")
T->Draw("event.fH.fNcells")
T->Draw("event.fH.GetNbinsX()")
with both the old style and the new style. It is currently
limited to one level, i.e., you still can not do:
T->Draw("event.fH.fAxis.fXmin")
Revision
1993 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 18 05:59:08 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 44100 byte(s)
Diff to
previous 1950
From Philippe:
This version of TTreeFormula enables using method calls within the
Draw command with new style branches.
Together with the patch for TStreamerInfo, this allow stress to
work properly in the new style of branches.
However it does not completely fix the access to data member.
It is currently limited to public data member. We need to
find a function that return the offset of a datamember given
its name (this function needs to lookup in the class itself
but also in its base).
Revision
1925 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 9 08:33:50 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 42175 byte(s)
Diff to
previous 1751
Many changes in this new version of TTreeFormula:
The functionality provided by the old static functions GetLeaf and GetBranch has been moved
to TTree::GetBranch, TTree::GetLeaf, TBranch::GetBranch and TBranch::GetLeaf.
Preliminary mods to support the new class TFriendElement.
The member fLeaves contain now pointers to the active leaves used by this TTreeFormula.
When a TChain loads a new TTree in TChain::LoadTree, the corresponding TTreePlayer object
calls the new function TTreeFormula::UpdateFormulaLeaves. This new function recomputes pointers in fLeaves
by using the names of the leaves and corresponding Trees in the new member "TObjArray fNames".
This solves a long standing problem with TChains having TTrees with classes that have evolved
compared to the first Tree in the TChain.
The Streamer function uses the automatic Streamer for the new class.
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/TTreeFormula.cxx
File length: 43020 byte(s)
Diff to
previous 1516
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
1205 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Dec 13 15:13:57 2000 UTC (14 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 33378 byte(s)
Diff to
previous 1131
W A R N I N G !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================
A very long list of changes in this pre-release of version 3.00.
We have modified the signature of many functions (in particular TObject)
to introduce more constness in the system.
You must change your code if your class derives from TObject and uses
one of the modified functions such as ls, Print, Compare, Hash, etc.
The modified functions in TObject have the following signature:
virtual TObject *Clone() const;
virtual Int_t Compare(const TObject *obj) const;
virtual void Delete(Option_t *option=""); // *MENU*
virtual void DrawClass() const; // *MENU*
virtual void DrawClone(Option_t *option="") const; // *MENU*
virtual void Dump() const; // *MENU*
virtual TObject *FindObject(const TObject *obj) const;
virtual char *GetObjectInfo(Int_t px, Int_t py) const;
virtual ULong_t Hash() const;
virtual void Inspect() const; // *MENU*
virtual Bool_t IsEqual(const TObject *obj) const;
virtual void ls(Option_t *option="") const;
virtual void Print(Option_t *option="") const;
A similar operation has been done with classes such as TH1, TVirtualPad,
TTree, etc.
Revision
1131 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Dec 8 08:00:38 2000 UTC (14 years, 1 month ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 33342 byte(s)
Diff to
previous 989
Because of deficiencies in the standard C formating fonction sprintf, add logic
in TTreeFormula::PrintValue to correctly print floats/doubles including the exponent
value in a fixed length buffer of 9 characters. The exponent is always shown
and the precision reduced.
Revision
446 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 11 20:10:12 2000 UTC (14 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 33010 byte(s)
Diff to
previous 224
The kMAXFOUND parameter limit for the EvalInstance() member function
was increased to 200 for version 2.24.05 (along with the appropriate
change in TFormula). However, the size of the fCodes, fCumulSize, and
fIndexes arrays (declared in the header) and the fIndex array (declared
in the constructor) should be increased to 200 as well.
(Thanks to Gene Van Buren for reporting the inconsistency)
The kMAXFOUND parameter is now declared in TFormula.h and kMAXCODES
is set to kMAXFOUND in TTreeFormula.
Revision
204 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 14 12:45:06 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 32630 byte(s)
Diff to
previous 203
Fix a bug in the new TTreeFormula constructor.
Changed the statement
for (k = fNdimensions[i]; (k > 0) && (fCumulSize[k-1]>=0); k--) {
to
for (k = fNdimensions[i]; (k > 0) && (fCumulSize[i][k-1]>=0); k--) {
This bug was detected by the HP-UX CC compiler
Revision
200 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 14 09:06:44 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 32644 byte(s)
Diff to
previous 119
New version of TTreeFormula by Philippe Canal.
This version should be properly handling the following cases.
Draw("fVertex");
Draw("fVertex[10]");
Draw("fVertex[][2]");
Draw("fVertex[600]");
Draw("fVertex[590][1]");
It should also handle properly operation including arrays of the same
number of dimension but different size.
E.g. with
carre[2][3] and cube[3][4]
Draw("carre - cube");
should be doing the equivalent of
for(i=0;i<2;i++)
for(j=0;j<3;j++)
histogram( carre[i][j] - cube[i][j] );
It should be the case both is the first dimension is a real dimension
of one 'acquired' from being in a TClonesArray.
Revision
51 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 30 06:12:50 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 20181 byte(s)
Diff to
previous 46
- New options in TStyle::Setxxx fonctions setting axis parameters.
For example, one can do : gStyle->SetLabelFont(72,"xyz")
to set the font for the 3 axes x,y,z
- Change print format precision from 9.5g to 9.9g in TTreeFormula::PrintValue.
Revision
44 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu May 25 09:49:29 2000 UTC (14 years, 8 months ago) by
brun
Original Path:
trunk/treeplayer/src/TTreeFormula.cxx
File length: 20202 byte(s)
Diff to
previous 3
- Add a new member char fType[20] in class Event of test program mainEvent.
- Modify TTreeFormula::DefinedVariable and TTreeFormula::EvalInstance
to support strings. With the new Event test program, one can do:
T.Draw("event.GetNtrack()","strstr(fType,\"type3\")!=0");
or
T.Draw("event.GetNtrack()","fType==\"type3\"");
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.