]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.h
Implemented handy getters + renamed some of the enums to avoid conflicts with root...
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliSpectraAODHistoManager.h
1
2 #ifndef ALISPECTRAAODHISTOMANAGER_H
3 #define ALISPECTRAAODHISTOMANAGER_H
4
5 /*  See cxx source for full Copyright notice */
6
7 //-------------------------------------------------------------------------
8 //                      AliSpectraAODHistoManager
9 //
10 //
11 //
12 //
13 // Authors: Michele Floris, CERN, Philip Versteeg, UU, Redmer Bertens, UU
14 //-------------------------------------------------------------------------
15
16 class AliAODEvent;
17 class TH1F;
18 class TH2F;
19 class TList;
20 #include "TNamed.h"
21 #include "Histograms.h" // Change this file if you want to add an histogram
22 #include "HistogramNames.h"
23
24 namespace AliSpectraNameSpace
25 {
26
27    
28    enum AODParticleSpecies_t
29    {
30      kSpPion,
31      kSpKaon,
32      kSpProton,
33      kNSpecies,
34    }; // Particle species used in plotting
35
36    const char * kParticleSpecies[] =
37    {
38        "PionPlus",
39        "KaonPlus",
40        "ProtonPlus",
41        "PionMinus",
42        "KaonMinus",
43        "ProtonMinus",
44    };
45
46    enum AODHistoType_t
47    {
48      kHistPtGenTruePrimary,
49      kHistPtRecSigma,
50      kHistPtRecTruePrimary,
51      kHistPtRecSigmaPrimary,
52      kHistPtRecSigmaSecondaryMaterial,
53      kHistPtRecSigmaSecondaryWeakDecay,
54      kNHistoTypes
55    }; // Types of histos
56
57    enum AODCharge_t
58    {
59        kChPos = 0,
60        kChNeg,
61        kNCharge
62    };
63
64 }
65
66 using namespace AliSpectraNameSpace;
67
68 class AliSpectraAODHistoManager : public TNamed
69 {
70 public:
71    AliSpectraAODHistoManager() :  TNamed(), fOutputList(0) {}
72    AliSpectraAODHistoManager(const char *name);
73    virtual  ~AliSpectraAODHistoManager() {}
74
75
76    TH2F*   BookPtGenHistogram(const char * name);
77    TH2F*   BookPtRecHistogram(const char * name);
78    TH2F*   BookPIDHistogram(const char * name);
79    TH2F*   BookNSigHistogram(const char * name);
80    TH2F*   BookqVecHistogram(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    TH2*     GetqVecHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
97    TH2*     GetqVecHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
98    TH2*     GetqVecHistogramByName(UInt_t id)    {      return (TH2*) fOutputList->FindObject(kHistName[id]);  }// Use this if you want to read a file saved with a different histo list
99   
100    //TH1F*   GetTH1F(UInt_t id)            {      return (TH1F*) GetPtHistogram(id);   }
101    //TH2F*   GetTH2F(UInt_t id)            {      return (TH2F*) GetPIDHistogram(id);   }
102
103   TList * GetOutputList() {return fOutputList;}
104
105   Long64_t Merge(TCollection* list);
106
107
108 private:
109    TList     *fOutputList;  // List of Pt Histo's
110
111    AliSpectraAODHistoManager(const AliSpectraAODHistoManager&);
112    AliSpectraAODHistoManager& operator=(const AliSpectraAODHistoManager&);
113
114    ClassDef(AliSpectraAODHistoManager, 1);
115
116 };
117 #endif
118