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