1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: ALICE Offline. *
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 // AliEbyE Analysis for Particle Ratio Fluctuation //
19 // Deepika Rathee | Satyajit Jena //
20 // drathee@cern.ch | sjena@cern.ch //
21 // Date: Wed Jul 9 18:38:30 CEST 2014 //
22 // New approch to find particle ratio to reduce memory //
24 //=========================================================================//
35 #include "AliMCEvent.h"
36 #include "AliMCParticle.h"
37 #include "AliESDtrackCuts.h"
38 #include "AliESDInputHandler.h"
39 #include "AliESDpid.h"
40 #include "AliCentrality.h"
41 #include "AliTracker.h"
42 #include "AliAODInputHandler.h"
43 #include "AliAODEvent.h"
44 #include "AliAODTrack.h"
45 #include "AliAODMCParticle.h"
46 #include "AliEbyEPidRatioQA.h"
50 ClassImp(AliEbyEPidRatioQA)
51 //________________________________________________________________________
52 AliEbyEPidRatioQA::AliEbyEPidRatioQA() :
53 AliEbyEPidRatioBase("QA", "QA"),
58 AliLog::SetClassDebugLevel("AliEbyEPidRatioQA",10);
61 //________________________________________________________________________
62 AliEbyEPidRatioQA::~AliEbyEPidRatioQA() {
68 //________________________________________________________________________
69 void AliEbyEPidRatioQA::CreateHistograms() {
71 Int_t binHnQA[17] = {AliEbyEPidRatioHelper::fgkfHistNBinsCent, AliEbyEPidRatioHelper::fgkfHistNBinsEta, // cent | eta
72 AliEbyEPidRatioHelper::fgkfHistNBinsRap, AliEbyEPidRatioHelper::fgkfHistNBinsPhi, // y | phi
73 AliEbyEPidRatioHelper::fgkfHistNBinsPt, AliEbyEPidRatioHelper::fgkfHistNBinsPt, // pt | pInner
74 AliEbyEPidRatioHelper::fgkfHistNBinsSign, 500, // sign | TPCsignal |
75 50, 50, 50, // nSigmaITS | nSigmaTPC | nSigmaTOF
76 50, 50, 50, 50, // DCAr | DCAz | nSigmaDCAr | nSigmaDCAz
79 Double_t minHnQA[17] = {AliEbyEPidRatioHelper::fgkfHistRangeCent[0], AliEbyEPidRatioHelper::fgkfHistRangeEta[0],
80 AliEbyEPidRatioHelper::fgkfHistRangeRap[0], AliEbyEPidRatioHelper::fgkfHistRangePhi[0],
81 AliEbyEPidRatioHelper::fgkfHistRangePt[0], AliEbyEPidRatioHelper::fgkfHistRangePt[0],
82 AliEbyEPidRatioHelper::fgkfHistRangeSign[0], 30,
84 -10., -10., -10., -10.,
87 Double_t maxHnQA[17] = {AliEbyEPidRatioHelper::fgkfHistRangeCent[1], AliEbyEPidRatioHelper::fgkfHistRangeEta[1],
88 AliEbyEPidRatioHelper::fgkfHistRangeRap[1], AliEbyEPidRatioHelper::fgkfHistRangePhi[1],
89 AliEbyEPidRatioHelper::fgkfHistRangePt[1], AliEbyEPidRatioHelper::fgkfHistRangePt[1],
90 AliEbyEPidRatioHelper::fgkfHistRangeSign[1], 500,
96 fHnQA = new THnSparseF("hnQA", "cent:eta:y:phi:pt:pInner:sign:TPCsignal:nSigmaITS:nSigmaTPC:nSigmaTOF:DCAr:DCAz:nSigmaDCAr:nSigmaDCAz:MCisProbe",
97 17, binHnQA, minHnQA, maxHnQA);
101 fHnQA->GetAxis(0)->SetTitle("centrality"); // 0-5|5-10|10-20|20-30|30-40|40-50|50-60|60-70|70-80|80-90 --> 10 bins
102 fHnQA->GetAxis(1)->SetTitle("#eta"); // eta [-0.9, 0.9]
103 fHnQA->GetAxis(2)->SetTitle("#it{y}"); // rapidity [-0.5, 0.5]
104 fHnQA->GetAxis(3)->SetTitle("#varphi"); // phi [ 0. , 2Pi]
105 fHnQA->GetAxis(4)->SetTitle("#it{p}_{T} (GeV/#it{c})"); // pt [ 0.46, 2.22]
106 fHnQA->GetAxis(5)->SetTitle("#it{p}_{Inner} (GeV/#it{c})"); // pInner [ 0.1, 3.0]
107 fHnQA->GetAxis(6)->SetTitle("sign"); // -1 | 0 | +1
109 fHnQA->GetAxis(7)->SetTitle("TPC signal"); // TPCsignal [30, 500]
110 fHnQA->GetAxis(8)->SetTitle("n #sigma ITS"); // nSigma ITS [-10, 10]
111 fHnQA->GetAxis(9)->SetTitle("n #sigma TPC"); // nSigma TPC [-10, 10]
112 fHnQA->GetAxis(10)->SetTitle("n #sigma TOF"); // nSigma TOF [-10, 10]
114 fHnQA->GetAxis(11)->SetTitle("DCAr"); // DCAr [-10, 10]
115 fHnQA->GetAxis(12)->SetTitle("DCAz"); // DCAz [-10, 10]
116 fHnQA->GetAxis(13)->SetTitle("n #sigma #sqrt(Cdd)/DCAr"); // nSigma DCAr [-10, 10]
117 fHnQA->GetAxis(14)->SetTitle("n #sigma #sqrt(Czz)/DCAz"); // nSigma DCAz [-10, 10]
118 fHnQA->GetAxis(15)->SetTitle("MCisProbe"); // 0 | 1 (isProbeParticle) | 2 (isProbeParticle wrong sign)
119 fHnQA->GetAxis(16)->SetTitle("PID"); // 0 | 1 | 2 | 3
121 fHelper->BinLogAxis(fHnQA, 4);
122 fHelper->BinLogAxis(fHnQA, 5);
127 //________________________________________________________________________
128 void AliEbyEPidRatioQA::Process() {
130 fESDTrackCuts->GetEtaRange(etaRange[0],etaRange[1]);
133 fESDTrackCuts->GetPtRange(ptRange[0],ptRange[1]);
136 for (Int_t idxTrack = 0; idxTrack < fNTracks; ++idxTrack) {
138 AliVTrack *track = (fESD) ? static_cast<AliVTrack*>(fESD->GetTrack(idxTrack)) : static_cast<AliVTrack*>(fAOD->GetTrack(idxTrack));
140 // -- Check if track is accepted for basic parameters
141 if (!fHelper->IsTrackAcceptedBasicCharged(track))
144 // -- Check if accepted - ESD
145 if (fESD && !fESDTrackCuts->AcceptTrack(dynamic_cast<AliESDtrack*>(track)))
148 // -- Check if accepted - AOD
150 AliAODTrack * trackAOD = dynamic_cast<AliAODTrack*>(track);
153 AliError("Pointer to dynamic_cast<AliAODTrack*>(track) = ZERO");
156 if (!trackAOD->TestFilterBit(fAODtrackCutBit))
159 // -- Check if in pT and eta range (is done in ESDTrackCuts for ESDs)
160 if(!(track->Pt() > ptRange[0] && track->Pt() <= ptRange[1] && TMath::Abs(track->Eta()) <= etaRange[1]))
168 if (fHelper->IsTrackAcceptedPID(track, pid, (AliPID::kPion))) { iPid = 1; gPdgCode = 211;}
169 else if (fHelper->IsTrackAcceptedPID(track, pid, (AliPID::kKaon))) { iPid = 2; gPdgCode = 321;}
170 else if (fHelper->IsTrackAcceptedPID(track, pid, (AliPID::kProton))){ iPid = 3; gPdgCode = 2212;}
174 if ((iPid != 0) && !fHelper->IsTrackAcceptedRapidity(track, yP, iPid))
177 if (!fHelper->IsTrackAcceptedDCA(track))
180 // -- Check if probe particle
181 Int_t isProbeParticle = 0;
183 Int_t label = TMath::Abs(track->GetLabel());
185 AliVParticle* particle = (fESD) ? fMCEvent->GetTrack(label) : static_cast<AliVParticle*>(fArrayMC->At(label));
187 if (TMath::Abs(particle->PdgCode()) == gPdgCode) {
189 if (particle->PdgCode() != (track->Charge()*gPdgCode))
196 Float_t dca[] = {0.,0.}; // dca_xy, dca_z,
197 Float_t cov[] = {0.,0.,0.}; // sigma_xy, sigma_xy_z, sigma_z
199 (static_cast<AliESDtrack*>(track))->GetImpactParameters(dca,cov);
201 Float_t dcaRoverCdd = ( TMath::Sqrt(cov[0]) != 0. ) ? dca[0]/TMath::Sqrt(cov[0]) : -9.99;
202 Float_t dcaZoverCzz = ( TMath::Sqrt(cov[2]) != 0. ) ? dca[1]/TMath::Sqrt(cov[2]) : -9.99;
208 // cout << pid[0] << " " << pid[1] << " " << pid[2] << yP << " " << iPid << endl;
211 Double_t aTrack[17] = {
212 Double_t(fCentralityBin), // 0 centrality
213 track->Eta(), // 1 eta
215 track->Phi(), // 3 phi
217 track->GetTPCmomentum(), // 5 pInner
218 track->Charge(), // 6 sign
219 track->GetTPCsignal(), // 7 TPC dE/dx
220 pid[0], // 8 n Sigma ITS
221 pid[1], // 9 n Sigma TPC
222 pid[2], // 10 n Sigma TOF
225 dcaRoverCdd, // 13 sqrt(cov[dd])
226 dcaZoverCzz, // 14 sqrt(cov[zz])
227 isProbeParticle, // 15 isProbe
234 Double_t aTrack[17] = {
235 Double_t(fCentralityBin), // 0 centrality
236 track->Eta(), // 1 eta
238 track->Phi(), // 3 phi
240 track->GetTPCmomentum(), // 5 pInner
241 track->Charge(), // 6 sign
242 track->GetTPCsignal(), // 7 TPC dE/dx
243 pid[0], // 8 n Sigma ITS
244 pid[1], // 9 n Sigma TPC
245 pid[2], // 10 n Sigma TOF
248 dcaRoverCdd, // 13 sqrt(cov[dd])
249 dcaZoverCzz, // 14 sqrt(cov[zz])
250 isProbeParticle, // 15 isProbe
256 } // for (Int_t idxTrack = 0; idxTrack < fNTracks; ++idxTrack) {