]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.h
adding proper destructors and some small changes in analysis macro
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliSpectraAODHistoManager.h
1 #ifndef ALISPECTRAAODHISTOMANAGER_H
2 #define ALISPECTRAAODHISTOMANAGER_H
3
4 /*  See cxx source for full Copyright notice */
5
6 //-------------------------------------------------------------------------
7 //                      AliSpectraAODHistoManager
8 //
9 //
10 //
11 //
12 // Authors: Michele Floris, CERN, Philip Versteeg, UU, Redmer Bertens, UU
13 //-------------------------------------------------------------------------
14
15 class AliAODEvent;
16 class TH1F;
17 class TH2F;
18 class TH1;
19 class TH2;
20 //class TList;
21 #include "TNamed.h"
22 #include "TList.h"
23 #include "Histograms.h" // Change this file if you want to add an histogram
24 #include "HistogramNames.h" // generate this automatically running createNames.py 
25
26 namespace AliSpectraNameSpace
27 {
28
29    
30    enum AODParticleSpecies_t
31    {
32      kSpPion,
33      kSpKaon,
34      kSpProton,
35      kNSpecies,
36      kSpUndefined,
37    }; // Particle species used in plotting
38
39    extern const char * kParticleSpecies[];
40
41    enum AODHistoType_t
42    {
43      kHistPtGenTruePrimary,
44      kHistPtRecSigma,
45      kHistPtRecTrue,
46      kHistPtRecTruePrimary,
47      kHistPtRecSigmaPrimary,
48      kHistPtRecSigmaSecondaryMaterial,
49      kHistPtRecSigmaSecondaryWeakDecay,
50      kHistNSigTPC,
51      kHistNSigTOF,
52      kHistNSigTPCTOF,
53      kNHistoTypes
54    }; // Types of histos
55
56    enum AODCharge_t
57    {
58        kChPos = 0,
59        kChNeg,
60        kNCharge
61    };
62
63 }
64
65 using namespace AliSpectraNameSpace;
66
67 class AliSpectraAODHistoManager : public TNamed
68 {
69 public:
70    AliSpectraAODHistoManager() :  TNamed(), fOutputList(0), fNRebin(0) {}
71   AliSpectraAODHistoManager(const char *name,Int_t nrebin);
72    virtual  ~AliSpectraAODHistoManager() {}
73
74
75    TH2F*   BookPtGenHistogram(const char * name);
76    TH2F*   BookPtGenAllChHistogram(const char * name);
77    TH2F*   BookPtRecHistogram(const char * name);
78    TH2F*   BookPtRecAllChHistogram(const char * name);
79    TH2F*   BookPIDHistogram(const char * name);
80    TH2F*   BookNSigHistogram(const char * name);
81    TH1F*   GetPtHistogram1D(const char * name,Double_t minDCA,Double_t maxDCA);
82    TH1F*   GetDCAHistogram1D(const char * name,Double_t minPt,Double_t maxPt);
83    TH2*     GetHistogram(UInt_t id)      {      return (TH2*) fOutputList->At(id);   }
84    //   TH1*     GetHistogram(AODHistoType_t histoType, AODParticleSpecies_t particleType, UInt_t charge);
85    TH1*     GetHistogram1D(UInt_t histoType, UInt_t particleType, UInt_t charge);
86    TH2*     GetHistogram2D(UInt_t histoType, UInt_t particleType, UInt_t charge);
87    TH2*     GetPtHistogram(UInt_t id)    {      return (TH2*) fOutputList->At(id);   }
88    TH2*     GetPtHistogram(const char * name)   {      return (TH2*) fOutputList->FindObject(name);   }
89    TH2*     GetPtHistogramByName(UInt_t id)     {      return (TH2*) fOutputList->FindObject(kHistName[id]); }  // Use this if you want to read a file saved with a different histo list   
90    TH2*     GetPIDHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
91    TH2*     GetPIDHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
92    TH2*     GetPIDHistogramByName(UInt_t id)    {      return (TH2*) fOutputList->FindObject(kHistName[id]);  }// Use this if you want to read a file saved with a different histo list
93    TH2*     GetNSigHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
94    TH2*     GetNSigHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
95    TH2*     GetNSigHistogramByName(UInt_t id)    {      return (TH2*) fOutputList->FindObject(kHistName[id]);  }// Use this if you want to read a file saved with a different histo list
96
97    //TH1F*   GetTH1F(UInt_t id)            {      return (TH1F*) GetPtHistogram(id);   }
98    //TH2F*   GetTH2F(UInt_t id)            {      return (TH2F*) GetPIDHistogram(id);   }
99
100   TList * GetOutputList() {return fOutputList;}
101   void    SetNRebin(Int_t nreb){fNRebin=nreb;}
102   Int_t   GetNRebin() {return fNRebin;}
103
104   Long64_t Merge(TCollection* list);
105
106
107 private:
108    TList     *fOutputList;  // List of Pt Histo's
109    Int_t      fNRebin; //rebin of histos
110    AliSpectraAODHistoManager(const AliSpectraAODHistoManager&);
111    AliSpectraAODHistoManager& operator=(const AliSpectraAODHistoManager&);
112
113    ClassDef(AliSpectraAODHistoManager, 1);
114
115 };
116 #endif
117