]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muondep/AliAnalysisMuMuGraphUtil.h
move track selection differences from AOD and ESD to corresponding reader
[u/mrichter/AliRoot.git] / PWG / muondep / AliAnalysisMuMuGraphUtil.h
1 #ifndef ALIANALYSISMUMUGRAPHUTIL_H
2 #define ALIANALYSISMUMUGRAPHUTIL_H
3
4 #ifndef ROOT_TObject
5 #  include "TObject.h"
6 #endif
7
8 #include <vector>
9 #include <string>
10 #include <set>
11
12 class TGraph;
13 class TGraphErrors;
14 class TCanvas;
15 class TObjArray;
16
17 #include "TAttFill.h"
18 #include "TAttMarker.h"
19 #include "TAttLine.h"
20 #include "TAttAxis.h"
21 #include "TString.h"
22
23 class AliAnalysisMuMuGraphUtil : public TObject
24 {
25 public:
26   
27   AliAnalysisMuMuGraphUtil(const char* ocdbpath="raw://");
28   virtual ~AliAnalysisMuMuGraphUtil() {}
29
30   static TGraphErrors* Combine(TObjArray& graph, Bool_t compact);
31   
32   static void Compact(TGraph& g);
33   
34   void DefaultStyle();
35
36   TCanvas* DrawWith2Scales(TGraph& g1, TGraph& g2, const char* canvasName="c1");
37
38   static Int_t GetRunNumber(const TGraph& g, Int_t i);
39
40   void GetRuns(std::set<int>& runs, TGraph& graph) const;
41
42   static Bool_t IsCompact(TGraph& g);
43   
44   void PlotSameWithLegend(TObjArray& a, Double_t ymin, Double_t ymax) const;
45
46   void ShouldDrawPeriods(Bool_t value) { fShouldDrawPeriods = value; }
47
48   void StyleGraph(TGraph& graph, UInt_t index) const;
49   
50   static void UnCompact(TGraph& g);
51   
52   static void GetYMinAndMax(TGraph& g, Double_t& ymin, Double_t& ymax);
53   
54   static TGraph* RelDif(TGraph& ga, TGraph& gb);
55
56   
57 private:
58   AliAnalysisMuMuGraphUtil(const AliAnalysisMuMuGraphUtil& rhs); // not implemented
59   AliAnalysisMuMuGraphUtil& operator=(const AliAnalysisMuMuGraphUtil& rhs); // not implemented
60
61   TString fOCDBPath; // OCDB path
62
63   std::vector<TAttLine> fAttLine; // line attributes
64   std::vector<TAttMarker> fAttMarker; // marker attributes
65   std::vector<TAttFill> fAttFill; // fill attributes
66   std::vector<TAttAxis> fAttXaxis; // x-axis attributes
67   std::vector<TAttAxis> fAttYaxis; // y-axis attributes
68   std::vector<std::string> fDrawOptions; // draw options
69   
70   Bool_t fShouldDrawPeriods; // draw period names on top of graphs
71   
72   ClassDef(AliAnalysisMuMuGraphUtil,0) // utility class to modify/plot graphs
73 };
74
75 #endif