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"),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)
66 if(vertex->GetNContributors() < 0) return kFALSE;
69 Double_t lvx = vertex->GetX();
70 Double_t lvy = vertex->GetY();
71 Double_t lvz = vertex->GetZ();
73 fEventCounter->Fill(3);
76 if(TMath::Abs(lvx) > 0.3) return kFALSE;
77 if(TMath::Abs(lvy) > 0.3) return kFALSE;
78 if(TMath::Abs(lvz) > 10) return kFALSE;
79 if(vertex->GetType()==AliAODVertex::kPileupSPD) return kFALSE;
81 fEventCounter->Fill(5);
85 //_____________________________________________________________________________
86 Int_t AliEbyEMultFluctuationTask :: SelectTrack(AliAODTrack* track)
89 Double_t eta = track->Eta();
91 if(TMath :: Abs(eta)>0.8) return 0;
93 if(!track->TestFilterBit(128)) return 0;
99 if(TMath ::Abs(dxy) >2.4 || TMath ::Abs(dz)>3.0) return 0;
100 // cout<<dxy<<dz<<endl;
103 Double_t nclus = track->GetTPCClusterInfo(2,1);
104 if(nclus<80) return 0;
108 Double_t chi2ndf = track->Chi2perNDF();
109 if(chi2ndf>4) return 0;
116 //________________________________________________________________________________________________
117 void AliEbyEMultFluctuationTask::UserCreateOutputObjects()
119 fOutputList = new TList();
123 My_ntuple = new TNtuple("My_ntuple", "My_ntuple", "Mult:Mult1:Mult2:nCentrality:fV0total:nBin2:nBin5:spdmult0:spdmult1:tracklets:run");
124 fOutputList->Add(My_ntuple);
126 fOutputList->SetOwner(kTRUE);
127 fEventCounter = new TH1D("fEventCounter","EventCounter", 10, 0.5,10.5);
128 fOutputList->Add(fEventCounter);
131 histcounter = new TH1D("histcounter","histcounter", 10, 0.5,10.5);
132 fOutputList->Add(histcounter);
136 fCentralityCounter = new TH1D("fEventCounter","EventCounter", 100, 0.5,100.5);
137 TAxis *xaxis = fCentralityCounter->GetXaxis();
138 for(Int_t ibin=0;ibin<100;ibin++)
140 BinLebel="cent";BinLebel+=ibin;
141 xaxis->SetBinLabel(ibin,BinLebel.Data());
144 fOutputList->Add(fCentralityCounter);
146 fHistMultV0A = new TH1F("fHistMultV0A","Mult-VOA",22000,0,22000);
147 fHistMultV0C = new TH1F("fHistMultV0C","Mult-VOC",22000,0,22000);
148 fHistMultV0total = new TH1F("fHistMultV0total","Mult-VOTotal",22000,0,22000);
151 fHistNchEta = new TH1D("fHistNchEta", "#eta distribution of charged tracks(for hybrid)", 200, -0.8, 0.8);
152 fHistNchEta->GetXaxis()->SetTitle("#eta");
153 fHistNchEta->GetYaxis()->SetTitle("dNch/d#eta");
156 fHistNchEtaCent = new TH1D("fHistNchEtaCent", "Central #eta distribution of charged tracks(for hybrid)", 200, -0.8, 0.8);
157 fHistNchEtaCent->GetXaxis()->SetTitle("#eta");
158 fHistNchEtaCent->GetYaxis()->SetTitle("dNch/d#eta(Central)");
162 fHistNchPhi = new TH1D("fHistNchPhi", "#phi distribution of charged tracks(for hybrid)", 200, -10, 10);
163 fHistNchPhi->GetXaxis()->SetTitle("#phi");
164 fHistNchPhi->GetYaxis()->SetTitle("dNch/d#phi");
166 fHistNchPt = new TH1D("fHistNchPt", "P_{T} distribution(charged tracks for hybrid)", 150, 0.1, 3.1);
167 fHistNchPt->GetXaxis()->SetTitle("P_{T} (GeV/c)");
168 fHistNchPt->GetYaxis()->SetTitle("dNch/dP_{T}(c/GeV)");
171 fHistchi2ndfvscs = new TH2D("fHistchi2ndfvscs","Chi2/ndf from Gaussian fits of Multiplicity Distribution",95,0,95,60,0,6);
172 fHistchi2ndfvscs->SetXTitle("%cs");
173 fHistchi2ndfvscs->SetYTitle("Chi2/ndf");
176 fHistnclus=new TH1D("no of clusters","no of tracks after TPCcluster cut",200,0,200);
177 fHistchi2ndf= new TH1D("chi_square/ndf","no of tracks after chi_square/ndf cut",10,0,10);
179 fHistVz = new TH1D("fHistVz","Primary vertex distribution - z coordinate",90,-15,15);
180 fHistVz->SetXTitle("Vz");
181 fHistVz->SetYTitle("Entries");
184 fOutputList->Add(fHistMultV0A);
185 fOutputList->Add(fHistMultV0C);
186 fOutputList->Add(fHistMultV0total);
187 fOutputList->Add(fHistnclus);
188 fOutputList->Add(fHistchi2ndf);
189 fOutputList->Add(fHistNchPt);
190 fOutputList->Add(fHistNchEta);
191 fOutputList->Add(fHistNchEtaCent);
193 fOutputList->Add(fHistNchPhi);
194 fOutputList->Add(fHistVz);
195 fOutputList->Add(fHistchi2ndfvscs);
202 for(Int_t i = 0; i < 25; i++) {
203 hname = "fMult"; hname+=i;
204 htitle = "Multiplicity in Cent Bin "; htitle+=i;
205 fMult[i] = new TH1F(hname.Data(),htitle.Data(),5000,0.5,5000.5);
206 fOutputList->Add(fMult[i]);
209 for(Int_t i = 25; i < 50; i++) {
210 hname = "fMult"; hname+=i;
211 htitle = "Multiplicity in Cent Bin "; htitle+=i;
212 fMult[i] = new TH1F(hname.Data(),htitle.Data(),3000,0.5,3000.5);
213 fOutputList->Add(fMult[i]);
216 for(Int_t i = 50; i < 91; i++) {
217 hname = "fMult"; hname+=i;
218 htitle = "Multiplicity in Cent Bin "; htitle+=i;
219 fMult[i] = new TH1F(hname.Data(),htitle.Data(),2000,0.5,2000.5);
220 fOutputList->Add(fMult[i]);
223 //****************for 2% centrality bin**************************//
224 for(Int_t i = 0; i < 12; i++) {
225 hname = "fMultTwo"; hname+=i;
226 htitle = "Multiplicity in Cent Bin "; htitle+=i;
227 fMultTwo[i] = new TH1F(hname.Data(),htitle.Data(),5000,0.5,5000.5);
228 fOutputList->Add(fMultTwo[i]);
231 for(Int_t i = 12; i < 25; i++) {
232 hname = "fMultTwo"; hname+=i;
233 htitle = "Multiplicity in Cent Bin "; htitle+=i;
234 fMultTwo[i] = new TH1F(hname.Data(),htitle.Data(),3000,0.5,3000.5);
235 fOutputList->Add(fMultTwo[i]);
238 for(Int_t i = 25; i <= 45; i++) {
239 hname = "fMultTwo"; hname+=i;
240 htitle = "Multiplicity in Cent Bin "; htitle+=i;
241 fMultTwo[i] = new TH1F(hname.Data(),htitle.Data(),2000,0.5,2000.5);
242 fOutputList->Add(fMultTwo[i]);
247 //*****************************for 5 % centrality bin********************//
248 for(Int_t i = 0; i < 5; i++) {
249 hname = "fMultFive"; hname+=i;
250 htitle = "Multiplicity in Cent Bin "; htitle+=i;
251 fMultFive[i] = new TH1F(hname.Data(),htitle.Data(),5000,0.5,5000.5);
252 fOutputList->Add(fMultFive[i]);
255 for(Int_t i = 5; i < 10; i++) {
256 hname = "fMultFive"; hname+=i;
257 htitle = "Multiplicity in Cent Bin "; htitle+=i;
258 fMultFive[i] = new TH1F(hname.Data(),htitle.Data(),3000,0.5,3000.5);
259 fOutputList->Add(fMultFive[i]);
262 for(Int_t i = 10; i <= 14; i++) {
263 hname = "fMultFive"; hname+=i;
264 htitle = "Multiplicity in Cent Bin "; htitle+=i;
265 fMultFive[i] = new TH1F(hname.Data(),htitle.Data(),2000,0.5,2000.5);
266 fOutputList->Add(fMultFive[i]);
272 //________________________________________________________________________
273 void AliEbyEMultFluctuationTask::UserExec(Option_t *)
279 fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
281 printf("ERROR: fAOD not available\n");
286 Bool_t isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
287 if(!isSelected) return;
288 fEventCounter->Fill(1);
292 // Get the event vertex.
293 fAODVertex = fAOD->GetPrimaryVertex();
295 if(TMath::Abs((fAODVertex->GetZ())-((fAOD->GetPrimaryVertexSPD())->GetZ())) > 0.5) return;
303 if (!SelectEvent(fAODVertex)) return;
305 //***************VZERO-AMPLITUDE*************************//
307 AliAODVZERO *aodV0 = fAOD->GetVZEROData();
308 Float_t fV0Amult = aodV0->GetMTotV0A();
309 Float_t fV0Cmult = aodV0->GetMTotV0C();
310 Float_t fV0total = fV0Amult + fV0Cmult;
312 //*****************SPD-CLUSTERS*************************//
316 AliAODHeader *fHeader = fAOD->GetHeader();
317 Int_t spdmult0 = fHeader->GetNumberOfITSClusters(0);
318 Int_t spdmult1 = fHeader->GetNumberOfITSClusters(1);
319 Int_t run = fHeader->GetRunNumber();
321 AliAODTracklets *fTracklets = fAOD->GetTracklets();
322 Int_t tracklets = fTracklets->GetNumberOfTracklets();
325 //********************CENTRALITY******************************************//
327 AliCentrality *centrality= fAOD->GetCentrality();
328 Double_t cent=centrality->GetCentralityPercentile("V0M");
329 // cout<<"cent= "<<cent<<endl;
331 if(cent < 0 || cent >= 91) return;
333 Int_t nCentrality = (Int_t)cent;
335 Int_t nBin2= (Int_t)( nCentrality/2.0);
337 Int_t nBin5 = (Int_t)( nCentrality/5.0);
340 histcounter->Fill(1);
345 fCentralityCounter->Fill(nCentrality);
347 fEventCounter->Fill(7);
354 //printf("There are %d tracks in this event\n", fAOD->GetNumberOfTracks());
357 for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) {
358 AliAODTrack* track = fAOD->GetTrack(iTracks);
360 printf("ERROR: Could not receive track %d\n", iTracks);
367 // Find the track classification.
368 Int_t tracktype = SelectTrack(track);
375 if(track->GetType()== AliAODTrack::kPrimary)
377 Short_t Charge = track->Charge();
378 Double_t eta = track->Eta();
379 if(TMath :: Abs(Charge)==1 && nBin5==0){
380 fHistNchEtaCent->Fill(eta);
384 Double_t pt = track->Pt();
385 if( pt < 0.3 || pt > 2.0 ) continue;
386 Double_t nclus = track->GetTPCClusterInfo(2,1);
387 Double_t chi2ndf = track->Chi2perNDF();
388 fHistnclus->Fill(nclus);
389 fHistchi2ndf->Fill(chi2ndf);
390 fHistchi2ndfvscs->Fill(cent,chi2ndf);
392 //Count the charge particles-----
393 if(TMath :: Abs(Charge)==1) Mult +=1;
394 if(Charge==1) Mult1 +=1;
395 if(Charge==-1) Mult2 +=1;
398 Double_t phi = track->Phi();
399 if(TMath :: Abs(Charge)==1) fHistNchPt->Fill(pt);
402 if(TMath :: Abs(Charge)==1) fHistNchEta->Fill(eta);
403 if(TMath :: Abs(Charge)==1) fHistNchPhi->Fill(phi);
412 //****************Filling Tree*************************//
414 My_ntuple->Fill(Mult,Mult1,Mult2,nCentrality,fV0total,nBin2,nBin5,spdmult0,spdmult1,tracklets,run);
417 fMult[nCentrality]->Fill(Mult);
420 fMultTwo[nBin2]->Fill(Mult);
423 fMultFive[nBin5]->Fill(Mult);
426 fHistMultV0A->Fill(fV0Amult);
427 fHistMultV0C->Fill(fV0Cmult);
428 fHistMultV0total->Fill(fV0total);
430 PostData(1, fOutputList);
432 //________________________________________________________________________
433 void AliEbyEMultFluctuationTask::Terminate(Option_t *)
437 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
439 printf("ERROR: Output list not available\n");