4 // This class defines a base classe to implement a typical computation
5 // which uses the internal RSN package event format (AliRsnEvent).
6 // It contains some default flags which turn out to be useful:
7 // - a flag to select only the "true" pairs (tracks from same resonance)
8 // - a flag to know if the computation is done over two events (mixing)
10 // Any kind of analysis object should be implemented as inheriting from this
11 // because the AliRsnAnalyzer which executes the analysis will accept a collection
12 // of such objects, in order to have a unique format of processing method
14 // The user who implements a kind of computation type should inherit from
15 // this class and override the virtual functions defined in it, which
16 // initialize the final output histogram and define how to process data.
19 // author: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
22 #ifndef ALIRSNFUNCTION_H
23 #define ALIRSNFUNCTION_H
28 #include "AliRsnCut.h"
29 #include "AliRsnHistoDef.h"
30 #include "AliRsnPairParticle.h"
36 class AliRsnFunction : public TObject
53 AliRsnFunction(EFcnType type, AliRsnHistoDef *hd, Bool_t skipOut = kTRUE);
54 AliRsnFunction(const AliRsnFunction ©);
55 virtual ~AliRsnFunction() {Clear();}
56 virtual void Clear(Option_t *option = "");
58 Bool_t UseBins() {return fUseBins;}
59 Bool_t SkipOut() {return fSkipOutsideInterval;}
60 AliRsnHistoDef* GetHistoDef() {return fHistoDef;}
62 TString GetFcnTitle();
64 void SetBinningCut(AliRsnCut::EType type, Double_t min, Double_t max, Double_t step);
65 void SetBinningCut(AliRsnCut::EType type, Int_t nbins, Double_t *bins);
66 void SetHistoDef(AliRsnHistoDef *def) {fHistoDef = def;}
67 void SetRotationAngle(Double_t rotAngle) {fRotAngle = rotAngle;}
70 TList* Init(const char *histoName, const char *histoTitle);
71 void Init(const char *histoName, const char *histoTitle, TList *tgt);
72 Bool_t Fill(AliRsnPairParticle *pair, AliRsnPairDef *ref, Double_t weight = 0.0);
73 Double_t FcnValue(AliRsnPairParticle *pair, AliRsnPairDef *ref);
77 const AliRsnFunction& operator=(const AliRsnFunction ©);
79 Double_t FcnResolution(AliRsnPairParticle *pair, AliRsnPairDef *pd);
81 EFcnType fFcnType; // function type
83 Double_t fRotAngle; // rotation angle (for "rotated" invMass)
85 Bool_t fUseBins; // flag to choose if binning is used
86 Bool_t fSkipOutsideInterval; // skip pairs which fall outside histogram interval
88 TArrayD fBins; // low edge of each bin (upper is the low edge of next bin)
89 AliRsnCut fBinningCut; // binning cut
90 AliRsnCut::EType fBinningCutType;// binning cut type
92 AliRsnHistoDef *fHistoDef; // definitions for histogram
93 TH1D *fHisto[100]; // binned histograms
96 ClassDef(AliRsnFunction, 1)