]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/GammaConv/AliGammaConversionHistograms.h
memory leak fixed
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / AliGammaConversionHistograms.h
1 #ifndef ALIGAMMACONVERSIONHISTOGRAMS_H
2 #define ALIGAMMACONVERSIONHISTOGRAMS_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 // Class used to do analysis on conversion pairs
9 //---------------------------------------------
10 ////////////////////////////////////////////////
11
12 #include "TString.h"
13 #include "Riostream.h"
14 #include <vector>
15
16 class TMap;
17 class TList;
18 class TH1F;
19 class TH2F;
20
21 class AliGammaConversionHistograms{
22
23  public: 
24   
25   AliGammaConversionHistograms();                                                                  //constructor
26   AliGammaConversionHistograms(const AliGammaConversionHistograms & original);                     //copy constructor
27   AliGammaConversionHistograms & operator = (const AliGammaConversionHistograms & original);       //assignment operator
28   virtual ~AliGammaConversionHistograms();                                                         //virtual destructor
29   
30
31   //  TList * GetOutputContainer();
32   void GetOutputContainer(TList *fOutputContainer);
33   
34   Int_t GetRBin(Double_t radius) const;
35   Int_t GetPhiBin(Double_t phi) const;
36   Int_t GetZBin(Double_t radius) const;
37  
38   void InitializeMappingValues(Int_t nPhiHistograms, Int_t nRHistograms, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi);
39
40   void AddMappingHistograms(Int_t nPhiHistograms, Int_t nRHistograms,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle="");
41
42   /*
43    * Adds a TH1F histogram to the histogram map and create a key for it 
44    */
45   void AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle="");
46
47   /*
48    * Adds a TH2F histogram to the histogram map and create a key for it 
49    */
50   void AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle="", Int_t logAxis =-1);
51
52   /*
53    * Create a logx binning suitable for dEdx plots
54    */
55   Bool_t BinLogAxis(const char* name, Int_t dim);
56
57
58   /*
59    *  Adds a TH1F Table to the table map and create a key for it
60    */
61   void AddTable(TString tableName,TString tableTitle,Int_t nXBins, const char * axesLabel[]);
62     
63  /*
64   *  Adds a TH2F Table    
65   */  
66         
67   void AddTable(TString tableName,TString tableTitle,Int_t nXBins, const char * axesXLabel[],Int_t nYBins, const char* axesYLabel[]);
68
69
70   /*
71    * Fills a TH1F histogram with the given name with the given value 
72    */
73   void FillHistogram(TString histogramName, Double_t xValue) const;
74
75   /*
76    * Fills a TH2F histogram with the given name with the given value 
77    */
78   void FillHistogram(TString histogramName, Double_t xValue, Double_t yValue) const;
79
80   /*
81    * Fills a TH1F table with the given name with the given value
82    */                   
83   void FillTable(TString tableName, Double_t xValue) const;
84
85   /*  
86    *  Fills a TH2F table with the given name with the given value
87    */   
88   void FillTable(TString tableName, Double_t xValue, Double_t yValue) const;
89
90   /*
91    *Returns a pointer to the histogram associated with name.
92    */
93    TObject* GetValue(const TString& name);
94
95
96  private:
97   TMap* fHistogramMap; // histogram map
98   
99
100
101   Int_t fNPhiIndex; //phi index
102   Int_t fNRIndex; //r index
103   Int_t fNZIndex; //z index
104   //  Double_t fRBinLimits[8]; // Limits of the radius bins
105   Double_t fRBinLimits[14]; // Limits of the radius bins
106   Double_t fZBinLimits[13]; // Limits of the Z bins
107   Double_t fMinRadius; //min radius cut
108   Double_t fMaxRadius; //max radius cut
109   Double_t fDeltaR; // delta r
110   Double_t fMinPhi; //min phi
111   Double_t fMaxPhi; // max phi
112   Double_t fDeltaPhi;//delta phi
113
114   TList * fMappingContainer; //mapping container
115   TList * fBackgroundContainer; // background container
116   TList * fDebugContainer; // debug container
117   TList * fResolutionContainer; //resolution container
118   TList * fMatchContainer; //match container
119   TList * fESDContainer;//esd container
120   TList * fMCContainer; // MC container
121   TList * fTableContainer; // table container
122   TList * fOtherContainer; // other container
123
124   ClassDef(AliGammaConversionHistograms,3)
125 };
126
127
128 #endif
129
130
131