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