]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.h
Generating histogram names automatically
[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      kProton = 0,
31      kKaon,
32      kPion,
33      kNSpecies = kPion,
34    }; // Particle species used in plotting
35
36    const char * kParticleSpecies[] =
37    {
38        "ProtonPlus",
39        "ProtonMinus",
40        "KaonPlus",
41        "KaonMinus",
42        "PionPlus",
43        "PionMinus",
44    };
45    enum AODHistoType_t
46    {
47        kHistSpectraRec = 0,
48        kHistSpectraGen,
49        kHNHistoTypes = kHistSpectraGen,
50    }; // Types of histos
51
52 }
53
54 using namespace AliSpectraNameSpace;
55
56 class AliSpectraAODHistoManager : public TNamed
57 {
58 public:
59    AliSpectraAODHistoManager() :  TNamed(), fOutputList(0) {}
60    AliSpectraAODHistoManager(const char *name);
61    virtual  ~AliSpectraAODHistoManager() {}
62
63
64    TH2F*   BookPtGenHistogram(const char * name);
65    TH2F*   BookPtRecHistogram(const char * name);
66    TH2F*   BookPIDHistogram(const char * name);
67    TH2F*   BookNSigHistogram(const char * name);
68    TH2F*   BookqVecHistogram(const char * name);
69    TH1F*   GetPtHistogram1D(const char * name,Double_t minDCA,Double_t maxDCA);
70    TH1F*   GetDCAHistogram1D(const char * name,Double_t minPt,Double_t maxPt);
71    TH2*     GetHistogram(UInt_t id)      {      return (TH2*) fOutputList->At(id);   }
72    TH2*     GetPtHistogram(UInt_t id)    {      return (TH2*) fOutputList->At(id);   }
73    TH2*     GetPtHistogram(const char * name)   {      return (TH2*) fOutputList->FindObject(name);   }
74    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   
75    TH2*     GetPIDHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
76    TH2*     GetPIDHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
77    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
78    TH2*     GetNSigHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
79    TH2*     GetNSigHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
80    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
81    TH2*     GetqVecHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
82    TH2*     GetqVecHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
83    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
84   
85    //TH1F*   GetTH1F(UInt_t id)            {      return (TH1F*) GetPtHistogram(id);   }
86    //TH2F*   GetTH2F(UInt_t id)            {      return (TH2F*) GetPIDHistogram(id);   }
87
88   TList * GetOutputList() {return fOutputList;}
89
90   Long64_t Merge(TCollection* list);
91
92
93 private:
94    TList     *fOutputList;  // List of Pt Histo's
95
96    AliSpectraAODHistoManager(const AliSpectraAODHistoManager&);
97    AliSpectraAODHistoManager& operator=(const AliSpectraAODHistoManager&);
98
99    ClassDef(AliSpectraAODHistoManager, 1);
100
101 };
102 #endif
103