162 :
TNamed(
"ParaCoord",
"ParaCoord")
166 if (nentries>estimate) {
167 Warning(
"TParallelCoord",
"Call tree->SetEstimate(tree->GetEntries()) to display all the tree variables");
227 Warning(
"AddVariable",
"Only a single variable can be added at a time.");
231 Warning(
"AddVariable",
"Nothing to add");
237 Warning(
"AddVariable",
"%s could not be evaluated",varexp);
302 if (selector->
GetVal(i)) {
303 if (selector->
GetVar(i)) {
312 if (!candle) pc->
Draw();
313 else pc->
Draw(
"candle");
345 if(!
gPad)
return 9999;
351 x1 = frame->
GetX1()+0.01;
352 x2 = frame->
GetX2()-0.01;
353 y2 = frame->
GetY2()-0.01;
354 y1 = frame->
GetY1()+0.01;
356 xx =
gPad->AbsPixeltoX(px);
357 yy =
gPad->AbsPixeltoY(py);
359 if(xx>x1 && xx<x2 && yy>y1 && yy<y2)
return 0;
384 if (!
gPad->IsEditable())
gROOT->MakeDefCanvas();
385 }
else gROOT->MakeDefCanvas();
472 if(!inrange)
continue;
488 if (gmax < var->GetCurrentMax()) gmax = var->
GetCurrentMax();
534 Error(
"GetTree",
"Cannot load the tree: no tree defined!");
539 Error(
"GetTree",
"Tree file name : \"%s\" does not exist (Are you in the correct directory?).",
fTreeFileName.
Data());
627 gPad->Range(0,0,1,1);
641 gPad->RangeAxis(0,0,1,1);
691 Int_t entryweight = 0;
695 if(!inrange)
continue;
707 a = (y[1]-y[0])/(x[1]-x[0]);
709 x[0] = x[0]+lx*r.
Rndm();
712 a = (x[1]-x[0])/(y[1]-y[0]);
714 y[0] = y[0]+ly*r.
Rndm();
746 if (!strcmp(var->
GetTitle(),vartitle))
break;
748 if(!var)
Error(
"RemoveVariable",
"\"%s\" not a variable",vartitle);
794 if (sfile ==
"") sfile =
Form(
"%s_parallelcoord_entries.root",
fTree->
GetName());
798 Warning(
"SaveEntryLists",
"%s already exists.", sfile.
Data());
799 if (!overwrite)
return;
800 else Warning(
"SaveEntryLists",
"Overwriting.");
808 Info(
"SaveEntryLists",
"File \"%s\" written.",sfile.
Data());
820 const char* filename =
Form(
"%s_parallelcoord_entries.root",
fTree->
GetName());
823 out<<
" // Create a TParallelCoord."<<std::endl;
825 out<<
" TTree* tree = (TTree*)f->Get(\""<<
fTreeName.
Data()<<
"\");"<<std::endl;
826 out<<
" TParallelCoord* para = new TParallelCoord(tree,"<<
fNentries<<
");"<<std::endl;
827 out<<
" // Load the entrylists."<<std::endl;
828 out<<
" TFile *entries = TFile::Open(\""<<filename<<
"\");"<<std::endl;
829 out<<
" TEntryList *currententries = (TEntryList*)entries->Get(\"currententries\");"<<std::endl;
830 out<<
" tree->SetEntryList(currententries);"<<std::endl;
831 out<<
" para->SetInitEntries((TEntryList*)entries->Get(\"initentries\"));"<<std::endl;
832 out<<
" para->SetCurrentEntries(currententries);"<<std::endl;
835 out<<
" TParallelCoordSelect* sel;"<<std::endl;
836 out<<
" para->GetSelectList()->Delete();"<<std::endl;
838 out<<
" para->AddSelection(\""<<sel->
GetTitle()<<
"\");"<<std::endl;
839 out<<
" sel = (TParallelCoordSelect*)para->GetSelectList()->Last();"<<std::endl;
840 out<<
" sel->SetLineColor("<<sel->
GetLineColor()<<
");"<<std::endl;
841 out<<
" sel->SetLineWidth("<<sel->
GetLineWidth()<<
");"<<std::endl;
848 out<<
" tree->Draw(\""<<varexp.
Data()<<
"\",\"\",\"goff\");"<<std::endl;
849 out<<
" TSelectorDraw* selector = (TSelectorDraw*)((TTreePlayer*)tree->GetPlayer())->GetSelector();"<<std::endl;
852 out<<
" TParallelCoordVar* var;"<<std::endl;
854 out<<
" //***************************************"<<std::endl;
855 out<<
" // Create the axis \""<<var->
GetTitle()<<
"\"."<<std::endl;
856 out<<
" para->AddVariable(selector->GetVal("<<i<<
"),\""<<var->
GetTitle()<<
"\");"<<std::endl;
857 out<<
" var = (TParallelCoordVar*)para->GetVarList()->Last();"<<std::endl;
861 out<<
" //***************************************"<<std::endl;
862 out<<
" // Set the TParallelCoord parameters."<<std::endl;
863 out<<
" para->SetCurrentFirst("<<
fCurrentFirst<<
");"<<std::endl;
864 out<<
" para->SetCurrentN("<<
fCurrentN<<
");"<<std::endl;
865 out<<
" para->SetWeightCut("<<
fWeightCut<<
");"<<std::endl;
866 out<<
" para->SetDotsSpacing("<<
fDotsSpacing<<
");"<<std::endl;
867 out<<
" para->SetLineColor("<<
GetLineColor()<<
");"<<std::endl;
868 out<<
" para->SetLineWidth("<<
GetLineWidth()<<
");"<<std::endl;
869 out<<
" para->SetBit(TParallelCoord::kVertDisplay,"<<
TestBit(
kVertDisplay)<<
");"<<std::endl;
872 out<<
" para->SetBit(TParallelCoord::kLiveUpdate,"<<
TestBit(
kLiveUpdate)<<
");"<<std::endl;
877 out<<std::endl<<
" para->Draw();"<<std::endl;
891 Warning(
"SaveTree",
"%s already exists.", sfile.
Data());
892 if (!overwrite)
return;
893 else Warning(
"SaveTree",
"Overwriting.");
901 Info(
"SaveTree",
"File \"%s\" written.",sfile.
Data());
1116 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.
REAL estimate(int elen, REAL *e)
void DeleteVariable()
Delete variables.
void Init(TClassEdit::TInterpreterLookupHelper *helper)
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".