AliPhysics  db95e02 (db95e02)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskRhoFlow.cxx
Go to the documentation of this file.
1 //
2 // Calculation of rho for flow bias studies
3 //
4 // Author: S.Aiola
5 
7 
8 #include <TClonesArray.h>
9 #include <TMath.h>
10 #include <TH2F.h>
11 
12 #include "AliVTrack.h"
13 #include "AliLog.h"
14 #include "AliRhoParameter.h"
15 #include "AliParticleContainer.h"
16 
18 
19 //________________________________________________________________________
22  fRhoNearSide(0),
23  fRhoAwaySide(0),
24  fRhoPerpSide1(0),
25  fRhoPerpSide2(0),
26  fHistRhoNearVsCent(0),
27  fHistDeltaRhoNearVsCent(0),
28  fHistRhoAwayVsCent(0),
29  fHistDeltaRhoAwayVsCent(0),
30  fHistRhoPerp1VsCent(0),
31  fHistDeltaRhoPerp1VsCent(0),
32  fHistRhoPerp2VsCent(0),
33  fHistDeltaRhoPerp2VsCent(0)
34 {
35  // Constructor.
36  SetAttachToEvent(kFALSE);
37 }
38 
39 //________________________________________________________________________
41  AliAnalysisTaskRho(name, kTRUE),
42  fRhoNearSide(0),
43  fRhoAwaySide(0),
44  fRhoPerpSide1(0),
45  fRhoPerpSide2(0),
46  fHistRhoNearVsCent(0),
47  fHistDeltaRhoNearVsCent(0),
48  fHistRhoAwayVsCent(0),
49  fHistDeltaRhoAwayVsCent(0),
50  fHistRhoPerp1VsCent(0),
51  fHistDeltaRhoPerp1VsCent(0),
52  fHistRhoPerp2VsCent(0),
53  fHistDeltaRhoPerp2VsCent(0)
54 {
55  // Constructor.
56  SetAttachToEvent(kFALSE);
57 }
58 
59 //________________________________________________________________________
61 {
62  // User create output objects, called at the beginning of the analysis.
63 
65 
66  fHistRhoNearVsCent = new TH2F("RhoNearVsCent", "RhoNearVsCent", 101, -1, 100, fNbins, fMinBinPt, fMaxBinPt*2);
68 
69  fHistRhoAwayVsCent = new TH2F("RhoAwayVsCent", "RhoAwayVsCent", 101, -1, 100, fNbins, fMinBinPt, fMaxBinPt*2);
71 
72  fHistRhoPerp1VsCent = new TH2F("RhoPerp1VsCent", "RhoPerp1VsCent", 101, -1, 100, fNbins, fMinBinPt, fMaxBinPt*2);
74 
75  fHistRhoPerp2VsCent = new TH2F("RhoPerp2VsCent", "RhoPerp2VsCent", 101, -1, 100, fNbins, fMinBinPt, fMaxBinPt*2);
77 
78  if (!fCompareRhoName.IsNull()) {
79  fHistDeltaRhoNearVsCent = new TH2F("DeltaRhoNearVsCent", "DeltaRhoNearVsCent", 101, -1, 100, fNbins, -fMaxBinPt, fMaxBinPt);
81 
82  fHistDeltaRhoAwayVsCent = new TH2F("DeltaRhoAwayVsCent", "DeltaRhoAwayVsCent", 101, -1, 100, fNbins, -fMaxBinPt, fMaxBinPt);
84 
85  fHistDeltaRhoPerp1VsCent = new TH2F("DeltaRhoPerp1VsCent", "DeltaRhoPerp1VsCent", 101, -1, 100, fNbins, -fMaxBinPt, fMaxBinPt);
87 
88  fHistDeltaRhoPerp2VsCent = new TH2F("DeltaRhoPerp2VsCent", "DeltaRhoPerp2VsCent", 101, -1, 100, fNbins, -fMaxBinPt, fMaxBinPt);
90  }
91 }
92 
93 //________________________________________________________________________
95 {
97  if (!tracks) return kFALSE;
98 
99  Double_t jetRadius = GetJetRadius();
100  Double_t maxTrackPhi = -1;
101  Double_t maxTrackPt = 0;
102 
103  AliVParticle *track = 0;
104  tracks->ResetCurrentID();
105  while ((track = tracks->GetNextAcceptParticle())) {
106 
107  if (track->Pt() > maxTrackPt) {
108  maxTrackPt = track->Pt();
109  maxTrackPhi = track->Phi();
110  }
111  }
112 
113  Double_t minPhi = -1;
114  Double_t maxPhi = -1;
115 
116  // away side
117  minPhi = maxTrackPhi + TMath::Pi() - TMath::Pi()/4 + jetRadius;
118  maxPhi = maxTrackPhi + TMath::Pi() + TMath::Pi()/4 + jetRadius;
119  if (maxPhi > TMath::Pi() * 2) {
120  minPhi -= TMath::Pi() * 2;
121  maxPhi -= TMath::Pi() * 2;
122  }
123  SetJetPhiLimits(minPhi, maxPhi);
124  fNExclLeadJets = 1;
126  fRhoAwaySide = fOutRho->GetVal();
127 
128  // perp 1 side
129  minPhi = maxTrackPhi + TMath::Pi()/2 - TMath::Pi()/4 + jetRadius;
130  maxPhi = maxTrackPhi + TMath::Pi()/2 + TMath::Pi()/4 + jetRadius;
131  if (maxPhi > TMath::Pi() * 2) {
132  minPhi -= TMath::Pi() * 2;
133  maxPhi -= TMath::Pi() * 2;
134  }
135  SetJetPhiLimits(minPhi, maxPhi);
136  fNExclLeadJets = 0;
138  fRhoPerpSide1 = fOutRho->GetVal();
139 
140  // perp 2 side
141  minPhi = maxTrackPhi - TMath::Pi()/2 - TMath::Pi()/4 + jetRadius;
142  maxPhi = maxTrackPhi - TMath::Pi()/2 + TMath::Pi()/4 + jetRadius;
143  if (maxPhi > TMath::Pi() * 2) {
144  minPhi -= TMath::Pi() * 2;
145  maxPhi -= TMath::Pi() * 2;
146  }
147  SetJetPhiLimits(minPhi, maxPhi);
148  fNExclLeadJets = 0;
150  fRhoPerpSide2 = fOutRho->GetVal();
151 
152  // near side
153  minPhi = maxTrackPhi - TMath::Pi()/4 + jetRadius;
154  maxPhi = maxTrackPhi + TMath::Pi()/4 + jetRadius;
155  if (maxPhi > TMath::Pi() * 2) {
156  minPhi -= TMath::Pi() * 2;
157  maxPhi -= TMath::Pi() * 2;
158  }
159  SetJetPhiLimits(minPhi, maxPhi);
160  fNExclLeadJets = 1;
162  fRhoNearSide = fOutRho->GetVal();
163 
164  return kTRUE;
165 }
166 
167 //________________________________________________________________________
169 {
170  // Fill histograms.
171 
176 
177  if (fCompareRho) {
182  }
183 
184  return kTRUE;
185 }
AliRhoParameter * fCompareRho
output scaled rho object
TH2F * fHistRhoNearVsCent
Rho in the perpendicular side 2.
TH2F * fHistRhoAwayVsCent
Rho - rho_near vs. centrality.
virtual AliVParticle * GetNextAcceptParticle()
double Double_t
Definition: External.C:58
Definition: External.C:236
TH2F * fHistDeltaRhoAwayVsCent
Away side rho vs. centrality.
TH2F * fHistDeltaRhoPerp2VsCent
Perpendicualr side 2 rho vs. centrality.
Double_t fRhoPerpSide2
Rho in the perpendicular side 1.
Double_t fMinBinPt
min pt in histograms
Double_t fRhoAwaySide
Rho in the near side.
Container for particles within the EMCAL framework.
Double_t GetJetRadius(Int_t i=0) const
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Double_t fCent
!event centrality
TH2F * fHistDeltaRhoPerp1VsCent
Perpendicualr side 1 rho vs. centrality.
void SetJetPhiLimits(Float_t min, Float_t max, Int_t c=0)
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
TH2F * fHistRhoPerp1VsCent
Rho - rho_away vs. centrality.
TH2F * fHistRhoPerp2VsCent
Rho - rho_perp1 vs. centrality.
ClassImp(AliAnalysisTaskRhoFlow) AliAnalysisTaskRhoFlow
TH2F * fHistDeltaRhoNearVsCent
Near side rho vs. centrality.
bool Bool_t
Definition: External.C:53
Int_t fNbins
no. of pt bins
Double_t fRhoPerpSide1
Rho in the away side.