Logo ROOT  
Reference Guide
TSpider.cxx
Go to the documentation of this file.
1 // @(#)root/treeviewer:$Id: 2bb6def14de16b049d4c979e73ad2b08d0936520 $
2 // Author: Bastien Dalla Piazza 20/07/07
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TSpider.h"
13 #include "TAttFill.h"
14 #include "TAttText.h"
15 #include "TAttLine.h"
16 #include "TGraphPolargram.h"
17 #include "TPolyLine.h"
18 #include "TNtuple.h"
19 #include "TBranch.h"
20 #include "TTreeFormula.h"
21 #include "TTreeFormulaManager.h"
22 #include "TList.h"
23 #include "TSelectorDraw.h"
24 #include "TROOT.h"
25 #include "TEntryList.h"
26 #include "TLatex.h"
27 #include "TVirtualPad.h"
28 #include "TMath.h"
29 #include "TCanvas.h"
30 #include "TArc.h"
31 #include "float.h"
32 #include "TEnv.h"
33 
35 
36 /** \class TSpider
37 Spider class.
38 
39 A spider view is a handy way to visualize a set of data stored in a TTree.
40 It draws as many polar axes as selected data members. For each of them, it draws
41 on the axis the position of the present event between the min and max of the
42 data member. Two modes are available:
43 
44  - The spider view: With each points on the axes is drawn a polyline.
45  - The segment view: For each data member is drawn an arc segment with the
46  radius corresponding to the event.
47 
48 The spider plot is available from the treeviewer called by
49 "atree->StartViewer()", or simply by calling its constructor and defining the
50 variables to display.
51 
52 Begin_Macro(source)
53 {
54  TCanvas *c1 = new TCanvas("c1","TSpider example",200,10,700,700);
55  TFile *f = new TFile("$(ROOTSYS)/tutorials/hsimple.root");
56  if (!f || f->IsZombie()) {
57  printf("Please run <ROOT location>/tutorials/hsimple.C before.");
58  return;
59  }
60  TNtuple* ntuple = (TNtuple*)f->Get("ntuple");
61  TString varexp = "px:py:pz:random:sin(px):log(px/py):log(pz)";
62  TString selectStr = "px>0 && py>0 && pz>0";
63  TString options = "average";
64  TSpider *spider = new TSpider(ntuple,varexp.Data(),selectStr.Data(),options.Data());
65  spider->Draw();
66  c1->ToggleEditor();
67  c1->Selected(c1,spider,1);
68  return c1;
69 }
70 End_Macro
71 */
72 
73 ////////////////////////////////////////////////////////////////////////////////
74 /// Default constructor.
75 
77 {
80  fPolargram=NULL;
81  fInput=NULL;
82  fManager=NULL;
83  fNcols=0;
84  fNx=3;
85  fNy=4;
86  fPolyList=NULL;
87  fSelect=NULL;
88  fSelector=NULL;
89  fTree=NULL;
90  fMax=NULL;
91  fMin=NULL;
92  fAve=NULL;
93  fCanvas=NULL;
94  fAveragePoly=NULL;
95  fEntry=0;
96  fSuperposed=NULL;
99  fAverageSlices=NULL;
101  fNentries=0;
102  fFirstEntry=0;
103  fArraySize=0;
104  fCurrentEntries = NULL;
105  fFormulas = NULL;
106 }
107 
108 ////////////////////////////////////////////////////////////////////////////////
109 /// Normal constructor. Options are:
110 /// - "average"
111 /// - "showrange"
112 /// - "segment"
113 
114 TSpider::TSpider(TTree* tree ,const char *varexp, const char *selection,
115  Option_t *option, Long64_t nentries, Long64_t firstentry)
116  : TAttFill(2,3003), TAttLine(1,1,1)
117 {
118  UInt_t ui=0;
119 
120  fArraySize = 16;
121  fTree=tree;
122  fSelector= new TSelectorDraw();
123  fFormulas= new TList();
124  fInput= new TList();
125  fInput->Add(new TNamed("varexp",""));
126  fInput->Add(new TNamed("selection",""));
128  gROOT->GetListOfCleanups()->Add(this);
129  fNx=2;
130  fNy=2;
132  fSelect=NULL;
133  fManager=NULL;
134  fCanvas=NULL;
135  fAveragePoly=NULL;
137  fSuperposed=NULL;
141  fAverageSlices=NULL;
143  if (firstentry < 0 || firstentry > tree->GetEstimate()) firstentry = 0;
144  fFirstEntry = firstentry;
145  if (nentries>0) fNentries = nentries;
146  else fNentries = nentries = tree->GetEstimate()-firstentry;
147 
149 
150  fPolargram=NULL;
151  fPolyList=NULL;
152 
155  for(ui=0;ui<fNx*fNy;++ui) fCurrentEntries[ui]=0;
156 
157  TString opt = option;
158 
159  if (opt.Contains("average")) fDisplayAverage=kTRUE;
160  if (opt.Contains("showrange")) fShowRange=kTRUE;
161  if (opt.Contains("segment")) fSegmentDisplay=kTRUE;
162 
163  fNcols=8;
164 
165  SetVariablesExpression(varexp);
166  SetSelectionExpression(selection);
167  SyncFormulas();
168  InitVariables(firstentry,nentries);
169 }
170 
171 ////////////////////////////////////////////////////////////////////////////////
172 /// Destructor.
173 
175 {
176  delete [] fCurrentEntries;
177  if(fPolyList){
178  fPolyList->Delete();
179  delete fPolyList;
180  }
181  if(fAverageSlices)
182  delete [] fAverageSlices;
183  if(fFormulas){
184  fFormulas->Delete();
185  delete fFormulas;
186  }
187  if(fSelect) delete fSelect;
188  if(fSelector) delete fSelector;
189  if(fInput){
190  fInput->Delete();
191  delete fInput;
192  }
193  if(fMax) delete [] fMax;
194  if(fMin) delete [] fMin;
195  if(fAve) delete [] fAve;
196  if(fSuperposed){
197  fSuperposed->Delete();
198  delete fSuperposed;
199  }
200  if (fCanvas) fCanvas->cd(0);
201 }
202 
203 ////////////////////////////////////////////////////////////////////////////////
204 /// Allow to superpose several spider views.
205 
207 {
208  if(!fSuperposed) fSuperposed=new TList();
209  fSuperposed->Add(sp);
210 }
211 
212 ////////////////////////////////////////////////////////////////////////////////
213 /// Add a variable to the plot from its expression.
214 
215 void TSpider::AddVariable(const char* varexp)
216 {
217  if(!varexp[0]) return;
218  TTreeFormula *fvar = new TTreeFormula("Var1",varexp,fTree);
219  if(fvar->GetNdim() <= 0) return;
220 
221  fFormulas->AddAfter(fFormulas->At(fNcols-1),fvar);
222 
223  InitArrays(fNcols + 1);
224  ++fNcols;
225  SyncFormulas();
226 
227  UInt_t ui=0;
228  Long64_t notSkipped=0;
229  Int_t tnumber=-1;
230  Long64_t entryNumber;
231  Long64_t entry = fFirstEntry;
232  Int_t entriesToDisplay = fNentries;
233  while(entriesToDisplay!=0){
234  entryNumber = fTree->GetEntryNumber(entry);
235  if(entryNumber < 0) break;
236  Long64_t localEntry = fTree->LoadTree(entryNumber);
237  if(localEntry < 0) break;
238  if(tnumber != fTree->GetTreeNumber()) {
239  tnumber = fTree->GetTreeNumber();
241  else {
242  for(Int_t i=0;i<=fFormulas->LastIndex();++i)
243  ((TTreeFormula*)fFormulas->At(i))->UpdateFormulaLeaves();
244  }
245  }
246  Int_t ndata=1;
247  if(fForceDim){
248  if(fManager)
249  ndata = fManager->GetNdata(kTRUE);
250  else {
251  for(ui=0;ui<fNcols;++ui){
252  if(ndata<((TTreeFormula*)fFormulas->At(ui))->GetNdata())
253  ndata = ((TTreeFormula*)fFormulas->At(ui))->GetNdata();
254  }
255  if(fSelect && fSelect->GetNdata() == 0)
256  ndata = 0;
257  }
258  }
259 
260  Bool_t loaded = kFALSE;
261  Bool_t skip = kFALSE;
262  // Loop over the instances of the selection condition
263  for(Int_t inst=0;inst<ndata;++inst){
264  if(fSelect){
265  if(fSelect->EvalInstance(inst) == 0){
266  skip = kTRUE;
267  ++entry;
268  }
269  }
270  if (!loaded) {
271  // EvalInstance(0) always needs to be called so that
272  // the proper branches are loaded.
273  ((TTreeFormula*)fFormulas->At(fNcols-1))->EvalInstance(0);
274  loaded = kTRUE;
275  } else if (inst == 0) {
276  loaded = kTRUE;
277  }
278  }
279  if(!skip){
280  fTree->LoadTree(entryNumber);
282  if(var->EvalInstance()>fMax[fNcols-1]) fMax[fNcols-1]=var->EvalInstance();
283  if(var->EvalInstance()<fMin[fNcols-1]) fMin[fNcols-1]=var->EvalInstance();
284  fAve[fNcols-1]+=var->EvalInstance();
285  ++notSkipped;
286  --entriesToDisplay;
287  ++entry;
288  }
289  }
290  if (notSkipped) fAve[fNcols-1]/=notSkipped;
291 
292  Color_t lc;
293  Style_t lt;
294  Width_t lw;
295  Color_t fc;
296  Style_t fs;
297 
298  if(fAverageSlices){
299  lc = fAverageSlices[0]->GetLineColor();
300  lt = fAverageSlices[0]->GetLineStyle();
301  lw = fAverageSlices[0]->GetLineWidth();
303  fs = fAverageSlices[0]->GetFillStyle();
304  } else {
305  lc = fAveragePoly->GetLineColor();
306  lt = fAveragePoly->GetLineStyle();
307  lw = fAveragePoly->GetLineWidth();
309  fs = fAveragePoly->GetFillStyle();
310  }
311 
312  delete fPolargram;
313  fPolargram = NULL;
314 
315  if(fSegmentDisplay){
316  for(ui=0;ui<fNx*fNy;++ui) ((TList*)fPolyList->At(ui))->Delete();
317  if (fAverageSlices) for(ui=0;ui<fNcols-1;++ui) delete fAverageSlices[ui];
318  }
319  fPolyList->Delete();
320  delete fPolyList;
321  fPolyList = NULL;
322  delete [] fAverageSlices;
323  fAverageSlices = NULL;
324  delete fAveragePoly;
325  fAveragePoly = NULL;
326 
327  if (fCanvas) {
328  fCanvas->Clear();
329  fCanvas->Divide(fNx,fNy);
330  }
331  Draw("");
332 
333  if(fAverageSlices){
334  for(ui = 0;ui<fNcols;++ui){
335  fAverageSlices[ui]->SetLineColor(lc);
336  fAverageSlices[ui]->SetLineStyle(lt);
337  fAverageSlices[ui]->SetLineWidth(lw);
339  fAverageSlices[ui]->SetFillStyle(fs);
340  }
341  } else {
347  }
348 }
349 
350 ////////////////////////////////////////////////////////////////////////////////
351 /// Delete a variable from its expression.
352 
353 void TSpider::DeleteVariable(const char* varexp)
354 {
355  Int_t var=-1;
356  UInt_t ui=0;
357 
358  if(fNcols == 2) return;
359  for(ui=0; ui<fNcols;++ui){
360  if(!strcmp(varexp,((TTreeFormula*)fFormulas->At(ui))->GetTitle())) var = ui;
361  }
362  if(var<0) return;
363 
364  fFormulas->Remove(fFormulas->At(var));
365  SyncFormulas();
366 
367  for(ui=var+1;ui<fNcols;++ui){
368  fMin[ui-1] = fMin[ui];
369  fMax[ui-1] = fMax[ui];
370  fAve[ui-1] = fAve[ui];
371  }
372  fMin[fNcols-1] = DBL_MAX;
373  fMax[fNcols-1] = -DBL_MAX;
374  fAve[fNcols-1] = 0;
375  --fNcols;
376 
377  Color_t lc;
378  Style_t lt;
379  Width_t lw;
380  Color_t fc;
381  Style_t fs;
382 
383  if(fAverageSlices){
384  lc = fAverageSlices[0]->GetLineColor();
385  lt = fAverageSlices[0]->GetLineStyle();
386  lw = fAverageSlices[0]->GetLineWidth();
388  fs = fAverageSlices[0]->GetFillStyle();
389  } else {
390  lc = fAveragePoly->GetLineColor();
391  lt = fAveragePoly->GetLineStyle();
392  lw = fAveragePoly->GetLineWidth();
394  fs = fAveragePoly->GetFillStyle();
395  }
396 
397  delete fPolargram;
398  fPolargram = NULL;
399 
400  if(fSegmentDisplay){
401  for(ui=0;ui<fNx*fNy;++ui) ((TList*)fPolyList->At(ui))->Delete();
402  if (fAverageSlices) for(ui=0;ui<=fNcols;++ui) delete fAverageSlices[ui];
403  }
404  fPolyList->Delete();
405  delete fPolyList;
406  fPolyList = NULL;
407  delete [] fAverageSlices;
408  fAverageSlices = NULL;
409  delete fAveragePoly;
410  fAveragePoly = NULL;
411 
412  if (fCanvas) {
413  fCanvas->Clear();
414  fCanvas->Divide(fNx,fNy);
415  }
416  Draw("");
417  if(fNcols == 2) SetSegmentDisplay(kTRUE);
418 
419  if(fAverageSlices){
420  for(ui = 0;ui<fNcols;++ui){
421  fAverageSlices[ui]->SetLineColor(lc);
422  fAverageSlices[ui]->SetLineStyle(lt);
423  fAverageSlices[ui]->SetLineWidth(lw);
425  fAverageSlices[ui]->SetFillStyle(fs);
426  }
427  } else {
433  }
434 }
435 
436 ////////////////////////////////////////////////////////////////////////////////
437 /// Compute the distance to the spider.
438 
440 {
441  if(!gPad) return 9999;
442  Double_t xx,yy,r2;
443  xx=gPad->AbsPixeltoX(px);
444  yy=gPad->AbsPixeltoY(py);
445  r2 = xx*xx + yy*yy;
446  if(r2>1 && r2<1.5)
447  return 0;
448  else return 9999;
449 }
450 
451 ////////////////////////////////////////////////////////////////////////////////
452 /// Draw the spider.
453 
454 void TSpider::Draw(Option_t *options)
455 {
456  UInt_t ui=0;
457 
458  gEnv->SetValue("Canvas.ShowEditor",1);
459  if(!gPad && !fCanvas){
460  fCanvas = new TCanvas("screen","Spider Plot",fNx*256,fNy*256);
461  if (fCanvas) fCanvas->Divide(fNx,fNy);
462  } else if(!fCanvas){
463  fCanvas = (TCanvas*)gPad;
464  if (fCanvas) fCanvas->Divide(fNx,fNy);
465  }
466  if(fPolargram) delete fPolargram;
467  fPolargram=new TGraphPolargram("fPolargram");
470  if (fCanvas) fCanvas->cd();
472  AppendPad(options);
473  for(ui=0;ui<fNx*fNy;++ui){
474  if (fCanvas) fCanvas->cd(ui+1);
475  fPolargram->Draw("pn");
477  if(fSegmentDisplay){
479  DrawSlices("");
480  } else {
482  DrawPoly("");
483  }
484  AppendPad();
485  }
486  if (fCanvas) fCanvas->Selected(fCanvas,this,1);
487 }
488 
489 ////////////////////////////////////////////////////////////////////////////////
490 /// Paint the Polygon representing the average value of the variables.
491 
493 {
494  Int_t linecolor=4;
495  Int_t fillstyle=0;
496  Int_t fillcolor=linecolor;
497  Int_t linewidth=1;
498  Int_t linestyle=1;
499 
500  UInt_t ui=0;
501  Double_t slice = 2*TMath::Pi()/fNcols;
502  Double_t *x = new Double_t[fNcols+1];
503  Double_t *y = new Double_t[fNcols+1];
504 
505  for(ui=0;ui<fNcols;++ui){
506  x[ui]=(fAve[ui]-fMin[ui])/(fMax[ui]-fMin[ui])*TMath::Cos(ui*slice);
507  y[ui]=(fAve[ui]-fMin[ui])/(fMax[ui]-fMin[ui])*TMath::Sin(ui*slice);
508  }
509  x[fNcols]=(fAve[0]-fMin[0])/(fMax[0]-fMin[0]);
510  y[fNcols]=0;
511 
512  if(!fAveragePoly){
513  fAveragePoly = new TPolyLine(fNcols+1,x,y);
514  fAveragePoly->SetLineColor(linecolor);
515  fAveragePoly->SetLineWidth(linewidth);
516  fAveragePoly->SetLineStyle(linestyle);
517  fAveragePoly->SetFillStyle(fillstyle);
518  fAveragePoly->SetFillColor(fillcolor);
519  }
520  fAveragePoly->Draw();
521  fAveragePoly->Draw("f");
522 
523  delete [] x;
524  delete [] y;
525 }
526 
527 ////////////////////////////////////////////////////////////////////////////////
528 /// Paint the polygon representing the current entry.
529 
530 void TSpider::DrawPoly(Option_t* /*options*/)
531 {
532  if(!fPolyList) fPolyList = new TList();
533  Double_t *x = new Double_t[fNcols+1];
534  Double_t *y = new Double_t[fNcols+1];
535 
536  Double_t slice = 2*TMath::Pi()/fNcols;
537  for(UInt_t i=0;i<fNcols;++i){
538  x[i]=(((TTreeFormula*)fFormulas->At(i))->EvalInstance()-fMin[i])/(fMax[i]-fMin[i])*TMath::Cos(i*slice);
539  y[i]=(((TTreeFormula*)fFormulas->At(i))->EvalInstance()-fMin[i])/(fMax[i]-fMin[i])*TMath::Sin(i*slice);
540  }
541  x[fNcols]=(((TTreeFormula*)fFormulas->At(0))->EvalInstance()-fMin[0])/(fMax[0]-fMin[0]);
542  y[fNcols]=0;
543 
544  TPolyLine* poly= new TPolyLine(fNcols+1,x,y);
545  poly->SetFillColor(GetFillColor());
546  poly->SetFillStyle(GetFillStyle());
547  poly->SetLineWidth(GetLineWidth());
548  poly->SetLineColor(GetLineColor());
549  poly->SetLineStyle(GetLineStyle());
550  poly->Draw("f");
551  poly->Draw();
552  fPolyList->Add(poly);
553  delete [] x;
554  delete [] y;
555 }
556 
557 ////////////////////////////////////////////////////////////////////////////////
558 /// Draw the slices of the segment plot.
559 
561 {
562  UInt_t ui=0;
563 
564  Double_t angle = 2*TMath::Pi()/fNcols;
565  Double_t conv = 180.0/TMath::Pi();
566 
567  if(!fPolyList) fPolyList = new TList;
568  TList* li = new TList();
569  for(ui=0;ui<fNcols;++ui){
570  Double_t r = (((TTreeFormula*)fFormulas->At(ui))->EvalInstance()-fMin[ui])/(fMax[ui]-fMin[ui]);
571  TArc* slice = new TArc(0,0,r,(ui-0.25)*angle*conv,(ui+0.25)*angle*conv);
572  slice->SetFillColor(GetFillColor());
573  slice->SetFillStyle(GetFillStyle());
574  slice->SetLineWidth(GetLineWidth());
575  slice->SetLineColor(GetLineColor());
576  slice->SetLineStyle(GetLineStyle());
577  li->Add(slice);
578  slice->Draw(options);
579  }
580  fPolyList->Add(li);
581 }
582 
583 ////////////////////////////////////////////////////////////////////////////////
584 /// Draw the slices representing the average for the segment plot.
585 
587 {
588  UInt_t ui=0;
589 
590  Int_t fillstyle=3002;
591  Int_t linecolor=4;
592  Int_t fillcolor=linecolor;
593  Int_t linewidth=1;
594  Int_t linestyle=1;
595 
596  Double_t angle = 2*TMath::Pi()/fNcols;
597  Double_t conv = 180.0/TMath::Pi();
598 
599  if(!fAverageSlices){
600  fAverageSlices = new TArc*[fNcols];
601  for(ui=0;ui<fNcols;++ui){
602  Double_t r = (fAve[ui]-fMin[ui])/(fMax[ui]-fMin[ui]);
603  fAverageSlices[ui] = new TArc(0,0,r,(ui-0.5)*angle*conv,(ui+0.5)*angle*conv);
604  fAverageSlices[ui]->SetFillColor(fillcolor);
605  fAverageSlices[ui]->SetFillStyle(fillstyle);
606  fAverageSlices[ui]->SetLineWidth(linewidth);
607  fAverageSlices[ui]->SetLineColor(linecolor);
608  fAverageSlices[ui]->SetLineStyle(linestyle);
609  }
610  }
611  for(ui=0;ui<fNcols;++ui) fAverageSlices[ui]->Draw();
612 }
613 
614 ////////////////////////////////////////////////////////////////////////////////
615 /// Get the LineStyle of the average.
616 
618 {
619  if(fAverageSlices) return fAverageSlices[0]->GetLineStyle();
620  else if(fAveragePoly) return fAveragePoly->GetLineStyle();
621  else return 0;
622 }
623 
624 ////////////////////////////////////////////////////////////////////////////////
625 /// Get the LineColor of the average.
626 
628 {
629  if(fAverageSlices) return fAverageSlices[0]->GetLineColor();
630  else if(fAveragePoly) return fAveragePoly->GetLineColor();
631  else return 0;
632 }
633 
634 ////////////////////////////////////////////////////////////////////////////////
635 /// Get the LineWidth of the average.
636 
638 {
639  if(fAverageSlices) return fAverageSlices[0]->GetLineWidth();
640  else if(fAveragePoly) return fAveragePoly->GetLineWidth();
641  else return 0;
642 }
643 
644 ////////////////////////////////////////////////////////////////////////////////
645 /// Get the Fill Color of the average.
646 
648 {
649  if(fAverageSlices) return fAverageSlices[0]->GetFillColor();
650  else if(fAveragePoly) return fAveragePoly->GetFillColor();
651  else return 0;
652 }
653 
654 ////////////////////////////////////////////////////////////////////////////////
655 /// Get the FillStyle of the average.
656 
658 {
659  if(fAverageSlices) return fAverageSlices[0]->GetFillStyle();
660  else if(fAveragePoly) return fAveragePoly->GetFillStyle();
661  else return 0;
662 }
663 
664 ////////////////////////////////////////////////////////////////////////////////
665 /// Execute the corresponding event.
666 
667 void TSpider::ExecuteEvent(Int_t /*event*/,Int_t /*px*/, Int_t /*py*/)
668 {
669  if (!gPad) return;
670  gPad->SetCursor(kHand);
671 }
672 
673 ////////////////////////////////////////////////////////////////////////////////
674 /// Find the alignement rule to apply for TText::SetTextAlign(Short_t).
675 
677 {
678  Double_t pi = TMath::Pi();
679 
680  while(angle < 0 || angle > 2*pi){
681  if(angle < 0) angle+=2*pi;
682  if(angle > 2*pi) angle-=2*pi;
683  }
684  if(!fAngularLabels){
685  if(angle > 0 && angle < pi/2) return 11;
686  else if(angle > pi/2 && angle < pi) return 31;
687  else if(angle > pi && angle < 3*pi/2) return 33;
688  else if(angle > 3*pi/2 && angle < 2*pi) return 13;
689  else if(angle == 0 || angle == 2*pi) return 12;
690  else if(angle == pi/2) return 21;
691  else if(angle == pi) return 32;
692  else if(angle == 3*pi/2) return 23;
693  else return 0;
694  }
695  else{
696  if(angle >= 0 && angle < pi) return 21;
697  else if(angle >=pi && angle <= 2*pi) return 23;
698  else return 0;
699  }
700 }
701 
702 ////////////////////////////////////////////////////////////////////////////////
703 /// Determine the orientation of the polar labels according to their angle.
704 
706 {
707  Double_t pi = TMath::Pi();
708  Double_t convraddeg = 180.0/pi;
709 
710  while(angle < 0 || angle > 2*pi){
711  if(angle < 0) angle+=2*pi;
712  if(angle > 2*pi) angle-=2*pi;
713  }
714 
715  if(angle >= 0 && angle <= pi/2) return angle*convraddeg - 90;
716  else if(angle > pi/2 && angle <= pi) return (angle + pi)*convraddeg + 90;
717  else if(angle > pi && angle <= 3*pi/2) return (angle - pi)*convraddeg - 90;
718  else if(angle > 3*pi/2 && angle <= 2*pi) return angle*convraddeg + 90;
719  else return 0;
720 }
721 
722 ////////////////////////////////////////////////////////////////////////////////
723 /// return the number of entries to be processed
724 /// this function checks that nentries is not bigger than the number
725 /// of entries in the Tree or in the associated TEventlist
726 
728 {
729  Long64_t lastentry = firstentry + nentries - 1;
730  if (lastentry > fTree->GetEntriesFriend()-1) {
731  lastentry = fTree->GetEntriesFriend() - 1;
732  nentries = lastentry - firstentry + 1;
733  }
734  //TEventList *elist = fTree->GetEventList();
735  //if (elist && elist->GetN() < nentries) nentries = elist->GetN();
736  TEntryList *elist = fTree->GetEntryList();
737  if (elist && elist->GetN() < nentries) nentries = elist->GetN();
738  return nentries;
739 }
740 
741 ////////////////////////////////////////////////////////////////////////////////
742 /// Go to a specified entry.
743 
745 {
746  if(e<fFirstEntry || e+fTree->GetScanField()>=fFirstEntry + fNentries) return;
747  fEntry = e;
749 }
750 
751 ////////////////////////////////////////////////////////////////////////////////
752 /// Go to the next entries.
753 
755 {
759 }
760 
761 ////////////////////////////////////////////////////////////////////////////////
762 /// Go to the previous entries.
763 
765 {
767  else fEntry -= fTree->GetScanField();
769 }
770 
771 ////////////////////////////////////////////////////////////////////////////////
772 /// Go to the next entry.
773 
775 {
776  if(fEntry + fTree->GetScanField() >= fFirstEntry + fNentries) return;
777  ++fEntry;
779 }
780 
781 ////////////////////////////////////////////////////////////////////////////////
782 /// Go to the last entry.
783 
785 {
786  if(fEntry - 1 < fFirstEntry) return;
787  --fEntry;
789 }
790 
791 ////////////////////////////////////////////////////////////////////////////////
792 /// Check if the arrays size is enough and reallocate them if not.
793 
795 {
796  if(newsize>fArraySize){
797 
798  Int_t i;
799  Int_t old = fArraySize;
800 
801  while(fArraySize<newsize) fArraySize*=2;
802 
803  Double_t *memmax = new Double_t[fArraySize];
804  Double_t *memmin = new Double_t[fArraySize];
805  Double_t *memave = new Double_t[fArraySize];
806 
807  for(i=0;i<fArraySize;++i){
808  if(i<old){
809  memmax[i] = fMax[i];
810  memmin[i] = fMin[i];
811  memave[i] = fAve[i];
812  } else {
813  memmax[i] = -DBL_MAX;
814  memmin[i] = DBL_MAX;
815  memave[i] = 0;
816  }
817  }
818 
819  delete [] fMax;
820  delete [] fMin;
821  delete [] fAve;
822 
823  fMax = memmax;
824  fMin = memmin;
825  fAve = memave;
826  }
827 }
828 
829 ////////////////////////////////////////////////////////////////////////////////
830 /// Browse the tree to set the min, max and average value of each variable of fVar.
831 
833 {
834  UInt_t ui=0;
835  Int_t i;
836 
837  fMax = new Double_t [fArraySize];
838  fMin= new Double_t [fArraySize];
839  fAve= new Double_t [fArraySize];
840 
841  for(i=0;i<fArraySize;++i){
842  fMax[i]= -DBL_MAX;
843  fMin[i]= DBL_MAX;
844  fAve[i]=0;
845  }
846 
847  Long64_t notSkipped=0;
848  Int_t tnumber=-1;
849  Long64_t entryNumber;
850  Long64_t entry = firstentry;
851  Int_t entriesToDisplay = nentries;
852  while(entriesToDisplay!=0){
853  entryNumber = fTree->GetEntryNumber(entry);
854  if(entryNumber < 0) break;
855  Long64_t localEntry = fTree->LoadTree(entryNumber);
856  if(localEntry < 0) break;
857  if(tnumber != fTree->GetTreeNumber()) {
858  tnumber = fTree->GetTreeNumber();
860  else {
861  for(i=0;i<=fFormulas->LastIndex();++i)
862  ((TTreeFormula*)fFormulas->At(i))->UpdateFormulaLeaves();
863  }
864  }
865  Int_t ndata=1;
866  if(fForceDim){
867  if(fManager)
868  ndata = fManager->GetNdata(kTRUE);
869  else {
870  for(ui=0;ui<fNcols;++ui){
871  if(ndata<((TTreeFormula*)fFormulas->At(ui))->GetNdata())
872  ndata = ((TTreeFormula*)fFormulas->At(ui))->GetNdata();
873  }
874  if(fSelect && fSelect->GetNdata() == 0)
875  ndata = 0;
876  }
877  }
878  Bool_t loaded = kFALSE;
879  Bool_t skip = kFALSE;
880  // Loop over the instances of the selection condition
881  for(Int_t inst=0;inst<ndata;++inst){
882  if(fSelect){
883  if(fSelect->EvalInstance(inst) == 0){
884  skip = kTRUE;
885  ++entry;
886  }
887  }
888  if (!loaded) {
889  // EvalInstance(0) always needs to be called so that
890  // the proper branches are loaded.
891  for (ui=0;ui<fNcols;ui++) {
892  ((TTreeFormula*)fFormulas->At(ui))->EvalInstance(0);
893  }
894  loaded = kTRUE;
895  } else if (inst == 0) {
896  loaded = kTRUE;
897  }
898  }
899  if(!skip){
900  fTree->LoadTree(entryNumber);
901  for(ui=0;ui<fNcols;++ui){
902  Double_t inst = ((TTreeFormula*)fFormulas->At(ui))->EvalInstance();
903  if(inst > fMax[ui]) fMax[ui] = inst;
904  if(inst < fMin[ui]) fMin[ui] = inst;
905  fAve[ui] += inst;
906  }
907  ++notSkipped;
908  --entriesToDisplay;
909  ++entry;
910  }
911  }
912  if (notSkipped) {for(ui=0;ui<fNcols;++ui) fAve[ui]/=notSkipped;}
913 }
914 
915 ////////////////////////////////////////////////////////////////////////////////
916 /// Paint the spider.
917 
918 void TSpider::Paint(Option_t* options)
919 {
920  UInt_t ui=0;
921  TString opt = options;
922 
923  if(opt.Contains("n")) return;
924 
925  Double_t slice = 2*TMath::Pi()/fNcols;
926  Double_t offset(1.0);
927  if (!fCanvas) {
928  if (gPad) fCanvas = gPad->GetCanvas();
929  else return;
930  }
931 
932  TLatex *txt = new TLatex();
933  for(ui=0;ui<fNx*fNy;++ui){
934  txt->SetTextAlign(13);
935  if (fCanvas) fCanvas->cd(ui+1);
936  if (fCurrentEntries) {
937  txt->PaintLatex(-1.2,1.2,0,0.08,Form("#%d",(int)fCurrentEntries[ui]));
938  }
939  txt->SetTextSize(0.035);
940  for(UInt_t var=0;var<fNcols;++var){ // Print labels.
941  if(ui==0){
942  txt->SetTextAlign(FindTextAlign(var*slice));
943  offset = 1.09 + txt->GetTextSize();
944  txt->PaintLatex(offset*TMath::Cos(var*slice),offset*TMath::Sin(var*slice),
945  FindTextAngle(var*slice),0.035,fFormulas->At(var)->GetTitle());
946  offset= 1.03;
947  txt->PaintLatex(offset*TMath::Cos(var*slice),offset*TMath::Sin(var*slice),
948  FindTextAngle(var*slice),0.035,Form("[%5.3f,%5.3f]",fMin[var],fMax[var]));
949  }
950  else {
951  txt->SetTextAlign(FindTextAlign(var*slice));
952  if(var*slice >=0 && var*slice <= TMath::Pi()) offset =1.13 + txt->GetTextSize();
953  else offset = 1.09 + txt->GetTextSize();
954  txt->PaintLatex(offset*TMath::Cos(var*slice),offset*TMath::Sin(var*slice),
955  FindTextAngle(var*slice),0.035,fFormulas->At(var)->GetTitle());
956  }
957  }
958  }
959  delete txt;
960 }
961 
962 ////////////////////////////////////////////////////////////////////////////////
963 /// Set the LineStyle of the average.
964 
966 {
967  UInt_t ui=0;
968 
969  if(fAverageSlices){
970  for(ui=0;ui<fNcols;++ui) fAverageSlices[ui]->SetLineStyle(sty);
971  } else if(fAveragePoly) fAveragePoly->SetLineStyle(sty);
972 }
973 
974 ////////////////////////////////////////////////////////////////////////////////
975 /// Set the LineColor of the average.
976 
978 {
979  UInt_t ui=0;
980 
981  if(fAverageSlices){
982  for(ui=0;ui<fNcols;++ui) fAverageSlices[ui]->SetLineColor(col);
983  } else if(fAveragePoly) fAveragePoly->SetLineColor(col);
984 }
985 
986 ////////////////////////////////////////////////////////////////////////////////
987 /// Set the LineWidth of the average.
988 
990 {
991  UInt_t ui=0;
992 
993  if(fAverageSlices){
994  for(ui=0;ui<fNcols;++ui) fAverageSlices[ui]->SetLineWidth(wid);
995  } else if(fAveragePoly) fAveragePoly->SetLineWidth(wid);
996 }
997 
998 ////////////////////////////////////////////////////////////////////////////////
999 /// Set the Fill Color of the average.
1000 
1002 {
1003  UInt_t ui=0;
1004 
1005  if(fAverageSlices){
1006  for(ui=0;ui<fNcols;++ui) fAverageSlices[ui]->SetFillColor(col);
1007  } else if(fAveragePoly) fAveragePoly->SetFillColor(col);
1008 }
1009 
1010 ////////////////////////////////////////////////////////////////////////////////
1011 /// Set the FillStyle of the average.
1012 
1014 {
1015  UInt_t ui=0;
1016 
1017  if(fAverageSlices){
1018  for(ui=0;ui<fNcols;++ui) fAverageSlices[ui]->SetFillStyle(sty);
1019  } else if(fAveragePoly) fAveragePoly->SetFillStyle(sty);
1020 }
1021 
1022 ////////////////////////////////////////////////////////////////////////////////
1023 /// Display or not the average.
1024 
1026 {
1027  if(disp == fDisplayAverage) return;
1028 
1029  UInt_t ui=0;
1030 
1031  fDisplayAverage = disp;
1032  delete fAveragePoly;
1033  fAveragePoly = NULL;
1034  if(fAverageSlices){
1035  for(ui = 0;ui<fNcols;++ui) delete fAverageSlices[ui];
1036  }
1037  delete [] fAverageSlices;
1038  fAverageSlices = NULL;
1039 
1040  for(ui=0;ui<fNx*fNy;++ui){
1041  if (fCanvas) fCanvas->cd(ui+1);
1042  gPad->Clear();
1043  }
1044 
1045  for(ui = 0; ui < fNx*fNy; ++ui){
1046  if (fCanvas) fCanvas->cd(ui+1);
1047  fPolargram->Draw("pn");
1049  if(fSegmentDisplay){
1050  if(disp) DrawSlicesAverage("");
1051  DrawSlices("");
1052  } else {
1053  if(disp) DrawPolyAverage("");
1054  DrawPoly("");
1055  }
1056  AppendPad();
1057  }
1058  if (fCanvas) {
1059  fCanvas->Modified();
1060  fCanvas->Update();
1061  }
1062 }
1063 
1064 ////////////////////////////////////////////////////////////////////////////////
1065 /// Set the current selected entries.
1066 
1068 {
1069  Int_t i;
1070  UInt_t ui=0;
1071  Int_t tnumber=-1;
1072  Long64_t entryNumber;
1073  Long64_t entry = fEntry;
1074  Int_t entriesToDisplay = fTree->GetScanField();
1075 
1077 
1078  while(entriesToDisplay!=0){
1079  entryNumber = fTree->GetEntryNumber(entry);
1080  if(entryNumber < 0) break;
1081  Long64_t localEntry = fTree->LoadTree(entryNumber);
1082  if(localEntry < 0) break;
1083  if(tnumber != fTree->GetTreeNumber()) {
1084  tnumber = fTree->GetTreeNumber();
1086  else {
1087  for(i=0;i<=fFormulas->LastIndex();++i)
1088  ((TTreeFormula*)fFormulas->At(i))->UpdateFormulaLeaves();
1089  }
1090  }
1091  Int_t ndata=1;
1092  if(fForceDim){
1093  if(fManager)
1094  ndata = fManager->GetNdata(kTRUE);
1095  else {
1096  for(ui=0;ui<fNcols;++ui){
1097  if(ndata < ((TTreeFormula*)fFormulas->At(ui))->GetNdata())
1098  ndata = ((TTreeFormula*)fFormulas->At(ui))->GetNdata();
1099  }
1100  if(fSelect && fSelect->GetNdata() == 0)
1101  ndata = 0;
1102  }
1103  }
1104  Bool_t loaded = kFALSE;
1105  Bool_t skip = kFALSE;
1106  // Loop over the instances of the selection condition
1107  for(Int_t inst=0;inst<ndata;++inst){
1108  if(fSelect){
1109  if(fSelect->EvalInstance(inst) == 0){
1110  skip = kTRUE;
1111  ++entry;
1112  }
1113  }
1114  if (!loaded) {
1115  // EvalInstance(0) always needs to be called so that
1116  // the proper branches are loaded.
1117  for (ui=0;ui<fNcols;ui++) {
1118  ((TTreeFormula*)fFormulas->At(ui))->EvalInstance(0);
1119  }
1120  loaded = kTRUE;
1121  } else if (inst == 0) {
1122  loaded = kTRUE;
1123  }
1124  }
1125  if(!skip){
1126  fCurrentEntries[fTree->GetScanField()-entriesToDisplay] = entryNumber;
1127  --entriesToDisplay;
1128  ++entry;
1129  }
1130  }
1131  if(fPolyList) UpdateView();
1132 }
1133 
1134 ////////////////////////////////////////////////////////////////////////////////
1135 /// Set line style.
1136 
1138 {
1139  UInt_t ui=0;
1140 
1142  for(ui=0; ui<fNx*fNy;++ui){
1143  if(fSegmentDisplay){
1144  TList *li = (TList*)fPolyList->At(ui);
1145  for(UInt_t var=0;var<fNcols;++var) ((TArc*)li->At(var))->SetLineStyle(sty);
1146  } else ((TPolyLine*)fPolyList->At(ui))->SetLineStyle(sty);
1147  }
1148 }
1149 
1150 ////////////////////////////////////////////////////////////////////////////////
1151 /// Set lin color.
1152 
1154 {
1155  UInt_t ui=0;
1156 
1158  for(ui=0; ui<fNx*fNy;++ui){
1159  if(fSegmentDisplay){
1160  TList *li = (TList*)fPolyList->At(ui);
1161  for(UInt_t var=0;var<fNcols;++var) ((TArc*)li->At(var))->SetLineColor(col);
1162  } else ((TPolyLine*)fPolyList->At(ui))->SetLineColor(col);
1163  }
1164 }
1165 
1166 ////////////////////////////////////////////////////////////////////////////////
1167 ///Set line width.
1168 
1170 {
1171  UInt_t ui=0;
1172 
1174  for(ui=0; ui<fNx*fNy;++ui){
1175  if(fSegmentDisplay){
1176  TList *li = (TList*)fPolyList->At(ui);
1177  for(UInt_t var=0;var<fNcols;++var) ((TArc*)li->At(var))->SetLineWidth(wid);
1178  } else ((TPolyLine*)fPolyList->At(ui))->SetLineWidth(wid);
1179  }
1180 }
1181 
1182 ////////////////////////////////////////////////////////////////////////////////
1183 /// Set fill color.
1184 
1186 {
1187  UInt_t ui=0;
1188 
1190  for(ui=0; ui<fNx*fNy;++ui){
1191  if(fSegmentDisplay){
1192  TList *li = (TList*)fPolyList->At(ui);
1193  for(UInt_t var=0;var<fNcols;++var) ((TArc*)li->At(var))->SetFillColor(col);
1194  } else ((TPolyLine*)fPolyList->At(ui))->SetFillColor(col);
1195  }
1196 }
1197 
1198 ////////////////////////////////////////////////////////////////////////////////
1199 /// Set fill style.
1200 
1202 {
1203  UInt_t ui=0;
1204 
1206  for(ui=0; ui<fNx*fNy;++ui){
1207  if(fSegmentDisplay){
1208  TList *li = (TList*)fPolyList->At(ui);
1209  for(UInt_t var=0;var<fNcols;++var) ((TArc*)li->At(var))->SetFillStyle(sty);
1210  } else ((TPolyLine*)fPolyList->At(ui))->SetFillStyle(sty);
1211  }
1212 }
1213 
1214 ////////////////////////////////////////////////////////////////////////////////
1215 /// Set number of radial divisions.
1216 
1218 {
1219  if(fPolargram->GetNdivRadial() == ndiv) return;
1220  fPolargram->SetNdivRadial(ndiv);
1221 }
1222 
1223 ////////////////////////////////////////////////////////////////////////////////
1224 /// Set the X number of sub pads.
1225 
1227 {
1228  if(fNx == nx || nx <= 0) return;
1229  fEntry = fCurrentEntries[0];
1230 
1231  UInt_t ui=0;
1232  Color_t lc;
1233  Style_t lt;
1234  Width_t lw;
1235  Color_t fc;
1236  Style_t fs;
1237  if(fAverageSlices){
1238  lc = fAverageSlices[0]->GetLineColor();
1239  lt = fAverageSlices[0]->GetLineStyle();
1240  lw = fAverageSlices[0]->GetLineWidth();
1241  fc = fAverageSlices[0]->GetFillColor();
1242  fs = fAverageSlices[0]->GetFillStyle();
1243  } else {
1244  lc = fAveragePoly->GetLineColor();
1245  lt = fAveragePoly->GetLineStyle();
1246  lw = fAveragePoly->GetLineWidth();
1248  fs = fAveragePoly->GetFillStyle();
1249  }
1250 
1251  if(fSegmentDisplay){
1252  for(ui=0; ui<fNx*fNy;++ui) ((TList*)fPolyList->At(ui))->Delete();
1253  }
1254  fPolyList->Delete();
1255  delete fPolyList;
1256  fPolyList = NULL;
1257  delete [] fCurrentEntries;
1258  fCurrentEntries = NULL;
1259 
1260  fNx = nx;
1261 
1264  if (fCanvas) {
1265  fCanvas->Clear();
1266  fCanvas->Divide(fNx,fNy);
1267  }
1268 
1269  for(ui=0; ui < fNx*fNy;++ui){
1270  if (fCanvas) fCanvas->cd(ui+1);
1271  fPolargram->Draw("pn");
1273  if(fSegmentDisplay){
1275  DrawSlices("");
1276  } else {
1278  DrawPoly("");
1279  }
1280  AppendPad();
1281  }
1282 
1283  if(fAverageSlices){
1284  for(ui = 0;ui<fNcols;++ui){
1285  fAverageSlices[ui]->SetLineColor(lc);
1286  fAverageSlices[ui]->SetLineStyle(lt);
1287  fAverageSlices[ui]->SetLineWidth(lw);
1289  fAverageSlices[ui]->SetFillStyle(fs);
1290  }
1291  } else {
1297  }
1298 }
1299 
1300 ////////////////////////////////////////////////////////////////////////////////
1301 /// Set the Y number of sub pads.
1302 
1304 {
1305  if(fNy == ny || ny <= 0) return;
1306  fEntry = fCurrentEntries[0];
1307 
1308  UInt_t ui=0;
1309  Color_t lc;
1310  Style_t lt;
1311  Width_t lw;
1312  Color_t fc;
1313  Style_t fs;
1314  if(fAverageSlices){
1315  lc = fAverageSlices[0]->GetLineColor();
1316  lt = fAverageSlices[0]->GetLineStyle();
1317  lw = fAverageSlices[0]->GetLineWidth();
1318  fc = fAverageSlices[0]->GetFillColor();
1319  fs = fAverageSlices[0]->GetFillStyle();
1320  } else {
1321  lc = fAveragePoly->GetLineColor();
1322  lt = fAveragePoly->GetLineStyle();
1323  lw = fAveragePoly->GetLineWidth();
1325  fs = fAveragePoly->GetFillStyle();
1326  }
1327 
1328  if(fSegmentDisplay){
1329  for(ui=0; ui<fNx*fNy;++ui) ((TList*)fPolyList->At(ui))->Delete();
1330  }
1331  fPolyList->Delete();
1332  delete fPolyList;
1333  fPolyList = NULL;
1334  delete [] fCurrentEntries;
1335  fCurrentEntries = NULL;
1336 
1337  fNy = ny;
1338 
1341  if (fCanvas) {
1342  fCanvas->Clear();
1343  fCanvas->Divide(fNx,fNy);
1344  }
1345 
1346  for(ui=0; ui < fNx*fNy;++ui){
1347  if (fCanvas) fCanvas->cd(ui+1);
1348  fPolargram->Draw("pn");
1350  if(fSegmentDisplay){
1352  DrawSlices("");
1353  } else {
1355  DrawPoly("");
1356  }
1357  AppendPad();
1358  }
1359 
1360  if(fAverageSlices){
1361  for(ui = 0;ui<fNcols;++ui){
1362  fAverageSlices[ui]->SetLineColor(lc);
1363  fAverageSlices[ui]->SetLineStyle(lt);
1364  fAverageSlices[ui]->SetLineWidth(lw);
1366  fAverageSlices[ui]->SetFillStyle(fs);
1367  }
1368  } else {
1374  }
1375 }
1376 
1377 ////////////////////////////////////////////////////////////////////////////////
1378 /// Set the segment display or not.
1379 
1381 {
1382  if(seg == fSegmentDisplay) return;
1383 
1384  UInt_t ui=0;
1385 
1386  if(fSegmentDisplay){
1387  for(ui=0;ui<fNx*fNy;++ui){
1388  ((TList*)fPolyList->At(ui))->Delete();
1389  }
1390  }
1391  fPolyList->Delete();
1392 
1393  Color_t lc = 1;
1394  Style_t lt = 1;
1395  Width_t lw = 1;
1396  Color_t fc = 1;
1397  Style_t fs = 0;
1398  if(fAverageSlices){
1399  lc = fAverageSlices[0]->GetLineColor();
1400  lt = fAverageSlices[0]->GetLineStyle();
1401  lw = fAverageSlices[0]->GetLineWidth();
1402  fc = fAverageSlices[0]->GetFillColor();
1403  fs = fAverageSlices[0]->GetFillStyle();
1404  } else {
1405  if (fAveragePoly) {
1406  lc = fAveragePoly->GetLineColor();
1407  lt = fAveragePoly->GetLineStyle();
1408  lw = fAveragePoly->GetLineWidth();
1410  fs = fAveragePoly->GetFillStyle();
1411  }
1412  }
1413 
1414  delete fPolyList;
1415  fPolyList = NULL;
1416  if(fAverageSlices){
1417  for(ui=0;ui<fNcols;++ui) delete fAverageSlices[ui];
1418  }
1419  delete [] fAverageSlices;
1420  fAverageSlices = NULL;
1421  delete fAveragePoly;
1422  fAveragePoly = NULL;
1423 
1424  for(ui=0;ui<fNx*fNy;++ui){
1425  if (fCanvas) fCanvas->cd(ui+1);
1426  gPad->Clear();
1427  }
1428 
1429  fSegmentDisplay = seg;
1430 
1431  for(ui=0; ui < fNx*fNy;++ui){
1432  if (fCanvas) fCanvas->cd(ui+1);
1433  fPolargram->Draw("pn");
1435  if(fSegmentDisplay){
1437  DrawSlices("");
1438  } else {
1440  DrawPoly("");
1441  }
1442  AppendPad();
1443  }
1444 
1445  if(fAverageSlices){
1446  for(ui=0;ui<fNcols;++ui){
1447  fAverageSlices[ui]->SetLineColor(lc);
1448  fAverageSlices[ui]->SetLineStyle(lt);
1449  fAverageSlices[ui]->SetLineWidth(lw);
1451  fAverageSlices[ui]->SetFillStyle(fs);
1452  }
1453  } else {
1454  if (fAveragePoly) {
1460  }
1461  }
1462  if (fCanvas) {
1463  fCanvas->Modified();
1464  fCanvas->Update();
1465  }
1466 }
1467 
1468 ////////////////////////////////////////////////////////////////////////////////
1469 /// Compile selection expression if there is one.
1470 
1471 void TSpider::SetSelectionExpression(const char* selection)
1472 {
1473  if (selection && strlen(selection)) {
1474  fSelect = new TTreeFormula("Selection",selection,fTree);
1475  // if (!fSelect) return -1;
1476  // if (!fSelect->GetNdim()) { delete fSelect; return -1; }
1477  fFormulas->Add(fSelect);
1478  }
1479 }
1480 
1481 ////////////////////////////////////////////////////////////////////////////////
1482 /// Compile the variables expression from the given string varexp.
1483 
1484 void TSpider::SetVariablesExpression(const char* varexp)
1485 {
1486  Int_t nch;
1487  fNcols=8;
1488 
1489  if (!varexp) return;
1490  TObjArray *leaves = fTree->GetListOfLeaves();
1491  UInt_t nleaves = leaves->GetEntriesFast();
1492  if (nleaves < fNcols) fNcols = nleaves;
1493  nch = strlen(varexp);
1494 
1495  // if varexp is empty, take first 8 columns by default
1496  Int_t allvar = 0;
1497  std::vector<TString> cnames;
1498  if (!strcmp(varexp, "*")) { fNcols = nleaves; allvar = 1; }
1499  if (nch == 0 || allvar) {
1500  UInt_t ncs = fNcols;
1501  fNcols = 0;
1502  for (UInt_t ui=0;ui<ncs;++ui) {
1503  TLeaf *lf = (TLeaf*)leaves->At(ui);
1504  if (lf->GetBranch()->GetListOfBranches()->GetEntries() > 0) continue;
1505  cnames.push_back(lf->GetName());
1506  fNcols++;
1507  }
1508  // otherwise select only the specified columns
1509  } else {
1510  fNcols = fSelector->SplitNames(varexp,cnames);
1511  }
1512 
1513  // Create the TreeFormula objects corresponding to each column
1514  for (UInt_t ui=0;ui<fNcols;ui++) {
1515  fFormulas->Add(new TTreeFormula("Var1",cnames[ui].Data(),fTree));
1516  }
1517 }
1518 
1519 ////////////////////////////////////////////////////////////////////////////////
1520 /// Create a TreeFormulaManager to coordinate the formulas.
1521 
1523 {
1524  Int_t i;
1525  if (fFormulas->LastIndex()>=0) {
1526  if (fSelect) {
1527  if (fSelect->GetManager()->GetMultiplicity() > 0 ) {
1529  for(i=0;i<=fFormulas->LastIndex();i++) {
1531  }
1532  fManager->Sync();
1533  }
1534  }
1535  for(i=0;i<=fFormulas->LastIndex();i++) {
1536  TTreeFormula *form = ((TTreeFormula*)fFormulas->At(i));
1537  switch( form->GetManager()->GetMultiplicity() ) {
1538  case 1:
1539  case 2:
1540  case -1:
1541  fForceDim = kTRUE;
1542  break;
1543  case 0:
1544  break;
1545  }
1546 
1547  }
1548  }
1549 }
1550 
1551 ////////////////////////////////////////////////////////////////////////////////
1552 /// Update the polylines or the arcs for the current entries.
1553 
1555 {
1556  Double_t slice = 2*TMath::Pi()/fNcols;
1557 
1558  Double_t x,y,r;
1559 
1560  for(UInt_t pad=1;pad <= fNx*fNy;++pad){
1561  fTree->LoadTree(fCurrentEntries[pad-1]);
1562  for(UInt_t i=0;i<fNcols;++i){
1563  r = (((TTreeFormula*)fFormulas->At(i))->EvalInstance()-fMin[i])/(fMax[i]-fMin[i]);
1564  x=r*TMath::Cos(i*slice);
1565  y=r*TMath::Sin(i*slice);
1566  if(!fSegmentDisplay) ((TPolyLine*)fPolyList->At(pad-1))->SetPoint(i,x,y);
1567  else {
1568  ((TArc*)((TList*)fPolyList->At(pad-1))->At(i))->SetR1(r);
1569  ((TArc*)((TList*)fPolyList->At(pad-1))->At(i))->SetR2(r);
1570  }
1571  }
1572  x=(((TTreeFormula*)fFormulas->At(0))->EvalInstance()-fMin[0])/(fMax[0]-fMin[0]);
1573  y=0;
1574  if(!fSegmentDisplay) ((TPolyLine*)fPolyList->At(pad-1))->SetPoint(fNcols,x,y);
1575  }
1576 }
TSpider::fSegmentDisplay
Bool_t fSegmentDisplay
Definition: TSpider.h:68
TPolyLine
Defined by an array on N points in a 2-D space.
Definition: TPolyLine.h:23
TTree::GetScanField
virtual Int_t GetScanField() const
Definition: TTree.h:506
TTree::GetEntriesFriend
virtual Long64_t GetEntriesFriend() const
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
Definition: TTree.cxx:5411
TSpider::GetAverageLineStyle
Style_t GetAverageLineStyle() const
Get the LineStyle of the average.
Definition: TSpider.cxx:617
TTreeFormulaManager::Sync
virtual Bool_t Sync()
Synchronize all the formulae.
Definition: TTreeFormulaManager.cxx:219
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
e
#define e(i)
Definition: RSha256.hxx:103
TSpider::Draw
virtual void Draw(Option_t *options="")
Draw the spider.
Definition: TSpider.cxx:454
Style_t
short Style_t
Definition: RtypesCore.h:80
TArc
Create an Arc.
Definition: TArc.h:26
TSpider::SetDisplayAverage
void SetDisplayAverage(Bool_t disp)
Display or not the average.
Definition: TSpider.cxx:1025
TObjArray
An array of TObjects.
Definition: TObjArray.h:37
TSpider::~TSpider
~TSpider()
Destructor.
Definition: TSpider.cxx:174
TAttFill::SetFillStyle
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition: TAttFill.h:39
Option_t
const char Option_t
Definition: RtypesCore.h:66
TTree::SetScanField
virtual void SetScanField(Int_t n=50)
Definition: TTree.h:637
TSpider::SetAverageFillColor
void SetAverageFillColor(Color_t col)
Set the Fill Color of the average.
Definition: TSpider.cxx:1001
fc
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:3728
gEnv
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
TMath::Cos
Double_t Cos(Double_t)
Definition: TMath.h:643
TSpider::DrawPolyAverage
void DrawPolyAverage(Option_t *options)
Paint the Polygon representing the average value of the variables.
Definition: TSpider.cxx:492
TSpider::SetVariablesExpression
void SetVariablesExpression(const char *varexp)
Compile the variables expression from the given string varexp.
Definition: TSpider.cxx:1484
TList::Delete
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:469
TCanvas::Selected
virtual void Selected(TVirtualPad *pad, TObject *obj, Int_t event)
Emit Selected() signal.
Definition: TCanvas.cxx:1637
tree
Definition: tree.py:1
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TPolyLine.h
TAttText.h
TSpider::DrawSlices
void DrawSlices(Option_t *options)
Draw the slices of the segment plot.
Definition: TSpider.cxx:560
TBranch::GetListOfBranches
TObjArray * GetListOfBranches()
Definition: TBranch.h:242
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TBranch.h
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TTree::GetEntryList
virtual TEntryList * GetEntryList()
Returns the entry list assigned to this tree.
Definition: TTree.cxx:5754
TTree
A TTree represents a columnar dataset.
Definition: TTree.h:79
TTreeFormula::GetManager
TTreeFormulaManager * GetManager() const
Definition: TTreeFormula.h:189
TTreeFormulaManager::Add
virtual void Add(TTreeFormula *)
Add a new formula to the list of formulas managed The manager of the formula will be changed and the ...
Definition: TTreeFormulaManager.cxx:71
TArc.h
TTreeFormula.h
TSpider::GotoFollowing
void GotoFollowing()
Go to the next entry.
Definition: TSpider.cxx:774
TSpider::fPolargram
TGraphPolargram * fPolargram
Definition: TSpider.h:61
TSpider::SetNdivRadial
void SetNdivRadial(Int_t div)
Set number of radial divisions.
Definition: TSpider.cxx:1217
TObject::AppendPad
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition: TObject.cxx:107
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
TSeqCollection::LastIndex
Int_t LastIndex() const
Definition: TSeqCollection.h:55
TAttText::SetTextSize
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition: TAttText.h:46
TSpider::SetNy
void SetNy(UInt_t ny)
Set the Y number of sub pads.
Definition: TSpider.cxx:1303
TObjArray::GetEntries
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:523
TSpider::FindTextAngle
Double_t FindTextAngle(Double_t theta)
Determine the orientation of the polar labels according to their angle.
Definition: TSpider.cxx:705
x
Double_t x[n]
Definition: legend1.C:17
TSpider::GotoPreceding
void GotoPreceding()
Go to the last entry.
Definition: TSpider.cxx:784
TSpider::SetAverageLineColor
void SetAverageLineColor(Color_t col)
Set the LineColor of the average.
Definition: TSpider.cxx:977
TList.h
TSpider::SetSegmentDisplay
void SetSegmentDisplay(Bool_t seg)
Set the segment display or not.
Definition: TSpider.cxx:1380
TLatex
To draw Mathematical Formula.
Definition: TLatex.h:18
nentries
int nentries
Definition: THbookFile.cxx:91
TSpider::fAveragePoly
TPolyLine * fAveragePoly
Definition: TSpider.h:55
TCanvas::Clear
void Clear(Option_t *option="")
Remove all primitives from the canvas.
Definition: TCanvas.cxx:723
TSpider::SetCurrentEntries
void SetCurrentEntries()
Set the current selected entries.
Definition: TSpider.cxx:1067
TPad::Divide
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
Definition: TPad.cxx:1166
TAttLine::SetLineColor
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
TAttText::GetTextSize
virtual Float_t GetTextSize() const
Return the text size.
Definition: TAttText.h:36
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TObject::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:403
TCanvas.h
TGraphPolargram::SetNdivPolar
void SetNdivPolar(Int_t Ndiv=508)
Set the number of Polar divisions: enter a number ij with 0<i<99 and 0<j<99.
Definition: TGraphPolargram.cxx:773
TEnv.h
TSpider::DrawSlicesAverage
void DrawSlicesAverage(Option_t *options)
Draw the slices representing the average for the segment plot.
Definition: TSpider.cxx:586
TSpider::fCurrentEntries
Long64_t * fCurrentEntries
Definition: TSpider.h:49
TString
Basic string class.
Definition: TString.h:136
TSpider::fMin
Double_t * fMin
Definition: TSpider.h:52
TSpider::GetAverageLineWidth
Width_t GetAverageLineWidth() const
Get the LineWidth of the average.
Definition: TSpider.cxx:637
TSpider::AddVariable
void AddVariable(const char *varexp)
Add a variable to the plot from its expression.
Definition: TSpider.cxx:215
Color_t
short Color_t
Definition: RtypesCore.h:83
TSpider::SetAverageFillStyle
void SetAverageFillStyle(Style_t sty)
Set the FillStyle of the average.
Definition: TSpider.cxx:1013
TSpider::SetAverageLineWidth
void SetAverageLineWidth(Width_t wid)
Set the LineWidth of the average.
Definition: TSpider.cxx:989
TTree::GetEntryNumber
virtual Long64_t GetEntryNumber(Long64_t entry) const
Return entry number corresponding to entry.
Definition: TTree.cxx:5765
TSpider::fAverageSlices
TArc ** fAverageSlices
Definition: TSpider.h:56
TSpider::fMax
Double_t * fMax
Definition: TSpider.h:51
TSpider::fNcols
UInt_t fNcols
Definition: TSpider.h:44
bool
TGraphPolargram::SetNdivRadial
void SetNdivRadial(Int_t Ndiv=508)
Set the number of radial divisions: enter a number ij with 0<i<99 and 0<j<99.
Definition: TGraphPolargram.cxx:785
TSpider::SetAverageLineStyle
void SetAverageLineStyle(Style_t sty)
Set the LineStyle of the average.
Definition: TSpider.cxx:965
TSpider::fFormulas
TList * fFormulas
Pointer to the mother pad.
Definition: TSpider.h:58
TNtuple.h
TROOT.h
TEllipse::Draw
virtual void Draw(Option_t *option="")
Draw this ellipse with its current attributes.
Definition: TEllipse.cxx:168
TPad::Modified
void Modified(Bool_t flag=1)
Definition: TPad.h:414
TAttLine.h
TList::At
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:356
TPolyLine::Draw
virtual void Draw(Option_t *option="")
Draw this polyline with its current attributes.
Definition: TPolyLine.cxx:228
TSpider::fArraySize
Int_t fArraySize
Definition: TSpider.h:45
TSpider::GotoEntry
void GotoEntry(Long64_t e)
Go to a specified entry.
Definition: TSpider.cxx:744
TSpider::SetLineStyle
virtual void SetLineStyle(Style_t sty)
Set line style.
Definition: TSpider.cxx:1137
TMath::Pi
constexpr Double_t Pi()
Definition: TMath.h:37
TTreeFormulaManager
Used to coordinate one or more TTreeFormula objects.
Definition: TTreeFormulaManager.h:30
TTreeFormula::GetNdata
virtual Int_t GetNdata()
Return number of available instances in the formula.
Definition: TTreeFormula.cxx:4444
TAttFill.h
TAttLine
Line Attributes class.
Definition: TAttLine.h:18
TSpider::InitVariables
void InitVariables(Long64_t firstentry, Long64_t nentries)
Browse the tree to set the min, max and average value of each variable of fVar.
Definition: TSpider.cxx:832
TSpider::SetLineColor
virtual void SetLineColor(Color_t col)
Set lin color.
Definition: TSpider.cxx:1153
TAttLine::GetLineColor
virtual Color_t GetLineColor() const
Return the line color.
Definition: TAttLine.h:33
TLeaf
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:57
TCanvas::cd
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:704
TTree::LoadTree
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
Definition: TTree.cxx:6371
TSpider::GetAverageLineColor
Color_t GetAverageLineColor() const
Get the LineColor of the average.
Definition: TSpider.cxx:627
TObjArray::GetEntriesFast
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TAttLine::GetLineStyle
virtual Style_t GetLineStyle() const
Return the line style.
Definition: TAttLine.h:34
Width_t
short Width_t
Definition: RtypesCore.h:82
TSpider::fTree
TTree * fTree
Definition: TSpider.h:54
TTreeFormulaManager.h
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TSpider
Spider class.
Definition: TSpider.h:40
TTreeFormula::EvalInstance
T EvalInstance(Int_t i=0, const char *stringStack[]=0)
Evaluate this treeformula.
Definition: TTreeFormula.cxx:3936
TTreeFormulaManager::UpdateFormulaLeaves
virtual void UpdateFormulaLeaves()
This function could be called TTreePlayer::UpdateFormulaLeaves, itself called by TChain::LoadTree whe...
Definition: TTreeFormulaManager.cxx:291
TSpider::fEntry
Long64_t fEntry
Definition: TSpider.h:46
TSpider::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute the distance to the spider.
Definition: TSpider.cxx:439
TSelectorDraw::SplitNames
virtual UInt_t SplitNames(const TString &varexp, std::vector< TString > &names)
Build Index array for names in varexp.
Definition: TSelectorDraw.cxx:1125
TSpider::fInput
TList * fInput
Definition: TSpider.h:59
TTreeFormula
Used to pass a selection expression to the Tree drawing routine.
Definition: TTreeFormula.h:58
TSelector::SetInputList
virtual void SetInputList(TList *input)
Definition: TSelector.h:66
TMath::Sin
Double_t Sin(Double_t)
Definition: TMath.h:639
TSpider::UpdateView
void UpdateView()
Update the polylines or the arcs for the current entries.
Definition: TSpider.cxx:1554
TVirtualPad.h
TTreeFormulaManager::GetNdata
virtual Int_t GetNdata(Bool_t forceLoadDim=kFALSE)
Return number of available instances in the formulas.
Definition: TTreeFormulaManager.cxx:122
TSpider::fShowRange
Bool_t fShowRange
Definition: TSpider.h:69
TSpider::FindTextAlign
Int_t FindTextAlign(Double_t theta)
Find the alignement rule to apply for TText::SetTextAlign(Short_t).
Definition: TSpider.cxx:676
TAttFill::GetFillStyle
virtual Style_t GetFillStyle() const
Return the fill area style.
Definition: TAttFill.h:31
y
Double_t y[n]
Definition: legend1.C:17
TTree::GetTreeNumber
virtual Int_t GetTreeNumber() const
Definition: TTree.h:514
TSpider::SyncFormulas
void SyncFormulas()
Create a TreeFormulaManager to coordinate the formulas.
Definition: TSpider.cxx:1522
TSpider::fNy
UInt_t fNy
Definition: TSpider.h:43
TTreeFormulaManager::GetMultiplicity
virtual Int_t GetMultiplicity() const
Definition: TTreeFormulaManager.h:66
TSpider::AddSuperposed
void AddSuperposed(TSpider *sp)
Allow to superpose several spider views.
Definition: TSpider.cxx:206
TSpider::fSuperposed
TList * fSuperposed
Definition: TSpider.h:53
TSpider::fCanvas
TCanvas * fCanvas
Average slices.
Definition: TSpider.h:57
TSpider::SetLineWidth
virtual void SetLineWidth(Width_t wid)
Set line width.
Definition: TSpider.cxx:1169
kHand
@ kHand
Definition: GuiTypes.h:373
unsigned int
TGraphPolargram::Draw
void Draw(Option_t *options="")
Draw Polargram.
Definition: TGraphPolargram.cxx:181
TEntryList
A List of entry numbers in a TTree or TChain.
Definition: TEntryList.h:26
TAttLine::SetLineWidth
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
TSpider::GetEntriesToProcess
Long64_t GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const
return the number of entries to be processed this function checks that nentries is not bigger than th...
Definition: TSpider.cxx:727
TLeaf::GetBranch
TBranch * GetBranch() const
Definition: TLeaf.h:115
TAttText::SetTextAlign
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition: TAttText.h:41
TSpider::fForceDim
Bool_t fForceDim
Definition: TSpider.h:67
TSpider::SetNx
void SetNx(UInt_t nx)
Set the X number of sub pads.
Definition: TSpider.cxx:1226
Double_t
double Double_t
Definition: RtypesCore.h:59
TSpider::fDisplayAverage
Bool_t fDisplayAverage
Definition: TSpider.h:66
TSelectorDraw.h
TList::AddAfter
virtual void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
Definition: TList.cxx:249
TCanvas
The Canvas class.
Definition: TCanvas.h:23
TGeant4Unit::pi
static constexpr double pi
Definition: TGeant4SystemOfUnits.h:67
TLatex.h
TList::Remove
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
TGraphPolargram
To draw polar axis.
Definition: TGraphPolargram.h:20
TSpider::GotoPrevious
void GotoPrevious()
Go to the previous entries.
Definition: TSpider.cxx:764
TGraphPolargram::GetNdivRadial
Int_t GetNdivRadial()
Definition: TGraphPolargram.h:88
TSpider::fNentries
Long64_t fNentries
Definition: TSpider.h:47
TLatex::PaintLatex
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
Definition: TLatex.cxx:2051
TGraphPolargram.h
TSpider::SetFillStyle
virtual void SetFillStyle(Style_t sty)
Set fill style.
Definition: TSpider.cxx:1201
TSpider::GotoNext
void GotoNext()
Go to the next entries.
Definition: TSpider.cxx:754
TAttFill::SetFillColor
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
TSpider::TSpider
TSpider()
Default constructor.
Definition: TSpider.cxx:76
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TEntryList.h
TSpider::fAve
Double_t * fAve
[fNx*fNy] current selected entries;
Definition: TSpider.h:50
TCanvas::Update
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2500
TSpider::ExecuteEvent
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute the corresponding event.
Definition: TSpider.cxx:667
TSpider::GetAverageFillStyle
Style_t GetAverageFillStyle() const
Get the FillStyle of the average.
Definition: TSpider.cxx:657
TObject::Delete
virtual void Delete(Option_t *option="")
Delete this object.
Definition: TObject.cxx:171
TSpider::InitArrays
void InitArrays(Int_t newsize)
Check if the arrays size is enough and reallocate them if not.
Definition: TSpider.cxx:794
TSpider::fSelector
TSelectorDraw * fSelector
Definition: TSpider.h:64
gPad
#define gPad
Definition: TVirtualPad.h:287
TAttFill::GetFillColor
virtual Color_t GetFillColor() const
Return the fill area color.
Definition: TAttFill.h:30
ROOT::v5::TFormula::GetNdim
virtual Int_t GetNdim() const
Definition: TFormula.h:237
TSpider::fFirstEntry
Long64_t fFirstEntry
Definition: TSpider.h:48
TEnv::SetValue
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=0)
Set the value of a resource or create a new resource.
Definition: TEnv.cxx:736
TSpider::SetSelectionExpression
void SetSelectionExpression(const char *selexp)
Compile selection expression if there is one.
Definition: TSpider.cxx:1471
TAttFill
Fill Area Attributes class.
Definition: TAttFill.h:19
TAttLine::GetLineWidth
virtual Width_t GetLineWidth() const
Return the line width.
Definition: TAttLine.h:35
TSpider::fNx
UInt_t fNx
Definition: TSpider.h:42
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TSpider::DrawPoly
void DrawPoly(Option_t *options)
Paint the polygon representing the current entry.
Definition: TSpider.cxx:530
TSpider.h
TSpider::SetFillColor
virtual void SetFillColor(Color_t col)
Set fill color.
Definition: TSpider.cxx:1185
TSpider::Paint
virtual void Paint(Option_t *options)
Paint the spider.
Definition: TSpider.cxx:918
TAttLine::SetLineStyle
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition: TAttLine.h:42
TSpider::fManager
TTreeFormulaManager * fManager
Definition: TSpider.h:60
TSpider::GetAverageFillColor
Color_t GetAverageFillColor() const
Get the Fill Color of the average.
Definition: TSpider.cxx:647
TTree::GetListOfLeaves
virtual TObjArray * GetListOfLeaves()
Definition: TTree.h:484
TEntryList::GetN
virtual Long64_t GetN() const
Definition: TEntryList.h:75
TSpider::fSelect
TTreeFormula * fSelect
Definition: TSpider.h:63
TList
A doubly linked list.
Definition: TList.h:44
TSelectorDraw
A specialized TSelector for TTree::Draw.
Definition: TSelectorDraw.h:33
TSpider::DeleteVariable
void DeleteVariable(const char *varexp)
Delete a variable from its expression.
Definition: TSpider.cxx:353
TMath.h
gROOT
#define gROOT
Definition: TROOT.h:406
TSpider::fPolyList
TList * fPolyList
Definition: TSpider.h:62
int
TSpider::fAngularLabels
Bool_t fAngularLabels
Selector.
Definition: TSpider.h:65