]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraBothHistoManager.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliSpectraBothHistoManager.h
1 #ifndef ALISPECTRABOTHHISTOMANAGER_H
2 #define ALISPECTRABOTHHISTOMANAGER_H
3
4 /*  See cxx source for full Copyright notice */
5
6 //-------------------------------------------------------------------------
7 //                      AliSpectraBothHistoManager
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
21 //class TList;
22 #include "TNamed.h"
23 #include "TList.h"
24 #include "HistogramsBoth.h" // Change this file if you want to add an histogram
25 #include "HistogramNamesBoth.h" // generate this automatically running createNames.py 
26
27 namespace AliSpectraNameSpaceBoth
28 {
29
30    
31    enum BothParticleSpecies_t
32    {
33      kSpPion,
34      kSpKaon,
35      kSpProton,
36      kNSpecies,
37      kSpUndefined,
38    }; // Particle species used in plotting
39
40    //extern const char * kParticleSpecies[];
41
42    enum BothHistoType_t
43    {
44      kHistPtGenTruePrimary,
45      kHistPtRecSigma,
46      kHistPtRecTrue,
47      kHistPtRecTruePrimary,
48      kHistPtRecPrimary, 
49      kHistPtRecSigmaPrimary,
50      kHistPtRecSigmaSecondaryMaterial,
51      kHistPtRecSigmaSecondaryWeakDecay,
52      kHistNSigTPC,
53      kHistNSigTOF,
54      kHistNSigTPCTOF,
55      kNHistoTypes
56    }; // Types of histos
57
58    enum BothCharge_t
59    {
60        kChPos = 0,
61        kChNeg,
62        kNCharge
63    };
64
65 }
66
67 using namespace AliSpectraNameSpaceBoth;
68
69 class AliSpectraBothHistoManager : public TNamed
70 {
71 public:
72    AliSpectraBothHistoManager() :  TNamed(), fOutputList(0), fNRebin(0) {}
73   AliSpectraBothHistoManager(const char *name,Int_t nrebin,Bool_t pidqa=kTRUE);
74    virtual  ~AliSpectraBothHistoManager() ;
75
76
77    TH2F*   BookPtGenHistogram(const char * name);
78    TH2F*   BookPtGenAllChHistogram(const char * name);
79    TH2F*   BookPtRecHistogram(const char * name);
80    TH2F*   BookPtRecAllChHistogram(const char * name);
81    TH2F*   BookPIDHistogram(const char * name);
82    TH2F*   BookNSigHistogram(const char * name);
83    TH2F*   BookGenMulvsRawMulHistogram(const char * name);
84    TH2F*   BookDoubleCountsHistogram(const char * name);
85    TH1F*   BookEventStatHist(); // due to zip bug in merging it is good to store in one list everything 
86
87    TH1F*   GetPtHistogram1D(const char * name,Double_t minDCA,Double_t maxDCA);
88    TH1F*   GetDCAHistogram1D(const char * name,Double_t minPt,Double_t maxPt);
89    TH2*     GetHistogram(UInt_t id)      {      return (TH2*) fOutputList->At(id);   }
90    //   TH1*     GetHistogram(BothHistoType_t histoType, BothParticleSpecies_t particleType, UInt_t charge);
91    TH1*     GetHistogram1D(UInt_t histoType, UInt_t particleType, UInt_t charge);
92    TH2*     GetHistogram2D(UInt_t histoType, UInt_t particleType, UInt_t charge);
93    TH2*     GetPtHistogram(UInt_t id)    {      return (TH2*) fOutputList->At(id);   }
94    TH2*     GetPtHistogram(const char * name)   {      return (TH2*) fOutputList->FindObject(name);   }
95    TH2*     GetPtHistogramByName(UInt_t id)     {      return (TH2*) fOutputList->FindObject(kHistNameBoth[id]); }  // Use this if you want to read a file saved with a different histo list   
96    TH2*     GetPIDHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
97    TH2*     GetPIDHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
98    TH2*     GetPIDHistogramByName(UInt_t id)    {      return (TH2*) fOutputList->FindObject(kHistNameBoth[id]);  }// Use this if you want to read a file saved with a different histo list
99    TH2*     GetNSigHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
100    TH2*     GetNSigHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
101    TH2*     GetNSigHistogramByName(UInt_t id)    {      return (TH2*) fOutputList->FindObject(kHistNameBoth[id]);  }// Use this if you want to read a file saved with a different histo list
102    TH2*     GetqVecHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
103    TH2*     GetqVecHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
104    TH2*     GetqVecHistogramByName(UInt_t id)    {      return (TH2*) fOutputList->FindObject(kHistNameBoth[id]);  }// Use this if you want to read a file saved with a different histo list
105    TH2*     GetGenMulvsRawMulHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
106    TH2*     GetGenMulvsRawMulHistogramByName(UInt_t id)    {      return (TH2*) fOutputList->FindObject(kHistNameBoth[id]);  }// Use this if you want to read a file saved with a different histo list
107    TH1F*    GetEventStatHist()  {      return (TH1F*) fOutputList->FindObject("EventStatHisto");  }     
108    //TH1F*   GetTH1F(UInt_t id)            {      return (TH1F*) GetPtHistogram(id);   }
109    //TH2F*   GetTH2F(UInt_t id)            {      return (TH2F*) GetPIDHistogram(id);   }
110
111   TList * GetOutputList() {return fOutputList;}
112   void    SetNRebin(Int_t nreb){fNRebin=nreb;}
113   Int_t   GetNRebin() {return fNRebin;}
114
115   Long64_t Merge(TCollection* list);
116
117
118 private:
119    TList     *fOutputList;  // List of Pt Histo's
120    Int_t      fNRebin; //rebin of histos
121    AliSpectraBothHistoManager(const AliSpectraBothHistoManager&);
122    AliSpectraBothHistoManager& operator=(const AliSpectraBothHistoManager&);
123
124    ClassDef(AliSpectraBothHistoManager, 2);
125
126 };
127 #endif
128