]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliAnalysisTaskElecHadronCorrel.cxx
added AddTask_GammaConvV1.C for Legotrain
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliAnalysisTaskElecHadronCorrel.cxx
CommitLineData
57189f04 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16
17////////////////////////////////////////////////////////////////////////
18// //
19// Task for Heavy Flavour Electron-Hadron DeltaPhi Correlation //
20// Non-Photonic Electron identified with Invariant mass //
21// analysis methos in function SelectPhotonicElectron //
22// DeltaPhi calculated in function ElectronHadCorrel //
23// //
24// Author: Deepa Thomas (Utrecht University) //
25// //
26////////////////////////////////////////////////////////////////////////
27
28#include "TChain.h"
29#include "TTree.h"
30#include "TH2F.h"
31#include "TMath.h"
32#include "TCanvas.h"
33#include "THnSparse.h"
34#include "TLorentzVector.h"
35#include "TString.h"
36#include "TFile.h"
37
38#include "AliAnalysisTask.h"
39#include "AliAnalysisManager.h"
40
3c56855b 41#include "AliLog.h"
57189f04 42#include "AliESDEvent.h"
43#include "AliESDHandler.h"
44#include "AliAODEvent.h"
45#include "AliAODHandler.h"
46
47#include "AliAnalysisTaskElecHadronCorrel.h"
48#include "TGeoGlobalMagField.h"
49#include "AliLog.h"
50#include "AliAnalysisTaskSE.h"
51#include "TRefArray.h"
52#include "TVector.h"
53#include "AliESDInputHandler.h"
54#include "AliESDpid.h"
55#include "AliESDtrackCuts.h"
56#include "AliPhysicsSelection.h"
57#include "AliESDCaloCluster.h"
58#include "AliAODCaloCluster.h"
520a29a8 59#include "AliESDCaloTrigger.h"
57189f04 60#include "AliEMCALRecoUtils.h"
61#include "AliEMCALGeometry.h"
62#include "AliGeomManager.h"
63#include "stdio.h"
64#include "TGeoManager.h"
65#include "iostream"
66#include "fstream"
3c56855b 67
68//#include "AliEventPoolManager.h"
69
520a29a8 70#include "AliCentrality.h"
3c56855b 71//#include "AliEMCALTrack.h"
520a29a8 72//#include "AliEMCALTracker.h"
57189f04 73#include "AliMagF.h"
74
75#include "AliKFParticle.h"
76#include "AliKFVertex.h"
77
78#include "AliPID.h"
79#include "AliPIDResponse.h"
80#include "AliHFEcontainer.h"
81#include "AliHFEcuts.h"
82#include "AliHFEpid.h"
83#include "AliHFEpidBase.h"
84#include "AliHFEpidQAmanager.h"
85#include "AliHFEtools.h"
86#include "AliCFContainer.h"
87#include "AliCFManager.h"
88
89ClassImp(AliAnalysisTaskElecHadronCorrel)
3c56855b 90//ClassImp(AliehDPhiBasicParticle)
57189f04 91//________________________________________________________________________
520a29a8 92 AliAnalysisTaskElecHadronCorrel::AliAnalysisTaskElecHadronCorrel(const char *name)
57189f04 93 : AliAnalysisTaskSE(name)
94 ,fESD(0)
95 ,fGeom(0)
96 ,fOutputList(0)
520a29a8 97 ,fTrackCuts1(new AliESDtrackCuts)
98 ,fTrackCuts2(new AliESDtrackCuts)
57189f04 99 ,fCuts(0)
100 ,fIdentifiedAsOutInz(kFALSE)
101 ,fPassTheEventCut(kFALSE)
102 ,fRejectKinkMother(kFALSE)
103 ,fVz(0.0)
104 ,fCFM(0)
105 ,fPID(0)
106 ,fPIDqa(0)
107 ,fOpeningAngleCut(0.1)
108 ,fInvmassCut(0.01)
3c56855b 109 ,fCentrality(0)
110 ,fCentralityMin(0)
111 ,fCentralityMax(0)
112 ,fkCentralityMethod(0)
4e01b68c 113// ,fPoolMgr(0x0)
57189f04 114 ,fNoEvents(0)
3c56855b 115// ,fTrkpt(0)
57189f04 116 ,fTrkEovPBef(0)
520a29a8 117 ,fTrkEovPBefHad(0)
3c56855b 118/* ,fTrkEovPAft(0)
520a29a8 119 ,fTrkEovPAftOwn(0)
57189f04 120 ,fdEdxBef(0)
121 ,fdEdxAft(0)
520a29a8 122 ,fdEdxAftOwn(0)
57189f04 123 ,fOpeningAngleLS(0)
124 ,fOpeningAngleULS(0)
3c56855b 125*/ ,fSemiIncElecDphi(0)
487ae960 126 ,fSemiIncElecDphi1(0)
127 ,fSemiIncElecDphi2(0)
128 ,fSemiIncElecDphi3(0)
129 ,fSemiIncElecDphi4(0)
57189f04 130 ,fPhotElecDphi(0)
487ae960 131 ,fPhotElecDphi1(0)
132 ,fPhotElecDphi2(0)
133 ,fPhotElecDphi3(0)
134 ,fPhotElecDphi4(0)
57189f04 135 ,fInclusiveElecDphi(0)
487ae960 136 ,fInclusiveElecDphi1(0)
137 ,fInclusiveElecDphi2(0)
138 ,fInclusiveElecDphi3(0)
139 ,fInclusiveElecDphi4(0)
57189f04 140 ,fDphiULSMassLow(0)
487ae960 141 ,fDphiULSMassLow1(0)
142 ,fDphiULSMassLow2(0)
143 ,fDphiULSMassLow3(0)
144 ,fDphiULSMassLow4(0)
57189f04 145 ,fDphiLSMassLow(0)
487ae960 146 ,fDphiLSMassLow1(0)
147 ,fDphiLSMassLow2(0)
148 ,fDphiLSMassLow3(0)
149 ,fDphiLSMassLow4(0)
520a29a8 150 ,fDphiULSMassLowNoPartner(0)
487ae960 151 ,fDphiULSMassLowNoPartner1(0)
152 ,fDphiULSMassLowNoPartner2(0)
153 ,fDphiULSMassLowNoPartner3(0)
154 ,fDphiULSMassLowNoPartner4(0)
520a29a8 155 ,fDphiLSMassLowNoPartner(0)
487ae960 156 ,fDphiLSMassLowNoPartner1(0)
157 ,fDphiLSMassLowNoPartner2(0)
158 ,fDphiLSMassLowNoPartner3(0)
159 ,fDphiLSMassLowNoPartner4(0)
57189f04 160 ,fPhotoElecPt(0)
161 ,fSemiInclElecPt(0)
520a29a8 162 ,fInclusiveElecPt(0)
163 ,fULSElecPt(0)
164 ,fLSElecPt(0)
3c56855b 165// ,fTrackPtBefTrkCuts(0)
166// ,fTrackPtAftTrkCuts(0)
520a29a8 167 ,fTPCnsigma(0)
3c56855b 168/* ,fTPCnsigmaAft(0)
520a29a8 169 ,fTPCnsigmaAftOwn(0)
170 ,fNCellv1(0)
171 ,fClsEv1(0)
172 ,fNClusv1(0)
173 ,fKFParticleP(0)
174 ,fKFParticleE(0)
3c56855b 175*/ ,fInvmassLS1(0)
487ae960 176 ,fInvmassLS2(0)
177 ,fInvmassLS3(0)
178 ,fInvmassLS4(0)
179 ,fInvmassLS5(0)
520a29a8 180 ,fInvmassULS1(0)
487ae960 181 ,fInvmassULS2(0)
182 ,fInvmassULS3(0)
183 ,fInvmassULS4(0)
184 ,fInvmassULS5(0)
520a29a8 185 ,fcentrality(0)
186 ,fElecPhi(0)
3c56855b 187 ,fElecPhiTPChalf(0)
188 ,fElecPhiPt(0)
189// ,fElecPhiTPC(0)
190// ,fElecPhiTPCEovP(0)
520a29a8 191 ,fHadronPhi(0)
3c56855b 192 ,fHadronPhiTPChalf(0)
193 ,fHadronPhiPt(0)
194/* ,fTrackHFEcuts(0)
4e01b68c 195 ,fTrakPhiSPD1(0)
196 ,fTrakPhiSPD2(0)
197 ,fTrakPhiSPDOr(0)
198 ,fTrakPhiSPDAnd(0)
199 ,fTrackHFEcutsITS(0)
3c56855b 200*/
4e01b68c 201/* ,fNoMixedEvents(0)
202 ,fMixStat(0)
203 ,fMixStat1(0)
204 ,fMixedIncElecDphi(0)
3c56855b 205 ,fMixedIncElecDphi1(0)
206 ,fMixedIncElecDphi2(0)
4e01b68c 207 ,fMixedPhotElecDphi(0)
3c56855b 208 ,fMixedPhotElecDphi1(0)
209 ,fMixedPhotElecDphi2(0)
4e01b68c 210 ,fMixedSemiIncElecDphi(0)
3c56855b 211 ,fMixedSemiIncElecDphi1(0)
212 ,fMixedSemiIncElecDphi2(0)
4e01b68c 213 ,fMixedDphiULSMassLow(0)
3c56855b 214 ,fMixedDphiULSMassLow1(0)
215 ,fMixedDphiULSMassLow2(0)
4e01b68c 216 ,fMixedDphiLSMassLow(0)
3c56855b 217 ,fMixedDphiLSMassLow1(0)
218 ,fMixedDphiLSMassLow2(0)
219*/
220/* ,fNLSminus(0)
487ae960 221 ,fNLSplus(0)
222 ,fNULS(0)
3c56855b 223*/ ,fHadronIPxy(0)
487ae960 224 ,fHadronIPz(0)
3c56855b 225 ,fHadronPt(0)
226 ,fCentralityPass(0)
227 ,fCentralityNoPass(0)
520a29a8 228// ,fSparseElectron(0)
229// ,fvalueElectron(0)
57189f04 230{
231 //Named constructor
520a29a8 232
57189f04 233 fPID = new AliHFEpid("hfePid");
520a29a8 234// fvalueElectron = new Double_t[8];
57189f04 235
236 // Define input and output slots here
237 // Input slot #0 works with a TChain
238 DefineInput(0, TChain::Class());
239 // Output slot #0 id reserved by the base class for AOD
240 // Output slot #1 writes into a TH1 container
241 // DefineOutput(1, TH1I::Class());
242 DefineOutput(1, TList::Class());
243 // DefineOutput(3, TTree::Class());
244}
245
246//________________________________________________________________________
247AliAnalysisTaskElecHadronCorrel::AliAnalysisTaskElecHadronCorrel()
248 : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisElecHadCorrel")
249 ,fESD(0)
250 ,fGeom(0)
251 ,fOutputList(0)
520a29a8 252 ,fTrackCuts1(new AliESDtrackCuts)
253 ,fTrackCuts2(new AliESDtrackCuts)
57189f04 254 ,fCuts(0)
255 ,fIdentifiedAsOutInz(kFALSE)
256 ,fPassTheEventCut(kFALSE)
257 ,fRejectKinkMother(kFALSE)
4e01b68c 258 ,fVz(0.0)
259 ,fCFM(0)
260 ,fPID(0)
261 ,fPIDqa(0)
262 ,fOpeningAngleCut(0.1)
57189f04 263 ,fInvmassCut(0.01)
3c56855b 264 ,fCentrality(0)
265 ,fCentralityMin(0)
266 ,fCentralityMax(0)
267 ,fkCentralityMethod(0)
4e01b68c 268// ,fPoolMgr(0x0)
57189f04 269 ,fNoEvents(0)
3c56855b 270// ,fTrkpt(0)
57189f04 271 ,fTrkEovPBef(0)
520a29a8 272 ,fTrkEovPBefHad(0)
3c56855b 273/* ,fTrkEovPAft(0)
520a29a8 274 ,fTrkEovPAftOwn(0)
57189f04 275 ,fdEdxBef(0)
276 ,fdEdxAft(0)
520a29a8 277 ,fdEdxAftOwn(0)
57189f04 278 ,fOpeningAngleLS(0)
279 ,fOpeningAngleULS(0)
3c56855b 280*/ ,fSemiIncElecDphi(0)
487ae960 281 ,fSemiIncElecDphi1(0)
282 ,fSemiIncElecDphi2(0)
283 ,fSemiIncElecDphi3(0)
284 ,fSemiIncElecDphi4(0)
57189f04 285 ,fPhotElecDphi(0)
487ae960 286 ,fPhotElecDphi1(0)
287 ,fPhotElecDphi2(0)
288 ,fPhotElecDphi3(0)
289 ,fPhotElecDphi4(0)
57189f04 290 ,fInclusiveElecDphi(0)
487ae960 291 ,fInclusiveElecDphi1(0)
292 ,fInclusiveElecDphi2(0)
293 ,fInclusiveElecDphi3(0)
294 ,fInclusiveElecDphi4(0)
57189f04 295 ,fDphiULSMassLow(0)
487ae960 296 ,fDphiULSMassLow1(0)
297 ,fDphiULSMassLow2(0)
298 ,fDphiULSMassLow3(0)
299 ,fDphiULSMassLow4(0)
57189f04 300 ,fDphiLSMassLow(0)
487ae960 301 ,fDphiLSMassLow1(0)
302 ,fDphiLSMassLow2(0)
303 ,fDphiLSMassLow3(0)
304 ,fDphiLSMassLow4(0)
520a29a8 305 ,fDphiULSMassLowNoPartner(0)
487ae960 306 ,fDphiULSMassLowNoPartner1(0)
307 ,fDphiULSMassLowNoPartner2(0)
308 ,fDphiULSMassLowNoPartner3(0)
309 ,fDphiULSMassLowNoPartner4(0)
520a29a8 310 ,fDphiLSMassLowNoPartner(0)
487ae960 311 ,fDphiLSMassLowNoPartner1(0)
312 ,fDphiLSMassLowNoPartner2(0)
313 ,fDphiLSMassLowNoPartner3(0)
314 ,fDphiLSMassLowNoPartner4(0)
57189f04 315 ,fPhotoElecPt(0)
316 ,fSemiInclElecPt(0)
520a29a8 317 ,fInclusiveElecPt(0)
318 ,fULSElecPt(0)
319 ,fLSElecPt(0)
3c56855b 320// ,fTrackPtBefTrkCuts(0)
321// ,fTrackPtAftTrkCuts(0)
520a29a8 322 ,fTPCnsigma(0)
3c56855b 323/* ,fTPCnsigmaAft(0)
520a29a8 324 ,fTPCnsigmaAftOwn(0)
325 ,fNCellv1(0)
326 ,fClsEv1(0)
327 ,fNClusv1(0)
328 ,fKFParticleP(0)
329 ,fKFParticleE(0)
3c56855b 330*/ ,fInvmassLS1(0)
487ae960 331 ,fInvmassLS2(0)
332 ,fInvmassLS3(0)
333 ,fInvmassLS4(0)
334 ,fInvmassLS5(0)
520a29a8 335 ,fInvmassULS1(0)
487ae960 336 ,fInvmassULS2(0)
337 ,fInvmassULS3(0)
338 ,fInvmassULS4(0)
339 ,fInvmassULS5(0)
520a29a8 340 ,fcentrality(0)
341 ,fElecPhi(0)
3c56855b 342 ,fElecPhiTPChalf(0)
343 ,fElecPhiPt(0)
344// ,fElecPhiTPC(0)
345// ,fElecPhiTPCEovP(0)
520a29a8 346 ,fHadronPhi(0)
3c56855b 347 ,fHadronPhiTPChalf(0)
348 ,fHadronPhiPt(0)
349/* ,fTrackHFEcuts(0)
4e01b68c 350 ,fTrakPhiSPD1(0)
351 ,fTrakPhiSPD2(0)
352 ,fTrakPhiSPDOr(0)
353 ,fTrakPhiSPDAnd(0)
354 ,fTrackHFEcutsITS(0)
3c56855b 355*/
4e01b68c 356/* ,fNoMixedEvents(0)
357 ,fMixStat(0)
358 ,fMixStat1(0)
359 ,fMixedIncElecDphi(0)
3c56855b 360 ,fMixedIncElecDphi1(0)
361 ,fMixedIncElecDphi2(0)
4e01b68c 362 ,fMixedPhotElecDphi(0)
3c56855b 363 ,fMixedPhotElecDphi1(0)
364 ,fMixedPhotElecDphi2(0)
4e01b68c 365 ,fMixedSemiIncElecDphi(0)
3c56855b 366 ,fMixedSemiIncElecDphi1(0)
367 ,fMixedSemiIncElecDphi2(0)
4e01b68c 368 ,fMixedDphiULSMassLow(0)
3c56855b 369 ,fMixedDphiULSMassLow1(0)
370 ,fMixedDphiULSMassLow2(0)
4e01b68c 371 ,fMixedDphiLSMassLow(0)
3c56855b 372 ,fMixedDphiLSMassLow1(0)
373 ,fMixedDphiLSMassLow2(0)
374*/
375/* ,fNLSminus(0)
487ae960 376 ,fNLSplus(0)
377 ,fNULS(0)
3c56855b 378*/ ,fHadronIPxy(0)
487ae960 379 ,fHadronIPz(0)
3c56855b 380 ,fHadronPt(0)
381 ,fCentralityPass(0)
382 ,fCentralityNoPass(0)
4e01b68c 383 // ,fSparseElectron(0)
384 // ,fvalueElectron(0)
57189f04 385{
520a29a8 386 //Default constructor
387 fPID = new AliHFEpid("hfePid");
4e01b68c 388 // fvalueElectron = new Double_t[8];
57189f04 389
520a29a8 390 // Constructor
4e01b68c 391 // Define input and output slots here
392 // Input slot #0 works with a TChain
393 DefineInput(0, TChain::Class());
394 // Output slot #0 id reserved by the base class for AOD
395 // Output slot #1 writes into a TH1 container
396 // DefineOutput(1, TH1I::Class());
397 DefineOutput(1, TList::Class());
398 //DefineOutput(3, TTree::Class());
57189f04 399}
400//_________________________________________
401
402AliAnalysisTaskElecHadronCorrel::~AliAnalysisTaskElecHadronCorrel()
403{
4e01b68c 404 //Destructor
405
406 delete fOutputList;
407 delete fGeom;
408 delete fPID;
409 delete fCFM;
410 delete fPIDqa;
411 delete fTrackCuts1;
412 delete fTrackCuts2;
413 // delete fSparseElectron;
414 // delete []fvalueElectron;
57189f04 415}
416//_________________________________________
417
418void AliAnalysisTaskElecHadronCorrel::UserExec(Option_t*)
419{
4e01b68c 420 //Main loop
421 //Called for each event
422
423 // create pointer to event
424 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
425 if (!fESD) {
426 printf("ERROR: fESD not available\n");
427 return;
428 }
520a29a8 429
4e01b68c 430 if(!fCuts){
431 AliError("HFE cuts not available");
432 return;
433 }
434
3c56855b 435 //---------------CENTRALITY SELECTION-----------------------
0523ddd5 436 SetCentralityParameters(0., 10., "V0M");
3c56855b 437 Bool_t pass = kFALSE; //to select centrality
438 CheckCentrality(fESD,pass);
439
440 if(!pass)return;
0523ddd5 441
4e01b68c 442 if(!fPID->IsInitialized()){
443 // Initialize PID with the given run number
444 AliWarning("PID not initialised, get from Run no");
445 fPID->InitializePID(fESD->GetRunNumber());
446 }
447
448 //-------trigger selection
449 UInt_t res = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
450 if (res==0)
451 return;
452
453 // if( (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kFastOnly) )
454 // return;
520a29a8 455
4e01b68c 456 if(!(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & (AliVEvent::kCentral))) return;
520a29a8 457
0523ddd5 458/* AliCentrality *fCentrality = (AliCentrality*)fESD->GetCentrality();
520a29a8 459
4e01b68c 460 Float_t centvalue = fCentrality->GetCentralityPercentile("V0M");
461 fcentrality->Fill(centvalue);
4e01b68c 462 if(centvalue<0 || centvalue>10) return;
0523ddd5 463*/
4e01b68c 464 Int_t fNOtrks = fESD->GetNumberOfTracks();
465 const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
520a29a8 466
4e01b68c 467 Double_t pVtxZ = -999;
468 pVtxZ = pVtx->GetZ();
520a29a8 469
4e01b68c 470 // Event cut
471 // if(!fCFM->CheckEventCuts(AliHFEcuts::kEventStepReconstructed, fESD)) return;
472
473 if(TMath::Abs(pVtxZ)>10) return;
474 fNoEvents->Fill(0);
475
476 if(fNOtrks<2) return;
477
478 AliPIDResponse *pidResponse = fInputHandler->GetPIDResponse();
479 if(!pidResponse){
480 AliDebug(1, "Using default PID Response");
520a29a8 481 pidResponse = AliHFEtools::GetDefaultPID(kFALSE, fInputEvent->IsA() == AliAODEvent::Class());
482 }
483
484 fPID->SetPIDResponse(pidResponse);
485
486 fCFM->SetRecEventInfo(fESD);
4e01b68c 487/*
488 //Event mixing
489 AliEventPool* pool = fPoolMgr->GetEventPool(centvalue, pVtxZ); // Get the buffer associated with the current centrality and z-vtx
490 if (!pool)
491 AliFatal(Form("No pool found for centrality = %f, zVtx = %f", centvalue, pVtxZ));
3c56855b 492*/
4e01b68c 493
520a29a8 494 // Track loop
495 for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
496 AliESDtrack* track = fESD->GetTrack(iTracks);
497 if (!track) {
498 printf("ERROR: Could not receive track %d\n", iTracks);
499 continue;
500 }
4e01b68c 501
502 if(track->Pt()<1) continue;
520a29a8 503
3c56855b 504 // fTrackPtBefTrkCuts->Fill(track->Pt());
4e01b68c 505
520a29a8 506 // RecKine: ITSTPC cuts
507 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, track)) continue;
508
509 //RecKink
510 if(fRejectKinkMother) { // Quick and dirty fix to reject both kink mothers and daughters
511 if(track->GetKinkIndex(0) != 0) continue;
512 }
513
514 // RecPrim
515 if(!ProcessCutStep(AliHFEcuts::kStepRecPrim, track)) continue;
516
4e01b68c 517 // HFE cuts: TPC PID cleanup
518 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, track)) continue;
519
3c56855b 520 // fTrackHFEcuts->Fill(track->Phi());
4e01b68c 521
522 //track phi distribution for diff ITS layer hit
3c56855b 523// if(track->HasPointOnITSLayer(0)) fTrakPhiSPD1->Fill(track->Phi());
524// if(track->HasPointOnITSLayer(1)) fTrakPhiSPD2->Fill(track->Phi());
525
4e01b68c 526
3c56855b 527// if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)) fTrakPhiSPDOr->Fill(track->Phi());
528// if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)) fTrakPhiSPDAnd->Fill(track->Phi());
4e01b68c 529
520a29a8 530 // HFEcuts: ITS layers cuts
531 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsITS, track)) continue;
532
3c56855b 533// fTrackHFEcutsITS->Fill(track->Phi());
520a29a8 534
3c56855b 535// fTrackPtAftTrkCuts->Fill(track->Pt());
4e01b68c 536
520a29a8 537 Double_t fClsE = -999, p = -999, fEovP=-999, pt = -999, dEdx=-999, fTPCnSigma=0;
4e01b68c 538 pt = track->Pt();
539 p = track->P();
540 dEdx = track->GetTPCsignal();
541 fTPCnSigma = fPID->GetPIDResponse() ? fPID->GetPIDResponse()->NumberOfSigmasTPC(track, AliPID::kElectron) : 1000;
542
543 //TPC electron phi
544 if(fTPCnSigma >= -2 && fTPCnSigma <= 2){
3c56855b 545// fElecPhiTPC->Fill(track->Phi());
4e01b68c 546 }
547
548 //eta cut (-0.7,0.7)
549 if(track->Eta() < -0.7 || track->Eta() > 0.7) continue;
550
551 // Track extrapolation to EMCAL
520a29a8 552 Int_t fClsId = track->GetEMCALcluster();
553 if(fClsId <0) continue;
554 AliESDCaloCluster *cluster = fESD->GetCaloCluster(fClsId);
555 if(TMath::Abs(cluster->GetTrackDx())>0.05 || TMath::Abs(cluster->GetTrackDz())>0.05) continue;
3c56855b 556// fdEdxBef->Fill(p,dEdx);
4e01b68c 557 fTPCnsigma->Fill(p,fTPCnSigma);
520a29a8 558
3c56855b 559// fTrkpt->Fill(pt);
520a29a8 560 fClsE = cluster->E();
520a29a8 561 fEovP = fClsE/p;
4e01b68c 562 /*
563 fvalueElectron[0] = pt;
564 fvalueElectron[1] = p;
565 fvalueElectron[2] = fTPCnSigma;
566 fvalueElectron[3] = dEdx;
567 fvalueElectron[4] = fEovP;
568 fvalueElectron[5] = cluster->GetM20();
569 fvalueElectron[6] = cluster->GetM02();
570 fvalueElectron[7] = cluster->GetDispersion();
571
572 fSparseElectron->Fill(fvalueElectron);
573 */
574 if(fTPCnSigma >= -2 && fTPCnSigma <= 2){
575 fTrkEovPBef->Fill(pt,fEovP);
576 }
577 if(fTPCnSigma < -3.5)fTrkEovPBefHad->Fill(pt,fEovP);
578 /*
579 Int_t pidpassed = 0;
520a29a8 580 //--- track accepted, do PID
581 AliHFEpidObject hfetrack;
582 hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);
583 hfetrack.SetRecTrack(track);
584 hfetrack.SetPbPb();
585 if(fPID->IsSelected(&hfetrack, NULL, "", fPIDqa)) pidpassed = 1;
586
587 if(pidpassed==1){
4e01b68c 588 cout << "dedx, E/p : "<< dEdx << ", " << fEovP <<endl;
589 fTrkEovPAft->Fill(pt,fEovP);
590 fdEdxAft->Fill(p,dEdx);
591 fTPCnsigmaAft->Fill(p,fTPCnSigma);
520a29a8 592 }
4e01b68c 593 */
594
595 //Electron id with TPC and E/p
596 if(fTPCnSigma >= -2 && fTPCnSigma <= 2 && fEovP >= 0.8 && fEovP <=1.2) {
3c56855b 597// fElecPhiTPCEovP->Fill(track->Phi());
4e01b68c 598
599 //Electron id with shower shape
600 if(cluster->GetM20()<0.2 && cluster->GetM02()< 0.5 && cluster->GetDispersion()<1){
3c56855b 601
3db00c72 602 fElecPhi->Fill(track->Phi());
3c56855b 603 fElecPhiPt->Fill(track->Phi(),track->Pt());
604 if (track->Eta() >0 && track->Eta() <0.7) fElecPhiTPChalf->Fill(track->Phi());
605// fTrkEovPAftOwn->Fill(pt,fEovP);
606// fdEdxAftOwn->Fill(p,dEdx);
607// fTPCnsigmaAftOwn->Fill(p,fTPCnSigma);
608
609 HadronInfo(iTracks);
3db00c72 610
611 Bool_t fFlagPhotonicElec = kFALSE;
612 // select photonic electron
613 SelectPhotonicElectron(iTracks,track,fFlagPhotonicElec);
614 //Inclusive electron-hadron correlation
487ae960 615 ElectronHadCorrel(iTracks, track, fInclusiveElecDphi, fInclusiveElecDphi1,fInclusiveElecDphi2,fInclusiveElecDphi3,fInclusiveElecDphi4);
3db00c72 616 fInclusiveElecPt->Fill(pt);
3c56855b 617// MixedEvent(track,fMixedIncElecDphi, fMixedIncElecDphi1,fMixedIncElecDphi2);
4e01b68c 618
3db00c72 619 // photonic electron
620 if(fFlagPhotonicElec){
4e01b68c 621 //Electron hadron correlation
487ae960 622 ElectronHadCorrel(iTracks, track, fPhotElecDphi,fPhotElecDphi1,fPhotElecDphi2,fPhotElecDphi3,fPhotElecDphi4);
4e01b68c 623 fPhotoElecPt->Fill(pt);
3c56855b 624// MixedEvent(track,fMixedPhotElecDphi, fMixedPhotElecDphi1,fMixedPhotElecDphi2);
3db00c72 625 }
626
627 // Semi inclusive electron
628 if(!fFlagPhotonicElec){
629 //Electron hadron correlation
487ae960 630 ElectronHadCorrel(iTracks, track, fSemiIncElecDphi, fSemiIncElecDphi1,fSemiIncElecDphi2,fSemiIncElecDphi3,fSemiIncElecDphi4);
3db00c72 631 fSemiInclElecPt->Fill(pt);
3c56855b 632// MixedEvent(track,fMixedSemiIncElecDphi,fMixedSemiIncElecDphi1,fMixedSemiIncElecDphi2);
3db00c72 633 }
4e01b68c 634
520a29a8 635 }
636 }
637 }
3c56855b 638 /*
520a29a8 639 //EMC clusters
640 Int_t clsNo = fESD->GetNumberOfCaloClusters();
641 fNClusv1->Fill(clsNo);
642 for(Int_t iclus=0; iclus<clsNo ; iclus++){
643 AliESDCaloCluster* clus = fESD->GetCaloCluster(iclus);
644 if(!clus->IsEMCAL()) continue;
645 fNCellv1->Fill(clus->GetNCells());
646 fClsEv1->Fill(clus->E());
647 }
3c56855b 648*/
649/*
650 TObjArray* tracksClone = CloneAndReduceTrackList();
651 tracksClone->SetOwner();
652 pool->UpdatePool(tracksClone);
653 */
520a29a8 654 PostData(1, fOutputList);
57189f04 655}
656//_________________________________________
657void AliAnalysisTaskElecHadronCorrel::UserCreateOutputObjects()
658{
659 //Create histograms
520a29a8 660 // TGeoManager::Import("geometry.root");
661 // fGeom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");
662
57189f04 663 //--------Initialize PID
664 fPID->SetHasMCData(kFALSE);
665 if(!fPID->GetNumberOfPIDdetectors())
520a29a8 666 {
667 fPID->AddDetector("TPC", 0);
668 fPID->AddDetector("EMCAL", 1);
669 }
670
57189f04 671 fPID->SortDetectors();
672 fPIDqa = new AliHFEpidQAmanager();
673 fPIDqa->Initialize(fPID);
520a29a8 674
57189f04 675 //--------Initialize correction Framework and Cuts
676 fCFM = new AliCFManager;
677 const Int_t kNcutSteps = AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kNcutStepsRecTrack + AliHFEcuts::kNcutStepsDETrack;
678 fCFM->SetNStepParticle(kNcutSteps);
679 for(Int_t istep = 0; istep < kNcutSteps; istep++)
680 fCFM->SetParticleCutsList(istep, NULL);
520a29a8 681
57189f04 682 if(!fCuts){
683 AliWarning("Cuts not available. Default cuts will be used");
684 fCuts = new AliHFEcuts;
685 fCuts->CreateStandardCuts();
686 }
687 fCuts->Initialize(fCFM);
4e01b68c 688/*
689 //Mixed event initialising
690 Int_t trackDepth = 2000;
691 Int_t poolsize = 1000;
692
693 Int_t nCentralityBins = 5;
694 Double_t CentralityBins[] = {0,2,4,6,8,10};
520a29a8 695
487ae960 696 Int_t nZvtxBins = 4;
697 Double_t vertexBins[] = {-10,-5,0,5,10};
4e01b68c 698
699 fPoolMgr = new AliEventPoolManager(poolsize, trackDepth, nCentralityBins, (Double_t*) CentralityBins, nZvtxBins, (Double_t*) vertexBins);
700*/
57189f04 701 //---------Output Tlist
702 fOutputList = new TList();
703 fOutputList->SetOwner();
704 fOutputList->Add(fPIDqa->MakeList("PIDQA"));
520a29a8 705
57189f04 706 fNoEvents = new TH1F("fNoEvents","",1,0,1) ;
707 fOutputList->Add(fNoEvents);
520a29a8 708
709 fcentrality = new TH1F("fcentrality","centrality", 100,0,100);
710 fOutputList->Add(fcentrality);
3c56855b 711/*
57189f04 712 fTrkpt = new TH1F("fTrkpt","track pt",1000,0,50);
713 fOutputList->Add(fTrkpt);
520a29a8 714
57189f04 715 fTrackPtBefTrkCuts = new TH1F("fTrackPtBefTrkCuts","track pt before track cuts",1000,0,50);
716 fOutputList->Add(fTrackPtBefTrkCuts);
520a29a8 717
57189f04 718 fTrackPtAftTrkCuts = new TH1F("fTrackPtAftTrkCuts","track pt after track cuts",1000,0,50);
719 fOutputList->Add(fTrackPtAftTrkCuts);
3c56855b 720*/
57189f04 721 fTPCnsigma = new TH2F("fTPCnsigma", "TPC - n sigma",1000,0,50,200,-10,10);
722 fOutputList->Add(fTPCnsigma);
3c56855b 723/*
520a29a8 724 fTPCnsigmaAft = new TH2F("fTPCnsigmaAft", "TPC - n sigma after hfepid",1000,0,50,200,-10,10);
725 fOutputList->Add(fTPCnsigmaAft);
726
727 fTPCnsigmaAftOwn = new TH2F("fTPCnsigmaAftOwn", "TPC - n sigma after own pid",1000,0,50,200,-10,10);
728 fOutputList->Add(fTPCnsigmaAftOwn);
3c56855b 729*/
57189f04 730 fTrkEovPBef = new TH2F("fTrkEovPBef","track E/p before HFE pid",1000,0,50,100,0,2);
731 fOutputList->Add(fTrkEovPBef);
520a29a8 732
733 fTrkEovPBefHad = new TH2F("fTrkEovPBefHad","track E/p for TPCnsig < 3.5",1000,0,50,100,0,2);
734 fOutputList->Add(fTrkEovPBefHad);
3c56855b 735/*
57189f04 736 fTrkEovPAft = new TH2F("fTrkEovPAft","track E/p after HFE pid",1000,0,50,100,0,2);
737 fOutputList->Add(fTrkEovPAft);
520a29a8 738
739 fTrkEovPAftOwn = new TH2F("fTrkEovPAftOwn","track E/p after own pid",1000,0,50,100,0,2);
740 fOutputList->Add(fTrkEovPAftOwn);
741
57189f04 742 fdEdxBef = new TH2F("fdEdxBef","track dEdx vs p before HFE pid",1000,0,50,150,0,150);
743 fOutputList->Add(fdEdxBef);
520a29a8 744
57189f04 745 fdEdxAft = new TH2F("fdEdxAft","track dEdx vs p after HFE pid",1000,0,50,150,0,150);
746 fOutputList->Add(fdEdxAft);
520a29a8 747
748 fdEdxAftOwn = new TH2F("fdEdxAftOwn","track dEdx vs p own HFE pid",1000,0,50,150,0,150);
749 fOutputList->Add(fdEdxAftOwn);
3c56855b 750*/
520a29a8 751 fElecPhi = new TH1F("fElecPhi", "Electron phi",1000,0,6.28);
752 fOutputList->Add(fElecPhi);
753
3c56855b 754 fElecPhiPt = new TH2F("fElecPhiPt", "Electron phi vs pt; Electron phi; pt (GeV/c)",1000,0,6.28,1000,0,100);
755 fOutputList->Add(fElecPhiPt);
756
757 fElecPhiTPChalf = new TH1F("fElecPhiTPChalf", "Electron phi for 0<eta<0.7",1000,0,6.28);
758 fOutputList->Add(fElecPhiTPChalf);
759
760/* fElecPhiTPC = new TH1F("fElecPhiTPC", "Electron phi after TPC cut",1000,0,6.28);
4e01b68c 761 fOutputList->Add(fElecPhiTPC);
762
763 fElecPhiTPCEovP = new TH1F("fElecPhiTPCEovP", "Electron phi after TPC and E/p cut",1000,0,6.28);
764 fOutputList->Add(fElecPhiTPCEovP);
3c56855b 765*/
520a29a8 766 fHadronPhi = new TH1F("fHadronPhi", "Hadron phi",1000,0,6.28);
767 fOutputList->Add(fHadronPhi);
768
3c56855b 769 fHadronPhiTPChalf = new TH1F("fHadronPhiTPChalf", "Hadron phi for 0<eta<0.9",1000,0,6.28);
770 fOutputList->Add(fHadronPhiTPChalf);
771
772 fHadronPhiPt = new TH2F("fHadronPhiPt", "Hadron phi vs pt; hadron phi; pt (GeV/c)",1000,0,6.28,1000,0,100);
773 fOutputList->Add(fHadronPhiPt);
774
775/*
4e01b68c 776 fTrackHFEcuts = new TH1F("fTrackHFEcuts","Track phi for HFE cuts",1000,0,6.28);
777 fOutputList->Add(fTrackHFEcuts);
778
779 fTrakPhiSPD1 = new TH1F("fTrakPhiSPD1","Track phi for hit in SPD layer 1",1000,0,6.28);
780 fOutputList->Add(fTrakPhiSPD1);
781
782 fTrakPhiSPD2 = new TH1F("fTrakPhiSPD2","Track phi for hit in SPD layer 2",1000,0,6.28);
783 fOutputList->Add(fTrakPhiSPD2);
784
785 fTrakPhiSPDOr = new TH1F("fTrakPhiSPDOr","Track phi for hit in any SPD layer",1000,0,6.28);
786 fOutputList->Add(fTrakPhiSPDOr);
787
788 fTrakPhiSPDAnd = new TH1F("fTrakPhiSPDAnd","Track phi for hit in both SPD layer",1000,0,6.28);
789 fOutputList->Add(fTrakPhiSPDAnd);
790
791 fTrackHFEcutsITS = new TH1F("fTrackHFEcutsITS","Track phi for HFE cuts + ITS HFE cuts",1000,0,6.28);
792 fOutputList->Add(fTrackHFEcutsITS);
520a29a8 793
57189f04 794 fOpeningAngleLS = new TH1F("fOpeningAngleLS","Opening angle for LS pairs",100,0,1);
795 fOutputList->Add(fOpeningAngleLS);
520a29a8 796
57189f04 797 fOpeningAngleULS = new TH1F("fOpeningAngleULS","Opening angle for ULS pairs",100,0,1);
798 fOutputList->Add(fOpeningAngleULS);
3c56855b 799*/
0523ddd5 800 fSemiIncElecDphi = new TH2F("fSemiIncElecDphi", "Semi Inclusive elec-had Dphi correlation",200,0,20,64,-1.57,4.71);
57189f04 801 fOutputList->Add(fSemiIncElecDphi);
520a29a8 802
0523ddd5 803 fSemiIncElecDphi1 = new TH2F("fSemiIncElecDphi1", "Semi Inclusive elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
487ae960 804 fOutputList->Add(fSemiIncElecDphi1);
805
0523ddd5 806 fSemiIncElecDphi2 = new TH2F("fSemiIncElecDphi2", "Semi Inclusive elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
487ae960 807 fOutputList->Add(fSemiIncElecDphi2);
808
0523ddd5 809 fSemiIncElecDphi3 = new TH2F("fSemiIncElecDphi3", "Semi Inclusive elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
487ae960 810 fOutputList->Add(fSemiIncElecDphi3);
811
0523ddd5 812 fSemiIncElecDphi4 = new TH2F("fSemiIncElecDphi4", "Semi Inclusive elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
487ae960 813 fOutputList->Add(fSemiIncElecDphi4);
814
0523ddd5 815 fPhotElecDphi = new TH2F("fPhotElecDphi", "Photon elec-had Dphi correlation",200,0,20,64,-1.57,4.71);
57189f04 816 fOutputList->Add(fPhotElecDphi);
520a29a8 817
0523ddd5 818 fPhotElecDphi1 = new TH2F("fPhotElecDphi1", "Photon elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
487ae960 819 fOutputList->Add(fPhotElecDphi1);
820
0523ddd5 821 fPhotElecDphi2 = new TH2F("fPhotElecDphi2", "Photon elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
487ae960 822 fOutputList->Add(fPhotElecDphi2);
823
0523ddd5 824 fPhotElecDphi3 = new TH2F("fPhotElecDphi3", "Photon elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
487ae960 825 fOutputList->Add(fPhotElecDphi3);
826
0523ddd5 827 fPhotElecDphi4 = new TH2F("fPhotElecDphi4", "Photon elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
487ae960 828 fOutputList->Add(fPhotElecDphi4);
829
0523ddd5 830 fInclusiveElecDphi = new TH2F("fInclusiveElecDphi", "Inclusive elec-had Dphi correlation",200,0,20,64,-1.57,4.71);
57189f04 831 fOutputList->Add(fInclusiveElecDphi);
520a29a8 832
0523ddd5 833 fInclusiveElecDphi1 = new TH2F("fInclusiveElecDphi1", "Inclusive elec-had Dphi correlation for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
487ae960 834 fOutputList->Add(fInclusiveElecDphi1);
835
0523ddd5 836 fInclusiveElecDphi2 = new TH2F("fInclusiveElecDphi2", "Inclusive elec-had Dphi correlation for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
487ae960 837 fOutputList->Add(fInclusiveElecDphi2);
838
0523ddd5 839 fInclusiveElecDphi3 = new TH2F("fInclusiveElecDphi3", "Inclusive elec-had Dphi correlation for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
487ae960 840 fOutputList->Add(fInclusiveElecDphi3);
841
0523ddd5 842 fInclusiveElecDphi4 = new TH2F("fInclusiveElecDphi4", "Inclusive elec-had Dphi correlation for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
487ae960 843 fOutputList->Add(fInclusiveElecDphi4);
844
0523ddd5 845 fDphiULSMassLow = new TH2F("fDphiULSMassLow", "e-h Dphi ULS, mass<cut",200,0,20,64,-1.57,4.71);
57189f04 846 fOutputList->Add(fDphiULSMassLow);
520a29a8 847
0523ddd5 848 fDphiULSMassLow1 = new TH2F("fDphiULSMassLow1", "e-h Dphi ULS, mass<cut for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
487ae960 849 fOutputList->Add(fDphiULSMassLow1);
850
0523ddd5 851 fDphiULSMassLow2 = new TH2F("fDphiULSMassLow2", "e-h Dphi ULS, mass<cut for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
487ae960 852 fOutputList->Add(fDphiULSMassLow2);
853
0523ddd5 854 fDphiULSMassLow3 = new TH2F("fDphiULSMassLow3", "e-h Dphi ULS, mass<cut for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
487ae960 855 fOutputList->Add(fDphiULSMassLow3);
856
0523ddd5 857 fDphiULSMassLow4 = new TH2F("fDphiULSMassLow4", "e-h Dphi ULS, mass<cut for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
487ae960 858 fOutputList->Add(fDphiULSMassLow4);
859
0523ddd5 860 fDphiLSMassLow = new TH2F("fDphiLSMassLow", "e-h Dphi LS, mass<cut",200,0,20,64,-1.57,4.71);
57189f04 861 fOutputList->Add(fDphiLSMassLow);
520a29a8 862
0523ddd5 863 fDphiLSMassLow1 = new TH2F("fDphiLSMassLow1", "e-h Dphi LS, mass<cut for 1<pt^{asso}<3",200,0,20,64,-1.57,4.71);
487ae960 864 fOutputList->Add(fDphiLSMassLow1);
865
0523ddd5 866 fDphiLSMassLow2 = new TH2F("fDphiLSMassLow2", "e-h Dphi LS, mass<cut for 3<pt^{asso}<5",200,0,20,64,-1.57,4.71);
487ae960 867 fOutputList->Add(fDphiLSMassLow2);
868
0523ddd5 869 fDphiLSMassLow3 = new TH2F("fDphiLSMassLow3", "e-h Dphi LS, mass<cut for 5<pt^{asso}<7",200,0,20,64,-1.57,4.71);
487ae960 870 fOutputList->Add(fDphiLSMassLow3);
871
0523ddd5 872 fDphiLSMassLow4 = new TH2F("fDphiLSMassLow4", "e-h Dphi LS, mass<cut for 7<pt^{asso}<9",200,0,20,64,-1.57,4.71);
487ae960 873 fOutputList->Add(fDphiLSMassLow4);
874
0523ddd5 875 fDphiULSMassLowNoPartner = new TH2F("fDphiULSMassLowNoPartner", "e-h Dphi ULS with no partner, mass<mass cut,",200,0,20,64,-1.57,4.71);
520a29a8 876 fOutputList->Add(fDphiULSMassLowNoPartner);
877
0523ddd5 878 fDphiULSMassLowNoPartner1 = new TH2F("fDphiULSMassLowNoPartner1", "e-h Dphi ULS with no partner, mass<mass cut for 1<pt^{asso}<3,",200,0,20,64,-1.57,4.71);
487ae960 879 fOutputList->Add(fDphiULSMassLowNoPartner1);
880
0523ddd5 881 fDphiULSMassLowNoPartner2 = new TH2F("fDphiULSMassLowNoPartner2", "e-h Dphi ULS with no partner, mass<mass cut for 3<pt^{asso}<5,",200,0,20,64,-1.57,4.71);
487ae960 882 fOutputList->Add(fDphiULSMassLowNoPartner2);
883
0523ddd5 884 fDphiULSMassLowNoPartner3 = new TH2F("fDphiULSMassLowNoPartner3", "e-h Dphi ULS with no partner, mass<mass cut for 5<pt^{asso}<7,",200,0,20,64,-1.57,4.71);
487ae960 885 fOutputList->Add(fDphiULSMassLowNoPartner3);
886
0523ddd5 887 fDphiULSMassLowNoPartner4 = new TH2F("fDphiULSMassLowNoPartner4", "e-h Dphi ULS with no partner, mass<mass cut for 7<pt^{asso}<9,",200,0,20,64,-1.57,4.71);
487ae960 888 fOutputList->Add(fDphiULSMassLowNoPartner4);
889
0523ddd5 890 fDphiLSMassLowNoPartner = new TH2F("fDphiLSMassLowNoPartner", "e-h Dphi LS with no partner, mass<mass cut",200,0,20,64,-1.57,4.71);
520a29a8 891 fOutputList->Add(fDphiLSMassLowNoPartner);
892
0523ddd5 893 fDphiLSMassLowNoPartner1 = new TH2F("fDphiLSMassLowNoPartner1", "e-h Dphi LS with no partner, mass<mass cut for 1<pt^{asso}<3,",200,0,20,64,-1.57,4.71);
487ae960 894 fOutputList->Add(fDphiLSMassLowNoPartner1);
895
0523ddd5 896 fDphiLSMassLowNoPartner2 = new TH2F("fDphiLSMassLowNoPartner2", "e-h Dphi LS with no partner, mass<mass cut for 3<pt^{asso}<5,",200,0,20,64,-1.57,4.71);
487ae960 897 fOutputList->Add(fDphiLSMassLowNoPartner2);
898
0523ddd5 899 fDphiLSMassLowNoPartner3 = new TH2F("fDphiLSMassLowNoPartner3", "e-h Dphi LS with no partner, mass<mass cut for 5<pt^{asso}<7,",200,0,20,64,-1.57,4.71);
487ae960 900 fOutputList->Add(fDphiLSMassLowNoPartner3);
901
0523ddd5 902 fDphiLSMassLowNoPartner4 = new TH2F("fDphiLSMassLowNoPartner4", "e-h Dphi LS with no partner, mass<mass cut for 7<pt^{asso}<9,",200,0,20,64,-1.57,4.71);
487ae960 903 fOutputList->Add(fDphiLSMassLowNoPartner4);
904
57189f04 905 fPhotoElecPt = new TH1F("fPhotoElecPt", "photonic electron pt",1000,0,100);
906 fOutputList->Add(fPhotoElecPt);
520a29a8 907
57189f04 908 fSemiInclElecPt = new TH1F("fSemiInclElecPt", "Semi-inclusive electron pt",1000,0,100);
909 fOutputList->Add(fSemiInclElecPt);
520a29a8 910
911 fInclusiveElecPt = new TH1F("fInclElecPt", "Inclusive electron pt",1000,0,100);
912 fOutputList->Add(fInclusiveElecPt);
913
914 fULSElecPt = new TH1F("fULSElecPt", "ULS electron pt",1000,0,100);
915 fOutputList->Add(fULSElecPt);
916
917 fLSElecPt = new TH1F("fLSElecPt", "LS electron pt",1000,0,100);
918 fOutputList->Add(fLSElecPt);
3c56855b 919/*
520a29a8 920 fNCellv1 = new TH1F("fNCellv1","Ncell in clus (v1); NCell; count",100,0,100) ;
921 fOutputList->Add(fNCellv1);
922
923 fClsEv1 = new TH1F("fClsEv1", "Clus E(v1); Cls E; count",1000,0,100);
924 fOutputList->Add(fClsEv1);
925
926 fNClusv1 = new TH1F("fNClusv1","Nclus in event (v1); NClus; count",500,0,500) ;
927 fOutputList->Add(fNClusv1);
928
929 fKFParticleP = new TH1F("fKFParticleP","KFparticle rec P; P(GeV/c)",1000,0,50);
930 fOutputList->Add(fKFParticleP);
931
932 fKFParticleE = new TH1F("fKFParticleE", "KfParticle rec E; E; count",1000,0,100);
933 fOutputList->Add(fKFParticleE);
3c56855b 934*/
520a29a8 935 fInvmassLS1 = new TH1F("fInvmassLS1", "Inv mass of LS (e,e); mass(GeV/c^2); counts;", 1000,0,1.0);
936 fOutputList->Add(fInvmassLS1);
937
938 fInvmassULS1 = new TH1F("fInvmassULS1", "Inv mass of ULS (e,e); mass(GeV/c^2); counts;", 1000,0,1.0);
939 fOutputList->Add(fInvmassULS1);
487ae960 940
941 fInvmassLS2 = new TH1F("fInvmassLS2", "Inv mass of LS (e,e) for pt^{e}>1; mass(GeV/c^2); counts;", 1000,0,1.0);
942 fOutputList->Add(fInvmassLS2);
943
944 fInvmassULS2 = new TH1F("fInvmassULS2", "Inv mass of ULS (e,e) for pt^{e}>1; mass(GeV/c^2); counts;", 1000,0,1.0);
945 fOutputList->Add(fInvmassULS2);
946
947 fInvmassLS3 = new TH1F("fInvmassLS3", "Inv mass of LS (e,e) for pt^{e}>2; mass(GeV/c^2); counts;", 1000,0,1.0);
948 fOutputList->Add(fInvmassLS3);
949
950 fInvmassULS3 = new TH1F("fInvmassULS3", "Inv mass of ULS (e,e) for pt^{e}>2; mass(GeV/c^2); counts;", 1000,0,1.0);
951 fOutputList->Add(fInvmassULS3);
952
953 fInvmassLS4 = new TH1F("fInvmassLS4", "Inv mass of LS (e,e) for pt^{e}>3; mass(GeV/c^2); counts;", 1000,0,1.0);
954 fOutputList->Add(fInvmassLS4);
955
956 fInvmassULS4 = new TH1F("fInvmassULS4", "Inv mass of ULS (e,e) for pt^{e}>3; mass(GeV/c^2); counts;", 1000,0,1.0);
957 fOutputList->Add(fInvmassULS4);
958
959 fInvmassLS5 = new TH1F("fInvmassLS5", "Inv mass of LS (e,e) for pt^{e}>4; mass(GeV/c^2); counts;", 1000,0,1.0);
960 fOutputList->Add(fInvmassLS5);
961
962 fInvmassULS5 = new TH1F("fInvmassULS5", "Inv mass of ULS (e,e) for pt^{e}>4; mass(GeV/c^2); counts;", 1000,0,1.0);
963 fOutputList->Add(fInvmassULS5);
4e01b68c 964/*
965 fNoMixedEvents = new TH1F("fNoMixedEvents","",1,0,1) ;
966 fOutputList->Add(fNoMixedEvents);
967
3c56855b 968 fMixStat = new TH2F("fMixStat","no of events in pool vs Centrality;Nevent in pool;Centrality",200,0,200,5,0,10);
4e01b68c 969 fOutputList->Add(fMixStat);
970
3c56855b 971 fMixStat1 = new TH2F("fMixStat1","no of events in pool vs zvtx;Nevents in pool;zvtx",200,0,200,4,-10,10);
4e01b68c 972 fOutputList->Add(fMixStat1);
973
487ae960 974 fMixedIncElecDphi = new TH2F("fMixedIncElecDphi", "Mixed event - Inclusive elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
4e01b68c 975 fOutputList->Add(fMixedIncElecDphi);
976
3c56855b 977 fMixedIncElecDphi1 = new TH2F("fMixedIncElecDphi1", "Mixed event - Inclusive elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
978 fOutputList->Add(fMixedIncElecDphi1);
979
980 fMixedIncElecDphi2 = new TH2F("fMixedIncElecDphi2", "Mixed event - Inclusive elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
981 fOutputList->Add(fMixedIncElecDphi2);
982
487ae960 983 fMixedSemiIncElecDphi = new TH2F("fMixedSemiIncElecDphi", "Mixed event - Semi Inclusive elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
4e01b68c 984 fOutputList->Add(fMixedSemiIncElecDphi);
985
3c56855b 986 fMixedSemiIncElecDphi1 = new TH2F("fMixedSemiIncElecDphi1", "Mixed event - Semi Inclusive elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
987 fOutputList->Add(fMixedSemiIncElecDphi1);
988
989 fMixedSemiIncElecDphi2 = new TH2F("fMixedSemiIncElecDphi2", "Mixed event - Semi Inclusive elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
990 fOutputList->Add(fMixedSemiIncElecDphi2);
991
487ae960 992 fMixedPhotElecDphi = new TH2F("fMixedPhotElecDphi", "Mixed event - Photo elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
4e01b68c 993 fOutputList->Add(fMixedPhotElecDphi);
994
3c56855b 995 fMixedPhotElecDphi1 = new TH2F("fMixedPhotElecDphi1", "Mixed event - Photo elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
996 fOutputList->Add(fMixedPhotElecDphi1);
997
998 fMixedPhotElecDphi2 = new TH2F("fMixedPhotElecDphi2", "Mixed event - Photo elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
999 fOutputList->Add(fMixedPhotElecDphi2);
1000
487ae960 1001 fMixedDphiULSMassLow = new TH2F("fMixedDphiULSMassLow", "Mixed event - ULS mass < cut elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
4e01b68c 1002 fOutputList->Add(fMixedDphiULSMassLow);
1003
3c56855b 1004 fMixedDphiULSMassLow1 = new TH2F("fMixedDphiULSMassLow1", "Mixed event - ULS mass < cut elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
1005 fOutputList->Add(fMixedDphiULSMassLow1);
1006
1007 fMixedDphiULSMassLow2 = new TH2F("fMixedDphiULSMassLow2", "Mixed event - ULS mass < cut elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
1008 fOutputList->Add(fMixedDphiULSMassLow2);
1009
487ae960 1010 fMixedDphiLSMassLow = new TH2F("fMixedDphiLSMassLow", "Mixed event - LS mass < cut elec-had Dphi correlation",200,0,20,100,-1.57,4.71);
4e01b68c 1011 fOutputList->Add(fMixedDphiLSMassLow);
3c56855b 1012
1013 fMixedDphiLSMassLow1 = new TH2F("fMixedDphiLSMassLow1", "Mixed event - LS mass < cut elec-had Dphi correlation 1<pt<3",200,0,20,100,-1.57,4.71);
1014 fOutputList->Add(fMixedDphiLSMassLow1);
1015
1016 fMixedDphiLSMassLow2 = new TH2F("fMixedDphiLSMassLow2", "Mixed event - LS mass < cut elec-had Dphi correlation 3<pt<5",200,0,20,100,-1.57,4.71);
1017 fOutputList->Add(fMixedDphiLSMassLow2);
487ae960 1018*/
3c56855b 1019 /*
487ae960 1020 fNLSminus = new TH1F("fNLSminus","No of LS negative pairs (e-,e-) ",1000,-0.5,999.5);
1021 fOutputList->Add(fNLSminus);
1022
1023 fNLSplus = new TH1F("fNLSplus","No of LS positive pairs (e+,e+)",1000,-0.5,999.5);
1024 fOutputList->Add(fNLSplus);
1025
1026 fNULS = new TH1F("fNULS","No of ULS pairs (e+,e-)",1000,-0.5,999.5);
1027 fOutputList->Add(fNULS);
3c56855b 1028*/
487ae960 1029 fHadronIPxy = new TH1F("fHadronIPxy", "hadron impact paramter XY",1000,-5,5);
1030 fOutputList->Add(fHadronIPxy);
1031
1032 fHadronIPz = new TH1F("fHadronIPz", "hadron impact paramter Z",1000,-20,20);
1033 fOutputList->Add(fHadronIPz);
1034
3c56855b 1035 fHadronPt = new TH1F("fHadronPt","hadron pt distribution",1000,0,100);
1036 fOutputList->Add(fHadronPt);
1037
1038 fCentralityPass = new TH1F("fCentralityPass", "Centrality Pass", 101, -1, 100);
1039 fOutputList->Add(fCentralityPass);
1040
1041 fCentralityNoPass = new TH1F("fCentralityNoPass", "Centrality No Pass", 101, -1, 100);
1042 fOutputList->Add(fCentralityNoPass);
1043
520a29a8 1044 /*
1045 Int_t binsv1[8]={1000,1000,200,150,100,100,100,100}; //pt, p, TPCnsig, dEdx, E/p, M20, M02, dispersion
1046 Double_t xminv1[8]={0,0,-10,0,0,0,0,0};
1047 Double_t xmaxv1[8]={50,50,10,150,2,2,2,2};
1048 fSparseElectron = new THnSparseD ("Electron","Electron",8,binsv1,xminv1,xmaxv1);
1049 fOutputList->Add(fSparseElectron);
1050 */
57189f04 1051 PostData(1,fOutputList);
1052}
1053
1054//________________________________________________________________________
1055void AliAnalysisTaskElecHadronCorrel::Terminate(Option_t *)
1056{
1057 // Info("Terminate");
520a29a8 1058 AliAnalysisTaskSE::Terminate();
57189f04 1059}
1060
1061//________________________________________________________________________
1062Bool_t AliAnalysisTaskElecHadronCorrel::ProcessCutStep(Int_t cutStep, AliVParticle *track)
1063{
1064 // Check single track cuts for a given cut step
1065 const Int_t kMCOffset = AliHFEcuts::kNcutStepsMCTrack;
1066 if(!fCFM->CheckParticleCuts(cutStep + kMCOffset, track)) return kFALSE;
1067 return kTRUE;
1068}
1069//_________________________________________
1070void AliAnalysisTaskElecHadronCorrel::SelectPhotonicElectron(Int_t itrack, AliESDtrack *track, Bool_t &fFlagPhotonicElec)
1071{
1072 //Identify non-heavy flavour electrons using Invariant mass method
520a29a8 1073
57189f04 1074 fTrackCuts1->SetAcceptKinkDaughters(kFALSE);
1075 fTrackCuts1->SetRequireTPCRefit(kTRUE);
1076 fTrackCuts1->SetEtaRange(-0.9,0.9);
1077 fTrackCuts1->SetRequireSigmaToVertex(kTRUE);
1078 fTrackCuts1->SetMaxChi2PerClusterTPC(3.5);
1079 fTrackCuts1->SetMinNClustersTPC(80);
520a29a8 1080
4e01b68c 1081 // const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
520a29a8 1082
57189f04 1083 Bool_t flagPhotonicElec = kFALSE;
487ae960 1084 Int_t NLS_plus=0, NLS_minus=0, NULS=0;
520a29a8 1085
57189f04 1086 for(Int_t jTracks = itrack+1; jTracks<fESD->GetNumberOfTracks(); jTracks++){
1087 AliESDtrack* trackAsso = fESD->GetTrack(jTracks);
1088 if (!trackAsso) {
1089 printf("ERROR: Could not receive track %d\n", jTracks);
1090 continue;
1091 }
520a29a8 1092
487ae960 1093 Double_t dEdxAsso = -999., ptAsso=-999., openingAngle = -999.,nsigma=-999.0;
520a29a8 1094 Double_t mass=-999., width = -999;
57189f04 1095 Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
520a29a8 1096
57189f04 1097 dEdxAsso = trackAsso->GetTPCsignal();
487ae960 1098 nsigma = fPID->GetPIDResponse() ? fPID->GetPIDResponse()->NumberOfSigmasTPC(trackAsso, AliPID::kElectron) : 1000;
57189f04 1099 ptAsso = trackAsso->Pt();
1100 Int_t chargeAsso = trackAsso->Charge();
1101 Int_t charge = track->Charge();
520a29a8 1102
57189f04 1103 if(ptAsso <0.3) continue;
3c56855b 1104 if(trackAsso->Eta()<-0.9 || trackAsso->Eta()>0.9) continue;
1105 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackAsso)) continue;
1106 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackAsso)) continue;
1107
1108 // if(!fTrackCuts1->AcceptTrack(trackAsso)) continue;
1109 // if(dEdxAsso <70 || dEdxAsso>100) continue; //11a pass1
487ae960 1110 if(nsigma < -3 || nsigma > 3) continue;
520a29a8 1111
57189f04 1112 Int_t fPDGe1 = 11; Int_t fPDGe2 = 11;
1113 if(charge>0) fPDGe1 = -11;
1114 if(chargeAsso>0) fPDGe2 = -11;
520a29a8 1115
57189f04 1116 if(charge == chargeAsso) fFlagLS = kTRUE;
1117 if(charge != chargeAsso) fFlagULS = kTRUE;
520a29a8 1118
1119 AliKFParticle ge1 = AliKFParticle(*track, fPDGe1);
1120 AliKFParticle ge2 = AliKFParticle(*trackAsso, fPDGe2);
57189f04 1121 AliKFParticle recg(ge1, ge2);
3c56855b 1122
57189f04 1123 if(recg.GetNDF()<1) continue;
1124 Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
1125 if(TMath::Sqrt(TMath::Abs(chi2recg))>3.) continue;
520a29a8 1126
57189f04 1127 openingAngle = ge1.GetAngle(ge2);
3c56855b 1128 // if(fFlagLS) fOpeningAngleLS->Fill(openingAngle);
1129 // if(fFlagULS) fOpeningAngleULS->Fill(openingAngle);
520a29a8 1130
3c56855b 1131 // if(openingAngle > fOpeningAngleCut) continue;
1132
1133 Int_t MassCorrect;
1134 MassCorrect = recg.GetMass(mass,width);
520a29a8 1135
487ae960 1136 if(fFlagLS){
1137 if(track->Charge() > 0 ) NLS_plus++;
1138 if(track->Charge() < 0 ) NLS_minus++;
1139 }
1140 if(fFlagULS) NULS++;
1141
1142 if(fFlagLS) {
1143 fInvmassLS1->Fill(mass);
1144 if(track->Pt()> 1) fInvmassLS2->Fill(mass);
1145 if(track->Pt()>2) fInvmassLS3->Fill(mass);
1146 if(track->Pt()>3) fInvmassLS4->Fill(mass);
1147 if(track->Pt()>4) fInvmassLS5->Fill(mass);
1148 }
1149 if(fFlagULS) {
1150 fInvmassULS1->Fill(mass);
1151 if(track->Pt() >1) fInvmassULS2->Fill(mass);
1152 if(track->Pt() >2) fInvmassULS3->Fill(mass);
1153 if(track->Pt() >3) fInvmassULS4->Fill(mass);
1154 if(track->Pt() >4) fInvmassULS5->Fill(mass);
1155 }
520a29a8 1156
520a29a8 1157 if(mass<fInvmassCut){
1158 if(fFlagULS)
1159 {
487ae960 1160 ElectronHadCorrel(itrack,track,fDphiULSMassLow, fDphiULSMassLow1,fDphiULSMassLow2,fDphiULSMassLow3,fDphiULSMassLow4);
520a29a8 1161 fULSElecPt->Fill(track->Pt());
3c56855b 1162// MixedEvent(track,fMixedDphiULSMassLow,fMixedDphiULSMassLow1,fMixedDphiULSMassLow2);
520a29a8 1163 }
1164 if(fFlagLS)
1165 {
487ae960 1166 ElectronHadCorrel(itrack,track,fDphiLSMassLow,fDphiLSMassLow1,fDphiLSMassLow2,fDphiLSMassLow3,fDphiLSMassLow4);
520a29a8 1167 fLSElecPt->Fill(track->Pt());
3c56855b 1168// MixedEvent(track,fMixedDphiLSMassLow,fMixedDphiLSMassLow1,fMixedDphiLSMassLow2);
520a29a8 1169 }
487ae960 1170 if(fFlagLS) ElectronHadCorrelNoPartner(itrack,jTracks,track,fDphiLSMassLowNoPartner, fDphiLSMassLowNoPartner1,fDphiLSMassLowNoPartner2,fDphiLSMassLowNoPartner3,fDphiLSMassLowNoPartner4);
1171 if(fFlagULS) ElectronHadCorrelNoPartner(itrack,jTracks,track,fDphiULSMassLowNoPartner, fDphiULSMassLowNoPartner1,fDphiULSMassLowNoPartner2,fDphiULSMassLowNoPartner3,fDphiULSMassLowNoPartner4);
57189f04 1172 }
520a29a8 1173
57189f04 1174 if(mass<fInvmassCut && fFlagULS && !flagPhotonicElec){
1175 flagPhotonicElec = kTRUE;
1176 }
520a29a8 1177 // }
1178
57189f04 1179 }
1180 fFlagPhotonicElec = flagPhotonicElec;
520a29a8 1181
3c56855b 1182// fNLSminus->Fill(NLS_minus);
1183// fNLSplus->Fill(NLS_plus);
1184// fNULS->Fill(NULS);
487ae960 1185
57189f04 1186}
1187//_________________________________________
487ae960 1188void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrel(Int_t itrack, AliESDtrack *track, TH2F *DphiPt, TH2F *DphiPt1,TH2F *DphiPt2,TH2F *DphiPt3,TH2F *DphiPt4)
57189f04 1189{
1190 //Construct Delta Phi between electrons and hadrons
520a29a8 1191
57189f04 1192 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1193 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1194 fTrackCuts2->SetRequireITSRefit(kTRUE);
1195 fTrackCuts2->SetEtaRange(-0.9,0.9);
1196 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1197 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1198 fTrackCuts2->SetMinNClustersTPC(80);
520a29a8 1199
57189f04 1200 for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
1201 AliESDtrack* trackHad = fESD->GetTrack(ktracks);
1202 if (!trackHad) {
1203 printf("ERROR: Could not receive track %d\n", ktracks);
1204 continue;
1205 }
1206 if(ktracks == itrack) continue; //do not select the same electron
520a29a8 1207
57189f04 1208 Double_t ptHad= -999, pHad=-999., dEdxHad = -999;
1209 Double_t ptEle = -999;
1210 Double_t phiEle = -999, phiHad = -999, Dphi = -999;
1211 Double_t pi = 3.14;
3c56855b 1212 Float_t IPxy=-999.0, IPz=-999.0;
520a29a8 1213
57189f04 1214 dEdxHad = trackHad->GetTPCsignal();
1215 ptHad = trackHad->Pt();
1216 pHad = trackHad->P();
4e01b68c 1217 ptEle = track->Pt();
3c56855b 1218 trackHad->GetImpactParameters(IPxy,IPz);
520a29a8 1219
487ae960 1220// if(ptHad <2) continue;
4e01b68c 1221 if(ptHad > ptEle) continue;
3c56855b 1222 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1223 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
1224 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
1225
1226// if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
487ae960 1227
3c56855b 1228 // fHadronIPxy->Fill(IPxy);
1229 // fHadronIPz->Fill(IPz);
487ae960 1230
3c56855b 1231 // if(TMath::Abs(IPxy)>2.5) continue;
1232 // fHadronPhi->Fill(trackHad->Phi());
4e01b68c 1233
57189f04 1234 phiEle = track->Phi();
1235 phiHad = trackHad->Phi();
1236 Dphi = phiEle - phiHad;
520a29a8 1237 if (Dphi > 3*pi/2)
57189f04 1238 Dphi = Dphi - 2*pi;
520a29a8 1239 if (Dphi < -pi/2)
57189f04 1240 Dphi = Dphi + 2*pi;
520a29a8 1241
487ae960 1242 if(ptHad>2) DphiPt->Fill(ptEle,Dphi);
1243 if(ptHad>2 && ptHad<4) DphiPt1->Fill(ptEle,Dphi);
1244 if(ptHad>4 && ptHad<6) DphiPt2->Fill(ptEle,Dphi);
1245 if(ptHad>6 && ptHad<8) DphiPt3->Fill(ptEle,Dphi);
1246 if(ptHad>8 && ptHad<10) DphiPt4->Fill(ptEle,Dphi);
4e01b68c 1247
57189f04 1248 }
1249}
1250//_________________________________________
487ae960 1251void AliAnalysisTaskElecHadronCorrel::ElectronHadCorrelNoPartner(Int_t itrack,Int_t jtrack, AliESDtrack *track, TH2F *DphiPtNew, TH2F *DphiPtNew1,TH2F *DphiPtNew2,TH2F *DphiPtNew3,TH2F *DphiPtNew4)
57189f04 1252{
520a29a8 1253 //Construct Delta Phi between electrons and hadrons for electrons from invariant mass calculation excluding associated track
57189f04 1254
520a29a8 1255 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1256 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1257 fTrackCuts2->SetRequireITSRefit(kTRUE);
1258 fTrackCuts2->SetEtaRange(-0.9,0.9);
1259 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1260 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1261 fTrackCuts2->SetMinNClustersTPC(80);
1262
1263 for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
1264 AliESDtrack* trackHad = fESD->GetTrack(ktracks);
1265 if (!trackHad) {
1266 printf("ERROR: Could not receive track %d\n", ktracks);
1267 continue;
1268 }
1269 if(ktracks == itrack || ktracks == jtrack) continue; //do not select the same electron and associated track from inv mass cal
1270
1271
1272 Double_t ptHad= -999, pHad=-999., dEdxHad = -999;
1273 Double_t ptEle = -999;
1274 Double_t phiEle = -999, phiHad = -999, Dphi = -999;
1275 Double_t pi = 3.14;
3c56855b 1276 Float_t IPxy=-999.0, IPz=-999.0;
520a29a8 1277
1278 dEdxHad = trackHad->GetTPCsignal();
1279 ptHad = trackHad->Pt();
1280 pHad = trackHad->P();
4e01b68c 1281 ptEle = track->Pt();
3c56855b 1282 trackHad->GetImpactParameters(IPxy,IPz);
520a29a8 1283
3c56855b 1284// if(ptHad <2) continue;
4e01b68c 1285 if(ptHad > ptEle) continue;
3c56855b 1286 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1287 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
1288 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
1289
1290// if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
1291// if(TMath::Abs(IPxy)>2.5) continue;
520a29a8 1292
1293 phiEle = track->Phi();
1294 phiHad = trackHad->Phi();
1295 Dphi = phiEle - phiHad;
1296 if (Dphi > 3*pi/2)
1297 Dphi = Dphi - 2*pi;
1298 if (Dphi < -pi/2)
1299 Dphi = Dphi + 2*pi;
57189f04 1300
487ae960 1301 if(ptHad>2) DphiPtNew->Fill(ptEle,Dphi);
1302 if(ptHad>2 && ptHad<4) DphiPtNew1->Fill(ptEle,Dphi);
1303 if(ptHad>4 && ptHad<6) DphiPtNew2->Fill(ptEle,Dphi);
1304 if(ptHad>6 && ptHad<8) DphiPtNew3->Fill(ptEle,Dphi);
1305 if(ptHad>8 && ptHad<10) DphiPtNew4->Fill(ptEle,Dphi);
520a29a8 1306 }
1307}
4e01b68c 1308/*
1309//_________________________________________
3c56855b 1310void AliAnalysisTaskElecHadronCorrel::MixedEvent(AliESDtrack *track, TH2F *DphiPt, TH2F *DphiPt1,TH2F *DphiPt2)
4e01b68c 1311{
1312
1313 const AliESDVertex *pVtx = fESD->GetPrimaryVertex();
1314 Double_t zVtx;
1315 zVtx = pVtx->GetZ();
1316
1317
1318 AliCentrality *fCentrality = (AliCentrality*)fESD->GetCentrality();
1319 Double_t centvalue = fCentrality->GetCentralityPercentile("V0M");
1320
1321 AliEventPool* pool = fPoolMgr->GetEventPool(centvalue, zVtx); // Get the buffer associated with the current centrality and z-vtx
1322 if (!pool)
1323 AliFatal(Form("No pool found for centrality = %f, zVtx = %f", centvalue, zVtx));
1324
1325 // pool->PrintInfo();
1326 if (pool->GetCurrentNEvents() >= 5) // start mixing when 5 events are in the buffer
1327 {
1328 Int_t nMix = pool->GetCurrentNEvents();
1329 fNoMixedEvents->Fill(0);
1330 fMixStat->Fill(pool->GetCurrentNEvents(),centvalue);
1331 fMixStat1->Fill(pool->GetCurrentNEvents(),zVtx);
1332
487ae960 1333 // cout << "nMix = " << nMix << " tracks in pool = " << pool->NTracksInPool() << endl;
3c56855b 1334 for (Int_t jMix=0; jMix<nMix; jMix++) // mix with each event in the buffer
4e01b68c 1335 {
1336 TObjArray* bgTracks = pool->GetEvent(jMix);
1337 for (Int_t i=0;i<bgTracks->GetEntriesFast(); i++)
1338 {
1339 AliVParticle* mixtrk = (AliVParticle*) bgTracks->At(i);
1340
1341 Double_t mixtrkPhi = -999;
1342 Double_t ptEle = -999;
1343 Double_t phiEle = -999, Dphi = -999;
1344 Double_t pi = 3.14;
1345 Double_t ptmixtrk = -999;
1346
1347 ptEle = track->Pt();
3c56855b 1348 ptmixtrk = mixtrk->Pt();
4e01b68c 1349 if(ptmixtrk > ptEle) continue;
1350
1351 mixtrkPhi = mixtrk->Phi();
1352 phiEle = track->Phi();
1353 Dphi = phiEle - mixtrkPhi;
1354
1355 if (Dphi > 3*pi/2)
1356 Dphi = Dphi - 2*pi;
1357 if (Dphi < -pi/2)
1358 Dphi = Dphi + 2*pi;
4e01b68c 1359 DphiPt->Fill(ptEle,Dphi);
3c56855b 1360 if(ptmixtrk>2 && ptmixtrk<4) DphiPt1->Fill(ptEle,Dphi);
1361 if(ptmixtrk>4 && ptmixtrk<6) DphiPt2->Fill(ptEle,Dphi);
4e01b68c 1362 }
1363 }
1364
1365 }
1366
1367}
1368//___________________________________________
1369TObjArray* AliAnalysisTaskElecHadronCorrel::CloneAndReduceTrackList()
1370{
3c56855b 1371 // clones a track list by using AliehDPhiBasicParticle which uses much less memory (used for event mixing)
4e01b68c 1372
1373 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1374 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1375 fTrackCuts2->SetRequireITSRefit(kTRUE);
1376 fTrackCuts2->SetEtaRange(-0.9,0.9);
1377 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1378 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1379 fTrackCuts2->SetMinNClustersTPC(80);
1380
1381 TObjArray* tracksClone = new TObjArray;
1382 tracksClone->SetOwner(kTRUE);
1383
1384 for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
1385 AliESDtrack* track = fESD->GetTrack(ktracks);
1386 if (!track) {
1387 printf("ERROR: Could not receive track %d\n", ktracks);
1388 continue;
1389 }
1390
1391 // if(ktracks == iTrack) continue;
3c56855b 1392 Double_t eta=-999,ptHad= -999, pHad=-999., phi=-999.0;
1393 Int_t label=-9999, id=-999;
1394 eta = track->Eta();
4e01b68c 1395 ptHad = track->Pt();
1396 pHad = track->P();
3c56855b 1397 phi= track->Phi();
1398 label= track->GetLabel();
1399 id=track->GetID();
4e01b68c 1400
1401 if(ptHad <2) continue;
1402 if(!fTrackCuts2->AcceptTrack(track)) continue;
1403
4e01b68c 1404 AliVParticle* particle = (AliVParticle*) fESD->GetTrack(ktracks);
3c56855b 1405 tracksClone->Add(new AliehDPhiBasicParticle(particle->Eta(), particle->Phi(), particle->Pt(), particle->Charge()));
1406
4e01b68c 1407 }
1408
1409 return tracksClone;
1410}
1411*/
3c56855b 1412//___________________________________________
1413void AliAnalysisTaskElecHadronCorrel::HadronInfo(Int_t itrack)
1414{
1415 //Hadron information
1416 fTrackCuts2->SetAcceptKinkDaughters(kFALSE);
1417 fTrackCuts2->SetRequireTPCRefit(kTRUE);
1418 fTrackCuts2->SetRequireITSRefit(kTRUE);
1419 fTrackCuts2->SetEtaRange(-0.9,0.9);
1420 fTrackCuts2->SetRequireSigmaToVertex(kTRUE);
1421 fTrackCuts2->SetMaxChi2PerClusterTPC(3.5);
1422 fTrackCuts2->SetMinNClustersTPC(80);
1423
1424 for(Int_t ktracks = 0; ktracks<fESD->GetNumberOfTracks(); ktracks++){
1425 AliESDtrack* trackHad = fESD->GetTrack(ktracks);
1426 if (!trackHad) {
1427 printf("ERROR: Could not receive track %d\n", ktracks);
1428 continue;
1429 }
1430
1431 if(ktracks == itrack) continue; //do not select the same electron
1432
1433 Double_t ptHad= -999;
1434 Float_t IPxy=-999.0, IPz=-999.0;
1435 ptHad = trackHad->Pt();
1436 trackHad->GetImpactParameters(IPxy,IPz);
1437
1438 if(trackHad->Eta()<-0.9 || trackHad->Eta()>0.9) continue;
1439 if(!ProcessCutStep(AliHFEcuts::kStepRecKineITSTPC, trackHad)) continue;
1440 if(!ProcessCutStep(AliHFEcuts::kStepHFEcutsTPC, trackHad)) continue;
1441
1442// if(!fTrackCuts2->AcceptTrack(trackHad)) continue;
1443 if(ptHad<2) continue;
1444
1445 fHadronPhi->Fill(trackHad->Phi());
1446 fHadronPhiPt->Fill(trackHad->Phi(),ptHad);
1447 if (trackHad->Eta() >0 && trackHad->Eta() <0.9) fHadronPhiTPChalf->Fill(trackHad->Phi());
1448
1449 fHadronIPxy->Fill(IPxy);
1450 fHadronIPz->Fill(IPz);
1451 fHadronPt->Fill(ptHad);
1452 }
1453}
1454//_________________________________________
1455void AliAnalysisTaskElecHadronCorrel::CheckCentrality(AliESDEvent* event, Bool_t &centralitypass)
1456{
1457 // Check if event is within the set centrality range. Falls back to V0 centrality determination if no method is set
1458 if (!fkCentralityMethod) AliFatal("No centrality method set! FATAL ERROR!");
1459 fCentrality = event->GetCentrality()->GetCentralityPercentile(fkCentralityMethod);
1460// cout << "--------------Centrality evaluated-------------------------"<<endl;
1461
1462 if ((fCentrality <= fCentralityMin) || (fCentrality > fCentralityMax))
1463 {
1464 fCentralityNoPass->Fill(fCentrality);
1465// cout << "--------------Fill no pass-------------------------"<<endl;
1466 centralitypass = kFALSE;
1467 }else
1468 {
1469 fCentralityPass->Fill(fCentrality);
1470// cout << "--------------Fill pass-------------------------"<<endl;
1471 centralitypass = kTRUE;
1472 }
1473
1474}
1475//_____________________________________________________________________________
1476void AliAnalysisTaskElecHadronCorrel::SetCentralityParameters(Double_t CentralityMin, Double_t CentralityMax, const char* CentralityMethod)
1477{
1478 // Set a centrality range ]min, max] and define the method to use for centrality selection
1479 fCentralityMin = CentralityMin;
1480 fCentralityMax = CentralityMax;
1481 fkCentralityMethod = CentralityMethod;
1482}