10 #include "AliAnalysisTask.h"
11 #include "AliAnalysisManager.h"
12 #include "AliAODHeader.h"
13 #include "AliAODTrack.h"
14 #include "AliAODTracklets.h"
15 #include "AliAODpidUtil.h"
16 #include "AliVTrack.h"
17 #include "AliAODEvent.h"
18 #include "AliAODInputHandler.h"
19 #include "AliCentrality.h"
20 #include "AliEbyEMultFluctuationTask.h"
21 #include "AliAODVertex.h"
22 #include "AliAODVZERO.h"
23 #include "AliCentrality.h"
25 #include "AliPIDResponse.h"
26 #include "AliPIDCombined.h"
27 #include "AliAODpidUtil.h"
29 #include "AliTPCPIDResponse.h"
30 #include "AliTRDPIDResponse.h"
33 ClassImp(AliEbyEMultFluctuationTask)
35 //________________________________________________________________________
36 AliEbyEMultFluctuationTask::AliEbyEMultFluctuationTask(const char *name)
37 : AliAnalysisTaskSE(name),fAOD(0), fAODVertex(0),fHistNchPt(0),fHistNchEta(0),fHistNchEtaCent(0),fHistNchPhi(0),fHistDCAxy(0),fHistDCAz(0),fHistnclus(0),fHistchi2ndf(0),fHistchi2ndfvscs(0),fHistVz(0),fHistMultV0A(0),fHistMultV0C(0),fHistMultV0total(0),My_ntuple(0),fOutputList(0),fCentralityEstimator("V0M"),fCentralityBins20(kFALSE),fCentralityCounter(0),fEventCounter(0),histcounter(0)
42 for(Int_t ibin=0;ibin<91;ibin++)
46 for(Int_t jbin=0;jbin<46;jbin++)
50 for(Int_t kbin=0;kbin<15;kbin++)
56 DefineInput(0, TChain::Class());
58 DefineOutput(1, TList::Class());
61 //________________________________________________________________________
62 Bool_t AliEbyEMultFluctuationTask :: SelectEvent(AliAODVertex* vertex)
67 if(vertex->GetNContributors() < 0) return kFALSE;
70 Double_t lvx = vertex->GetX();
71 Double_t lvy = vertex->GetY();
72 Double_t lvz = vertex->GetZ();
74 fEventCounter->Fill(3);
77 if(TMath::Abs(lvx) > 0.3) return kFALSE;
78 if(TMath::Abs(lvy) > 0.3) return kFALSE;
79 if(TMath::Abs(lvz) > 10) return kFALSE;
80 if(vertex->GetType()==AliAODVertex::kPileupSPD) return kFALSE;
82 fEventCounter->Fill(5);
90 //_____________________________________________________________________________
91 Int_t AliEbyEMultFluctuationTask :: SelectTrack(AliAODTrack* track)
94 Double_t eta = track->Eta();
96 if(TMath :: Abs(eta)>0.8) return 0;
98 if(!track->TestFilterBit(128)) return 0;
103 dz = track->ZAtDCA();
104 if(TMath ::Abs(dxy) >2.4 || TMath ::Abs(dz)>3.0) return 0;
105 // cout<<dxy<<dz<<endl;
108 Double_t nclus = track->GetTPCClusterInfo(2,1);
109 if(nclus<80) return 0;
113 Double_t chi2ndf = track->Chi2perNDF();
114 if(chi2ndf>4) return 0;
121 //________________________________________________________________________________________________
122 void AliEbyEMultFluctuationTask::UserCreateOutputObjects()
124 fOutputList = new TList();
128 My_ntuple = new TNtuple("My_ntuple", "My_ntuple", "Mult:Mult1:Mult2:nCentrality:fV0total:nBin2:nBin5:spdmult0:spdmult1:tracklets:run");
129 fOutputList->Add(My_ntuple);
131 fOutputList->SetOwner(kTRUE);
132 fEventCounter = new TH1D("fEventCounter","EventCounter", 10, 0.5,10.5);
133 fOutputList->Add(fEventCounter);
136 histcounter = new TH1D("histcounter","histcounter", 10, 0.5,10.5);
137 fOutputList->Add(histcounter);
141 fCentralityCounter = new TH1D("fEventCounter","EventCounter", 100, 0.5,100.5);
142 TAxis *xaxis = fCentralityCounter->GetXaxis();
143 for(Int_t ibin=0;ibin<100;ibin++)
145 BinLebel="cent";BinLebel+=ibin;
146 xaxis->SetBinLabel(ibin,BinLebel.Data());
149 fOutputList->Add(fCentralityCounter);
151 fHistMultV0A = new TH1F("fHistMultV0A","Mult-VOA",22000,0,22000);
152 fHistMultV0C = new TH1F("fHistMultV0C","Mult-VOC",22000,0,22000);
153 fHistMultV0total = new TH1F("fHistMultV0total","Mult-VOTotal",22000,0,22000);
156 fHistNchEta = new TH1D("fHistNchEta", "#eta distribution of charged tracks(for hybrid)", 200, -0.8, 0.8);
157 fHistNchEta->GetXaxis()->SetTitle("#eta");
158 fHistNchEta->GetYaxis()->SetTitle("dNch/d#eta");
161 fHistNchEtaCent = new TH1D("fHistNchEtaCent", "Central #eta distribution of charged tracks(for hybrid)", 200, -0.8, 0.8);
162 fHistNchEtaCent->GetXaxis()->SetTitle("#eta");
163 fHistNchEtaCent->GetYaxis()->SetTitle("dNch/d#eta(Central)");
167 fHistNchPhi = new TH1D("fHistNchPhi", "#phi distribution of charged tracks(for hybrid)", 200, -10, 10);
168 fHistNchPhi->GetXaxis()->SetTitle("#phi");
169 fHistNchPhi->GetYaxis()->SetTitle("dNch/d#phi");
171 fHistNchPt = new TH1D("fHistNchPt", "P_{T} distribution(charged tracks for hybrid)", 150, 0.1, 3.1);
172 fHistNchPt->GetXaxis()->SetTitle("P_{T} (GeV/c)");
173 fHistNchPt->GetYaxis()->SetTitle("dNch/dP_{T}(c/GeV)");
176 fHistchi2ndfvscs = new TH2D("fHistchi2ndfvscs","Chi2/ndf from Gaussian fits of Multiplicity Distribution",95,0,95,60,0,6);
177 fHistchi2ndfvscs->SetXTitle("%cs");
178 fHistchi2ndfvscs->SetYTitle("Chi2/ndf");
181 fHistnclus=new TH1D("no of clusters","no of tracks after TPCcluster cut",200,0,200);
182 fHistchi2ndf= new TH1D("chi_square/ndf","no of tracks after chi_square/ndf cut",10,0,10);
184 fHistVz = new TH1D("fHistVz","Primary vertex distribution - z coordinate",90,-15,15);
185 fHistVz->SetXTitle("Vz");
186 fHistVz->SetYTitle("Entries");
189 fOutputList->Add(fHistMultV0A);
190 fOutputList->Add(fHistMultV0C);
191 fOutputList->Add(fHistMultV0total);
192 fOutputList->Add(fHistnclus);
193 fOutputList->Add(fHistchi2ndf);
194 fOutputList->Add(fHistNchPt);
195 fOutputList->Add(fHistNchEta);
196 fOutputList->Add(fHistNchEtaCent);
198 fOutputList->Add(fHistNchPhi);
199 fOutputList->Add(fHistVz);
200 fOutputList->Add(fHistchi2ndfvscs);
207 for(Int_t i = 0; i < 25; i++) {
208 hname = "fMult"; hname+=i;
209 htitle = "Multiplicity in Cent Bin "; htitle+=i;
210 fMult[i] = new TH1F(hname.Data(),htitle.Data(),5000,0.5,5000.5);
211 fOutputList->Add(fMult[i]);
214 for(Int_t i = 25; i < 50; i++) {
215 hname = "fMult"; hname+=i;
216 htitle = "Multiplicity in Cent Bin "; htitle+=i;
217 fMult[i] = new TH1F(hname.Data(),htitle.Data(),3000,0.5,3000.5);
218 fOutputList->Add(fMult[i]);
221 for(Int_t i = 50; i < 91; i++) {
222 hname = "fMult"; hname+=i;
223 htitle = "Multiplicity in Cent Bin "; htitle+=i;
224 fMult[i] = new TH1F(hname.Data(),htitle.Data(),2000,0.5,2000.5);
225 fOutputList->Add(fMult[i]);
228 //****************for 2% centrality bin**************************//
229 for(Int_t i = 0; i < 12; i++) {
230 hname = "fMultTwo"; hname+=i;
231 htitle = "Multiplicity in Cent Bin "; htitle+=i;
232 fMultTwo[i] = new TH1F(hname.Data(),htitle.Data(),5000,0.5,5000.5);
233 fOutputList->Add(fMultTwo[i]);
236 for(Int_t i = 12; i < 25; i++) {
237 hname = "fMultTwo"; hname+=i;
238 htitle = "Multiplicity in Cent Bin "; htitle+=i;
239 fMultTwo[i] = new TH1F(hname.Data(),htitle.Data(),3000,0.5,3000.5);
240 fOutputList->Add(fMultTwo[i]);
243 for(Int_t i = 25; i <= 45; i++) {
244 hname = "fMultTwo"; hname+=i;
245 htitle = "Multiplicity in Cent Bin "; htitle+=i;
246 fMultTwo[i] = new TH1F(hname.Data(),htitle.Data(),2000,0.5,2000.5);
247 fOutputList->Add(fMultTwo[i]);
252 //*****************************for 5 % centrality bin********************//
253 for(Int_t i = 0; i < 5; i++) {
254 hname = "fMultFive"; hname+=i;
255 htitle = "Multiplicity in Cent Bin "; htitle+=i;
256 fMultFive[i] = new TH1F(hname.Data(),htitle.Data(),5000,0.5,5000.5);
257 fOutputList->Add(fMultFive[i]);
260 for(Int_t i = 5; i < 10; i++) {
261 hname = "fMultFive"; hname+=i;
262 htitle = "Multiplicity in Cent Bin "; htitle+=i;
263 fMultFive[i] = new TH1F(hname.Data(),htitle.Data(),3000,0.5,3000.5);
264 fOutputList->Add(fMultFive[i]);
267 for(Int_t i = 10; i <= 14; i++) {
268 hname = "fMultFive"; hname+=i;
269 htitle = "Multiplicity in Cent Bin "; htitle+=i;
270 fMultFive[i] = new TH1F(hname.Data(),htitle.Data(),2000,0.5,2000.5);
271 fOutputList->Add(fMultFive[i]);
277 //________________________________________________________________________
278 void AliEbyEMultFluctuationTask::UserExec(Option_t *)
284 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
286 printf("ERROR: fAOD not available\n");
291 Bool_t isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
292 if(!isSelected) return;
293 fEventCounter->Fill(1);
297 // Get the event vertex.
298 fAODVertex = fAOD->GetPrimaryVertex();
304 if(TMath::Abs((fAODVertex->GetZ())-((fAOD->GetPrimaryVertexSPD())->GetZ())) > 0.5) return;
307 if (!SelectEvent(fAODVertex)) return;
309 //***************VZERO-AMPLITUDE*************************//
311 AliAODVZERO *aodV0 = fAOD->GetVZEROData();
312 Float_t fV0Amult = aodV0->GetMTotV0A();
313 Float_t fV0Cmult = aodV0->GetMTotV0C();
314 Float_t fV0total = fV0Amult + fV0Cmult;
316 //*****************SPD-CLUSTERS*************************//
320 AliAODHeader *fHeader = fAOD->GetHeader();
321 Int_t spdmult0 = fHeader->GetNumberOfITSClusters(0);
322 Int_t spdmult1 = fHeader->GetNumberOfITSClusters(1);
323 Int_t run = fHeader->GetRunNumber();
325 AliAODTracklets *fTracklets = fAOD->GetTracklets();
326 Int_t tracklets = fTracklets->GetNumberOfTracklets();
329 //********************CENTRALITY******************************************//
331 AliCentrality *centrality= fAOD->GetCentrality();
332 Double_t cent=centrality->GetCentralityPercentile("V0M");
333 // cout<<"cent= "<<cent<<endl;
335 if(cent < 0 || cent >= 91) return;
337 Int_t nCentrality = (Int_t)cent;
339 Int_t nBin2= (Int_t)( nCentrality/2.0);
341 Int_t nBin5 = (Int_t)( nCentrality/5.0);
344 histcounter->Fill(1);
349 fCentralityCounter->Fill(nCentrality);
351 fEventCounter->Fill(7);
358 //printf("There are %d tracks in this event\n", fAOD->GetNumberOfTracks());
361 for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) {
362 AliAODTrack* track = fAOD->GetTrack(iTracks);
364 printf("ERROR: Could not receive track %d\n", iTracks);
371 // Find the track classification.
372 Int_t tracktype = SelectTrack(track);
379 if(track->GetType()== AliAODTrack::kPrimary)
381 Short_t Charge = track->Charge();
382 Double_t eta = track->Eta();
383 if(TMath :: Abs(Charge)==1 && nBin5==0){
384 fHistNchEtaCent->Fill(eta);
388 Double_t pt = track->Pt();
389 if( pt < 0.3 || pt > 2.0 ) continue;
390 Double_t nclus = track->GetTPCClusterInfo(2,1);
391 Double_t chi2ndf = track->Chi2perNDF();
392 fHistnclus->Fill(nclus);
393 fHistchi2ndf->Fill(chi2ndf);
394 fHistchi2ndfvscs->Fill(cent,chi2ndf);
396 //Count the charge particles-----
397 if(TMath :: Abs(Charge)==1) Mult +=1;
398 if(Charge==1) Mult1 +=1;
399 if(Charge==-1) Mult2 +=1;
402 Double_t phi = track->Phi();
403 if(TMath :: Abs(Charge)==1) fHistNchPt->Fill(pt);
406 if(TMath :: Abs(Charge)==1) fHistNchEta->Fill(eta);
407 if(TMath :: Abs(Charge)==1) fHistNchPhi->Fill(phi);
416 //****************Filling Tree*************************//
418 My_ntuple->Fill(Mult,Mult1,Mult2,nCentrality,fV0total,nBin2,nBin5,spdmult0,spdmult1,tracklets,run);
421 fMult[nCentrality]->Fill(Mult);
424 fMultTwo[nBin2]->Fill(Mult);
427 fMultFive[nBin5]->Fill(Mult);
430 fHistMultV0A->Fill(fV0Amult);
431 fHistMultV0C->Fill(fV0Cmult);
432 fHistMultV0total->Fill(fV0total);
434 PostData(1, fOutputList);
436 //________________________________________________________________________
437 void AliEbyEMultFluctuationTask::Terminate(Option_t *)
441 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
443 printf("ERROR: Output list not available\n");