Log of /trunk/tree/treeplayer/inc/TTreePlayer.h
Parent Directory
Revision
38741 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Apr 5 18:12:39 2011 UTC (3 years, 9 months ago) by
pcanal
File length: 7815 byte(s)
Diff to
previous 31561
Copy documentation explained the length of the array returned by TSelectorDraw::GetVal. Add reference to this documentation in the other related function GetV1, etc. in TSelectorDraw, TTreePlayer and TTree.
Revision
31561 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Dec 4 16:31:47 2009 UTC (5 years, 1 month ago) by
brun
File length: 7495 byte(s)
Diff to
previous 31496
From Lorenzo:
patch to revert back the changes in the fitting method in the TTree in order to not have the libHist dependency.
Revision
18606 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 27 08:34:25 2007 UTC (7 years, 8 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 7409 byte(s)
Diff to
previous 17846
-Change the return type of TTree::Fit and TTree::UnbinnedFit from Long64_t to Int_t
to be consistent with the return type of TH1::Fit and TGraqph::Fit.
-TTree::Fit and TTree::UnbinnedFit have now the following return status:
The function return the status of the fit in the following form
fitResult = migradResult + 10*minosResult + 100*hesseResult + 1000*improveResult
The fitResult is 0 is the fit is OK.
The fitResult is negative in case of an error not connected with the fit.
The number of entries used in the fit can be obtained via
mytree.GetSelectedRows();
If the number of selected entries is null the function returns -1
Revision
17846 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Feb 10 07:36:56 2007 UTC (7 years, 11 months ago) by
pcanal
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 7407 byte(s)
Diff to
previous 17422
Change fSelectorUpdate from Bool_t to TSelector* to hold the value
of the selector being processed so that UpdateFormulaLeaves can update it
instead of blindly update the possibly
idle fSelector __and__ the possibly invalid (because of file reload)
fSelectorFromFile. (This resolves the crash in roottest/root/tree/selector)
Revision
17422 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 22 07:57:14 2007 UTC (8 years ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 7389 byte(s)
Diff to
previous 16684
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
9753 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 13 09:44:28 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 7014 byte(s)
Diff to
previous 9615
Add a new function;
Long64_t TTreePlayer::GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const
// return the number of entries to be processed
// this function checks that nentries is not bigger than the number
// of entries in the Tree or in the associated TEventlist
This new function is called in:
TTreePlayer::CopyTree
TTreePlayer::Principal
TTreePlayer::Process
TTreePlayer::Scan
TTreePlayer::Query
Revision
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/inc/TTreePlayer.h
File length: 6925 byte(s)
Diff to
previous 9556
*****************WARNING*****************
With this mega patch, we introduce support for TTree/TChain with more than
2 billion entries. Several class data members have been changed from
Int_t (or Stat_t) to Long64_t.
==>Trees written with this new version cannot be read with older versions
******************************************
TBranch:
========
- replace the members with type Int_t or Stat_t by Long64_t
Long64_t fEntryNumber; // Current entry number (last one filled in this branch)
Long64_t fReadEntry; //! Current entry number when reading
Long64_t fEntries; // Number of entries
Long64_t fTotBytes; // Total number of bytes in all leaves before compression
Long64_t fZipBytes; // Total number of bytes in all leaves after compression
Long64_t *fBasketEntry; //[fMaxBaskets] Table of first entry in eack basket
- corresponding changes in the member functions
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray *list, Int_t n);
Int_t GetEvent(Long64_t entry=0) {return GetEntry(entry);}
Long64_t *GetBasketEntry() const {return fBasketEntry;}
Long64_t GetReadEntry() const {return fReadEntry;}
Long64_t GetTotalSize() const;
Long64_t GetTotBytes() const {return fTotBytes;}
Long64_t GetZipBytes() const {return fZipBytes;}
Long64_t GetEntryNumber() const {return fEntryNumber;}
Long64_t GetEntries() const {return fEntries;}
TBranch::Streamer has been modified to read old files and automatically translate
the old types to the new types.
The new version of Streamer uses the TClass::ReadBuffer/WriteBuffer.
TBranch::Print has been modified to take into account the new data types.
ClassDef version increased to 10.
TBranchClones:
==============
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
TBranchElement:
===============
Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
TBranchObject:
==============
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
TChain:
=======
Long64_t *fTreeOffset; //[fTreeOffsetLen]Array of variables
virtual Int_t Add(const char *name, Long64_t nentries=kBigNumber);
virtual Int_t AddFile(const char *name, Long64_t nentries=kBigNumber);
virtual Long64_t Draw(const char *varexp, const TCut &selection, Option_t *option=""
,Long64_t nentries=kBigNumber, Long64_t firstentry=0);
virtual Long64_t Draw(const char *varexp, const char *selection, Option_t *option=""
,Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
virtual Long64_t GetChainEntryNumber(Long64_t entry) const;
virtual Long64_t GetEntries() const;
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
Long64_t LoadTree(Long64_t entry);
virtual void Loop(Option_t *option="",Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
virtual Long64_t Merge(const char *name);
virtual Long64_t Merge(TCollection *list);
virtual Long64_t Merge(TFile *file, Int_t basketsize, Option_t *option="");
virtual Long64_t Process(const char *filename,Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
virtual Long64_t Process(TSelector *selector,Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0);
ClassDef version changed from 4 to 5
TSelector
=========
virtual Bool_t ProcessCut(Long64_t /*entry*/) { return kTRUE; }
virtual void ProcessFill(Long64_t /*entry*/) { }
virtual Bool_t Process(Long64_t /*entry*/) { return kFALSE; }
TSelectorCint
=============
virtual Bool_t ProcessCut(Long64_t entry);
virtual void ProcessFill(Long64_t entry);
virtual Bool_t Process(Long64_t entry);
TSelectorDraw
=============
Long64_t fDraw; //! Last entry loop number when object was drawn
Long64_t fSelectedRows; // Number of selected entries
Long64_t fOldEstimate; // value of Tree fEstimate when selector is called
Double_t *fV1; //![fSelectedRows]Local buffer for variable 1
Double_t *fV2; //![fSelectedRows]Local buffer for variable 2
Double_t *fV3; //![fSelectedRows]Local buffer for variable 3
Double_t *fV4; //![fSelectedRows]Local buffer for variable 4
Double_t *fW; //![fSelectedRows]Local buffer for weights
virtual Long64_t GetSelectedRows() const {return fSelectedRows;}
virtual Bool_t Process(Long64_t /*entry*/) { return kFALSE; }
virtual void ProcessFill(Long64_t entry);
virtual void ProcessFillMultiple(Long64_t entry);
virtual void ProcessFillObject(Long64_t entry);
virtual void SetEstimate(Long64_t n);
TTree
=====
Modified data types
Long64_t fEntries; // Number of entries
Long64_t fTotBytes; // Total number of bytes in all branches before compression
Long64_t fZipBytes; // Total number of bytes in all branches after compression
Long64_t fSavedBytes; // Number of autosaved bytes
Long64_t fMaxEntryLoop; // Maximum number of entries to process
Long64_t fMaxVirtualSize; // Maximum total size of buffers kept in memory
Long64_t fAutoSave; // Autosave tree when fAutoSave bytes produced
Long64_t fEstimate; // Number of entries to estimate histogram limits
Long64_t fChainOffset; //! Offset of 1st entry of this Tree in a TChain
Long64_t fReadEntry; //! Number of the entry being processed
Long64_t fTotalBuffers; //! Total number of bytes in branch buffers
Long64_t fDebugMin; //! First entry number to debug
Long64_t fDebugMax; //! Last entry number to debug
New function signatures
virtual Long64_t AutoSave(Option_t *option="");
virtual TTree *CloneTree(Long64_t nentries=-1, Option_t *option="");
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1);
virtual TTree *CopyTree(const char *selection, Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Draw(const char *varexp, const TCut &selection, Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Draw(const char *varexp, const char *selection, Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
virtual Long64_t Fit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option="" ,Option_t *goption=""
,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
virtual Long64_t GetChainEntryNumber(Long64_t entry) const {return entry;}
virtual Long64_t GetChainOffset() const { return fChainOffset; }
Long64_t GetDebugMax() const {return fDebugMax;}
Long64_t GetDebugMin() const {return fDebugMin;}
virtual Long64_t GetEntries() const {return fEntries;}
virtual Long64_t GetEntriesFast() const {return fEntries;}
virtual Long64_t GetEntriesFriend() const;
virtual Long64_t GetEstimate() const { return fEstimate; }
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
Int_t GetEvent(Long64_t entry=0, Int_t getall=0) {return GetEntry(entry,getall);}
virtual Long64_t GetEntryNumberWithBestIndex(Int_t major, Int_t minor=0) const;
virtual Long64_t GetEntryNumberWithIndex(Int_t major, Int_t minor=0) const;
virtual Long64_t GetEntryNumber(Long64_t entry) const;
virtual Long64_t GetMaxEntryLoop() const {return fMaxEntryLoop;}
static Long64_t GetMaxTreeSize();
virtual Long64_t GetMaxVirtualSize() const {return fMaxVirtualSize;}
virtual Long64_t GetReadEntry() const {return fReadEntry;}
virtual Long64_t GetReadEvent() const {return fReadEntry;}
virtual Long64_t GetSelectedRows() {return GetPlayer()->GetSelectedRows();}
virtual Long64_t GetTotBytes() const {return fTotBytes;}
virtual Long64_t GetZipBytes() const {return fZipBytes;}
virtual Long64_t LoadTree(Long64_t entry);
virtual Long64_t LoadTreeFriend(Long64_t entry, TTree *T);
virtual Long64_t Merge(TCollection *list);
TPrincipal *Principal(const char *varexp="", const char *selection="", Option_t *option="np"
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Process(const char *filename,Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
virtual Long64_t Process(TSelector *selector, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Project(const char *hname, const char *varexp, const char *selection="", Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual TSQLResult *Query(const char *varexp="", const char *selection="", Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Scan(const char *varexp="", const char *selection="", Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
virtual void SetDebug(Int_t level=1, Long64_t min=0, Long64_t max=9999999); // *MENU*
virtual void SetEntries(Long64_t n);
virtual void SetEstimate(Long64_t nentries=10000);
virtual void SetMaxEntryLoop(Long64_t maxev=1000000000) {fMaxEntryLoop = maxev;} // *MENU*
static void SetMaxTreeSize(Long64_t maxsize=1900000000);
virtual void SetMaxVirtualSize(Long64_t size=0) {fMaxVirtualSize = size;} // *MENU*
virtual void Show(Long64_t entry=-1, Int_t lenmax=20);
virtual Long64_t UnbinnedFit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
TTree::Streamer has been modified to real old files.
TTree::Print has been modified to take into account the new data types.
ClassDef version number incremented to 13.
TVirtualTreePlayer
==================
virtual TTree *CopyTree(const char *selection, Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
virtual Long64_t DrawScript(const char* wrapperPrefix,
const char *macrofilename, const char *cutfilename,
Option_t *option, Long64_t nentries, Long64_t firstentry) = 0;
virtual Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry) = 0;
virtual Long64_t Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,Option_t *goption
,Long64_t nentries, Long64_t firstentry) = 0;
virtual Long64_t GetSelectedRows() const = 0;
virtual TPrincipal *Principal(const char *varexp="", const char *selection="", Option_t *option="np"
,Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
virtual Long64_t Process(const char *filename,Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
virtual Long64_t Process(TSelector *selector,Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
virtual Long64_t Scan(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry) = 0;
virtual TSQLResult *Query(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry) = 0;
virtual void SetEstimate(Long64_t n) = 0;
virtual Long64_t UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
,Long64_t nentries, Long64_t firstentry) = 0;
TTreeFormula
============
TLeaf* GetLeafWithDatamember(const char* topchoice, const char* nextchice, Long64_t readentry) const;
Bool_t BranchHasMethod(TLeaf* leaf, TBranch* branch,
const char* method,const char* params,
Long64_t readentry) const;
TTreePlayer
===========
Long64_t fSelectedRows; // Number of selected entries
virtual TTree *CopyTree(const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Long64_t DrawScript(const char* wrapperPrefix,
const char *macrofilename, const char *cutfilename,
Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Long64_t Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,
Option_t *goption ,Long64_t nentries, Long64_t firstentry);
virtual Long64_t GetSelectedRows() const {return fSelectedRows;}
TPrincipal *Principal(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Long64_t Process(const char *filename,Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual Long64_t Process(TSelector *selector,Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual Long64_t Scan(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual TSQLResult *Query(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual void SetEstimate(Long64_t n);
virtual Long64_t UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
,Long64_t nentries, Long64_t firstentry);
The generated code by TTreePlayer::MakeCode, MakeClass, MakeProxy
uses Long64_t instead of Int_t
TTreeViewer
===========
Long64_t Process(const char* filename, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
void SetCurrentRecord(Long64_t entry);
THbookBranch
============
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
virtual void SetEntries(Long64_t n) {fEntries=n;}
THbookTree
==========
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
virtual void InitBranches(Long64_t entry);
virtual void SetEntries(Long64_t n);
TProofDraw
==========
virtual Bool_t Process(Long64_t /*entry*/);
TProofPlayer
============
virtual Long64_t Process(TDSet *set,
virtual Long64_t DrawSelect(TDSet *set, const char *varexp,
Long64_t Process(TDSet *set, const char *selector,
Long64_t DrawSelect(TDSet *set, const char *varexp,
Revision
9556 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 20 09:40:19 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6862 byte(s)
Diff to
previous 9432
From Philippe:
This patch implements support for TTree Friend in the new TTree Proxy
mechanism (See releases notes of ROOT 4.00/08).
For example with the result of tutorials/treefriend.C and the macro print.C:
void print() {
cout << "Entry #" << fChain->GetReadEntry()
<< " and #" << TF.GetReadEntry() << " \t"
<< x << " "; // from the main tree
if (TF.GetReadEntry()>=0) cout << TF.x; // from the friend tree
else cout << "N/A";
cout << endl;
}
You can simply create a Proxy based TSelector with
T->MakeProxy("withfriend","print.C","","nohist");
Then use the resulting file (withfriend.h) as anyother
TSelector script. For example:
T->Process("withfriend.h+","",20);
Or you can generate a simple histogram 2 files fill.C and fillCut.C
root [5] .! cat fill.C
double fill() {
return x - TF.x;
}
root [6] .! cat fillCut.C
Bool_t fillCut() {
return TF.GetReadEntry()>=0;
}
and you can just do:
T->Draw("fill.C+","fillCut.C");
Revision
9323 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 25 18:42:19 2004 UTC (10 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6648 byte(s)
Diff to
previous 8337
From Philippe:
This introduces the implementation of MakeProxy and Draw of a C++ function which
is run in a context where the name of the branches can be used as a C++ variable.
In TTree, we added a method MakeProxy and modified the behavior of TTree::Draw
(by modifying TTreePlayer::DrawSelect).
In TTreePlayer we added TTreePlayer::MakeProxy and TTreePlayer::DrawScript
TTreeProxyGenerator is a new class implementing the generation of the skeleton.
(TBranchProxyDescriptor and TBranchProxyClassDescriptor are helper class).
A priori the tree parsing done by TTreeProxyGenerator could be used to
re-implement improved an improve MakeClass/MakeSelector.
TBranchProxy is the base class of a new hierarchy of classes implementing the
indirect access to the branch of a TTree. The main features are
- protection against array out-of-bound
- on-demand loading of branches
- ability to use the 'branchname' as if it was a data member.
For example with Event.root:
Double_t somepx = fTracks.fPx[2];
somepx is updated with the current fPx of the 3rd track.
TTree::Draw as been updated so that upon seeing
tree->Draw("h1analysis.C+","")
tree->Draw("h1analysis.C+","h1analysisCut.C")
If h1analysis.C (and h1analysisCut.C in the 2nd case) are readable files,
the new MakeProxy will be used __instead of__ TTreeFormula. Currently
TTreeFormula and 'TBranchProxy' can not be used together.
In which case the means of parameters to TTree::Draw are more like:
Int_t TTree::Draw(const char *filename, const char *cutfilename,
Option_t *option="",
Int_t nentries=1000000000, Int_t firstentry=0);
Both files are expected to be source file which contains at least a free
standing function with the signature:
x_t filename();
and
y_t cutfilename();
x_t and y_t needs to be type that can convert respectively to a double
and a bool (because the code does; if(cutfilename()) htemp->Fill(filename());
The 2 free standing function are run in a context such that the branch names
are available as locally avaiable variable of the correct (read-only) type.
If 'filename' is suffixes with an ACLiC mode, the ACLiC mode is inforced
(Note that at this time, interpreted mode is not supported and if no ACLiC
mode is specified, a '+' is used by default).
The generated script file (currently generatedSel.h but subject to change in
a future release) is intentionally __not__ deleted at the end of the processing.
Also if the file already exist, it is updated if and only if the new version
is different. In particular this means issues twice in a row:
tree->Draw("Script.C+");
does __not__ result in a second (useless) compilation.
For example to draw px in hsimple.root just have a hsimple.C file:
double hsimple() {
return px;
}
and do:
new TFile("hsimple.root")
tree = ntuple
draw(tree,"hsimple.C");
or
draw(tree,"hsimple.C+");
I attached a few examples, including a full port of the h1analysis tutorials.
To use the h1analysis do:
TChain chain("h42");
chain.Add("$H1/dstarmb.root"); // 21330730 bytes 21920 events
chain.Add("$H1/dstarp1a.root"); // 71464503 bytes 73243 events
chain.Add("$H1/dstarp1b.root"); // 83827959 bytes 85597 events
chain.Add("$H1/dstarp2.root"); // 100675234 bytes 103053 events
chain.Draw("h1analysis.C+","h1analysisCut.C");
h1analysis_Terminate();
I also have an example working of all the new Event files:
new TFile("Event.new.split9.root");
TTree * tree = (TTree*)file->Get("T");
tree->Draw("script.C");
script0.C needs to be used for Event.new.split0.root.
Also you can just generate the skeleton by doing:
tree->MakeProxy("mysel",scriptfilename,cutfilename,splitLevel);
Where the non-split branches, will be made to look as if there were
split up to 'splitLevel'. (i.e mean that their data members will
be syntactically available as if they were split).
Revision
7664 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 26 21:48:27 2003 UTC (11 years, 2 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6329 byte(s)
Diff to
previous 7403
From Philippe:
This update makes any selector created by the TTreePlayer directly from a source file local to the current TTreePlayer
object (instead of being a static).
It also insures that TProofPlayer and TTreePlayer do not call delete for an object of
a class which library was unloaded (since the code is gone, this would lead to a core
dump).
Revision
7403 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 7 11:10:36 2003 UTC (11 years, 3 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6069 byte(s)
Diff to
previous 7153
Implement support for 4 dimensions in TTree::Draw.
When doing tree.Draw("x:y:z:u"), the variable "u" is mapped to a color number.
A 3-d scatter plot is generated with ncolors TPolymarker3D objects attached
to the produced histogram list of functions.
Revision
7153 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 25 17:31:42 2003 UTC (11 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6002 byte(s)
Diff to
previous 5936
From Philippe:
This patch solves 2 problems.
If a simple tree was made the friend of a chain, the simple tree was loaded using the 'entry in the tree (inside the
chain)' instead of the 'entry in the chain'. This resulted in ONLY the first part of the simple tree to be used (over
and over again)!
TTree::Scan (Query and CopyTree) could not handle the case where a TChain was made a friend of a TTree (and problably
more cases of uneven length chain friends). This was
because, it never detected that a new file was open since it only looked a the main Tree (and none of its friend). In
consequence the formula were not updated when they should.
Revision
5865 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 10 14:51:51 2003 UTC (12 years ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 5886 byte(s)
Diff to
previous 5339
Important restructuring of the TTreePlayer class in view of PROOF.
In particular TTree::DrawSelect is reduced to a few lines to use
the new TSelectorDraw class via TTreePlayer::Process.
More changes are foreseen to use the same mechanism for TTree::Scan
and TTree::Query.
Revision
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/inc/TTreePlayer.h
File length: 7903 byte(s)
Diff to
previous 4073
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
3563 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 2 21:48:08 2002 UTC (13 years ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 7862 byte(s)
Diff to
previous 2301
Delete unused function EstimateLimites.
Add support for histograms with string variables.
All combinations are supported for
1-D histograms
2-D histograms
3-D histograms
Profile histograms
2-D profile histograms.
Introduce a better version of TTreePlayer::FindGoodLimits in case
of integer or string variables.
Fix a problem in case of 1-D profile histograms. The kCanRebin bit
was not set.
Revision
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/inc/TTreePlayer.h
File length: 7263 byte(s)
Diff to
previous 988
W A R N I N G !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================
A very long list of changes in this pre-release of version 3.00.
We have modified the signature of many functions (in particular TObject)
to introduce more constness in the system.
You must change your code if your class derives from TObject and uses
one of the modified functions such as ls, Print, Compare, Hash, etc.
The modified functions in TObject have the following signature:
virtual TObject *Clone() const;
virtual Int_t Compare(const TObject *obj) const;
virtual void Delete(Option_t *option=""); // *MENU*
virtual void DrawClass() const; // *MENU*
virtual void DrawClone(Option_t *option="") const; // *MENU*
virtual void Dump() const; // *MENU*
virtual TObject *FindObject(const TObject *obj) const;
virtual char *GetObjectInfo(Int_t px, Int_t py) const;
virtual ULong_t Hash() const;
virtual void Inspect() const; // *MENU*
virtual Bool_t IsEqual(const TObject *obj) const;
virtual void ls(Option_t *option="") const;
virtual void Print(Option_t *option="") const;
A similar operation has been done with classes such as TH1, TVirtualPad,
TTree, etc.
Revision
489 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 17 09:47:00 2000 UTC (14 years, 5 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 7090 byte(s)
Diff to
previous 385
Implement interface between trees and the principal components analysis class
TPrincipal.
The user interface is in TTree::Principal that calls the TTreePlayer::Principal
function. The specs of this interface are:
TPrincipal *TTree::Principal(const char *varexp, const char *selection, Option_t *option, Int_t nentries, Int_t firstentry)
{
//*-*-*-*-*-*-*-*-*Interface to the Principal Components Analysis class*-*-*
//*-* ====================================================
//
// Create an instance of TPrincipal
// Fill it with the selected variables
// if option "n" is specified, the TPrincipal object is filled with
// normalized variables.
// If option "p" is specified, compute the principal components
// If option "p" and "d" print results of analysis
// If option "p" and "h" generate standard histograms
// If option "p" and "c" generate code of conversion functions
// return a pointer to the TPrincipal object. It is the user responsability
// to delete this object.
// The option default value is "np"
//
// see TTree::Draw for explanation of the other parameters.
//
// The created object is named "principal" and a reference to it
// is added to the list of specials Root objects.
// you can retrieve a pointer to the created object via:
// TPrincipal *principal =
// (TPrincipal*)gROOT->GetListOfSpecials()->FindObject("principal");
//
Revision
385 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 18 16:35:01 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6897 byte(s)
Diff to
previous 382
Add new function TTree::MakeAnal
Modify signature of TTree::MakeClass, TVirtualTreePlayer::MakeClass
and TTreePlayer::MakeClass adding a second optional argument Option_t *option.
TTree::MakeAnal calls TTree::MakeClass with the 2nd arg = "anal"
TTree::MakeAnal generates the skeleton code to be used by TTree::Process.
Revision
382 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 17 10:26:41 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6876 byte(s)
Diff to
previous 346
TTree.h, TChain
=======
New data member TString fProcessOption in the class TTree
This string contains the option passed to TTree::Process.
The option can be queried by TTree::GetProcessOption.
New function Int_t TTree::GetChainEntryNumber(Int_t entry)
This function returns directly entry
New function Int_t TChain::GetChainEntryNumber(Int_t entry)
This function returns the absolute entry number in the chain
corresponding to the local TTree entry number entry.
The TTree::Process functions have a new optional argument Option_t (option.
same for TChain::Process, TVirtualTreePlayer and TTreePlayer
TSelector, TSelectorCint
=========
Add new functions
virtual Bool_t ExecuteNotify();
virtual Bool_t Notify() {return kTRUE;}
ExecuteNotify calls the user class function Notify when
TTree::Process starts the first entry in a file of a chain.
TTreePlayer
===========
Implememt the logic to call the new functions TSelector::ExecuteNotify
Revision
346 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 10 06:17:57 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6836 byte(s)
Diff to
previous 337
Implement the new function TTree::Process and the corresponding function(s)
in TTreePlayer.
The main function in TTreePlayer is
TTreePlayer::Process(TSelector *selector, Int_t nentries, Int_t firstentry)
This new function exploits the new class TSelector to initialize, select,
analyze and terminate the user code referenced by the selector.
This function is now called by
TTreePlayer::Process(const char *filename, Int_t nentries, Int_t firstentry)
The code in the class derived from TSelector may be interpreted or compiled.
Revision
318 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 3 10:11:04 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 7000 byte(s)
Diff to
previous 120
The following functions have their signature changed from void to Int_t
The TTree::Draw, Fit, Process, Project and Scan functions returns the number
of selected events.
virtual Int_t Draw(TCut varexp, TCut selection, Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0);
virtual Int_t Draw(const char *varexp, const char *selection, Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
virtual Int_t Fit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option="" ,Option_t *goption=""
,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
virtual Int_t Process(const char *filename, Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
virtual Int_t Project(const char *hname, const char *varexp, const char *selection="", Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0);
virtual Int_t Scan(const char *varexp="", const char *selection="", Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
The function TTree::Process is a new function:
// The code in filename is loaded (interpreted or compiled , see below)
// filename must contain a valid class implementation derived from TTreeProcess.
// where TTreeProcess has the following member functions:
// void TTreeProcess::Begin(). This function is called before looping on the
// events in the Tree. The user can create his histograms in this function.
//
// Bool_t TTreeProcess::Select(Int_t entry). This function is called
// before processing entry. It is the user's responsability to read
// the corresponding entry in memory (may be just a partial read).
// The function returns kTRUE if the entry must be processed,
// kFALSE otherwise.
// void TTreeProcess::Analyze(Int_t entry). This function is called for
// all selected events. User fills histograms in this function.
// void TTreeProcess::Finish(). This function is called at the end of
// the loop on all events.
//
// if filename is of the form file.C, the file will be interpreted.
// if filename is of the form file.C++, the file file.C will be compiled
// and dynamically loaded. The corresponding binary file and shared library
// will be deleted at the end of the function.
// if filename is of the form file.C+, the file file.C will be compiled
// and dynamically loaded. The corresponding binary file and shared library
// will be kept at the end of the function. At next call, if file.C
// is older than file.o and file.so, the file.C is not compiled, only
// file.so is loaded.
//
// The function returns the number of processed entries. It returns -1
// in case of an error.
The correesponding modifications have been made in TChain, TVirtualTreePlayer
and TTreePlayer
Revision
120 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 13 09:18:47 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6856 byte(s)
Diff to
previous 47
- Mods in TTreePlayer to reflect the numerous changes in TGraph,
TVirtualPad, TView, TLego. Most internal variables changed from
Float_t to Double_t. In particular the members, fVmin, fVmax, fV1, fV2, fV3
are now double precision arrays. The corresponding getter functions have
their return type changed accordingly. This is a backward incompatibility.
Revision
47 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon May 29 06:19:21 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/treeplayer/inc/TTreePlayer.h
File length: 6857 byte(s)
Diff to
previous 3
// 29 May
- Add the following note in the TPave, TPaveLabel and TPaveText constructors:
IMPORTANT NOTE:
Because TPave objects (and objects deriving from TPave) have their
master coordinate system in NDC, one cannot use the TBox functions
SetX1,SetY1,SetX2,SetY2 to change the corner coordinates. One should use
instead SetX1NDC, SetY1NDC, SetX2NDC, SetY2NDC.
28 May
- Modify THistPainter::PaintStat and PaintStat2 to use the TLatex character #pm
instead of +-
// 27 May
- Add new member functions:
Int_t TVirtualTreePlayer::GetDimension()
Int_t TTreePlayer::GetDimension()
GetDimension returns the number of dimensions in the TTree::Draw expression.
- Add new function in TTree;
void TTree::UnbinnedFit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0);
This function (origin Stephen Bailey) performs an unbinned fit to the
variable(s) given in varexp.
- Remove unused data member fDimension from class TTree.
- Introduce support for "Virtuality" in TLeafObject.
New data member fVirtual added and corresponding IsVirtual/SetVirtual functions.
By default, fVirtual is kTRUE.
This change allows new interesting possibilities in split mode. For example
if a member is TShape *fShape, a real object may be now of any type
derived from TShape (eg, TTUBE, TBRIK, etc).
With the previous version, the fShape object had to be of the declared
type TShape only.
When writing a TLeafObject, the class name of the object is now written in
the branch buffer by TLeafObject::FillBasket. When TLeafObject::ReadBasket
is called, an instance of the real class is built and its Streamer function
called.
This change is backward compatible. Old files can still be processed.
It is possible to set the virtuality for the branch to kFALSE via
TLeafObject::SetVirtual. Setting the virtuality to kFALSE makes
writing and reading faster and the file slightly smaller. In this case,
a TLeafObject must be of the type declared only.
- New minor changes in TGaxis (Damir Buskulic) for date/time format
in case the start time is not an integer value.
- Modify tutorial psexam.C to set the TPaveText TextFont to 61 instead of 62.
Font precision 1 bypass the TLatex logic.
- Mods in TLatex to remove the special treatment for characters ' and ".
Strings like l'#acute{e}toile are now correctly processed.
- Fix a bug in TGraph::GetFunction. (thanks Damon Spayde). The test
if (fFunctions) return 0; replaced by
if (!fFunctions) return 0;
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.