4 #include "KVTreeAnalyzer.h"
19 #include "KVFileDialog.h"
20 #include "KVDalitzPlot.h"
23 #include <KVHistogram.h>
27 #include "KVNameValueListGUI.h"
40 #define MAX_COLOR_INDEX 5
41 Int_t my_color_array[] = {
64 fgAnalyzerList->Add(
this);
65 fDeletedByGUIClose =
kFALSE;
70 fMain_selectionlist = 0;
72 SetAnalysisModifiedSinceLastSave(
kFALSE);
73 fAnalysisSaveDir =
".";
74 fPROOFEnabled =
false;
76 fDrawSame = fApplySelection = fProfileHisto =
kFALSE;
86 fSelectedSelections = 0;
91 fXmin = fXmax = fYmin = fYmax = -1.;
92 fWeight =
"1./(abs(vper))";
95 fXminF = fXmaxF = -1.;
98 fOrderedDalitz =
false;
109 :
TNamed(
"KVTreeAnalyzer",
"KVTreeAnalyzer"), fTree(0), fChain(0), fSelections(
kTRUE), fHistoNumber(1), fSelectionNumber(1), fAliasNumber(1), fNoGui(nogui)
128 :
TNamed(
"KVTreeAnalyzer", t->GetTitle()), fTree(0), fChain(0), fSelections(
kTRUE), fHistoNumber(1), fSelectionNumber(1), fAliasNumber(1), fNoGui(nogui)
152 if (gTreeAnalyzer ==
this) gTreeAnalyzer = 0x0;
234 if (strcmp(weight,
"")) {
235 if (_selection !=
"" && _elist !=
"")
236 title.
Form(
"%s [%s] {(%s) && (%s)}", expr, weight, _elist.
Data(), selection);
237 else if (_selection !=
"")
238 title.
Form(
"%s [%s] {%s}", expr, weight, selection);
239 else if (_elist !=
"")
240 title.
Form(
"%s [%s] {%s}", expr, weight, _elist.
Data());
242 title.
Form(
"%s [%s]", expr, weight);
245 if (_selection !=
"" && _elist !=
"")
246 title.
Form(
"%s {(%s) && (%s)}", expr, _elist.
Data(), selection);
247 else if (_selection !=
"")
248 title.
Form(
"%s {%s}", expr, selection);
249 else if (_elist !=
"")
250 title.
Form(
"%s {%s}", expr, _elist.
Data());
252 title.
Form(
"%s", expr);
295 TString drawexp(expr), histo, histotitle;
303 if (strcmp(weight,
"")) {
304 if (strcmp(selection,
"")) Selection.
Form(
"(%s)&&(%s)", selection, weight);
305 else Selection = weight;
308 Selection = selection;
309 if (nY) histo.
Form(
">>%s(%d,%f,%f,%d,%f,%f)",
name.Data(), nX,
xmin,
xmax, nY,
ymin,
ymax);
315 else drawResult =
fTree->
Draw(drawexp, Selection,
"goff");
316 if (drawResult < 0) {
362 TString drawexp(expr), histo, histotitle;
374 if (strcmp(weight,
"")) {
375 if (strcmp(selection,
"")) Selection.
Form(
"(%s)&&(%s)", selection, weight);
376 else Selection = weight;
379 Selection = selection;
381 if (drawResult < 0) {
416 if (
h->IsType(
"Histo"))
return h->GetHisto();
468 if (
fChain->
Draw(drawexp, selection,
"entrylist") < 0) {
482 title.
Form(
"(%s) && (%s)", _elist.
Data(), selection);
533 if (tmp !=
"") cout <<
"CURRENT SELECTION : " << tmp << endl;
578 while ((o = next())) {
617 cout <<
"Analysis " <<
GetTitle() <<
" has been modified. Save before continuing? [y] : " << flush;
621 if (reply ==
'n' || reply ==
'N')
return;
632 "Analysis has been modified. Save before continuing?",
kMBIconStop,
634 if (ret_code ==
kMBNo)
return;
698 ULong_t red, cyan, green, yellow, magenta, gura, gurb, gurc, gurd, gure, gurf;
699 gClient->GetColorByName(
"#ff00ff", magenta);
700 gClient->GetColorByName(
"#ff0000", red);
701 gClient->GetColorByName(
"#00ff00", green);
702 gClient->GetColorByName(
"#00ffff", cyan);
703 gClient->GetColorByName(
"#ffff00", yellow);
704 gClient->GetColorByName(
"#cf14b2", gura);
705 gClient->GetColorByName(
"#cd93e6", gurb);
706 gClient->GetColorByName(
"#c1e91a", gurc);
707 gClient->GetColorByName(
"#d1a45b", gurd);
708 gClient->GetColorByName(
"#b54cfe", gure);
709 gClient->GetColorByName(
"#a325ef", gurf);
724 UInt_t hWidth = 400, hHeight = 400;
740 fMenuFile->
Connect(
"Activated(Int_t)",
"KVTreeAnalyzer",
this,
"HandleHistoFileMenu(Int_t)");
757 fOptionMenu->
Connect(
"Activated(Int_t)",
"KVTreeAnalyzer",
this,
"HandleOptionsMenu(Int_t)");
773 UInt_t lWidth = 300, lHeight = 300;
794 G_leaflist->
Connect(
"SelectionChanged()",
"KVTreeAnalyzer",
this,
"LeafChanged()");
810 UInt_t sWidth = 600, sHeight = lHeight;
818 lab =
new TGLabel(fHorizontalFrame1614,
"Make selection : ");
868 G_histo_prof->
Connect(
"Toggled(Bool_t)",
"KVTreeAnalyzer",
this,
"SetProfileHisto(Bool_t)");
891 G_histo_bin->
Connect(
"Toggled(Bool_t)",
"KVTreeAnalyzer",
this,
"SetUserBinning(Bool_t)");
896 hWidth = lWidth + sWidth + 20;
1001 G_histolist->
Connect(
"SelectionChanged()",
"KVTreeAnalyzer",
this,
"HistoSelectionChanged()");
1054 while (draw_options[dop] !=
" ") {
1078 G_histo_log->
Connect(
"Toggled(Bool_t)",
"KVTreeAnalyzer",
this,
"SetDrawLog(Bool_t)");
1097 hHeight = hHeight + lHeight + 50;
1187 p.FindCommonTitleCharacters(((
TChain*)t)->GetListOfFiles(),
'X');
1237 if (!
f ||
f->IsZombie()) {
1308 gTreeAnalyzer =
this;
1329 TIter next(&padList);
1331 while ((o = next())) {
1394 histo->
Draw(
"same");
1395 TObject* legend =
gPad->GetListOfPrimitives()->FindObject(
"TPave");
1397 gPad->GetListOfPrimitives()->Remove(legend);
1411 while ((
h = nxt())) {
1429 c->SetWindowSize(700, 700);
1507 cut =
dynamic_cast<TCutG*
>(obj);
1510 histo =
dynamic_cast<TH1*
>(obj);
1522 if (
gPad &&
gPad->GetListOfPrimitives()->FindObject(histo) && (gen)) {
1523 TIter next(
gPad->GetListOfPrimitives());
1525 while ((o = next())) {
1543 if (weight ==
"1") weight =
"";
1572 return (test_sel == tree_sel);
1592 if (kvhisto) histo = kvhisto->
GetHisto();
1593 if (histo && (histo->
IsA() ==
h->
IsA()))
return histo;
1639 if (selection.
IsNull())
return;
1680 for (
int i = 1; i < nsel; i++) {
1684 if (i > 1) newselect +=
" && ";
1685 newselect += tmp.
Data();
1710 for (
int i = 0; i < nsel; i++) {
1714 if (i > 0) newselect +=
" || ";
1715 newselect += tmp.
Data();
1733 if (nsel < 1)
return;
1734 for (
int i = 0; i < nsel; i++) {
1830 else if (nleaf == 2) {
1840 else if (nleaf == 3) {
1884 if (cancel)
return false;
1885 fNx =
p.GetIntValue(
"Xbins");
1886 fXmin =
p.GetDoubleValue(
"Xmin");
1887 fXmax =
p.GetDoubleValue(
"Xmax");
1888 fNy =
p.GetIntValue(
"Ybins");
1889 fYmin =
p.GetDoubleValue(
"Ymin");
1890 fYmax =
p.GetDoubleValue(
"Ymax");
1904 if (cancel)
return false;
1905 fNxF =
p.GetIntValue(
"bins");
1906 fXminF =
p.GetDoubleValue(
"min");
1907 fXmaxF =
p.GetDoubleValue(
"max");
1921 if (cancel)
return false;
1922 fNxD =
p.GetIntValue(
"Xbins");
1923 fNyD =
p.GetIntValue(
"Ybins");
1946 if (!leaf)
return 0;
1952 if (entryNumber < 0)
break;
1953 branch->GetEntry(entryNumber);
1954 for (
Int_t j = 0; j < leaf->GetLen(); ++j) {
1982 if (!leaf)
return 0;
1988 if (entryNumber < 0)
break;
1989 branch->GetEntry(entryNumber);
1990 for (
Int_t j = 0; j < leaf->GetLen(); ++j) {
2036 int nx = 500, ny = 500;
2063 TIter nxtSame(same_histo.get());
2103 if (!
fProfileHisto) histo.
Form(
">>%s(%d,%f,%f,%d,%f,%f)",
name.Data(), nx,
xmin,
xmax, ny,
ymin,
ymax);
2106 else histo.
Form(
">>%s",
name.Data());
2113 else drawResult =
fTree->
Draw(drawexp, ww.
Data(),
"prof,goff");
2114 if (drawResult < 0) {
2146 Warning(
"DrawAsDalitz",
"Cannot be used with aliases !");
2168 Int_t vari1, vari2, vari3;
2170 Char_t varc1, varc2, varc3;
2178 else if (xType.
Contains(
"Short_t")) {
2183 else if (xType.
Contains(
"Char_t")) {
2188 else if (xType.
Contains(
"Double_t")) {
2193 else if (xType.
Contains(
"Float_t")) {
2216 for (
int i = 0; i <
nentries; i++) {
2218 if (el) j = el->
Next();
2225 else if (xType.
Contains(
"Short_t")) {
2230 else if (xType.
Contains(
"Char_t")) {
2235 else if (xType.
Contains(
"Double_t")) {
2240 else if (xType.
Contains(
"Float_t")) {
2245 h->FillAsDalitz(
x,
y, z);
2270 Bool_t cancel_pressed{
false};
2274 if (cancel_pressed)
return false;
2275 fWeight = params.GetStringValue(
"Weight");
2292 TH1* histo =
nullptr;
2302 if (kvhisto) histo = kvhisto->
GetHisto();
2304 if (
type.Contains(
"Int_t") ||
type.Contains(
"Char_t") ||
type.Contains(
"Short_t") ||
type ==
"Long_t" ||
type ==
"Long64_t") {
2307 if (
type.Contains(
"Char_t")) {
2331 if (kvhisto) histo = kvhisto->
GetHisto();
2617 if (
h->IsType(
"Histo") && !strcmp(
h->GetExpression(), expr)) hlist->
Add(
h->GetHisto());
2638 if (
h->IsType(
"Histo") && !strcmp(
h->GetSelection(), expr)) hlist->
Add(
h->GetHisto());
2654 if (
h->IsType(
"Histo") && !strcmp(
h->GetExpression(), expr) && !strcmp(
h->GetSelection(), selection)) {
2655 if (strcmp(weight,
"")) {
2656 if (!strcmp(
h->GetWeight(), weight))
return h->GetHisto();
2658 else return h->GetHisto();
2684 if (
h->IsType(
"Histo") && !strcmp(
h->GetExpression(), expr) && !strcmp(
h->GetSelection(), selection) && !strcmp(
h->GetWeight(), weight)) {
2703 if (nsel < 1)
return;
2704 for (
int i = 0; i < nsel; i++) {
2740 Info(
"AddSelectedHistos",
"Call to context menu not OK");
2745 Info(
"AddSelectedHistos",
"You pressed cancel");
2753 Info(
"AddSelectedHistos",
"Only possible for 2 histograms");
2787 TIter next(&old_lists);
2792 cout <<
"REGENERATING SELECTION : " << old_el->
GetTitle() << endl;
2837 while (
tan ==
this);
2838 tan->AnalysisSaveCheck();
2842 gROOT->ProcessLine(
".q");
2910 const char* filetypes[] = {
2911 "Analysis files",
"Analysis*.root",
2933 const char* filetypes[] = {
2934 "ROOT files",
"*.root",
2956 const char* filetypes[] = {
2957 "ROOT files",
"*.root*",
2968 TString theTreeName, theTreeTitle;
2974 if (trees->GetEntries()) {
2975 theTreeName = trees->
First()->GetName();
2976 theTreeTitle = trees->
First()->GetTitle();
2978 if (theTreeName !=
"") {
2999 const char* filetypes[] = {
3000 "ROOT files",
"*.root",
3019 const char* filetypes[] = {
3020 "Analysis files",
"Analysis*.root",
3048 while ((akey = (
TKey*)next())) {
3065 void KVTreeAnalyzer::OpenSingleFile(
TFile*
file)
3074 if (trees->GetEntries()) {
3076 TString aTreeName = trees->First()->GetName();
3081 OpenChain(aTreeName, trees->First()->GetTitle(), &fileList);
3100 TObject* kvta =
file->GetListOfKeys()->FindObject(
"KVTreeAnalyzer");
3105 OpenSingleFile(
file);
3158 while ((o = next())) {
3160 Info(
"GenerateAllAliases",
"Adding alias %s to leaflist", o->
GetTitle());
3190 TObject* kvta =
file->GetListOfKeys()->FindObject(
"KVTreeAnalyzer");
3220 exp.ReplaceAll(
"d2r",
"TMath::DegToRad()");
3221 exp.ReplaceAll(
"r2d",
"TMath::RadToDeg()");
3230 static const char* gSaveAsTypes[] = {
"PostScript",
"*.ps",
3231 "Encapsulated PostScript",
"*.eps",
3236 "ROOT files",
"*.root",
3259 Info(
"SetUpHistoAutoSave",
"Select image filetype and directory");
3262 static Int_t typeidx = 0;
3291 static TString lastFilename =
"";
3294 gPad->SaveAs(lastFilename);
3307 Info(
"AutoSaveHisto",
"Saved as: %s", title.
Data());
3308 gPad->SaveAs(title);
3309 lastFilename = title;
3323 TIter nextSel(list);
3325 while ((
sel = nextSel())) {
3327 Info(
"GenerateAllSelections",
"Generating selection: %s",
sel->GetTitle());
3344 TIter nextHist(list);
3348 if (!obj->
IsType(
"Cut")) {
3354 if (weight ==
"1") weight =
"";
3356 Info(
"GenerateAllHistograms",
"Generating histogram: %s", hist->
GetTitle());
3391 Info(
"Streamer",
"Checking friends");
3400 Info(
"Streamer",
"Found friend to convert to TChain");
3404 Info(
"Streamer",
"Choose file containg friend tree %s", fe->
GetTreeName());
3406 const char* filetypes[] = {
3407 "ROOT files",
"*.root",
3425 Info(
"Streamer",
"Removing TTree friends");
3427 while (!toRemove.
End()) {
3431 Info(
"Streamer",
"Adding friends as TChains");
3432 while (!toRemove.
End()) {
3433 idx = toRemove.
Next();
3454 while ((obj = (
TNamed*)next())) {
3469 if (
h->IsType(
"Histo"))
h->ParseExpressionAndSelection();
3496 if (trees->GetEntries()) {
3506 while ((akey = (
TKey*)next())) {
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TProof * gProof
char * Form(const char *fmt,...)
char * StrDup(const char *str)
void AssignAndDelete(TString &target, char *tobedeleted)
R__EXTERN TSystem * gSystem
virtual Bool_t IsType(const Char_t *typ) const
static void InitEnvironment()
static Bool_t OpenContextMenu(const char *method, TObject *obj, const char *alt_method_name="")
TCanvas with mouse-controlled dynamic zoom and pan & scan.
Fill 3D observables in a dalitz plot ,.
Modified version of TGFileDialog file selection dialog.
Wrapper for histograms and graphical cuts used by KVTreeAnalyzer.
static void ParseHistoTitle(const Char_t *title, KVString &exp, KVString &sel, KVString &weight)
const Char_t * GetExpression() const
const Char_t * GetSelection() const
const Char_t * GetWeight() const
Return weighting used for filling histogram.
virtual void SetIsBoolean(Bool_t isit=kTRUE)
Extension of TGLVContainer for KVListView widget.
Enhanced version of ROOT TGListView widget.
virtual void ActivateSortButtons()
virtual void SetDataColumns(Int_t ncolumns)
void SetDoubleClickAction(const char *receiver_class, void *receiver, const char *slot)
virtual KVLVColumnData * GetDataColumn(Int_t index) const
virtual void Display(const TCollection *l)
virtual void SetMaxColumnSize(UInt_t width)
KVList * GetPickOrderedSelectedObjects() const
TList * GetSelectedObjects() const
void AllowContextMenu(Bool_t on=kTRUE)
virtual void SetDataColumn(Int_t index, const Char_t *name, const Char_t *method="", Int_t mode=kTextCenterX)
void SetUseObjLabelAsRealClass(Bool_t yes=kTRUE)
Extended TList class which owns its objects by default.
GUI for setting KVNameValueList parameters.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
const Char_t * GetStringValue(const Char_t *name) const
Strings used to represent a set of ranges of values.
void Add(Int_t)
Add value 'n' to the list.
KaliVeda extensions to ROOT collection classes.
virtual void Copy(TObject &obj) const
KVSeqCollection * GetSubListWithMethod(const Char_t *retvalue, const Char_t *method) const
virtual TObject * Last() const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual void Clear(Option_t *option="")
virtual Int_t GetSize() const
virtual TObject * At(Int_t idx) const
virtual TObject * First() const
virtual TObject * FindObjectWithMethod(const Char_t *retvalue, const Char_t *method) const
virtual TObject * FindObjectByTitle(const Char_t *) const
Will return object with given title (value of TObject::GetTitle() method).
virtual void Add(TObject *obj)
virtual TObject * FindObjectWithNameAndType(const Char_t *name, const Char_t *type) const
virtual TObject * Remove(TObject *obj)
Remove object from list.
virtual TObject * FindObject(const char *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
GUI for simple intuitive analysis of data in TTree ,.
void DeleteHisto(const Char_t *expr, const Char_t *selection, const Char_t *weight)
Int_t fSelectionNumber
used for automatic naming of selections
Bool_t IsPROOFEnabledForSelections() const
Bool_t fNoGui
=kTRUE if no graphical interface is required
static KVTreeAnalyzer * OpenFile(const Char_t *filename, Bool_t nogui=kFALSE)
TList * GetHistosByData(const Char_t *expr)
KVHistogram * GetHistoByTitle(const Char_t *title)
TChain * fChain
the analyzed TTree or TChain
bool DefineUserBinningD()
Bool_t fNormHisto
=kTRUE: generate normalised histograms (normalise to integral of histo)
TGCheckButton * G_histo_norm
void SaveAs(const char *filename="", Option_t *option="") const
Bool_t IsPROOFEnabled() const
void SetTreeFileName(TTree *t)
Int_t fHistoNumber
used for automatic naming of histograms
void SetTree(TTree *t)
Connects a TChain for analysis.
TGGroupFrame * fMain_leaflist
GUI for access to TTree leaves and aliases.
void DeleteSelections()
Delete the currently selected selection(s)
void ReconnectTree()
Backwards compatibility: to read old analysis files.
const TGMainFrame * GetMainWindow() const
void OpenAnyFile(const Char_t *filepath)
KVListView * G_histolist
GUI list of histograms.
void HistoFileMenu_Save()
Bool_t MakeSelection(const Char_t *selection)
void ReapplyAnyFile(const Char_t *filepath)
void SetAnalysisModifiedSinceLastSave(Bool_t)
TString fAutoSaveDir
directory for autosaving histos
Bool_t fStatsHisto
=kTRUE: display histo stats box
TGCheckButton * G_histo_app_sel
const Char_t * get_leaf_type_name(const TNamed *l)
Bool_t fApplySelection
=kTRUE: apply current selection to existing histogram
TString fTreeName
name of analyzed TTree
Bool_t fDrawSame
=kTRUE: draw histograms in same plot
void SetUpHistoAutoSave()
void GenerateAllAliases(TCollection *list)
Generate all user aliases in list which are not already defined.
Int_t fAliasNumber
used for automatic naming of TTree aliases
TH1 * RemakeHisto(TH1 *h, const Char_t *expr, const Char_t *weight="")
TH1 * MakeHisto(const Char_t *expr, const Char_t *selection, Int_t nX, Int_t nY=0, const Char_t *weight="", Double_t xmin=-1, Double_t xmax=-1, Double_t ymin=-1, Double_t ymax=-1)
void SetAlias(const Char_t *name, const Char_t *expr)
Bool_t fDeletedByGUIClose
double GetTreeMinimum(const TString &leafname)
static KVList * fgAnalyzerList
static list of all analyzers in memory
void HistoFileMenu_Apply()
TString fTreeFileName
name of file containing analyzed TTree
void DeleteSelectedHisto()
Delete all currently selected histograms.
void GUIClosed()
Called when graphical window is closed.
TEntryList * GetSelection(const Char_t *)
Look for selection in list of selections.
Bool_t IsCurrentSelection(const Char_t *sel)
void AutoSaveHisto(TH1 *h)
TGTextEntry * G_alias_text
TGPopupMenu * fSelCombMenu
Bool_t fNewCanvas
=kTRUE: draw each histogram in a new canvas
void init()
Default initialization.
TString fRelativePathToAnalysisFile
TGCheckButton * G_histo_log
TGComboBox * G_histo_draw_option
KVUniqueNameList fSelections
list of TEntryList user selections
void GenerateAllHistograms(TCollection *)
Bool_t fNormHistoEvents
=kTRUE: generate normalised histograms (normalise to number of events)
void SetSelection(TObject *)
void CurrentSelection()
Print the currently active selection (TEntryList set on TTree).
KVList fLeafList
clones of leaves in TChain
TGCheckButton * G_histo_weight
void UpdateEntryLists()
regenerate entry lists for all selections
TGCheckButton * G_histo_prof
void SetEntryList(TEntryList *)
void HistoAddition(Double_t c1=1, Double_t c2=1)
void OpenGUI()
Launch the GUI (unless fNoGui=kTRUE in which case this does nothing)
void HistoFileMenu_OpenFriend()
TGPictureButton * G_histo_add
void SetRelativePathToAnalysisFile(const Char_t *p)
TGPictureButton * G_histo_del
void CombineSelectionsAnd()
TGCheckButton * G_histo_stats
KVTreeAnalyzer(Bool_t nogui=kTRUE)
TGCheckButton * G_histo_new_can
void HandleHistoFileMenu(Int_t)
TGCheckButton * G_histo_bin
void HandleOptionsMenu(Int_t opt)
TGGroupFrame * fMain_selectionlist
GUI for handling selections.
void GetHistosFromFile(TFile *file, const KVUnownedList &keys)
TString fSaveAnalysisFileName
TGPopupMenu * fMenuSelections
void CombineSelectionsOr()
TGPictureButton * G_leaf_draw
Bool_t fAutoSaveHisto
=kTRUE: on draw, generate image file of current displayed histo
bool DefineUserBinning1F()
void HandleSelectionsMenu(Int_t)
void DrawHistogram(TH1 *histo, Bool_t same=false, Bool_t logscale=false)
void EnablePROOF(Bool_t yes=kTRUE)
KVList fHistolist
list of generated histograms
TList * GetHistosBySelection(const Char_t *expr)
void OpenAnyFriendFile(const Char_t *filepath)
TTree * fTree
for backwards compatibility
TGCheckButton * G_histo_norm_events
void GenerateAllSelections(TCollection *)
For applying existing analysis to new data.
TGPopupMenu * fSelGenerate
TString fAutoSaveType
filetype for autosaving histos
TH1 * GetHistogram(const Char_t *name) const
Return histogram with given name.
TGPopupMenu * fOptionMenu
Long64_t GetEntriesInCurrentSelection() const
KVListView * G_selectionlist
GUI list of TEntryList selections.
double GetTreeMaximum(const TString &leafname)
TGStatusBar * G_selection_status
status bar in selections GUI
void AddSelection(TEntryList *)
TGLayoutHints * fMenuBarItemLayout
TGCheckButton * G_histo_same
TH1 * MakeIntHisto(const Char_t *expr, const Char_t *selection, Int_t Xmin, Int_t Xmax, const Char_t *weight="")
virtual ~KVTreeAnalyzer()
Destructor.
void OpenChain()
Open a file or files containing TTrees to analyse.
void SelectionChanged()
Method called whenever the selected selection in the GUI list changes.
TGMainFrame * fMain_histolist
GUI for handling histograms.
TH1 * GetHisto(const Char_t *expr, const Char_t *selection, const Char_t *weight="")
Bool_t fAnalysisModifiedSinceLastSave
TNamed * GetAlias(const Char_t *expr)
void HistoSelectionChanged()
Method called when user histo selection changes in GUI histogram list.
void GenerateHistoTitle(TString &title, const Char_t *exp, const Char_t *sel, const Char_t *weight="")
void ReadFromFile(const Char_t *filename)
open a previously saved analysis session.
Bool_t fDrawLog
=kTRUE: draw histograms with log-Y (1-D) or log-Z (2-D) scale
void HistoFileMenu_Open()
Open a previous analysis session.
void DrawLeaf(TObject *)
Method called when user double-clicks a leaf/alias in list.
KVList fAliasList
list of TTree aliases
TList * fSelectedSelections
void Copy(TObject &obj) const
void DrawHisto(TObject *o, Bool_t gen=kTRUE)
TGCheckButton * G_histo_autosave
TGTextEntry * G_selection_text
KVListView * G_leaflist
GUI list of TTree leaves and aliases.
Bool_t fMethodCalled
allows to know if context menu methods are called
virtual void Add(TObject *obj)
Extended TList class which does not own its objects by default.
virtual void SetLineWidth(Width_t lwidth)
virtual void SetLineColor(Color_t lcolor)
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void SetEntryList(TEntryList *elist, Option_t *opt="") override
TFriendElement * AddFriend(const char *chainname, const char *dummy="") override
TObjArray * GetListOfLeaves() override
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
void RemoveFriend(TTree *) override
void SetDirectory(TDirectory *dir) override
Long64_t Draw(const char *varexp, const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
virtual void SetProof(Bool_t on=kTRUE, Bool_t refresh=kFALSE, Bool_t gettreeheader=kFALSE)
Long64_t GetEntries() const override
static TClass * GetClass(Bool_t load=kTRUE, Bool_t silent=kFALSE)
Bool_t InheritsFrom(const char *cl) const override
void ls(Option_t *option="") const override
virtual void AddAll(const TCollection *col)
virtual Int_t GetEntries() const
TObject * Clone(const char *newname="") const override
const char * GetVarX() const
const char * GetVarY() const
virtual Bool_t GetReapplyCut() const
virtual Long64_t GetEntry(Long64_t index)
virtual Long64_t GetN() const
virtual const char * GetValue(const char *name, const char *dflt) const
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
virtual const char * GetTreeName() const
virtual TTree * GetTree()
virtual TFile * GetFile()
TGFrame * GetContainer() const
virtual void AddEntry(const char *s, Int_t id)
TGDimension GetDefaultSize() const override
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
void MapSubwindows() override
void SetCleanup(Int_t mode=kLocalCleanup) override
void SetMultipleSelection(Bool_t option)
virtual UInt_t GetDefaultHeight() const
virtual void Resize(TGDimension size)
TGDimension GetSize() const
void MapWindow() override
TGDimension GetDefaultSize() const override
void SetText(const char *newText)
const char * GetTitle() const override
void SetIconPixmap(char **xpm_array)
void SetIconName(const char *name)
void SetWindowName(const char *name=nullptr) override
virtual void SetText(const char *text, Int_t partidx=0)
virtual void SetMaxLength(Int_t maxlen)
void Clear(Option_t *option="") override
const char * GetText() const
virtual void SetCursorPosition(Int_t pos)
virtual void SetAlignment(ETextJustification mode=kTextLeft)
virtual void SetText(const char *text, Bool_t emit=kTRUE)
virtual void SetName(const char *name)
virtual void RaiseWindow()
void Draw(Option_t *chopt="") override
void SetTitle(const char *title="") override
virtual void SetDirectory(TDirectory *dir)
virtual Bool_t Add(const TH1 *h, const TH1 *h2, Double_t c1=1, Double_t c2=1)
void SetTitle(const char *title) override
virtual Int_t GetNbinsY() const
Option_t * GetOption() const override
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
virtual Int_t GetNbinsX() const
virtual void SetMaximum(Double_t maximum=-1111)
void Draw(Option_t *option="") override
virtual Double_t Integral(Int_t binx1, Int_t binx2, Option_t *option="") const
TClass * IsA() const override
virtual void SetOption(Option_t *option=" ")
virtual void Scale(Double_t c1=1, Option_t *option="")
TObject * Clone(const char *newname="") const override
virtual void Sumw2(Bool_t flag=kTRUE)
virtual void SetStats(Bool_t stats=kTRUE)
virtual const char * GetClassName() const
virtual const char * GetTypeName() const
TBranch * GetBranch() const
TObject * FindObject(const char *name) const override
void Add(TObject *obj) override
TObject * First() const override
void Delete(Option_t *option="") override
TObject * At(Int_t idx) const override
void Copy(TObject &named) const override
virtual void SetTitle(const char *title="")
const char * GetName() const override
void Streamer(TBuffer &) override
const char * GetTitle() const override
TObject * FindObject(const char *name) const override
virtual const char * GetName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual const char * GetTitle() const
virtual TClass * IsA() const
virtual void Info(const char *method, const char *msgfmt,...) const
static TProof * Open(const char *url=0, const char *conffile=0, const char *confdir=0, Int_t loglevel=0)
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
TString & Insert(Ssiz_t pos, const char *s)
Ssiz_t First(char c) const
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Append(char c, Ssiz_t rep=1)
TString & Prepend(char c, Ssiz_t rep=1)
virtual Int_t Sizeof() const
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
virtual const char * DirName(const char *pathname)
virtual char * ConcatFileName(const char *dir, const char *name)
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
virtual Bool_t ChangeDirectory(const char *path)
virtual const char * BaseName(const char *pathname)
virtual Bool_t IsAbsoluteFileName(const char *dir)
virtual const char * WorkingDirectory()
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual TObjArray * GetListOfLeaves()
TFile * GetCurrentFile() const
virtual TList * GetListOfAliases() const
virtual TTree * GetFriend(const char *) const
virtual Double_t GetMaximum(const char *columname)
TDirectory * GetDirectory() const
virtual TEntryList * GetEntryList()
virtual Long64_t GetEntries() const
virtual Long64_t Draw(const char *varexp, const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
virtual Long64_t GetEntryNumber(Long64_t entry) const
virtual TLeaf * GetLeaf(const char *branchname, const char *leafname)
virtual Double_t GetMinimum(const char *columname)
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
virtual TList * GetListOfFriends() const
virtual void ResetBranchAddresses()
RVec< PromoteType< T > > tan(const RVec< T > &v)
RVec< PromoteType< T > > exp(const RVec< T > &v)