1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: Satyajit Jena. *
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 //=========================================================================//
19 // Analysis Task for Net-Charge Higher Moment Analysis //
20 // Author: Satyajit Jena || Nirbhay K. Behera //
21 // sjena@cern.ch || nbehera@cern.ch //
23 //=========================================================================//
32 #include "THnSparse.h"
35 #include "AliAnalysisTaskSE.h"
36 #include "AliAnalysisManager.h"
38 #include "AliESDVertex.h"
39 #include "AliESDEvent.h"
40 #include "AliESDInputHandler.h"
41 #include "AliAODEvent.h"
42 #include "AliAODTrack.h"
43 #include "AliAODInputHandler.h"
45 #include "AliESDEvent.h"
46 #include "AliAODEvent.h"
48 #include "AliESDtrackCuts.h"
49 #include "AliAODMCHeader.h"
50 #include "AliAODMCParticle.h"
51 #include "AliMCEventHandler.h"
52 #include "AliMCEvent.h"
54 #include "AliGenHijingEventHeader.h"
55 #include "AliGenEventHeader.h"
57 #include "AliAODPid.h"
58 #include "AliPIDResponse.h"
59 #include "AliAODpidUtil.h"
60 #include "AliPIDCombined.h"
62 #include "AliEbyEHigherMomentsTask.h"
67 ClassImp(AliEbyEHigherMomentsTask)
70 //-----------------------------------------------------------------------
71 AliEbyEHigherMomentsTask::AliEbyEHigherMomentsTask( const char *name )
72 : AliAnalysisTaskSE( name ),
77 fParticleSpecies(AliPID::kProton),
79 fCentralityEstimator("V0M"),
100 fTHnCentNplusNminusCh(0),
101 fTHnCentNplusNminusChTruth(0),
102 fTHnCentNplusNminus(0)
105 for ( Int_t i = 0; i < 13; i++) {
109 for ( Int_t i = 0; i < 5; i++ ){
110 fTHnCentNplusNminusPid[i] = NULL;
111 fTHnCentNplusNminusPidTruth[i] = NULL;
114 DefineOutput(1, TList::Class()); // Outpput....
115 //DefineOutput(2, TList::Class());
118 AliEbyEHigherMomentsTask::~AliEbyEHigherMomentsTask() {
119 //if(fListOfHistosQA) delete fListOfHistosQA;
120 if(fListOfHistos) delete fListOfHistos;
124 //---------------------------------------------------------------------------------
125 void AliEbyEHigherMomentsTask::UserCreateOutputObjects() {
127 // fListOfHistosQA = new TList();
128 //fListOfHistosQA->SetOwner(kTRUE);
129 fListOfHistos = new TList();
130 fListOfHistos->SetOwner(kTRUE);
132 fEventCounter = new TH1D("fEventCounter","EventCounter", 10, 0.5,10.5);
133 fEventCounter->GetXaxis()->SetBinLabel(1,"Event Accesed");
134 fEventCounter->GetXaxis()->SetBinLabel(2,"Within 0-90% centrality");
135 fEventCounter->GetXaxis()->SetBinLabel(5,"Have a vertex");
136 fEventCounter->GetXaxis()->SetBinLabel(6,"After vertex Cut");
137 fEventCounter->GetXaxis()->SetBinLabel(7,"Event Analyzed");
138 fEventCounter->GetXaxis()->SetBinLabel(8,"Event Analysis finished");
139 fListOfHistos->Add(fEventCounter);
142 fHistQA[0] = new TH1D("fHistQAvx", "Histo Vx After Cut", 400, -4., 4.);
143 fHistQA[1] = new TH1D("fHistQAvy", "Histo Vy After Cut", 400, -4., 4.);
144 fHistQA[2] = new TH1D("fHistQAvz", "Histo Vz After Cut", 500, -25., 25.);
145 fHistQA[3] = new TH1D("fHistQAvxA", "Histo Vx All", 500, -5., 5.);
146 fHistQA[4] = new TH1D("fHistQAvyA", "Histo Vy All", 500, -5., 5.);
147 fHistQA[5] = new TH1D("fHistQAvzA", "Histo Vz All", 500, -25., 25.);
148 fHistQA[6] = new TH1D("fHistQADcaXyC", "Histo DCAxy after cut", 500, -5., 5.);
149 fHistQA[7] = new TH1D("fHistQADcaZC", "Histo DCAz after cut", 500, -5., 5.);
150 fHistQA[8] = new TH1D("fHistQAPt","p_{T} distribution",600,0,6);
151 fHistQA[9] = new TH1D("fHistQAEta","#eta distribution",240,-1.2,1.2);
152 fHistQA[10] = new TH1D("fHistQAPhi","#phi distribution",340,0,6.8);
153 fHistQA[11] = new TH1D("fHistQANCls","Number of TPC cluster",200,0,200);
154 fHistQA[12] = new TH1D("fHistQAChi2","Chi2 per NDF",100,0,10);
155 for(Int_t i = 0; i < 13; i++)
157 fListOfHistos->Add(fHistQA[i]);
160 fHistDCA = new TH2D("fHistDCA","DCAxy Vs DCAz", 500, -5., 5., 500, -5., 5.);
161 fTPCSig = new TH2D("fTPCSig","TPC signal",200, 0.0, 10. ,1000,0.,1000);
162 fTPCSig->SetMarkerColor(kRed);
163 fTPCSigA = new TH2D("fTPCSigA","TPC signal all ",200, 0.0, 10. ,1000,0.,1000);
164 fListOfHistos->Add(fHistDCA);
165 fListOfHistos->Add(fTPCSig);
166 fListOfHistos->Add(fTPCSigA);
168 const Int_t nDim = 3;
169 const Int_t nPid = 5;
170 TString Species[nPid] = {"Electron","Muon","Pion","Kaon","Proton"};
172 Int_t fBins[nPid][nDim];
173 Double_t fMin[nPid][nDim];
174 Double_t fMax[nPid][nDim];
176 for( Int_t i = 0; i < nPid; i++ ){
177 for( Int_t j = 0; j < nDim; j++ ){
185 Int_t fBinsCh[nDim] = {100, 1500, 1500};
186 Double_t fMinCh[nDim] = { -0.5, -0.5, -0.5 };
187 Double_t fMaxCh[nDim] = { 99.5, 1499.5, 1499.5};
189 fTHnCentNplusNminusCh = new THnSparseD("fTHnCentNplusNminusCh","Cent-NplusChrg-NminusChrg", nDim, fBinsCh, fMinCh, fMaxCh);
190 fTHnCentNplusNminusCh->GetAxis(0)->SetTitle("Centrality");
191 fTHnCentNplusNminusCh->GetAxis(1)->SetTitle("Nplus");
192 fTHnCentNplusNminusCh->GetAxis(2)->SetTitle("Nminus");
193 fListOfHistos->Add(fTHnCentNplusNminusCh);
195 if( fAnalysisType == "MCAOD" ){
197 fTHnCentNplusNminusChTruth = new THnSparseD("fTHnCentNplusNminusChTruth","Cent-NplusChrg-NminusChrg", nDim, fBinsCh, fMinCh, fMaxCh);
198 fTHnCentNplusNminusChTruth->GetAxis(0)->SetTitle("Centrality");
199 fTHnCentNplusNminusChTruth->GetAxis(1)->SetTitle("Nplus");
200 fTHnCentNplusNminusChTruth->GetAxis(2)->SetTitle("Nminus");
201 fListOfHistos->Add(fTHnCentNplusNminusChTruth);
206 TString hname1, hname11;
207 TString htitle1, axisTitle1, axisTitle2;
212 Int_t gPid = (Int_t)fParticleSpecies;
214 if( gPid > 1 && gPid < 5 ){
216 fBins[2][0] = 100; fBins[2][1] = 1000; fBins[2][2] = 1000;
217 fMin[2][0] = -0.5; fMin[2][1] = -0.5; fMin[2][2] = -0.5;
218 fMax[2][0] = 99.5; fMax[2][1] = 999.5; fMax[2][2] = 999.5;
220 fBins[3][0] = 100; fBins[3][1] = 600; fBins[3][2] = 600;
221 fMin[3][0] = -0.5; fMin[3][1] = -0.5; fMin[3][2] = -0.5;
222 fMax[3][0] = 99.5; fMax[3][1] = 599.5; fMax[3][2] = 599.5;
224 fBins[4][0] = 100; fBins[4][1] = 400; fBins[4][2] = 400;
225 fMin[4][0] = -0.5; fMin[4][1] = -0.5; fMin[4][2] = -0.5;
226 fMax[4][0] = 99.5; fMax[4][1] = 399.5; fMax[4][2] = 399.5;
228 hname1 = "fCentNplusNminusPid"; hname1 +=gPid;
229 htitle1 = Species[gPid]; htitle1 +=" And Neg-"; htitle1 +=Species[gPid];
230 axisTitle1 ="Pos-"; axisTitle1 += Species[gPid];
231 axisTitle2 ="Neg-"; axisTitle2 += Species[gPid];
233 fTHnCentNplusNminusPid[gPid] = new THnSparseD(hname1.Data(),htitle1.Data(), nDim, fBins[gPid], fMin[gPid],fMax[gPid]);
235 fTHnCentNplusNminusPid[gPid]->GetAxis(0)->SetTitle("Centrality");
236 fTHnCentNplusNminusPid[gPid]->GetAxis(1)->SetTitle(axisTitle1.Data());
237 fTHnCentNplusNminusPid[gPid]->GetAxis(2)->SetTitle(axisTitle2.Data());
239 fListOfHistos->Add(fTHnCentNplusNminusPid[gPid]);
241 if( fAnalysisType == "MCAOD" ){
243 hname11 = "fCentNplusNminusPidTruth"; hname11 +=gPid;
244 fTHnCentNplusNminusPidTruth[gPid] = new THnSparseD(hname11.Data(),htitle1.Data(), nDim, fBins[gPid], fMin[gPid],fMax[gPid]);
246 fTHnCentNplusNminusPidTruth[gPid]->GetAxis(0)->SetTitle("Centrality");
247 fTHnCentNplusNminusPidTruth[gPid]->GetAxis(1)->SetTitle(axisTitle1.Data());
248 fTHnCentNplusNminusPidTruth[gPid]->GetAxis(2)->SetTitle(axisTitle2.Data());
249 fListOfHistos->Add(fTHnCentNplusNminusPidTruth[gPid]);
252 }//Pion, Koan and Proton-------
255 Int_t fBinsX[nDim] = {100, 1500, 1500};
256 Double_t fMinX[nDim] = { -0.5, -0.5, -0.5 };
257 Double_t fMaxX[nDim] = { 99.5, 1499.5, 1499.5};
259 fTHnCentNplusNminus = new THnSparseD("fTHnCentNplusNminus","Cent-NplusChrg-NminusChrg", nDim, fBinsX, fMinX, fMaxX);
260 fTHnCentNplusNminus->GetAxis(0)->SetTitle("Centrality");
261 fTHnCentNplusNminus->GetAxis(1)->SetTitle("UnwantedPlus");
262 fTHnCentNplusNminus->GetAxis(2)->SetTitle("UnwantedMinus");
263 fListOfHistos->Add(fTHnCentNplusNminus);
265 }//Unwanted particle -(other than pi, K or proton)
269 //PostData(1, fListOfHistosQA);
270 PostData(1, fListOfHistos);
276 //----------------------------------------------------------------------------------
277 void AliEbyEHigherMomentsTask::UserExec( Option_t * ){
279 fEventCounter->Fill(1);
281 if(fAnalysisType == "AOD") {
285 }//AOD--analysis-----
287 else if(fAnalysisType == "MCAOD") {
295 fEventCounter->Fill(8);
300 //--------------------------------------------------------------------------------------
301 void AliEbyEHigherMomentsTask::doAODEvent(){
303 Double_t positiveSum = 0.;
304 Double_t negativeSum = 0.;
305 Double_t posPidSum = 0.;
306 Double_t negPidSum = 0.;
309 AliAnalysisManager* manager = AliAnalysisManager::GetAnalysisManager();
311 cout<<"ERROR: Analysis manager not found."<<endl;
314 //coneect to the inputHandler------------
315 AliAODInputHandler* inputHandler = dynamic_cast<AliAODInputHandler*> (manager->GetInputEventHandler());
317 cout<<"ERROR: Input handler not found."<<endl;
321 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
324 cout<< "ERROR 01: AOD not found " <<endl;
328 fPIDResponse =inputHandler->GetPIDResponse();
332 AliFatal("This Task needs the PID response attached to the inputHandler");
336 AliAODHeader *aodHeader = fAOD->GetHeader();
338 fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
340 if(fCentrality < 0 || fCentrality >= 91) return;
344 fEventCounter->Fill(2);
346 if(!ProperVertex()) return;
348 Int_t nTracks = fAOD->GetNumberOfTracks();
350 TExMap *trackMap = new TExMap();//Mapping matrix----
352 for(Int_t i = 0; i < nTracks; i++) {
354 AliAODTrack* aodTrack = dynamic_cast<AliAODTrack *>(fAOD->GetTrack(i));
357 AliError(Form("ERROR: Could not retrieve AODtrack %d",i));
361 Double_t tpcSignalAll = aodTrack->GetTPCsignal();
362 fTPCSigA->Fill(aodTrack->GetTPCmomentum(),tpcSignalAll);
364 Int_t gID = aodTrack->GetID();
366 if (aodTrack->TestFilterBit(1)) trackMap->Add(gID, i);//Global tracks-----
367 }//1st track loop----
369 AliAODTrack* newAodTrack;
371 for( Int_t j = 0; j < nTracks; j++ )
374 AliAODTrack* aodTrack1 = dynamic_cast<AliAODTrack *>(fAOD->GetTrack(j));
377 AliError(Form("ERROR: Could not retrieve AODtrack %d",j));
382 if(!aodTrack1->TestFilterBit(fAODtrackCutBit)) continue;
384 Int_t gID = aodTrack1->GetID();
386 //if( aodTrack->GetID() != (-aodTrack1->GetID() -1) ) continue;
387 newAodTrack = gID >= 0 ? aodTrack1 : fAOD->GetTrack(trackMap->GetValue(-1-gID)); //Take those global track who corresponds to TPC only track
390 Double_t pt = aodTrack1->Pt();
391 Double_t eta = aodTrack1->Eta();
392 Double_t nclus = aodTrack1->GetTPCClusterInfo(2,1);
393 Double_t chi2ndf = aodTrack1->Chi2perNDF();
395 if( pt < fPtLowerLimit || pt > fPtHigherLimit ) continue;
396 if( eta < fEtaLowerLimit || eta > fEtaHigherLimit ) continue;
397 if( nclus < fTPCNClus ) continue;
398 if( chi2ndf > fChi2perNDF ) continue;
400 if( fAODtrackCutBit == 128 ){
401 //TPC only tracks----
402 Float_t dxy = 0., dz = 0.;
403 dxy = aodTrack1->DCA();
404 dz = aodTrack1->ZAtDCA();
406 if( fabs(dxy) > fDCAxy ) continue;
407 if( fabs(dz) > fDCAz ) continue;
408 //Extra cut on DCA---( Similar to BF Task.. )
409 if( fDCAxy !=0 && fDCAz !=0 ){
410 if( TMath::Sqrt((dxy*dxy)/(fDCAxy*fDCAxy)+(dz*dz)/(fDCAz*fDCAz)) > 1. ) continue;
413 fHistQA[6]->Fill(dxy);
414 fHistQA[7]->Fill(dz);
415 fHistDCA->Fill(dxy,dz);
419 fHistQA[8]->Fill(pt);
420 fHistQA[9]->Fill(eta);
421 fHistQA[10]->Fill(aodTrack1->Phi());
422 fHistQA[11]->Fill(nclus);
423 fHistQA[12]->Fill(chi2ndf);
425 Short_t gCharge = aodTrack1->Charge();
427 if(gCharge > 0) positiveSum += 1.;
428 if(gCharge < 0) negativeSum += 1.;
432 gPid = (Int_t)fParticleSpecies;
434 Double_t rap = newAodTrack->Y(AliPID::ParticleMass(fParticleSpecies));
435 Double_t tpcSignal = newAodTrack->GetTPCsignal();
436 //Double_t rap = aodTrack1->Y(AliPID::ParticleMass(fParticleSpecies));
437 //Double_t tpcSignal = aodTrack1->GetTPCsignal();
439 if( fabs(rap ) > fRapidityCut ) continue;//Rapidity cut
441 fTPCSig->Fill(newAodTrack->GetTPCmomentum(),tpcSignal);
443 Float_t nsigmaTPCPID = -999.;
444 Float_t nsigmaTOFPID = -999.;
445 //Float_t nsigmaTPCTOFPID = -999.;
447 nsigmaTPCPID = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,fParticleSpecies));
448 nsigmaTOFPID = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(newAodTrack,fParticleSpecies));
450 if ( nsigmaTPCPID < fNSigmaCut ){
452 if (gCharge > 0) posPidSum +=1.;
453 if( gCharge < 0 ) negPidSum +=1.;
458 }//--------- Track Loop to select with filterbit
461 //cout << fCentrality <<" "<< nPlusCharge << " " << nMinusCharge << endl;
462 //cout << fCentrality <<" "<< nParticle << " " << nAntiParticle << endl;
464 Double_t fContainerCh[3] = { fCentrality, positiveSum, negativeSum};
468 fTHnCentNplusNminusCh->Fill(fContainerCh);
471 gPid = (Int_t)fParticleSpecies;
472 Double_t fContainerPid[3] = { fCentrality, posPidSum, negPidSum};
473 fTHnCentNplusNminusPid[gPid]->Fill(fContainerPid);
476 fEventCounter->Fill(7);
477 PostData(1, fListOfHistos);
481 //--------------------------------------------------------------------------------------
482 //--------------------------------------------------------------------------------------
483 void AliEbyEHigherMomentsTask::doMCAODEvent(){
487 Double_t positiveSumMCRec = 0.;
488 Double_t negativeSumMCRec = 0.;
489 Double_t posPidSumMCRec = 0.;
490 Double_t negPidSumMCRec = 0.;
492 Double_t positiveSumMCTruth = 0.;
493 Double_t negativeSumMCTruth = 0.;
494 Double_t posPidSumMCTruth = 0.;
495 Double_t negPidSumMCTruth = 0.;
498 Int_t gPdgCode = AliPID::ParticleCode(fParticleSpecies);
500 //Connect to Anlaysis manager------
501 AliAnalysisManager* manager = AliAnalysisManager::GetAnalysisManager();
503 cout<<"ERROR: Analysis manager not found."<<endl;
507 AliAODInputHandler* inputHandler = dynamic_cast<AliAODInputHandler*> (manager->GetInputEventHandler());
509 cout<<"ERROR: Input handler not found."<<endl;
514 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
517 cout<< "ERROR 01: AOD not found " <<endl;
521 fPIDResponse =inputHandler->GetPIDResponse();
525 AliFatal("This Task needs the PID response attached to the inputHandler");
530 // ------------------------------------------------------------------
532 fArrayMC = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
534 AliFatal("Error: MC particles branch not found!\n");
538 AliAODMCHeader *mcHdr=NULL;
539 mcHdr=(AliAODMCHeader*)fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName());
541 printf("MC header branch not found!\n");
545 AliAODHeader *aodHeader = fAOD->GetHeader();
547 fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
551 if( fCentrality < 0 || fCentrality >= 91) return;
553 fEventCounter->Fill(2);
555 if(!ProperVertex()) return;
557 Int_t nTracks = fAOD->GetNumberOfTracks();
559 TExMap *trackMap = new TExMap();//Mapping matrix----
561 for(Int_t i = 0; i < nTracks; i++) {
563 AliAODTrack* aodTrack = dynamic_cast<AliAODTrack *>(fAOD->GetTrack(i));
566 AliError(Form("ERROR: Could not retrieve AODtrack %d",i));
570 Double_t tpcSignalAll = aodTrack->GetTPCsignal();
571 fTPCSigA->Fill(aodTrack->GetTPCmomentum(),tpcSignalAll);
573 Int_t gID = aodTrack->GetID();
575 if (aodTrack->TestFilterBit(1)) trackMap->Add(gID, i);//Global(primary) tracks-----
577 }//1st track loop----
579 AliAODTrack* newAodTrack;
581 for( Int_t j = 0; j < nTracks; j++ ){
583 AliAODTrack* aodTrack1 = dynamic_cast<AliAODTrack *>(fAOD->GetTrack(j));
586 AliError(Form("ERROR: Could not retrieve AODtrack %d",j));
591 if(!aodTrack1->TestFilterBit(fAODtrackCutBit)) continue;
593 Int_t gID = aodTrack1->GetID();
595 //if( aodTrack->GetID() != (-aodTrack1->GetID() -1) ) continue;
597 newAodTrack = gID >= 0 ? aodTrack1 : fAOD->GetTrack(trackMap->GetValue(-1-gID)); //Take those global track who corresponds to TPC only track
600 //cout << dxy << endl;
601 Double_t pt = aodTrack1->Pt();
602 Double_t eta = aodTrack1->Eta();
603 Double_t nclus = aodTrack1->GetTPCClusterInfo(2,1);
604 Double_t chi2ndf = aodTrack1->Chi2perNDF();
606 if( pt < fPtLowerLimit || pt > fPtHigherLimit ) continue;
607 if( eta < fEtaLowerLimit || eta > fEtaHigherLimit ) continue;
608 if( nclus < fTPCNClus ) continue;
609 if( chi2ndf > fChi2perNDF ) continue;
611 if( fAODtrackCutBit == 128 ){
612 Float_t dxy = 0., dz = 0.;
613 dxy = aodTrack1->DCA();
614 dz = aodTrack1->ZAtDCA();
616 if( fabs(dxy) > fDCAxy ) continue;
617 if( fabs(dz) > fDCAz ) continue;
618 //Extra cut on DCA---( Similar to BF Task.. )
619 if( fDCAxy !=0 && fDCAz !=0 ){
620 if( TMath::Sqrt((dxy*dxy)/(fDCAxy*fDCAxy)+(dz*dz)/(fDCAz*fDCAz)) > 1. ) continue;
623 fHistQA[6]->Fill(dxy);
624 fHistQA[7]->Fill(dz);
625 fHistDCA->Fill(dxy,dz);
631 fHistQA[8]->Fill(pt);
632 fHistQA[9]->Fill(eta);
633 fHistQA[10]->Fill(aodTrack1->Phi());
634 fHistQA[11]->Fill(nclus);
635 fHistQA[12]->Fill(chi2ndf);
638 Short_t gCharge = aodTrack1->Charge();
640 if( gCharge == 0 ) continue;
642 if(gCharge > 0) positiveSumMCRec += 1.;
643 if(gCharge < 0) negativeSumMCRec += 1.;
647 gPid = (Int_t)fParticleSpecies;
648 Double_t rap = newAodTrack->Y(AliPID::ParticleMass(fParticleSpecies));
649 Double_t tpcSignal = newAodTrack->GetTPCsignal();
651 if( fabs(rap ) > fRapidityCut ) continue;//Rapidity cut
653 fTPCSig->Fill(newAodTrack->GetTPCmomentum(),tpcSignal);
655 Float_t nsigmaTPCPID = -999.;
656 Float_t nsigmaTOFPID = -999.;
657 //Float_t nsigmaTPCTOFPID = -999.;
659 nsigmaTPCPID = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,fParticleSpecies));
660 nsigmaTOFPID = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(newAodTrack,fParticleSpecies));
662 if( nsigmaTPCPID < fNSigmaCut ){
664 if (gCharge > 0) posPidSumMCRec +=1;
665 if( gCharge < 0 ) negPidSumMCRec +=1.;
669 }//--------- Track Loop to select with filterbit
672 Double_t fContainerCh[3] = { fCentrality, positiveSumMCRec, negativeSumMCRec};//Reco. values ch. hadrons
673 fTHnCentNplusNminusCh->Fill(fContainerCh);//Fill the rec. ch. particles---
676 gPid = (Int_t)fParticleSpecies;
677 Double_t fContainerPid[3] = { fCentrality, posPidSumMCRec, negPidSumMCRec};//Reco. values pid.
678 fTHnCentNplusNminusPid[gPid]->Fill(fContainerPid);//Fill the rec. pid tracks
682 //cout << fCentrality << " "<< nPlusCharge << " "<< nMinusCharge << endl;
683 //cout << nParticle <<" And " << nAntiParticle << endl;
684 //===========================================
685 //--------MC Truth---------------------------
686 //===========================================
688 Int_t nMCTrack = fArrayMC->GetEntriesFast();
690 for (Int_t iMC = 0; iMC < nMCTrack; iMC++) {
692 AliAODMCParticle *partMC = (AliAODMCParticle*) fArrayMC->At(iMC);
695 AliError(Form("ERROR: Could not retrieve AODMCtrack %d",iMC));
699 if(partMC->Charge() == 0) continue;
700 if(!partMC->IsPhysicalPrimary()) continue;
702 if (partMC->Eta() < fEtaLowerLimit || partMC->Eta() > fEtaHigherLimit) continue;
703 if (partMC->Pt() < fPtLowerLimit || partMC->Pt() > fPtHigherLimit) continue;
705 Short_t gCharge = partMC->Charge();
707 if(gCharge > 0) positiveSumMCTruth += 1.;
708 if(gCharge < 0) negativeSumMCTruth += 1.;
712 Double_t rap = partMC->Y();
713 if( fabs(rap ) > fRapidityCut ) continue;//Rapidity cut
714 if(TMath::Abs(partMC->GetPdgCode()) != gPdgCode) continue;
716 if(gCharge > 0) posPidSumMCTruth += 1.;
717 if(gCharge < 0) negPidSumMCTruth += 1.;
722 }//MC-Truth Track loop--
724 Double_t fContainerChTruth[3] = { fCentrality, positiveSumMCTruth, negativeSumMCTruth };
725 fTHnCentNplusNminusChTruth->Fill(fContainerChTruth);//MC -Truth ch. particles
728 gPid = (Int_t)fParticleSpecies;
729 Double_t fContainerPidTruth[3] = { fCentrality, posPidSumMCTruth, negPidSumMCTruth};
730 fTHnCentNplusNminusPidTruth[gPid]->Fill(fContainerPidTruth);//MC-Truth pid
733 fEventCounter->Fill(7);
734 PostData(1, fListOfHistos);
739 //---------------------------------------------------------------------------------------
740 Bool_t AliEbyEHigherMomentsTask::ProperVertex(){
742 Bool_t IsVtx = kFALSE;
744 const AliAODVertex *vertex = fAOD->GetPrimaryVertex();
748 vertex->GetCovarianceMatrix(fCov);
749 if(vertex->GetNContributors() > 0) {
752 Double_t lvx = vertex->GetX();
753 Double_t lvy = vertex->GetY();
754 Double_t lvz = vertex->GetZ();
756 fEventCounter->Fill(5);
758 fHistQA[3]->Fill(lvx);fHistQA[4]->Fill(lvy);fHistQA[5]->Fill(lvz);
760 if(TMath::Abs(lvx) < fVxMax) {
761 if(TMath::Abs(lvy) < fVyMax) {
762 if(TMath::Abs(lvz) < fVzMax) {
764 fEventCounter->Fill(6);
765 fHistQA[0]->Fill(lvx);fHistQA[1]->Fill(lvy);fHistQA[2]->Fill(lvz);
773 }//Contributors check---
774 }//If vertex-----------
778 //---------------------------------------------------------------------------------------
780 //------------------------------------------------------------------------
781 void AliEbyEHigherMomentsTask::Terminate( Option_t * ){
783 Info("AliEbyEHigherMomentTask"," Task Successfully finished");
787 //------------------------------------------------------------------------