161 :
TNamed(
"ParaCoord",
"ParaCoord")
166 Warning(
"TParallelCoord",
"Call tree->SetEstimate(tree->GetEntries()) to display all the tree variables");
225 if (
exp.Contains(
':') ||
exp.Contains(
">>") ||
exp.Contains(
"<<")) {
226 Warning(
"AddVariable",
"Only a single variable can be added at a time.");
230 Warning(
"AddVariable",
"Nothing to add");
236 Warning(
"AddVariable",
"%s could not be evaluated",varexp);
299 if (selector->
GetVal(i)) {
300 if (selector->
GetVar(i)) {
308 pc->SetTitle(varexp.
Data());
309 if (!candle)
pc->Draw();
310 else pc->Draw(
"candle");
342 if(!
gPad)
return 9999;
350 y2 = frame->
GetY2()-0.01;
351 y1 = frame->
GetY1()+0.01;
353 xx =
gPad->AbsPixeltoX(px);
354 yy =
gPad->AbsPixeltoY(py);
356 if(xx>
x1 && xx<x2 && yy>y1 && yy<y2)
return 0;
381 if (!
gPad->IsEditable())
gROOT->MakeDefCanvas();
382 }
else gROOT->MakeDefCanvas();
468 if(!inrange)
continue;
484 if (gmax < var->GetCurrentMax()) gmax = var->
GetCurrentMax();
530 Error(
"GetTree",
"Cannot load the tree: no tree defined!");
535 Error(
"GetTree",
"Tree file name : \"%s\" does not exist (Are you in the correct directory?).",
fTreeFileName.
Data());
537 }
else if (
f->IsZombie()) {
623 gPad->Range(0,0,1,1);
637 gPad->RangeAxis(0,0,1,1);
693 Int_t entryweight = 0;
697 if(!inrange)
continue;
709 a = (
y[1]-
y[0])/(
x[1]-
x[0]);
711 x[0] =
x[0]+lx*
r.Rndm();
714 a = (
x[1]-
x[0])/(
y[1]-
y[0]);
716 y[0] =
y[0]+ly*
r.Rndm();
748 if (!strcmp(var->
GetTitle(),vartitle))
break;
751 Error(
"RemoveVariable",
"\"%s\" not a variable",vartitle);
798 if (sfile ==
"") sfile =
Form(
"%s_parallelcoord_entries.root",
fTree->
GetName());
802 Warning(
"SaveEntryLists",
"%s already exists.", sfile.
Data());
803 if (!overwrite)
return;
804 else Warning(
"SaveEntryLists",
"Overwriting.");
812 Info(
"SaveEntryLists",
"File \"%s\" written.",sfile.
Data());
824 const char* filename =
Form(
"%s_parallelcoord_entries.root",
fTree->
GetName());
827 out<<
" // Create a TParallelCoord."<<std::endl;
829 out<<
" TTree* tree = (TTree*)f->Get(\""<<
fTreeName.
Data()<<
"\");"<<std::endl;
830 out<<
" TParallelCoord* para = new TParallelCoord(tree,"<<
fNentries<<
");"<<std::endl;
831 out<<
" // Load the entrylists."<<std::endl;
832 out<<
" TFile *entries = TFile::Open(\""<<filename<<
"\");"<<std::endl;
833 out<<
" TEntryList *currententries = (TEntryList*)entries->Get(\"currententries\");"<<std::endl;
834 out<<
" tree->SetEntryList(currententries);"<<std::endl;
835 out<<
" para->SetInitEntries((TEntryList*)entries->Get(\"initentries\"));"<<std::endl;
836 out<<
" para->SetCurrentEntries(currententries);"<<std::endl;
839 out<<
" TParallelCoordSelect* sel;"<<std::endl;
840 out<<
" para->GetSelectList()->Delete();"<<std::endl;
842 out<<
" para->AddSelection(\""<<sel->
GetTitle()<<
"\");"<<std::endl;
843 out<<
" sel = (TParallelCoordSelect*)para->GetSelectList()->Last();"<<std::endl;
844 out<<
" sel->SetLineColor("<<sel->
GetLineColor()<<
");"<<std::endl;
845 out<<
" sel->SetLineWidth("<<sel->
GetLineWidth()<<
");"<<std::endl;
852 out<<
" tree->Draw(\""<<varexp.
Data()<<
"\",\"\",\"goff\");"<<std::endl;
853 out<<
" TSelectorDraw* selector = (TSelectorDraw*)((TTreePlayer*)tree->GetPlayer())->GetSelector();"<<std::endl;
856 out<<
" TParallelCoordVar* var;"<<std::endl;
858 out<<
" //***************************************"<<std::endl;
859 out<<
" // Create the axis \""<<var->
GetTitle()<<
"\"."<<std::endl;
860 out<<
" para->AddVariable(selector->GetVal("<<i<<
"),\""<<var->
GetTitle()<<
"\");"<<std::endl;
861 out<<
" var = (TParallelCoordVar*)para->GetVarList()->Last();"<<std::endl;
865 out<<
" //***************************************"<<std::endl;
866 out<<
" // Set the TParallelCoord parameters."<<std::endl;
867 out<<
" para->SetCurrentFirst("<<
fCurrentFirst<<
");"<<std::endl;
868 out<<
" para->SetCurrentN("<<
fCurrentN<<
");"<<std::endl;
869 out<<
" para->SetWeightCut("<<
fWeightCut<<
");"<<std::endl;
870 out<<
" para->SetDotsSpacing("<<
fDotsSpacing<<
");"<<std::endl;
871 out<<
" para->SetLineColor("<<
GetLineColor()<<
");"<<std::endl;
872 out<<
" para->SetLineWidth("<<
GetLineWidth()<<
");"<<std::endl;
873 out<<
" para->SetBit(TParallelCoord::kVertDisplay,"<<
TestBit(
kVertDisplay)<<
");"<<std::endl;
876 out<<
" para->SetBit(TParallelCoord::kLiveUpdate,"<<
TestBit(
kLiveUpdate)<<
");"<<std::endl;
881 out<<std::endl<<
" para->Draw();"<<std::endl;
895 Warning(
"SaveTree",
"%s already exists.", sfile.
Data());
896 if (!overwrite)
return;
897 else Warning(
"SaveTree",
"Overwriting.");
905 Info(
"SaveTree",
"File \"%s\" written.",sfile.
Data());
1120 if (
gPad->GetCanvas()->SupportAlpha())
return;
static const double x2[5]
static const double x1[5]
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetY2(Double_t y2)
virtual void SetX1(Double_t x1)
virtual void SetX2(Double_t x2)
virtual void SetY1(Double_t y1)
Bool_t Contains(const char *name) const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
A List of entry numbers in a TTree or TChain.
virtual Bool_t Enter(Long64_t entry, TTree *tree=0)
Add entry #entry to the list.
virtual Long64_t GetEntry(Int_t index)
Return the number of the entry #index of this TEntryList in the TTree or TChain See also Next().
virtual Long64_t GetN() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
virtual void Draw(Option_t *option="")
Draw this frame with its current attributes.
A Graph is a graphics object made of two arrays X and Y with npoints each.
@ kClipFrame
clip to the frame boundary
void PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a graph.
void Reset()
Reset list iterator.
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
@ kCanDelete
if object in a list can be deleted
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
A TParallelCoordRange is a range used for parallel coordinates plots.
A TParallelCoordSelect is a specialised TList to hold TParallelCoordRanges used by TParallelCoord.
const char * GetTitle() const
Returns title of object.
TH1F * GetHistogram()
Create or recreate the histogram.
void GetEntryXY(Long64_t n, Double_t &x, Double_t &y)
Get the position of the variable on the graph for the n'th entry.
void SetLogScale(Bool_t log)
Set the axis in log scale.
Double_t GetCurrentMax() const
void SetCurrentMin(Double_t min)
Set the current minimum of the axis.
void SavePrimitive(std::ostream &out, Option_t *options)
Save the TParallelCoordVar as a macro.
Double_t GetCurrentMin() const
void SetLiveRangesUpdate(Bool_t on)
If true, the pad is updated while the motion of a dragged range.
void SetX(Double_t x, Bool_t gl)
Set the X position of the axis in the case of a vertical axis.
void SetY(Double_t y, Bool_t gl)
Set the Y position of the axis in the case of a horizontal axis.
void SetBoxPlot(Bool_t box)
Set the axis to display a candle.
void SetCurrentMax(Double_t max)
Set the current maximum of the axis.
void GetQuantiles()
Get the box plot values (quantiles).
void SetHistogramHeight(Double_t h=0)
Set the height of the bar histogram.
Bool_t Eval(Long64_t evtidx, TParallelCoordSelect *select)
Check if the entry is within the range(s) of "select".
virtual void Paint(Option_t *option="")
Paint the axis.
Int_t GetEntryWeight(Long64_t evtidx)
Get the entry weight: The weight of an entry for a given variable is the bin content of the histogram...
void SetHistogramLineWidth(Int_t lw=2)
void GetMinMaxMean()
Get mean, min and max of those variable.
void SetValues(Long64_t length, Double_t *val)
Set the variable values.
void SetHistogramBinning(Int_t n=100)
Set the histogram binning.
Parallel Coordinates class.
void AddSelection(const char *title)
Add a selection.
void SetCurrentEntries(TEntryList *entries)
void UnzoomAll()
Unzoom all variables.
TEntryList * fInitEntries
virtual void Draw(Option_t *options="")
Draw the parallel coordinates graph.
void SetAxisHistogramLineWidth(Int_t lw=2)
Set the same histogram axis line width for all axis.
TTree * GetTree()
return the tree if fTree is defined.
TEntryList * fCurrentEntries
void SetGlobalLogScale(Bool_t)
All axes in log scale.
TParallelCoordSelect * fCurrentSelection
TParallelCoordSelect * GetCurrentSelection()
Return the selection currently being edited.
Double_t GetGlobalMin()
return the global minimum.
void Init()
An axis used when displaying a candle chart.
virtual ~TParallelCoord()
Destructor.
void SetAxisHistogramHeight(Double_t h=0.5)
Set the same histogram axis height for all axis.
TParallelCoordSelect * GetSelection(const char *title)
Get a selection from its title.
void DeleteSelection(TParallelCoordSelect *sel)
Delete a selection.
virtual void Paint(Option_t *options="")
Paint the parallel coordinates graph.
Int_t GetNbins()
get the binning of the histograms.
TString fTreeName
Pointer to the TTree.
void ResetTree()
Reset the tree entry list to the initial one..
TEntryList * GetEntryList(Bool_t sel=kTRUE)
Get the whole entry list or one for a selection.
void SavePrimitive(std::ostream &out, Option_t *options)
Save the TParallelCoord in a macro.
TParallelCoord()
Default constructor.
void SetGlobalScale(Bool_t gl)
Constraint all axes to the same scale.
void SetLiveRangesUpdate(Bool_t)
If true, the pad is updated while the motion of a dragged range.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute the distance from the TParallelCoord.
void AddVariable(Double_t *val, const char *title="")
Add a variable.
void SetCandleChart(Bool_t can)
Set a candle chart display.
void SetCurrentN(Long64_t)
Set the number of entry to be displayed.
Double_t GetGlobalMax()
return the global maximum.
TParallelCoordSelect * SetCurrentSelection(const char *title)
Set the selection being edited.
void SetGlobalMax(Double_t max)
Force all variables to adopt the same max.
virtual void ExecuteEvent(Int_t entry, Int_t px, Int_t py)
Execute the corresponding entry.
void SetGlobalMin(Double_t min)
Force all variables to adopt the same min.
void PaintEntries(TParallelCoordSelect *sel=NULL)
Loop over the entries and paint them.
void RemoveVariable(TParallelCoordVar *var)
Delete a variable from the graph.
void ApplySelectionToTree()
Apply the current selection to the tree.
void SetAxesPosition()
Update the position of the axes.
void SaveEntryLists(const char *filename="", Bool_t overwrite=kFALSE)
Save the entry lists in a root file "filename.root".
void SetAxisHistogramBinning(Int_t n=100)
Set the same histogram axis binning for all axis.
void CleanUpSelections(TParallelCoordRange *range)
Clean up the selections from the ranges which could have been deleted when a variable has been delete...
void SetInitEntries(TEntryList *entries)
void SetDotsSpacing(Int_t s=0)
Set dots spacing.
static void SetEntryList(TParallelCoord *para, TEntryList *enlist)
Set the entry lists of "para".
void SetVertDisplay(Bool_t vert=kTRUE)
Set the vertical or horizontal display.
static void BuildParallelCoord(TSelectorDraw *selector, Bool_t candle)
Call constructor and add the variables.
Double_t * GetVariable(const char *var)
Get the variables values from its title.
void SetCurrentFirst(Long64_t)
Set the first entry to be displayed.
TGaxis * fCandleAxis
Current Selection being edited.
void SaveTree(const char *filename="", Bool_t overwrite=kFALSE)
Save the tree in a file if fTreeFileName == "".
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Defined by an array on N points in a 2-D space.
virtual void PaintPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="")
Draw this polyline with new coordinates.
This is the base class for the ROOT Random number generators.
A specialized TSelector for TTree::Draw.
TTreeFormula * GetSelect() const
TTreeFormula * GetVar(Int_t i) const
Return the TTreeFormula corresponding to the i-th component of the request formula (where the compone...
virtual Int_t GetDimension() const
virtual Double_t * GetVal(Int_t i) const
Return the last values corresponding to the i-th component of the formula being processed (where the ...
virtual Int_t GetNfill() const
virtual void SetObject(TObject *obj)
void ToLower()
Change string to lower-case.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void SetLineStyleString(Int_t i, const char *text)
Set line style string using the PostScript convention.
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
A TTree represents a columnar dataset.
TFile * GetCurrentFile() const
Return pointer to the current file.
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
virtual Double_t * GetV1()
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual void SetBorderMode(Short_t bordermode)
virtual void SetBorderSize(Short_t bordersize)
static constexpr double s
static constexpr double pc
REAL estimate(int elen, REAL *e)