Implementation of all needed changes in the package in order to speed-up the executio...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnListOutput.h
CommitLineData
c865cb1d 1#ifndef ALIRSNLISTOUTPUT_H
2#define ALIRSNLISTOUTPUT_H
3
4//
5// General class for outputs which can stay into a TList
6//
7
8#include <TRef.h>
9#include <TNamed.h>
10#include <TArrayI.h>
11#include <TObjArray.h>
12
13#include <TH1.h>
14#include <TH2.h>
15#include <TH3.h>
16#include <TNtuple.h>
17#include <THnSparse.h>
18
19#include "AliCFContainer.h"
20
21class AliRsnValue;
22
23class AliRsnListOutput : public TNamed {
24
25public:
26
27 enum EOut {
28 kHistoDefault,
29 kHistoSparse,
30 kCFContainer
31 };
32
33 AliRsnListOutput(const char *name = "", EOut type = kHistoDefault);
34 AliRsnListOutput(const AliRsnListOutput &copy);
35 const AliRsnListOutput& operator=(const AliRsnListOutput &copy);
36 virtual ~AliRsnListOutput();
37
38 EOut GetType() {return fType;}
39 Int_t GetSteps() {return fSteps;}
40 TObjArray* GetValues() {return &fValues;}
41 Int_t GetNValues() {return (fNValues = fValues.GetEntries());}
42 AliRsnValue* GetValue(Int_t i) {return (AliRsnValue*)fValues[i];}
43 void SetType(EOut type) {fType = type;}
44 void SetSteps(Int_t n) {fSteps = n;}
45
46 void AddValue(AliRsnValue *value);
47
48 virtual void Reset();
49 virtual Bool_t Init(const char *prefix, TList *list);
50 virtual Bool_t Fill(TObject *target, Int_t step = 0);
51
52private:
53
54 TH1* CreateHistogram(const char *name);
55 THnSparseF* CreateHistogramSparse(const char *name);
56 AliCFContainer* CreateCFContainer(const char *name);
57
58 EOut fType; // output format among allowed ones
59 Int_t fSteps; // number of steps (only for container)
60 TObjArray fValues; // container for all related values
61 Int_t fNValues; //! number of values (internal use)
62 TList *fList; //! list containing the output
63 Int_t fIndex; // index of object in the list
64
65 TArrayD fArray; //! temp array of computed values
66
67 ClassDef(AliRsnListOutput, 1) // AliRsnListOutput class
68};
69
70#endif