]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/AliRsnListOutput.h
Update for centrality patch flag
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnListOutput.h
CommitLineData
c865cb1d 1#ifndef ALIRSNLISTOUTPUT_H
2#define ALIRSNLISTOUTPUT_H
3
4//
b63357a0 5// Class AliRsnListOutput
6//
7// This class defines a base classe to implement a Output
8// which uses the internal RSN package event format (AliRsnEvent).
9// It contains some default flags which turn out to be useful:
10// - a flag to select only the "true" pairs (tracks from same resonance)
11// - a flag to know if the computation is done over two events (mixing)
12//
13// Any kind of analysis object should be implemented as inheriting from this
14// because the AliRsnAnalyzer which executes the analysis will accept a collection
15// of such objects, in order to have a unique format of processing method
16//
17// The user who implements a kind of computation type should inherit from
18// this class and override the virtual Outputs defined in it, which
19// initialize the final output histogram and define how to process data.
20//
21//
22// author: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
c865cb1d 23//
24
25#include <TRef.h>
26#include <TNamed.h>
27#include <TArrayI.h>
28#include <TObjArray.h>
29
30#include <TH1.h>
31#include <TH2.h>
32#include <TH3.h>
33#include <TNtuple.h>
34#include <THnSparse.h>
74d60285 35#include <Rtypes.h>
c865cb1d 36
b63357a0 37class AliCFContainer;
c865cb1d 38class AliRsnValue;
61f275d1 39class AliRsnDaughter;
40class AliRsnEvent;
c865cb1d 41class AliRsnListOutput : public TNamed {
42
43public:
44
45 enum EOut {
46 kHistoDefault,
47 kHistoSparse,
48 kCFContainer
49 };
50
51 AliRsnListOutput(const char *name = "", EOut type = kHistoDefault);
52 AliRsnListOutput(const AliRsnListOutput &copy);
61f275d1 53 AliRsnListOutput &operator=(const AliRsnListOutput &copy);
c865cb1d 54 virtual ~AliRsnListOutput();
55
b63357a0 56 EOut GetType() const {return fType;}
57 Int_t GetSteps() const {return fSteps;}
61f275d1 58 TObjArray *GetValues() {return &fValues;}
f34f960b 59 Int_t GetNValues() {return (fNValues = fValues.GetEntries());}
61f275d1 60 AliRsnValue *GetValue(Int_t i) const {return (AliRsnValue *)fValues[i];}
b63357a0 61 Int_t GetIndex() const {return fIndex;}
74d60285 62 Bool_t GetFillHistogramOnlyInRange() { return fCheckHistRange; }
f34f960b 63 void SetType(EOut type) {fType = type;}
64 void SetSteps(Int_t n) {fSteps = n;}
65 void SetSkipFailed(Bool_t y) {fSkipFailed = y;}
74d60285 66 void SetFillHistogramOnlyInRange(Bool_t fillInRangeOnly) { fCheckHistRange = fillInRangeOnly; }
c865cb1d 67
68 void AddValue(AliRsnValue *value);
69
70 virtual void Reset();
71 virtual Bool_t Init(const char *prefix, TList *list);
72 virtual Bool_t Fill(TObject *target, Int_t step = 0);
61f275d1 73 virtual Bool_t Fill(AliRsnEvent *ev,AliRsnDaughter *d);
c865cb1d 74
75private:
76
61f275d1 77 TH1 *CreateHistogram(const char *name);
78 THnSparseF *CreateHistogramSparse(const char *name);
79 AliCFContainer *CreateCFContainer(const char *name);
c865cb1d 80
f34f960b 81 Bool_t fSkipFailed; // tell to skip fills when one computation fails
c865cb1d 82 EOut fType; // output format among allowed ones
83 Int_t fSteps; // number of steps (only for container)
84 TObjArray fValues; // container for all related values
85 Int_t fNValues; //! number of values (internal use)
86 TList *fList; //! list containing the output
87 Int_t fIndex; // index of object in the list
74d60285 88 Bool_t fCheckHistRange;// check if values is in histogram range
61f275d1 89
c865cb1d 90 TArrayD fArray; //! temp array of computed values
91
74d60285 92 ClassDef(AliRsnListOutput, 2) // AliRsnListOutput class
c865cb1d 93};
94
95#endif