9 #include "AliAnalysisTaskSE.h"
10 #include "AliAnalysisManager.h"
12 #include "AliESDEvent.h"
13 #include "AliESDInputHandler.h"
14 #include "AliESDtrackCuts.h"
16 #include "AliMCEvent.h"
18 #include "AliMCEventHandler.h"
20 #include "AliAnalysisTaskPtFluc.h"
25 // Analysis of Pt Fluctuations (pp)
26 // Author: Stefan Heckel
27 // Version of pp task: 11.4, 11.06.2012
30 ClassImp(AliAnalysisTaskPtFluc)
32 //________________________________________________________________________
33 AliAnalysisTaskPtFluc::AliAnalysisTaskPtFluc(const char *name)
34 :AliAnalysisTaskSE(name),
61 fMultEventMeanPtSq(0),
64 fTwoPartCorrEvSample(0),
65 fTwoPartCorrEvSampleSq(0),
73 DefineOutput(1, TList::Class());
76 //________________________________________________________________________
77 AliAnalysisTaskPtFluc::~AliAnalysisTaskPtFluc()
79 if (fRandom3) delete fRandom3; fRandom3 = 0;
87 if (fESDTrackCuts) delete fESDTrackCuts; fESDTrackCuts = 0;
91 //________________________________________________________________________
92 void AliAnalysisTaskPtFluc::UserCreateOutputObjects()
97 OpenFile(1, "RECREATE");
98 fOutputList = new TList();
99 fOutputList->SetOwner();
102 fPtSpec = new TH1F("fPtSpec","Pt spectrum",100,0,2.5);
103 fPtSpec2 = new TH1F("fPtSpec2","Pt spectrum 2 - MC ESD",100,0,2.5);
104 fMult = new TH1F("fMult","Multiplicity distribution",120,-0.5,119.5);
106 fEta = new TH1F("fEta","Eta distribution",80,-2,2);
107 fEtaPhiPlus = new TH1F("fEtaPhiPlus","Phi distribution for positive eta",62,0,6.2);
108 fEtaPhiMinus = new TH1F("fEtaPhiMinus","Phi distribution for negative eta",62,0,6.2);
110 fVtxZ = new TH1F("fVtxZ","Vertex Z distribution before cuts",100,-20,20);
111 fVtxZCut = new TH1F("fVtxZCut","Vertex Z distribution after vtxZ cut",110,-11,11);
112 fVtxZCont = new TH1F("fVtxZCont","Vertex Z distribution after nCont cut",110,-11,11);
113 fVtxZCutDiff = new TH1F("fVtxZCutDiff","Vertex Z distribution after cut on vtx Z Diff",110,-11,11);
114 fVtxZPileup = new TH1F("fVtxZPileup","Vertex Z distribution after pileup rejection",110,-11,11);
115 fVtxZTrackCuts = new TH1F("fVtxZTrackCuts","Vertex Z distribution after track cuts",110,-11,11);
117 fVtxZDiff1 = new TH1F("fVtxZDiff1","Difference 1 between vertex Z distributions",100,-5,5);
118 fVtxZDiff2 = new TH1F("fVtxZDiff2","Difference 2 between vertex Z distributions",100,-5,5);
119 fVtxZDiff3 = new TH1F("fVtxZDiff3","Difference 3 between vertex Z distributions",100,-5,5);
120 fVtxZDiff1b = new TH1F("fVtxZDiff1b","Difference 1 between vertex Z distributions after all cuts",100,-5,5);
121 fVtxZDiff2b = new TH1F("fVtxZDiff2b","Difference 2 between vertex Z distributions after all cuts",100,-5,5);
122 fVtxZDiff3b = new TH1F("fVtxZDiff3b","Difference 3 between vertex Z distributions after all cuts",100,-5,5);
125 fEventMeanPt = new TH1F("fEventMeanPt","Mean-Pt distribution",50,0,2.5);
126 fEventMeanPtSq = new TH1F("fEventMeanPtSq","Mean-Pt squared distribution",100,0,5);
127 fEventMeanPtMult = new TH2F("fEventMeanPtMult","Mean-Pt for single events vs. multiplicity",20,0,100,200,0.,2.);
129 fMultEventMeanPt = new TH1F("fMultEventMeanPt","Mean-Pt event by event vs. Multiplicity",100,-0.5,99.5);
130 fMultEventMeanPtSq = new TH1F("fMultEventMeanPtSq","Mean-Pt event by event squared vs. Multiplicity",100,-0.5,99.5);
133 fTwoPartCorrEv = new TH1F("fTwoPartCorrEv","Two-particle correlator vs. Multiplicity",100,-0.5,99.5);
134 fTwoPartCorrEvSq = new TH1F("fTwoPartCorrEvSq","Two-particle correlator squared vs. Multiplicity",100,-0.5,99.5);
135 fTwoPartCorrEvSample = new TH1F("fTwoPartCorrEvSample","Two-particle correlator vs. Multiplicity",100,-0.5,99.5);
136 fTwoPartCorrEvSampleSq = new TH1F("fTwoPartCorrEvSampleSq","Two-particle correlator squared vs. Multiplicity",100,-0.5,99.5);
139 // Add histograms to the output list
140 fOutputList->Add(fPtSpec);
141 fOutputList->Add(fPtSpec2);
142 fOutputList->Add(fMult);
143 fOutputList->Add(fEta);
144 fOutputList->Add(fEtaPhiPlus);
145 fOutputList->Add(fEtaPhiMinus);
146 fOutputList->Add(fVtxZ);
147 fOutputList->Add(fVtxZCut);
148 fOutputList->Add(fVtxZCont);
149 fOutputList->Add(fVtxZCutDiff);
150 fOutputList->Add(fVtxZPileup);
151 fOutputList->Add(fVtxZTrackCuts);
152 fOutputList->Add(fVtxZDiff1);
153 fOutputList->Add(fVtxZDiff2);
154 fOutputList->Add(fVtxZDiff3);
155 fOutputList->Add(fVtxZDiff1b);
156 fOutputList->Add(fVtxZDiff2b);
157 fOutputList->Add(fVtxZDiff3b);
158 fOutputList->Add(fEventMeanPt);
159 fOutputList->Add(fEventMeanPtSq);
160 fOutputList->Add(fEventMeanPtMult);
161 fOutputList->Add(fMultEventMeanPt);
162 fOutputList->Add(fMultEventMeanPtSq);
163 fOutputList->Add(fTwoPartCorrEv);
164 fOutputList->Add(fTwoPartCorrEvSq);
165 fOutputList->Add(fTwoPartCorrEvSample);
166 fOutputList->Add(fTwoPartCorrEvSampleSq);
168 // Post output data (if histograms are not used later, PostData is at least called here)
169 PostData(1, fOutputList);
173 //________________________________________________________________________
174 void AliAnalysisTaskPtFluc::UserExec(Option_t *)
177 // Called for each event
180 // --- ESD event handler ---
181 if (!fMC || fMCType < 3) {
183 // Printf("ESD handler");
185 AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
188 Printf("ERROR: Could not get ESDInputHandler");
191 fESD = esdH->GetEvent();
195 Printf("ERROR: fESD not available");
199 if(!fESDTrackCuts) Printf("ERROR: No esd track cut");
201 } // --- End ESD event handler ---
204 // --- MC event handler ---
206 AliStack *stack = NULL;
210 // Printf("MC handler");
212 AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
215 Printf("ERROR: Could not get MCInputHandler");
219 fMCev = mcH->MCEvent();
223 Printf("ERROR: fMCev not available");
227 stack = fMCev->Stack();
231 // --- End MC event handler ---
234 // --- Vertex cuts ---
236 Double_t vtxZGlobal=0., vtxZSPD=0., vtxZTPC=0.;
237 Double_t vtxNContGlobal=0.;
238 // Double_t vtxNContSPD=0., vtxNContTPC=0.;
239 Double_t vtxZ=0., vtxNCont=0.;
240 Double_t vtxZdiff1=0., vtxZdiff2=0., vtxZdiff3=0.;
242 if (!fMC || fMCType < 3) {
245 const AliESDVertex* vtxESD = fESD->GetPrimaryVertexTracks();
246 vtxZGlobal = vtxESD->GetZ();
247 vtxNContGlobal = vtxESD->GetNContributors();
250 const AliESDVertex* vtxESDSPD = fESD->GetPrimaryVertexSPD();
251 vtxZSPD = vtxESDSPD->GetZ();
252 // vtxNContSPD = vtxESDSPD->GetNContributors();
255 const AliESDVertex* vtxESDTPC = fESD->GetPrimaryVertexTPC();
256 vtxZTPC = vtxESDTPC->GetZ();
257 // vtxNContTPC = vtxESDTPC->GetNContributors();
260 vtxNCont = vtxNContGlobal;
262 fVtxZ->Fill(vtxZ); // VtxZ before cuts
264 // Differences between vertices
265 vtxZdiff1 = vtxZTPC - vtxZGlobal;
266 vtxZdiff2 = vtxZTPC - vtxZSPD;
267 vtxZdiff3 = vtxZGlobal - vtxZSPD;
268 fVtxZDiff1->Fill(vtxZdiff1);
269 fVtxZDiff2->Fill(vtxZdiff2);
270 fVtxZDiff3->Fill(vtxZdiff3);
272 // Event cut on the z-position of the vertex
273 if(vtxZ > fMaxVertexZ || vtxZ < (-1.*fMaxVertexZ)) {
274 // Printf("VertexZ out of range, Zv = %f",vtxZ);
278 fVtxZCut->Fill(vtxZ); // VtxZ after cut on vtxZ
280 // Event cut on the number of contributors
281 if(vtxNCont < fNContributors) {
282 // Printf("Vertex has no contributors");
286 fVtxZCont->Fill(vtxZ); // VtxZ after cut on nContributors
288 // Event cut on the difference of the z-positions of the vertices (TPC - global)
289 if (fMaxVertexZDiff1 > 0.) {
290 if(vtxZdiff1 > fMaxVertexZDiff1 || vtxZdiff1 < (-1.*fMaxVertexZDiff1)) {
291 // Printf("VertexZ Diff (TPC - global) out of range, vtxZdiff1 = %f",vtxZ);
296 fVtxZCutDiff->Fill(vtxZ); // VtxZ after cut on vtxZDiff
298 } // --- End vertex cuts ---
301 // --- Pileup rejection ---
302 if (!fMC || fMCType < 3) {
304 if (fESD->IsPileupFromSPD(3,0.8,3.,2.,5.)) {
305 // Printf("IsPileupFromSPD");
309 fVtxZPileup->Fill(vtxZ); // VtxZ after pileup rejection
311 } // --- End pileup rejection ---
314 Int_t nrTracks = 0; // count for number of tracks which pass the track cuts
315 // Int_t nrTracks2 = 0; // count for number of tracks which pass the track cuts - for MC ESD vs. MC truth
316 Int_t nrESDTracks = 0; // number of tracks in the ESD file
317 Int_t nrMCTracks = 0; // number of tracks in the MC file
318 Double_t sumPt = 0.; // sum of track Pts
319 Double_t twoPartCorrEv = 0.; // Two-particle correlator of one event for multiplicity bin analysis
320 Double_t twoPartCorrEvSample = 0.; // Two-part. corr. of one event for whole sample analysis
322 Double_t tracks[120] = {0.}; // array of track Pts, needed for the two-particle correlator
324 Double_t trackPt=0., trackEta=0., trackPhi=0.;
325 Double_t trackPt2=0.; // for MC ESD
326 Double_t eventMeanPt=0., eventMeanPtSq=0., evMptMult=0.;
327 Double_t twoPartCorrPair=0., twoPartCorrEvSq=0.;
328 Double_t twoPartCorrPairSample=0., twoPartCorrEvSampleSq=0.;
329 // Double_t nrPairs=0.;
331 Double_t *nbins = 0x0; // Mean pT values for multiplicity bin analysis
332 Double_t evMptSample=0.; // Mean pT value for whole sample analysis
334 Double_t random=0., trackPt40=0., ptRatio=0.;
337 fRandom3 = new TRandom3();
339 if (fMCType == 2 || fMCType == 4) { // MC, Type = mod. MC truth
340 fRandom3->SetSeed(0);
344 Double_t energy = 0.; // beam energy ---> has to be set by the user (in GeV) for MCType >= 3 (w/o ESD) <---
346 if (!fMC || fMCType < 3) {
347 energy = fESD->GetBeamEnergy();
351 // --- Mean pT values ---
353 // !!!!! Have to be calculated in a first run - for each sample, which should be analysed, separately! !!!!!
356 // -- Mean pT values for the multiplicity bins (starting with N = 0, therefore the first value has to be 0.000) --
358 // MC 900 GeV 10e13 (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2) ---> TPC standalone <------> values for MC ESD <---
359 Double_t nbinsMC900[100] = {0.000, 0.452, 0.468, 0.482, 0.497, 0.511, 0.524, 0.535, 0.544, 0.550, 0.557, 0.563, 0.567, 0.571, 0.576, 0.580, 0.583, 0.586, 0.590, 0.592, 0.595, 0.599, 0.600, 0.602, 0.604, 0.611, 0.604, 0.618, 0.614, 0.612, 0.632, 0.623, 0.617, 0.612, 0.640, 0.632, 0.649, 0.609, 0.658, 0.615, 0.677, 0.614, 0.646, 0.000, 0.000, 0.000, 0.000, 0.000, 0.672, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000};
361 // MC 2.76 TeV 11b10a (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2) ---> TPC standalone <------> values for MC ESD <---
362 Double_t nbinsMC276[100] = {0.000, 0.451, 0.467, 0.485, 0.505, 0.523, 0.540, 0.551, 0.563, 0.569, 0.577, 0.583, 0.588, 0.594, 0.598, 0.603, 0.608, 0.611, 0.615, 0.617, 0.622, 0.622, 0.626, 0.630, 0.633, 0.632, 0.637, 0.633, 0.641, 0.643, 0.650, 0.649, 0.655, 0.650, 0.669, 0.664, 0.653, 0.671, 0.668, 0.683, 0.693, 0.662, 0.765, 0.643, 0.677, 0.660, 0.000, 0.689, 0.708, 0.653, 0.635, 0.000, 0.719, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000};
364 // MC 7 TeV 10f6a (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2) ---> TPC standalone <------> values for MC ESD <---
365 Double_t nbinsMC7[100] = {0.000, 0.447, 0.465, 0.485, 0.508, 0.530, 0.548, 0.562, 0.573, 0.581, 0.589, 0.595, 0.601, 0.607, 0.612, 0.617, 0.621, 0.625, 0.629, 0.633, 0.637, 0.640, 0.643, 0.646, 0.649, 0.652, 0.654, 0.657, 0.659, 0.662, 0.664, 0.666, 0.668, 0.670, 0.672, 0.674, 0.677, 0.677, 0.680, 0.682, 0.684, 0.685, 0.687, 0.688, 0.693, 0.692, 0.692, 0.693, 0.696, 0.698, 0.696, 0.700, 0.702, 0.697, 0.701, 0.708, 0.712, 0.714, 0.705, 0.717, 0.702, 0.701, 0.716, 0.716, 0.761, 0.706, 0.750, 0.715, 0.731, 0.728, 0.711, 0.733, 0.000, 0.714, 0.704, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.652, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000};
366 // MC 7 TeV 10f6a (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2) ---> values for MC truth <---
367 // Double_t nbinsMC7[100] = {0.000, 0.441, 0.455, 0.473, 0.493, 0.515, 0.534, 0.550, 0.561, 0.570, 0.578, 0.585, 0.591, 0.597, 0.602, 0.607, 0.612, 0.616, 0.621, 0.624, 0.628, 0.631, 0.635, 0.638, 0.641, 0.644, 0.646, 0.649, 0.652, 0.654, 0.656, 0.659, 0.661, 0.663, 0.665, 0.666, 0.669, 0.670, 0.672, 0.674, 0.676, 0.678, 0.679, 0.683, 0.683, 0.685, 0.686, 0.686, 0.692, 0.693, 0.690, 0.691, 0.690, 0.692, 0.701, 0.701, 0.700, 0.704, 0.701, 0.704, 0.709, 0.698, 0.707, 0.711, 0.692, 0.739, 0.689, 0.715, 0.691, 0.720, 0.790, 0.670, 0.000, 0.717, 0.833, 0.716, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.619, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000};
370 // MC 7 TeV 10f6 (Phojet) (Pt-Range: 0.15 - 2) ---> TPC standalone <------> values for MC ESD <---
371 // Double_t nbinsMC7[100] = {0.000, 0.483, 0.490, 0.502, 0.515, 0.527, 0.535, 0.541, 0.545, 0.548, 0.552, 0.555, 0.558, 0.561, 0.563, 0.566, 0.568, 0.571, 0.573, 0.574, 0.576, 0.578, 0.579, 0.581, 0.582, 0.583, 0.584, 0.585, 0.585, 0.586, 0.586, 0.587, 0.588, 0.589, 0.588, 0.588, 0.588, 0.588, 0.587, 0.589, 0.588, 0.588, 0.587, 0.587, 0.586, 0.583, 0.588, 0.587, 0.589, 0.583, 0.586, 0.582, 0.584, 0.583, 0.585, 0.582, 0.587, 0.576, 0.580, 0.588, 0.566, 0.581, 0.594, 0.585, 0.531, 0.000, 0.580, 0.499, 0.534, 0.534, 0.580, 0.432, 0.674, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.655, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000};
372 // MC 7 TeV 10f6 (Phojet) (Pt-Range: 0.15 - 2) ---> values for MC truth <---
373 // Double_t nbinsMC7[100] = {0.000, 0.479, 0.483, 0.493, 0.506, 0.518, 0.527, 0.533, 0.537, 0.540, 0.543, 0.546, 0.549, 0.551, 0.554, 0.556, 0.558, 0.560, 0.562, 0.564, 0.566, 0.568, 0.569, 0.570, 0.571, 0.572, 0.573, 0.574, 0.575, 0.576, 0.576, 0.576, 0.577, 0.577, 0.577, 0.579, 0.577, 0.577, 0.577, 0.576, 0.577, 0.577, 0.577, 0.575, 0.575, 0.575, 0.573, 0.575, 0.571, 0.575, 0.568, 0.569, 0.570, 0.576, 0.566, 0.570, 0.568, 0.575, 0.565, 0.562, 0.564, 0.545, 0.563, 0.527, 0.551, 0.540, 0.571, 0.561, 0.562, 0.553, 0.000, 0.586, 0.000, 0.603, 0.480, 0.489, 0.566, 0.513, 0.715, 0.000, 0.000, 0.000, 0.441, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000};
376 // Data 900 GeV 10c.pass3 (Pt-Range: 0.15 - 2) ---> TPC standalone <---
377 Double_t nbinsData900[100] = {0.000, 0.488, 0.486, 0.489, 0.495, 0.504, 0.513, 0.521, 0.528, 0.535, 0.541, 0.545, 0.549, 0.554, 0.558, 0.561, 0.565, 0.568, 0.570, 0.573, 0.576, 0.577, 0.580, 0.583, 0.582, 0.587, 0.587, 0.589, 0.591, 0.594, 0.601, 0.599, 0.598, 0.601, 0.608, 0.609, 0.600, 0.606, 0.611, 0.605, 0.612, 0.603, 0.576, 0.606, 0.617, 0.609, 0.572, 0.607, 0.546, 0.000, 0.604, 0.000, 0.689, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000};
379 // Data 2.76 TeV 11a.pass2 w/oSDD (Pt-Range: 0.15 - 2) ---> TPC standalone <---
380 Double_t nbinsData276[100] = {0.000, 0.492, 0.491, 0.496, 0.503, 0.513, 0.523, 0.533, 0.541, 0.549, 0.555, 0.560, 0.565, 0.570, 0.574, 0.578, 0.582, 0.585, 0.589, 0.591, 0.594, 0.597, 0.599, 0.601, 0.604, 0.606, 0.608, 0.610, 0.612, 0.613, 0.615, 0.618, 0.619, 0.621, 0.622, 0.624, 0.625, 0.626, 0.626, 0.628, 0.632, 0.633, 0.633, 0.635, 0.635, 0.638, 0.634, 0.641, 0.642, 0.644, 0.638, 0.646, 0.644, 0.647, 0.644, 0.646, 0.640, 0.650, 0.650, 0.655, 0.666, 0.650, 0.659, 0.644, 0.646, 0.657, 0.629, 0.626, 0.602, 0.652, 0.629, 0.000, 0.659, 0.580, 0.000, 0.000, 0.000, 0.000, 0.000, 0.706, 0.000, 0.596, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000};
382 // Data 7 TeV 10d.pass2 + 10e.pass2 (Pt-Range: 0.15 - 2) ---> TPC standalone <---
383 Double_t nbinsData7[100] = {0.000, 0.492, 0.492, 0.497, 0.505, 0.516, 0.527, 0.538, 0.547, 0.555, 0.562, 0.568, 0.573, 0.578, 0.583, 0.587, 0.591, 0.595, 0.598, 0.601, 0.604, 0.607, 0.610, 0.612, 0.615, 0.617, 0.619, 0.621, 0.623, 0.625, 0.627, 0.629, 0.631, 0.632, 0.634, 0.636, 0.637, 0.639, 0.640, 0.642, 0.643, 0.645, 0.646, 0.647, 0.648, 0.650, 0.650, 0.652, 0.653, 0.654, 0.655, 0.657, 0.657, 0.659, 0.659, 0.659, 0.660, 0.663, 0.663, 0.662, 0.663, 0.665, 0.668, 0.665, 0.667, 0.668, 0.672, 0.671, 0.669, 0.672, 0.672, 0.671, 0.675, 0.666, 0.683, 0.670, 0.673, 0.676, 0.684, 0.672, 0.673, 0.675, 0.689, 0.678, 0.678, 0.720, 0.675, 0.690, 0.664, 0.622, 0.000, 0.698, 0.678, 0.686, 0.751, 0.657, 0.000, 0.663, 0.000, 0.677};
385 // -- End mean pT values for the multiplicity bins --
388 // -- Selection of MC/Data and energy; whole sample values --
392 if (energy < 1000.) {
394 // Printf(" -- MC, 900 GeV -- ");
396 evMptSample = 0.5281; // MC 900 GeV 10e13 (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2) ---> TPC standalone <---
400 else if (energy > 1000. && energy < 3000.) {
402 // Printf(" -- MC, 2.76 TeV -- ");
404 evMptSample = 0.5574; // MC 2.76 TeV 11b10a (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2) ---> TPC standalone <---
410 // Printf(" -- MC, 7 TeV -- ");
412 evMptSample = 0.5809; // MC 7 TeV 10f6a (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2) ---> TPC standalone <---
413 // evMptSample = 0.5732; // MC 7 TeV 10f6a (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2) ---> value for MC truth <---
415 // evMptSample = 0.5481; // MC 7 TeV 10f6 (Phojet) (Pt-Range: 0.15 - 2) ---> TPC standalone <---
416 // evMptSample = 0.5409; // MC 7 TeV 10f6 (Phojet) (Pt-Range: 0.15 - 2) ---> value for MC truth <---
424 if (energy < 1000.) {
426 // Printf(" -- Data, 900 GeV -- ");
428 evMptSample = 0.5263; // Data 900 GeV 10c.pass3 (Pt-Range: 0.15 - 2) ---> TPC standalone <---
430 nbins = nbinsData900;
432 else if (energy > 1000. && energy < 3000.) {
434 // Printf(" -- Data, 2.76 TeV -- ");
436 evMptSample = 0.5548; // Data 2.76 TeV 11a.pass2 w/oSDD (Pt-Range: 0.15 - 2) ---> TPC standalone <---
438 nbins = nbinsData276;
442 // Printf(" -- Data, 7 TeV -- ");
444 evMptSample = 0.5738; // Data 7 TeV 10d.pass2 + 10e.pass2 (Pt-Range: 0.15 - 2) ---> TPC standalone <---
451 // -- End selection of MC/Data and energy; whole sample values --
453 // --- End mean pT values ---
456 // --- Ratio of pT distributions MC ESD / MC truth ---
458 // MC 7 TeV 10f6a (Pythia6 - Perugia0) (Pt-Range: 0.15 - 2, array-range: 0 - 2.1 GeV/c)
459 Double_t nbinsPtRatio[84] = {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.823, 0.908, 0.908, 0.901, 0.903, 0.910, 0.918, 0.931, 0.941, 0.947, 0.951, 0.953, 0.956, 0.959, 0.959, 0.960, 0.961, 0.962, 0.963, 0.963, 0.963, 0.964, 0.964, 0.964, 0.963, 0.963, 0.963, 0.964, 0.964, 0.962, 0.963, 0.964, 0.963, 0.963, 0.962, 0.962, 0.961, 0.963, 0.964, 0.964, 0.965, 0.965, 0.965, 0.964, 0.964, 0.964, 0.964, 0.964, 0.963, 0.964, 0.961, 0.957, 0.958, 0.959, 0.959, 0.958, 0.958, 0.957, 0.959, 0.956, 0.956, 0.954, 0.954, 0.956, 0.955, 0.954, 0.954, 0.954, 0.955, 0.954, 0.951, 0.952, 0.951, 0.949, 0.000, 0.000, 0.000, 0.000};
461 // --- End ratio of pT distributions MC ESD / MC truth ---
464 if (!fMC || fMCType < 3) {
465 nrESDTracks = fESD->GetNumberOfTracks();
469 nrMCTracks = stack->GetNtrack();
472 // Printf("\n\n nrESDTracks: %i nrMCTracks : %i \n",nrESDTracks,nrMCTracks);
477 if (fMCType == 0) { // MC, Type = ESD
480 // --- Loop over all tracks of one ESD event ---
481 for (Int_t iTracks = 0; iTracks < nrESDTracks; iTracks++) {
483 AliESDtrack* track = fESD->GetTrack(iTracks);
486 Printf("ERROR: Could not receive track %d\n", iTracks);
490 if(!fESDTrackCuts->AcceptTrack(track))continue;
492 trackPt = track->Pt();
493 fPtSpec->Fill(trackPt);
494 tracks[nrTracks] = trackPt;
496 trackEta = track->Eta();
497 fEta->Fill(trackEta);
499 trackPhi = track->Phi();
502 fEtaPhiPlus->Fill(trackPhi);
504 else if (trackEta < 0.) {
505 fEtaPhiMinus->Fill(trackPhi);
508 sumPt = sumPt + trackPt;
511 // Printf("Track Pt = %.3f Track Eta = %.3f Track Phi = %3f\n",trackPt,trackEta,trackPhi);
513 } // --- End track loop ---
516 } // End MC, Type = ESD
517 else if (fMCType > 0) { // MC, Type = MC truth
520 // --- Loop over all tracks of one MC event - MC truth / stack ---
521 for (Int_t iTracks = 0; iTracks < nrMCTracks; iTracks++) {
523 TParticle *track = stack->Particle(iTracks);
526 Printf("ERROR: Could not receive track %d\n", iTracks);
530 // only charged particles
531 TParticlePDG* pdg = track->GetPDG();
534 Double_t charge = pdg->Charge()/3.;
535 if ( TMath::Abs(charge) < 0.001 ) continue;
537 // only physical primary
538 Bool_t prim = stack->IsPhysicalPrimary(iTracks);
541 // get pt, eta and phi and cut in eta and pt
542 trackPt = track->Pt();
543 trackEta = track->Eta();
544 trackPhi = track->Phi();
546 // Printf("Track Pt = %.3f Track Eta = %.3f Track Phi = %3f ",trackPt,trackEta,trackPhi);
548 if (trackEta > 0.8) continue;
549 if (trackEta < -0.8) continue;
551 if (trackPt < 0.15) continue;
552 if (trackPt > 2.) continue;
554 // Printf("Track Pt = %.3f Track Eta = %.3f Track Phi = %3f ",trackPt,trackEta,trackPhi);
555 // Printf("-> Track accepted!");
558 // -- Reject tracks according to ratio of pT distribution MC ESD / MC truth --
559 if (fMCType == 2 || fMCType == 4) { // MC, Type = mod. MC truth
561 trackPt40 = trackPt*40.;
562 trackPtBin = floor(trackPt40);
564 ptRatio = nbinsPtRatio[trackPtBin];
566 // Printf("trackPt: %f trackPt40: %f trackPtBin: %i ptRatio: %.3f ",trackPt,trackPt40,trackPtBin,ptRatio);
568 random = fRandom3->Rndm();
569 // Printf("Random: %f \n",random);
571 if (random > ptRatio) continue;
572 // Printf("accepted random: %f \n",random);
574 } // -- End reject tracks according to ratio of pT distribution MC ESD / MC truth --
577 fPtSpec->Fill(trackPt);
578 tracks[nrTracks] = trackPt;
580 fEta->Fill(trackEta);
583 fEtaPhiPlus->Fill(trackPhi);
585 else if (trackEta < 0.) {
586 fEtaPhiMinus->Fill(trackPhi);
589 sumPt = sumPt + trackPt;
592 // Printf("Track Pt = %.3f Track Eta = %.3f Track Phi = %3f\n",trackPt,trackEta,trackPhi);
594 } // --- End stack track loop ---
596 // Printf("nrTracks MC truth: %i \n",nrTracks);
599 // MC, Type = MC truth with corresponding ESD
602 // --- Loop over all tracks of one MC event - MC ESD ---
603 for (Int_t jTracks = 0; jTracks < nrESDTracks; jTracks++) {
604 AliESDtrack* track = fESD->GetTrack(jTracks);
606 Printf("ERROR: Could not receive track %d\n", jTracks);
610 if(!fESDTrackCuts->AcceptTrack(track))continue;
612 trackPt2 = track->Pt();
613 fPtSpec2->Fill(trackPt2);
617 // Printf("Track Pt ESD = %.3f\n\n",trackPt2);
619 } // --- End ESD track loop ---
621 // Printf("nrTracks ESD: %i \n\n",nrTracks2);
623 } // End MC, Tpye = MC truth with corresponding ESD
625 } // End MC, Type = MC truth
632 // --- Loop over all tracks of one ESD event ---
633 for (Int_t iTracks = 0; iTracks < nrESDTracks; iTracks++) {
635 AliESDtrack* track = fESD->GetTrack(iTracks);
638 Printf("ERROR: Could not receive track %d\n", iTracks);
642 if(!fESDTrackCuts->AcceptTrack(track))continue;
644 trackPt = track->Pt();
645 fPtSpec->Fill(trackPt);
646 tracks[nrTracks] = trackPt;
648 trackEta = track->Eta();
649 fEta->Fill(trackEta);
651 trackPhi = track->Phi();
654 fEtaPhiPlus->Fill(trackPhi);
656 else if (trackEta < 0.) {
657 fEtaPhiMinus->Fill(trackPhi);
660 sumPt = sumPt + trackPt;
663 // Printf("Track Pt = %.3f Track Eta = %.3f Track Phi = %3f\n",trackPt,trackEta,trackPhi);
665 } // --- End track loop ---
670 // --- Calculation of various values and filling of histograms (for remaining events with N_acc > 0) ---
674 if (!fMC || fMCType < 3) {
676 // VtxZ after all track cuts
677 fVtxZTrackCuts->Fill(vtxZ);
679 // Differences between vertices after all cuts
680 fVtxZDiff1b->Fill(vtxZdiff1);
681 fVtxZDiff2b->Fill(vtxZdiff2);
682 fVtxZDiff3b->Fill(vtxZdiff3);
686 // Multiplicity distribution
687 fMult->Fill(nrTracks);
689 // // Number of pairs in event
690 // nrPairs = 0.5 * nrTracks * (nrTracks-1);
692 // Calculation of mean Pt and mean Pt Squared
693 eventMeanPt = sumPt / nrTracks;
694 eventMeanPtSq = eventMeanPt * eventMeanPt;
696 // Mean-Pt and Mean-Pt squared
697 fEventMeanPt->Fill(eventMeanPt);
698 fEventMeanPtSq->Fill(eventMeanPtSq);
699 fEventMeanPtMult->Fill(nrTracks,eventMeanPt);
701 // Mean-Pt and Mean-Pt squared depending on multiplicity
702 fMultEventMeanPt->Fill(nrTracks,eventMeanPt);
703 fMultEventMeanPtSq->Fill(nrTracks,eventMeanPtSq);
705 // Printf("nrTracks: %i sumPt: %.8f meanPt: %.8f meanPtSq: %.8f\n",nrTracks,sumPt,eventMeanPt,eventMeanPtSq);
708 // --- Two-particle correlator ---
710 evMptMult = nbins[nrTracks];
711 // Printf("nrTracks = %3i evMptMult = %.3f evMptSample = %.3f \n\n",nrTracks,evMptMult,evMptSample);
713 for (int i=0; i<nrTracks; i++) {
715 for (int j=i+1; j<nrTracks; j++) {
717 twoPartCorrPair = (tracks[i] - evMptMult) * (tracks[j] - evMptMult); // Multiplicity bins
718 twoPartCorrEv = twoPartCorrEv + twoPartCorrPair;
720 twoPartCorrPairSample = (tracks[i] - evMptSample) * (tracks[j] - evMptSample); // Whole sample
721 twoPartCorrEvSample = twoPartCorrEvSample + twoPartCorrPairSample;
727 twoPartCorrEvSq = twoPartCorrEv * twoPartCorrEv;
728 fTwoPartCorrEv->Fill(nrTracks,twoPartCorrEv);
729 fTwoPartCorrEvSq->Fill(nrTracks,twoPartCorrEvSq);
732 twoPartCorrEvSampleSq = twoPartCorrEvSample * twoPartCorrEvSample;
733 fTwoPartCorrEvSample->Fill(nrTracks,twoPartCorrEvSample);
734 fTwoPartCorrEvSampleSq->Fill(nrTracks,twoPartCorrEvSampleSq);
736 // --- End two-particle correlator ---
739 } // --- End calculation of various values and filling of histograms ---
743 PostData(1, fOutputList);
746 if (fRandom3) delete fRandom3; fRandom3 = 0;
750 void AliAnalysisTaskPtFluc::Terminate(Option_t *)
752 // Called once at the end of the query
754 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
756 Printf("ERROR: fOutputList not available\n");