]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/AliTreeDraw.h
9ea3b81a17369287c78e6bc34622322f0faeca57
[u/mrichter/AliRoot.git] / PWG1 / AliTreeDraw.h
1 #ifndef ALITREEDRAW_H
2 #define ALITREEDRAW_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7
8 //////////////////////////////////////////////////////////////////////////////
9 //                          Class AliTreeDraw                               //
10 //                                                                          //
11 //   marian.ivanov@cern.ch                                                  //
12 //////////////////////////////////////////////////////////////////////////////
13
14
15
16 #include <TObject.h>
17 #include <TObjArray.h>
18
19 class TH1;
20 class TH1F;
21 class TH2F;
22 class TTree;
23
24 class AliTreeDraw: public TObject{
25 public:
26   AliTreeDraw();
27   ~AliTreeDraw(){;}
28   void SetTree(TTree *tree){fTree=tree;}
29   const TH1 * GetRes() const{ return (TH1*)fRes;}
30   const TH1 * GetMean() const{ return (TH1*)fMean;}
31   const TObjArray* GetPoints() const {return fPoints;}
32   void  ClearHisto();
33   void  ClearPoints(){if (fPoints) fPoints->Clear();}
34   //
35   TH1F * DrawXY(const char * chx, const char *chy, const char* selection, 
36                 const char * quality,Int_t nbins, Float_t minx, Float_t maxx, 
37                 Float_t miny, Float_t maxy, Int_t nBinsRes=30);
38   TH1F * DrawLogXY(const char * chx, const char *chy, const char* selection, 
39                    const char * quality, Int_t nbins,Float_t minx, Float_t maxx, 
40                    Float_t miny, Float_t maxy, Int_t nBinsRes=30); 
41   TH1F * Eff(const char *variable, const char* selection, const char * quality, 
42              Int_t nbins,Float_t min, Float_t max); 
43   TH1F * EffLog(const char *variable, const char* selection, const char * quality, 
44              Int_t nbins,Float_t min, Float_t max);
45   //
46   void   GetPoints3D(const char * label, const char * chpoints, const char* selection, TTree * tpoints, Int_t color=6, Float_t rmin=4.);
47
48  private: 
49   static void   AliLabelAxes(TH1* histo, const char* xAxisTitle, const char* yAxisTitle);
50   static Double_t* CreateLogBins(Int_t nBins, Double_t xMin, Double_t xMax);
51   static TH1F*  CreateEffHisto(TH1F* hGen, TH1F* hRec);
52   static TH1F*  CreateResHisto(TH2F* hRes2, TH1F **phMean, 
53                                 Bool_t drawBinFits = kTRUE,Bool_t overflowBinFits = kFALSE);
54
55   TTree * fTree;    //the tree for visualization - NOT OWNER
56   TH1F  * fRes;     //temporary histogram        - OWNER  
57   TH1F  * fMean;    //temporary histogram        - OWNER
58   TObjArray *fPoints;//                          - OWNER
59   ClassDef(AliTreeDraw,0)
60 };
61
62 #endif