]>
Commit | Line | Data |
---|---|---|
9e64e697 | 1 | // $Id: AliAnalysisTaskEmcalJetSpectraMECpA.cxx 3010 2012-06-10 05:40:56Z loizides $ |
d7afd9ac | 2 | // |
3 | // Jet spectrum task. | |
4 | // | |
5 | // Author: R.Reed, M.Connors | |
6 | ||
7 | #include "AliAnalysisTaskEmcalJetSpectraMECpA.h" | |
8 | ||
9 | #include <TCanvas.h> | |
10 | #include <TChain.h> | |
11 | #include <TClonesArray.h> | |
12 | #include <TH1F.h> | |
13 | #include <TH2F.h> | |
14 | #include <TH3F.h> | |
15 | #include <THnSparse.h> | |
16 | #include <TList.h> | |
17 | #include <TLorentzVector.h> | |
18 | #include <TParameter.h> | |
19 | #include <TParticle.h> | |
20 | #include <TTree.h> | |
21 | #include <TVector3.h> | |
22 | ||
23 | #include "AliAODEvent.h" | |
24 | #include "AliAnalysisManager.h" | |
25 | #include "AliAnalysisTask.h" | |
26 | #include "AliCentrality.h" | |
27 | #include "AliESDEvent.h" | |
28 | #include "AliESDInputHandler.h" | |
29 | #include "AliEmcalJet.h" | |
30 | #include "AliVCluster.h" | |
31 | #include "AliRhoParameter.h" | |
32 | #include "AliEmcalParticle.h" | |
33 | ||
34 | ClassImp(AliAnalysisTaskEmcalJetSpectraMECpA) | |
35 | ||
36 | //________________________________________________________________________ | |
37 | AliAnalysisTaskEmcalJetSpectraMECpA::AliAnalysisTaskEmcalJetSpectraMECpA() : | |
38 | AliAnalysisTaskEmcalJet("spectra",kFALSE), | |
39 | fHistRhovsCent(0), | |
40 | fHistNjetvsCent(0) | |
41 | { | |
42 | // Default constructor. | |
43 | for (Int_t i = 0;i<6;++i){ | |
44 | fHistJetPtvsTrackPt[i] = 0; | |
45 | fHistRawJetPtvsTrackPt[i] = 0; | |
46 | fHistTrackPt[i] = 0; | |
47 | fHistEP0[i] = 0; | |
48 | fHistEP0A[i] = 0; | |
49 | fHistEP0C[i] = 0; | |
50 | fHistEPAvsC[i] = 0; | |
51 | fHistJetPtvsdEP[i] = 0; | |
52 | fHistJetPtvsdEPBias[i] = 0; | |
53 | fHistRhovsEP[i] = 0; | |
54 | fHistJetPtEtaPhi[i] = 0; | |
55 | ||
56 | } | |
d7afd9ac | 57 | SetMakeGeneralHistograms(kTRUE); |
58 | } | |
59 | ||
60 | //________________________________________________________________________ | |
61 | AliAnalysisTaskEmcalJetSpectraMECpA::AliAnalysisTaskEmcalJetSpectraMECpA(const char *name) : | |
62 | AliAnalysisTaskEmcalJet(name,kTRUE), | |
63 | fHistRhovsCent(0), | |
64 | fHistNjetvsCent(0) | |
65 | { | |
66 | for (Int_t i = 0;i<6;++i){ | |
67 | fHistJetPtvsTrackPt[i] = 0; | |
68 | fHistRawJetPtvsTrackPt[i] = 0; | |
69 | fHistTrackPt[i] = 0; | |
70 | fHistEP0[i] = 0; | |
71 | fHistEP0A[i] = 0; | |
72 | fHistEP0C[i] = 0; | |
73 | fHistEPAvsC[i] = 0; | |
74 | fHistJetPtvsdEP[i] = 0; | |
75 | fHistJetPtvsdEPBias[i] = 0; | |
76 | fHistRhovsEP[i] = 0; | |
77 | fHistJetPtEtaPhi[i] = 0; | |
78 | } | |
d7afd9ac | 79 | SetMakeGeneralHistograms(kTRUE); |
80 | } | |
81 | ||
82 | //________________________________________________________________________ | |
83 | void AliAnalysisTaskEmcalJetSpectraMECpA::UserCreateOutputObjects() | |
84 | { | |
85 | if (! fCreateHisto) | |
86 | return; | |
87 | AliAnalysisTaskEmcalJet::UserCreateOutputObjects(); | |
88 | ||
89 | fHistRhovsCent = new TH2F("RhovsCent", "RhovsCent", 100, 0.0, 100.0, 500, 0, 500); | |
e77cf839 | 90 | fHistRhoScvsCent = new TH2F("RhoScvsCent", "RhoScvsCent", 100, 0.0, 100.0, 500, 0, 500); |
d7afd9ac | 91 | fHistNjetvsCent = new TH2F("NjetvsCent", "NjetvsCent", 100, 0.0, 100.0, 100, 0, 100); |
92 | ||
93 | TString name; | |
94 | TString title; | |
95 | for (Int_t i = 0;i<6;++i){ | |
96 | name = TString(Form("JetPtvsTrackPt_%i",i)); | |
97 | title = TString(Form("Jet pT vs Leading Track pT cent bin %i",i)); | |
98 | fHistJetPtvsTrackPt[i] = new TH2F(name,title,1000,-500,500,100,0,100); | |
99 | fOutput->Add(fHistJetPtvsTrackPt[i]); | |
e77cf839 | 100 | |
101 | name = TString(Form("JetPtScvsTrackPt_%i",i)); | |
102 | title = TString(Form("Jet pT Rho_scaled vs Leading Track pT cent bin %i",i)); | |
103 | fHistJetPtScvsTrackPt[i] = new TH2F(name,title,1000,-500,500,100,0,100); | |
104 | fOutput->Add(fHistJetPtScvsTrackPt[i]); | |
105 | ||
d7afd9ac | 106 | name = TString(Form("RawJetPtvsTrackPt_%i",i)); |
107 | title = TString(Form("Raw Jet pT vs Leading Track pT cent bin %i",i)); | |
108 | fHistRawJetPtvsTrackPt[i] = new TH2F(name,title,1000,-500,500,100,0,100); | |
109 | fOutput->Add(fHistRawJetPtvsTrackPt[i]); | |
110 | name = TString(Form("TrackPt_%i",i)); | |
111 | title = TString(Form("Track pT cent bin %i",i)); | |
112 | fHistTrackPt[i] = new TH1F(name,title,1000,0,200); | |
113 | fOutput->Add(fHistTrackPt[i]); | |
114 | ||
115 | name = TString(Form("EP0_%i",i)); | |
116 | title = TString(Form("EP VZero cent bin %i",i)); | |
117 | fHistEP0[i] = new TH1F(name,title,100,-TMath::Pi(),TMath::Pi()); | |
118 | fOutput->Add(fHistEP0[i]); | |
119 | name = TString(Form("EP0A_%i",i)); | |
120 | title = TString(Form("EP VZero cent bin %i",i)); | |
121 | fHistEP0A[i] = new TH1F(name,title,100,-TMath::Pi(),TMath::Pi()); | |
122 | fOutput->Add(fHistEP0A[i]); | |
123 | name = TString(Form("EP0C_%i",i)); | |
124 | title = TString(Form("EP VZero cent bin %i",i)); | |
125 | fHistEP0C[i] = new TH1F(name,title,100,-TMath::Pi(),TMath::Pi()); | |
126 | fOutput->Add(fHistEP0C[i]); | |
127 | name = TString(Form("EPAvsC_%i",i)); | |
128 | title = TString(Form("EP VZero cent bin %i",i)); | |
129 | fHistEPAvsC[i] = new TH2F(name,title,100,-TMath::Pi(),TMath::Pi(),100,-TMath::Pi(),TMath::Pi()); | |
130 | fOutput->Add(fHistEPAvsC[i]); | |
131 | name = TString(Form("JetPtvsdEP_%i",i)); | |
132 | title = TString(Form("Jet pt vs dEP cent bin %i",i)); | |
133 | fHistJetPtvsdEP[i] = new TH2F(name,title,1000,-500,500,400,-2*TMath::Pi(),2*TMath::Pi()); | |
134 | fOutput->Add(fHistJetPtvsdEP[i]); | |
135 | name = TString(Form("JetPtvsdEPBias_%i",i)); | |
136 | title = TString(Form("Bias Jet pt vs dEP cent bin %i",i)); | |
137 | fHistJetPtvsdEPBias[i] = new TH2F(name,title,1000,-500,500,400,-2*TMath::Pi(),2*TMath::Pi()); | |
138 | fOutput->Add(fHistJetPtvsdEPBias[i]); | |
139 | name = TString(Form("JetPtvsEP_%i",i)); | |
140 | title = TString(Form("Jet pt vs EP cent bin %i",i)); | |
141 | fHistJetPtvsEP[i] = new TH2F(name,title,1000,-500,500,400,-2*TMath::Pi(),2*TMath::Pi()); | |
142 | fOutput->Add(fHistJetPtvsEP[i]); | |
143 | name = TString(Form("JetPtvsEPBias_%i",i)); | |
144 | title = TString(Form("Bias Jet pt vs EP cent bin %i",i)); | |
145 | fHistJetPtvsEPBias[i] = new TH2F(name,title,1000,-500,500,400,-2*TMath::Pi(),2*TMath::Pi()); | |
146 | fOutput->Add(fHistJetPtvsEPBias[i]); | |
147 | name = TString(Form("RhovsEP_%i",i)); | |
148 | title = TString(Form("Rho vs EP cent bin %i",i)); | |
149 | fHistRhovsEP[i] = new TH2F(name,title,500,0,500,400,-2*TMath::Pi(),2*TMath::Pi()); | |
150 | fOutput->Add(fHistRhovsEP[i]); | |
151 | ||
152 | name = TString(Form("JetPtEtaPhi_%i",i)); | |
153 | title = TString(Form("JetPtEtaPhi_%i",i)); | |
154 | fHistJetPtEtaPhi[i] = new TH3F(name,title,300,-100,200,26,-0.8,0.8,400,-2*TMath::Pi(),2*TMath::Pi()); | |
155 | fOutput->Add(fHistJetPtEtaPhi[i]); | |
156 | ||
157 | ||
158 | } | |
159 | ||
160 | ||
161 | fOutput->Add(fHistRhovsCent); | |
162 | fOutput->Add(fHistNjetvsCent); | |
163 | ||
164 | PostData(1, fOutput); | |
165 | } | |
166 | ||
167 | //________________________________________________________________________ | |
168 | ||
169 | Int_t AliAnalysisTaskEmcalJetSpectraMECpA::GetCentBin(Double_t cent) const | |
170 | { | |
171 | // Get centrality bin. | |
172 | ||
173 | Int_t centbin = -1; | |
174 | if (cent>=0 && cent<10) | |
175 | centbin = 0; | |
176 | else if (cent>=10 && cent<20) | |
177 | centbin = 1; | |
178 | else if (cent>=20 && cent<30) | |
179 | centbin = 2; | |
180 | else if (cent>=30 && cent<40) | |
181 | centbin = 3; | |
182 | else if (cent>=40 && cent<50) | |
183 | centbin = 4; | |
184 | else if (cent>=50 && cent<90) | |
185 | centbin = 5; | |
186 | return centbin; | |
187 | } | |
188 | ||
189 | //________________________________________________________________________ | |
190 | ||
191 | Float_t AliAnalysisTaskEmcalJetSpectraMECpA:: RelativePhi(Double_t mphi,Double_t vphi) const | |
192 | { | |
193 | if (vphi < -1*TMath::Pi()) vphi += (2*TMath::Pi()); | |
194 | else if (vphi > TMath::Pi()) vphi -= (2*TMath::Pi()); | |
195 | if (mphi < -1*TMath::Pi()) mphi += (2*TMath::Pi()); | |
196 | else if (mphi > TMath::Pi()) mphi -= (2*TMath::Pi()); | |
197 | double dphi = mphi-vphi; | |
198 | if (dphi < -1*TMath::Pi()) dphi += (2*TMath::Pi()); | |
199 | else if (dphi > TMath::Pi()) dphi -= (2*TMath::Pi()); | |
200 | ||
201 | return dphi;//dphi in [-Pi, Pi] | |
202 | } | |
203 | ||
204 | ||
205 | //________________________________________________________________________ | |
206 | Bool_t AliAnalysisTaskEmcalJetSpectraMECpA::Run() | |
207 | { | |
9e64e697 | 208 | |
209 | ||
d7afd9ac | 210 | Int_t centbin = GetCentBin(fCent); |
211 | //for pp analyses we will just use the first centrality bin | |
212 | if (centbin == -1) | |
213 | centbin = 0; | |
214 | ||
215 | if (!fTracks){ | |
216 | cout << "Tracks not found: " << fCent << endl; | |
217 | return kTRUE; | |
218 | } | |
219 | ||
220 | const Int_t nTrack = fTracks->GetEntriesFast(); | |
221 | for (int i = 0;i<nTrack;i++){ | |
222 | AliVParticle *track = static_cast<AliVParticle*>(fTracks->At(i)); | |
223 | if (!track) | |
224 | continue; | |
225 | fHistTrackPt[centbin]->Fill(track->Pt()); | |
226 | } | |
227 | ||
228 | fHistEP0[centbin]->Fill(fEPV0); | |
229 | fHistEP0A[centbin]->Fill(fEPV0A); | |
230 | fHistEP0C[centbin]->Fill(fEPV0C); | |
231 | fHistEPAvsC[centbin]->Fill(fEPV0A,fEPV0C); | |
e77cf839 | 232 | |
233 | fRho = GetRhoFromEvent(fRhoName); | |
d7afd9ac | 234 | fRhoVal = fRho->GetVal(); |
235 | fHistRhovsCent->Fill(fCent,fRhoVal); | |
e77cf839 | 236 | fHistRhovsCent->Fill(fCent,fRhoVal); |
d7afd9ac | 237 | fHistRhovsEP[centbin]->Fill(fRhoVal,fEPV0); |
e77cf839 | 238 | |
239 | ||
240 | TString fRhoScaledName = fRhoName; | |
241 | fRhoScaledName.Append("_Scaled"); | |
242 | Double_t fRhoScVal = 0; | |
243 | AliRhoParameter *fRhoScaled=GetRhoFromEvent(fRhoScaledName); | |
244 | if(fRhoScaled){ | |
245 | fRhoScVal=fRhoScaled->GetVal(); | |
246 | if(fRhoScVal){ | |
247 | fHistRhoScvsCent->Fill(fCent,fRhoScVal); | |
248 | } | |
249 | } | |
d7afd9ac | 250 | const Int_t Njets = fJets->GetEntriesFast(); |
251 | ||
252 | Int_t NjetAcc = 0; | |
253 | for (Int_t iJets = 0; iJets < Njets; ++iJets) { | |
254 | AliEmcalJet *jet = static_cast<AliEmcalJet*>(fJets->At(iJets)); | |
255 | if (!jet) | |
256 | continue; | |
257 | if (jet->Area()==0) | |
258 | continue; | |
259 | if (jet->Pt()<0.1) | |
260 | continue; | |
261 | if (jet->MaxTrackPt()>100) | |
262 | continue; | |
263 | if (! AcceptJet(jet)) | |
264 | continue; | |
265 | // jets.push_back(jet); | |
266 | NjetAcc++; | |
267 | Double_t jetPt = -500; | |
268 | jetPt = jet->Pt()-jet->Area()*fRhoVal; | |
269 | fHistJetPtvsTrackPt[centbin]->Fill(jetPt,jet->MaxTrackPt()); | |
e77cf839 | 270 | |
271 | if(fRhoScVal) { | |
272 | Double_t jetPtSc = -500; | |
273 | jetPtSc = jet->Pt()-jet->Area()*fRhoScVal; | |
274 | fHistJetPtScvsTrackPt[centbin]->Fill(jetPtSc,jet->MaxTrackPt()); | |
275 | } | |
276 | ||
d7afd9ac | 277 | fHistRawJetPtvsTrackPt[centbin]->Fill(jet->Pt(),jet->MaxTrackPt()); |
278 | ||
279 | fHistJetPtEtaPhi[centbin]->Fill(jet->Pt(),jet->Eta(),jet->Phi()); | |
280 | ||
281 | fHistJetPtvsdEP[centbin]->Fill(jetPt,RelativePhi((fEPV0+TMath::Pi()),jet->Phi())); | |
282 | fHistJetPtvsEP[centbin]->Fill(jetPt,fEPV0); | |
283 | if (jet->MaxTrackPt()>5.0){ | |
284 | fHistJetPtvsdEPBias[centbin]->Fill(jetPt,RelativePhi((fEPV0+TMath::Pi()),jet->Phi())); | |
285 | fHistJetPtvsEPBias[centbin]->Fill(jetPt,fEPV0); | |
286 | } | |
287 | } | |
288 | ||
289 | fHistNjetvsCent->Fill(fCent,NjetAcc); | |
290 | return kTRUE; | |
291 | } | |
292 | ||
293 | ||
294 | ||
295 | ||
296 |