Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGCF / EBYE / BalanceFunctions / AliBalancePsi.h
CommitLineData
9efce966 1#ifndef ALIBALANCEPSI_H
0879e280 2#define ALIBALANCEPSI_H
3/* See cxx source for full Copyright notice */
4
5
6/* $Id: AliBalancePsi.h 54125 2012-01-24 21:07:41Z miweber $ */
7
8//-------------------------------------------------------------------------
9// Class AliBalancePsi
10// This is the class for the Balance Function writ Psi analysis
11//
12// Origin: Panos Christakoglou, Nikhef, Panos.Christakoglou@cern.ch
13//-------------------------------------------------------------------------
3b3e3404 14// test
c64cb1f6 15#include <vector>
0879e280 16#include <TObject.h>
17#include "TString.h"
73609a48 18#include "TH2D.h"
0879e280 19
a38fd7f3 20#include "AliTHn.h"
21
c64cb1f6 22using std::vector;
23
0879e280 24#define ANALYSIS_TYPES 7
25#define MAXIMUM_NUMBER_OF_STEPS 1024
26#define MAXIMUM_STEPS_IN_PSI 360
27
0879e280 28class TH1D;
29class TH2D;
30class TH3D;
31
683cbfb5 32const Int_t kTrackVariablesSingle = 3; // track variables in histogram (event class, pTtrig, vertexZ)
33const Int_t kTrackVariablesPair = 6; // track variables in histogram (event class, dEta, dPhi, pTtrig, ptAssociated, vertexZ)
0879e280 34const TString gBFPsiAnalysisType[ANALYSIS_TYPES] = {"y","eta","qlong","qout","qside","qinv","phi"};
35
36class AliBalancePsi : public TObject {
37 public:
38 enum EAnalysisType {
39 kRapidity = 0,
40 kEta = 1,
41 kQlong = 2,
42 kQout = 3,
43 kQside = 4,
44 kQinv = 5,
45 kPhi = 6
46 };
47
48 AliBalancePsi();
49 AliBalancePsi(const AliBalancePsi& balance);
50 ~AliBalancePsi();
51
0879e280 52 void SetCentralityIdentifier(const char* centralityId) {
53 fCentralityId = centralityId;}
54
55 void SetAnalysisLevel(const char* analysisLevel) {
56 fAnalysisLevel = analysisLevel;}
9fd4b54e 57 void SetShuffle(Bool_t shuffle) {fShuffle = shuffle;}
0879e280 58 void SetCentralityInterval(Double_t cStart, Double_t cStop) { fCentStart = cStart; fCentStop = cStop;};
f0fb4ac1 59 void SetEventClass(TString receivedEventClass){ fEventClass = receivedEventClass; }
7c04a4d2 60 void SetDeltaEtaMax(Double_t receivedDeltaEtaMax){ fDeltaEtaMax = receivedDeltaEtaMax; }
683cbfb5 61 void SetVertexZBinning(Bool_t receivedVertexBinning=kTRUE){ fVertexBinning = receivedVertexBinning; }
ea9867da 62 void SetCustomBinning(TString receivedCustomBinning) { fCustomBinning = receivedCustomBinning; }
0879e280 63
64 void InitHistograms(void);
65
66 const char* GetAnalysisLevel() {return fAnalysisLevel.Data();}
67 Int_t GetNumberOfAnalyzedEvent() {return fAnalyzedEvents;}
68
621329de 69 void CalculateBalance(Double_t gReactionPlane,
f06d59b3 70 TObjArray* particles,
73609a48 71 TObjArray* particlesMixed,
f0fb4ac1 72 Float_t bSign,
683cbfb5 73 Double_t kMultorCent = -100,
74 Double_t vertexZ = 0);
0879e280 75
34616eda 76 TH2D *GetCorrelationFunction(TString type,
77 Double_t psiMin, Double_t psiMax,
78 Double_t vertexZMin=-1,
79 Double_t vertexZMax=-1,
80 Double_t ptTriggerMin=-1.,
81 Double_t ptTriggerMax=-1.,
82 Double_t ptAssociatedMin=-1.,
83 Double_t ptAssociatedMax=-1,
84 AliBalancePsi *bMixed=NULL);
6acdbcb2 85 TH2D *GetCorrelationFunctionPN(Double_t psiMin, Double_t psiMax,
20006629 86 Double_t vertexZMin=-1,
87 Double_t vertexZMax=-1,
6acdbcb2 88 Double_t ptTriggerMin=-1.,
89 Double_t ptTriggerMax=-1.,
90 Double_t ptAssociatedMin=-1.,
47e040b5 91 Double_t ptAssociatedMax=-1);
6acdbcb2 92 TH2D *GetCorrelationFunctionNP(Double_t psiMin, Double_t psiMax,
20006629 93 Double_t vertexZMin=-1,
94 Double_t vertexZMax=-1,
6acdbcb2 95 Double_t ptTriggerMin=-1.,
96 Double_t ptTriggerMax=-1.,
97 Double_t ptAssociatedMin=-1.,
47e040b5 98 Double_t ptAssociatedMax=-1);
6acdbcb2 99 TH2D *GetCorrelationFunctionPP(Double_t psiMin, Double_t psiMax,
20006629 100 Double_t vertexZMin=-1,
101 Double_t vertexZMax=-1,
6acdbcb2 102 Double_t ptTriggerMin=-1.,
103 Double_t ptTriggerMax=-1.,
104 Double_t ptAssociatedMin=-1.,
47e040b5 105 Double_t ptAssociatedMax=-1);
6acdbcb2 106 TH2D *GetCorrelationFunctionNN(Double_t psiMin, Double_t psiMax,
20006629 107 Double_t vertexZMin=-1,
108 Double_t vertexZMax=-1,
6acdbcb2 109 Double_t ptTriggerMin=-1.,
110 Double_t ptTriggerMax=-1.,
111 Double_t ptAssociatedMin=-1.,
20006629 112 Double_t ptAssociatedMax=-1);
7b610f27 113 TH2D *GetCorrelationFunctionChargeIndependent(Double_t psiMin, Double_t psiMax,
20006629 114 Double_t vertexZMin=-1,
115 Double_t vertexZMax=-1,
7b610f27 116 Double_t ptTriggerMin=-1.,
117 Double_t ptTriggerMax=-1.,
118 Double_t ptAssociatedMin=-1.,
47e040b5 119 Double_t ptAssociatedMax=-1);
a38fd7f3 120
9afe3098 121 AliTHn *GetHistNp() {return fHistP;}
122 AliTHn *GetHistNn() {return fHistN;}
123 AliTHn *GetHistNpn() {return fHistPN;}
124 AliTHn *GetHistNnp() {return fHistNP;}
125 AliTHn *GetHistNpp() {return fHistPP;}
126 AliTHn *GetHistNnn() {return fHistNN;}
127
a38fd7f3 128 void SetHistNp(AliTHn *gHist) {
129 fHistP = gHist; }//fHistP->FillParent(); fHistP->DeleteContainers();}
130 void SetHistNn(AliTHn *gHist) {
131 fHistN = gHist; }//fHistN->FillParent(); fHistN->DeleteContainers();}
132 void SetHistNpn(AliTHn *gHist) {
133 fHistPN = gHist; }//fHistPN->FillParent(); fHistPN->DeleteContainers();}
134 void SetHistNnp(AliTHn *gHist) {
135 fHistNP = gHist; }//fHistNP->FillParent(); fHistNP->DeleteContainers();}
136 void SetHistNpp(AliTHn *gHist) {
137 fHistPP = gHist; }//fHistPP->FillParent(); fHistPP->DeleteContainers();}
138 void SetHistNnn(AliTHn *gHist) {
139 fHistNN = gHist; }//fHistNN->FillParent(); fHistNN->DeleteContainers();}
9afe3098 140
141 TH1D *GetBalanceFunctionHistogram(Int_t iVariableSingle,
142 Int_t iVariablePair,
6acdbcb2 143 Double_t psiMin, Double_t psiMax,
20006629 144 Double_t vertexZMin=-1,
145 Double_t vertexZMax=-1,
6acdbcb2 146 Double_t ptTriggerMin=-1.,
147 Double_t ptTriggerMax=-1.,
148 Double_t ptAssociatedMin=-1.,
20006629 149 Double_t ptAssociatedMax=-1); //
6acdbcb2 150
f0c5040c 151 TH1D *GetBalanceFunctionHistogram2pMethod(Int_t iVariableSingle,
20006629 152 Int_t iVariablePair,
153 Double_t psiMin, Double_t psiMax,
154 Double_t vertexZMin=-1,
155 Double_t vertexZMax=-1,
156 Double_t ptTriggerMin=-1.,
157 Double_t ptTriggerMax=-1.,
158 Double_t ptAssociatedMin=-1.,
159 Double_t ptAssociatedMax=-1,
160 AliBalancePsi *bfMix=NULL);
f0c5040c 161
6acdbcb2 162 TH2D *GetBalanceFunctionDeltaEtaDeltaPhi(Double_t psiMin, Double_t psiMax,
20006629 163 Double_t vertexZMin=-1,
164 Double_t vertexZMax=-1,
6acdbcb2 165 Double_t ptTriggerMin=-1.,
166 Double_t ptTriggerMax=-1.,
167 Double_t ptAssociatedMin=-1.,
20006629 168 Double_t ptAssociatedMax=-1);
621329de 169
f0c5040c 170 TH2D *GetBalanceFunctionDeltaEtaDeltaPhi2pMethod(Double_t psiMin, Double_t psiMax,
20006629 171 Double_t vertexZMin=-1,
172 Double_t vertexZMax=-1,
f0c5040c 173 Double_t ptTriggerMin=-1.,
174 Double_t ptTriggerMax=-1.,
175 Double_t ptAssociatedMin=-1.,
176 Double_t ptAssociatedMax=-1.,
177 AliBalancePsi *bfMix=NULL);
f2e8af26 178
179 TH1D *GetBalanceFunction1DFrom2D2pMethod(Bool_t bPhi,
180 Double_t psiMin, Double_t psiMax,
20006629 181 Double_t vertexZMin=-1,
182 Double_t vertexZMax=-1,
f2e8af26 183 Double_t ptTriggerMin=-1.,
184 Double_t ptTriggerMax=-1.,
185 Double_t ptAssociatedMin=-1.,
186 Double_t ptAssociatedMax=-1.,
187 AliBalancePsi *bfMix=NULL);
188
1822002d 189 Bool_t GetMomentsAnalytical(Int_t fVariable, TH1D* gHist, Bool_t kUseZYAM,
f2e8af26 190 Double_t &mean, Double_t &meanError,
191 Double_t &sigma, Double_t &sigmaError,
192 Double_t &skewness, Double_t &skewnessError,
193 Double_t &kurtosis, Double_t &kurtosisError);
f0c5040c 194
73609a48 195 TH2D *GetQAHistHBTbefore() {return fHistHBTbefore;}
196 TH2D *GetQAHistHBTafter() {return fHistHBTafter;}
03f5696b 197 TH3D *GetQAHistConversionbefore() {return fHistConversionbefore;}
198 TH3D *GetQAHistConversionafter() {return fHistConversionafter;}
e9caebd2 199 TH2D *GetQAHistPsiMinusPhi() {return fHistPsiMinusPhi;}
f0754617 200 TH3D *GetQAHistResonancesBefore() {return fHistResonancesBefore;}
201 TH3D *GetQAHistResonancesRho() {return fHistResonancesRho;}
202 TH3D *GetQAHistResonancesK0() {return fHistResonancesK0;}
203 TH3D *GetQAHistResonancesLambda() {return fHistResonancesLambda;}
5a861dc6 204 TH3D *GetQAHistQbefore() {return fHistQbefore;}
205 TH3D *GetQAHistQafter() {return fHistQafter;}
73609a48 206
2922bbe3 207 void UseResonancesCut() {fResonancesCut = kTRUE;}
d9eb282c 208 void UseHBTCut(Double_t setHBTCutValue = 0.02) {
209 fHBTCut = kTRUE; fHBTCutValue = setHBTCutValue;}
a9737921 210 void UseConversionCut(Double_t setInvMassCutConversion = 0.04) {
211 fConversionCut = kTRUE; fInvMassCutConversion = setInvMassCutConversion; }
6fa567bd 212 void UseMomentumDifferenceCut(Double_t gDeltaPtCutMin) {
213 fQCut = kTRUE; fDeltaPtMin = gDeltaPtCutMin;}
73609a48 214
ea9867da 215 // related to customized binning of output AliTHn
216 Bool_t IsUseVertexBinning() { return fVertexBinning; }
217 TString GetBinningString() { return fBinningString; }
218 Double_t* GetBinning(const char* configuration, const char* tag, Int_t& nBins);
219
0879e280 220 private:
ea9867da 221 Float_t GetDPhiStar(Float_t phi1, Float_t pt1, Float_t charge1, Float_t phi2, Float_t pt2, Float_t charge2, Float_t radius, Float_t bSign);
73609a48 222
9fd4b54e 223 Bool_t fShuffle; //shuffled balance function object
0879e280 224 TString fAnalysisLevel; //ESD, AOD or MC
225 Int_t fAnalyzedEvents; //number of events that have been analyzed
226
227 TString fCentralityId;//Centrality identifier to be used for the histo naming
228
0879e280 229 Double_t fCentStart;
230 Double_t fCentStop;
231
9afe3098 232 AliTHn *fHistP; //N+
233 AliTHn *fHistN; //N-
234 AliTHn *fHistPN; //N+-
235 AliTHn *fHistNP; //N-+
236 AliTHn *fHistPP; //N++
237 AliTHn *fHistNN; //N--
0879e280 238
73609a48 239 //QA histograms
240 TH2D *fHistHBTbefore; // Delta Eta vs. Delta Phi before HBT inspired cuts
241 TH2D *fHistHBTafter; // Delta Eta vs. Delta Phi after HBT inspired cuts
03f5696b 242 TH3D *fHistConversionbefore; // 3D histogram (Deta,Dphi,Invmass) before Conversion cuts
243 TH3D *fHistConversionafter; // 3D histogram (Deta,Dphi,Invmass) before Conversion cuts
f0754617 244 TH2D *fHistPsiMinusPhi;// psi - phi QA histogram
245 TH3D *fHistResonancesBefore; // 3D histogram (Deta,Dphi,Invmass) before resonance cuts
246 TH3D *fHistResonancesRho; // 3D histogram (Deta,Dphi,Invmass) after removing rho
247 TH3D *fHistResonancesK0; // 3D histogram (Deta,Dphi,Invmass) after removing rho, K0
5a861dc6 248 TH3D *fHistResonancesLambda; // 3D histogram (Deta,Dphi,Invmass) after removing rho, K0, and Lambda
249 TH3D *fHistQbefore; // Delta Eta vs. Delta Phi before cut on momentum difference
250 TH3D *fHistQafter; // Delta Eta vs. Delta Phi after cut on momentum difference
73609a48 251
0879e280 252 Double_t fPsiInterval;// interval in Psi-phi1
7c04a4d2 253 Double_t fDeltaEtaMax;// maximum delta eta for output THnSparse
0879e280 254
2922bbe3 255 Bool_t fResonancesCut;//resonances cut
5a861dc6 256 Bool_t fHBTCut;//cut for two-track efficiency (like HBT group)
d9eb282c 257 Double_t fHBTCutValue;// value for two-track efficiency cut (default = 0.02 from dphicorrelations)
73609a48 258 Bool_t fConversionCut;//conversion cut
a9737921 259 Double_t fInvMassCutConversion;//invariant mass for conversion cut
5a861dc6 260 Bool_t fQCut;//cut on momentum difference to suppress femtoscopic effect correlations
6fa567bd 261 Double_t fDeltaPtMin;//delta pt cut: minimum value
683cbfb5 262 Bool_t fVertexBinning;//use vertex z binning in AliTHn
ea9867da 263 TString fCustomBinning;//for setting customized binning
264 TString fBinningString;//final binning string
73609a48 265
7c04a4d2 266 TString fEventClass;
f0fb4ac1 267
0879e280 268 AliBalancePsi & operator=(const AliBalancePsi & ) {return *this;}
269
a9737921 270 ClassDef(AliBalancePsi, 2)
0879e280 271};
272
273#endif