2 printf(
"This demo show how to handle TTreeViewer sessions\n");
3 printf(
"Compile class Event from test directory before running this\n");
4 printf(
"- use arrow buttons from bottom to cycle records ...\n");
5 printf(
"- make new expressions and drag them to X, Y, Z or Cut items ...\n");
6 printf(
"- use the Draw button to check your current selection ...\n");
7 printf(
"- click the record button once you are happy with this ...\n");
8 printf(
"- open the TV context menu (right-click on the right panel)...\n");
9 printf(
" Use : RemoveLastRecord() - to remove last record :-)\n");
10 printf(
" SetRecordName() - to name current record\n");
11 printf(
" UpdateRecord() - if you want to change a record from the list\n");
12 printf(
" with your new X, Y, Z, Cut configuration.\n");
13 printf(
" Best luck !\n");
27 TFile *tv_file = (
TFile*)
gROOT->GetListOfFiles()->FindObject(
"Event.root");
29 if (!tv_file) tv_file =
new TFile(
"$ROOTSYS/test/Event.root");
30 if (tv_file) tv_tree = (
TTree*)tv_file->
Get(
"T");
32 printf(
"Tree %s not found", fTree->GetName());
58 item->
SetExpression(
"sqrt(fTracks.fPx*fTracks.fPx+fTracks.fPy*fTracks.fPy)",
"~Pt",
kFALSE);
81 tv_record = tv_session->AddRecord(
kTRUE);
82 tv_session->SetRecordName(
"Temperature");
83 tv_record->fX =
"fTemperature";
87 tv_record->fXAlias =
"fTemperature";
88 tv_record->fYAlias =
"-empty-";
89 tv_record->fZAlias =
"-empty-";
90 tv_record->fCutAlias =
"-empty-";
91 tv_record->fOption =
"lego1";
92 tv_record->fScanRedirected =
kFALSE;
93 tv_record->fCutEnabled =
kTRUE;
95 tv_record = tv_session->AddRecord(
kTRUE);
96 tv_session->SetRecordName(
"Py versus Px");
97 tv_record->fX =
"fTracks.fPx";
98 tv_record->fY =
"fTracks.fPy";
100 tv_record->fCut =
"";
101 tv_record->fXAlias =
"fTracks.fPx";
102 tv_record->fYAlias =
"fTracks.fPy";
103 tv_record->fZAlias =
"-empty-";
104 tv_record->fCutAlias =
"-empty-";
105 tv_record->fOption =
"lego";
106 tv_record->fScanRedirected =
kFALSE;
107 tv_record->fCutEnabled =
kTRUE;
109 tv_record = tv_session->AddRecord(
kTRUE);
110 tv_session->SetRecordName(
"Transverse momentum");
111 tv_record->fX =
"sqrt(fTracks.fPx*fTracks.fPx+fTracks.fPy*fTracks.fPy)";
114 tv_record->fCut =
"fTracks.fPx>0";
115 tv_record->fXAlias =
"~Pt";
116 tv_record->fYAlias =
"-empty-";
117 tv_record->fZAlias =
"-empty-";
118 tv_record->fCutAlias =
"~Cut1";
119 tv_record->fOption =
"";
120 tv_record->fScanRedirected =
kFALSE;
121 tv_record->fCutEnabled =
kTRUE;
123 tv_record = tv_session->AddRecord(
kTRUE);
124 tv_session->SetRecordName(
"Surface plot of Py vs. Px");
125 tv_record->fX =
"fTracks.fPx";
126 tv_record->fY =
"fTracks.fPy";
128 tv_record->fCut =
"";
129 tv_record->fXAlias =
"fTracks.fPx";
130 tv_record->fYAlias =
"fTracks.fPy";
131 tv_record->fZAlias =
"-empty-";
132 tv_record->fCutAlias =
"-empty-";
133 tv_record->fOption =
"SURF";
134 tv_record->fScanRedirected =
kFALSE;
135 tv_record->fCutEnabled =
kTRUE;
137 tv_session->Show(tv_session->First());
void SetNexpressions(Int_t expr)
Change the number of expression widgets.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
void SetTreeName(const char *treeName)
Allow geting the tree from the context menu.
A graphic user interface designed to handle ROOT trees and to take advantage of TTree class features...
void SetExpression(const char *name, const char *alias, Bool_t cutType=kFALSE)
Set the true name, alias and type of the expression, then refresh it.
R__EXTERN TSystem * gSystem
TTVLVEntry * ExpressionItem(Int_t index)
Get the item from a specific position.
This class represent entries that goes into the TreeViewer listview container.
void SetSession(TTVSession *session)
Set current session.
I/O classes for TreeViewer session handling.
A TTree object has a header with a name and a title.