161 :
TNamed(
"ParaCoord",
"ParaCoord")
165 if (nentries>estimate) {
166 Warning(
"TParallelCoord",
"Call tree->SetEstimate(tree->GetEntries()) to display all the tree variables");
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);
301 if (selector->
GetVal(i)) {
302 if (selector->
GetVar(i)) {
311 if (!candle) pc->
Draw();
312 else pc->
Draw(
"candle");
344 if(!
gPad)
return 9999;
350 x1 = frame->
GetX1()+0.01;
351 x2 = frame->
GetX2()-0.01;
352 y2 = frame->
GetY2()-0.01;
353 y1 = frame->
GetY1()+0.01;
355 xx =
gPad->AbsPixeltoX(px);
356 yy =
gPad->AbsPixeltoY(py);
358 if(xx>x1 && xx<x2 && yy>y1 && yy<y2)
return 0;
383 if (!
gPad->IsEditable())
gROOT->MakeDefCanvas();
384 }
else gROOT->MakeDefCanvas();
471 if(!inrange)
continue;
487 if (gmax < var->GetCurrentMax()) gmax = var->
GetCurrentMax();
533 Error(
"GetTree",
"Cannot load the tree: no tree defined!");
538 Error(
"GetTree",
"Tree file name : \"%s\" does not exist (Are you in the correct directory?).",
fTreeFileName.
Data());
626 gPad->Range(0,0,1,1);
640 gPad->RangeAxis(0,0,1,1);
690 Int_t entryweight = 0;
694 if(!inrange)
continue;
706 a = (y[1]-y[0])/(x[1]-x[0]);
708 x[0] = x[0]+lx*r.
Rndm();
711 a = (x[1]-x[0])/(y[1]-y[0]);
713 y[0] = y[0]+ly*r.
Rndm();
745 if (!strcmp(var->
GetTitle(),vartitle))
break;
747 if(!var)
Error(
"RemoveVariable",
"\"%s\" not a variable",vartitle);
793 if (sfile ==
"") sfile =
Form(
"%s_parallelcoord_entries.root",
fTree->
GetName());
797 Warning(
"SaveEntryLists",
"%s already exists.", sfile.
Data());
798 if (!overwrite)
return;
799 else Warning(
"SaveEntryLists",
"Overwriting.");
807 Info(
"SaveEntryLists",
"File \"%s\" written.",sfile.
Data());
819 const char* filename =
Form(
"%s_parallelcoord_entries.root",
fTree->
GetName());
822 out<<
" // Create a TParallelCoord."<<std::endl;
824 out<<
" TTree* tree = (TTree*)f->Get(\""<<
fTreeName.
Data()<<
"\");"<<std::endl;
825 out<<
" TParallelCoord* para = new TParallelCoord(tree,"<<
fNentries<<
");"<<std::endl;
826 out<<
" // Load the entrylists."<<std::endl;
827 out<<
" TFile *entries = TFile::Open(\""<<filename<<
"\");"<<std::endl;
828 out<<
" TEntryList *currententries = (TEntryList*)entries->Get(\"currententries\");"<<std::endl;
829 out<<
" tree->SetEntryList(currententries);"<<std::endl;
830 out<<
" para->SetInitEntries((TEntryList*)entries->Get(\"initentries\"));"<<std::endl;
831 out<<
" para->SetCurrentEntries(currententries);"<<std::endl;
834 out<<
" TParallelCoordSelect* sel;"<<std::endl;
835 out<<
" para->GetSelectList()->Delete();"<<std::endl;
837 out<<
" para->AddSelection(\""<<sel->
GetTitle()<<
"\");"<<std::endl;
838 out<<
" sel = (TParallelCoordSelect*)para->GetSelectList()->Last();"<<std::endl;
839 out<<
" sel->SetLineColor("<<sel->
GetLineColor()<<
");"<<std::endl;
840 out<<
" sel->SetLineWidth("<<sel->
GetLineWidth()<<
");"<<std::endl;
847 out<<
" tree->Draw(\""<<varexp.
Data()<<
"\",\"\",\"goff\");"<<std::endl;
848 out<<
" TSelectorDraw* selector = (TSelectorDraw*)((TTreePlayer*)tree->GetPlayer())->GetSelector();"<<std::endl;
851 out<<
" TParallelCoordVar* var;"<<std::endl;
853 out<<
" //***************************************"<<std::endl;
854 out<<
" // Create the axis \""<<var->
GetTitle()<<
"\"."<<std::endl;
855 out<<
" para->AddVariable(selector->GetVal("<<i<<
"),\""<<var->
GetTitle()<<
"\");"<<std::endl;
856 out<<
" var = (TParallelCoordVar*)para->GetVarList()->Last();"<<std::endl;
860 out<<
" //***************************************"<<std::endl;
861 out<<
" // Set the TParallelCoord parameters."<<std::endl;
862 out<<
" para->SetCurrentFirst("<<
fCurrentFirst<<
");"<<std::endl;
863 out<<
" para->SetCurrentN("<<
fCurrentN<<
");"<<std::endl;
864 out<<
" para->SetWeightCut("<<
fWeightCut<<
");"<<std::endl;
865 out<<
" para->SetDotsSpacing("<<
fDotsSpacing<<
");"<<std::endl;
866 out<<
" para->SetLineColor("<<
GetLineColor()<<
");"<<std::endl;
867 out<<
" para->SetLineWidth("<<
GetLineWidth()<<
");"<<std::endl;
868 out<<
" para->SetBit(TParallelCoord::kVertDisplay,"<<
TestBit(
kVertDisplay)<<
");"<<std::endl;
871 out<<
" para->SetBit(TParallelCoord::kLiveUpdate,"<<
TestBit(
kLiveUpdate)<<
");"<<std::endl;
876 out<<std::endl<<
" para->Draw();"<<std::endl;
890 Warning(
"SaveTree",
"%s already exists.", sfile.
Data());
891 if (!overwrite)
return;
892 else Warning(
"SaveTree",
"Overwriting.");
900 Info(
"SaveTree",
"File \"%s\" written.",sfile.
Data());
1115 if (
gPad->GetCanvas()->SupportAlpha())
return;
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.
TEntryList * fInitEntries
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
void Init()
An axis used when displaying a candle chart.
void PaintEntries(TParallelCoordSelect *sel=NULL)
Loop over the entries and paint them.
A TParallelCoordSelect is a specialised TList to hold TParallelCoordRanges used by TParallelCoord...
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
void CleanUpSelections(TParallelCoordRange *range)
Clean up the selections from the ranges which could have been deleted when a variable has been delete...
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
TTreeFormula * GetVar(Int_t i) const
Return the TTreeFormula corresponding to the i-th component of the request formula (where the compone...
virtual Long64_t GetN() const
TParallelCoordSelect * GetCurrentSelection()
Return the selection currently being edited.
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 ...
void SetCurrentMax(Double_t max)
Set the current maximum of the axis.
void PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a graph.
static void BuildParallelCoord(TSelectorDraw *selector, Bool_t candle)
Call constructor and add the variables.
TParallelCoordSelect * GetSelection(const char *title)
Get a selection from its title.
virtual void SetBorderMode(Short_t bordermode)
void SetAxisHistogramHeight(Double_t h=0.5)
Set the same histogram axis height for all axis.
TString & ReplaceAll(const TString &s1, const TString &s2)
R__EXTERN TStyle * gStyle
Bool_t TestBit(UInt_t f) const
void SetLogScale(Bool_t log)
Set the axis in log scale.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
void SetCurrentMin(Double_t min)
Set the current minimum of the axis.
void SetAxisHistogramLineWidth(Int_t lw=2)
Set the same histogram axis line width for all axis.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
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 *options="")
Draw the parallel coordinates graph.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
void SetLiveRangesUpdate(Bool_t)
If true, the pad is updated while the motion of a dragged range.
A TParallelCoordRange is a range used for parallel coordinates plots.
void ToLower()
Change string to lower-case.
void SetValues(Long64_t length, Double_t *val)
Set the variable values.
void ResetTree()
Reset the tree entry list to the initial one..
void SetCurrentFirst(Long64_t)
Set the first entry to be displayed.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
void SetVertDisplay(Bool_t vert=kTRUE)
Set the vertical or horizontal display.
virtual void SetX1(Double_t x1)
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
TH1F * GetHistogram()
Create or recreate the histogram.
void SetCurrentN(Long64_t)
Set the number of entry to be displayed.
Bool_t Contains(const char *name) const
void SetBoxPlot(Bool_t box)
Set the axis to display a candle.
virtual void SetX2(Double_t x2)
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
virtual Int_t GetDimension() const
void SetLineStyleString(Int_t i, const char *text)
Set line style string using the PostScript convention.
virtual Width_t GetLineWidth() const
Return the line width.
Double_t GetGlobalMin()
return the global minimum.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
if object in a list can be deleted
TParallelCoordSelect * fCurrentSelection
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.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetAxisHistogramBinning(Int_t n=100)
Set the same histogram axis binning for all axis.
void SetX(Double_t x, Bool_t gl)
Set the X position of the axis in the case of a vertical axis.
Double_t GetCurrentMin() const
static const double x2[5]
TEntryList * fCurrentEntries
Int_t GetNbins()
get the binning of the histograms.
void ApplySelectionToTree()
Apply the current selection to the tree.
void SetY(Double_t y, Bool_t gl)
Set the Y position of the axis in the case of a horizontal axis.
This is the base class for the ROOT Random number generators.
The TNamed class is the base class for all named ROOT classes.
clip to the frame boundary
REAL estimate(int elen, REAL *e)
void DeleteVariable()
Delete variables.
void SetInitEntries(TEntryList *entries)
TString & Append(const char *cs)
void SetLiveRangesUpdate(Bool_t on)
If true, the pad is updated while the motion of a dragged range.
virtual void Draw(Option_t *option="")
Draw this frame with its current attributes.
Double_t GetCurrentMax() const
void GetMinMaxMean()
Get mean, min and max of those variable.
void SetCurrentEntries(TEntryList *entries)
virtual void SetBorderSize(Short_t bordersize)
virtual void Paint(Option_t *options="")
Paint the parallel coordinates graph.
void SaveTree(const char *filename="", Bool_t overwrite=kFALSE)
Save the tree in a file if fTreeFileName == "".
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 SetGlobalMax(Double_t max)
Force all variables to adopt the same max.
virtual Double_t Rndm()
Machine independent random number generator.
void RemoveVariable(TParallelCoordVar *var)
Delete a variable from the graph.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TTreeFormula * GetSelect() const
static void SetEntryList(TParallelCoord *para, TEntryList *enlist)
Set the entry lists of "para".
Double_t GetGlobalMax()
return the global maximum.
void SetCandleChart(Bool_t can)
Set a candle chart display.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
TParallelCoord()
Default constructor.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
void AddSelection(const char *title)
Add a selection.
void SetGlobalScale(Bool_t gl)
Constraint all axes to the same scale.
TString fTreeName
Pointer to the TTree.
virtual void ExecuteEvent(Int_t entry, Int_t px, Int_t py)
Execute the corresponding entry.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
void SetGlobalLogScale(Bool_t)
All axes in log scale.
void SetHistogramBinning(Int_t n=100)
Set the histogram binning.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TFile * GetCurrentFile() const
Return pointer to the current file.
char * Form(const char *fmt,...)
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()...
TGaxis * fCandleAxis
Current Selection being edited.
TTree * GetTree()
return the tree if fTree is defined.
void SetGlobalMin(Double_t min)
Force all variables to adopt the same min.
virtual Long64_t GetEstimate() const
virtual void PaintPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="")
Draw this polyline with new coordinates.
~TParallelCoord()
Destructor.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
const char * GetTitle() const
Returns title of object.
void AddVariable(Double_t *val, const char *title="")
Add a variable.
A specialized TSelector for TTree::Draw.
void UnzoomAll()
Unzoom all variables.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetY2(Double_t y2)
TString & Remove(Ssiz_t pos)
void GetQuantiles()
Get the box plot values (quantiles).
void SetHistogramHeight(Double_t h=0)
Set the height of the bar histogram.
static const double x1[5]
A Pave (see TPave) with text, lines or/and boxes inside.
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
virtual void Draw(Option_t *option="")
Draw the axis.
TParallelCoordSelect * SetCurrentSelection(const char *title)
Set the selection being edited.
void SavePrimitive(std::ostream &out, Option_t *options)
Save the TParallelCoordVar as a macro.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual Int_t GetNfill() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void SetDotsSpacing(Int_t s=0)
Set dots spacing.
virtual Bool_t Enter(Long64_t entry, TTree *tree=0)
Add entry #entry to the list.
virtual void SetObject(TObject *obj)
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
void DeleteSelection(TParallelCoordSelect *sel)
Delete a selection.
void SavePrimitive(std::ostream &out, Option_t *options)
Save the TParallelCoord in a macro.
Parallel Coordinates class.
void SetAxesPosition()
Update the position of the axes.
void SetHistogramLineWidth(Int_t lw=2)
Double_t * GetVariable(const char *var)
Get the variables values from its title.
virtual void Add(TObject *obj)
A Graph is a graphics object made of two arrays X and Y with npoints each.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Defined by an array on N points in a 2-D space.
void Reset()
Reset list iterator.
A TTree object has a header with a name and a title.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute the distance from the TParallelCoord.
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
virtual Int_t GetSize() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetY1(Double_t y1)
A List of entry numbers in a TTree or TChain.
TEntryList * GetEntryList(Bool_t sel=kTRUE)
Get the whole entry list or one for a selection.
virtual Double_t * GetV1()
Bool_t Eval(Long64_t evtidx, TParallelCoordSelect *select)
Check if the entry is within the range(s) of "select".
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const
void SaveEntryLists(const char *filename="", Bool_t overwrite=kFALSE)
Save the entry lists in a root file "filename.root".