]>
Commit | Line | Data |
---|---|---|
dbec3946 | 1 | #ifndef ALIHISTOLISTWRAPPER_H |
2 | #define ALIHISTOLISTWRAPPER_H | |
3 | ||
4 | //------------------------------------------------------------------------- | |
5 | // AliHistoListWrapper | |
6 | // This class is used to contain a list of histograms to be merged | |
7 | // with another list, not necessarily containing the same histos in the | |
8 | // same order. | |
9 | // | |
10 | // The merging method checks if the lists contain the same histograms | |
11 | // and, if not, adds an empty copy of the missing histograms to the | |
12 | // relevant list. | |
13 | // | |
14 | // Can only contain objects inheriting from TH1. Can be useful if you | |
15 | // want to run a task on CAF and book your histograms dinamically | |
16 | // (e.g. in your UserExec method rather than in the UserCreateObject) | |
17 | // | |
18 | // Author: Michele Floris, CERN | |
19 | // | |
20 | //------------------------------------------------------------------------- | |
21 | ||
22 | #include <TNamed.h> | |
23 | #include "TList.h" | |
24 | ||
25 | class TList; | |
26 | class TH1; | |
27 | class TCollection; | |
28 | ||
29 | ||
30 | ||
31 | ||
32 | class AliHistoListWrapper : public TNamed | |
33 | { | |
34 | public: | |
2787875e | 35 | |
dbec3946 | 36 | AliHistoListWrapper(); |
37 | AliHistoListWrapper(const char* name, const char* title); | |
38 | AliHistoListWrapper(const AliHistoListWrapper& obj); | |
39 | ~AliHistoListWrapper(); | |
40 | ||
41 | void AddHistoToList(TObject* h){fList->Add(h);} | |
42 | TList * GetList(){return fList;} | |
43 | ||
44 | Long64_t Merge(TCollection* list); | |
45 | ||
46 | AliHistoListWrapper& operator=(const AliHistoListWrapper& wrap); | |
47 | ||
2787875e | 48 | protected: |
dbec3946 | 49 | TList * fList; |
50 | ||
2787875e | 51 | private: |
52 | ||
dbec3946 | 53 | ClassDef(AliHistoListWrapper, 1); |
54 | }; | |
55 | ||
56 | #endif |