]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.h
d875ce683f0c1d98f0c0afdc99b9e4c2eb79522d
[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
22 namespace AliSpectraNameSpace
23 {
24    enum AODPtHist_t
25    {
26       // 6 Pt Reconstructed Sigma
27       kHistPtRecSigmaProtonPlus = 0,            // Pt histo for protons +, reconstructed tracks, sigma ID
28       kHistPtRecSigmaKaonPlus,                  // Pt histo for kaons +, reconsructed tracks, sigma ID
29       kHistPtRecSigmaPionPlus,                  // Pt histo for pions +, reconstructed tracks, sigma ID
30       kHistPtRecSigmaProtonMinus,               // Pt histo for protons -, reconstructed tracks, sigma ID
31       kHistPtRecSigmaKaonMinus,                 // Pt histo for kaons -, reconstructed tracks, sigma ID
32       kHistPtRecSigmaPionMinus,                 // Pt histo for pions -, reconstructed tracks, sigma ID
33       
34       // 6 Pt Reconstructed True
35       kHistPtRecTrueProtonPlus,                 // Pt histo for protons +, reconstructed tracks, true ID
36       kHistPtRecTrueKaonPlus,                   // Pt histo for kaons +, reconsructed tracks, true ID
37       kHistPtRecTruePionPlus,                   // Pt histo for pions +, reconstructed tracks, true ID
38       kHistPtRecTrueProtonMinus,                // Pt histo for protons -, reconstructed tracks, true ID
39       kHistPtRecTrueKaonMinus,                  // Pt histo for kaons -, reconstructed tracks, true ID
40       kHistPtRecTruePionMinus,                  // Pt histo for pions -, reconstructed tracks, true ID
41             
42       // 6 Pt Reconstructed Sigma Primary
43       kHistPtRecSigmaPrimaryProtonPlus,         // Pt histo for protons +, reconstructed tracks, sigma ID, primary Event
44       kHistPtRecSigmaPrimaryKaonPlus,           // Pt histo for kaons +, reconsructed tracks, sigma ID, primary Event
45       kHistPtRecSigmaPrimaryPionPlus,           // Pt histo for pions +, reconstructed tracks, sigma ID, primary Event
46       kHistPtRecSigmaPrimaryProtonMinus,        // Pt histo for protons -, reconstructed tracks, sigma ID, primary Event
47       kHistPtRecSigmaPrimaryKaonMinus,          // Pt histo for kaons -, reconstructed tracks, sigma ID, primary Event
48       kHistPtRecSigmaPrimaryPionMinus,          // Pt histo for pions -, reconstructed tracks, sigma ID, primary Event
49             
50       // 6 Pt Reconstructed Sigma Secondary
51       kHistPtRecSigmaSecondaryProtonPlus,       // Pt histo for protons +, reconstructed tracks, sigma ID, secondary Event
52       kHistPtRecSigmaSecondaryKaonPlus,         // Pt histo for kaons +, reconsructed tracks, sigma ID, secondary Event
53       kHistPtRecSigmaSecondaryPionPlus,         // Pt histo for pions +, reconstructed tracks, sigma ID, secondary Event
54       kHistPtRecSigmaSecondaryProtonMinus,      // Pt histo for protons -, reconstructed tracks, sigma ID, secondary Event
55       kHistPtRecSigmaSecondaryKaonMinus,        // Pt histo for kaons -, reconstructed tracks, sigma ID, secondary Event
56       kHistPtRecSigmaSecondaryPionMinus,        // Pt histo for pions -, reconstructed tracks, sigma ID, secondary Event
57
58       // 6 Pt Generated True Primary
59       kHistPtGenTruePrimaryProtonPlus,          // Pt histo for protons +, generated tracks, true ID, primary Event
60       kHistPtGenTruePrimaryKaonPlus,            // Pt histo for kaons +, generated tracks, true ID, primary Event
61       kHistPtGenTruePrimaryPionPlus,            // Pt histo for pions +, generated tracks, true ID, primary Event
62       kHistPtGenTruePrimaryProtonMinus,         // Pt histo for protons -, generated tracks, true ID, primary Event
63       kHistPtGenTruePrimaryKaonMinus,           // Pt histo for kaons -, generated tracks, true ID, primary Event
64       kHistPtGenTruePrimaryPionMinus,           // Pt histo for pions -, generated tracks, true ID, primary Event
65       kNPtSpecies = kHistPtGenTruePrimaryPionMinus,
66       
67       // 6 Pt Reconstructed True Primary
68       kHistPtRecTruePrimaryProtonPlus,          // Pt histo for protons +, reconstructed tracks, true ID, primary event
69       kHistPtRecTruePrimaryKaonPlus,            // Pt histo for kaons +, reconsructed tracks, true ID, primary event
70       kHistPtRecTruePrimaryPionPlus,            // Pt histo for pions +, reconstructed tracks, true ID, primary event
71       kHistPtRecTruePrimaryProtonMinus,         // Pt histo for protons -, reconstructed tracks, true ID, primary event
72       kHistPtRecTruePrimaryKaonMinus,           // Pt histo for kaons -, reconstructed tracks, true ID, primary event
73       kHistPtRecTruePrimaryPionMinus,           // Pt histo for pions -, reconstructed tracks, true ID, primary event
74       
75       // Rest
76       kHistPtRec,                               // Pt histo for all particles, reconstructed tracks
77       kHistPtGen,                               // Pt histo for all particles, generated tracks
78       kNPtHist = kHistPtGen,                    // Number of pt-likehistos histos
79       kHistPIDTPC,                              // Particle Identification histo
80       kHistPIDTPCPt,
81       kNHist,                                   // Total number of histos
82    };  // Type of events plotted in Pt Histogram
83
84    const char * kHistName[] =
85    {
86       // 6 Pt Reconstructed Sigma
87       "histPtRecSigmaProtonPlus",               // Pt histo for protons +, reconstructed tracks, sigma ID
88       "histPtRecSigmaKaonPlus",                 // Pt histo for kaons +, reconsructed tracks, sigma ID
89       "histPtRecSigmaPionPlus",                 // Pt histo for pions +, reconstructed tracks, sigma ID
90       "histPtRecSigmaProtonMinus",              // Pt histo for protons -, reconstructed tracks, sigma ID
91       "histPtRecSigmaKaonMinus",                // Pt histo for kaons -, reconstructed tracks, sigma ID
92       "histPtRecSigmaPionMinus",                // Pt histo for pions -, reconstructed tracks, sigma ID
93       
94       // 6 Pt Reconstructed True
95       "histPtRecTrueProtonPlus",                // Pt histo for protons +, reconstructed tracks, true ID
96       "histPtRecTrueKaonPlus",                  // Pt histo for kaons +, reconsructed tracks, true ID
97       "histPtRecTruePionPlus",                  // Pt histo for pions +, reconstructed tracks, true ID
98       "histPtRecTrueProtonMinus",               // Pt histo for protons -, reconstructed tracks, true ID
99       "histPtRecTrueKaonMinus",                 // Pt histo for kaons -, reconstructed tracks, true ID
100       "histPtRecTruePionMinus",                 // Pt histo for pions -, reconstructed tracks, true ID
101
102       // 6 Pt Reconstructed Sigma Primary
103       "histPtRecSigmaPrimaryProtonPlus",        // Pt histo for protons +, reconstructed tracks, sigma ID, primary Event
104       "histPtRecSigmaPrimaryKaonPlus",          // Pt histo for kaons +, reconsructed tracks, sigma ID, primary Event
105       "histPtRecSigmaPrimaryPionPlus",          // Pt histo for pions +, reconstructed tracks, sigma ID, primary Event
106       "histPtRecSigmaPrimaryProtonMinus",       // Pt histo for protons -, reconstructed tracks, sigma ID, primary Event
107       "histPtRecSigmaPrimaryKaonMinus",         // Pt histo for kaons -, reconstructed tracks, sigma ID, primary Event
108       "histPtRecSigmaPrimaryPionMinus",         // Pt histo for pions -, reconstructed tracks, sigma ID, primary Event
109       
110       // 6 Pt Reconstructed Sigma Seconday
111       "histPtRecSigmaSecondaryProtonPlus",      // Pt histo for protons +, reconstructed tracks, sigma ID, secondary Event
112       "histPtRecSigmaSecondaryKaonPlus",        // Pt histo for kaons +, reconsructed tracks, sigma ID, secondary Event
113       "histPtRecSigmaSecondaryPionPlus",        // Pt histo for pions +, reconstructed tracks, sigma ID, secondary Event
114       "histPtRecSigmaSecondaryProtonMinus",     // Pt histo for protons -, reconstructed tracks, sigma ID, secondary Event
115       "histPtRecSigmaSecondaryKaonMinus",       // Pt histo for kaons -, reconstructed tracks, sigma ID, secondary Event
116       "histPtRecSigmaSecondaryPionMinus",       // Pt histo for pions -, reconstructed tracks, sigma ID, secondary Event
117       
118       // 6 Pt Reconstructed Sigma Primary
119       "histPtGenTruePrimaryProtonPlus",         // Pt histo for protons +, generated tracks, sigma ID, primary Event
120       "histPtGenTruePrimaryKaonPlus",           // Pt histo for kaons +, generated tracks, sigma ID, primary Event
121       "histPtGenTruePrimaryPionPlus",           // Pt histo for pions +, generated tracks, sigma ID, primary Event
122       "histPtGenTruePrimaryProtonMinus",          // Pt histo for protons -, generated tracks, sigma ID, primary Event
123       "histPtGenTruePrimaryKaonMinus",            // Pt histo for kaons -, generated tracks, sigma ID, primary Event
124       "histPtGenTruePrimaryPionMinus",            // Pt histo for pions -, generated tracks, sigma ID, primary Event
125
126       // 6 Pt Reconstructed True
127       "histPtRecTruePrimaryProtonPlus",         // Pt histo for protons +, reconstructed tracks, true ID, primary event
128       "histPtRecTruePrimaryKaonPlus",           // Pt histo for kaons +, reconsructed tracks, true ID, primary event
129       "histPtRecTruePrimaryPionPlus",           // Pt histo for pions +, reconstructed tracks, true ID, primary event
130       "histPtRecTruePrimaryProtonMinus",        // Pt histo for protons -, reconstructed tracks, true ID, primary event
131       "histPtRecTruePrimaryKaonMinus",          // Pt histo for kaons -, reconstructed tracks, true ID, primary event
132       "histPtRecTruePrimaryPionMinus",          // Pt histo for pions -, reconstructed tracks, true ID, primary event
133       
134       // Rest
135       "histPtRec",                              // Pt histo for all particles, reconstructed tracks
136       "histPtGen",                              // Pt histo for all particles, generated tracks
137       "histPIDTPC",                             // Particle Identification histo
138       "histPIDTPCPt",
139    };
140
141    enum AODParticleSpecies_t
142    {
143        kProton = 0,
144        kKaon,
145        kPion,
146        kNSpecies = kPion,
147    }; // Particle species used in plotting
148
149    const char * kParticleSpecies[] =
150    {
151        "ProtonPlus",
152        "ProtonMinus",
153        "KaonPlus",
154        "KaonMinus",
155        "PionPlus",
156        "PionMinus",
157    };
158    enum AODHistoType_t
159    {
160        kHistSpectraRec = 0,
161        kHistSpectraGen,
162        kHNHistoTypes = kHistSpectraGen,
163    }; // Types of histos
164
165 }
166
167 using namespace AliSpectraNameSpace;
168
169 class AliSpectraAODHistoManager : public TNamed
170 {
171 public:
172    AliSpectraAODHistoManager() :  TNamed(), fOutputList(0) {}
173    AliSpectraAODHistoManager(const char *name);
174    virtual  ~AliSpectraAODHistoManager() {}
175
176
177    TH1F*   BookPtHistogram(const char * name);
178    TH2F*   BookPIDHistogram(const char * name);
179    TH1*     GetHistogram(UInt_t id)      {      return (TH1*) fOutputList->At(id);   }
180    TH1*     GetPtHistogram(UInt_t id)    {      return (TH1*) fOutputList->At(id);   }
181    TH1*     GetPtHistogram(const char * name)   {      return (TH1*) fOutputList->FindObject(name);   }
182    TH1*     GetPtHistogramByName(UInt_t id)     {      return (TH1*) fOutputList->FindObject(kHistName[id]); }  // Use this if you want to read a file saved with a different histo list   
183    TH2*     GetPIDHistogram(UInt_t id)   {      return (TH2*) fOutputList->At(id);   }
184    TH2*     GetPIDHistogram(const char * name)  {      return (TH2*) fOutputList->FindObject(name);   }
185    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
186    TH1F*   GetTH1F(UInt_t id)            {      return (TH1F*) GetPtHistogram(id);   }
187    TH2F*   GetTH2F(UInt_t id)            {      return (TH2F*) GetPIDHistogram(id);   }
188
189   TList * GetOutputList() {return fOutputList;}
190
191   Long64_t Merge(TCollection* list);
192
193
194 private:
195    TList     *fOutputList;  // List of Pt Histo's
196
197    AliSpectraAODHistoManager(const AliSpectraAODHistoManager&);
198    AliSpectraAODHistoManager& operator=(const AliSpectraAODHistoManager&);
199
200    ClassDef(AliSpectraAODHistoManager, 1);
201
202 };
203 #endif
204