]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnFunction.h
Removed warnings from RESONANCES code
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnFunction.h
CommitLineData
13f28255 1//
2// Class AliRsn Fcn
3//
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)
9//
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
13//
e0baff8c 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
13f28255 16// initialize the final output histogram and define how to process data.
17//
18//
19// author: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
20//
21
22#ifndef ALIRSNFUNCTION_H
23#define ALIRSNFUNCTION_H
24
25#include <TArrayD.h>
26#include <TString.h>
27
28#include "AliRsnCut.h"
29#include "AliRsnHistoDef.h"
30#include "AliRsnPairParticle.h"
31
32class TH1D;
33class TH2D;
34class AliRsnEvent;
35
36class AliRsnFunction : public TObject
37{
38
e0baff8c 39 public:
13f28255 40
41 enum EFcnType
42 {
43 kInvMass,
44 kInvMassMC,
e0baff8c 45 kInvMassRotated,
13f28255 46 kResolution,
47 kPtSpectrum,
0ef90328 48 kEtaSpectrum,
13f28255 49 kFcnTypes
50 };
51
52 AliRsnFunction();
53 AliRsnFunction(EFcnType type, AliRsnHistoDef *hd, Bool_t skipOut = kTRUE);
54 AliRsnFunction(const AliRsnFunction &copy);
55 virtual ~AliRsnFunction() {Clear();}
56 virtual void Clear(Option_t *option = "");
57
58 Bool_t UseBins() {return fUseBins;}
59 Bool_t SkipOut() {return fSkipOutsideInterval;}
60 AliRsnHistoDef* GetHistoDef() {return fHistoDef;}
61 TString GetFcnName();
62 TString GetFcnTitle();
e0baff8c 63
13f28255 64 void SetBinningCut(AliRsnCut::EType type, Double_t min, Double_t max, Double_t step);
e0baff8c 65 void SetBinningCut(AliRsnCut::EType type, Int_t nbins, Double_t *bins);
13f28255 66 void SetHistoDef(AliRsnHistoDef *def) {fHistoDef = def;}
e0baff8c 67 void SetRotationAngle(Double_t rotAngle) {fRotAngle = rotAngle;}
13f28255 68
69 // working routines
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);
74
e0baff8c 75 private:
76
13f28255 77 const AliRsnFunction& operator=(const AliRsnFunction &copy);
e0baff8c 78
13f28255 79 Double_t FcnResolution(AliRsnPairParticle *pair, AliRsnPairDef *pd);
e0baff8c 80
13f28255 81 EFcnType fFcnType; // function type
e0baff8c 82
83 Double_t fRotAngle; // rotation angle (for "rotated" invMass)
13f28255 84
85 Bool_t fUseBins; // flag to choose if binning is used
86 Bool_t fSkipOutsideInterval; // skip pairs which fall outside histogram interval
e0baff8c 87
13f28255 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
91
92 AliRsnHistoDef *fHistoDef; // definitions for histogram
93 TH1D *fHisto[100]; // binned histograms
e0baff8c 94
13f28255 95 // ROOT dictionary
96 ClassDef(AliRsnFunction, 1)
97};
98
99#endif