1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: Nirbhay K. Behera *
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 // Toy Model for Net-Charge Higher Moment Analysis //
20 // Author: Satyajit Jena || Nirbhay K. Behera //
21 // sjena@cern.ch || nbehera@cern.ch //
23 //=========================================================================//
31 #include "THnSparse.h"
33 #include "TParticle.h"
34 #include <TDatabasePDG.h>
35 #include <TParticlePDG.h>
37 #include "AliAnalysisTaskSE.h"
38 #include "AliAnalysisManager.h"
40 #include "AliESDVertex.h"
41 #include "AliESDEvent.h"
42 #include "AliESDInputHandler.h"
43 #include "AliAODEvent.h"
44 #include "AliAODTrack.h"
45 #include "AliAODInputHandler.h"
47 #include "AliESDEvent.h"
48 #include "AliAODEvent.h"
50 #include "AliESDtrackCuts.h"
51 #include "AliAODMCHeader.h"
52 #include "AliAODMCParticle.h"
53 #include "AliMCEventHandler.h"
54 #include "AliMCEvent.h"
55 #include "AliMCParticle.h"
57 #include "AliGenHijingEventHeader.h"
58 #include "AliGenEventHeader.h"
60 #include "AliAODPid.h"
61 #include "AliPIDResponse.h"
62 #include "AliAODpidUtil.h"
63 #include "AliPIDCombined.h"
65 #include "AliHigherMomentsToyModel.h"
71 ClassImp(AliHigherMomentsToyModel)
74 //-----------------------------------------------------------------------
75 AliHigherMomentsToyModel::AliHigherMomentsToyModel( const char *name )
76 : AliAnalysisTaskSE( name ),
82 fParticleSpecies(AliPID::kProton),
84 fCentralityEstimator("V0M"),
99 fAODtrackCutBit(1024),
105 fTHnCentNplusNminusCh(0),
106 fTHnCentNplusNminusChTruth(0),
107 fTHnCentNplusNminus(0)
110 for ( Int_t i = 0; i < 13; i++) {
114 for ( Int_t i = 0; i < 5; i++ ){
115 fTHnCentNplusNminusPid[i] = NULL;
116 fTHnCentNplusNminusPidTruth[i] = NULL;
119 DefineOutput(1, TList::Class()); // Outpput....
120 DefineOutput(2, TList::Class());
124 AliHigherMomentsToyModel::~AliHigherMomentsToyModel() {
126 if(fListOfHistosQA) delete fListOfHistosQA;
127 if(fListOfHistos) delete fListOfHistos;
131 //---------------------------------------------------------------------------------
132 void AliHigherMomentsToyModel::UserCreateOutputObjects() {
134 fListOfHistosQA = new TList();
135 fListOfHistosQA->SetOwner(kTRUE);
137 fListOfHistos = new TList();
138 fListOfHistos->SetOwner(kTRUE);
140 fEventCounter = new TH1D("fEventCounter","EventCounter", 10, 0.5,10.5);
141 fEventCounter->GetXaxis()->SetBinLabel(1,"Event Accesed");
142 fEventCounter->GetXaxis()->SetBinLabel(2,"Within 0-90% centrality");
143 fEventCounter->GetXaxis()->SetBinLabel(5,"Have a vertex");
144 fEventCounter->GetXaxis()->SetBinLabel(6,"After vertex Cut");
145 fEventCounter->GetXaxis()->SetBinLabel(7,"Event Analyzed");
146 fEventCounter->GetXaxis()->SetBinLabel(8,"Event Analysis finished");
147 fListOfHistosQA->Add(fEventCounter);
149 fHistQA[0] = new TH1D("fHistQAvx", "Histo Vx After Cut", 400, -4., 4.);
150 fHistQA[1] = new TH1D("fHistQAvy", "Histo Vy After Cut", 400, -4., 4.);
151 fHistQA[2] = new TH1D("fHistQAvz", "Histo Vz After Cut", 500, -25., 25.);
152 fHistQA[3] = new TH1D("fHistQAvxA", "Histo Vx All", 500, -5., 5.);
153 fHistQA[4] = new TH1D("fHistQAvyA", "Histo Vy All", 500, -5., 5.);
154 fHistQA[5] = new TH1D("fHistQAvzA", "Histo Vz All", 500, -25., 25.);
155 fHistQA[6] = new TH1D("fHistQADcaXyC", "Histo DCAxy after cut", 500, -5., 5.);
156 fHistQA[7] = new TH1D("fHistQADcaZC", "Histo DCAz after cut", 500, -5., 5.);
157 fHistQA[8] = new TH1D("fHistQAPt","p_{T} distribution",600,0,6);
158 fHistQA[9] = new TH1D("fHistQAEta","#eta distribution",240,-1.2,1.2);
159 fHistQA[10] = new TH1D("fHistQAPhi","#phi distribution",340,0,6.8);
160 fHistQA[11] = new TH1D("fHistQANCls","Number of TPC cluster",200,0,200);
161 fHistQA[12] = new TH1D("fHistQAChi2","Chi2 per NDF",100,0,10);
163 for(Int_t i = 0; i < 13; i++)
165 fListOfHistosQA->Add(fHistQA[i]);
168 fHistDCA = new TH2D("fHistDCA","DCAxy Vs DCAz", 500, -5., 5., 500, -5., 5.);
169 fTPCSig = new TH2D("fTPCSig","TPC signal",200, 0.0, 10. ,1000,0.,1000);
170 fTPCSig->SetMarkerColor(kRed);
171 fTPCSigA = new TH2D("fTPCSigA","TPC signal all ",200, 0.0, 10. ,1000,0.,1000);
172 fListOfHistosQA->Add(fHistDCA);
173 fListOfHistosQA->Add(fTPCSig);
174 fListOfHistosQA->Add(fTPCSigA);
177 const Int_t nDim = 3;
178 const Int_t nPid = 5;
180 TString Species[nPid] = {"Electron","Muon","Pion","Kaon","Proton"};
182 Int_t fBins[nPid][nDim];
183 Double_t fMin[nPid][nDim];
184 Double_t fMax[nPid][nDim];
186 for( Int_t i = 0; i < nPid; i++ ){
187 for( Int_t j = 0; j < nDim; j++ ){
194 Int_t fBinsCh[nDim] = {100, 1500, 1500};
195 Double_t fMinCh[nDim] = { -0.5, -0.5, -0.5 };
196 Double_t fMaxCh[nDim] = { 99.5, 1499.5, 1499.5};
198 fTHnCentNplusNminusCh = new THnSparseD("fTHnCentNplusNminusCh","Cent-NplusChrg-NminusChrg", nDim, fBinsCh, fMinCh, fMaxCh);
199 fTHnCentNplusNminusCh->GetAxis(0)->SetTitle("Centrality");
200 fTHnCentNplusNminusCh->GetAxis(1)->SetTitle("Nplus");
201 fTHnCentNplusNminusCh->GetAxis(2)->SetTitle("Nminus");
202 fListOfHistos->Add(fTHnCentNplusNminusCh);
204 if( fAnalysisType == "MCAOD" ){
206 fTHnCentNplusNminusChTruth = new THnSparseD("fTHnCentNplusNminusChTruth","Cent-NplusChrg-NminusChrg", nDim, fBinsCh, fMinCh, fMaxCh);
207 fTHnCentNplusNminusChTruth->GetAxis(0)->SetTitle("Centrality");
208 fTHnCentNplusNminusChTruth->GetAxis(1)->SetTitle("Nplus");
209 fTHnCentNplusNminusChTruth->GetAxis(2)->SetTitle("Nminus");
210 fListOfHistos->Add(fTHnCentNplusNminusChTruth);
214 TString hname1, hname11;
215 TString htitle1, axisTitle1, axisTitle2;
221 Int_t gPid = (Int_t)fParticleSpecies;
223 if( gPid > 1 && gPid < 5 ){
225 fBins[2][0] = 100; fBins[2][1] = 1000; fBins[2][2] = 1000;
226 fMin[2][0] = -0.5; fMin[2][1] = -0.5; fMin[2][2] = -0.5;
227 fMax[2][0] = 99.5; fMax[2][1] = 999.5; fMax[2][2] = 999.5;
229 fBins[3][0] = 100; fBins[3][1] = 600; fBins[3][2] = 600;
230 fMin[3][0] = -0.5; fMin[3][1] = -0.5; fMin[3][2] = -0.5;
231 fMax[3][0] = 99.5; fMax[3][1] = 599.5; fMax[3][2] = 599.5;
233 fBins[4][0] = 100; fBins[4][1] = 400; fBins[4][2] = 400;
234 fMin[4][0] = -0.5; fMin[4][1] = -0.5; fMin[4][2] = -0.5;
235 fMax[4][0] = 99.5; fMax[4][1] = 399.5; fMax[4][2] = 399.5;
237 hname1 = "fCentNplusNminusPid"; hname1 +=gPid;
238 htitle1 = Species[gPid]; htitle1 +=" And Neg-"; htitle1 +=Species[gPid];
239 axisTitle1 = Species[gPid];
240 axisTitle2 ="Neg-"; axisTitle2 += Species[gPid];
242 fTHnCentNplusNminusPid[gPid] = new THnSparseD(hname1.Data(),htitle1.Data(), nDim, fBins[gPid], fMin[gPid],fMax[gPid]);
244 fTHnCentNplusNminusPid[gPid]->GetAxis(0)->SetTitle("Centrality");
245 fTHnCentNplusNminusPid[gPid]->GetAxis(1)->SetTitle(axisTitle1.Data());
246 fTHnCentNplusNminusPid[gPid]->GetAxis(1)->SetTitle(axisTitle2.Data());
248 fListOfHistos->Add(fTHnCentNplusNminusPid[gPid]);
250 if( fAnalysisType == "MCAOD" ){
252 hname11 = "fCentNplusNminusPidTruth"; hname11 +=gPid;
253 fTHnCentNplusNminusPidTruth[gPid] = new THnSparseD(hname11.Data(),htitle1.Data(), nDim, fBins[gPid], fMin[gPid],fMax[gPid]);
255 fTHnCentNplusNminusPidTruth[gPid]->GetAxis(0)->SetTitle("Centrality");
256 fTHnCentNplusNminusPidTruth[gPid]->GetAxis(1)->SetTitle(axisTitle1.Data());
257 fTHnCentNplusNminusPidTruth[gPid]->GetAxis(1)->SetTitle(axisTitle2.Data());
259 fListOfHistos->Add(fTHnCentNplusNminusPidTruth[gPid]);
262 }//Pion, Koan and Proton-------
266 Int_t fBinsX[nDim] = {100, 1500, 1500};
267 Double_t fMinX[nDim] = { -0.5, -0.5, -0.5 };
268 Double_t fMaxX[nDim] = { 99.5, 1499.5, 1499.5};
270 fTHnCentNplusNminus = new THnSparseD("fTHnCentNplusNminus","Cent-NplusChrg-NminusChrg", nDim, fBinsX, fMinX, fMaxX);
271 fTHnCentNplusNminus->GetAxis(0)->SetTitle("Centrality");
272 fTHnCentNplusNminus->GetAxis(1)->SetTitle("UnwantedPlus");
273 fTHnCentNplusNminus->GetAxis(2)->SetTitle("UnwantedMinus");
274 fListOfHistos->Add(fTHnCentNplusNminus);
276 }//Unwanted particle -------
282 PostData(1, fListOfHistosQA);
283 PostData(2, fListOfHistos);
288 //----------------------------------------------------------------------------------
289 void AliHigherMomentsToyModel::UserExec( Option_t * ){
291 fEventCounter->Fill(1);
294 if(fAnalysisType == "AOD") {
298 }//AOD--analysis-----
300 else if(fAnalysisType == "MCAOD") {
311 fEventCounter->Fill(8);
313 PostData(1, fListOfHistosQA);
314 PostData(2, fListOfHistos);
318 //--------------------------------------------------------------------------------------
319 void AliHigherMomentsToyModel::doAODEvent(){
321 //-------------------
322 Double_t nPlusCharge = 0.;
323 Double_t nMinusCharge = 0.;
324 Double_t nPartile = 0.;
325 Double_t nAntiParticle = 0.;
329 //connect to the analysis mannager-----
331 AliAnalysisManager* manager = AliAnalysisManager::GetAnalysisManager();
333 cout<<"ERROR: Analysis manager not found."<<endl;
336 //coneect to the inputHandler------------
337 AliAODInputHandler* inputHandler = dynamic_cast<AliAODInputHandler*> (manager->GetInputEventHandler());
339 cout<<"ERROR: Input handler not found."<<endl;
343 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
346 cout<< "ERROR 01: AOD not found " <<endl;
350 fPIDResponse =inputHandler->GetPIDResponse();
354 AliFatal("This Task needs the PID response attached to the inputHandler");
359 AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
360 if(!aodHeader) AliFatal("Not a standard AOD");
362 fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
364 cent = aodHeader->GetCentralityP()->GetCentralityClass10(fCentralityEstimator.Data());
367 fCentrality = aodHeader->GetCentralityP()->GetCentralityClass5(fCentralityEstimator.Data());
368 else if (cent == 10 || cent == -1.)
370 else if (cent > 0 && cent < 9)
371 fCentrality = cent + 1;
373 if(fCentrality < 0 || fCentrality >= 91) return;
375 fEventCounter->Fill(2);
377 if(!ProperVertex()) return;
379 Int_t nTracks = fAOD->GetNumberOfTracks();
381 TExMap *trackMap = new TExMap();//Mapping matrix----
383 for(Int_t i = 0; i < nTracks; i++) {
385 AliAODTrack* aodTrack = dynamic_cast<AliAODTrack *>(fAOD->GetTrack(i));
388 AliError(Form("ERROR: Could not retrieve AODtrack %d",i));
392 Double_t tpcSignalAll = aodTrack->GetTPCsignal();
393 fTPCSigA->Fill(aodTrack->GetTPCmomentum(),tpcSignalAll);
395 Int_t gID = aodTrack->GetID();
397 if (aodTrack->TestFilterBit(1)) trackMap->Add(gID, i);//Global tracks-----
398 }//1st track loop----
400 AliAODTrack* newAodTrack;
402 for( Int_t j = 0; j < nTracks; j++ )
405 AliAODTrack* aodTrack1 = dynamic_cast<AliAODTrack *>(fAOD->GetTrack(j));
408 AliError(Form("ERROR: Could not retrieve AODtrack %d",j));
413 if(!aodTrack1->TestFilterBit(fAODtrackCutBit)) continue;
415 Int_t gID = aodTrack1->GetID();
417 //if( aodTrack->GetID() != (-aodTrack1->GetID() -1) ) continue;
418 newAodTrack = gID >= 0 ? aodTrack1 : dynamic_cast<AliAODTrack*>(fAOD->GetTrack(trackMap->GetValue(-1-gID))); //Take those global track who corresponds to TPC only track
419 if(!newAodTrack) AliFatal("Not a standard AOD");
421 Float_t dxy = 0., dz = 0.;
423 dxy = aodTrack1->DCA();
424 dz = aodTrack1->ZAtDCA();
426 Double_t pt = aodTrack1->Pt();
427 Double_t eta = aodTrack1->Eta();
428 Double_t nclus = aodTrack1->GetTPCClusterInfo(2,1);
429 Double_t chi2ndf = aodTrack1->Chi2perNDF();
432 if( fabs(dxy) > fDCAxy ) continue;
433 if( fabs(dz) > fDCAz ) continue;
434 //Extra cut on DCA---( Similar to BF Task.. )
435 if( fDCAxy !=0 && fDCAz !=0 ){
436 if( TMath::Sqrt((dxy*dxy)/(fDCAxy*fDCAxy)+(dz*dz)/(fDCAz*fDCAz)) > 1. ) continue;
439 if( pt < fPtLowerLimit || pt > fPtHigherLimit ) continue;
440 if( eta < fEtaLowerLimit || eta > fEtaHigherLimit ) continue;
441 if( nclus < fTPCNClus ) continue;
442 if( chi2ndf > fChi2perNDF ) continue;
445 fHistQA[6]->Fill(dxy);
446 fHistQA[7]->Fill(dz);
447 fHistQA[8]->Fill(pt);
448 fHistQA[9]->Fill(eta);
449 fHistQA[10]->Fill(aodTrack1->Phi());
450 fHistQA[11]->Fill(nclus);
451 fHistQA[12]->Fill(chi2ndf);
452 fHistDCA->Fill(dxy,dz);
454 Short_t gCharge = aodTrack1->Charge();
456 if(gCharge > 0) nPlusCharge += 1.;
457 if(gCharge < 0) nMinusCharge += 1.;
461 gPid = (Int_t)fParticleSpecies;
463 Double_t rap = newAodTrack->Y(AliPID::ParticleMass(fParticleSpecies));
464 Double_t tpcSignal = newAodTrack->GetTPCsignal();
465 //Double_t rap = aodTrack1->Y(AliPID::ParticleMass(fParticleSpecies));
466 //Double_t tpcSignal = aodTrack1->GetTPCsignal();
468 if( fabs(rap ) > fRapidityCut ) continue;//Rapidity cut
470 fTPCSig->Fill(newAodTrack->GetTPCmomentum(),tpcSignal);
472 Float_t nsigmaTPCPID = -999.;
473 //Float_t nsigmaTOFPID = -999.;
474 //Float_t nsigmaTPCTOFPID = -999.;
476 nsigmaTPCPID = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,fParticleSpecies));
477 //nsigmaTOFPID = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(newAodTrack,fParticleSpecies));
479 if ( nsigmaTPCPID < fNSigmaCut ){
481 if (gCharge > 0) nPartile +=1.;
482 if( gCharge < 0 ) nAntiParticle +=1.;
487 }//--------- Track Loop to select with filterbit
491 Double_t fContainerCh[3] = { static_cast<Double_t>(fCentrality), nPlusCharge, nMinusCharge};
492 Double_t fContainerPid[3] = { static_cast<Double_t>(fCentrality), nPartile, nAntiParticle};
495 fTHnCentNplusNminusCh->Fill(fContainerCh);
498 gPid = (Int_t)fParticleSpecies;
499 fTHnCentNplusNminusPid[gPid]->Fill(fContainerPid);
501 // cout << "nCentrality "<< fCentrality <<", nParticle="<< nPartile << ", nMinusParticle=" << nAntiParticle << endl;
505 //cout << "nCentrality "<< fCentrality <<", nPlusCharge="<< nPlusCharge << ", nMinusCharge=" << nMinusCharge << endl;
507 fEventCounter->Fill(7);
512 //--------------------------------------------------------------------------------------
515 //--------------------------------------------------------------------------------------
516 void AliHigherMomentsToyModel::doMCAODEvent(){
520 Double_t nPlusCharge = 0.;
521 Double_t nMinusCharge = 0.;
523 Double_t nPlusChargeTruth = 0.;
524 Double_t nMinusChargeTruth = 0.;
526 Double_t nPartile = 0.;
527 Double_t nAntiParticle = 0.;
528 Double_t nPartileTruth = 0.;
529 Double_t nAntiParticleTruth = 0.;
532 Int_t gPdgCode = AliPID::ParticleCode(fParticleSpecies);
534 //Connect to Anlaysis manager------
535 AliAnalysisManager* manager = AliAnalysisManager::GetAnalysisManager();
537 cout<<"ERROR: Analysis manager not found."<<endl;
541 AliAODInputHandler* inputHandler = dynamic_cast<AliAODInputHandler*> (manager->GetInputEventHandler());
543 cout<<"ERROR: Input handler not found."<<endl;
548 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
551 cout<< "ERROR 01: AOD not found " <<endl;
555 fPIDResponse =inputHandler->GetPIDResponse();
559 AliFatal("This Task needs the PID response attached to the inputHandler");
563 // ------------------------------------------------------------------
565 fArrayMC = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
567 AliFatal("Error: MC particles branch not found!\n");
571 AliAODMCHeader *mcHdr=NULL;
572 mcHdr=(AliAODMCHeader*)fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName());
574 printf("MC header branch not found!\n");
578 AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
579 if(!aodHeader) AliFatal("Not a standard AOD");
581 fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
585 cent = aodHeader->GetCentralityP()->GetCentralityClass10(fCentralityEstimator.Data());
588 fCentrality = aodHeader->GetCentralityP()->GetCentralityClass5(fCentralityEstimator.Data());
589 else if (cent == 10 || cent == -1.)
591 else if (cent > 0 && cent < 9)
592 fCentrality = cent + 1;
594 if( fCentrality < 0 || fCentrality >= 91) return;
596 fEventCounter->Fill(2);
600 if(!ProperVertex()) return;
602 Int_t nTracks = fAOD->GetNumberOfTracks();
605 TExMap *trackMap = new TExMap();//Mapping matrix----
607 for(Int_t i = 0; i < nTracks; i++) {
609 AliAODTrack* aodTrack = dynamic_cast<AliAODTrack *>(fAOD->GetTrack(i));
612 AliError(Form("ERROR: Could not retrieve AODtrack %d",i));
616 Double_t tpcSignalAll = aodTrack->GetTPCsignal();
617 fTPCSigA->Fill(aodTrack->GetTPCmomentum(),tpcSignalAll);
619 Int_t gID = aodTrack->GetID();
621 if (aodTrack->TestFilterBit(1)) trackMap->Add(gID, i);//Global tracks-----
623 }//1st track loop----
625 AliAODTrack* newAodTrack;
627 for( Int_t j = 0; j < nTracks; j++ ){
629 AliAODTrack* aodTrack1 = dynamic_cast<AliAODTrack *>(fAOD->GetTrack(j));
632 AliError(Form("ERROR: Could not retrieve AODtrack %d",j));
637 if(!aodTrack1->TestFilterBit(fAODtrackCutBit)) continue;
640 Int_t gID = aodTrack1->GetID();
642 //if( aodTrack->GetID() != (-aodTrack1->GetID() -1) ) continue;
644 newAodTrack = gID >= 0 ? aodTrack1 : dynamic_cast<AliAODTrack*>(fAOD->GetTrack(trackMap->GetValue(-1-gID))); //Take those global track who corresponds to TPC only track
645 if(!newAodTrack) AliFatal("Not a standard AOD");
648 //cout << dxy << endl;
649 Double_t pt = aodTrack1->Pt();
650 Double_t eta = aodTrack1->Eta();
651 Double_t nclus = aodTrack1->GetTPCClusterInfo(2,1);
652 Double_t chi2ndf = aodTrack1->Chi2perNDF();
654 Float_t dxy = 0., dz = 0.;
656 if( fAODtrackCutBit == 128 ){
658 dxy = aodTrack1->DCA();
659 dz = aodTrack1->ZAtDCA();
661 if( fabs(dxy) > fDCAxy ) continue;
662 if( fabs(dz) > fDCAz ) continue;
663 //Extra cut on DCA---( Similar to BF Task.. )
664 if( fDCAxy !=0 && fDCAz !=0 ){
665 if( TMath::Sqrt((dxy*dxy)/(fDCAxy*fDCAxy)+(dz*dz)/(fDCAz*fDCAz)) > 1. ) continue;
668 fHistQA[6]->Fill(dxy);
669 fHistQA[7]->Fill(dz);
670 fHistDCA->Fill(dxy,dz);
675 if( pt < fPtLowerLimit || pt > fPtHigherLimit ) continue;
676 if( eta < fEtaLowerLimit || eta > fEtaHigherLimit ) continue;
677 if( nclus < fTPCNClus ) continue;
678 if( chi2ndf > fChi2perNDF ) continue;
682 fHistQA[8]->Fill(pt);
683 fHistQA[9]->Fill(eta);
684 fHistQA[10]->Fill(aodTrack1->Phi());
685 fHistQA[11]->Fill(nclus);
686 fHistQA[12]->Fill(chi2ndf);
689 Short_t gCharge = aodTrack1->Charge();
691 if( gCharge == 0 ) continue;
694 if(gCharge > 0) nPlusCharge += 1.;
695 if(gCharge < 0) nMinusCharge += 1.;
699 gPid = (Int_t)fParticleSpecies;;
700 Double_t rap = newAodTrack->Y(AliPID::ParticleMass(fParticleSpecies));
701 Double_t tpcSignal = newAodTrack->GetTPCsignal();
703 if( fabs(rap ) > fRapidityCut ) continue;//Rapidity cut
705 fTPCSig->Fill(newAodTrack->GetTPCmomentum(),tpcSignal);
707 Float_t nsigmaTPCPID = -999.;
708 //Float_t nsigmaTOFPID = -999.;
709 //Float_t nsigmaTPCTOFPID = -999.;
711 nsigmaTPCPID = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(newAodTrack,fParticleSpecies));
712 //nsigmaTOFPID = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(newAodTrack,fParticleSpecies));
714 if ( nsigmaTPCPID < fNSigmaCut ){
717 if (gCharge > 0) nPartile +=1.;
718 if( gCharge < 0 ) nAntiParticle +=1.;
723 }//--------- Track Loop to select with filterbit
725 //cout << "Cent=" << fCentrality << " MC-PlusChrg=" << nPlusCharge << " MC-MinusChrg=" << nMinusCharge << endl;
727 //cout << "nCentrality "<< fCentrality <<", nParticle="<< nPartile << ", nMinusParticle=" << nAntiParticle << endl;
729 Double_t fContainerCh[3] = { static_cast<Double_t>(fCentrality), nPlusCharge, nMinusCharge};
730 Double_t fContainerPid[3] = { static_cast<Double_t>(fCentrality), nPartile, nAntiParticle};
732 fTHnCentNplusNminusCh->Fill(fContainerCh);
736 gPid = (Int_t)fParticleSpecies;
737 fTHnCentNplusNminusPid[gPid]->Fill(fContainerPid);
741 //===========================================
742 //--------MC Truth---------------------------
743 //===========================================
745 Int_t nMCTrack = fArrayMC->GetEntriesFast();
747 for (Int_t iMC = 0; iMC < nMCTrack; iMC++) {
749 AliAODMCParticle *partMC = (AliAODMCParticle*) fArrayMC->At(iMC);
752 AliError(Form("ERROR: Could not retrieve AODMCtrack %d",iMC));
756 if(partMC->Charge() == 0) continue;
757 if(!partMC->IsPhysicalPrimary()) continue;
759 if (partMC->Eta() < fEtaLowerLimit || partMC->Eta() > fEtaHigherLimit) continue;
760 if (partMC->Pt() < fPtLowerLimit || partMC->Pt() > fPtHigherLimit) continue;
762 Short_t gCharge = partMC->Charge();
764 if(gCharge > 0) nPlusChargeTruth += 1.;
765 if(gCharge < 0) nMinusChargeTruth += 1.;
769 Double_t rap = partMC->Y();
771 if( fabs(rap ) > fRapidityCut ) continue;//Rapidity cut
773 if(TMath::Abs(partMC->GetPdgCode()) != gPdgCode) continue;
775 if(gCharge > 0) nPartileTruth += 1.;
776 if(gCharge < 0) nAntiParticleTruth += 1.;
780 }//MC-Truth Track loop--
782 Double_t fContainerChTruth[3] = { static_cast<Double_t>(fCentrality), nPlusChargeTruth, nMinusChargeTruth };
783 Double_t fContainerPidTruth[3] = { static_cast<Double_t>(fCentrality), nPartileTruth, nAntiParticleTruth };
785 //cout << "Cent=" << fCentrality << " MC-PlusChrgT=" << nPlusChargeTruth << " MC-MinusChrgT=" << nMinusChargeTruth << endl;
787 //cout << "nCentrality "<< fCentrality <<", nParticleT="<< nPartileTruth << ", nMinusParticleT=" << nAntiParticleTruth << endl;
789 //cout << "----------------------------" << endl;
790 fTHnCentNplusNminusChTruth->Fill(fContainerChTruth);
793 gPid = (Int_t)fParticleSpecies;
794 fTHnCentNplusNminusPidTruth[gPid]->Fill(fContainerPidTruth);
799 fEventCounter->Fill(7);
804 //---------------------------------------------------------------------------------------
806 //---------------------------------------------------------------------------------------
807 Bool_t AliHigherMomentsToyModel::ProperVertex(){
809 Bool_t IsVtx = kFALSE;
811 const AliAODVertex *vertex = fAOD->GetPrimaryVertex();
815 vertex->GetCovarianceMatrix(fCov);
816 if(vertex->GetNContributors() > 0) {
819 Double_t lvx = vertex->GetX();
820 Double_t lvy = vertex->GetY();
821 Double_t lvz = vertex->GetZ();
823 fEventCounter->Fill(5);
825 fHistQA[3]->Fill(lvx);fHistQA[4]->Fill(lvy);fHistQA[5]->Fill(lvz);
827 if(TMath::Abs(lvx) < fVxMax) {
828 if(TMath::Abs(lvy) < fVyMax) {
829 if(TMath::Abs(lvz) < fVzMax) {
831 fEventCounter->Fill(6);
832 fHistQA[0]->Fill(lvx);fHistQA[1]->Fill(lvy);fHistQA[2]->Fill(lvz);
840 }//Contributors check---
841 }//If vertex-----------
845 //---------------------------------------------------------------------------------------
849 //------------------------------------------------------------------------
850 void AliHigherMomentsToyModel::Terminate( Option_t * ){
852 Info("AliHigherMomentsToyModel"," Task Successfully finished");
856 //------------------------------------------------------------------------