]>
Commit | Line | Data |
---|---|---|
8628b70c | 1 | // $Id$ |
b31a78d4 | 2 | // |
3 | // Calculation of rho for flow bias studies | |
4 | // | |
5 | // Author: S.Aiola | |
6 | ||
7 | #include "AliAnalysisTaskRhoFlow.h" | |
8 | ||
9 | #include <TClonesArray.h> | |
10 | #include <TMath.h> | |
11 | #include <TH2F.h> | |
12 | ||
13 | #include "AliVTrack.h" | |
14 | #include "AliLog.h" | |
15 | #include "AliRhoParameter.h" | |
16 | ||
17 | ClassImp(AliAnalysisTaskRhoFlow) | |
18 | ||
19 | //________________________________________________________________________ | |
20 | AliAnalysisTaskRhoFlow::AliAnalysisTaskRhoFlow() : | |
21 | AliAnalysisTaskRho("AliAnalysisTaskRhoFlow",kTRUE), | |
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 | //________________________________________________________________________ | |
40 | AliAnalysisTaskRhoFlow::AliAnalysisTaskRhoFlow(const char *name) : | |
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 | //________________________________________________________________________ | |
60 | void AliAnalysisTaskRhoFlow::UserCreateOutputObjects() | |
61 | { | |
62 | // User create output objects, called at the beginning of the analysis. | |
63 | ||
9239b066 | 64 | AliAnalysisTaskEmcalJet::UserCreateOutputObjects(); |
b31a78d4 | 65 | |
66 | fHistRhoNearVsCent = new TH2F("RhoNearVsCent", "RhoNearVsCent", 101, -1, 100, fNbins, fMinBinPt, fMaxBinPt*2); | |
67 | fOutput->Add(fHistRhoNearVsCent); | |
68 | ||
69 | fHistRhoAwayVsCent = new TH2F("RhoAwayVsCent", "RhoAwayVsCent", 101, -1, 100, fNbins, fMinBinPt, fMaxBinPt*2); | |
70 | fOutput->Add(fHistRhoAwayVsCent); | |
71 | ||
72 | fHistRhoPerp1VsCent = new TH2F("RhoPerp1VsCent", "RhoPerp1VsCent", 101, -1, 100, fNbins, fMinBinPt, fMaxBinPt*2); | |
73 | fOutput->Add(fHistRhoPerp1VsCent); | |
74 | ||
75 | fHistRhoPerp2VsCent = new TH2F("RhoPerp2VsCent", "RhoPerp2VsCent", 101, -1, 100, fNbins, fMinBinPt, fMaxBinPt*2); | |
76 | fOutput->Add(fHistRhoPerp2VsCent); | |
77 | ||
78 | if (!fCompareRhoName.IsNull()) { | |
79 | fHistDeltaRhoNearVsCent = new TH2F("DeltaRhoNearVsCent", "DeltaRhoNearVsCent", 101, -1, 100, fNbins, -fMaxBinPt, fMaxBinPt); | |
80 | fOutput->Add(fHistDeltaRhoNearVsCent); | |
81 | ||
82 | fHistDeltaRhoAwayVsCent = new TH2F("DeltaRhoAwayVsCent", "DeltaRhoAwayVsCent", 101, -1, 100, fNbins, -fMaxBinPt, fMaxBinPt); | |
83 | fOutput->Add(fHistDeltaRhoAwayVsCent); | |
84 | ||
85 | fHistDeltaRhoPerp1VsCent = new TH2F("DeltaRhoPerp1VsCent", "DeltaRhoPerp1VsCent", 101, -1, 100, fNbins, -fMaxBinPt, fMaxBinPt); | |
86 | fOutput->Add(fHistDeltaRhoPerp1VsCent); | |
87 | ||
88 | fHistDeltaRhoPerp2VsCent = new TH2F("DeltaRhoPerp2VsCent", "DeltaRhoPerp2VsCent", 101, -1, 100, fNbins, -fMaxBinPt, fMaxBinPt); | |
89 | fOutput->Add(fHistDeltaRhoPerp2VsCent); | |
90 | } | |
91 | } | |
92 | ||
93 | //________________________________________________________________________ | |
94 | Bool_t AliAnalysisTaskRhoFlow::Run() | |
95 | { | |
96 | if (!fTracks) | |
97 | return kFALSE; | |
98 | ||
7cd832c7 | 99 | Double_t jetRadius = GetJetRadius(); |
b31a78d4 | 100 | Double_t maxTrackPhi = -1; |
101 | Double_t maxTrackPt = 0; | |
102 | ||
103 | for (Int_t i = 0; i < fTracks->GetEntriesFast(); i++) { | |
104 | AliVTrack *track = static_cast<AliVTrack*>(fTracks->At(i)); | |
105 | if (!track) | |
106 | continue; | |
107 | if (!AcceptTrack(track)) | |
108 | continue; | |
109 | ||
110 | if (track->Pt() > maxTrackPt) { | |
111 | maxTrackPt = track->Pt(); | |
112 | maxTrackPhi = track->Phi(); | |
113 | } | |
114 | } | |
115 | ||
116 | Double_t minPhi = -1; | |
117 | Double_t maxPhi = -1; | |
118 | ||
119 | // away side | |
7cd832c7 | 120 | minPhi = maxTrackPhi + TMath::Pi() - TMath::Pi()/4 + jetRadius; |
121 | maxPhi = maxTrackPhi + TMath::Pi() + TMath::Pi()/4 + jetRadius; | |
b31a78d4 | 122 | if (maxPhi > TMath::Pi() * 2) { |
123 | minPhi -= TMath::Pi() * 2; | |
124 | maxPhi -= TMath::Pi() * 2; | |
125 | } | |
126 | SetJetPhiLimits(minPhi, maxPhi); | |
393ec2ad | 127 | fNExclLeadJets = 1; |
b31a78d4 | 128 | AliAnalysisTaskRho::Run(); |
7cd832c7 | 129 | fRhoAwaySide = fOutRho->GetVal(); |
b31a78d4 | 130 | |
131 | // perp 1 side | |
7cd832c7 | 132 | minPhi = maxTrackPhi + TMath::Pi()/2 - TMath::Pi()/4 + jetRadius; |
133 | maxPhi = maxTrackPhi + TMath::Pi()/2 + TMath::Pi()/4 + jetRadius; | |
b31a78d4 | 134 | if (maxPhi > TMath::Pi() * 2) { |
135 | minPhi -= TMath::Pi() * 2; | |
136 | maxPhi -= TMath::Pi() * 2; | |
137 | } | |
138 | SetJetPhiLimits(minPhi, maxPhi); | |
393ec2ad | 139 | fNExclLeadJets = 0; |
b31a78d4 | 140 | AliAnalysisTaskRho::Run(); |
7cd832c7 | 141 | fRhoPerpSide1 = fOutRho->GetVal(); |
b31a78d4 | 142 | |
143 | // perp 2 side | |
7cd832c7 | 144 | minPhi = maxTrackPhi - TMath::Pi()/2 - TMath::Pi()/4 + jetRadius; |
145 | maxPhi = maxTrackPhi - TMath::Pi()/2 + TMath::Pi()/4 + jetRadius; | |
b31a78d4 | 146 | if (maxPhi > TMath::Pi() * 2) { |
147 | minPhi -= TMath::Pi() * 2; | |
148 | maxPhi -= TMath::Pi() * 2; | |
149 | } | |
150 | SetJetPhiLimits(minPhi, maxPhi); | |
393ec2ad | 151 | fNExclLeadJets = 0; |
b31a78d4 | 152 | AliAnalysisTaskRho::Run(); |
7cd832c7 | 153 | fRhoPerpSide2 = fOutRho->GetVal(); |
b31a78d4 | 154 | |
155 | // near side | |
7cd832c7 | 156 | minPhi = maxTrackPhi - TMath::Pi()/4 + jetRadius; |
157 | maxPhi = maxTrackPhi + TMath::Pi()/4 + jetRadius; | |
b31a78d4 | 158 | if (maxPhi > TMath::Pi() * 2) { |
159 | minPhi -= TMath::Pi() * 2; | |
160 | maxPhi -= TMath::Pi() * 2; | |
161 | } | |
393ec2ad | 162 | SetJetPhiLimits(minPhi, maxPhi); |
163 | fNExclLeadJets = 1; | |
b31a78d4 | 164 | AliAnalysisTaskRho::Run(); |
7cd832c7 | 165 | fRhoNearSide = fOutRho->GetVal(); |
b31a78d4 | 166 | |
167 | return kTRUE; | |
168 | } | |
169 | ||
170 | //________________________________________________________________________ | |
171 | Bool_t AliAnalysisTaskRhoFlow::FillHistograms() | |
172 | { | |
173 | // Fill histograms. | |
174 | ||
175 | fHistRhoNearVsCent->Fill(fCent, fRhoNearSide); | |
176 | fHistRhoAwayVsCent->Fill(fCent, fRhoAwaySide); | |
177 | fHistRhoPerp1VsCent->Fill(fCent, fRhoPerpSide1); | |
178 | fHistRhoPerp2VsCent->Fill(fCent, fRhoPerpSide2); | |
179 | ||
180 | if (fCompareRho) { | |
181 | fHistDeltaRhoNearVsCent->Fill(fCent, fRhoNearSide - fCompareRho->GetVal()); | |
182 | fHistDeltaRhoAwayVsCent->Fill(fCent, fRhoAwaySide - fCompareRho->GetVal()); | |
183 | fHistDeltaRhoPerp1VsCent->Fill(fCent, fRhoPerpSide1 - fCompareRho->GetVal()); | |
184 | fHistDeltaRhoPerp2VsCent->Fill(fCent, fRhoPerpSide2 - fCompareRho->GetVal()); | |
185 | } | |
186 | ||
187 | return kTRUE; | |
188 | } |