1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //////////////////////////////////////////////
18 // QA task for EMCAL electron analysis //
19 // Author: Deepa Thomas, Shingo Sakai //
20 //////////////////////////////////////////////
26 #include "THnSparse.h"
28 #include "AliAnalysisTask.h"
29 #include "AliAnalysisManager.h"
31 #include "AliESDEvent.h"
32 #include "AliESDInputHandler.h"
33 #include "AliESDtrackCuts.h"
34 #include "AliAODEvent.h"
35 #include "AliAODHandler.h"
38 #include "AliESDpid.h"
39 #include "AliAODPid.h"
40 #include "AliPIDResponse.h"
41 #include "AliHFEcontainer.h"
42 #include "AliHFEcuts.h"
43 #include "AliHFEpid.h"
44 #include "AliHFEpidBase.h"
45 #include "AliHFEpidQAmanager.h"
46 #include "AliHFEtools.h"
47 #include "AliCFContainer.h"
48 #include "AliCFManager.h"
50 #include "AliAnalysisTaskHFEemcQA.h"
55 ClassImp(AliAnalysisTaskHFEemcQA)
56 //________________________________________________________________________
57 AliAnalysisTaskHFEemcQA::AliAnalysisTaskHFEemcQA(const char *name)
58 : AliAnalysisTaskSE(name),
66 fCaloClusters_tender(0),
119 fvalueElectron = new Double_t[6];
120 // Define input and output slots here
121 // Input slot #0 works with a TChain
122 DefineInput(0, TChain::Class());
123 // Output slot #0 id reserved by the base class for AOD
124 // Output slot #1 writes into a TH1 container
125 DefineOutput(1, TList::Class());
127 //________________________________________________________________________
128 AliAnalysisTaskHFEemcQA::AliAnalysisTaskHFEemcQA()
129 : AliAnalysisTaskSE("DefaultTask_HfeEMCQA"),
137 fCaloClusters_tender(0),
153 fHistoCalCellTime(0),
188 //Default constructor
190 fvalueElectron = new Double_t[6];
191 // Define input and output slots here
192 // Input slot #0 works with a TChain
193 DefineInput(0, TChain::Class());
194 // Output slot #0 id reserved by the base class for AOD
195 // Output slot #1 writes into a TH1 container
196 // DefineOutput(1, TH1I::Class());
197 DefineOutput(1, TList::Class());
198 //DefineOutput(3, TTree::Class());
200 //________________________________________________________________________
201 AliAnalysisTaskHFEemcQA::~AliAnalysisTaskHFEemcQA()
205 delete fTracks_tender;
206 delete fCaloClusters_tender;
207 delete fSparseElectron;
208 delete []fvalueElectron;
210 //________________________________________________________________________
211 void AliAnalysisTaskHFEemcQA::UserCreateOutputObjects()
215 AliDebug(3, "Creating Output Objects");
217 /////////////////////////////////////////////////
218 //Automatic determination of the analysis mode//
219 ////////////////////////////////////////////////
220 AliVEventHandler *inputHandler = dynamic_cast<AliVEventHandler *>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
221 if(!TString(inputHandler->IsA()->GetName()).CompareTo("AliAODInputHandler")){
226 printf("Analysis Mode: %s Analysis\n", IsAODanalysis() ? "AOD" : "ESD");
231 fOutputList = new TList();
232 fOutputList->SetOwner();
234 fNevents = new TH1F("fNevents","No of events",3,-0.5,2.5);
235 fOutputList->Add(fNevents);
236 fNevents->GetYaxis()->SetTitle("counts");
237 fNevents->GetXaxis()->SetBinLabel(1,"All");
238 fNevents->GetXaxis()->SetBinLabel(2,"With >2 Trks");
239 fNevents->GetXaxis()->SetBinLabel(3,"Vtx_{z}<10cm");
241 fVtxZ = new TH1F("fVtxZ","Z vertex position;Vtx_{z};counts",1000,-50,50);
242 fOutputList->Add(fVtxZ);
244 fVtxY = new TH1F("fVtxY","Y vertex position;Vtx_{y};counts",1000,-50,50);
245 fOutputList->Add(fVtxY);
247 fVtxX = new TH1F("fVtxX","X vertex position;Vtx_{x};counts",1000,-50,50);
248 fOutputList->Add(fVtxX);
250 fTrigMulti = new TH2F("fTrigMulti","Multiplicity distribution for different triggers; Trigger type; multiplicity",11,-1,10,2000,0,2000);
251 fOutputList->Add(fTrigMulti);
253 fHistClustE = new TH1F("fHistClustE", "EMCAL cluster energy distribution; Cluster E;counts", 5000, 0.0, 50.0);
254 fOutputList->Add(fHistClustE);
256 fEMCClsEtaPhi = new TH2F("fEMCClsEtaPhi","EMCAL cluster #eta and #phi distribution;#eta;#phi",100,-0.9,0.9,200,0,6.3);
257 fOutputList->Add(fEMCClsEtaPhi);
259 fHistoNCls = new TH1F("fHistoNCls","No of EMCAL cluster in the event;N^{EMC}_{cls};counts",150,0,150);
260 fOutputList->Add(fHistoNCls);
262 fHistoNClsE1 = new TH1F("fHistoNClsE1","No of EMCAL cluster in the event (E>0.1 GeV);N^{EMC}_{cls};counts",150,0,150);
263 fOutputList->Add(fHistoNClsE1);
265 fHistoNClsE2 = new TH1F("fHistoNClsE2","No of EMCAL cluster in the event (E>0.2 GeV);N^{EMC}_{cls};counts",150,0,150);
266 fOutputList->Add(fHistoNClsE2);
268 fHistoNClsE3 = new TH1F("fHistoNClsE3","No of EMCAL cluster in the event (E>0.5 GeV);N^{EMC}_{cls};counts",150,0,150);
269 fOutputList->Add(fHistoNClsE3);
271 //fHistoNCells = new TH1F("fHistoNCells","No of EMCAL cells in a cluster;N^{EMC}_{cells};counts",30,0,30);
272 fHistoNCells = new TH2F("fHistoNCells","No of EMCAL cells in a cluster;Cluster E;N^{EMC}_{cells}",300,0,30,30,0,30);
273 fOutputList->Add(fHistoNCells);
275 fHistoCalCell = new TH2F("fHistoCalCell","EMCAL cells in a cluster;cell ID;E (GeV)",15000,-0.5,14999.5,600,0,30);
276 fOutputList->Add(fHistoCalCell);
278 fHistoCalTime = new TH2F("fHistoCalTime","Cluster Time; p_{T} (GeV/c); Time (s)",300,0,30,1000,1e-8,1e-5);
279 fOutputList->Add(fHistoCalTime);
281 fHistoCalCellTime = new TH2F("fHistoCalCellTime","Cell Time; ID; Time (s)",15000,-0.5,14999.5,1000,1e-8,1e-5);
282 fOutputList->Add(fHistoCalCellTime);
284 fNegTrkIDPt = new TH1F("fNegTrkIDPt", "p_{T} distribution of tracks with negative track id;p_{T} (GeV/c);counts", 500, 0.0, 50.0);
285 fOutputList->Add(fNegTrkIDPt);
287 fTrkPt = new TH1F("fTrkPt","p_{T} distribution of all tracks;p_{T} (GeV/c);counts",1000,0,100);
288 fOutputList->Add(fTrkPt);
290 fTrketa = new TH1F("fTrketa","All Track #eta distribution;#eta;counts",100,-1.5,1.5);
291 fOutputList->Add(fTrketa);
293 fTrkphi = new TH1F("fTrkphi","All Track #phi distribution;#phi;counts",100,0,6.3);
294 fOutputList->Add(fTrkphi);
296 fdEdx = new TH2F("fdEdx","All Track dE/dx distribution;p (GeV/c);dE/dx",200,0,20,500,0,160);
297 fOutputList->Add(fdEdx);
299 fTPCNpts = new TH2F("fTPCNpts","All track TPC Npoints used for dE/dx calculation;p (GeV/c);N points",200,0,20,200,0.,200.);
300 fOutputList->Add(fTPCNpts);
302 fTPCnsig = new TH2F("fTPCnsig","All Track TPC Nsigma distribution;p (GeV/c);#sigma_{TPC-dE/dx}",1000,0,50,200,-10,10);
303 fOutputList->Add(fTPCnsig);
305 fHistPtMatch = new TH1F("fHistPtMatch", "p_{T} distribution of tracks matched to EMCAL;p_{T} (GeV/c);counts",1000, 0.0, 100.0);
306 fOutputList->Add(fHistPtMatch);
308 fEMCTrkMatch = new TH2F("fEMCTrkMatch","Distance of EMCAL cluster to its closest track;#phi;z",100,-0.3,0.3,100,-0.3,0.3);
309 fOutputList->Add(fEMCTrkMatch);
311 fEMCTrkPt = new TH1F("fEMCTrkPt","p_{T} distribution of tracks with EMCAL cluster;p_{T} (GeV/c);counts",1000,0,100);
312 fOutputList->Add(fEMCTrkPt);
314 fEMCTrketa = new TH1F("fEMCTrketa","#eta distribution of tracks matched to EMCAL;#eta;counts",100,-1.5,1.5);
315 fOutputList->Add(fEMCTrketa);
317 fEMCTrkphi = new TH1F("fEMCTrkphi","#phi distribution of tracks matched to EMCAL;#phi;counts",100,0,6.3);
318 fOutputList->Add(fEMCTrkphi);
320 fEMCdEdx = new TH2F("fEMCdEdx","dE/dx distribution of tracks matched to EMCAL;p (GeV/c);dE/dx",200,0,20,500,0,160);
321 fOutputList->Add(fEMCdEdx);
323 fEMCTPCnsig = new TH2F("fEMCTPCnsig","TPC Nsigma distribution of tracks matched to EMCAL;p (GeV/c);#sigma_{TPC-dE/dx}",1000,0,50,200,-10,10);
324 fOutputList->Add(fEMCTPCnsig);
326 fEMCTPCNpts = new TH2F("fEMCTPCNpts","TPC Npoints used for dE/dx for tracks matched to EMCAL;p (GeV/c);N points",200,0,20,200,0.,200.);
327 fOutputList->Add(fEMCTPCNpts);
329 fClsEAftMatch = new TH1F("fClsEAftMatch", "EMCAL cluster energy distribution after track matching; Cluster E;counts", 500, 0.0, 50.0);
330 fOutputList->Add(fClsEAftMatch);
332 fHistEop = new TH2F("fHistEop", "E/p distribution;p_{T} (GeV/c);E/p", 200,0,20,60, 0.0, 3.0);
333 fOutputList->Add(fHistEop);
335 fHistdEdxEop = new TH2F("fHistdEdxEop", "E/p vs dE/dx;E/p;dE/dx", 60, 0.0, 3.0, 500,0,160);
336 fOutputList->Add(fHistdEdxEop);
338 fHistNsigEop = new TH2F ("fHistNsigEop", "E/p vs TPC nsig",60, 0.0, 3.0, 200, -10,10);
339 fOutputList->Add(fHistNsigEop);
341 fM20 = new TH2F ("fM20","M20 vs pt distribution",200,0,20,400,0,2);
342 fOutputList->Add(fM20);
344 fM02 = new TH2F ("fM02","M02 vs pt distribution",200,0,20,400,0,2);
345 fOutputList->Add(fM02);
347 fM20EovP = new TH2F ("fM20EovP","M20 vs E/p distribution",400,0,3,400,0,2);
348 fOutputList->Add(fM20EovP);
350 fM02EovP = new TH2F ("fM02EovP","M02 vs E/p distribution",400,0,3,400,0,2);
351 fOutputList->Add(fM02EovP);
353 fEleCanTPCNpts = new TH2F("fEleCanTPCNpts","TPC Npoints used for dE/dx for electron candidates;p_{T} (GeV/c);N points",200,0,20,200,0,200);
354 fOutputList->Add(fEleCanTPCNpts);
356 fEleCanTPCNCls = new TH2F("fEleCanTPCNCls","TPC N clusters for electron candidates;p_{T} (GeV/c);N TPC clusters",200,0,20,171,-0.5,170.5);
357 fOutputList->Add(fEleCanTPCNCls);
359 fEleCanITSNCls = new TH2F("fEleCanITSNCls","ITS N clusters for electron candidates;p_{T} (GeV/c);N ITS clusters",200,0,20,8,-0.5,7.5);
360 fOutputList->Add(fEleCanITSNCls);
362 fEleCanITShit = new TH1F("fEleCanITShit","ITS hit map;ITS layer;counts",7,-0.5,6.5);
363 fOutputList->Add(fEleCanITShit);
365 fEleCanSPD1 = new TH2F("fEleCanSPD1","Hit on SPD layer 1;p_{T} (GeV/c);Hit",200,0,20,1,0,1);
366 fOutputList->Add(fEleCanSPD1);
368 fEleCanSPD2 = new TH2F("fEleCanSPD2","Hit on SPD layer 2;p_{T} (GeV/c);Hit",200,0,20,1,0,1);
369 fOutputList->Add(fEleCanSPD2);
371 fEleCanSPDBoth = new TH2F("fEleCanSPDBoth","Tracks with hits on both SPD layer;p_{T} (GeV/c);Hit",200,0,20,1,0,1);
372 fOutputList->Add(fEleCanSPDBoth);
374 fEleCanSPDOr = new TH2F("fEleCanSPDOr","Tracks with hits on both SPD layer;p_{T} (GeV/c);Hit",200,0,20,1,0,1);
375 fOutputList->Add(fEleCanSPDOr);
377 Int_t bins[6]={8,500,200,400,400,400}; //trigger, pt, TPCnsig, E/p, M20, M02
378 Double_t xmin[6]={-0.5,0,-10,0,0,0};
379 Double_t xmax[6]={7.5,25,10,2,2,2};
380 fSparseElectron = new THnSparseD ("Electron","Electron",6,bins,xmin,xmax);
381 fOutputList->Add(fSparseElectron);
383 PostData(1,fOutputList);
386 //________________________________________________________________________
387 void AliAnalysisTaskHFEemcQA::UserExec(Option_t *)
390 // Called for each event
393 UInt_t evSelMask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
395 fVevent = dynamic_cast<AliVEvent*>(InputEvent());
397 printf("ERROR: fVEvent not available\n");
401 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
403 // printf("fESD available\n");
411 //new branches with calibrated tracks and clusters
412 if(IsAODanalysis()) fTracks_tender = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject("AODFilterTracks"));
413 if(!IsAODanalysis()) fTracks_tender = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject("ESDFilterTracks"));
415 fCaloClusters_tender = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject("EmcCaloClusters"));
421 AliESDtrackCuts* esdTrackCutsH = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE);
422 esdTrackCutsH->SetMaxDCAToVertexXY(2.4);
423 esdTrackCutsH->SetMaxDCAToVertexZ(3.2);
424 esdTrackCutsH->SetDCAToVertex2D(kTRUE);
426 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
428 // printf("fAOD available\n");
435 fpidResponse = fInputHandler->GetPIDResponse();
440 Int_t ntracks = -999;
441 if(!fUseTender)ntracks = fVevent->GetNumberOfTracks();
442 if(fUseTender) ntracks = fTracks_tender->GetEntries();
443 if(ntracks < 1) printf("There are %d tracks in this event\n",ntracks);
445 fNevents->Fill(0); //all events
446 Double_t Zvertex = -100, Xvertex = -100, Yvertex = -100;
447 const AliVVertex *pVtx = fVevent->GetPrimaryVertex();
448 Double_t NcontV = pVtx->GetNContributors();
450 fNevents->Fill(1); //events with 2 tracks
452 Zvertex = pVtx->GetZ();
453 Yvertex = pVtx->GetY();
454 Xvertex = pVtx->GetX();
455 fVtxZ->Fill(Zvertex);
456 fVtxX->Fill(Xvertex);
457 fVtxY->Fill(Yvertex);
462 TString firedTrigger;
463 TString TriggerEG1("EG1");
464 TString TriggerEG2("EG2");
465 fVevent->GetFiredTriggerClasses();
467 Bool_t EG1tr = kFALSE;
468 Bool_t EG2tr = kFALSE;
470 if(firedTrigger.Contains(TriggerEG1))EG1tr = kTRUE;
471 if(firedTrigger.Contains(TriggerEG2))EG2tr = kTRUE;
475 //Double_t multiplicity=fAOD->GetHeader()->GetRefMultiplicity();
476 AliAODHeader *header = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
477 if(!header) AliFatal("Not a standard AOD");
478 Double_t multiplicity = header->GetRefMultiplicity();
480 fTrigMulti->Fill(-0.5, multiplicity);
481 if(evSelMask & AliVEvent::kAny) fTrigMulti->Fill(0.5, multiplicity);
482 if(evSelMask & AliVEvent::kMB) fTrigMulti->Fill(1.5, multiplicity);
483 if(evSelMask & AliVEvent::kINT7) fTrigMulti->Fill(2.5, multiplicity);
484 if(evSelMask & AliVEvent::kINT8) fTrigMulti->Fill(3.5, multiplicity);
485 if(evSelMask & AliVEvent::kEMC1) fTrigMulti->Fill(4.5, multiplicity);
486 if(evSelMask & AliVEvent::kEMC7) fTrigMulti->Fill(5.5, multiplicity);
487 if(evSelMask & AliVEvent::kEMC8) fTrigMulti->Fill(6.5, multiplicity);
488 if(evSelMask & AliVEvent::kEMCEJE) fTrigMulti->Fill(7.5, multiplicity);
489 if(evSelMask & AliVEvent::kEMCEGA) fTrigMulti->Fill(8.5, multiplicity);
490 if(evSelMask & AliVEvent::kEMCEGA & EG2tr) fTrigMulti->Fill(9.5, multiplicity);
492 if(evSelMask & AliVEvent::kMB) trigger =0;
493 if(evSelMask & AliVEvent::kINT7) trigger =1;
494 if(evSelMask & AliVEvent::kINT8) trigger =2;
495 if(evSelMask & AliVEvent::kEMC1) trigger =3;
496 if(evSelMask & AliVEvent::kEMC7) trigger =4;
497 if(evSelMask & AliVEvent::kEMC8) trigger =5;
498 if(evSelMask & AliVEvent::kEMCEJE) trigger =6;
499 if(evSelMask & AliVEvent::kEMCEGA) trigger =7;
505 if(fabs(Zvertex>10.0))return;
506 fNevents->Fill(2); //events after z vtx cut
508 /////////////////////////////
509 //EMCAL cluster information//
510 ////////////////////////////
512 if(!fUseTender) Nclust = fVevent->GetNumberOfCaloClusters();
513 if(fUseTender) Nclust = fCaloClusters_tender->GetEntries();
516 int NclustE1 = 0; //# of clust E>0.1
517 int NclustE2 = 0; //# of clust E>0.2
518 int NclustE3 = 0; //# of clust E>0.5
520 for(Int_t icl=0; icl<Nclust; icl++)
522 AliVCluster *clust = 0x0;
523 if(!fUseTender) clust = fVevent->GetCaloCluster(icl);
524 if(fUseTender) clust = dynamic_cast<AliVCluster*>(fCaloClusters_tender->At(icl));
525 if(!clust) printf("ERROR: Could not receive cluster matched calibrated from track %d\n", icl);
527 if(clust && clust->IsEMCAL())
529 Double_t clustE = clust->E();
530 Float_t emcx[3]; // cluster pos
531 clust->GetPosition(emcx);
532 TVector3 clustpos(emcx[0],emcx[1],emcx[2]);
533 Double_t emcphi = clustpos.Phi();
534 Double_t emceta = clustpos.Eta();
535 fHistClustE->Fill(clustE);
536 fEMCClsEtaPhi->Fill(emceta,emcphi);
537 fHistoNCells->Fill(clustE,clust->GetNCells());
538 //fHistoNCells->Fill(clust->GetNCells());
540 double emctof = clust->GetTOF();
541 fHistoCalTime->Fill(clustE,emctof);
544 if(clustE>0.1)NclustE1++;
545 if(clustE>0.2)NclustE2++;
546 if(clustE>0.5)NclustE3++;
550 fHistoNCls->Fill(NclustAll);
551 fHistoNClsE1->Fill(NclustE1);
552 fHistoNClsE2->Fill(NclustE2);
553 fHistoNClsE3->Fill(NclustE3);
556 AliVCaloCells *fCaloCells = fVevent->GetEMCALCells();
558 //Int_t nSACell, iSACell, mclabel;
559 Short_t cellAddr, nSACell;
562 Double_t cellAmp=-1., cellTimeT=-1., efrac=-1.;
564 nSACell = fCaloCells->GetNumberOfCells();
565 for(iSACell = 0; iSACell < nSACell; iSACell++ ){
566 Bool_t haveCell = fCaloCells->GetCell(iSACell, cellAddr, cellAmp, cellTimeT , mclabel, efrac);
567 //virtual Bool_t GetCell(Short_t pos, Short_t &cellNumber, Double_t &litude, Double_t &time, Int_t &mclabel, Double_t &efrac)
570 fHistoCalCell->Fill(cellAddr,cellAmp);
571 fHistoCalCellTime->Fill(cellAddr,cellTimeT);
575 /////////////////////////////////
576 //Look for kink mother for AOD//
577 /////////////////////////////////
578 Int_t numberofvertices = 100;
579 if(fAOD) numberofvertices = fAOD->GetNumberOfVertices();
580 Double_t listofmotherkink[numberofvertices];
581 Int_t numberofmotherkink = 0;
584 for(Int_t ivertex=0; ivertex < numberofvertices; ivertex++) {
585 AliAODVertex *aodvertex = fAOD->GetVertex(ivertex);
586 if(!aodvertex) continue;
587 if(aodvertex->GetType()==AliAODVertex::kKink) {
588 AliAODTrack *mother = (AliAODTrack *) aodvertex->GetParent();
589 if(!mother) continue;
590 Int_t idmother = mother->GetID();
591 listofmotherkink[numberofmotherkink] = idmother;
592 numberofmotherkink++;
601 for (Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
603 AliVParticle* Vtrack = 0x0;
604 if(!fUseTender) Vtrack = fVevent->GetTrack(iTracks);
605 if(fUseTender) Vtrack = dynamic_cast<AliVTrack*>(fTracks_tender->At(iTracks));
608 printf("ERROR: Could not receive track %d\n", iTracks);
611 AliVTrack *track = dynamic_cast<AliVTrack*>(Vtrack);
612 AliESDtrack *etrack = dynamic_cast<AliESDtrack*>(Vtrack);
613 AliAODTrack *atrack = dynamic_cast<AliAODTrack*>(Vtrack);
619 if(!atrack->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)) continue; //mimimum cuts
622 if(!esdTrackCutsH->AcceptTrack(etrack))continue;
626 Bool_t kinkmotherpass = kTRUE;
627 for(Int_t kinkmother = 0; kinkmother < numberofmotherkink; kinkmother++) {
628 if(track->GetID() == listofmotherkink[kinkmother]) {
629 kinkmotherpass = kFALSE;
633 if(!kinkmotherpass) continue;
636 if(etrack->GetKinkIndex(0) != 0) continue;
642 Double_t dEdx =-999, fTPCnSigma=-999;
643 dEdx = track->GetTPCsignal();
644 fTPCnSigma = fpidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
646 if(track->GetID()<0) fNegTrkIDPt->Fill(track->Pt());
647 fTrkPt->Fill(track->Pt());
648 fTrketa->Fill(track->Eta());
649 fTrkphi->Fill(track->Phi());
650 fdEdx->Fill(track->P(),dEdx);
651 fTPCNpts->Fill(track->P(),track->GetTPCsignalN());
652 fTPCnsig->Fill(track->P(),fTPCnSigma);
654 ///////////////////////////
655 //Track matching to EMCAL//
656 //////////////////////////
657 Int_t EMCalIndex = -1;
658 EMCalIndex = track->GetEMCALcluster();
659 if(EMCalIndex < 0) continue;
660 fHistPtMatch->Fill(track->Pt());
662 AliVCluster *clustMatch=0x0;
663 if(!fUseTender) clustMatch = (AliVCluster*)fVevent->GetCaloCluster(EMCalIndex);
664 if(fUseTender) clustMatch = dynamic_cast<AliVCluster*>(fCaloClusters_tender->At(EMCalIndex));
666 if(clustMatch && clustMatch->IsEMCAL())
668 /////////////////////////////////////////////
669 //Properties of tracks matched to the EMCAL//
670 /////////////////////////////////////////////
671 fEMCTrkMatch->Fill(clustMatch->GetTrackDx(),clustMatch->GetTrackDz());
672 if(TMath::Abs(clustMatch->GetTrackDx())>0.05 || TMath::Abs(clustMatch->GetTrackDz())>0.05) continue;
674 fEMCTrkPt->Fill(track->Pt());
675 fEMCTrketa->Fill(track->Eta());
676 fEMCTrkphi->Fill(track->Phi());
677 fEMCdEdx->Fill(track->P(),dEdx);
678 fEMCTPCnsig->Fill(track->P(),fTPCnSigma);
679 fEMCTPCNpts->Fill(track->P(),track->GetTPCsignalN());
681 Double_t clustMatchE = clustMatch->E();
682 fClsEAftMatch->Fill(clustMatchE);
686 Double_t m02 = -99999;
687 if(track->P()>0)eop = clustMatchE/track->P();
688 m02 =clustMatch->GetM02();
691 fHistdEdxEop->Fill(eop,dEdx);
692 fHistNsigEop->Fill(eop,fTPCnSigma);
693 fM20EovP->Fill(eop,clustMatch->GetM20());
694 fM02EovP->Fill(eop,clustMatch->GetM02());
697 fHistEop->Fill(track->Pt(),eop);
698 fM20->Fill(track->Pt(),clustMatch->GetM20());
699 fM02->Fill(track->Pt(),clustMatch->GetM02());
702 fvalueElectron[0] = trigger;
703 fvalueElectron[1] = track->Pt();
704 fvalueElectron[2] = fTPCnSigma;
705 fvalueElectron[3] = eop;
706 fvalueElectron[4] = clustMatch->GetM20();
707 fvalueElectron[5] = clustMatch->GetM02();
710 //cout << "filling sparse"<<endl;
711 fSparseElectron->Fill(fvalueElectron);
714 ////////////////////////////////////////////////
715 //Track properties of EMCAL electron cadidates//
716 ///////////////////////////////////////////////
717 if(fTPCnSigma > -1 && fTPCnSigma < 3 && eop>0.9 && eop<1.2 && m02 > 0.006 && m02 < 0.35){
718 fEleCanTPCNpts->Fill(track->Pt(),track->GetTPCsignalN());
719 fEleCanTPCNCls->Fill(track->Pt(),track->GetTPCNcls());
722 for(Int_t l=0;l<6;l++) {
723 if(TESTBIT(track->GetITSClusterMap(),l)) {
724 fEleCanITShit->Fill(l);
725 if(l==0) fEleCanSPD1->Fill(track->Pt(),0.5);
726 if(l==1) fEleCanSPD2->Fill(track->Pt(),0.5);
727 if(l==0 && l==1) fEleCanSPDBoth->Fill(track->Pt(),0.5);
728 if(l==0 || l==1) fEleCanSPDOr->Fill(track->Pt(),0.5);
732 fEleCanITSNCls->Fill(track->Pt(),fITSncls++);
737 PostData(1, fOutputList);
739 //________________________________________________________________________
740 void AliAnalysisTaskHFEemcQA::Terminate(Option_t *)
742 // Draw result to the screen
743 // Called once at the end of the query
745 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
747 printf("ERROR: Output list not available\n");