added shower shape info
[u/mrichter/AliRoot.git] / PWGJE / AliAnalysisTaskJetCore.cxx
CommitLineData
a9e585a7 1
568f8fa2 2// ******************************************
3// This task computes several jet observables like
4// the fraction of energy in inner and outer coronnas,
da93bb11 5// jet-track correlations,triggered jet shapes and
568f8fa2 6// correlation strength distribution of particles inside jets.
7// Author: lcunquei@cern.ch
8// *******************************************
9
10
11/**************************************************************************
12 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
13 * *
14 * Author: The ALICE Off-line Project. *
15 * Contributors are mentioned in the code where appropriate. *
16 * *
17 * Permission to use, copy, modify and distribute this software and its *
18 * documentation strictly for non-commercial purposes is hereby granted *
19 * without fee, provided that the above copyright notice appears in all *
20 * copies and that both the copyright notice and this permission notice *
21 * appear in the supporting documentation. The authors make no claims *
22 * about the suitability of this software for any purpose. It is *
23 * provided "as is" without express or implied warranty. *
24 **************************************************************************/
25
26
75bf77e3 27#include "TChain.h"
28#include "TTree.h"
29#include "TMath.h"
30#include "TH1F.h"
31#include "TH2F.h"
32#include "TH3F.h"
33#include "THnSparse.h"
34#include "TCanvas.h"
35
36#include "AliLog.h"
37
38#include "AliAnalysisTask.h"
39#include "AliAnalysisManager.h"
40
41#include "AliVEvent.h"
42#include "AliESDEvent.h"
43#include "AliESDInputHandler.h"
44#include "AliCentrality.h"
45#include "AliAnalysisHelperJetTasks.h"
46#include "AliInputEventHandler.h"
47#include "AliAODJetEventBackground.h"
48#include "AliAnalysisTaskFastEmbedding.h"
75bf77e3 49#include "AliAODEvent.h"
ea693273 50#include "AliAODHandler.h"
75bf77e3 51#include "AliAODJet.h"
52
53#include "AliAnalysisTaskJetCore.h"
54
55ClassImp(AliAnalysisTaskJetCore)
56
57AliAnalysisTaskJetCore::AliAnalysisTaskJetCore() :
58AliAnalysisTaskSE(),
59fESD(0x0),
5bd732d4 60fAODIn(0x0),
61fAODOut(0x0),
ea693273 62fAODExtension(0x0),
75bf77e3 63fBackgroundBranch(""),
ea693273 64fNonStdFile(""),
75bf77e3 65fIsPbPb(kTRUE),
66fOfflineTrgMask(AliVEvent::kAny),
67fMinContribVtx(1),
a9e585a7 68fVtxZMin(-10.),
69fVtxZMax(10.),
75bf77e3 70fEvtClassMin(0),
71fEvtClassMax(4),
8b47ec90 72fFilterMask(0),
ea693273 73fRadioFrac(0.2),
74fMinDist(0.1),
75bf77e3 75fCentMin(0.),
76fCentMax(100.),
77fNInputTracksMin(0),
78fNInputTracksMax(-1),
ea693273 79fAngStructCloseTracks(0),
da93bb11 80fCheckMethods(0),
529e2916 81fDoEventMixing(0),
75bf77e3 82fJetEtaMin(-.5),
83fJetEtaMax(.5),
529e2916 84fNevents(0x0),
85fTindex(0x0),
86fTrigBufferIndex(0x0),
75bf77e3 87fJetPtMin(20.),
88fJetTriggerExcludeMask(AliAODJet::kHighTrackPtTriggered),
89fJetPtFractionMin(0.5),
90fNMatchJets(4),
91fMatchMaxDist(0.8),
92fKeepJets(kFALSE),
75bf77e3 93fkNbranches(2),
94fkEvtClasses(12),
95fOutputList(0x0),
96fbEvent(kTRUE),
97fHistEvtSelection(0x0),
da93bb11 98fhnDeltaR(0x0),
529e2916 99fhnMixedEvents(0x0),
75bf77e3 100fh2JetCoreMethod1C10(0x0),
101fh2JetCoreMethod2C10(0x0),
ea693273 102fh2JetCoreMethod1C20(0x0),
103fh2JetCoreMethod2C20(0x0),
75bf77e3 104fh2JetCoreMethod1C30(0x0),
105fh2JetCoreMethod2C30(0x0),
75bf77e3 106fh2JetCoreMethod1C60(0x0),
107fh2JetCoreMethod2C60(0x0),
ea693273 108fh2AngStructpt1C10(0x0),
109fh2AngStructpt2C10(0x0),
110fh2AngStructpt3C10(0x0),
111fh2AngStructpt4C10(0x0),
112fh2AngStructpt1C20(0x0),
113fh2AngStructpt2C20(0x0),
114fh2AngStructpt3C20(0x0),
115fh2AngStructpt4C20(0x0),
116fh2AngStructpt1C30(0x0),
117fh2AngStructpt2C30(0x0),
118fh2AngStructpt3C30(0x0),
119fh2AngStructpt4C30(0x0),
120fh2AngStructpt1C60(0x0),
121fh2AngStructpt2C60(0x0),
122fh2AngStructpt3C60(0x0),
da93bb11 123fh2AngStructpt4C60(0x0),
ba143e7f 124fh2JetsumHT3R2a(0x0),
125fh2JetsumHT3R2ap(0x0),
126fh2JetsumHT3R4a(0x0),
127fh2JetsumHT3R4ap(0x0),
128fh2JetsumHT3R6a(0x0),
129fh2JetsumHT3R6ap(0x0),
130fh2JetsumHT3R8a(0x0),
131fh2JetsumHT3R8ap(0x0),
132fh2JetsumHT3R10a(0x0),
133fh2JetsumHT3R10ap(0x0),
134fh2JetsumHT3R2aa(0x0),
135fh2JetsumHT3R2aap(0x0),
136fh2JetsumHT3R4aa(0x0),
137fh2JetsumHT3R4aap(0x0),
138fh2JetsumHT3R6aa(0x0),
139fh2JetsumHT3R6aap(0x0),
140fh2JetsumHT3R8aa(0x0),
141fh2JetsumHT3R8aap(0x0),
142fh2JetsumHT3R10aa(0x0),
143fh2JetsumHT3R10aap(0x0),
144fh2JetsumHT3R2aaa(0x0),
145fh2JetsumHT3R2aaap(0x0),
146fh2JetsumHT3R4aaa(0x0),
147fh2JetsumHT3R4aaap(0x0),
148fh2JetsumHT3R6aaa(0x0),
149fh2JetsumHT3R6aaap(0x0),
150fh2JetsumHT3R8aaa(0x0),
151fh2JetsumHT3R8aaap(0x0),
152fh2JetsumHT3R10aaa(0x0),
153fh2JetsumHT3R10aaap(0x0),
154fh2JetsumHT3R2b(0x0),
155fh2JetsumHT3R2bp(0x0),
156fh2JetsumHT3R4b(0x0),
157fh2JetsumHT3R4bp(0x0),
158fh2JetsumHT3R6b(0x0),
159fh2JetsumHT3R6bp(0x0),
160fh2JetsumHT3R8b(0x0),
161fh2JetsumHT3R8bp(0x0),
162fh2JetsumHT3R10b(0x0),
163fh2JetsumHT3R10bp(0x0),
164fh2JetsumHT3R2bb(0x0),
165fh2JetsumHT3R2bbp(0x0),
166fh2JetsumHT3R4bb(0x0),
167fh2JetsumHT3R4bbp(0x0),
168fh2JetsumHT3R6bb(0x0),
169fh2JetsumHT3R6bbp(0x0),
170fh2JetsumHT3R8bb(0x0),
171fh2JetsumHT3R8bbp(0x0),
172fh2JetsumHT3R10bb(0x0),
173fh2JetsumHT3R10bbp(0x0),
174fh2JetsumHT3R2bbb(0x0),
175fh2JetsumHT3R2bbbp(0x0),
176fh2JetsumHT3R4bbb(0x0),
177fh2JetsumHT3R4bbbp(0x0),
178fh2JetsumHT3R6bbb(0x0),
179fh2JetsumHT3R6bbbp(0x0),
180fh2JetsumHT3R8bbb(0x0),
181fh2JetsumHT3R8bbbp(0x0),
182fh2JetsumHT3R10bbb(0x0),
183fh2JetsumHT3R10bbbp(0x0),
3353f803 184fh3spectriggeredC10(0x0),
185fh3spectriggeredC20(0x0),
186fh3spectriggeredC3060(0x0),
da93bb11 187fh3specbiased(0x0),
20dcc500 188fh3spectot(0x0),
189fh3spectotb(0x0)
da93bb11 190
75bf77e3 191{
192 // default Constructor
193
529e2916 194
195 // Trigger buffer.
196 for(Int_t i=0; i<10; i++) {
197 for(Int_t j=0; j<7; j++) {
198 fTrigBuffer[i][j]=0;
199 }
200 }
201
202
203
204
205
75bf77e3 206 fJetBranchName[0] = "";
207 fJetBranchName[1] = "";
208
209 fListJets[0] = new TList;
210 fListJets[1] = new TList;
211}
212
213AliAnalysisTaskJetCore::AliAnalysisTaskJetCore(const char *name) :
214AliAnalysisTaskSE(name),
215fESD(0x0),
5bd732d4 216fAODIn(0x0),
217fAODOut(0x0),
ea693273 218fAODExtension(0x0),
75bf77e3 219fBackgroundBranch(""),
ea693273 220fNonStdFile(""),
75bf77e3 221fIsPbPb(kTRUE),
222fOfflineTrgMask(AliVEvent::kAny),
223fMinContribVtx(1),
a9e585a7 224fVtxZMin(-10.),
225fVtxZMax(10.),
75bf77e3 226fEvtClassMin(0),
227fEvtClassMax(4),
8b47ec90 228fFilterMask(0),
ea693273 229fRadioFrac(0.2),
230fMinDist(0.1),
75bf77e3 231fCentMin(0.),
232fCentMax(100.),
233fNInputTracksMin(0),
234fNInputTracksMax(-1),
ea693273 235fAngStructCloseTracks(0),
da93bb11 236fCheckMethods(0),
529e2916 237fDoEventMixing(0),
75bf77e3 238fJetEtaMin(-.5),
239fJetEtaMax(.5),
529e2916 240fNevents(0x0),
241fTindex(0x0),
242fTrigBufferIndex(0x0),
75bf77e3 243fJetPtMin(20.),
244fJetTriggerExcludeMask(AliAODJet::kHighTrackPtTriggered),
245fJetPtFractionMin(0.5),
246fNMatchJets(4),
247fMatchMaxDist(0.8),
248fKeepJets(kFALSE),
75bf77e3 249fkNbranches(2),
250fkEvtClasses(12),
251fOutputList(0x0),
252fbEvent(kTRUE),
253fHistEvtSelection(0x0),
da93bb11 254fhnDeltaR(0x0),
529e2916 255fhnMixedEvents(0x0),
75bf77e3 256fh2JetCoreMethod1C10(0x0),
257fh2JetCoreMethod2C10(0x0),
ea693273 258fh2JetCoreMethod1C20(0x0),
259fh2JetCoreMethod2C20(0x0),
75bf77e3 260fh2JetCoreMethod1C30(0x0),
261fh2JetCoreMethod2C30(0x0),
75bf77e3 262fh2JetCoreMethod1C60(0x0),
263fh2JetCoreMethod2C60(0x0),
ea693273 264fh2AngStructpt1C10(0x0),
265fh2AngStructpt2C10(0x0),
266fh2AngStructpt3C10(0x0),
267fh2AngStructpt4C10(0x0),
268fh2AngStructpt1C20(0x0),
269fh2AngStructpt2C20(0x0),
270fh2AngStructpt3C20(0x0),
271fh2AngStructpt4C20(0x0),
272fh2AngStructpt1C30(0x0),
273fh2AngStructpt2C30(0x0),
274fh2AngStructpt3C30(0x0),
275fh2AngStructpt4C30(0x0),
276fh2AngStructpt1C60(0x0),
277fh2AngStructpt2C60(0x0),
278fh2AngStructpt3C60(0x0),
da93bb11 279fh2AngStructpt4C60(0x0),
ba143e7f 280fh2JetsumHT3R2a(0x0),
281fh2JetsumHT3R2ap(0x0),
282fh2JetsumHT3R4a(0x0),
283fh2JetsumHT3R4ap(0x0),
284fh2JetsumHT3R6a(0x0),
285fh2JetsumHT3R6ap(0x0),
286fh2JetsumHT3R8a(0x0),
287fh2JetsumHT3R8ap(0x0),
288fh2JetsumHT3R10a(0x0),
289fh2JetsumHT3R10ap(0x0),
290fh2JetsumHT3R2aa(0x0),
291fh2JetsumHT3R2aap(0x0),
292fh2JetsumHT3R4aa(0x0),
293fh2JetsumHT3R4aap(0x0),
294fh2JetsumHT3R6aa(0x0),
295fh2JetsumHT3R6aap(0x0),
296fh2JetsumHT3R8aa(0x0),
297fh2JetsumHT3R8aap(0x0),
298fh2JetsumHT3R10aa(0x0),
299fh2JetsumHT3R10aap(0x0),
300fh2JetsumHT3R2aaa(0x0),
301fh2JetsumHT3R2aaap(0x0),
302fh2JetsumHT3R4aaa(0x0),
303fh2JetsumHT3R4aaap(0x0),
304fh2JetsumHT3R6aaa(0x0),
305fh2JetsumHT3R6aaap(0x0),
306fh2JetsumHT3R8aaa(0x0),
307fh2JetsumHT3R8aaap(0x0),
308fh2JetsumHT3R10aaa(0x0),
309fh2JetsumHT3R10aaap(0x0),
310fh2JetsumHT3R2b(0x0),
311fh2JetsumHT3R2bp(0x0),
312fh2JetsumHT3R4b(0x0),
313fh2JetsumHT3R4bp(0x0),
314fh2JetsumHT3R6b(0x0),
315fh2JetsumHT3R6bp(0x0),
316fh2JetsumHT3R8b(0x0),
317fh2JetsumHT3R8bp(0x0),
318fh2JetsumHT3R10b(0x0),
319fh2JetsumHT3R10bp(0x0),
320fh2JetsumHT3R2bb(0x0),
321fh2JetsumHT3R2bbp(0x0),
322fh2JetsumHT3R4bb(0x0),
323fh2JetsumHT3R4bbp(0x0),
324fh2JetsumHT3R6bb(0x0),
325fh2JetsumHT3R6bbp(0x0),
326fh2JetsumHT3R8bb(0x0),
327fh2JetsumHT3R8bbp(0x0),
328fh2JetsumHT3R10bb(0x0),
329fh2JetsumHT3R10bbp(0x0),
330fh2JetsumHT3R2bbb(0x0),
331fh2JetsumHT3R2bbbp(0x0),
332fh2JetsumHT3R4bbb(0x0),
333fh2JetsumHT3R4bbbp(0x0),
334fh2JetsumHT3R6bbb(0x0),
335fh2JetsumHT3R6bbbp(0x0),
336fh2JetsumHT3R8bbb(0x0),
337fh2JetsumHT3R8bbbp(0x0),
338fh2JetsumHT3R10bbb(0x0),
339fh2JetsumHT3R10bbbp(0x0),
3353f803 340fh3spectriggeredC10(0x0),
341fh3spectriggeredC20(0x0),
342fh3spectriggeredC3060(0x0),
da93bb11 343fh3specbiased(0x0),
20dcc500 344fh3spectot(0x0),
345fh3spectotb(0x0)
75bf77e3 346 {
347 // Constructor
348
529e2916 349
350 for(Int_t i=0; i<10; i++) {
351 for(Int_t j=0; j<7; j++) {
352 fTrigBuffer[i][j]=0;
353 }
354 }
355
356
357
75bf77e3 358 fJetBranchName[0] = "";
359 fJetBranchName[1] = "";
360
361 fListJets[0] = new TList;
362 fListJets[1] = new TList;
363
364 DefineOutput(1, TList::Class());
365}
366
367AliAnalysisTaskJetCore::~AliAnalysisTaskJetCore()
368{
369 delete fListJets[0];
370 delete fListJets[1];
371}
372
373void AliAnalysisTaskJetCore::SetBranchNames(const TString &branch1, const TString &branch2)
374{
375 fJetBranchName[0] = branch1;
376 fJetBranchName[1] = branch2;
377}
378
379void AliAnalysisTaskJetCore::Init()
380{
381
382 // check for jet branches
383 if(!strlen(fJetBranchName[0].Data()) || !strlen(fJetBranchName[1].Data())){
384 AliError("Jet branch name not set.");
385 }
386
387}
388
389void AliAnalysisTaskJetCore::UserCreateOutputObjects()
390{
391 // Create histograms
392 // Called once
393 OpenFile(1);
394 if(!fOutputList) fOutputList = new TList;
395 fOutputList->SetOwner(kTRUE);
396
397 Bool_t oldStatus = TH1::AddDirectoryStatus();
398 TH1::AddDirectory(kFALSE);
399
400
401 fHistEvtSelection = new TH1I("fHistEvtSelection", "event selection", 6, -0.5, 5.5);
402 fHistEvtSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED");
403 fHistEvtSelection->GetXaxis()->SetBinLabel(2,"events IN");
404 fHistEvtSelection->GetXaxis()->SetBinLabel(3,"event selection (rejected)");
405 fHistEvtSelection->GetXaxis()->SetBinLabel(4,"vertex cut (rejected)");
406 fHistEvtSelection->GetXaxis()->SetBinLabel(5,"centrality (rejected)");
407 fHistEvtSelection->GetXaxis()->SetBinLabel(6,"multiplicity (rejected)");
408
529e2916 409 UInt_t entries = 0; // bit coded, see GetDimParams() below
410 entries = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 |1<<7;
da93bb11 411 fhnDeltaR = NewTHnSparseF("fhnDeltaR", entries);
c42c6838 412
20dcc500 413 //change binning in pTtrack
414 Double_t *xPt3 = new Double_t[10];
c42c6838 415 xPt3[0] = 0.;
20dcc500 416 for(int i = 1; i<=9;i++){
c42c6838 417 if(xPt3[i-1]<1)xPt3[i] = xPt3[i-1] + 0.2; // 1 - 5
20dcc500 418 else if(xPt3[i-1]<10)xPt3[i] = xPt3[i-1] + 3; // 5 - 12
419 else xPt3[i] = xPt3[i-1] + 150.; // 18
c42c6838 420 }
421 fhnDeltaR->SetBinEdges(2,xPt3);
422 delete [] xPt3;
423
20dcc500 424 //change binning in HTI
425 Double_t *xPt4 = new Double_t[14];
426 xPt4[0] = 0.;
427 for(int i = 1; i<=13;i++){
428 if(xPt4[i-1]<10)xPt4[i] = xPt4[i-1] + 1; // 1 - 10
429 else if(xPt4[i-1]<20)xPt4[i] = xPt4[i-1] + 5; // 10 - 12
430 else xPt4[i] = xPt4[i-1] + 30.; // 13
431 }
432 fhnDeltaR->SetBinEdges(6,xPt4);
433 delete [] xPt4;
434
435
436
c42c6838 437
438
439
529e2916 440
c42c6838 441 if(fDoEventMixing){
529e2916 442 UInt_t cifras = 0; // bit coded, see GetDimParams() below
443 cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 |1<<7;
c42c6838 444 fhnMixedEvents = NewTHnSparseF("fhnMixedEvents", cifras);}
ea693273 445
da93bb11 446 if(fCheckMethods){
529e2916 447
75bf77e3 448 fh2JetCoreMethod1C10 = new TH2F("JetCoreMethod1C10","",150, 0., 150.,100, 0., 1.5);
449 fh2JetCoreMethod2C10 = new TH2F("JetCoreMethod2C10","",150, 0., 150.,100, 0., 1.5);
ea693273 450 fh2JetCoreMethod1C20 = new TH2F("JetCoreMethod1C20","",150, 0., 150.,100, 0., 1.5);
451 fh2JetCoreMethod2C20 = new TH2F("JetCoreMethod2C20","",150, 0., 150.,100, 0., 1.5);
75bf77e3 452 fh2JetCoreMethod1C30 = new TH2F("JetCoreMethod1C30","",150, 0., 150.,100, 0., 1.5);
453 fh2JetCoreMethod2C30 = new TH2F("JetCoreMethod2C30","",150, 0., 150.,100, 0., 1.5);
75bf77e3 454 fh2JetCoreMethod1C60 = new TH2F("JetCoreMethod1C60","",150, 0., 150.,100, 0., 1.5);
da93bb11 455 fh2JetCoreMethod2C60 = new TH2F("JetCoreMethod2C60","",150, 0., 150.,100, 0., 1.5);}
456
ea693273 457
da93bb11 458 if(fAngStructCloseTracks>0){
a9e585a7 459 fh2AngStructpt1C10 = new TH2F("Ang struct pt1 C10","",15,0.,1.5,150,0.,10.);
460 fh2AngStructpt2C10 = new TH2F("Ang struct pt2 C10","",15,0.,1.5,150,0.,10.);
461 fh2AngStructpt3C10 = new TH2F("Ang struct pt3 C10","",15,0.,1.5,150,0.,10.);
462 fh2AngStructpt4C10 = new TH2F("Ang struct pt4 C10","",15,0.,1.5,150,0.,10.);
463 fh2AngStructpt1C20 = new TH2F("Ang struct pt1 C20","",15,0.,1.5,150,0.,10.);
464 fh2AngStructpt2C20 = new TH2F("Ang struct pt2 C20","",15,0.,1.5,150,0.,10.);
465 fh2AngStructpt3C20 = new TH2F("Ang struct pt3 C20","",15,0.,1.5,150,0.,10.);
466 fh2AngStructpt4C20 = new TH2F("Ang struct pt4 C20","",15,0.,1.5,150,0.,10.);
467 fh2AngStructpt1C30 = new TH2F("Ang struct pt1 C30","",15,0.,1.5,150,0.,10.);
468 fh2AngStructpt2C30 = new TH2F("Ang struct pt2 C30","",15,0.,1.5,150,0.,10.);
469 fh2AngStructpt3C30 = new TH2F("Ang struct pt3 C30","",15,0.,1.5,150,0.,10.);
470 fh2AngStructpt4C30 = new TH2F("Ang struct pt4 C30","",15,0.,1.5,150,0.,10.);
471 fh2AngStructpt1C60 = new TH2F("Ang struct pt1 C60","",15,0.,1.5,150,0.,10.);
472 fh2AngStructpt2C60 = new TH2F("Ang struct pt2 C60","",15,0.,1.5,150,0.,10.);
473 fh2AngStructpt3C60 = new TH2F("Ang struct pt3 C60","",15,0.,1.5,150,0.,10.);
474 fh2AngStructpt4C60 = new TH2F("Ang struct pt4 C60","",15,0.,1.5,150,0.,10.); }
20dcc500 475
ba143e7f 476 fh2JetsumHT3R2a = new TH2F("Pt sum R02 HT0 TT10","",20,0.,200.,100,0.,10.);
477 fh2JetsumHT3R2ap = new TH2F("Pt sum R02 HT0 TT10 p","",20,0.,200.,100,0.,10.);
478 fh2JetsumHT3R4a = new TH2F("Pt sum R04 HT0 TT10","",20,0.,200.,100,0.,10.);
479 fh2JetsumHT3R4ap = new TH2F("Pt sum R04 HT0 TT10 p","",20,0.,200.,100,0.,10.);
480 fh2JetsumHT3R6a = new TH2F("Pt sum R06 HT0 TT10","",20,0.,200.,100,0.,10.);
481 fh2JetsumHT3R6ap = new TH2F("Pt sum R06 HT0 TT10 p","",20,0.,200.,100,0.,10.);
482 fh2JetsumHT3R8a = new TH2F("Pt sum R08 HT0 TT10","",20,0.,200.,100,0.,10.);
483 fh2JetsumHT3R8ap = new TH2F("Pt sum R08 HT0 TT10 p","",20,0.,200.,100,0.,10.);
484 fh2JetsumHT3R10a = new TH2F("Pt sum R10 HT0 TT10","",20,0.,200.,100,0.,10.);
485 fh2JetsumHT3R10ap = new TH2F("Pt sum R10 HT0 TT10 p","",20,0.,200.,100,0.,10.);
486
487 fh2JetsumHT3R2aa = new TH2F("Pt sum R02 HT0 TT20","",20,0.,200.,100,0.,10.);
488 fh2JetsumHT3R2aap = new TH2F("Pt sum R02 HT0 TT20 p","",20,0.,200.,100,0.,10.);
489 fh2JetsumHT3R4aa = new TH2F("Pt sum R04 HT0 TT20","",20,0.,200.,100,0.,10.);
490 fh2JetsumHT3R4aap = new TH2F("Pt sum R04 HT0 TT20 p","",20,0.,200.,100,0.,10.);
491 fh2JetsumHT3R6aa = new TH2F("Pt sum R06 HT0 TT20","",20,0.,200.,100,0.,10.);
492 fh2JetsumHT3R6aap = new TH2F("Pt sum R06 HT0 TT20 p","",20,0.,200.,100,0.,10.);
493 fh2JetsumHT3R8aa = new TH2F("Pt sum R08 HT0 TT20","",20,0.,200.,100,0.,10.);
494 fh2JetsumHT3R8aap = new TH2F("Pt sum R08 HT0 TT20 p","",20,0.,200.,100,0.,10.);
495 fh2JetsumHT3R10aa = new TH2F("Pt sum R10 HT0 TT20","",20,0.,200.,100,0.,10.);
496 fh2JetsumHT3R10aap = new TH2F("Pt sum R10 HT0 TT20 p","",20,0.,200.,100,0.,10.);
497
498 fh2JetsumHT3R2aaa = new TH2F("Pt sum R02 HT0 TT0","",20,0.,200.,100,0.,10.);
499 fh2JetsumHT3R2aaap = new TH2F("Pt sum R02 HT0 TT0 p","",20,0.,200.,100,0.,10.);
500 fh2JetsumHT3R4aaa = new TH2F("Pt sum R04 HT0 TT0","",20,0.,200.,100,0.,10.);
501 fh2JetsumHT3R4aaap = new TH2F("Pt sum R04 HT0 TT0 p","",20,0.,200.,100,0.,10.);
502 fh2JetsumHT3R6aaa = new TH2F("Pt sum R06 HT0 TT0","",20,0.,200.,100,0.,10.);
503 fh2JetsumHT3R6aaap = new TH2F("Pt sum R06 HT0 TT0 p","",20,0.,200.,100,0.,10.);
504 fh2JetsumHT3R8aaa = new TH2F("Pt sum R08 HT0 TT0","",20,0.,200.,100,0.,10.);
505 fh2JetsumHT3R8aaap = new TH2F("Pt sum R08 HT0 TT0 p","",20,0.,200.,100,0.,10.);
506 fh2JetsumHT3R10aaa = new TH2F("Pt sum R10 HT0 TT0","",20,0.,200.,100,0.,10.);
507 fh2JetsumHT3R10aaap = new TH2F("Pt sum R10 HT0 TT0 p","",20,0.,200.,100,0.,10.);
508
509 fh2JetsumHT3R2b = new TH2F("Pt sum R02 HT6 TT10","",20,0.,200.,100,0.,10.);
510 fh2JetsumHT3R2bp = new TH2F("Pt sum R02 HT6 TT10 p","",20,0.,200.,100,0.,10.);
511 fh2JetsumHT3R4b = new TH2F("Pt sum R04 HT6 TT10","",20,0.,200.,100,0.,10.);
512 fh2JetsumHT3R4bp = new TH2F("Pt sum R04 HT6 TT10 p","",20,0.,200.,100,0.,10.);
513 fh2JetsumHT3R6b = new TH2F("Pt sum R06 HT6 TT10","",20,0.,200.,100,0.,10.);
514 fh2JetsumHT3R6bp = new TH2F("Pt sum R06 HT6 TT10 p","",20,0.,200.,100,0.,10.);
515 fh2JetsumHT3R8b = new TH2F("Pt sum R08 HT6 TT10","",20,0.,200.,100,0.,10.);
516 fh2JetsumHT3R8bp = new TH2F("Pt sum R08 HT6 TT10 p","",20,0.,200.,100,0.,10.);
517 fh2JetsumHT3R10b = new TH2F("Pt sum R10 HT6 TT10","",20,0.,200.,100,0.,10.);
518 fh2JetsumHT3R10bp = new TH2F("Pt sum R10 HT6 TT10 p","",20,0.,200.,100,0.,10.);
519
520 fh2JetsumHT3R2bb = new TH2F("Pt sum R02 HT6 TT20","",20,0.,200.,100,0.,10.);
521 fh2JetsumHT3R2bbp = new TH2F("Pt sum R02 HT6 TT20 p","",20,0.,200.,100,0.,10.);
522 fh2JetsumHT3R4bb = new TH2F("Pt sum R04 HT6 TT20","",20,0.,200.,100,0.,10.);
523 fh2JetsumHT3R4bbp = new TH2F("Pt sum R04 HT6 TT20 p","",20,0.,200.,100,0.,10.);
524 fh2JetsumHT3R6bb = new TH2F("Pt sum R06 HT6 TT20","",20,0.,200.,100,0.,10.);
525 fh2JetsumHT3R6bbp = new TH2F("Pt sum R06 HT6 TT20 p","",20,0.,200.,100,0.,10.);
526 fh2JetsumHT3R8bb = new TH2F("Pt sum R08 HT6 TT20","",20,0.,200.,100,0.,10.);
527 fh2JetsumHT3R8bbp = new TH2F("Pt sum R08 HT6 TT20 p","",20,0.,200.,100,0.,10.);
528 fh2JetsumHT3R10bb = new TH2F("Pt sum R10 HT6 TT20","",20,0.,200.,100,0.,10.);
529 fh2JetsumHT3R10bbp = new TH2F("Pt sum R10 HT6 TT20 p","",20,0.,200.,100,0.,10.);
530
531 fh2JetsumHT3R2bbb = new TH2F("Pt sum R02 HT6 TT0","",20,0.,200.,100,0.,10.);
532 fh2JetsumHT3R2bbbp = new TH2F("Pt sum R02 HT6 TT0 p","",20,0.,200.,100,0.,10.);
533 fh2JetsumHT3R4bbb = new TH2F("Pt sum R04 HT6 TT0","",20,0.,200.,100,0.,10.);
534 fh2JetsumHT3R4bbbp = new TH2F("Pt sum R04 HT6 TT0 p","",20,0.,200.,100,0.,10.);
535 fh2JetsumHT3R6bbb = new TH2F("Pt sum R06 HT6 TT0","",20,0.,200.,100,0.,10.);
536 fh2JetsumHT3R6bbbp = new TH2F("Pt sum R06 HT6 TT0 p","",20,0.,200.,100,0.,10.);
537 fh2JetsumHT3R8bbb = new TH2F("Pt sum R08 HT6 TT0","",20,0.,200.,100,0.,10.);
538 fh2JetsumHT3R8bbbp = new TH2F("Pt sum R08 HT6 TT0 p","",20,0.,200.,100,0.,10.);
539 fh2JetsumHT3R10bbb = new TH2F("Pt sum R10 HT6 TT0","",20,0.,200.,100,0.,10.);
540 fh2JetsumHT3R10bbbp = new TH2F("Pt sum R10 HT6 TT0 p","",20,0.,200.,100,0.,10.);
541
542
543
544
545
3353f803 546 fh3spectriggeredC10 = new TH3F("Triggered spectrumC10","",10,0.,1.,100,-200.,200.,50,0.,50.);
547 fh3spectriggeredC20 = new TH3F("Triggered spectrumC20","",10,0.,1.,100,-200.,200.,50,0.,50.);
548 fh3spectriggeredC3060 = new TH3F("Triggered spectrumC3060","",10,0.,1.,100,-200.,200.,50,0.,50.);
549
da93bb11 550 fh3specbiased = new TH3F("Biased spectrum","",10,0,100,50,0.,200.,50,0.,50.);
20dcc500 551 fh3spectot = new TH3F("Total spectrum 0-10","",50,0.,200.,50,0.,50.,50,0.,50.);
ba143e7f 552 fh3spectotb = new TH3F("Total spectrum 30-60","",50,0.,200.,50,0.,50.,50,0.,50.);
75bf77e3 553 fOutputList->Add(fHistEvtSelection);
a9e585a7 554
da93bb11 555 fOutputList->Add(fhnDeltaR);
556
529e2916 557 fOutputList->Add(fhnMixedEvents);
da93bb11 558
559
560
561 if(fCheckMethods){
529e2916 562
75bf77e3 563 fOutputList->Add(fh2JetCoreMethod1C10);
564 fOutputList->Add(fh2JetCoreMethod2C10);
ea693273 565 fOutputList->Add(fh2JetCoreMethod1C20);
566 fOutputList->Add(fh2JetCoreMethod2C20);
75bf77e3 567 fOutputList->Add(fh2JetCoreMethod1C30);
568 fOutputList->Add(fh2JetCoreMethod2C30);
75bf77e3 569 fOutputList->Add(fh2JetCoreMethod1C60);
da93bb11 570 fOutputList->Add(fh2JetCoreMethod2C60);}
a9e585a7 571
ea693273 572
75bf77e3 573
a9e585a7 574
575
576 if(fAngStructCloseTracks>0){
ea693273 577 fOutputList->Add(fh2AngStructpt1C10);
578 fOutputList->Add(fh2AngStructpt2C10);
579 fOutputList->Add(fh2AngStructpt3C10);
580 fOutputList->Add(fh2AngStructpt4C10);
581 fOutputList->Add(fh2AngStructpt1C20);
582 fOutputList->Add(fh2AngStructpt2C20);
583 fOutputList->Add(fh2AngStructpt3C20);
584 fOutputList->Add(fh2AngStructpt4C20);
585 fOutputList->Add(fh2AngStructpt1C30);
586 fOutputList->Add(fh2AngStructpt2C30);
587 fOutputList->Add(fh2AngStructpt3C30);
588 fOutputList->Add(fh2AngStructpt4C30);
589 fOutputList->Add(fh2AngStructpt1C60);
590 fOutputList->Add(fh2AngStructpt2C60);
591 fOutputList->Add(fh2AngStructpt3C60);
a9e585a7 592 fOutputList->Add(fh2AngStructpt4C60);}
20dcc500 593
594
ba143e7f 595 fOutputList->Add(fh2JetsumHT3R2a);
596 fOutputList->Add(fh2JetsumHT3R2ap);
597 fOutputList->Add(fh2JetsumHT3R4a);
598 fOutputList->Add(fh2JetsumHT3R4ap);
599 fOutputList->Add(fh2JetsumHT3R6a);
600 fOutputList->Add(fh2JetsumHT3R6ap);
601 fOutputList->Add(fh2JetsumHT3R8a);
602 fOutputList->Add(fh2JetsumHT3R8ap);
603 fOutputList->Add(fh2JetsumHT3R10a);
604 fOutputList->Add(fh2JetsumHT3R10ap);
605 fOutputList->Add(fh2JetsumHT3R2aa);
606 fOutputList->Add(fh2JetsumHT3R2aap);
607 fOutputList->Add(fh2JetsumHT3R4aa);
608 fOutputList->Add(fh2JetsumHT3R4aap);
609 fOutputList->Add(fh2JetsumHT3R6aa);
610 fOutputList->Add(fh2JetsumHT3R6aap);
611 fOutputList->Add(fh2JetsumHT3R8aa);
612 fOutputList->Add(fh2JetsumHT3R8aap);
613 fOutputList->Add(fh2JetsumHT3R10aa);
614 fOutputList->Add(fh2JetsumHT3R10aap);
615 fOutputList->Add(fh2JetsumHT3R2aaa);
616 fOutputList->Add(fh2JetsumHT3R2aaap);
617 fOutputList->Add(fh2JetsumHT3R4aaa);
618 fOutputList->Add(fh2JetsumHT3R4aaap);
619 fOutputList->Add(fh2JetsumHT3R6aaa);
620 fOutputList->Add(fh2JetsumHT3R6aaap);
621 fOutputList->Add(fh2JetsumHT3R8aaa);
622 fOutputList->Add(fh2JetsumHT3R8aaap);
623 fOutputList->Add(fh2JetsumHT3R10aaa);
624 fOutputList->Add(fh2JetsumHT3R10aaap);
625
626 fOutputList->Add(fh2JetsumHT3R2b);
627 fOutputList->Add(fh2JetsumHT3R2bp);
628 fOutputList->Add(fh2JetsumHT3R4b);
629 fOutputList->Add(fh2JetsumHT3R4bp);
630 fOutputList->Add(fh2JetsumHT3R6b);
631 fOutputList->Add(fh2JetsumHT3R6bp);
632 fOutputList->Add(fh2JetsumHT3R8b);
633 fOutputList->Add(fh2JetsumHT3R8bp);
634 fOutputList->Add(fh2JetsumHT3R10b);
635 fOutputList->Add(fh2JetsumHT3R10bp);
636 fOutputList->Add(fh2JetsumHT3R2bb);
637 fOutputList->Add(fh2JetsumHT3R2bbp);
638 fOutputList->Add(fh2JetsumHT3R4bb);
639 fOutputList->Add(fh2JetsumHT3R4bbp);
640 fOutputList->Add(fh2JetsumHT3R6bb);
641 fOutputList->Add(fh2JetsumHT3R6bbp);
642 fOutputList->Add(fh2JetsumHT3R8bb);
643 fOutputList->Add(fh2JetsumHT3R8bbp);
644 fOutputList->Add(fh2JetsumHT3R10bb);
645 fOutputList->Add(fh2JetsumHT3R10bbp);
646 fOutputList->Add(fh2JetsumHT3R2bbb);
647 fOutputList->Add(fh2JetsumHT3R2bbbp);
648 fOutputList->Add(fh2JetsumHT3R4bbb);
649 fOutputList->Add(fh2JetsumHT3R4bbbp);
650 fOutputList->Add(fh2JetsumHT3R6bbb);
651 fOutputList->Add(fh2JetsumHT3R6bbbp);
652 fOutputList->Add(fh2JetsumHT3R8bbb);
653 fOutputList->Add(fh2JetsumHT3R8bbbp);
654 fOutputList->Add(fh2JetsumHT3R10bbb);
655 fOutputList->Add(fh2JetsumHT3R10bbbp);
5bd732d4 656
ba143e7f 657
20dcc500 658
3353f803 659 fOutputList->Add(fh3spectriggeredC10);
660 fOutputList->Add(fh3spectriggeredC20);
661 fOutputList->Add(fh3spectriggeredC3060);
662
da93bb11 663 fOutputList->Add(fh3specbiased);
529e2916 664 fOutputList->Add(fh3spectot);
20dcc500 665 fOutputList->Add(fh3spectotb);
75bf77e3 666 // =========== Switch on Sumw2 for all histos ===========
667 for (Int_t i=0; i<fOutputList->GetEntries(); ++i) {
668 TH1 *h1 = dynamic_cast<TH1*>(fOutputList->At(i));
669 if (h1){
670 h1->Sumw2();
671 continue;
672 }
ea693273 673 THnSparse *hn = dynamic_cast<THnSparse*>(fOutputList->At(i));
674 if (hn){
675 hn->Sumw2();
676 }
75bf77e3 677 }
678 TH1::AddDirectory(oldStatus);
679
680 PostData(1, fOutputList);
681}
682
683void AliAnalysisTaskJetCore::UserExec(Option_t *)
684{
685
686
687 if(!strlen(fJetBranchName[0].Data()) || !strlen(fJetBranchName[1].Data())){
688 AliError("Jet branch name not set.");
689 return;
690 }
691
692 fESD=dynamic_cast<AliESDEvent*>(InputEvent());
693 if (!fESD) {
694 AliError("ESD not available");
5bd732d4 695 fAODIn = dynamic_cast<AliAODEvent*>(InputEvent());
696 }
697 fAODOut = dynamic_cast<AliAODEvent*>(AODEvent());
698
699 static AliAODEvent* aod = 0;
700 // take all other information from the aod we take the tracks from
701 if(!aod){
702 if(!fESD)aod = fAODIn;
703 else aod = fAODOut;}
704
705
ea693273 706
707 if(fNonStdFile.Length()!=0){
708 // case that we have an AOD extension we need can fetch the jets from the extended output
709 AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
710 fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0);
711 if(!fAODExtension){
712 if(fDebug>1)Printf("AODExtension found for %s",fNonStdFile.Data());
713 }}
714
715
716
717
75bf77e3 718
719 // -- event selection --
720 fHistEvtSelection->Fill(1); // number of events before event selection
721
722 // physics selection
723 AliInputEventHandler* inputHandler = (AliInputEventHandler*)
724 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
da93bb11 725 cout<<inputHandler->IsEventSelected()<<" "<<fOfflineTrgMask<<endl;
75bf77e3 726 if(!(inputHandler->IsEventSelected() & fOfflineTrgMask)){
727 if(fDebug) Printf(" Trigger Selection: event REJECTED ... ");
728 fHistEvtSelection->Fill(2);
729 PostData(1, fOutputList);
730 return;
731 }
732
733 // vertex selection
5bd732d4 734 if(!aod){
52721bee 735 if(fDebug) Printf("%s:%d No AOD",(char*)__FILE__,__LINE__);
736 fHistEvtSelection->Fill(3);
737 PostData(1, fOutputList);
738 }
5bd732d4 739 AliAODVertex* primVtx = aod->GetPrimaryVertex();
52721bee 740
741 if(!primVtx){
742 if(fDebug) Printf("%s:%d No primVtx",(char*)__FILE__,__LINE__);
743 fHistEvtSelection->Fill(3);
d27719bf 744 PostData(1, fOutputList);
745 return;
52721bee 746 }
747
75bf77e3 748 Int_t nTracksPrim = primVtx->GetNContributors();
749 if ((nTracksPrim < fMinContribVtx) ||
750 (primVtx->GetZ() < fVtxZMin) ||
751 (primVtx->GetZ() > fVtxZMax) ){
752 if(fDebug) Printf("%s:%d primary vertex z = %f: event REJECTED...",(char*)__FILE__,__LINE__,primVtx->GetZ());
753 fHistEvtSelection->Fill(3);
754 PostData(1, fOutputList);
755 return;
756 }
757
758 // event class selection (from jet helper task)
759 Int_t eventClass = AliAnalysisHelperJetTasks::EventClass();
760 if(fDebug) Printf("Event class %d", eventClass);
761 if (eventClass < fEvtClassMin || eventClass > fEvtClassMax){
762 fHistEvtSelection->Fill(4);
763 PostData(1, fOutputList);
764 return;
765 }
766
767 // centrality selection
768 AliCentrality *cent = 0x0;
da93bb11 769 Double_t centValue = 0.;
20dcc500 770 if(fESD) {cent = fESD->GetCentrality();
771 if(cent) centValue = cent->GetCentralityPercentile("V0M");}
5bd732d4 772 else centValue=aod->GetHeader()->GetCentrality();
20dcc500 773
75bf77e3 774 if(fDebug) printf("centrality: %f\n", centValue);
3353f803 775 if (centValue < fCentMin || centValue > fCentMax){
776 fHistEvtSelection->Fill(4);
777 PostData(1, fOutputList);
778 return;
779 }
75bf77e3 780
781
568f8fa2 782 fHistEvtSelection->Fill(0);
783 // accepted events
75bf77e3 784 // -- end event selection --
ea693273 785
75bf77e3 786 // get background
787 AliAODJetEventBackground* externalBackground = 0;
5bd732d4 788 if(fAODOut&&!externalBackground&&fBackgroundBranch.Length()){
789 externalBackground = (AliAODJetEventBackground*)(fAODOut->FindListObject(fBackgroundBranch.Data()));
75bf77e3 790 if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
791 }
ea693273 792 if(fAODExtension&&!externalBackground&&fBackgroundBranch.Length()){
793 externalBackground = (AliAODJetEventBackground*)(fAODExtension->GetAOD()->FindListObject(fBackgroundBranch.Data()));
794 if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
795 }
5bd732d4 796
797 if(fAODIn&&!externalBackground&&fBackgroundBranch.Length()){
798 externalBackground = (AliAODJetEventBackground*)(fAODIn->FindListObject(fBackgroundBranch.Data()));
799 if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
800 }
ea693273 801
75bf77e3 802 Float_t rho = 0;
803 if(externalBackground)rho = externalBackground->GetBackground(0);
804
805
806 // fetch jets
807 TClonesArray *aodJets[2];
ea693273 808 aodJets[0]=0;
5bd732d4 809 if(fAODOut&&!aodJets[0]){
810 aodJets[0] = dynamic_cast<TClonesArray*>(fAODOut->FindListObject(fJetBranchName[0].Data()));
811 aodJets[1] = dynamic_cast<TClonesArray*>(fAODOut->FindListObject(fJetBranchName[1].Data())); }
ea693273 812 if(fAODExtension && !aodJets[0]){
529e2916 813 aodJets[0] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[0].Data()));
814 aodJets[1] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[1].Data())); }
5bd732d4 815 if(fAODIn&&!aodJets[0]){
816 aodJets[0] = dynamic_cast<TClonesArray*>(fAODIn->FindListObject(fJetBranchName[0].Data()));
817 aodJets[1] = dynamic_cast<TClonesArray*>(fAODIn->FindListObject(fJetBranchName[1].Data())); }
818
ea693273 819
529e2916 820 //Double_t ptsub[aodJets[0]->GetEntriesFast()];
821 //Int_t inord[aodJets[0]->GetEntriesFast()];
822 //for(Int_t n=0;n<aodJets[0]->GetEntriesFast();n++){
823 // ptsub[n]=0;
824 // inord[n]=0;}
a9e585a7 825
ea693273 826 TList ParticleList;
827 Int_t nT = GetListOfTracks(&ParticleList);
828 for (Int_t iJetType = 0; iJetType < 2; iJetType++) {
75bf77e3 829 fListJets[iJetType]->Clear();
830 if (!aodJets[iJetType]) continue;
529e2916 831
75bf77e3 832 if(fDebug) Printf("%s: %d jets",fJetBranchName[iJetType].Data(),aodJets[iJetType]->GetEntriesFast());
833
a9e585a7 834
75bf77e3 835 for (Int_t iJet = 0; iJet < aodJets[iJetType]->GetEntriesFast(); iJet++) {
836 AliAODJet *jet = dynamic_cast<AliAODJet*>((*aodJets[iJetType])[iJet]);
529e2916 837 if (jet) fListJets[iJetType]->Add(jet);
838 // if(iJetType==0){
839 // ptsub[iJet]=jet->Pt()-rho*jet->EffectiveAreaCharged();}
840 }}
75bf77e3 841
842 Double_t etabig=0;
843 Double_t ptbig=0;
844 Double_t areabig=0;
845 Double_t phibig=0.;
846 Double_t etasmall=0;
847 Double_t ptsmall=0;
848 Double_t areasmall=0;
da93bb11 849 //Double_t distr=0.;
75bf77e3 850 Double_t phismall=0.;
a9e585a7 851
da93bb11 852
529e2916 853 // Double_t up1[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
854 // Double_t up2[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
855 // Double_t up3[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
856 // Double_t up4[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
857 // Double_t down1[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
858 // Double_t down2[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
859 // Double_t down3[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
860 // Double_t down4[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
861 Int_t iCount=0;
862 Int_t trigJet=-1;
863 Int_t trigBBTrack=-1;
864 Int_t trigInTrack=-1;
865
75bf77e3 866 for(Int_t i=0; i<fListJets[0]->GetEntries(); ++i){
867 AliAODJet* jetbig = (AliAODJet*)(fListJets[0]->At(i));
868 etabig = jetbig->Eta();
869 phibig = jetbig->Phi();
870 ptbig = jetbig->Pt();
871 if(ptbig==0) continue;
872 areabig = jetbig->EffectiveAreaCharged();
ea693273 873 Double_t ptcorr=ptbig-rho*areabig;
3353f803 874
75bf77e3 875 if((etabig<fJetEtaMin)||(etabig>fJetEtaMax)) continue;
876 Double_t dismin=100.;
877 Double_t ptmax=-10.;
878 Int_t index1=-1;
879 Int_t index2=-1;
da93bb11 880
3353f803 881 Int_t point=GetHardestTrackBackToJet(jetbig);
882 AliVParticle *partback = (AliVParticle*)ParticleList.At(point);
883 if(!partback) continue;
884 if(centValue<10.) fh3spectriggeredC10->Fill(jetbig->EffectiveAreaCharged(),ptcorr,partback->Pt());
885 if(centValue<20.) fh3spectriggeredC20->Fill(jetbig->EffectiveAreaCharged(),ptcorr,partback->Pt());
886 if(centValue>30. && centValue<60.) fh3spectriggeredC3060->Fill(jetbig->EffectiveAreaCharged(),ptcorr,partback->Pt());
887
888 if(ptcorr<=0) continue;
6134f035 889 //if(partback->Pt()<6.) continue;
da93bb11 890 AliAODTrack* leadtrack;
891 Int_t ippt=0;
892 Double_t ppt=-10;
529e2916 893 TRefArray *genTrackList = jetbig->GetRefTracks();
894 Int_t nTracksGenJet = genTrackList->GetEntriesFast();
895 AliAODTrack* genTrack;
da93bb11 896 for(Int_t ir=0; ir<nTracksGenJet; ++ir){
897 genTrack = (AliAODTrack*)(genTrackList->At(ir));
898 if(genTrack->Pt()>ppt){ppt=genTrack->Pt();
529e2916 899 ippt=ir;}}
da93bb11 900 leadtrack=(AliAODTrack*)(genTrackList->At(ippt));
529e2916 901 if(!leadtrack) continue;
da93bb11 902 fh3specbiased->Fill(centValue,ptcorr,leadtrack->Pt());
529e2916 903 if(centValue<10)fh3spectot->Fill(ptcorr,leadtrack->Pt(),partback->Pt());
ba143e7f 904 if(centValue>30. && centValue<60.)fh3spectotb->Fill(ptcorr,leadtrack->Pt(),partback->Pt());
529e2916 905 //store one trigger info
906 if((partback->Pt()>10.)&&(iCount==0)){
907 trigJet=i;
908 trigBBTrack=point;
909 trigInTrack=ippt;
910 iCount=iCount+1;}
911
912
913 if(fCheckMethods){
914 for(Int_t j=0; j<fListJets[1]->GetEntries(); ++j){
75bf77e3 915 AliAODJet* jetsmall = (AliAODJet*)(fListJets[1]->At(j));
916 etasmall = jetsmall->Eta();
917 phismall = jetsmall->Phi();
918 ptsmall = jetsmall->Pt();
919 areasmall = jetsmall->EffectiveAreaCharged();
ea693273 920 Double_t tmpDeltaR=(phismall-phibig)*(phismall-phibig)+(etasmall-etabig)*(etasmall-etabig);
921 tmpDeltaR=TMath::Sqrt(tmpDeltaR);
922 //Fraction in the jet core
923 if((ptsmall>ptmax)&&(tmpDeltaR<=fRadioFrac)){ptmax=ptsmall;
75bf77e3 924 index2=j;}
ea693273 925 if(tmpDeltaR<=dismin){ dismin=tmpDeltaR;
926 index1=j;}} //en of loop over R=0.2 jets
75bf77e3 927 //method1:most concentric jet=core
928 if(dismin<fMinDist){ AliAODJet* jetmethod1 = (AliAODJet*)(fListJets[1]->At(index1));
ea693273 929 if(centValue<10) fh2JetCoreMethod1C10->Fill(ptcorr,jetmethod1->Pt()/ptbig);
930 if((centValue>20)&&(centValue<40)) fh2JetCoreMethod1C20->Fill(ptcorr,jetmethod1->Pt()/ptbig);
931 if((centValue>30)&&(centValue<60)) fh2JetCoreMethod1C30->Fill(ptcorr,jetmethod1->Pt()/ptbig);
932 if(centValue>60) fh2JetCoreMethod1C60->Fill(ptcorr,jetmethod1->Pt()/ptbig); }
75bf77e3 933 //method2:hardest contained jet=core
934 if(index2!=-1){
935 AliAODJet* jetmethod2 = (AliAODJet*)(fListJets[1]->At(index2));
ea693273 936 if(centValue<10) fh2JetCoreMethod2C10->Fill(ptcorr,jetmethod2->Pt()/ptbig);
937 if((centValue>20)&&(centValue<40)) fh2JetCoreMethod2C20->Fill(ptcorr,jetmethod2->Pt()/ptbig);
938 if((centValue>30)&&(centValue<60)) fh2JetCoreMethod2C30->Fill(ptcorr,jetmethod2->Pt()/ptbig);
da93bb11 939 if(centValue>60) fh2JetCoreMethod2C60->Fill(ptcorr,jetmethod2->Pt()/ptbig); }}
20dcc500 940 Double_t sumpt2a=0.;
941 Double_t sumpt2b=0.;
20dcc500 942 Double_t sumpt4a=0.;
943 Double_t sumpt4b=0.;
20dcc500 944 Double_t sumpt6a=0.;
945 Double_t sumpt6b=0.;
20dcc500 946 Double_t sumpt8a=0.;
947 Double_t sumpt8b=0.;
20dcc500 948 Double_t sumpt10a=0.;
949 Double_t sumpt10b=0.;
ba143e7f 950 Double_t sumpt2aa=0.;
951 Double_t sumpt2bb=0.;
952 Double_t sumpt4aa=0.;
953 Double_t sumpt4bb=0.;
954 Double_t sumpt6aa=0.;
955 Double_t sumpt6bb=0.;
956 Double_t sumpt8aa=0.;
957 Double_t sumpt8bb=0.;
958 Double_t sumpt10aa=0.;
959 Double_t sumpt10bb=0.;
960 Double_t sumpt2aaa=0.;
961 Double_t sumpt2bbb=0.;
962 Double_t sumpt4aaa=0.;
963 Double_t sumpt4bbb=0.;
964 Double_t sumpt6aaa=0.;
965 Double_t sumpt6bbb=0.;
966 Double_t sumpt8aaa=0.;
967 Double_t sumpt8bbb=0.;
968 Double_t sumpt10aaa=0.;
969 Double_t sumpt10bbb=0.;
970 Double_t sumpt2ap=0.;
971 Double_t sumpt2bp=0.;
972 Double_t sumpt4ap=0.;
973 Double_t sumpt4bp=0.;
974 Double_t sumpt6ap=0.;
975 Double_t sumpt6bp=0.;
976 Double_t sumpt8ap=0.;
977 Double_t sumpt8bp=0.;
978 Double_t sumpt10ap=0.;
979 Double_t sumpt10bp=0.;
980 Double_t sumpt2aap=0.;
981 Double_t sumpt2bbp=0.;
982 Double_t sumpt4aap=0.;
983 Double_t sumpt4bbp=0.;
984 Double_t sumpt6aap=0.;
985 Double_t sumpt6bbp=0.;
986 Double_t sumpt8aap=0.;
987 Double_t sumpt8bbp=0.;
988 Double_t sumpt10aap=0.;
989 Double_t sumpt10bbp=0.;
990 Double_t sumpt2aaap=0.;
991 Double_t sumpt2bbbp=0.;
992 Double_t sumpt4aaap=0.;
993 Double_t sumpt4bbbp=0.;
994 Double_t sumpt6aaap=0.;
995 Double_t sumpt6bbbp=0.;
996 Double_t sumpt8aaap=0.;
997 Double_t sumpt8bbbp=0.;
998 Double_t sumpt10aaap=0.;
999 Double_t sumpt10bbbp=0.;
1000
1001
1002
5bd732d4 1003
ea693273 1004
da93bb11 1005 for(int it = 0;it<nT;++it){
ea693273 1006 AliVParticle *part = (AliVParticle*)ParticleList.At(it);
529e2916 1007 Double_t deltaR = jetbig->DeltaR(part);
ba143e7f 1008 Double_t deltaEta = etabig-part->Eta();
20dcc500 1009 if(partback->Pt()>10.){
ba143e7f 1010
1011 if(centValue<10){
1012 //for one more centrality
1013 if(deltaR<0.2){if(leadtrack->Pt()>0.)sumpt2a=sumpt2a+part->Pt();
1014 if(leadtrack->Pt()>6) sumpt2b=sumpt2b+part->Pt();}
1015 if(deltaR>=0.2 && deltaR<0.4){if(leadtrack->Pt()>0.)sumpt4a=sumpt4a+part->Pt();
1016 if(leadtrack->Pt()>6.)sumpt4b=sumpt4b+part->Pt();}
1017
1018 if(deltaR>=0.4 && deltaR<0.6){if(leadtrack->Pt()>0.)sumpt6a=sumpt6a+part->Pt();
1019 if(leadtrack->Pt()>6.) sumpt6b=sumpt6b+part->Pt();}
1020 if(deltaR>=0.6 && deltaR<0.8){if(leadtrack->Pt()>0.)sumpt8a=sumpt8a+part->Pt();
1021 if(leadtrack->Pt()>6.) sumpt8b=sumpt8b+part->Pt();}
1022 if(deltaR>=0.8 && deltaR<1.2){if(leadtrack->Pt()>0.)sumpt10a=sumpt10a+part->Pt();
1023 if(leadtrack->Pt()>6.) sumpt10b=sumpt10b+part->Pt();}}
1024
1025 if(centValue>30. && centValue<60.){
1026 //for one more centrality
1027 if(deltaR<0.2){if(leadtrack->Pt()>0.)sumpt2ap=sumpt2ap+part->Pt();
1028 if(leadtrack->Pt()>6) sumpt2bp=sumpt2bp+part->Pt();}
1029 if(deltaR>=0.2 && deltaR<0.4){if(leadtrack->Pt()>0.)sumpt4ap=sumpt4ap+part->Pt();
1030 if(leadtrack->Pt()>6.)sumpt4bp=sumpt4bp+part->Pt();}
1031
1032 if(deltaR>=0.4 && deltaR<0.6){if(leadtrack->Pt()>0.)sumpt6ap=sumpt6ap+part->Pt();
1033 if(leadtrack->Pt()>6.) sumpt6bp=sumpt6bp+part->Pt();}
1034 if(deltaR>=0.6 && deltaR<0.8){if(leadtrack->Pt()>0.)sumpt8ap=sumpt8ap+part->Pt();
1035 if(leadtrack->Pt()>6.) sumpt8bp=sumpt8bp+part->Pt();}
1036 if(deltaR>=0.8 && deltaR<1.2){if(leadtrack->Pt()>0.)sumpt10ap=sumpt10ap+part->Pt();
1037 if(leadtrack->Pt()>6.) sumpt10bp=sumpt10bp+part->Pt();}}}
20dcc500 1038
ba143e7f 1039
1040 if(partback->Pt()>20.){
1041
1042 if(centValue<10){
1043 //for one more centrality
1044 if(deltaR<0.2){if(leadtrack->Pt()>0.)sumpt2aa=sumpt2aa+part->Pt();
1045 if(leadtrack->Pt()>6.) sumpt2bb=sumpt2bb+part->Pt();}
1046 if(deltaR>=0.2 && deltaR<0.4){if(leadtrack->Pt()>0.)sumpt4aa=sumpt4aa+part->Pt();
1047 if(leadtrack->Pt()>6.)sumpt4bb=sumpt4bb+part->Pt();}
1048
1049 if(deltaR>=0.4 && deltaR<0.6){if(leadtrack->Pt()>0.)sumpt6aa=sumpt6aa+part->Pt();
1050 if(leadtrack->Pt()>6.) sumpt6bb=sumpt6bb+part->Pt();}
1051 if(deltaR>=0.6 && deltaR<0.8){if(leadtrack->Pt()>0.)sumpt8aa=sumpt8aa+part->Pt();
1052 if(leadtrack->Pt()>6.) sumpt8bb=sumpt8bb+part->Pt();}
1053 if(deltaR>=0.8 && deltaR<1.2){if(leadtrack->Pt()>0.)sumpt10aa=sumpt10aa+part->Pt();
1054 if(leadtrack->Pt()>6.) sumpt10bb=sumpt10bb+part->Pt();}}
1055
1056 if(centValue>30. && centValue<60.){
1057 //for one more centrality
1058 if(deltaR<0.2){if(leadtrack->Pt()>0.)sumpt2aap=sumpt2aap+part->Pt();
1059 if(leadtrack->Pt()>6) sumpt2bbp=sumpt2bbp+part->Pt();}
1060 if(deltaR>=0.2 && deltaR<0.4){if(leadtrack->Pt()>0.)sumpt4aap=sumpt4aap+part->Pt();
1061 if(leadtrack->Pt()>6.)sumpt4bbp=sumpt4bbp+part->Pt();}
1062
1063 if(deltaR>=0.4 && deltaR<0.6){if(leadtrack->Pt()>0.)sumpt6aap=sumpt6aap+part->Pt();
1064 if(leadtrack->Pt()>6.) sumpt6bbp=sumpt6bbp+part->Pt();}
1065 if(deltaR>=0.6 && deltaR<0.8){if(leadtrack->Pt()>0.)sumpt8aap=sumpt8aap+part->Pt();
1066 if(leadtrack->Pt()>6.) sumpt8bbp=sumpt8bbp+part->Pt();}
1067 if(deltaR>=0.8 && deltaR<1.2){if(leadtrack->Pt()>0.)sumpt10aap=sumpt10aap+part->Pt();
1068 if(leadtrack->Pt()>6.) sumpt10bbp=sumpt10bbp+part->Pt();}}}
1069
1070
1071
1072
1073 if(partback->Pt()<1.){
1074
1075 if(centValue<10){
1076 //for one more centrality
1077 if(deltaR<0.2){if(leadtrack->Pt()>0.)sumpt2aaa=sumpt2aaa+part->Pt();
1078 if(leadtrack->Pt()>6.) sumpt2bbb=sumpt2bbb+part->Pt();}
1079 if(deltaR>=0.2 && deltaR<0.4){if(leadtrack->Pt()>0.)sumpt4aaa=sumpt4aaa+part->Pt();
1080 if(leadtrack->Pt()>6.)sumpt4bbb=sumpt4bbb+part->Pt();}
1081
1082 if(deltaR>=0.4 && deltaR<0.6){if(leadtrack->Pt()>0.)sumpt6aaa=sumpt6aaa+part->Pt();
1083 if(leadtrack->Pt()>6.) sumpt6bbb=sumpt6bbb+part->Pt();}
1084 if(deltaR>=0.6 && deltaR<0.8){if(leadtrack->Pt()>0.)sumpt8aaa=sumpt8aaa+part->Pt();
1085 if(leadtrack->Pt()>6.) sumpt8bbb=sumpt8bbb+part->Pt();}
1086 if(deltaR>=0.8 && deltaR<1.2){if(leadtrack->Pt()>0.)sumpt10aaa=sumpt10aaa+part->Pt();
1087 if(leadtrack->Pt()>6.) sumpt10bbb=sumpt10bbb+part->Pt();}}
1088
1089 if(centValue>30. && centValue<60.){
1090 //for one more centrality
1091 if(deltaR<0.2){if(leadtrack->Pt()>0.)sumpt2aaap=sumpt2aaap+part->Pt();
1092 if(leadtrack->Pt()>6) sumpt2bbbp=sumpt2bbbp+part->Pt();}
1093 if(deltaR>=0.2 && deltaR<0.4){if(leadtrack->Pt()>0.)sumpt4aaap=sumpt4aaap+part->Pt();
1094 if(leadtrack->Pt()>6.)sumpt4bbbp=sumpt4bbbp+part->Pt();}
1095
1096 if(deltaR>=0.4 && deltaR<0.6){if(leadtrack->Pt()>0.)sumpt6aaap=sumpt6aaap+part->Pt();
1097 if(leadtrack->Pt()>6.) sumpt6bbbp=sumpt6bbbp+part->Pt();}
1098 if(deltaR>=0.6 && deltaR<0.8){if(leadtrack->Pt()>0.)sumpt8aaap=sumpt8aaap+part->Pt();
1099 if(leadtrack->Pt()>6.) sumpt8bbbp=sumpt8bbbp+part->Pt();}
1100 if(deltaR>=0.8 && deltaR<1.2){if(leadtrack->Pt()>0.)sumpt10aaap=sumpt10aaap+part->Pt();
1101 if(leadtrack->Pt()>6.) sumpt10bbbp=sumpt10bbbp+part->Pt();}}}
1102
1103
1104
1105
5bd732d4 1106
20dcc500 1107
da93bb11 1108 Double_t deltaPhi=phibig-part->Phi();
1109 if(deltaPhi<-0.5*TMath::Pi()) deltaPhi+=2.*TMath::Pi();
1110 if(deltaPhi>3./2.*TMath::Pi()) deltaPhi-=2.*TMath::Pi();
529e2916 1111 Double_t jetEntries[8] = {centValue,ptcorr,part->Pt(),deltaR,deltaEta,deltaPhi,leadtrack->Pt(),partback->Pt()}; fhnDeltaR->Fill(jetEntries);
1112 }
1113 //end of track loop
20dcc500 1114 Double_t rhoin2=rho*TMath::Pi()*0.2*0.2;
1115 Double_t rhoin4=rho*TMath::Pi()*(0.4*0.4-0.2*0.2);
1116 Double_t rhoin6=rho*TMath::Pi()*(0.6*0.6-0.4*0.4);
1117 Double_t rhoin8=rho*TMath::Pi()*(0.8*0.8-0.6*0.6);
1118 Double_t rhoin10=rho*TMath::Pi()*(1.2*1.2-0.8*0.8);
1119
1120
1121 if(rho!=0){
ba143e7f 1122
5bd732d4 1123 if(partback->Pt()>10.){
ba143e7f 1124 if(centValue<10.){
1125 if(leadtrack->Pt()>0.){
1126 fh2JetsumHT3R2a->Fill(ptcorr,sumpt2a/rhoin2);
1127 fh2JetsumHT3R4a->Fill(ptcorr,sumpt4a/rhoin4);
1128 fh2JetsumHT3R6a->Fill(ptcorr,sumpt6a/rhoin6);
1129 fh2JetsumHT3R8a->Fill(ptcorr,sumpt8a/rhoin8);
1130 fh2JetsumHT3R10a->Fill(ptcorr,sumpt10a/rhoin10);}
1131 if(leadtrack->Pt()>6.){
1132 fh2JetsumHT3R2b->Fill(ptcorr,sumpt2b/rhoin2);
1133 fh2JetsumHT3R4b->Fill(ptcorr,sumpt4b/rhoin4);
1134 fh2JetsumHT3R6b->Fill(ptcorr,sumpt6b/rhoin6);
1135 fh2JetsumHT3R8b->Fill(ptcorr,sumpt8b/rhoin8);
1136 fh2JetsumHT3R10b->Fill(ptcorr,sumpt10b/rhoin10);}}
1137
1138 if(centValue>30 && centValue<60.){
1139 if(leadtrack->Pt()>0.){
1140 fh2JetsumHT3R2ap->Fill(ptcorr,sumpt2ap/rhoin2);
1141 fh2JetsumHT3R4ap->Fill(ptcorr,sumpt4ap/rhoin4);
1142 fh2JetsumHT3R6ap->Fill(ptcorr,sumpt6ap/rhoin6);
1143 fh2JetsumHT3R8ap->Fill(ptcorr,sumpt8ap/rhoin8);
1144 fh2JetsumHT3R10ap->Fill(ptcorr,sumpt10ap/rhoin10);}
1145 if(leadtrack->Pt()>6.){
1146 fh2JetsumHT3R2bp->Fill(ptcorr,sumpt2bp/rhoin2);
1147 fh2JetsumHT3R4bp->Fill(ptcorr,sumpt4bp/rhoin4);
1148 fh2JetsumHT3R6bp->Fill(ptcorr,sumpt6bp/rhoin6);
1149 fh2JetsumHT3R8bp->Fill(ptcorr,sumpt8bp/rhoin8);
1150 fh2JetsumHT3R10bp->Fill(ptcorr,sumpt10bp/rhoin10);}}}
1151
1152
1153
1154
1155
1156 if(partback->Pt()>20.){
1157 if(centValue<10.){
1158 if(leadtrack->Pt()>0.){
1159 fh2JetsumHT3R2aa->Fill(ptcorr,sumpt2aa/rhoin2);
1160 fh2JetsumHT3R4aa->Fill(ptcorr,sumpt4aa/rhoin4);
1161 fh2JetsumHT3R6aa->Fill(ptcorr,sumpt6aa/rhoin6);
1162 fh2JetsumHT3R8aa->Fill(ptcorr,sumpt8aa/rhoin8);
1163 fh2JetsumHT3R10aa->Fill(ptcorr,sumpt10aa/rhoin10);}
1164 if(leadtrack->Pt()>6.){
1165 fh2JetsumHT3R2bb->Fill(ptcorr,sumpt2bb/rhoin2);
1166 fh2JetsumHT3R4bb->Fill(ptcorr,sumpt4bb/rhoin4);
1167 fh2JetsumHT3R6bb->Fill(ptcorr,sumpt6bb/rhoin6);
1168 fh2JetsumHT3R8bb->Fill(ptcorr,sumpt8bb/rhoin8);
1169 fh2JetsumHT3R10bb->Fill(ptcorr,sumpt10bb/rhoin10);}}
1170
1171 if(centValue>30 && centValue<60.){
1172 if(leadtrack->Pt()>0.){
1173 fh2JetsumHT3R2aap->Fill(ptcorr,sumpt2aap/rhoin2);
1174 fh2JetsumHT3R4aap->Fill(ptcorr,sumpt4aap/rhoin4);
1175 fh2JetsumHT3R6aap->Fill(ptcorr,sumpt6aap/rhoin6);
1176 fh2JetsumHT3R8aap->Fill(ptcorr,sumpt8aap/rhoin8);
1177 fh2JetsumHT3R10aap->Fill(ptcorr,sumpt10aap/rhoin10);}
1178 if(leadtrack->Pt()>6.){
1179 fh2JetsumHT3R2bbp->Fill(ptcorr,sumpt2bbp/rhoin2);
1180 fh2JetsumHT3R4bbp->Fill(ptcorr,sumpt4bbp/rhoin4);
1181 fh2JetsumHT3R6bbp->Fill(ptcorr,sumpt6bbp/rhoin6);
1182 fh2JetsumHT3R8bbp->Fill(ptcorr,sumpt8bbp/rhoin8);
1183 fh2JetsumHT3R10bbp->Fill(ptcorr,sumpt10bbp/rhoin10);}}}
1184
1185
1186
1187 if(partback->Pt()<1.){
1188 if(centValue<10.){
1189 if(leadtrack->Pt()>0.){
1190 fh2JetsumHT3R2aaa->Fill(ptcorr,sumpt2aaa/rhoin2);
1191 fh2JetsumHT3R4aaa->Fill(ptcorr,sumpt4aaa/rhoin4);
1192 fh2JetsumHT3R6aaa->Fill(ptcorr,sumpt6aaa/rhoin6);
1193 fh2JetsumHT3R8aaa->Fill(ptcorr,sumpt8aaa/rhoin8);
1194 fh2JetsumHT3R10aaa->Fill(ptcorr,sumpt10aaa/rhoin10);}
1195 if(leadtrack->Pt()>6.){
1196 fh2JetsumHT3R2bbb->Fill(ptcorr,sumpt2bbb/rhoin2);
1197 fh2JetsumHT3R4bbb->Fill(ptcorr,sumpt4bbb/rhoin4);
1198 fh2JetsumHT3R6bbb->Fill(ptcorr,sumpt6bbb/rhoin6);
1199 fh2JetsumHT3R8bbb->Fill(ptcorr,sumpt8bbb/rhoin8);
1200 fh2JetsumHT3R10bbb->Fill(ptcorr,sumpt10bbb/rhoin10);}}
1201
1202 if(centValue>30 && centValue<60.){
1203 if(leadtrack->Pt()>0.){
1204 fh2JetsumHT3R2aaap->Fill(ptcorr,sumpt2aaap/rhoin2);
1205 fh2JetsumHT3R4aaap->Fill(ptcorr,sumpt4aaap/rhoin4);
1206 fh2JetsumHT3R6aaap->Fill(ptcorr,sumpt6aaap/rhoin6);
1207 fh2JetsumHT3R8aaap->Fill(ptcorr,sumpt8aaap/rhoin8);
1208 fh2JetsumHT3R10aaap->Fill(ptcorr,sumpt10aaap/rhoin10);}
1209 if(leadtrack->Pt()>6.){
1210 fh2JetsumHT3R2bbbp->Fill(ptcorr,sumpt2bbbp/rhoin2);
1211 fh2JetsumHT3R4bbbp->Fill(ptcorr,sumpt4bbbp/rhoin4);
1212 fh2JetsumHT3R6bbbp->Fill(ptcorr,sumpt6bbbp/rhoin6);
1213 fh2JetsumHT3R8bbbp->Fill(ptcorr,sumpt8bbbp/rhoin8);
1214 fh2JetsumHT3R10bbbp->Fill(ptcorr,sumpt10bbbp/rhoin10);}}}
1215
1216 }
1217
1218
1219
1220
1221
1222
1223
20dcc500 1224
1225 }
ba143e7f 1226
1227
529e2916 1228 //end of jet loop
1229
1230
1231
1232
1233 if(fDoEventMixing){
1234 //check before if the trigger exists
1235 // fTrigBuffer[i][0] = zvtx
1236 // fTrigBuffer[i][1] = phi
1237 // fTrigBuffer[i][2] = eta
1238 // fTrigBuffer[i][3] = pt_jet
1239 // fTrigBuffer[i][4] = pt_trig
1240 // fTrigBuffer[i][5]= pt_track_in
1241 // fTrigBuffer[i][6]= centrality
1242 if(fTindex==11) fTindex=0;
1243 if(fTrigBuffer[fTindex][3]>0){
1244 if (TMath::Abs(fTrigBuffer[fTindex][0]-primVtx->GetZ()<2.)){
1245 if (TMath::Abs(fTrigBuffer[fTindex][6]-centValue<10)){
1246
1247 for(int it = 0;it<nT;++it){
20dcc500 1248 AliVParticle *part = (AliVParticle*)ParticleList.At(it);
1249 Double_t DPhi = fTrigBuffer[fTindex][1] - part->Phi();
529e2916 1250 Double_t DEta = fTrigBuffer[fTindex][2] - part->Eta();
1251 Double_t DR=TMath::Sqrt(DPhi*DPhi+DEta*DEta);
1252 if(DPhi<-0.5*TMath::Pi()) DPhi+=2.*TMath::Pi();
1253 if(DPhi>3./2.*TMath::Pi()) DPhi-=2.*TMath::Pi();
1254 Double_t triggerEntries[8] = {centValue,fTrigBuffer[fTindex][3],part->Pt(),DR,DEta,DPhi,fTrigBuffer[fTindex][4],fTrigBuffer[fTindex][5]};
1255 fhnMixedEvents->Fill(triggerEntries);
1256 }
1257 fNevents=fNevents+1;
1258 if(fNevents==9) {fTindex=fTindex+1;
1259 fNevents=0;}
1260 }}}
1261
1262
1263 // Copy the triggers from the current event into the buffer.
1264 //again, only if the trigger exists:
1265 if(trigJet>-1){
1266 AliAODJet* jetT = (AliAODJet*)(fListJets[0]->At(trigJet));
1267 AliVParticle *partL = (AliVParticle*)ParticleList.At(trigInTrack);
1268 AliVParticle *partT = (AliVParticle*)ParticleList.At(trigBBTrack);
1269 fTrigBuffer[fTrigBufferIndex][0] = primVtx->GetZ();
1270 fTrigBuffer[fTrigBufferIndex][1] = jetT->Phi();
1271 fTrigBuffer[fTrigBufferIndex][2] = jetT->Eta();
1272 fTrigBuffer[fTrigBufferIndex][3] = jetT->Pt()-rho*jetT->EffectiveAreaCharged();
1273 fTrigBuffer[fTrigBufferIndex][4] = partT->Pt();
1274 fTrigBuffer[fTrigBufferIndex][5] = partL->Pt();
1275 fTrigBuffer[fTrigBufferIndex][6] = centValue;
1276 fTrigBufferIndex++;
1277 if(fTrigBufferIndex==9) fTrigBufferIndex=0;
1278 }
1279 }
1280
1281
1282
1283
da93bb11 1284
ea693273 1285 //////////////////ANGULAR STRUCTURE//////////////////////////////////////
1286
1287 //tracks up to R=0.8 distant from the jet axis
529e2916 1288 // if(fAngStructCloseTracks==1){
1289 // TList CloseTrackList;
1290 // Int_t nn=GetListOfTracksCloseToJet(&CloseTrackList,jetbig);
1291 // Double_t difR=0.04;
1292 // for(Int_t l=0;l<15;l++){
1293 // Double_t rr=l*0.1+0.1;
1294 // for(int it = 0;it<nn;++it){
1295 // AliVParticle *part1 = (AliVParticle*)CloseTrackList.At(it);
1296 // for(int itu=it+1;itu<CloseTrackList.GetEntries();itu++){
1297 // AliVParticle *part2 = (AliVParticle*)CloseTrackList.At(itu);
1298 // Double_t ptm=part1->Pt();
1299 // Double_t ptn=part2->Pt();
1300 // Double_t Rnm = (part1->Eta()-part2->Eta())*(part1->Eta()-part2->Eta())+(part1->Phi()-part2->Phi())*(part1->Phi()-part2->Phi());
1301 // Rnm=TMath::Sqrt(Rnm);
1302 // Double_t deltag=(1./(TMath::Sqrt(2*TMath::Pi())*difR))*TMath::Exp(-1.*(rr-Rnm)*(rr-Rnm)/(2.*difR*difR));
1303 // Double_t stepf=0.5*(1.+TMath::Erf((rr-Rnm)/(TMath::Sqrt(2.)*difR)));
1304 // if((ptcorr<85.) && (ptcorr>=70.)){up1[l]=up1[l]+ptm*ptn*Rnm*Rnm*deltag;
1305 // down1[l]=down1[l]+ptm*ptn*Rnm*Rnm*stepf;}
1306 // if((ptcorr<100.) && (ptcorr>=85.)){up2[l]=up2[l]+ptm*ptn*Rnm*Rnm*deltag;
1307 // down2[l]=down2[l]+ptm*ptn*Rnm*Rnm*stepf;}
1308 // if((ptcorr<120.) && (ptcorr>=100.)){up3[l]=up3[l]+ptm*ptn*Rnm*Rnm*deltag;
1309 // down3[l]=down3[l]+ptm*ptn*Rnm*Rnm*stepf;}
1310 // if((ptcorr<140.) && (ptcorr>=120.)){up4[l]=up4[l]+ptm*ptn*Rnm*Rnm*deltag;
1311 // down4[l]=down4[l]+ptm*ptn*Rnm*Rnm*stepf;}}}}
1312 // }
ea693273 1313
529e2916 1314 // //only jet constituents
1315 // if(fAngStructCloseTracks==2){
ea693273 1316
529e2916 1317 // Double_t difR=0.04;
1318 // for(Int_t l=0;l<15;l++){
1319 // Double_t rr=l*0.1+0.1;
ea693273 1320
1321
529e2916 1322 // AliAODTrack* part1;
1323 // AliAODTrack* part2;
da93bb11 1324
529e2916 1325 // TRefArray *genTrackListb = jetbig->GetRefTracks();
1326 // Int_t nTracksGenJetb = genTrackListb->GetEntriesFast();
da93bb11 1327
1328
1329
529e2916 1330 // for(Int_t it=0; it<nTracksGenJetb; ++it){
1331 // part1 = (AliAODTrack*)(genTrackListb->At(it));
1332 // for(Int_t itu=0; itu<nTracksGenJetb; ++itu){
1333 // part2 = (AliAODTrack*)(genTrackListb->At(itu));
1334 // Double_t ptm=part1->Pt();
1335 // Double_t ptn=part2->Pt();
1336 // Double_t Rnm = (part1->Eta()-part2->Eta())*(part1->Eta()-part2->Eta())+(part1->Phi()-part2->Phi())*(part1->Phi()-part2->Phi());
1337 // Rnm=TMath::Sqrt(Rnm);
1338 // Double_t deltag=(1./(TMath::Sqrt(2*TMath::Pi())*difR))*TMath::Exp(-1.*(rr-Rnm)*(rr-Rnm)/(2.*difR*difR));
1339 // Double_t stepf=0.5*(1.+TMath::Erf((rr-Rnm)/(TMath::Sqrt(2.)*difR)));
1340 // if((ptcorr<85.) && (ptcorr>=70.)){up1[l]=up1[l]+ptm*ptn*Rnm*Rnm*deltag;
1341 // down1[l]=down1[l]+ptm*ptn*Rnm*Rnm*stepf;}
1342 // if((ptcorr<100.) && (ptcorr>=85.)){up2[l]=up2[l]+ptm*ptn*Rnm*Rnm*deltag;
1343 // down2[l]=down2[l]+ptm*ptn*Rnm*Rnm*stepf;}
1344 // if((ptcorr<120.) && (ptcorr>=100.)){up3[l]=up3[l]+ptm*ptn*Rnm*Rnm*deltag;
1345 // down3[l]=down3[l]+ptm*ptn*Rnm*Rnm*stepf;}
1346 // if((ptcorr<140.) && (ptcorr>=120.)){up4[l]=up4[l]+ptm*ptn*Rnm*Rnm*deltag;
1347 // down4[l]=down4[l]+ptm*ptn*Rnm*Rnm*stepf;}}}}}
1348 // }
1349 // //end loop over R=0.4 jets
1350 // if(fAngStructCloseTracks>0){
1351 // for(Int_t l=0;l<15;l++){
1352 // Double_t rr=l*0.1+0.1;
1353 // if(down1[l]!=0){
1354 // if(centValue<10.)fh2AngStructpt1C10->Fill(rr,rr*up1[l]/down1[l]);
1355 // if(centValue>20. && centValue<40.) fh2AngStructpt1C20->Fill(rr,rr*up1[l]/down1[l]);
1356 // if(centValue>30. && centValue<60.) fh2AngStructpt1C30->Fill(rr,rr*up1[l]/down1[l]);
1357 // if(centValue>60.) fh2AngStructpt1C60->Fill(rr,rr*up1[l]/down1[l]);}
1358 // if(down2[l]!=0){
1359 // if(centValue<10.) fh2AngStructpt2C10->Fill(rr,rr*up2[l]/down2[l]);
1360 // if(centValue>20. && centValue<40.) fh2AngStructpt2C20->Fill(rr,rr*up2[l]/down2[l]);
1361 // if(centValue>30. && centValue<60.) fh2AngStructpt2C30->Fill(rr,rr*up2[l]/down2[l]);
1362 // if(centValue>60.) fh2AngStructpt2C60->Fill(rr,rr*up2[l]/down2[l]);}
1363 // if(down3[l]!=0){
1364 // if(centValue<10.) fh2AngStructpt3C10->Fill(rr,rr*up3[l]/down3[l]);
1365 // if(centValue>20. && centValue<40.) fh2AngStructpt3C20->Fill(rr,rr*up3[l]/down3[l]);
1366 // if(centValue>30. && centValue<60.) fh2AngStructpt3C30->Fill(rr,rr*up3[l]/down3[l]);
1367 // if(centValue>60.) fh2AngStructpt3C60->Fill(rr,rr*up3[l]/down3[l]);}
1368 // if(down4[l]!=0){
1369 // if(centValue<10.) fh2AngStructpt4C10->Fill(rr,rr*up4[l]/down4[l]);
1370 // if(centValue>20. && centValue<40.) fh2AngStructpt4C20->Fill(rr,rr*up4[l]/down4[l]);
1371 // if(centValue>30. && centValue<60.) fh2AngStructpt4C30->Fill(rr,rr*up4[l]/down4[l]);
1372 // if(centValue>60.) fh2AngStructpt4C60->Fill(rr,rr*up4[l]/down4[l]);}}}
ea693273 1373
1374
1375
1376
1377
75bf77e3 1378
1379
1380 PostData(1, fOutputList);
da93bb11 1381}
75bf77e3 1382
1383void AliAnalysisTaskJetCore::Terminate(const Option_t *)
1384{
1385 // Draw result to the screen
1386 // Called once at the end of the query
1387
1388 if (!GetOutputData(1))
1389 return;
1390}
1391
ea693273 1392
1393
5bd732d4 1394
ea693273 1395
1396
1397Int_t AliAnalysisTaskJetCore::GetListOfTracks(TList *list){
1398
5bd732d4 1399 Int_t iCount = 0;
1400 AliAODEvent *aod = 0;
ba143e7f 1401 if(!fESD)aod = fAODIn;
5bd732d4 1402 else aod = fAODOut;
ba143e7f 1403
5bd732d4 1404 for(int it = 0;it < aod->GetNumberOfTracks();++it){
1405 AliAODTrack *tr = aod->GetTrack(it);
ea693273 1406 if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
1407 if(TMath::Abs(tr->Eta())>0.9)continue;
1408 if(tr->Pt()<0.15)continue;
1409 list->Add(tr);
1410 //cout<<fAOD->GetNumberOfTracks()<<" "<<tr->Pt()<<endl;
1411 iCount++;
1412 }
1413
529e2916 1414
ea693273 1415 return iCount;
1416
1417}
1418
da93bb11 1419 Int_t AliAnalysisTaskJetCore::GetHardestTrackBackToJet(AliAODJet *jetbig){
5bd732d4 1420
1421 AliAODEvent *aod = 0;
1422 if(!fESD)aod = fAODIn;
1423 else aod = fAODOut;
da93bb11 1424 Int_t index=-1;
1425 Double_t ptmax=-10;
1426 Double_t dphi=0;
1427 Double_t dif=0;
1428 Int_t iCount=0;
5bd732d4 1429 for(int it = 0;it < aod->GetNumberOfTracks();++it){
1430 AliAODTrack *tr = aod->GetTrack(it);
da93bb11 1431 if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
1432 if(TMath::Abs(tr->Eta())>0.9)continue;
1433 if(tr->Pt()<0.15)continue;
1434 iCount=iCount+1;
529e2916 1435 dphi=RelativePhi(tr->Phi(),jetbig->Phi());
da93bb11 1436 if(TMath::Abs(dphi)<TMath::Pi()-0.2) continue;
1437 if(tr->Pt()>ptmax){ ptmax=tr->Pt();
b6844e9e 1438 index=iCount-1;
1439 dif=dphi; }}
da93bb11 1440
1441 return index;
1442
1443 }
1444
1445
1446
1447
1448
1449
1450
1451
1452
ea693273 1453 Int_t AliAnalysisTaskJetCore::GetListOfTracksCloseToJet(TList *list,AliAODJet *jetbig){
1454
1455 Int_t iCount = 0;
5bd732d4 1456 AliAODEvent *aod = 0;
1457 if(!fESD)aod = fAODIn;
1458 else aod = fAODOut;
8b47ec90 1459
5bd732d4 1460 for(int it = 0;it < aod->GetNumberOfTracks();++it){
1461 AliAODTrack *tr = aod->GetTrack(it);
ea693273 1462 if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
1463 if(TMath::Abs(tr->Eta())>0.9)continue;
1464 if(tr->Pt()<0.15)continue;
1465 Double_t disR=jetbig->DeltaR(tr);
1466 if(disR>0.8) continue;
1467 list->Add(tr);
1468 //cout<<fAOD->GetNumberOfTracks()<<" "<<tr->Pt()<<endl;
1469 iCount++;
1470 }
1471
1472 list->Sort();
1473 return iCount;
1474
1475}
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
75bf77e3 1487Int_t AliAnalysisTaskJetCore::GetNInputTracks()
1488{
1489
1490 Int_t nInputTracks = 0;
5bd732d4 1491 AliAODEvent *aod = 0;
1492 if(!fESD)aod = fAODIn;
1493 else aod = fAODOut;
75bf77e3 1494 TString jbname(fJetBranchName[1]);
1495 //needs complete event, use jets without background subtraction
1496 for(Int_t i=1; i<=3; ++i){
1497 if(jbname.Contains(Form("B%d",i))) jbname.ReplaceAll(Form("B%d",i),"B0");
1498 }
1499 // use only HI event
1500 if(jbname.Contains("AODextraonly")) jbname.ReplaceAll("AODextraonly","AOD");
1501 if(jbname.Contains("AODextra")) jbname.ReplaceAll("AODextra","AOD");
1502
1503 if(fDebug) Printf("Multiplicity from jet branch %s", jbname.Data());
5bd732d4 1504 TClonesArray *tmpAODjets = dynamic_cast<TClonesArray*>(aod->FindListObject(jbname.Data()));
75bf77e3 1505 if(!tmpAODjets){
1506 Printf("Jet branch %s not found", jbname.Data());
1507 Printf("AliAnalysisTaskJetCore::GetNInputTracks FAILED");
1508 return -1;
1509 }
1510
1511 for (Int_t iJet=0; iJet<tmpAODjets->GetEntriesFast(); iJet++){
1512 AliAODJet *jet = dynamic_cast<AliAODJet*>((*tmpAODjets)[iJet]);
1513 if(!jet) continue;
1514 TRefArray *trackList = jet->GetRefTracks();
1515 Int_t nTracks = trackList->GetEntriesFast();
1516 nInputTracks += nTracks;
1517 if(fDebug) Printf("#jet%d: %d tracks", iJet, nTracks);
1518 }
1519 if(fDebug) Printf("---> input tracks: %d", nInputTracks);
1520
1521 return nInputTracks;
1522}
1523
1524
1525
ea693273 1526Double_t AliAnalysisTaskJetCore::RelativePhi(Double_t mphi,Double_t vphi){
1527
1528 if (vphi < -1*TMath::Pi()) vphi += (2*TMath::Pi());
1529 else if (vphi > TMath::Pi()) vphi -= (2*TMath::Pi());
1530 if (mphi < -1*TMath::Pi()) mphi += (2*TMath::Pi());
1531 else if (mphi > TMath::Pi()) mphi -= (2*TMath::Pi());
1532 double dphi = mphi-vphi;
1533 if (dphi < -1*TMath::Pi()) dphi += (2*TMath::Pi());
1534 else if (dphi > TMath::Pi()) dphi -= (2*TMath::Pi());
1535 return dphi;//dphi in [-Pi, Pi]
1536}
1537
75bf77e3 1538
1539
da93bb11 1540THnSparse* AliAnalysisTaskJetCore::NewTHnSparseF(const char* name, UInt_t entries)
1541{
1542 // generate new THnSparseF, axes are defined in GetDimParams()
1543
1544 Int_t count = 0;
1545 UInt_t tmp = entries;
1546 while(tmp!=0){
1547 count++;
1548 tmp = tmp &~ -tmp; // clear lowest bit
1549 }
1550
1551 TString hnTitle(name);
1552 const Int_t dim = count;
1553 Int_t nbins[dim];
1554 Double_t xmin[dim];
1555 Double_t xmax[dim];
1556
1557 Int_t i=0;
1558 Int_t c=0;
1559 while(c<dim && i<32){
1560 if(entries&(1<<i)){
1561
1562 TString label("");
1563 GetDimParams(i, label, nbins[c], xmin[c], xmax[c]);
1564 hnTitle += Form(";%s",label.Data());
1565 c++;
1566 }
1567
1568 i++;
1569 }
1570 hnTitle += ";";
1571
1572 return new THnSparseF(name, hnTitle.Data(), dim, nbins, xmin, xmax);
1573}
1574
1575void AliAnalysisTaskJetCore::GetDimParams(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
1576{
1577 // stores label and binning of axis for THnSparse
1578
1579 const Double_t pi = TMath::Pi();
1580
1581 switch(iEntry){
1582
1583 case 0:
1584 label = "V0 centrality (%)";
1585
1586 nbins = 10;
1587 xmin = 0.;
1588 xmax = 100.;
1589 break;
1590
1591
1592 case 1:
1593 label = "corrected jet pt";
c42c6838 1594 nbins = 20;
da93bb11 1595 xmin = 0.;
1596 xmax = 200.;
1597 break;
1598
1599
1600 case 2:
1601 label = "track pT";
1602
ba143e7f 1603 nbins = 9;
da93bb11 1604 xmin = 0.;
5bd732d4 1605 xmax = 150;
da93bb11 1606 break;
1607
1608
529e2916 1609 case 3:
da93bb11 1610 label = "deltaR";
1611 nbins = 15;
1612 xmin = 0.;
1613 xmax = 1.5;
1614 break;
529e2916 1615
1616
1617
da93bb11 1618 case 4:
1619 label = "deltaEta";
ba143e7f 1620 nbins = 8;
1621 xmin = -1.6;
1622 xmax = 1.6;
da93bb11 1623 break;
1624
1625
5bd732d4 1626 case 5:
da93bb11 1627 label = "deltaPhi";
1628 nbins = 90;
1629 xmin = -0.5*pi;
1630 xmax = 1.5*pi;
1631 break;
1632
1633
529e2916 1634
1635 case 6:
da93bb11 1636 label = "leading track";
ba143e7f 1637 nbins = 13;
da93bb11 1638 xmin = 0;
20dcc500 1639 xmax = 50;
da93bb11 1640 break;
1641
529e2916 1642 case 7:
da93bb11 1643
1644 label = "trigger track";
ba143e7f 1645 nbins =10;
da93bb11 1646 xmin = 0;
1647 xmax = 50;
1648 break;
529e2916 1649
1650
1651
1652
1653
1654
1655
1656
da93bb11 1657 }
1658
1659}
1660