1 // **************************************
2 // Task used for the correction of determiantion of reconstructed jet spectra
3 // Compares input (gen) and output (rec) jets
4 // *******************************************
7 /**************************************************************************
8 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
10 * Author: The ALICE Off-line Project. *
11 * Contributors are mentioned in the code where appropriate. *
13 * Permission to use, copy, modify and distribute this software and its *
14 * documentation strictly for non-commercial purposes is hereby granted *
15 * without fee, provided that the above copyright notice appears in all *
16 * copies and that both the copyright notice and this permission notice *
17 * appear in the supporting documentation. The authors make no claims *
18 * about the suitability of this software for any purpose. It is *
19 * provided "as is" without express or implied warranty. *
20 **************************************************************************/
26 #include <TInterpreter.h>
28 #include <TRefArray.h>
37 #include <TLorentzVector.h>
38 #include <TClonesArray.h>
39 #include "TDatabasePDG.h"
41 #include "AliAnalysisTaskJetCluster.h"
42 #include "AliAnalysisManager.h"
43 #include "AliJetFinder.h"
44 #include "AliJetHeader.h"
45 #include "AliJetReader.h"
46 #include "AliESDEvent.h"
47 #include "AliAODEvent.h"
48 #include "AliAODHandler.h"
49 #include "AliAODExtension.h"
50 #include "AliAODTrack.h"
51 #include "AliAODJet.h"
52 #include "AliAODMCParticle.h"
53 #include "AliMCEventHandler.h"
54 #include "AliMCEvent.h"
56 #include "AliGenPythiaEventHeader.h"
57 #include "AliJetKineReaderHeader.h"
58 #include "AliGenCocktailEventHeader.h"
59 #include "AliInputEventHandler.h"
60 #include "AliAODJetEventBackground.h"
62 #include "fastjet/PseudoJet.hh"
63 #include "fastjet/ClusterSequenceArea.hh"
64 #include "fastjet/AreaDefinition.hh"
65 #include "fastjet/JetDefinition.hh"
66 // get info on how fastjet was configured
67 #include "fastjet/config.h"
71 ClassImp(AliAnalysisTaskJetCluster)
73 AliAnalysisTaskJetCluster::~AliAnalysisTaskJetCluster(){
81 if(fTCAJetsOut)fTCAJetsOut->Delete();
84 if(fTCAJetsOutRan)fTCAJetsOutRan->Delete();
85 delete fTCAJetsOutRan;
87 if(fTCARandomConesOut)fTCARandomConesOut->Delete();
88 delete fTCARandomConesOut;
90 if(fTCARandomConesOutRan)fTCARandomConesOutRan->Delete();
91 delete fTCARandomConesOutRan;
93 if(fAODJetBackgroundOut)fAODJetBackgroundOut->Reset();
94 delete fAODJetBackgroundOut;
97 AliAnalysisTaskJetCluster::AliAnalysisTaskJetCluster():
102 fUseAODTrackInput(kFALSE),
103 fUseAODMCInput(kFALSE),
104 fUseBackgroundCalc(kFALSE),
105 fEventSelection(kFALSE),
107 fFilterMaskBestPt(0),
110 fTrackTypeRec(kTrackUndef),
111 fTrackTypeGen(kTrackUndef),
113 fNSkipLeadingCone(0),
117 fTrackEtaWindow(0.9),
120 fJetOutputMinPt(0.150),
121 fMaxTrackPtInJet(100.),
127 fStoreRhoLeadingTrackCorr(kFALSE),
129 fBackgroundBranch(""),
140 fUseTrPtResolutionSmearing(kFALSE),
141 fUseDiceEfficiency(kFALSE),
142 fDiceEfficiencyMinPt(-1.),
143 fUseTrPtResolutionFromOADB(kFALSE),
144 fUseTrEfficiencyFromOADB(kFALSE),
145 fPathTrPtResolution(""),
146 fPathTrEfficiency(""),
147 fChangeEfficiencyFraction(0.),
148 fEfficiencyFixed(1.),
150 fAlgorithm(fastjet::kt_algorithm),
151 fStrategy(fastjet::Best),
152 fRecombScheme(fastjet::BIpt_scheme),
153 fAreaType(fastjet::active_area),
155 fActiveAreaRepeats(1),
159 fTCARandomConesOut(0x0),
160 fTCARandomConesOutRan(0x0),
161 fAODJetBackgroundOut(0x0),
167 fh1PtHardTrials(0x0),
170 fh1NConstLeadingRec(0x0),
172 fh1PtJetsLeadingRecIn(0x0),
173 fh1PtJetConstRec(0x0),
174 fh1PtJetConstLeadingRec(0x0),
175 fh1PtTracksRecIn(0x0),
176 fh1PtTracksLeadingRecIn(0x0),
178 fh1NConstRecRan(0x0),
179 fh1PtJetsLeadingRecInRan(0x0),
180 fh1NConstLeadingRecRan(0x0),
181 fh1PtJetsRecInRan(0x0),
182 fh1PtTracksGenIn(0x0),
184 fh1CentralityPhySel(0x0),
186 fh1CentralitySelect(0x0),
191 fh2NRecTracksPt(0x0),
193 fh2NConstLeadingPt(0x0),
195 fh2LeadingJetPhiEta(0x0),
197 fh2LeadingJetEtaPt(0x0),
199 fh2LeadingTrackEtaPt(0x0),
200 fh2JetsLeadingPhiEta(0x0),
201 fh2JetsLeadingPhiPt(0x0),
202 fh2TracksLeadingPhiEta(0x0),
203 fh2TracksLeadingPhiPt(0x0),
204 fh2TracksLeadingJetPhiPt(0x0),
205 fh2JetsLeadingPhiPtW(0x0),
206 fh2TracksLeadingPhiPtW(0x0),
207 fh2TracksLeadingJetPhiPtW(0x0),
208 fh2NRecJetsPtRan(0x0),
210 fh2NConstLeadingPtRan(0x0),
215 fh2TracksLeadingJetPhiPtRan(0x0),
216 fh2TracksLeadingJetPhiPtWRan(0x0),
217 fh3CentvsRhoLeadingTrackPt(0x0),
218 fh3CentvsSigmaLeadingTrackPt(0x0),
219 fh3MultvsRhoLeadingTrackPt(0x0),
220 fh3MultvsSigmaLeadingTrackPt(0x0),
221 fh3CentvsRhoLeadingTrackPtQ1(0x0),
222 fh3CentvsRhoLeadingTrackPtQ2(0x0),
223 fh3CentvsRhoLeadingTrackPtQ3(0x0),
224 fh3CentvsRhoLeadingTrackPtQ4(0x0),
225 fh3CentvsSigmaLeadingTrackPtQ1(0x0),
226 fh3CentvsSigmaLeadingTrackPtQ2(0x0),
227 fh3CentvsSigmaLeadingTrackPtQ3(0x0),
228 fh3CentvsSigmaLeadingTrackPtQ4(0x0),
229 fh3MultvsRhoLeadingTrackPtQ1(0x0),
230 fh3MultvsRhoLeadingTrackPtQ2(0x0),
231 fh3MultvsRhoLeadingTrackPtQ3(0x0),
232 fh3MultvsRhoLeadingTrackPtQ4(0x0),
233 fh3MultvsSigmaLeadingTrackPtQ1(0x0),
234 fh3MultvsSigmaLeadingTrackPtQ2(0x0),
235 fh3MultvsSigmaLeadingTrackPtQ3(0x0),
236 fh3MultvsSigmaLeadingTrackPtQ4(0x0),
237 fh3CentvsDeltaRhoLeadingTrackPtQ1(0x0),
238 fh3CentvsDeltaRhoLeadingTrackPtQ2(0x0),
239 fh3CentvsDeltaRhoLeadingTrackPtQ3(0x0),
240 fh3CentvsDeltaRhoLeadingTrackPtQ4(0x0),
241 fh2PtGenPtSmeared(0x0),
243 fp1PtResolution(0x0),
250 for(int i = 0;i<3;i++){
251 fh1BiARandomCones[i] = 0;
252 fh1BiARandomConesRan[i] = 0;
254 for(int i = 0;i<kMaxCent;i++){
255 fh2JetsLeadingPhiPtC[i] = 0;
256 fh2JetsLeadingPhiPtWC[i] = 0; //! jet correlation with leading jet
257 fh2TracksLeadingJetPhiPtC[i] = 0;
258 fh2TracksLeadingJetPhiPtWC[i] = 0;
262 AliAnalysisTaskJetCluster::AliAnalysisTaskJetCluster(const char* name):
263 AliAnalysisTaskSE(name),
267 fUseAODTrackInput(kFALSE),
268 fUseAODMCInput(kFALSE),
269 fUseBackgroundCalc(kFALSE),
270 fEventSelection(kFALSE), fFilterMask(0),
271 fFilterMaskBestPt(0),
274 fTrackTypeRec(kTrackUndef),
275 fTrackTypeGen(kTrackUndef),
277 fNSkipLeadingCone(0),
281 fTrackEtaWindow(0.9),
284 fJetOutputMinPt(0.150),
285 fMaxTrackPtInJet(100.),
291 fStoreRhoLeadingTrackCorr(kFALSE),
293 fBackgroundBranch(""),
304 fUseTrPtResolutionSmearing(kFALSE),
305 fUseDiceEfficiency(kFALSE),
306 fDiceEfficiencyMinPt(-1.),
307 fUseTrPtResolutionFromOADB(kFALSE),
308 fUseTrEfficiencyFromOADB(kFALSE),
309 fPathTrPtResolution(""),
310 fPathTrEfficiency(""),
311 fChangeEfficiencyFraction(0.),
312 fEfficiencyFixed(1.),
314 fAlgorithm(fastjet::kt_algorithm),
315 fStrategy(fastjet::Best),
316 fRecombScheme(fastjet::BIpt_scheme),
317 fAreaType(fastjet::active_area),
319 fActiveAreaRepeats(1),
323 fTCARandomConesOut(0x0),
324 fTCARandomConesOutRan(0x0),
325 fAODJetBackgroundOut(0x0),
331 fh1PtHardTrials(0x0),
334 fh1NConstLeadingRec(0x0),
336 fh1PtJetsLeadingRecIn(0x0),
337 fh1PtJetConstRec(0x0),
338 fh1PtJetConstLeadingRec(0x0),
339 fh1PtTracksRecIn(0x0),
340 fh1PtTracksLeadingRecIn(0x0),
342 fh1NConstRecRan(0x0),
343 fh1PtJetsLeadingRecInRan(0x0),
344 fh1NConstLeadingRecRan(0x0),
345 fh1PtJetsRecInRan(0x0),
346 fh1PtTracksGenIn(0x0),
348 fh1CentralityPhySel(0x0),
350 fh1CentralitySelect(0x0),
355 fh2NRecTracksPt(0x0),
357 fh2NConstLeadingPt(0x0),
359 fh2LeadingJetPhiEta(0x0),
361 fh2LeadingJetEtaPt(0x0),
363 fh2LeadingTrackEtaPt(0x0),
364 fh2JetsLeadingPhiEta(0x0),
365 fh2JetsLeadingPhiPt(0x0),
366 fh2TracksLeadingPhiEta(0x0),
367 fh2TracksLeadingPhiPt(0x0),
368 fh2TracksLeadingJetPhiPt(0x0),
369 fh2JetsLeadingPhiPtW(0x0),
370 fh2TracksLeadingPhiPtW(0x0),
371 fh2TracksLeadingJetPhiPtW(0x0),
372 fh2NRecJetsPtRan(0x0),
374 fh2NConstLeadingPtRan(0x0),
379 fh2TracksLeadingJetPhiPtRan(0x0),
380 fh2TracksLeadingJetPhiPtWRan(0x0),
381 fh3CentvsRhoLeadingTrackPt(0x0),
382 fh3CentvsSigmaLeadingTrackPt(0x0),
383 fh3MultvsRhoLeadingTrackPt(0x0),
384 fh3MultvsSigmaLeadingTrackPt(0x0),
385 fh3CentvsRhoLeadingTrackPtQ1(0x0),
386 fh3CentvsRhoLeadingTrackPtQ2(0x0),
387 fh3CentvsRhoLeadingTrackPtQ3(0x0),
388 fh3CentvsRhoLeadingTrackPtQ4(0x0),
389 fh3CentvsSigmaLeadingTrackPtQ1(0x0),
390 fh3CentvsSigmaLeadingTrackPtQ2(0x0),
391 fh3CentvsSigmaLeadingTrackPtQ3(0x0),
392 fh3CentvsSigmaLeadingTrackPtQ4(0x0),
393 fh3MultvsRhoLeadingTrackPtQ1(0x0),
394 fh3MultvsRhoLeadingTrackPtQ2(0x0),
395 fh3MultvsRhoLeadingTrackPtQ3(0x0),
396 fh3MultvsRhoLeadingTrackPtQ4(0x0),
397 fh3MultvsSigmaLeadingTrackPtQ1(0x0),
398 fh3MultvsSigmaLeadingTrackPtQ2(0x0),
399 fh3MultvsSigmaLeadingTrackPtQ3(0x0),
400 fh3MultvsSigmaLeadingTrackPtQ4(0x0),
401 fh3CentvsDeltaRhoLeadingTrackPtQ1(0x0),
402 fh3CentvsDeltaRhoLeadingTrackPtQ2(0x0),
403 fh3CentvsDeltaRhoLeadingTrackPtQ3(0x0),
404 fh3CentvsDeltaRhoLeadingTrackPtQ4(0x0),
405 fh2PtGenPtSmeared(0x0),
407 fp1PtResolution(0x0),
414 for(int i = 0;i<3;i++){
415 fh1BiARandomCones[i] = 0;
416 fh1BiARandomConesRan[i] = 0;
418 for(int i = 0;i<kMaxCent;i++){
419 fh2JetsLeadingPhiPtC[i] = 0;
420 fh2JetsLeadingPhiPtWC[i] = 0; //! jet correlation with leading jet
421 fh2TracksLeadingJetPhiPtC[i] = 0;
422 fh2TracksLeadingJetPhiPtWC[i] = 0;
424 DefineOutput(1, TList::Class());
429 Bool_t AliAnalysisTaskJetCluster::Notify()
432 // Implemented Notify() to read the cross sections
433 // and number of trials from pyxsec.root
438 void AliAnalysisTaskJetCluster::UserCreateOutputObjects()
442 // Create the output container
445 fRandom = new TRandom3(0);
451 if (fDebug > 1) printf("AnalysisTaskJetCluster::UserCreateOutputObjects() \n");
455 if(fNonStdBranch.Length()!=0)
457 // only create the output branch if we have a name
458 // Create a new branch for jets...
459 // -> cleared in the UserExec....
460 // here we can also have the case that the brnaches are written to a separate file
463 fTCAJetsOut = new TClonesArray("AliAODJet", 0);
464 fTCAJetsOut->SetName(fNonStdBranch.Data());
465 AddAODBranch("TClonesArray",&fTCAJetsOut,fNonStdFile.Data());
468 if(fJetTypes&kJetRan){
469 fTCAJetsOutRan = new TClonesArray("AliAODJet", 0);
470 fTCAJetsOutRan->SetName(Form("%s_%s",fNonStdBranch.Data(),"random"));
471 if(fUseDiceEfficiency || fUseTrPtResolutionSmearing) {
472 if( fEfficiencyFixed < 1.)
473 fTCAJetsOutRan->SetName(Form("%s_%sDetector%d%dEffFixed%d",fNonStdBranch.Data(),"random",fUseTrPtResolutionSmearing,fUseDiceEfficiency,(int)(fEfficiencyFixed*100.)));
475 fTCAJetsOutRan->SetName(Form("%s_%sDetector%d%dFr%d",fNonStdBranch.Data(),"random",fUseTrPtResolutionSmearing,fUseDiceEfficiency,(int)(fChangeEfficiencyFraction*100.)));
477 AddAODBranch("TClonesArray",&fTCAJetsOutRan,fNonStdFile.Data());
480 if(fUseBackgroundCalc){
481 if(!AODEvent()->FindListObject(Form("%s_%s",AliAODJetEventBackground::StdBranchName(),fNonStdBranch.Data()))){
482 fAODJetBackgroundOut = new AliAODJetEventBackground();
483 fAODJetBackgroundOut->SetName(Form("%s_%s",AliAODJetEventBackground::StdBranchName(),fNonStdBranch.Data()));
484 if(fUseDiceEfficiency || fUseTrPtResolutionSmearing) {
485 if( fEfficiencyFixed < 1.)
486 fAODJetBackgroundOut->SetName(Form("%s_%sDetector%d%dEffFixed%d",AliAODJetEventBackground::StdBranchName(),fNonStdBranch.Data(),fUseTrPtResolutionSmearing,fUseDiceEfficiency,(int)(fEfficiencyFixed*100.)));
488 fAODJetBackgroundOut->SetName(Form("%s_%sDetector%d%dFr%d",AliAODJetEventBackground::StdBranchName(),fNonStdBranch.Data(),fUseTrPtResolutionSmearing,fUseDiceEfficiency,(int)(fChangeEfficiencyFraction*100.)));
490 AddAODBranch("AliAODJetEventBackground",&fAODJetBackgroundOut,fNonStdFile.Data());
493 // create the branch for the random cones with the same R
494 TString cName = Form("%sRandomConeSkip%02d",fNonStdBranch.Data(),fNSkipLeadingCone);
495 if(fUseDiceEfficiency || fUseTrPtResolutionSmearing) {
496 if( fEfficiencyFixed < 1.)
497 cName = Form("%sDetector%d%dEffFixed%d_RandomConeSkip%02d",fNonStdBranch.Data(),fUseTrPtResolutionSmearing,fUseDiceEfficiency,(int)(fEfficiencyFixed*100.),fNSkipLeadingCone);
499 cName = Form("%sDetector%d%dFr%d_RandomConeSkip%02d",fNonStdBranch.Data(),fUseTrPtResolutionSmearing,fUseDiceEfficiency,(int)(fChangeEfficiencyFraction*100.),fNSkipLeadingCone);
503 if(!AODEvent()->FindListObject(cName.Data())){
504 fTCARandomConesOut = new TClonesArray("AliAODJet", 0);
505 fTCARandomConesOut->SetName(cName.Data());
506 AddAODBranch("TClonesArray",&fTCARandomConesOut,fNonStdFile.Data());
509 // create the branch with the random for the random cones on the random event
510 if(fJetTypes&kRCRan){
511 cName = Form("%sRandomCone_random",fNonStdBranch.Data());
512 if(!AODEvent()->FindListObject(cName.Data())){
513 fTCARandomConesOutRan = new TClonesArray("AliAODJet", 0);
514 fTCARandomConesOutRan->SetName(cName.Data());
515 AddAODBranch("TClonesArray",&fTCARandomConesOutRan,fNonStdFile.Data());
520 if(fNonStdFile.Length()!=0){
522 // case that we have an AOD extension we need to fetch the jets from the extended output
523 // we identify the extension aod event by looking for the branchname
524 AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
525 // case that we have an AOD extension we need can fetch the background maybe from the extended output
526 fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0);
531 if(!fHistList)fHistList = new TList();
532 fHistList->SetOwner();
533 PostData(1, fHistList); // post data in any case once
535 Bool_t oldStatus = TH1::AddDirectoryStatus();
536 TH1::AddDirectory(kFALSE);
541 const Int_t nBinPt = 100;
542 Double_t binLimitsPt[nBinPt+1];
543 for(Int_t iPt = 0;iPt <= nBinPt;iPt++){
545 binLimitsPt[iPt] = 0.0;
548 binLimitsPt[iPt] = binLimitsPt[iPt-1] + 2.0;
552 const Int_t nBinPhi = 90;
553 Double_t binLimitsPhi[nBinPhi+1];
554 for(Int_t iPhi = 0;iPhi<=nBinPhi;iPhi++){
556 binLimitsPhi[iPhi] = -1.*TMath::Pi();
559 binLimitsPhi[iPhi] = binLimitsPhi[iPhi-1] + 1/(Float_t)nBinPhi * TMath::Pi()*2;
565 const Int_t nBinEta = 40;
566 Double_t binLimitsEta[nBinEta+1];
567 for(Int_t iEta = 0;iEta<=nBinEta;iEta++){
569 binLimitsEta[iEta] = -2.0;
572 binLimitsEta[iEta] = binLimitsEta[iEta-1] + 0.1;
576 const int nChMax = 5000;
578 fh1Xsec = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1);
579 fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>");
581 fh1Trials = new TH1F("fh1Trials","trials root file",1,0,1);
582 fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
585 fh1NJetsRec = new TH1F("fh1NJetsRec","N reconstructed jets",120,-0.5,119.5);
586 fh1NJetsRecRan = new TH1F("fh1NJetsRecRan","N reconstructed jets",120,-0.5,119.5);
588 fh1NConstRec = new TH1F("fh1NConstRec","# jet constituents",120,-0.5,119.5);
589 fh1NConstRecRan = new TH1F("fh1NConstRecRan","# jet constituents",120,-0.5,119.5);
590 fh1NConstLeadingRec = new TH1F("fh1NConstLeadingRec","jet constituents",120,-0.5,119.5);
591 fh1NConstLeadingRecRan = new TH1F("fh1NConstLeadingRecRan","jet constituents",120,-0.5,119.5);
594 fh1PtHard = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",nBinPt,binLimitsPt);
595 fh1PtHardNoW = new TH1F("fh1PtHardNoW","PYTHIA Pt hard no weight;p_{T,hard}",nBinPt,binLimitsPt);
596 fh1PtHardTrials = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",nBinPt,binLimitsPt);
598 fh1PtJetsRecIn = new TH1F("fh1PtJetsRecIn","Rec jets P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
599 fh1PtJetsRecInRan = new TH1F("fh1PtJetsRecInRan","Rec jets P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
600 fh1PtJetsLeadingRecIn = new TH1F("fh1PtJetsLeadingRecIn","Rec jets P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
601 fh1PtJetsLeadingRecInRan = new TH1F("fh1PtJetsLeadingRecInRan","Rec jets P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
602 fh1PtJetConstRec = new TH1F("fh1PtJetsConstRec","Rec jets constituents P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
603 fh1PtJetConstLeadingRec = new TH1F("fh1PtJetsConstLeadingRec","Rec jets constituents P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
604 fh1PtTracksRecIn = new TH1F("fh1PtTracksRecIn",Form("Rec tracks P_T #eta < %1.2f;p_{T} (GeV/c)",fTrackEtaWindow),nBinPt,binLimitsPt);
605 fh1PtTracksLeadingRecIn = new TH1F("fh1PtTracksLeadingRecIn",Form("Rec tracks P_T #eta < %1.2f ;p_{T} (GeV/c)",fTrackEtaWindow),nBinPt,binLimitsPt);
606 fh1PtTracksGenIn = new TH1F("fh1PtTracksGenIn",Form("gen tracks P_T #eta < %1.2f ;p_{T} (GeV/c)",fTrackEtaWindow),nBinPt,binLimitsPt);
607 fh1Nch = new TH1F("fh1Nch","charged multiplicity; N_{ch}",nChMax,-0.5,nChMax-0.5);
609 fh1Centrality = new TH1F("fh1Centrality",";cent (%)",111,-0.5,110.5);
610 fh1CentralitySelect = new TH1F("fh1CentralitySelect",";cent (%)",111,-0.5,110.5);
611 fh1CentralityPhySel = new TH1F("fh1CentralityPhySel",";cent (%)",111,-0.5,110.5);
613 fh1Z = new TH1F("fh1Z",";zvtx",100,-25,25);
614 fh1ZSelect = new TH1F("fh1ZSelect",";zvtx",100,-25,25);
615 fh1ZPhySel = new TH1F("fh1ZPhySel",";zvtx",100,-25,25);
617 fh2NRecJetsPt = new TH2F("fh2NRecJetsPt","Number of jets above threshhold;p_{T,cut} (GeV/c);N_{jets}",nBinPt,binLimitsPt,50,-0.5,49.5);
618 fh2NRecJetsPtRan = new TH2F("fh2NRecJetsPtRan","Number of jets above threshhold;p_{T,cut} (GeV/c);N_{jets}",nBinPt,binLimitsPt,50,-0.5,49.5);
619 fh2NRecTracksPt = new TH2F("fh2NRecTracksPt","Number of tracks above threshhold;p_{T,cut} (GeV/c);N_{tracks}",nBinPt,binLimitsPt,50,-0.5,49.5);
623 fh2NConstPt = new TH2F("fh2NConstPt","Number of constituents ;p_{T} (GeV/c);N",nBinPt,binLimitsPt,50,-0.5,49.5);
624 fh2NConstLeadingPt = new TH2F("fh2NConstLeadingPt","Number of constituents ;p_{T} (GeV/c);N",nBinPt,binLimitsPt,50,-0.5,49.5);
625 fh2NConstPtRan = new TH2F("fh2NConstPtRan","Number of constituents ;p_{T} (GeV/c);N",nBinPt,binLimitsPt,50,-0.5,49.5);
626 fh2NConstLeadingPtRan = new TH2F("fh2NConstLeadingPtRan","Number of constituents ;p_{T} (GeV/c);N",nBinPt,binLimitsPt,50,-0.5,49.5);
628 fh2PtNch = new TH2F("fh2PtNch","p_T of cluster vs. multiplicity; N_{ch};p_{T} (GeV/c);",nChMax,-0.5,nChMax-0.5,nBinPt,binLimitsPt);
629 fh2PtNchRan = new TH2F("fh2PtNchRan","p_T of cluster vs. multiplicity ran; N_{ch};p_{T} (GeV/c);",nChMax,-0.5,nChMax-0.5,nBinPt,binLimitsPt);
630 fh2PtNchN = new TH2F("fh2PtNchN","p_T of cluster vs. multiplicity N weighted; N_{ch};p_{T} (GeV/c);",nChMax,-0.5,nChMax-0.5,nBinPt,binLimitsPt);
631 fh2PtNchNRan = new TH2F("fh2PtNchNRan","p_T of cluster vs. multiplicity N weighted ran; N_{ch};p_{T} (GeV/c);",nChMax,-0.5,nChMax-0.5,nBinPt,binLimitsPt);
635 fh2JetPhiEta = new TH2F("fh2JetPhiEta","eta vs phi all jets;#phi;#eta",
636 nBinPhi,0.,2.*TMath::Pi(),nBinEta,binLimitsEta);
637 fh2LeadingJetPhiEta = new TH2F("fh2LeadingJetPhiEta","eta vs phi leading jets;#phi;#eta",
638 nBinPhi,0.,2.*TMath::Pi(),nBinEta,binLimitsEta);
640 fh2JetEtaPt = new TH2F("fh2JetEtaPt","pt vs eta all jets;#eta;p_{T}",
641 nBinEta,binLimitsEta,nBinPt,binLimitsPt);
642 fh2LeadingJetEtaPt = new TH2F("fh2LeadingJetEtaPt","pT vs eta leading jets;#eta;p_{T}",
643 nBinEta,binLimitsEta,nBinPt,binLimitsPt);
645 fh2TrackEtaPt = new TH2F("fh2TrackEtaPt","pt vs eta all jets;#eta;p_{T}",
646 nBinEta,binLimitsEta,nBinPt,binLimitsPt);
647 fh2LeadingTrackEtaPt = new TH2F("fh2LeadingTrackEtaPt","pT vs eta leading jets;#eta;p_{T}",
648 nBinEta,binLimitsEta,nBinPt,binLimitsPt);
652 fh2JetsLeadingPhiEta = new TH2F("fh2JetsLeadingPhiEta","delta eta vs delta phi to leading jet;#Delta#phi;#Delta#eta",
653 nBinPhi,binLimitsPhi,nBinEta,binLimitsEta);
654 fh2JetsLeadingPhiPt = new TH2F("fh2JetsLeadingPhiPt","leading p_T vs delta phi to leading jet;#Delta#phi;p_{T} (GeV/c)",
655 nBinPhi,binLimitsPhi,nBinPt,binLimitsPt);
656 fh2TracksLeadingPhiEta = new TH2F("fh2TracksLeadingPhiEta","delta eta vs delta phi to leading track;#Delta#phi;#Delta#eta",
657 nBinPhi,binLimitsPhi,nBinEta,binLimitsEta);
658 fh2TracksLeadingPhiPt = new TH2F("fh2TracksLeadingPhiPt","leading p_T vs delta phi to leading jet;#Delta#phi;p_{T} (GeV/c)",
659 nBinPhi,binLimitsPhi,nBinPt,binLimitsPt);
660 fh2TracksLeadingJetPhiPt = new TH2F("fh2TracksLeadingJetPhiPt","leading p_T vs delta phi to leading jet;#Delta#phi;p_{T} (GeV/c)",
661 nBinPhi,binLimitsPhi,nBinPt,binLimitsPt);
662 fh2TracksLeadingJetPhiPtRan = new TH2F("fh2TracksLeadingJetPhiPtRan","leading p_T vs delta phi to leading jet;#Delta#phi;p_{T} (GeV/c)",
663 nBinPhi,binLimitsPhi,nBinPt,binLimitsPt);
665 fh2JetsLeadingPhiPtW = new TH2F("fh2JetsLeadingPhiPtW","leading p_T vs delta phi p_T weigted to leading jet;#Delta#phi;p_{T} (GeV/c)",
666 nBinPhi,binLimitsPhi,nBinPt,binLimitsPt);
667 fh2TracksLeadingPhiPtW = new TH2F("fh2TracksLeadingPhiPtW","leading p_T vs delta phi to leading jet (p_T weighted);#Delta#phi;p_{T} (GeV/c)",
668 nBinPhi,binLimitsPhi,nBinPt,binLimitsPt);
670 fh2TracksLeadingJetPhiPtW = new TH2F("fh2TracksLeadingJetPhiPtW","leading p_T vs delta phi to leading jet;#Delta#phi;p_{T} (GeV/c)",
671 nBinPhi,binLimitsPhi,nBinPt,binLimitsPt);
672 fh2TracksLeadingJetPhiPtWRan = new TH2F("fh2TracksLeadingJetPhiPtWRan","leading p_T vs delta phi to leading jet;#Delta#phi;p_{T} (GeV/c)",
673 nBinPhi,binLimitsPhi,nBinPt,binLimitsPt);
675 if(fStoreRhoLeadingTrackCorr) {
676 fh3CentvsRhoLeadingTrackPt = new TH3F("fh3CentvsRhoLeadingTrackPt","centrality vs background density full event; centrality; #rho", 50,0.,100.,500,0.,250.,100,0.,100.);
677 fh3CentvsSigmaLeadingTrackPt = new TH3F("fh3CentvsSigmaLeadingTrackPt","centrality vs sigma full event; centrality; #sigma(#rho)", 50,0.,100.,50,0.,50.,100,0.,100.);
678 fh3MultvsRhoLeadingTrackPt = new TH3F("fh3MultvsRhoLeadingTrackPt","multiplicity vs background density full event; multiplicity; #rho", 100,0.,5000.,500,0.,250.,100,0.,100.);
679 fh3MultvsSigmaLeadingTrackPt = new TH3F("fh3MultvsSigmaLeadingTrackPt","multiplicity vs sigma full event; multiplicity; #sigma(#rho)", 100,0.,5000.,50,0.,50.,100,0.,100.);
682 fh3CentvsRhoLeadingTrackPtQ1 = new TH3F("fh3CentvsRhoLeadingTrackPtQ1","centrality vs background density Q1; centrality; #rho; leading p_{t}^{track}", 50,0.,100.,500,0.,250.,100,0.,100.);
683 fh3CentvsRhoLeadingTrackPtQ2 = new TH3F("fh3CentvsRhoLeadingTrackPtQ2","centrality vs background density Q2; centrality; #rho; leading p_{t}^{track}", 50,0.,100.,500,0.,250.,100,0.,100.);
684 fh3CentvsRhoLeadingTrackPtQ3 = new TH3F("fh3CentvsRhoLeadingTrackPtQ3","centrality vs background density Q3; centrality; #rho; leading p_{t}^{track}", 50,0.,100.,500,0.,250.,100,0.,100.);
685 fh3CentvsRhoLeadingTrackPtQ4 = new TH3F("fh3CentvsRhoLeadingTrackPtQ4","centrality vs background density Q4; centrality; #rho; leading p_{t}^{track}", 50,0.,100.,500,0.,250.,100,0.,100.);
687 fh3CentvsSigmaLeadingTrackPtQ1 = new TH3F("fh3CentvsSigmaLeadingTrackPtQ1","centrality vs background density Q1; centrality; #sigma(#rho); leading p_{t}^{track}", 50,0.,100.,50,0.,50.,100,0.,100.);
688 fh3CentvsSigmaLeadingTrackPtQ2 = new TH3F("fh3CentvsSigmaLeadingTrackPtQ2","centrality vs background density Q2; centrality; #sigma(#rho); leading p_{t}^{track}", 50,0.,100.,50,0.,50.,100,0.,100.);
689 fh3CentvsSigmaLeadingTrackPtQ3 = new TH3F("fh3CentvsSigmaLeadingTrackPtQ3","centrality vs background density Q3; centrality; #sigma(#rho); leading p_{t}^{track}", 50,0.,100.,50,0.,50.,100,0.,100.);
690 fh3CentvsSigmaLeadingTrackPtQ4 = new TH3F("fh3CentvsSigmaLeadingTrackPtQ4","centrality vs background density Q4; centrality; #sigma(#rho); leading p_{t}^{track}", 50,0.,100.,50,0.,50.,100,0.,100.);
692 fh3MultvsRhoLeadingTrackPtQ1 = new TH3F("fh3MultvsRhoLeadingTrackPtQ1","multiplicity vs background density Q1; multiplicity; #rho; leading p_{t}^{track}", 100,0.,5000.,500,0.,250.,100,0.,100.);
693 fh3MultvsRhoLeadingTrackPtQ2 = new TH3F("fh3MultvsRhoLeadingTrackPtQ2","multiplicity vs background density Q2; multiplicity; #rho; leading p_{t}^{track}", 100,0.,5000.,500,0.,250.,100,0.,100.);
694 fh3MultvsRhoLeadingTrackPtQ3 = new TH3F("fh3MultvsRhoLeadingTrackPtQ3","multiplicity vs background density Q3; multiplicity; #rho; leading p_{t}^{track}", 100,0.,5000.,500,0.,250.,100,0.,100.);
695 fh3MultvsRhoLeadingTrackPtQ4 = new TH3F("fh3MultvsRhoLeadingTrackPtQ4","multiplicity vs background density Q4; multiplicity; #rho; leading p_{t}^{track}", 100,0.,5000.,500,0.,250.,100,0.,100.);
697 fh3MultvsSigmaLeadingTrackPtQ1 = new TH3F("fh3MultvsSigmaLeadingTrackPtQ1","multiplicity vs background density Q1; multiplicity; #sigma(#rho); leading p_{t}^{track}", 100,0.,5000.,50,0.,50.,100,0.,100.);
698 fh3MultvsSigmaLeadingTrackPtQ2 = new TH3F("fh3MultvsSigmaLeadingTrackPtQ2","multiplicity vs background density Q2; multiplicity; #sigma(#rho); leading p_{t}^{track}", 100,0.,5000.,50,0.,50.,100,0.,100.);
699 fh3MultvsSigmaLeadingTrackPtQ3 = new TH3F("fh3MultvsSigmaLeadingTrackPtQ3","multiplicity vs background density Q3; multiplicity; #sigma(#rho); leading p_{t}^{track}", 100,0.,5000.,50,0.,50.,100,0.,100.);
700 fh3MultvsSigmaLeadingTrackPtQ4 = new TH3F("fh3MultvsSigmaLeadingTrackPtQ4","multiplicity vs background density Q4; multiplicity; #sigma(#rho); leading p_{t}^{track}", 100,0.,5000.,50,0.,50.,100,0.,100.);
703 fh3CentvsDeltaRhoLeadingTrackPtQ1 = new TH3F("fh3CentvsDeltaRhoLeadingTrackPtQ1","centrality vs background density Q1; centrality; #rho_{quadrant}-#rho_{full event}; leading p_{t}^{track}", 50,0.,100.,200,-10.,10.,100,0.,100.);
704 fh3CentvsDeltaRhoLeadingTrackPtQ2 = new TH3F("fh3CentvsDeltaRhoLeadingTrackPtQ2","centrality vs background density Q2; centrality; #rho_{quadrant}-#rho_{full event}; leading p_{t}^{track}", 50,0.,100.,200,-10.,10.,100,0.,100.);
705 fh3CentvsDeltaRhoLeadingTrackPtQ3 = new TH3F("fh3CentvsDeltaRhoLeadingTrackPtQ3","centrality vs background density Q3; centrality; #rho_{quadrant}-#rho_{full event}; leading p_{t}^{track}", 50,0.,100.,200,-10.,10.,100,0.,100.);
706 fh3CentvsDeltaRhoLeadingTrackPtQ4 = new TH3F("fh3CentvsDeltaRhoLeadingTrackPtQ4","centrality vs background density Q4; centrality; #rho_{quadrant}-#rho_{full event}; leading p_{t}^{track}", 50,0.,100.,200,-10.,10.,100,0.,100.);
708 fHistList->Add(fh3CentvsRhoLeadingTrackPt);
709 fHistList->Add(fh3CentvsSigmaLeadingTrackPt);
710 fHistList->Add(fh3MultvsRhoLeadingTrackPt);
711 fHistList->Add(fh3MultvsSigmaLeadingTrackPt);
713 fHistList->Add(fh3CentvsRhoLeadingTrackPtQ1);
714 fHistList->Add(fh3CentvsRhoLeadingTrackPtQ2);
715 fHistList->Add(fh3CentvsRhoLeadingTrackPtQ3);
716 fHistList->Add(fh3CentvsRhoLeadingTrackPtQ4);
718 fHistList->Add(fh3CentvsSigmaLeadingTrackPtQ1);
719 fHistList->Add(fh3CentvsSigmaLeadingTrackPtQ2);
720 fHistList->Add(fh3CentvsSigmaLeadingTrackPtQ3);
721 fHistList->Add(fh3CentvsSigmaLeadingTrackPtQ4);
723 fHistList->Add(fh3MultvsRhoLeadingTrackPtQ1);
724 fHistList->Add(fh3MultvsRhoLeadingTrackPtQ2);
725 fHistList->Add(fh3MultvsRhoLeadingTrackPtQ3);
726 fHistList->Add(fh3MultvsRhoLeadingTrackPtQ4);
728 fHistList->Add(fh3MultvsSigmaLeadingTrackPtQ1);
729 fHistList->Add(fh3MultvsSigmaLeadingTrackPtQ2);
730 fHistList->Add(fh3MultvsSigmaLeadingTrackPtQ3);
731 fHistList->Add(fh3MultvsSigmaLeadingTrackPtQ4);
733 fHistList->Add(fh3CentvsDeltaRhoLeadingTrackPtQ1);
734 fHistList->Add(fh3CentvsDeltaRhoLeadingTrackPtQ2);
735 fHistList->Add(fh3CentvsDeltaRhoLeadingTrackPtQ3);
736 fHistList->Add(fh3CentvsDeltaRhoLeadingTrackPtQ4);
740 //Detector level effects histos
741 fh2PtGenPtSmeared = new TH2F("fh2PtGenPtSmeared","fh2PtGenPtSmeared",nBinPt,binLimitsPt,nBinPt,binLimitsPt);
743 fp1Efficiency = new TProfile("fp1Efficiency","fp1Efficiency",nBinPt,binLimitsPt);
744 fp1PtResolution = new TProfile("fp1PtResolution","fp1PtResolution",nBinPt,binLimitsPt);
746 fHistList->Add(fh2PtGenPtSmeared);
747 fHistList->Add(fp1Efficiency);
748 fHistList->Add(fp1PtResolution);
750 if(fNRandomCones>0&&fUseBackgroundCalc){
751 for(int i = 0;i<3;i++){
752 fh1BiARandomCones[i] = new TH1F(Form("fh1BiARandomCones%d",i),";B_{i}^{A} (GeV/c)",200,-100,100);
753 fh1BiARandomConesRan[i] = new TH1F(Form("fh1BiARandomConesRan%d",i),";B_{i}^{A} (GeV/c)",200,-100,100);
757 for(int i = 0;i < kMaxCent;i++){
758 fh2JetsLeadingPhiPtC[i] = (TH2F*)fh2JetsLeadingPhiPt->Clone(Form("%s_C%02d",fh2JetsLeadingPhiPt->GetName(),i+1));
759 fh2JetsLeadingPhiPtWC[i]= (TH2F*)fh2JetsLeadingPhiPtW->Clone(Form("%s_C%02d",fh2JetsLeadingPhiPtW->GetName(),i+1));
760 fh2TracksLeadingJetPhiPtC[i] = (TH2F*)fh2TracksLeadingJetPhiPt->Clone(Form("%s_C%02d",fh2TracksLeadingJetPhiPt->GetName(),i+1));
761 fh2TracksLeadingJetPhiPtWC[i] = (TH2F*)fh2TracksLeadingJetPhiPtW->Clone(Form("%s_C%02d",fh2TracksLeadingJetPhiPtW->GetName(),i+1));
764 const Int_t saveLevel = 3; // large save level more histos
766 fHistList->Add(fh1Xsec);
767 fHistList->Add(fh1Trials);
769 fHistList->Add(fh1NJetsRec);
770 fHistList->Add(fh1NConstRec);
771 fHistList->Add(fh1NConstLeadingRec);
772 fHistList->Add(fh1PtJetsRecIn);
773 fHistList->Add(fh1PtJetsLeadingRecIn);
774 fHistList->Add(fh1PtTracksRecIn);
775 fHistList->Add(fh1PtTracksLeadingRecIn);
776 fHistList->Add(fh1PtJetConstRec);
777 fHistList->Add(fh1PtJetConstLeadingRec);
778 fHistList->Add(fh1NJetsRecRan);
779 fHistList->Add(fh1NConstRecRan);
780 fHistList->Add(fh1PtJetsLeadingRecInRan);
781 fHistList->Add(fh1NConstLeadingRecRan);
782 fHistList->Add(fh1PtJetsRecInRan);
783 fHistList->Add(fh1Nch);
784 fHistList->Add(fh1Centrality);
785 fHistList->Add(fh1CentralitySelect);
786 fHistList->Add(fh1CentralityPhySel);
787 fHistList->Add(fh1Z);
788 fHistList->Add(fh1ZSelect);
789 fHistList->Add(fh1ZPhySel);
790 if(fNRandomCones>0&&fUseBackgroundCalc){
791 for(int i = 0;i<3;i++){
792 fHistList->Add(fh1BiARandomCones[i]);
793 fHistList->Add(fh1BiARandomConesRan[i]);
796 for(int i = 0;i < kMaxCent;i++){
797 fHistList->Add(fh2JetsLeadingPhiPtC[i]);
798 fHistList->Add(fh2JetsLeadingPhiPtWC[i]);
799 fHistList->Add(fh2TracksLeadingJetPhiPtC[i]);
800 fHistList->Add(fh2TracksLeadingJetPhiPtWC[i]);
803 fHistList->Add(fh2NRecJetsPt);
804 fHistList->Add(fh2NRecTracksPt);
805 fHistList->Add(fh2NConstPt);
806 fHistList->Add(fh2NConstLeadingPt);
807 fHistList->Add(fh2PtNch);
808 fHistList->Add(fh2PtNchRan);
809 fHistList->Add(fh2PtNchN);
810 fHistList->Add(fh2PtNchNRan);
811 fHistList->Add(fh2JetPhiEta);
812 fHistList->Add(fh2LeadingJetPhiEta);
813 fHistList->Add(fh2JetEtaPt);
814 fHistList->Add(fh2LeadingJetEtaPt);
815 fHistList->Add(fh2TrackEtaPt);
816 fHistList->Add(fh2LeadingTrackEtaPt);
817 fHistList->Add(fh2JetsLeadingPhiEta );
818 fHistList->Add(fh2JetsLeadingPhiPt);
819 fHistList->Add(fh2TracksLeadingPhiEta);
820 fHistList->Add(fh2TracksLeadingPhiPt);
821 fHistList->Add(fh2TracksLeadingJetPhiPt);
822 fHistList->Add(fh2JetsLeadingPhiPtW);
823 fHistList->Add(fh2TracksLeadingPhiPtW);
824 fHistList->Add(fh2TracksLeadingJetPhiPtW);
825 fHistList->Add(fh2NRecJetsPtRan);
826 fHistList->Add(fh2NConstPtRan);
827 fHistList->Add(fh2NConstLeadingPtRan);
828 fHistList->Add(fh2TracksLeadingJetPhiPtRan);
829 fHistList->Add(fh2TracksLeadingJetPhiPtWRan);
832 // =========== Switch on Sumw2 for all histos ===========
833 for (Int_t i=0; i<fHistList->GetEntries(); ++i) {
834 TH1 *h1 = dynamic_cast<TH1*>(fHistList->At(i));
839 THnSparse *hn = dynamic_cast<THnSparse*>(fHistList->At(i));
842 TH1::AddDirectory(oldStatus);
845 void AliAnalysisTaskJetCluster::LocalInit()
851 if (fDebug > 1) printf("AnalysisTaskJetCluster::Init() \n");
853 if(fUseTrPtResolutionFromOADB) LoadTrPtResolutionRootFileFromOADB();
854 if(fUseTrEfficiencyFromOADB) LoadTrEfficiencyRootFileFromOADB();
857 FitMomentumResolution();
861 void AliAnalysisTaskJetCluster::UserExec(Option_t */*option*/)
864 // handle and reset the output jet branch
866 if(fTCAJetsOut)fTCAJetsOut->Delete();
867 if(fTCAJetsOutRan)fTCAJetsOutRan->Delete();
868 if(fTCARandomConesOut)fTCARandomConesOut->Delete();
869 if(fTCARandomConesOutRan)fTCARandomConesOutRan->Delete();
870 if(fAODJetBackgroundOut)fAODJetBackgroundOut->Reset();
872 AliAODJetEventBackground* externalBackground = 0;
873 if(!externalBackground&&fBackgroundBranch.Length()){
874 externalBackground = (AliAODJetEventBackground*)(AODEvent()->FindListObject(fBackgroundBranch.Data()));
875 if((!externalBackground)&&fAODExtension)externalBackground = (AliAODJetEventBackground*)(fAODExtension->GetAOD()->FindListObject(fBackgroundBranch.Data()));
876 if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
879 // Execute analysis for current event
881 AliESDEvent *fESD = 0;
882 if(fUseAODTrackInput){
883 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
885 Printf("%s:%d AODEvent not found in Input Manager %d",(char*)__FILE__,__LINE__,fUseAODTrackInput);
891 // assume that the AOD is in the general output...
894 Printf("%s:%d AODEvent not found in the Output",(char*)__FILE__,__LINE__);
898 fESD = dynamic_cast<AliESDEvent*> (InputEvent());
902 //Check if information is provided detector level effects
903 if(!fMomResH1 || !fMomResH2 || !fMomResH3) fUseTrPtResolutionSmearing = kFALSE;
904 if(!fhEffH1 || !fhEffH2 || !fhEffH3 ) fUseDiceEfficiency = kFALSE;
905 if( fEfficiencyFixed < 1. ) fUseDiceEfficiency = kTRUE;
907 Bool_t selectEvent = false;
908 Bool_t physicsSelection = true;// handled by the framework(fInputHandler->IsEventSelected()&AliVEvent::kMB)==AliVEvent::kMB;
914 const AliAODVertex *vtxAOD = fAOD->GetPrimaryVertex();
915 TString vtxTitle(vtxAOD->GetTitle());
916 zVtx = vtxAOD->GetZ();
918 cent = fAOD->GetHeader()->GetCentrality();
919 if(cent<10)cenClass = 0;
920 else if(cent<30)cenClass = 1;
921 else if(cent<50)cenClass = 2;
922 else if(cent<80)cenClass = 3;
923 if(physicsSelection){
924 fh1CentralityPhySel->Fill(cent);
925 fh1ZPhySel->Fill(zVtx);
929 if(vtxAOD->GetNContributors()>2&&!vtxTitle.Contains("TPCVertex")){
930 Float_t yvtx = vtxAOD->GetY();
931 Float_t xvtx = vtxAOD->GetX();
932 Float_t r2 = yvtx*yvtx+xvtx*xvtx;
933 if(TMath::Abs(zVtx)<fVtxZCut&&r2<fVtxR2Cut){ // apply vertex cut later on
934 if(physicsSelection){
940 if(cent<fCentCutLo||cent>fCentCutUp){
951 PostData(1, fHistList);
954 fh1Centrality->Fill(cent);
956 fh1Trials->Fill("#sum{ntrials}",1);
959 if (fDebug > 10)Printf("%s:%d",(char*)__FILE__,__LINE__);
961 // ==== General variables needed
965 // we simply fetch the tracks/mc particles as a list of AliVParticles
970 Int_t nT = GetListOfTracks(&recParticles,fTrackTypeRec);
971 Float_t nCh = recParticles.GetEntries();
973 if(fDebug>2)Printf("%s:%d Selected Rec tracks: %d %d",(char*)__FILE__,__LINE__,nT,recParticles.GetEntries());
974 nT = GetListOfTracks(&genParticles,fTrackTypeGen);
975 if(fDebug>2)Printf("%s:%d Selected Gen tracks: %d %d",(char*)__FILE__,__LINE__,nT,genParticles.GetEntries());
979 vector<fastjet::PseudoJet> inputParticlesRec;
980 vector<fastjet::PseudoJet> inputParticlesRecRan;
982 // Generate the random cones
984 AliAODJet vTmpRan(1,0,0,1);
985 for(int i = 0; i < recParticles.GetEntries(); i++){
986 AliVParticle *vp = (AliVParticle*)recParticles.At(i);
988 // Carefull energy is not well determined in real data, should not matter for p_T scheme?
989 // we take total momentum here
991 if((!fUseTrPtResolutionSmearing) && (!fUseDiceEfficiency)) {
992 //Add particles to fastjet in case we are not running toy model
993 fastjet::PseudoJet jInp(vp->Px(),vp->Py(),vp->Pz(),vp->P());
994 jInp.set_user_index(i);
995 inputParticlesRec.push_back(jInp);
997 else if(fUseDiceEfficiency) {
999 // Dice to decide if particle is kept or not - toy model for efficiency
1001 Double_t sumEff = 0.;
1003 Double_t eff[3] = {0.};
1006 Double_t rnd = fRandom->Uniform(1.);
1007 if( fEfficiencyFixed<1. ) {
1008 sumEff = fEfficiencyFixed;
1012 Double_t pTtmp = pT;
1013 if(pT>10.) pTtmp = 10.;
1014 Double_t eff1 = fhEffH1->GetBinContent(fhEffH1->FindBin(pTtmp));
1015 Double_t eff2 = fhEffH2->GetBinContent(fhEffH2->FindBin(pTtmp));
1016 Double_t eff3 = fhEffH3->GetBinContent(fhEffH3->FindBin(pTtmp));
1018 //Sort efficiencies from large to small
1019 if(eff1>eff2 && eff1>eff3) {
1034 else if(eff2>eff1 && eff2>eff3) {
1049 else if(eff3>eff1 && eff3>eff2) {
1065 sumEff = eff[0]+eff[1]+eff[2];
1067 fp1Efficiency->Fill(vp->Pt(),sumEff);
1068 if(rnd>sumEff && pT > fDiceEfficiencyMinPt) continue;
1070 if(fUseTrPtResolutionSmearing) {
1071 //Smear momentum of generated particle
1072 Double_t smear = 1.;
1073 //Select hybrid track category
1075 smear = GetMomentumSmearing(cat[2],pT);
1076 else if(rnd<=(eff[2]+eff[1]))
1077 smear = GetMomentumSmearing(cat[1],pT);
1079 smear = GetMomentumSmearing(cat[0],pT);
1081 fp1PtResolution->Fill(vp->Pt(),smear);
1083 Double_t sigma = vp->Pt()*smear;
1084 Double_t pTrec = fRandom->Gaus(vp->Pt(),sigma);
1086 Double_t phi = vp->Phi();
1087 Double_t theta = 2.*TMath::ATan(TMath::Exp(-1.*(vp->Eta())));
1088 Double_t pX = pTrec * TMath::Cos(phi);
1089 Double_t pY = pTrec * TMath::Sin(phi);
1090 Double_t pZ = pTrec/TMath::Tan(theta);
1091 Double_t p=TMath::Sqrt(pTrec*pTrec+pZ*pZ);
1093 fh2PtGenPtSmeared->Fill(vp->Pt(),pTrec);
1095 fastjet::PseudoJet jInp(pX,pY,pZ,p);
1096 jInp.set_user_index(i);
1097 inputParticlesRec.push_back(jInp);
1101 fastjet::PseudoJet jInp(vp->Px(),vp->Py(),vp->Pz(),vp->P());
1102 jInp.set_user_index(i);
1103 inputParticlesRec.push_back(jInp);
1109 // the randomized input changes eta and phi, but keeps the p_T
1110 if(i>=fNSkipLeadingRan){// eventually skip the leading particles
1111 Double_t pT = vp->Pt();
1112 Double_t eta = 2.*fTrackEtaWindow * fRandom->Rndm() - fTrackEtaWindow;
1113 Double_t phi = 2.* TMath::Pi() * fRandom->Rndm();
1115 Double_t theta = 2.*TMath::ATan(TMath::Exp(-eta));
1116 Double_t pZ = pT/TMath::Tan(theta);
1118 Double_t pX = pT * TMath::Cos(phi);
1119 Double_t pY = pT * TMath::Sin(phi);
1120 Double_t p = TMath::Sqrt(pT*pT+pZ*pZ);
1121 fastjet::PseudoJet jInpRan(pX,pY,pZ,p);
1123 jInpRan.set_user_index(i);
1124 inputParticlesRecRan.push_back(jInpRan);
1125 vTmpRan.SetPxPyPzE(pX,pY,pZ,p);
1128 // fill the tref array, only needed when we write out jets
1131 fRef->Delete(); // make sure to delete before placement new...
1132 if((!fUseTrPtResolutionSmearing) && (!fUseDiceEfficiency)) {
1133 new(fRef) TRefArray(TProcessID::GetProcessWithUID(vp)); //TRefArray does not work with toy model ...
1136 if((!fUseTrPtResolutionSmearing) && (!fUseDiceEfficiency)) fRef->Add(vp); //TRefArray does not work with toy model ...
1140 if(inputParticlesRec.size()==0){
1141 if(fDebug)Printf("%s:%d No input particles found, skipping event",(char*)__FILE__,__LINE__);
1142 PostData(1, fHistList);
1147 // employ setters for these...
1150 // now create the object that holds info about ghosts
1152 if(!fUseBackgroundCalc&& fNonStdBranch.Length()==0){
1153 // reduce CPU time...
1155 fActiveAreaRepeats = 0;
1159 fastjet::GhostedAreaSpec ghostSpec(fGhostEtamax, fActiveAreaRepeats, fGhostArea);
1160 fastjet::AreaType areaType = fastjet::active_area;
1161 fastjet::AreaDefinition areaDef = fastjet::AreaDefinition(areaType,ghostSpec);
1162 fastjet::JetDefinition jetDef(fAlgorithm, fRparam, fRecombScheme, fStrategy);
1163 fastjet::ClusterSequenceArea clustSeq(inputParticlesRec, jetDef,areaDef);
1165 //range where to compute background
1166 Double_t phiMin = 0, phiMax = 0, rapMin = 0, rapMax = 0;
1168 phiMax = 2*TMath::Pi();
1169 rapMax = fGhostEtamax - fRparam;
1170 rapMin = - fGhostEtamax + fRparam;
1171 fastjet::RangeDefinition range(rapMin,rapMax, phiMin, phiMax);
1174 const vector <fastjet::PseudoJet> &inclusiveJets = clustSeq.inclusive_jets();
1175 const vector <fastjet::PseudoJet> &sortedJets = sorted_by_pt(inclusiveJets);
1178 fh1NJetsRec->Fill(sortedJets.size());
1180 // loop over all jets an fill information, first on is the leading jet
1182 Int_t nRecOver = inclusiveJets.size();
1183 Int_t nRec = inclusiveJets.size();
1184 if(inclusiveJets.size()>0){
1185 AliAODJet leadingJet (sortedJets[0].px(), sortedJets[0].py(), sortedJets[0].pz(), sortedJets[0].E());
1186 Double_t area = clustSeq.area(sortedJets[0]);
1187 leadingJet.SetEffArea(area,0);
1188 Float_t pt = leadingJet.Pt();
1189 Int_t nAodOutJets = 0;
1190 Int_t nAodOutTracks = 0;
1191 AliAODJet *aodOutJet = 0;
1194 for(int i = 1;i <= fh2NRecJetsPt->GetNbinsX();i++){
1195 Float_t ptCut = fh2NRecJetsPt->GetXaxis()->GetBinCenter(i);
1196 while(pt<ptCut&&iCount<nRec){
1200 pt = sortedJets[iCount].perp();
1203 if(nRecOver<=0)break;
1204 fh2NRecJetsPt->Fill(ptCut,nRecOver);
1206 Float_t phi = leadingJet.Phi();
1207 if(phi<0)phi+=TMath::Pi()*2.;
1208 Float_t eta = leadingJet.Eta();
1210 if(externalBackground){
1211 // carefull has to be filled in a task before
1212 // todo, ReArrange to the botom
1213 pTback = externalBackground->GetBackground(2)*leadingJet.EffectiveAreaCharged();
1215 pt = leadingJet.Pt() - pTback;
1216 // correlation of leading jet with tracks
1217 TIterator *recIter = recParticles.MakeIterator();
1219 AliVParticle *tmpRecTrack = 0;
1220 while((tmpRecTrack = (AliVParticle*)(recIter->Next()))){
1221 Float_t tmpPt = tmpRecTrack->Pt();
1223 Float_t tmpPhi = tmpRecTrack->Phi();
1224 if(tmpPhi<0)tmpPhi+=TMath::Pi()*2.;
1225 Float_t dPhi = phi - tmpPhi;
1226 if(dPhi>TMath::Pi())dPhi = dPhi - 2.*TMath::Pi();
1227 if(dPhi<(-1.*TMath::Pi()))dPhi = dPhi + 2.*TMath::Pi();
1228 fh2TracksLeadingJetPhiPt->Fill(dPhi,pt);
1229 fh2TracksLeadingJetPhiPtW->Fill(dPhi,pt,tmpPt);
1231 fh2TracksLeadingJetPhiPtC[cenClass]->Fill(dPhi,pt);
1232 fh2TracksLeadingJetPhiPtWC[cenClass]->Fill(dPhi,pt,tmpPt);
1238 TLorentzVector vecareab;
1239 for(int j = 0; j < nRec;j++){
1240 AliAODJet tmpRec (sortedJets[j].px(), sortedJets[j].py(), sortedJets[j].pz(), sortedJets[j].E());
1243 Float_t tmpPt = tmpRec.Pt();
1245 if(tmpPt>fJetOutputMinPt&&fTCAJetsOut){// cut on the non-background subtracted...
1246 aodOutJet = new ((*fTCAJetsOut)[nAodOutJets++]) AliAODJet(tmpRec);
1247 aodOutJet->GetRefTracks()->Clear();
1248 Double_t area1 = clustSeq.area(sortedJets[j]);
1249 aodOutJet->SetEffArea(area1,0);
1250 fastjet::PseudoJet vecarea=clustSeq.area_4vector(sortedJets[j]);
1251 vecareab.SetPxPyPzE(vecarea.px(),vecarea.py(),vecarea.pz(),vecarea.e());
1252 aodOutJet->SetVectorAreaCharged(&vecareab);
1256 Float_t tmpPtBack = 0;
1257 if(externalBackground){
1258 // carefull has to be filled in a task before
1259 // todo, ReArrange to the botom
1260 tmpPtBack = externalBackground->GetBackground(2)*tmpRec.EffectiveAreaCharged();
1262 tmpPt = tmpPt - tmpPtBack;
1263 if(tmpPt<0)tmpPt = 0; // avoid negative weights...
1265 fh1PtJetsRecIn->Fill(tmpPt);
1266 // Fill Spectra with constituentsemacs
1267 const vector<fastjet::PseudoJet> &constituents = clustSeq.constituents(sortedJets[j]);
1269 fh1NConstRec->Fill(constituents.size());
1270 fh2PtNch->Fill(nCh,tmpPt);
1271 fh2PtNchN->Fill(nCh,tmpPt,constituents.size());
1272 fh2NConstPt->Fill(tmpPt,constituents.size());
1273 // loop over constiutents and fill spectrum
1275 AliVParticle *partLead = 0;
1276 Float_t ptLead = -1;
1278 for(unsigned int ic = 0; ic < constituents.size();ic++){
1279 AliVParticle *part = (AliVParticle*)recParticles.At(constituents[ic].user_index());
1281 fh1PtJetConstRec->Fill(part->Pt());
1283 if((!fUseTrPtResolutionSmearing) && (!fUseDiceEfficiency)) aodOutJet->AddTrack(fRef->At(constituents[ic].user_index()));
1284 if(part->Pt()>fMaxTrackPtInJet){
1285 aodOutJet->SetTrigger(AliAODJet::kHighTrackPtTriggered);
1288 if(part->Pt()>ptLead){
1289 ptLead = part->Pt();
1292 if(j==0)fh1PtJetConstLeadingRec->Fill(part->Pt());
1295 AliAODTrack *aodT = 0;
1298 //set pT of leading constituent of jet
1299 aodOutJet->SetPtLeading(partLead->Pt());
1300 aodT = dynamic_cast<AliAODTrack*>(partLead);
1302 if(aodT->TestFilterBit(fFilterMaskBestPt)){
1303 aodOutJet->SetTrigger(AliAODJet::kHighTrackPtBest);
1310 Float_t tmpPhi = tmpRec.Phi();
1311 Float_t tmpEta = tmpRec.Eta();
1312 if(tmpPhi<0)tmpPhi+=TMath::Pi()*2.;
1314 fh1PtJetsLeadingRecIn->Fill(tmpPt);
1315 fh2LeadingJetPhiEta->Fill(tmpPhi,tmpEta);
1316 fh2LeadingJetEtaPt->Fill(tmpEta,tmpPt);
1317 fh1NConstLeadingRec->Fill(constituents.size());
1318 fh2NConstLeadingPt->Fill(tmpPt,constituents.size());
1321 fh2JetPhiEta->Fill(tmpRec.Phi(),tmpEta);
1322 fh2JetEtaPt->Fill(tmpEta,tmpPt);
1323 Float_t dPhi = phi - tmpPhi;
1324 if(dPhi>TMath::Pi())dPhi = dPhi - 2.*TMath::Pi();
1325 if(dPhi<(-1.*TMath::Pi()))dPhi = dPhi + 2.*TMath::Pi();
1326 Float_t dEta = eta - tmpRec.Eta();
1327 fh2JetsLeadingPhiEta->Fill(dPhi,dEta);
1328 fh2JetsLeadingPhiPt->Fill(dPhi,pt);
1330 fh2JetsLeadingPhiPtC[cenClass]->Fill(dPhi,pt);
1331 fh2JetsLeadingPhiPtWC[cenClass]->Fill(dPhi,pt,tmpPt);
1333 fh2JetsLeadingPhiPtW->Fill(dPhi,pt,tmpPt);
1334 }// loop over reconstructed jets
1339 // Add the random cones...
1340 if(fNRandomCones>0&&fTCARandomConesOut){
1341 // create a random jet within the acceptance
1342 Double_t etaMax = fTrackEtaWindow - fRparam;
1345 Double_t pTC = 1; // small number
1346 for(int ir = 0;ir < fNRandomCones;ir++){
1347 Double_t etaC = etaMax*2.*(fRandom->Rndm()-0.5); // +- etamax
1348 Double_t phiC = fRandom->Rndm()*2.*TMath::Pi(); // 0 - 2pi
1350 Double_t thetaC = 2.*TMath::ATan(TMath::Exp(-etaC));
1351 Double_t pZC = pTC/TMath::Tan(thetaC);
1352 Double_t pXC = pTC * TMath::Cos(phiC);
1353 Double_t pYC = pTC * TMath::Sin(phiC);
1354 Double_t pC = TMath::Sqrt(pTC*pTC+pZC*pZC);
1355 AliAODJet tmpRecC (pXC,pYC,pZC, pC);
1357 for(int jj = 0; jj < TMath::Min(nRec,fNSkipLeadingCone);jj++){// test for overlap with leading jets
1358 AliAODJet jet (sortedJets[jj].px(), sortedJets[jj].py(), sortedJets[jj].pz(), sortedJets[jj].E());
1359 if(jet.DeltaR(& tmpRecC)<2.*fRparam+0.2){
1364 // test for overlap with previous cones to avoid double counting
1365 for(int iic = 0;iic<ir;iic++){
1366 AliAODJet *iicone = (AliAODJet*)fTCARandomConesOut->At(iic);
1368 if(iicone->DeltaR(&tmpRecC)<2.*fRparam){
1375 tmpRecC.SetBgEnergy(0,0); // this is use as temporary storage of the summed p_T below
1376 tmpRecC.SetPtLeading(-1.);
1377 if(fTCARandomConesOut)new ((*fTCARandomConesOut)[nCone++]) AliAODJet(tmpRecC);
1378 if(fTCARandomConesOutRan)new ((*fTCARandomConesOutRan)[nConeRan++]) AliAODJet(tmpRecC);
1379 }// loop over random cones creation
1382 // loop over the reconstructed particles and add up the pT in the random cones
1383 // maybe better to loop over randomized particles not in the real jets...
1384 // but this by definition brings dow average energy in the whole event
1385 AliAODJet vTmpRanR(1,0,0,1);
1386 for(int i = 0; i < recParticles.GetEntries(); i++){
1387 AliVParticle *vp = (AliVParticle*)recParticles.At(i);
1388 if(fTCARandomConesOut){
1389 for(int ir = 0;ir < fNRandomCones;ir++){
1390 AliAODJet *jC = (AliAODJet*)fTCARandomConesOut->At(ir);
1391 if(jC&&jC->DeltaR(vp)<fRparam){
1392 if(vp->Pt()>fMaxTrackPtInJet)jC->SetTrigger(AliAODJet::kHighTrackPtTriggered);
1393 jC->SetBgEnergy(jC->ChargedBgEnergy()+vp->Pt(),0);
1394 if(vp->Pt() > jC->GetPtLeading()) jC->SetPtLeading(vp->Pt());
1397 }// add up energy in cone
1399 // the randomized input changes eta and phi, but keeps the p_T
1400 if(i>=fNSkipLeadingRan){// eventually skip the leading particles
1401 Double_t pTR = vp->Pt();
1402 Double_t etaR = 2.*fTrackEtaWindow* fRandom->Rndm() - fTrackEtaWindow;
1403 Double_t phiR = 2.* TMath::Pi() * fRandom->Rndm();
1405 Double_t thetaR = 2.*TMath::ATan(TMath::Exp(-etaR));
1406 Double_t pZR = pTR/TMath::Tan(thetaR);
1408 Double_t pXR = pTR * TMath::Cos(phiR);
1409 Double_t pYR = pTR * TMath::Sin(phiR);
1410 Double_t pR = TMath::Sqrt(pTR*pTR+pZR*pZR);
1411 vTmpRanR.SetPxPyPzE(pXR,pYR,pZR,pR);
1412 if(fTCARandomConesOutRan){
1413 for(int ir = 0;ir < fTCARandomConesOutRan->GetEntriesFast();ir++){
1414 AliAODJet *jC = (AliAODJet*)fTCARandomConesOutRan->At(ir);
1415 if(jC&&jC->DeltaR(&vTmpRanR)<fRparam){
1416 if(vTmpRanR.Pt()>fMaxTrackPtInJet)jC->SetTrigger(AliAODJet::kHighTrackPtTriggered);
1417 jC->SetBgEnergy(jC->ChargedBgEnergy()+vTmpRanR.Pt(),0);
1418 if(vTmpRanR.Pt() > jC->GetPtLeading()) jC->SetPtLeading(vTmpRanR.Pt());
1423 }// loop over recparticles
1425 Float_t jetArea = fRparam*fRparam*TMath::Pi();
1426 if(fTCARandomConesOut){
1427 for(int ir = 0;ir < fTCARandomConesOut->GetEntriesFast();ir++){
1428 // rescale the momentum vectors for the random cones
1430 AliAODJet *rC = (AliAODJet*)fTCARandomConesOut->At(ir);
1432 Double_t etaC = rC->Eta();
1433 Double_t phiC = rC->Phi();
1434 // massless jet, unit vector
1435 pTC = rC->ChargedBgEnergy();
1436 if(pTC<=0)pTC = 0.001; // for almost empty events
1437 Double_t thetaC = 2.*TMath::ATan(TMath::Exp(-etaC));
1438 Double_t pZC = pTC/TMath::Tan(thetaC);
1439 Double_t pXC = pTC * TMath::Cos(phiC);
1440 Double_t pYC = pTC * TMath::Sin(phiC);
1441 Double_t pC = TMath::Sqrt(pTC*pTC+pZC*pZC);
1442 rC->SetPxPyPzE(pXC,pYC,pZC, pC);
1443 rC->SetBgEnergy(0,0);
1444 rC->SetEffArea(jetArea,0);
1448 if(fTCARandomConesOutRan){
1449 for(int ir = 0;ir < fTCARandomConesOutRan->GetEntriesFast();ir++){
1450 AliAODJet* rC = (AliAODJet*)fTCARandomConesOutRan->At(ir);
1453 Double_t etaC = rC->Eta();
1454 Double_t phiC = rC->Phi();
1455 // massless jet, unit vector
1456 pTC = rC->ChargedBgEnergy();
1457 if(pTC<=0)pTC = 0.001;// for almost empty events
1458 Double_t thetaC = 2.*TMath::ATan(TMath::Exp(-etaC));
1459 Double_t pZC = pTC/TMath::Tan(thetaC);
1460 Double_t pXC = pTC * TMath::Cos(phiC);
1461 Double_t pYC = pTC * TMath::Sin(phiC);
1462 Double_t pC = TMath::Sqrt(pTC*pTC+pZC*pZC);
1463 rC->SetPxPyPzE(pXC,pYC,pZC, pC);
1464 rC->SetBgEnergy(0,0);
1465 rC->SetEffArea(jetArea,0);
1469 }// if(fNRandomCones
1471 //background estimates:all bckg jets(0) & wo the 2 hardest(1)
1473 if(fAODJetBackgroundOut){
1474 vector<fastjet::PseudoJet> jets2=sortedJets;
1475 if(jets2.size()>2) jets2.erase(jets2.begin(),jets2.begin()+2);
1479 Double_t meanarea1=0.;
1482 Double_t meanarea2=0.;
1484 clustSeq.get_median_rho_and_sigma(jets2, range, true, bkg1, sigma1, meanarea1, true);
1485 fAODJetBackgroundOut->SetBackground(0,bkg1,sigma1,meanarea1);
1487 // fh1BiARandomCones[0]->Fill(omCone-(bkg1*areaRandomCone));
1488 // fh1BiARandomConesRan[0]->Fill(ptRandomConeRan-(bkg1*areaRandomCone));
1490 clustSeq.get_median_rho_and_sigma(jets2, range, false, bkg2, sigma2, meanarea2, true);
1491 fAODJetBackgroundOut->SetBackground(1,bkg2,sigma2,meanarea2);
1492 // fh1BiARandomCones[1]->Fill(ptRandomCone-(bkg2*areaRandomCone));
1493 // fh1BiARandomConesRan[1]->Fill(ptRandomConeRan-(bkg2*areaRandomCone));
1498 if(fStoreRhoLeadingTrackCorr) {
1499 vector<fastjet::PseudoJet> jets3=sortedJets;
1500 if(jets3.size()>2) jets3.erase(jets3.begin(),jets3.begin()+2);
1504 Double_t meanarea2=0.;
1506 clustSeq.get_median_rho_and_sigma(jets3, range, false, bkg2, sigma2, meanarea2, true);
1507 fAODJetBackgroundOut->SetBackground(1,bkg2,sigma2,meanarea2);
1509 //Get leading track in event
1510 AliVParticle *leading = (AliVParticle*)recParticles.At(0);
1512 fh3CentvsRhoLeadingTrackPt->Fill(cent,bkg2,leading->Pt());
1513 fh3CentvsSigmaLeadingTrackPt->Fill(cent,sigma2,leading->Pt());
1514 fh3MultvsRhoLeadingTrackPt->Fill(nCh,bkg2,leading->Pt());
1515 fh3MultvsSigmaLeadingTrackPt->Fill(nCh,sigma2,leading->Pt());
1518 //Calculate rho with 4-vector area method for different quadrants with respect to the leading track in the event
1519 //exclude 2 leading jets from event
1520 //Quadrant 1: |phi_leadingTrack - phi_bkgCluster| < pi/2./2. - R (Near side to leading track)
1521 //Quadrant 2: pi/2 - (pi/2./2. - R) < |phi_leadingTrack - phi_bkgCluster| < pi/2 + (pi/2./2. - R) (Orthogonal to leading track)
1522 //Quadrant 3: pi - (pi/2/2 - R) < |phi_leadingTrack - phi_bkgCluster| < pi + (pi/2./2. - R) (Away side to leading track)
1523 //Quadrant 4: 3/2*pi - (pi/2./2. - R) < |phi_leadingTrack - phi_bkgCluster| < 3/2*pi + (pi/2./2. - R) (Orthogonal to leading track)
1525 //Assuming R=0.2 for background clusters
1527 Double_t bkg2Q[4] = {0.};
1528 Double_t sigma2Q[4] = {0.};
1529 Double_t meanarea2Q[4] = {0.};
1531 //Get phi of leading track in event
1532 Float_t phiLeadingTrack = leading->Phi();
1533 Float_t phiStep = (TMath::Pi()/2./2. - 0.2);
1535 //Quadrant1 - near side
1536 phiMin = phiLeadingTrack - phiStep;
1537 phiMax = phiLeadingTrack + phiStep;
1538 fastjet::RangeDefinition rangeQ1(rapMin,rapMax, phiMin, phiMax);
1539 clustSeq.get_median_rho_and_sigma(jets3, rangeQ1, false, bkg2Q[0], sigma2Q[0], meanarea2Q[0], true);
1541 //Quadrant2 - orthogonal
1542 Double_t phiQ2 = phiLeadingTrack + TMath::Pi()/2.;
1543 if(phiQ2>TMath::TwoPi()) phiQ2 = phiQ2 - TMath::TwoPi();
1544 phiMin = phiQ2 - phiStep;
1545 phiMax = phiQ2 + phiStep;
1546 fastjet::RangeDefinition rangeQ2(rapMin,rapMax, phiMin, phiMax);
1547 clustSeq.get_median_rho_and_sigma(jets3, rangeQ2, false, bkg2Q[1], sigma2Q[1], meanarea2Q[1], true);
1549 //Quadrant3 - away side
1550 Double_t phiQ3 = phiLeadingTrack + TMath::Pi();
1551 if(phiQ3>TMath::TwoPi()) phiQ3 = phiQ3 - TMath::TwoPi();
1552 phiMin = phiQ3 - phiStep;
1553 phiMax = phiQ3 + phiStep;
1554 fastjet::RangeDefinition rangeQ3(rapMin,rapMax, phiMin, phiMax);
1555 clustSeq.get_median_rho_and_sigma(jets3, rangeQ3, false, bkg2Q[2], sigma2Q[2], meanarea2Q[2], true);
1557 //Quadrant4 - othogonal
1558 Double_t phiQ4 = phiLeadingTrack + 3./2.*TMath::Pi();
1559 if(phiQ4>TMath::TwoPi()) phiQ4 = phiQ4 - TMath::TwoPi();
1560 phiMin = phiQ4 - phiStep;
1561 phiMax = phiQ4 + phiStep;
1562 fastjet::RangeDefinition rangeQ4(rapMin,rapMax, phiMin, phiMax);
1563 clustSeq.get_median_rho_and_sigma(jets3, rangeQ4, false, bkg2Q[3], sigma2Q[3], meanarea2Q[3], true);
1565 fh3CentvsRhoLeadingTrackPtQ1->Fill(cent,bkg2Q[0],leading->Pt());
1566 fh3CentvsRhoLeadingTrackPtQ2->Fill(cent,bkg2Q[1],leading->Pt());
1567 fh3CentvsRhoLeadingTrackPtQ3->Fill(cent,bkg2Q[2],leading->Pt());
1568 fh3CentvsRhoLeadingTrackPtQ4->Fill(cent,bkg2Q[3],leading->Pt());
1570 fh3CentvsSigmaLeadingTrackPtQ1->Fill(cent,sigma2Q[0],leading->Pt());
1571 fh3CentvsSigmaLeadingTrackPtQ2->Fill(cent,sigma2Q[1],leading->Pt());
1572 fh3CentvsSigmaLeadingTrackPtQ3->Fill(cent,sigma2Q[2],leading->Pt());
1573 fh3CentvsSigmaLeadingTrackPtQ4->Fill(cent,sigma2Q[3],leading->Pt());
1575 fh3MultvsRhoLeadingTrackPtQ1->Fill(nCh,bkg2Q[0],leading->Pt());
1576 fh3MultvsRhoLeadingTrackPtQ2->Fill(nCh,bkg2Q[1],leading->Pt());
1577 fh3MultvsRhoLeadingTrackPtQ3->Fill(nCh,bkg2Q[2],leading->Pt());
1578 fh3MultvsRhoLeadingTrackPtQ4->Fill(nCh,bkg2Q[3],leading->Pt());
1580 fh3MultvsSigmaLeadingTrackPtQ1->Fill(nCh,sigma2Q[0],leading->Pt());
1581 fh3MultvsSigmaLeadingTrackPtQ2->Fill(nCh,sigma2Q[1],leading->Pt());
1582 fh3MultvsSigmaLeadingTrackPtQ3->Fill(nCh,sigma2Q[2],leading->Pt());
1583 fh3MultvsSigmaLeadingTrackPtQ4->Fill(nCh,sigma2Q[3],leading->Pt());
1585 fh3CentvsDeltaRhoLeadingTrackPtQ1->Fill(cent,bkg2Q[0]-bkg2,leading->Pt());
1586 fh3CentvsDeltaRhoLeadingTrackPtQ2->Fill(cent,bkg2Q[1]-bkg2,leading->Pt());
1587 fh3CentvsDeltaRhoLeadingTrackPtQ3->Fill(cent,bkg2Q[2]-bkg2,leading->Pt());
1588 fh3CentvsDeltaRhoLeadingTrackPtQ4->Fill(cent,bkg2Q[3]-bkg2,leading->Pt());
1596 // fill track information
1597 Int_t nTrackOver = recParticles.GetSize();
1598 // do the same for tracks and jets
1601 TIterator *recIter = recParticles.MakeIterator();
1602 AliVParticle *tmpRec = (AliVParticle*)(recIter->Next());
1603 Float_t pt = tmpRec->Pt();
1605 // Printf("Leading track p_t %3.3E",pt);
1606 for(int i = 1;i <= fh2NRecTracksPt->GetNbinsX();i++){
1607 Float_t ptCut = fh2NRecTracksPt->GetXaxis()->GetBinCenter(i);
1608 while(pt<ptCut&&tmpRec){
1610 tmpRec = (AliVParticle*)(recIter->Next());
1615 if(nTrackOver<=0)break;
1616 fh2NRecTracksPt->Fill(ptCut,nTrackOver);
1620 AliVParticle *leading = (AliVParticle*)recParticles.At(0);
1621 Float_t phi = leading->Phi();
1622 if(phi<0)phi+=TMath::Pi()*2.;
1623 Float_t eta = leading->Eta();
1625 while((tmpRec = (AliVParticle*)(recIter->Next()))){
1626 Float_t tmpPt = tmpRec->Pt();
1627 Float_t tmpEta = tmpRec->Eta();
1628 fh1PtTracksRecIn->Fill(tmpPt);
1629 fh2TrackEtaPt->Fill(tmpEta,tmpPt);
1630 if(tmpRec==leading){
1631 fh1PtTracksLeadingRecIn->Fill(tmpPt);
1632 fh2LeadingTrackEtaPt->Fill(tmpEta,tmpPt);
1636 Float_t tmpPhi = tmpRec->Phi();
1638 if(tmpPhi<0)tmpPhi+=TMath::Pi()*2.;
1639 Float_t dPhi = phi - tmpPhi;
1640 if(dPhi>TMath::Pi())dPhi = dPhi - 2.*TMath::Pi();
1641 if(dPhi<(-1.*TMath::Pi()))dPhi = dPhi + 2.*TMath::Pi();
1642 Float_t dEta = eta - tmpRec->Eta();
1643 fh2TracksLeadingPhiEta->Fill(dPhi,dEta);
1644 fh2TracksLeadingPhiPt->Fill(dPhi,pt);
1645 fh2TracksLeadingPhiPtW->Fill(dPhi,pt,tmpPt);
1650 // find the random jets
1652 fastjet::ClusterSequenceArea clustSeqRan(inputParticlesRecRan, jetDef, areaDef);
1654 // fill the jet information from random track
1655 const vector <fastjet::PseudoJet> &inclusiveJetsRan = clustSeqRan.inclusive_jets();
1656 const vector <fastjet::PseudoJet> &sortedJetsRan = sorted_by_pt(inclusiveJetsRan);
1658 fh1NJetsRecRan->Fill(sortedJetsRan.size());
1660 // loop over all jets an fill information, first on is the leading jet
1662 Int_t nRecOverRan = inclusiveJetsRan.size();
1663 Int_t nRecRan = inclusiveJetsRan.size();
1665 if(inclusiveJetsRan.size()>0){
1666 AliAODJet leadingJet (sortedJetsRan[0].px(), sortedJetsRan[0].py(), sortedJetsRan[0].pz(), sortedJetsRan[0].E());
1667 Float_t pt = leadingJet.Pt();
1670 TLorentzVector vecarearanb;
1672 for(int i = 1;i <= fh2NRecJetsPtRan->GetNbinsX();i++){
1673 Float_t ptCut = fh2NRecJetsPtRan->GetXaxis()->GetBinCenter(i);
1674 while(pt<ptCut&&iCount<nRecRan){
1678 pt = sortedJetsRan[iCount].perp();
1681 if(nRecOverRan<=0)break;
1682 fh2NRecJetsPtRan->Fill(ptCut,nRecOverRan);
1684 Float_t phi = leadingJet.Phi();
1685 if(phi<0)phi+=TMath::Pi()*2.;
1686 pt = leadingJet.Pt();
1688 // correlation of leading jet with random tracks
1690 for(unsigned int ip = 0; ip < inputParticlesRecRan.size();ip++)
1692 Float_t tmpPt = inputParticlesRecRan[ip].perp();
1694 Float_t tmpPhi = inputParticlesRecRan[ip].phi();
1695 if(tmpPhi<0)tmpPhi+=TMath::Pi()*2.;
1696 Float_t dPhi = phi - tmpPhi;
1697 if(dPhi>TMath::Pi())dPhi = dPhi - 2.*TMath::Pi();
1698 if(dPhi<(-1.*TMath::Pi()))dPhi = dPhi + 2.*TMath::Pi();
1699 fh2TracksLeadingJetPhiPtRan->Fill(dPhi,pt);
1700 fh2TracksLeadingJetPhiPtWRan->Fill(dPhi,pt,tmpPt);
1703 Int_t nAodOutJetsRan = 0;
1704 AliAODJet *aodOutJetRan = 0;
1705 for(int j = 0; j < nRecRan;j++){
1706 AliAODJet tmpRec (sortedJetsRan[j].px(), sortedJetsRan[j].py(), sortedJetsRan[j].pz(), sortedJetsRan[j].E());
1707 Float_t tmpPt = tmpRec.Pt();
1708 fh1PtJetsRecInRan->Fill(tmpPt);
1709 // Fill Spectra with constituents
1710 const vector<fastjet::PseudoJet> &constituents = clustSeqRan.constituents(sortedJetsRan[j]);
1711 fh1NConstRecRan->Fill(constituents.size());
1712 fh2NConstPtRan->Fill(tmpPt,constituents.size());
1713 fh2PtNchRan->Fill(nCh,tmpPt);
1714 fh2PtNchNRan->Fill(nCh,tmpPt,constituents.size());
1717 if(tmpPt>fJetOutputMinPt&&fTCAJetsOutRan){
1718 aodOutJetRan = new ((*fTCAJetsOutRan)[nAodOutJetsRan++]) AliAODJet(tmpRec);
1719 Double_t arearan=clustSeqRan.area(sortedJetsRan[j]);
1720 aodOutJetRan->GetRefTracks()->Clear();
1721 aodOutJetRan->SetEffArea(arearan,0);
1722 fastjet::PseudoJet vecarearan=clustSeqRan.area_4vector(sortedJetsRan[j]);
1723 vecarearanb.SetPxPyPzE(vecarearan.px(),vecarearan.py(),vecarearan.pz(),vecarearan.e());
1724 aodOutJetRan->SetVectorAreaCharged(&vecarearanb);
1729 Float_t tmpPhi = tmpRec.Phi();
1730 if(tmpPhi<0)tmpPhi+=TMath::Pi()*2.;
1733 fh1PtJetsLeadingRecInRan->Fill(tmpPt);
1734 fh1NConstLeadingRecRan->Fill(constituents.size());
1735 fh2NConstLeadingPtRan->Fill(tmpPt,constituents.size());
1741 if(fAODJetBackgroundOut){
1744 Double_t meanarea3=0.;
1745 clustSeqRan.get_median_rho_and_sigma(sortedJetsRan ,range, false, bkg3, sigma3, meanarea3, true);
1746 fAODJetBackgroundOut->SetBackground(2,bkg3,sigma3,meanarea3);
1747 // float areaRandomCone = rRandomCone2 *TMath::Pi();
1749 fh1BiARandomCones[2]->Fill(ptRandomCone-(bkg3*areaRandomCone));
1750 fh1BiARandomConesRan[2]->Fill(ptRandomConeRan-(bkg3*areaRandomCone));
1759 // do the event selection if activated
1760 if(fJetTriggerPtCut>0){
1761 bool select = false;
1762 Float_t minPt = fJetTriggerPtCut;
1764 // hard coded for now ...
1765 // 54.50 44.5 29.5 18.5 for anti-kt rejection 1E-3
1766 if(cent<10)minPt = 50;
1767 else if(cent<30)minPt = 42;
1768 else if(cent<50)minPt = 28;
1769 else if(cent<80)minPt = 18;
1772 if(externalBackground)rho = externalBackground->GetBackground(2);
1774 for(int i = 0;i < fTCAJetsOut->GetEntriesFast();i++){
1775 AliAODJet *jet = (AliAODJet*)fTCAJetsOut->At(i);
1776 Float_t ptSub = jet->Pt() - rho *jet->EffectiveAreaCharged();
1785 static AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
1786 fh1CentralitySelect->Fill(cent);
1787 fh1ZSelect->Fill(zVtx);
1788 aodH->SetFillAOD(kTRUE);
1792 if(fTCAJetsOut)Printf("%s:%d Rec Jets %d",(char*)__FILE__,__LINE__,fTCAJetsOut->GetEntriesFast());
1793 if(fTCAJetsOutRan)Printf("%s:%d Rec Jets Ran %d",(char*)__FILE__,__LINE__,fTCAJetsOutRan->GetEntriesFast());
1794 if(fTCARandomConesOut)Printf("%s:%d RC %d",(char*)__FILE__,__LINE__,fTCARandomConesOut->GetEntriesFast());
1795 if(fTCARandomConesOutRan)Printf("%s:%d RC Ran %d",(char*)__FILE__,__LINE__,fTCARandomConesOutRan->GetEntriesFast());
1797 PostData(1, fHistList);
1800 void AliAnalysisTaskJetCluster::Terminate(Option_t */*option*/)
1803 // Terminate analysis
1805 if (fDebug > 1) printf("AnalysisJetCluster: Terminate() \n");
1807 if(fMomResH1Fit) delete fMomResH1Fit;
1808 if(fMomResH2Fit) delete fMomResH2Fit;
1809 if(fMomResH3Fit) delete fMomResH3Fit;
1814 Int_t AliAnalysisTaskJetCluster::GetListOfTracks(TList *list,Int_t type){
1817 // get list of tracks/particles for different types
1820 if(fDebug>2)Printf("%s:%d Selecting tracks with %d",(char*)__FILE__,__LINE__,type);
1823 if(type==kTrackAOD || type==kTrackAODextra || type==kTrackAODextraonly){
1824 if(type!=kTrackAODextraonly) {
1825 AliAODEvent *aod = 0;
1826 if(fUseAODTrackInput)aod = dynamic_cast<AliAODEvent*>(InputEvent());
1827 else aod = AODEvent();
1829 if(fDebug>2)Printf("%s:%d No AOD",(char*)__FILE__,__LINE__);
1833 for(int it = 0;it < aod->GetNumberOfTracks();++it){
1834 AliAODTrack *tr = aod->GetTrack(it);
1835 Bool_t bGood = false;
1836 if(fFilterType == 0)bGood = true;
1837 else if(fFilterType == 1)bGood = tr->IsHybridTPCConstrainedGlobal();
1838 else if(fFilterType == 2)bGood = tr->IsHybridGlobalConstrainedGlobal();
1839 if((fFilterMask>0)&&((!tr->TestFilterBit(fFilterMask)||(!bGood)))){
1840 if(fDebug>10)Printf("%s:%d Not matching filter %d/%d %d/%d",(char*)__FILE__,__LINE__,it,aod->GetNumberOfTracks(),fFilterMask,tr->GetFilterMap());
1843 if(TMath::Abs(tr->Eta())>fTrackEtaWindow){
1844 if(fDebug>10)Printf("%s:%d Not matching eta %d/%d",(char*)__FILE__,__LINE__,it,aod->GetNumberOfTracks());
1847 if(tr->Pt()<fTrackPtCut){
1848 if(fDebug>10)Printf("%s:%d Not matching pt %d/%d",(char*)__FILE__,__LINE__,it,aod->GetNumberOfTracks());
1851 if(fDebug>10)Printf("%s:%d MATCHED %d/%d",(char*)__FILE__,__LINE__,it,aod->GetNumberOfTracks());
1856 if(type==kTrackAODextra || type==kTrackAODextraonly) {
1857 AliAODEvent *aod = 0;
1858 if(fUseAODTrackInput)aod = dynamic_cast<AliAODEvent*>(InputEvent());
1859 else aod = AODEvent();
1864 TClonesArray *aodExtraTracks = dynamic_cast<TClonesArray*>(aod->FindListObject("aodExtraTracks"));
1865 if(!aodExtraTracks)return iCount;
1866 for(int it =0; it<aodExtraTracks->GetEntries(); it++) {
1867 AliVParticle *track = dynamic_cast<AliVParticle*> ((*aodExtraTracks)[it]);
1868 if (!track) continue;
1870 AliAODTrack *trackAOD = dynamic_cast<AliAODTrack*> (track);
1871 if(!trackAOD)continue;
1872 Bool_t bGood = false;
1873 if(fFilterType == 0)bGood = true;
1874 else if(fFilterType == 1)bGood = trackAOD->IsHybridTPCConstrainedGlobal();
1875 else if(fFilterType == 2)bGood = trackAOD->IsHybridGlobalConstrainedGlobal();
1876 if((fFilterMask>0)&&((!trackAOD->TestFilterBit(fFilterMask)||(!bGood))))continue;
1877 if(TMath::Abs(trackAOD->Eta())>fTrackEtaWindow) continue;
1878 if(trackAOD->Pt()<fTrackPtCut) continue;
1879 list->Add(trackAOD);
1884 else if (type == kTrackKineAll||type == kTrackKineCharged){
1885 AliMCEvent* mcEvent = MCEvent();
1886 if(!mcEvent)return iCount;
1887 // we want to have alivpartilces so use get track
1888 for(int it = 0;it < mcEvent->GetNumberOfTracks();++it){
1889 if(!mcEvent->IsPhysicalPrimary(it))continue;
1890 AliMCParticle* part = (AliMCParticle*)mcEvent->GetTrack(it);
1891 if(type == kTrackKineAll){
1892 if(part->Pt()<fTrackPtCut)continue;
1896 else if(type == kTrackKineCharged){
1897 if(part->Particle()->GetPDG()->Charge()==0)continue;
1898 if(part->Pt()<fTrackPtCut)continue;
1904 else if (type == kTrackAODMCCharged || type == kTrackAODMCAll || type == kTrackAODMCChargedAcceptance) {
1905 AliAODEvent *aod = 0;
1906 if(fUseAODMCInput)aod = dynamic_cast<AliAODEvent*>(InputEvent());
1907 else aod = AODEvent();
1908 if(!aod)return iCount;
1909 TClonesArray *tca = dynamic_cast<TClonesArray*>(aod->FindListObject(AliAODMCParticle::StdBranchName()));
1910 if(!tca)return iCount;
1911 for(int it = 0;it < tca->GetEntriesFast();++it){
1912 AliAODMCParticle *part = (AliAODMCParticle*)(tca->At(it));
1913 if(!part->IsPhysicalPrimary())continue;
1914 if(type == kTrackAODMCAll){
1915 if(part->Pt()<fTrackPtCut)continue;
1919 else if (type == kTrackAODMCCharged || type == kTrackAODMCChargedAcceptance ){
1920 if(part->Charge()==0)continue;
1921 if(part->Pt()<fTrackPtCut)continue;
1922 if(kTrackAODMCCharged){
1926 if(TMath::Abs(part->Eta())>fTrackEtaWindow)continue;
1937 void AliAnalysisTaskJetCluster::LoadTrPtResolutionRootFileFromOADB() {
1939 TFile *f = TFile::Open(fPathTrPtResolution.Data());
1943 TProfile *fProfPtPtSigma1PtGlobSt = (TProfile*)f->Get("fProfPtPtSigma1PtGlobSt");
1944 TProfile *fProfPtPtSigma1PtGlobCnoITS = (TProfile*)f->Get("fProfPtPtSigma1PtGlobCnoITS");
1945 TProfile *fProfPtPtSigma1PtGlobCnoSPD = (TProfile*)f->Get("fProfPtPtSigma1PtGlobCnoSPD");
1947 SetSmearResolution(kTRUE);
1948 SetMomentumResolutionHybrid(fProfPtPtSigma1PtGlobSt,fProfPtPtSigma1PtGlobCnoITS,fProfPtPtSigma1PtGlobCnoSPD);
1953 void AliAnalysisTaskJetCluster::LoadTrEfficiencyRootFileFromOADB() {
1955 TFile *f = TFile::Open(fPathTrEfficiency.Data());
1958 TH1D *hEffPosGlobSt = (TH1D*)f->Get("hEffPosGlobSt");
1959 TH1D *hEffPosGlobCnoITS = (TH1D*)f->Get("hEffPosGlobCnoITS");
1960 TH1D *hEffPosGlobCnoSPD = (TH1D*)f->Get("hEffPosGlobCnoSPD");
1962 SetDiceEfficiency(kTRUE);
1964 if(fChangeEfficiencyFraction>0.) {
1966 TH1D *hEffPosGlobStMin = (TH1D*)hEffPosGlobSt->Clone("hEffPosGlobStMin");
1968 for(int bin=1; bin<=hEffPosGlobSt->GetNbinsX(); bin++) {
1969 Double_t content = hEffPosGlobSt->GetBinContent(bin);
1970 hEffPosGlobStMin->SetBinContent(bin,content-fChangeEfficiencyFraction);
1973 SetEfficiencyHybrid(hEffPosGlobStMin,hEffPosGlobCnoITS,hEffPosGlobCnoSPD);
1977 SetEfficiencyHybrid(hEffPosGlobSt,hEffPosGlobCnoITS,hEffPosGlobCnoSPD);
1981 void AliAnalysisTaskJetCluster::SetMomentumResolutionHybrid(TProfile *p1, TProfile *p2, TProfile *p3) {
1984 // set mom res profiles
1987 if(fMomResH1) delete fMomResH1;
1988 if(fMomResH2) delete fMomResH2;
1989 if(fMomResH3) delete fMomResH3;
1991 fMomResH1 = new TProfile(*p1);//(TProfile*)p1->Clone("fMomResH1");
1992 fMomResH2 = new TProfile(*p2);//(TProfile*)p2->Clone("fMomResH2");
1993 fMomResH3 = new TProfile(*p3);//(TProfile*)p3->Clone("fMomResH3");
1997 void AliAnalysisTaskJetCluster:: SetEfficiencyHybrid(TH1 *h1, TH1 *h2, TH1 *h3) {
1999 // set tracking efficiency histos
2002 fhEffH1 = (TH1*)h1->Clone("fhEffH1");
2003 fhEffH2 = (TH1*)h2->Clone("fhEffH2");
2004 fhEffH3 = (TH1*)h3->Clone("fhEffH3");
2007 Double_t AliAnalysisTaskJetCluster::GetMomentumSmearing(Int_t cat, Double_t pt) {
2010 // Get smearing on generated momentum
2013 //printf("GetMomentumSmearing for cat %d and pt = %f \n",cat,pt);
2015 TProfile *fMomRes = 0x0;
2016 if(cat==1) fMomRes = (TProfile*)fMomResH1->Clone("fMomRes");
2017 if(cat==2) fMomRes = (TProfile*)fMomResH2->Clone("fMomRes");
2018 if(cat==3) fMomRes = (TProfile*)fMomResH3->Clone("fMomRes");
2025 Double_t smear = 0.;
2028 if(cat==1 && fMomResH1Fit) smear = fMomResH1Fit->Eval(pt);
2029 if(cat==2 && fMomResH2Fit) smear = fMomResH2Fit->Eval(pt);
2030 if(cat==3 && fMomResH3Fit) smear = fMomResH3Fit->Eval(pt);
2034 Int_t bin = fMomRes->FindBin(pt);
2036 smear = fRandom->Gaus(fMomRes->GetBinContent(bin),fMomRes->GetBinError(bin));
2040 if(fMomRes) delete fMomRes;
2045 void AliAnalysisTaskJetCluster::FitMomentumResolution() {
2047 // Fit linear function on momentum resolution at high pT
2050 if(!fMomResH1Fit && fMomResH1) {
2051 fMomResH1Fit = new TF1("fMomResH1Fit","[0]+[1]*x",0.,200.);
2052 fMomResH1->Fit(fMomResH1Fit,"LL V0","",5.,30.);
2053 fMomResH1Fit ->SetRange(5.,100.);
2056 if(!fMomResH2Fit && fMomResH2) {
2057 fMomResH2Fit = new TF1("fMomResH2Fit","[0]+[1]*x",0.,200.);
2058 fMomResH2->Fit(fMomResH2Fit,"LL V0","",5.,30.);
2059 fMomResH2Fit ->SetRange(5.,100.);
2062 if(!fMomResH3Fit && fMomResH3) {
2063 fMomResH3Fit = new TF1("fMomResH3Fit","[0]+[1]*x",0.,200.);
2064 fMomResH3->Fit(fMomResH3Fit,"LL V0","",5.,30.);
2065 fMomResH3Fit ->SetRange(5.,100.);
2071 Int_t AliAnalysisTaskJetCluster::AddParticlesFastJet(TList &particles,vector<fastjet::PseudoJet> &inputParticles){
2072 for(int i = 0; i < particles.GetEntries(); i++){
2073 AliVParticle *vp = (AliVParticle*)particles.At(i);
2074 // Carefull energy is not well determined in real data, should not matter for p_T scheme?
2075 fastjet::PseudoJet jInp(vp->Px(),vp->Py(),vp->Pz(),vp->E());
2076 jInp.set_user_index(i);
2077 inputParticles.push_back(jInp);